diff --git a/mbuni/doc/userguide.shtml b/mbuni/doc/userguide.shtml index aea38a5..9ef93ca 100644 --- a/mbuni/doc/userguide.shtml +++ b/mbuni/doc/userguide.shtml @@ -744,14 +744,17 @@ lists all the configuration directives. The column Mode string     - Short form of - hostname. This is used in generating message IDs. It is also used to - generate the message retrieval URL (sent as part of the MMS + Short MMC + hostname. This is used in generating message IDs as well as the + message retrieval URL (sent as part of the MMS notification): For instance if you have this as mmsc then the retrieval URL will have the form http://mmsc/msgtoken (no port is added). Be sure to - keep this value short as some handsets do not like long URLs in MMS - notifications. If you do not supply a host alias, the gateway will create a long form URL (http://hostname:port/msgtoken) when it sends notifications + keep this value short (as some handsets do not like long URLs in MMS + notifications), and it must not include non-alphanumeric characters + as this can screw up URL location parsing. If you do not supply a + host alias, the gateway will create a long form URL + (http://hostname:port/msgtoken) when it sends notifications     diff --git a/mbuni/mmlib/mms_util.c b/mbuni/mmlib/mms_util.c index fed3483..69fe9af 100644 --- a/mbuni/mmlib/mms_util.c +++ b/mbuni/mmlib/mms_util.c @@ -210,10 +210,8 @@ Octstr *mms_maketransid(char *qf, Octstr *mmscname) time(NULL), (++ct % 10000), getpid()%1000, random()%1000); else x = octstr_create(qf); - - y = md5digest(mmscname); - - res = octstr_format("%S@%.5s", x, octstr_get_cstr(y)); + + res = octstr_format("%S@%S", mmscname, x); octstr_destroy(x); octstr_destroy(y); @@ -229,7 +227,7 @@ extern Octstr *mms_getqf_fromtransid(Octstr *transid) return NULL; i = octstr_search_char(transid, '@', 0); - return (i >= 0) ? octstr_copy(transid, 0, i) : octstr_duplicate(transid); + return (i >= 0) ? octstr_copy(transid, i+1, octstr_len(transid)) : octstr_duplicate(transid); } Octstr *mms_isodate(time_t t) diff --git a/mbuni/mmsc/mms_resolve_shell.c b/mbuni/mmsc/mms_resolve_shell.c index 781a93f..c472fad 100644 --- a/mbuni/mmsc/mms_resolve_shell.c +++ b/mbuni/mmsc/mms_resolve_shell.c @@ -46,6 +46,11 @@ static Octstr *mms_resolve(Octstr * phonenum, void *module_data, void *settings_ octstr_strip_crlfs(s); pclose(fp); + + if (octstr_len(s) == 0) { + octstr_destroy(s); + return NULL; + } return s; } diff --git a/mbuni/mmsc/mmsglobalsender.c b/mbuni/mmsc/mmsglobalsender.c index b219d68..5636f13 100644 --- a/mbuni/mmsc/mmsglobalsender.c +++ b/mbuni/mmsc/mmsglobalsender.c @@ -236,6 +236,7 @@ static int sendMsg(MmsEnvelope *e) break; } } + octstr_destroy(mmsc); } else /* Search VASP list, see what you can find... */ for (j = 0, m = list_len(settings->vasp_list); j < m; j++) if ((vasp = list_get(settings->vasp_list, j)) != NULL && @@ -259,7 +260,7 @@ static int sendMsg(MmsEnvelope *e) if (res == MMS_SEND_OK) to->process = 0; else { /* If there was a report request, queue it. */ - + if (e->dlr) { Octstr *qfs; MmsMsg *m = mms_deliveryreport(e->msgId, to->rcpt, tnow, diff --git a/mbuni/mmsc/mmsproxy.c b/mbuni/mmsc/mmsproxy.c index e288edf..4a3d062 100644 --- a/mbuni/mmsc/mmsproxy.c +++ b/mbuni/mmsc/mmsproxy.c @@ -1591,7 +1591,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h) switch (mm7_msgtype(mreq)) { case MM7_TAG_SubmitReq: mm7_get_envelope(mreq, &from, &to, &subject, &vasid, &expiryt, &delivert); - m = mm7_soap_to_mmsmsg(mreq, sender); + m = mm7_soap_to_mmsmsg(mreq, from ? from : sender); if (m) { Octstr *value = NULL; int dlr; @@ -1618,7 +1618,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h) octstr_get_cstr(settings->global_queuedir), settings->host_alias); msgid = mms_maketransid(octstr_get_cstr(qf), settings->host_alias); - mms_log("Received", sender, to, -1, msgid, h->vasp->id, NULL, "MM7", + mms_log("Received", from ? from : sender, to, -1, msgid, h->vasp->id, NULL, "MM7", h->ua, NULL); if (value) octstr_destroy(value);