Skip to content

Commit

Permalink
Merge pull request #29 from monich/service-denied
Browse files Browse the repository at this point in the history
[mms-lib] Only report status REFUSED for errors 225, 229 and 235
  • Loading branch information
Slava Monich committed Apr 22, 2014
2 parents bbb8ca2 + 0ab4a7c commit 2c9bb47
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 2 deletions.
10 changes: 9 additions & 1 deletion mms-lib/src/mms_task_send.c
Expand Up @@ -81,7 +81,15 @@ mms_task_send_done(
}
} else {
MMS_ERR("MMSC responded with %u", pdu->sc.rsp_status);
state = MMS_SEND_STATE_REFUSED;
switch (pdu->sc.rsp_status) {
case MMS_MESSAGE_RSP_STATUS_ERR_PERM_SERVICE_DENIED:
case MMS_MESSAGE_RSP_STATUS_ERR_PERM_LACK_OF_PREPAID:
case MMS_MESSAGE_RSP_STATUS_ERR_PERM_CONTENT_NOT_ACCEPTED:
state = MMS_SEND_STATE_REFUSED;
break;
default:
break;
}
}
} else {
MMS_ERR("Unexpected response from MMSC");
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
Binary file added mms-lib/test/send/data/ServiceDenied/0001.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mms-lib/test/send/data/ServiceDenied/m-send.conf
Binary file not shown.
1 change: 1 addition & 0 deletions mms-lib/test/send/data/ServiceDenied/test.txt
@@ -0,0 +1 @@
MMS Center rejection test
16 changes: 15 additions & 1 deletion mms-lib/test/send/test_send.c
Expand Up @@ -122,7 +122,7 @@ static const TestDesc send_tests[] = {
MMS_SEND_STATE_SENDING,
"TestMessageId"
},{
"Reject",
"ServiceDenied",
ATTACHMENTS(test_files_reject),
"Rejection test",
"+1234567890",
Expand All @@ -135,6 +135,20 @@ static const TestDesc send_tests[] = {
SOUP_STATUS_OK,
MMS_SEND_STATE_REFUSED,
NULL
},{
"Failure",
ATTACHMENTS(test_files_reject),
"Failure test",
"+1234567890",
NULL,
NULL,
NULL,
0,
"m-send.conf",
MMS_CONTENT_TYPE,
SOUP_STATUS_OK,
MMS_SEND_STATE_SEND_ERROR,
NULL
}
};

Expand Down

0 comments on commit 2c9bb47

Please sign in to comment.