diff --git a/mbuni/mmlib/mms_util.c b/mbuni/mmlib/mms_util.c index 1a80ae8..6aed2ff 100644 --- a/mbuni/mmlib/mms_util.c +++ b/mbuni/mmlib/mms_util.c @@ -170,7 +170,10 @@ Octstr *mms_make_msgid(char *qf, Octstr *mmscname) else x = octstr_create(qf); - res = octstr_format("%S@%S", x,mmscname); + if (mmscname) + res = octstr_format("%S@%S", x,mmscname); + else + res = octstr_duplicate(x); octstr_destroy(x); octstr_destroy(y); diff --git a/mbuni/mmsbox/bearerbox.c b/mbuni/mmsbox/bearerbox.c index beb2d77..aa41aad 100644 --- a/mbuni/mmsbox/bearerbox.c +++ b/mbuni/mmsbox/bearerbox.c @@ -219,8 +219,8 @@ static int mm7soap_receive(MmsBoxHTTPClientInfo *h) dlr, octstr_get_cstr(qdir), "MM7/SOAP-IN", - octstr_imm(MM_NAME)); - msgid = mms_make_msgid(octstr_get_cstr(qf), octstr_imm(MM_NAME)); + NULL); + msgid = mms_make_msgid(octstr_get_cstr(qf), NULL); mms_log("Received", from, to, -1, msgid, NULL, h->m->id, "MMSBox", h->ua, NULL); octstr_destroy(linkedid); @@ -249,7 +249,7 @@ static int mm7soap_receive(MmsBoxHTTPClientInfo *h) 0, octstr_get_cstr(qdir), "MM7/SOAP-IN", - octstr_imm(MM_NAME)); + NULL); else qf = NULL; if (qf) @@ -291,7 +291,7 @@ static int mm7soap_receive(MmsBoxHTTPClientInfo *h) 0, octstr_get_cstr(qdir), "MM7/SOAP-IN", - octstr_imm(MM_NAME)); + NULL); else qf = NULL; if (qf) @@ -462,7 +462,7 @@ static int mm7eaif_receive(MmsBoxHTTPClientInfo *h) dlr, octstr_get_cstr(qdir), "MM7/EAIF-IN", - octstr_imm(MM_NAME)); + NULL); if (qf) { /* Log to access log */ @@ -483,7 +483,7 @@ static int mm7eaif_receive(MmsBoxHTTPClientInfo *h) 0, octstr_get_cstr(qdir), "MM7/EAIF-IN", - octstr_imm(MM_NAME)); + NULL); if (qf) { /* Log to access log */ mms_log("Received DLR", hfrom, to, -1, NULL, NULL, h->m->id, "MMSBox", h->ua, NULL); @@ -513,7 +513,7 @@ static int mm7eaif_receive(MmsBoxHTTPClientInfo *h) 0, octstr_get_cstr(qdir), "MM7/EAIF-IN", - octstr_imm(MM_NAME)); + NULL); if (qf) { /* Log to access log */ mms_log("Received RR", hfrom, to, -1, NULL, NULL, h->m->id, "MMSBox", h->ua, NULL); @@ -671,7 +671,7 @@ static int mm7http_receive(MmsBoxHTTPClientInfo *h) dlr, octstr_get_cstr(qdir), "MM7/HTTP-IN", - octstr_imm(MM_NAME)); + NULL); if (qf) { /* Log to access log */ @@ -692,7 +692,7 @@ static int mm7http_receive(MmsBoxHTTPClientInfo *h) 0, octstr_get_cstr(qdir), "MM7/HTTP-IN", - octstr_imm(MM_NAME)); + NULL); if (qf) { /* Log to access log */ mms_log("Received DLR", hfrom, to, -1, NULL, NULL, h->m->id, "MMSBox", h->ua, NULL); @@ -723,7 +723,7 @@ static int mm7http_receive(MmsBoxHTTPClientInfo *h) 0, octstr_get_cstr(qdir), "MM7/HTTP-IN", - octstr_imm(MM_NAME)); + NULL); if (qf) { /* Log to access log */ mms_log("Received RR", hfrom, to, -1, NULL, NULL, h->m->id, "MMSBox", h->ua, NULL); diff --git a/mbuni/mmsbox/mmsbox.c b/mbuni/mmsbox/mmsbox.c index ab33a9f..1a1e38f 100644 --- a/mbuni/mmsbox/mmsbox.c +++ b/mbuni/mmsbox/mmsbox.c @@ -1133,17 +1133,17 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers, /* Write to queue. */ x = qfs->mms_queue_add(from, xto, subject, - e ? e->fromproxy : NULL, - mmc, - time(NULL), expiryt, m, NULL, - xservice_code, /* Send service code as vasp id XXX - not very nice, but */ - svc_name, - dlr_url, rr_url, - hdrs, - (dlr_url != NULL), - octstr_get_cstr(qdir), + e ? e->fromproxy : NULL, + mmc, + time(NULL), expiryt, m, NULL, + xservice_code, /* Send service code as vasp id XXX - not very nice, but */ + svc_name, + dlr_url, rr_url, + hdrs, + (dlr_url != NULL), + octstr_get_cstr(qdir), "MMSBox", - octstr_imm(MM_NAME)); + NULL); mms_info(2, "mmsbox", NULL,"MMSBox: Queued message from service [%s], [transid [%s]: %s", octstr_get_cstr(svc_name), otransid ? octstr_get_cstr(otransid) : "", diff --git a/mbuni/mmsbox/mmsbox_resolve_shell.c b/mbuni/mmsbox/mmsbox_resolve_shell.c index f5a4684..195c47e 100644 --- a/mbuni/mmsbox/mmsbox_resolve_shell.c +++ b/mbuni/mmsbox/mmsbox_resolve_shell.c @@ -42,15 +42,18 @@ static Octstr *_shell_resolve(Octstr *pfrom, Octstr *pto, char *in_mmc, void *mo s = octstr_format("%s '%s' '%s' '%s'", octstr_get_cstr(script), octstr_get_cstr(pfrom), octstr_get_cstr(pto), in_mmc); + + mms_info(0, "mmsbox", NULL, "Preparing to call resolver as: %s", octstr_get_cstr(s)); fp = popen(octstr_get_cstr(s), "r"); octstr_destroy(s); - fgets(buf, 4096, fp); + fgets(buf, sizeof buf, fp); s = octstr_create(buf); octstr_strip_crlfs(s); pclose(fp); - + + mms_info(0, "mmsbox", NULL, "Resolver returned: %s", octstr_get_cstr(s)); if (octstr_len(s) == 0) { octstr_destroy(s); return NULL;