Commit 0ab4a7c3 authored by Slava Monich's avatar Slava Monich

[mms-lib] Only report status REFUSED for errors 225, 229 and 235

Error 225 is actually pretty common (use of secondary SIM, roaming service
denied and so on). It usually means some sort of restriction imposed by the
operator and not. The status REFUSED should be represented in the UI with a
string like "Service denied" or "Rejected by the operator".
parent 12fc2ed9
......@@ -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");
......
......@@ -122,7 +122,7 @@ static const TestDesc send_tests[] = {
MMS_SEND_STATE_SENDING,
"TestMessageId"
},{
"Reject",
"ServiceDenied",
ATTACHMENTS(test_files_reject),
"Rejection test",
"+1234567890",
......@@ -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
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment