minor improvements to mm7 sender in mmsbox
This commit is contained in:
parent
098ffba5cf
commit
7eec5761a1
|
@ -922,6 +922,8 @@ MmsMsg *mm7_soap_to_mmsmsg(MSoapMsg_t *m, Octstr *from)
|
|||
|
||||
void mm7_soap_destroy(MSoapMsg_t *m)
|
||||
{
|
||||
if (m == NULL) return;
|
||||
|
||||
http_destroy_headers(m->envelope);
|
||||
if (m->msg)
|
||||
mime_entity_destroy(m->msg);
|
||||
|
|
|
@ -619,45 +619,37 @@ static Octstr *mm7soap_send(MmscGrp *mmc, Octstr *from, Octstr *to,
|
|||
if (!MM7_SOAP_STATUS_OK(tstatus) && tstatus != MM7_SOAP_COMMAND_REJECTED) {
|
||||
Octstr *detail = mm7_soap_header_value(mresp, octstr_imm("Details"));
|
||||
if (detail == NULL)
|
||||
mm7_soap_header_value(mresp, octstr_imm("faultcode"));
|
||||
detail = 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) : "",
|
||||
tstatus, mms_soap_status_to_cstr(tstatus),
|
||||
detail ? octstr_get_cstr(detail) : "");
|
||||
detail ? octstr_get_cstr(detail) : "(empty)");
|
||||
|
||||
*error = octstr_format("Failed to deliver to MMC[url=%s, id=%s], status=[%d=>%s]!",
|
||||
octstr_get_cstr(mmc->mmsc_url),
|
||||
octstr_get_cstr(mmc->id),
|
||||
tstatus,
|
||||
mms_soap_status_to_cstr(tstatus));
|
||||
|
||||
if (detail)
|
||||
octstr_destroy(detail);
|
||||
|
||||
} else
|
||||
ret = mm7_soap_header_value(mresp, octstr_imm("MessageID"));
|
||||
|
||||
info(0, "Sent to MMC[%s], code=[%d=>%s], msgid=[%s]", octstr_get_cstr(mmc->id),
|
||||
tstatus, mms_soap_status_to_cstr(tstatus), ret ? octstr_get_cstr(ret) : "(none)");
|
||||
|
||||
octstr_destroy(detail);
|
||||
} else {
|
||||
ret = mm7_soap_header_value(mresp, octstr_imm("MessageID"));
|
||||
info(0, "Sent to MMC[%s], code=[%d=>%s], msgid=[%s]", octstr_get_cstr(mmc->id),
|
||||
tstatus, mms_soap_status_to_cstr(tstatus), ret ? octstr_get_cstr(ret) : "(none)");
|
||||
}
|
||||
|
||||
if (ret)
|
||||
mms_log2("Sent", from, to, -1, ret, NULL, mmc->id, "MMSBox", NULL, NULL);
|
||||
done1:
|
||||
|
||||
if (mreq)
|
||||
mm7_soap_destroy(mreq);
|
||||
if (mresp)
|
||||
mm7_soap_destroy(mresp);
|
||||
if (rh)
|
||||
http_destroy_headers(rh);
|
||||
if (body)
|
||||
octstr_destroy(body);
|
||||
if (ph)
|
||||
http_destroy_headers(ph);
|
||||
if (rbody)
|
||||
octstr_destroy(rbody);
|
||||
if (url)
|
||||
octstr_destroy(url);
|
||||
|
||||
mm7_soap_destroy(mreq);
|
||||
mm7_soap_destroy(mresp);
|
||||
http_destroy_headers(rh);
|
||||
octstr_destroy(body);
|
||||
http_destroy_headers(ph);
|
||||
octstr_destroy(rbody);
|
||||
octstr_destroy(url);
|
||||
|
||||
gwlist_destroy(xto, NULL);
|
||||
|
||||
|
|
|
@ -603,11 +603,17 @@ static void fixup_addresses(List *headers)
|
|||
|
||||
static void send_mm4_res(int mtype, Octstr *to, Octstr *sender, Octstr *transid, char *status, Octstr *msgid)
|
||||
{
|
||||
char tmp[32];
|
||||
List *h = http_create_empty_headers();
|
||||
MIMEEntity *m = mime_entity_create();
|
||||
Octstr *err = NULL;
|
||||
/* Make headers */
|
||||
http_header_add(h, "X-Mms-3GPP-MMS-Version", MMS_3GPP_VERSION);
|
||||
sprintf(tmp, "%d.%d.%d",
|
||||
MAJOR_VERSION(MMS_3GPP_VERSION),
|
||||
MINOR1_VERSION(MMS_3GPP_VERSION),
|
||||
MINOR2_VERSION(MMS_3GPP_VERSION));
|
||||
|
||||
http_header_add(h, "X-Mms-3GPP-MMS-Version", tmp);
|
||||
http_header_add(h, "X-Mms-Transaction-ID", octstr_get_cstr(transid));
|
||||
http_header_add(h, "X-Mms-Message-Type", mm4_types[mtype].mm4str);
|
||||
if (msgid)
|
||||
|
|
Loading…
Reference in New Issue