diff --git a/mbuni/doc/examples/mmsc.conf b/mbuni/doc/examples/mmsc.conf index 8bc0faa..577a8be 100644 --- a/mbuni/doc/examples/mmsc.conf +++ b/mbuni/doc/examples/mmsc.conf @@ -33,6 +33,7 @@ mms-notify-text = "You have received a multimedia message from %S, go to XXX to mms-notify-unprovisioned-text = "This is a test" mms-to-email-txt = "This is a multimedia message (HTML suppressed)" mms-to-email-html = "This is a multimedia message powered by Digital Solutions" +mms-to-email-default-subject = "This is a multimedia message" mms-message-too-large-txt = "You have received a multimedia message from %S that is too large for your phone. Go to xxx to view it" sendmms-port = 10001 @@ -80,10 +81,7 @@ type = soap short-code = 111 vasp-username = newscorp vasp-password = news123 -vasp-url = http://localhost:23535/ -mmsc-username = user -mmsc-password = secret -mms-to-email-handler = true +vasp-url = http://mmsc:mms@localhost:23535/ mms-to-local-copy-handler = true group = mmsproxy diff --git a/mbuni/doc/userguide.shtml b/mbuni/doc/userguide.shtml index 4de2d64..4b68ddb 100644 --- a/mbuni/doc/userguide.shtml +++ b/mbuni/doc/userguide.shtml @@ -1526,6 +1526,25 @@ lists all the configuration directives. The column Mode     + + + mms-to-email-default-subject +     + + + MMSC +     + + + + String +     + + This string is used as the default message subject when sending + MMS to email in the event that no subject is defined in the message +     + + @@ -1597,14 +1616,7 @@ vasp-password = news123
vasp-url -= http://example.vasp.com:8080/mm7
-mmsc-username -= mymmsc
-mmsc-password -= mypass
- - -
+= http://mmsc1:pass@example.vasp.com:8080/mm7

@@ -1678,32 +1690,7 @@ mmsc-password String - Outgoing messages to the VASP are sent via this URL (using HTTP POST) - - - - - mmsc-username - - - String - - - Outgoing HTTP authentication: The username Mbuni must use when sending data - to the VASP - - - - - - mmsc-password - - - String - - - Outgoing HTTP authentication: password Mbuni must use when sending data - to the VASP + Outgoing messages to the VASP are sent via this URL (using HTTP POST) diff --git a/mbuni/mmlib/mms_cfg.def b/mbuni/mmlib/mms_cfg.def index abeec80..293b5fd 100644 --- a/mbuni/mmlib/mms_cfg.def +++ b/mbuni/mmlib/mms_cfg.def @@ -74,6 +74,7 @@ SINGLE_GROUP(mbuni, OCTSTR(mms-notify-unprovisioned-text) OCTSTR(mms-to-email-txt) OCTSTR(mms-to-email-html) + OCTSTR(mms-to-email-default-subject) OCTSTR(mms-message-too-large-txt) OCTSTR(mms-client-msisdn-header) OCTSTR(mms-client-ip-header) @@ -101,8 +102,6 @@ MULTI_GROUP(mms-vasp, OCTSTR(vasp-url) OCTSTR(mms-to-email-handler) OCTSTR(mms-to-local-copy-handler) - OCTSTR(mmsc-username) - OCTSTR(mmsc-password) ) MULTI_GROUP(send-mms-user, diff --git a/mbuni/mmsc/mmsc_cfg.c b/mbuni/mmsc/mmsc_cfg.c index d5c05be..778ddf3 100644 --- a/mbuni/mmsc/mmsc_cfg.c +++ b/mbuni/mmsc/mmsc_cfg.c @@ -203,6 +203,7 @@ MmscSettings *mms_load_mmsc_settings(mCfg *cfg, List **proxyrelays) m->mms_email_txt = _mms_cfg_getx(grp, octstr_imm("mms-to-email-txt")); m->mms_email_html = _mms_cfg_getx(grp, octstr_imm("mms-to-email-html")); + m->mms_email_subject = mms_cfg_get(grp, octstr_imm("mms-to-email-default-subject")); m->mms_toolarge = _mms_cfg_getx(grp, octstr_imm("mms-message-too-large-txt")); @@ -286,9 +287,6 @@ MmscSettings *mms_load_mmsc_settings(mCfg *cfg, List **proxyrelays) mv->vasp_password = _mms_cfg_getx(grp, octstr_imm("vasp-password")); mv->vasp_url = _mms_cfg_getx(grp, octstr_imm("vasp-url")); - - mv->mmsc_username = _mms_cfg_getx(grp, octstr_imm("mmsc-username")); - mv->mmsc_password = _mms_cfg_getx(grp, octstr_imm("mmsc-password")); s = _mms_cfg_getx(grp, octstr_imm("type")); @@ -407,7 +405,8 @@ Octstr *mms_find_sender_msisdn(Octstr *send_url, xip = ip ? octstr_duplicate(ip) : NULL; if (detokenizerfuncs && ((l && list_len(l) > 1) || xip)) phonenum = detokenizerfuncs->mms_detokenize((l && list_len(l) > 1) ? - list_get(l, list_len(l) - 1) : octstr_imm("x"), + list_get(l, list_len(l) - 1) : + send_url, xip); if (l) list_destroy(l, (list_item_destructor_t *)octstr_destroy); diff --git a/mbuni/mmsc/mmsc_cfg.h b/mbuni/mmsc/mmsc_cfg.h index 53cfd0b..faa7544 100644 --- a/mbuni/mmsc/mmsc_cfg.h +++ b/mbuni/mmsc/mmsc_cfg.h @@ -30,7 +30,6 @@ typedef struct MmsVasp { enum {SOAP_VASP, EAIF_VASP, NONE_VASP} type; Octstr *vasp_username, *vasp_password; Octstr *vasp_url; - Octstr *mmsc_username, *mmsc_password; } MmsVasp; typedef struct MmscSettings { @@ -87,6 +86,7 @@ typedef struct MmscSettings { Octstr *mms_email_txt; Octstr *mms_email_html; + Octstr *mms_email_subject; Octstr *wap_gw_msisdn_header; Octstr *wap_gw_ip_header; diff --git a/mbuni/mmsc/mmsglobalsender.c b/mbuni/mmsc/mmsglobalsender.c index 81a174e..06d35c1 100644 --- a/mbuni/mmsc/mmsglobalsender.c +++ b/mbuni/mmsc/mmsglobalsender.c @@ -154,7 +154,7 @@ static int sendMsg(MmsEnvelope *e) msg, &err); else res = mms_sendtoemail(e->from, to->rcpt, - e->subject, + e->subject ? e->subject : settings->mms_email_subject, e->msgId, msg, e->dlr, &err, sendmail_cmd, settings->hostname, 1, 1, octstr_get_cstr(settings->mms_email_txt), @@ -477,7 +477,9 @@ static int mms_sendtoproxy(Octstr *from, Octstr *to, pto = octstr_format("%S@%S", to, proxy); - x = mms_sendtoemail(from, pto, subject, msgid, msg, 0, + x = mms_sendtoemail(from, pto, + subject ? subject : settings->mms_email_subject, + msgid, msg, 0, error, sendmail_cmd, settings->hostname, 0, 0,NULL,NULL,0); @@ -530,11 +532,7 @@ static int mm7soap_send(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgId, *error = octstr_format("Failed to convert SOAP message 2 HTTP Msg!"); goto done1; } - - if (vasp->mmsc_username) - http_add_basic_auth(rh, vasp->mmsc_username, - vasp->mmsc_password ? vasp->mmsc_password : octstr_imm("")); - + http_start_request(caller, HTTP_METHOD_POST, vasp->vasp_url, rh, body, 1, NULL, NULL); if ((xx = http_receive_result(caller, &hstatus, &url, &ph, &rbody)) == NULL || @@ -632,10 +630,6 @@ static int mm7eaif_send(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgid, http_header_add(rh, "X-NOKIA-MMSC-Message-Type", msgtype); http_header_add(rh, "Content-Type", "application/vnd.wap.mms-message"); - if (vasp->mmsc_username) - http_add_basic_auth(rh, vasp->mmsc_username, - vasp->mmsc_password ? vasp->mmsc_password : octstr_imm("")); - body = mms_tobinary(m); http_start_request(caller, HTTP_METHOD_POST, vasp->vasp_url, rh, body, 1, NULL, NULL); diff --git a/mbuni/mmsc/mmsproxy.c b/mbuni/mmsc/mmsproxy.c index c66dde1..295835e 100644 --- a/mbuni/mmsc/mmsproxy.c +++ b/mbuni/mmsc/mmsproxy.c @@ -481,7 +481,7 @@ static void sendmms_proxy(MmsHTTPClientInfo *h) List *mh = mms_message_headers(m); Octstr *from = h->client_addr ? octstr_duplicate(h->client_addr) : NULL; List *to = list_create(); - Octstr *subject; + Octstr *subject = NULL; time_t expiryt, deliveryt; Octstr *otransid = NULL, *value = NULL, *msgid = NULL;