From 83d1c989915f5f5d6840d375c4964ffbab01daa1 Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Tue, 28 Mar 2006 08:37:25 +0000 Subject: [PATCH] Further cleanups for MM7/Soap and mmsbox - better error reporting, better xml content --- mbuni/mmlib/mms_mm7soap.c | 2 +- mbuni/mmsbox/bearerbox.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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) : "",