diff --git a/mbuni/mmlib/mms_mm7soap.c b/mbuni/mmlib/mms_mm7soap.c index 0c3e5bc..6e08874 100644 --- a/mbuni/mmlib/mms_mm7soap.c +++ b/mbuni/mmlib/mms_mm7soap.c @@ -359,7 +359,7 @@ static void output_rcpt(char *hdr, List *hdrs, Octstr *p) /* Construct by hand. */ Octstr *headers_to_soapxml(List *hdrs) { - Octstr *s = octstr_create("\n"); + Octstr *s = octstr_create("\n"); Octstr *p, *q, *r, *fault, *mtype; int i, n; time_t t; diff --git a/mbuni/mmsbox/bearerbox.c b/mbuni/mmsbox/bearerbox.c index c01f891..fc4f690 100644 --- a/mbuni/mmsbox/bearerbox.c +++ b/mbuni/mmsbox/bearerbox.c @@ -560,11 +560,16 @@ static Octstr *mm7soap_send(MmscGrp *mmc, Octstr *from, Octstr *to, if ((s = mm7_soap_header_value(mresp, octstr_imm("StatusCode"))) != NULL) { tstatus = atoi(octstr_get_cstr(s)); octstr_destroy(s); - } else + } else if ((s = mm7_soap_header_value(mresp, octstr_imm("faultstring"))) != NULL) { + tstatus = atoi(octstr_get_cstr(s)); + octstr_destroy(s); + } else tstatus = MM7_SOAP_FORMAT_CORRUPT; if (!MM7_SOAP_STATUS_OK(tstatus)) { Octstr *detail = mm7_soap_header_value(mresp, octstr_imm("Details")); + if (detail == NULL) + mm7_soap_header_value(mresp, octstr_imm("faultcode")); ret = NULL; info(0, "Send to MMSC[%s], failed, code=[%d=>%s], detail=%s", mmc ? octstr_get_cstr(mmc->id) : "",