From ef53251db31e4aebf0818ad5792c2dd81f6f6de0 Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Wed, 12 Apr 2006 06:52:54 +0000 Subject: [PATCH] - More mmsbox fixes to please Ericsson MMC - Added 'vasid' send-mms URL parameter --- mbuni/doc/userguide.shtml | 10 ++++++++++ mbuni/mmlib/mms_mm7soap.c | 14 ++++---------- mbuni/mmlib/mms_queue.c | 2 +- mbuni/mmsbox/mmsbox.c | 11 +++++++---- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/mbuni/doc/userguide.shtml b/mbuni/doc/userguide.shtml index 8af76ca..aea38a5 100644 --- a/mbuni/doc/userguide.shtml +++ b/mbuni/doc/userguide.shtml @@ -2349,6 +2349,16 @@ faked-sender = 100
+ + + vasid + + + This will be passed on the MMC as the VASID parameter in the + MM7/SOAP message. If not provided, defaults to sendmms-user + + +

diff --git a/mbuni/mmlib/mms_mm7soap.c b/mbuni/mmlib/mms_mm7soap.c index 4f19a07..17b27ca 100644 --- a/mbuni/mmlib/mms_mm7soap.c +++ b/mbuni/mmlib/mms_mm7soap.c @@ -594,7 +594,7 @@ int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, List **hdrs, Octstr **body) http_header_remove_all(c->headers, "Content-ID"); http_header_add(c->headers, "Content-ID", octstr_get_cstr(cloc_str)); - http_header_add(xml->headers, "Content-Type", "text/xml"); + http_header_add(xml->headers, "Content-Type", "\"text/xml\""); http_header_add(xml->headers, "Content-ID", octstr_get_cstr(envloc)); xml->body = headers_to_soapxml(hh); @@ -603,20 +603,14 @@ int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, List **hdrs, Octstr **body) http_destroy_headers(hh); - ctype = octstr_format("multipart/related" - - "; start=\"%S\"" -#if 1 - "; type=text/xml" -#endif -, + ctype = octstr_format("multipart/related; type=\"text/xml\"; start=\"%S\"", envloc); octstr_destroy(envloc); octstr_destroy(cloc); octstr_destroy(cloc_str); } else { - ctype = octstr_imm("text/xml"); + ctype = octstr_imm("\"text/xml\""); mime->body = headers_to_soapxml(m->envelope); } @@ -909,7 +903,7 @@ MSoapMsg_t *mm7_mmsmsg_to_soap(MmsMsg *msg, Octstr *from, List *xto, if (vaspid) http_header_add(m->envelope, "VASPID", vaspid); if (vasid) - http_header_add(m->envelope, "VASID", vaspid); + http_header_add(m->envelope, "VASID", vasid); if ((s = mms_get_header_value(msg, octstr_imm("X-Mms-Message-Class"))) != NULL) { http_header_add(m->envelope, "MessageClass", octstr_get_cstr(s)); diff --git a/mbuni/mmlib/mms_queue.c b/mbuni/mmlib/mms_queue.c index 92fb03e..266af83 100644 --- a/mbuni/mmlib/mms_queue.c +++ b/mbuni/mmlib/mms_queue.c @@ -87,7 +87,7 @@ static int free_envelope(MmsEnvelope *e, int removefromqueue); * b - billed amount. * r - whether delivery receipts are required or not. * M - Application specific data (string) - * V - VASID -- from VASP + * V - VASPID -- from VASP * v - vasid -- from VASP * U - url1 -- e.g. for delivery report * u - url2 -- e.g. for read report diff --git a/mbuni/mmsbox/mmsbox.c b/mbuni/mmsbox/mmsbox.c index ca71aa5..c2ca692 100644 --- a/mbuni/mmsbox/mmsbox.c +++ b/mbuni/mmsbox/mmsbox.c @@ -893,8 +893,7 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers, goto done; } } else { /* all others, make the message as-is and hope for the best! */ - http_header_add(me->headers, "Content-Type", octstr_get_cstr(ctype)); - + http_header_add(me->headers, "Content-Type", octstr_get_cstr(ctype)); me->body = octstr_duplicate(data); } @@ -1047,7 +1046,8 @@ static void sendmms_func(void *unused) List *lto = NULL, *rh = http_create_empty_headers(); Octstr *rb = NULL, *base_url = octstr_imm("http://localhost"); int i, n, res = 0; - + Octstr *vasid = http_cgi_variable(cgivars, "vasid"); + if ((data = http_cgi_variable(cgivars, "text")) != NULL) { /* text. */ Octstr *charset = http_cgi_variable(cgivars, "charset"); @@ -1105,7 +1105,8 @@ static void sendmms_func(void *unused) /* Requests to make_and_queue below can block, but for now we don't care. */ if (ctype && data && !rb) { /* only send if no error. */ res = make_and_queue_msg(data, ctype, rh, base_url, URL_TYPE, NULL, - octstr_imm("sendmms-user"), u->faked_sender, + vasid ? vasid : octstr_imm("sendmms-user"), + u->faked_sender, 1, &err); http_destroy_headers(rh); if (res < 0) @@ -1122,6 +1123,8 @@ static void sendmms_func(void *unused) octstr_destroy(base_url); if (ctype) octstr_destroy(ctype); + if (vasid) + octstr_destroy(vasid); } else { http_send_reply(client, HTTP_UNAUTHORIZED, hh, octstr_imm("Authentication failed"));