diff --git a/mbuni/mmlib/mms_util.c b/mbuni/mmlib/mms_util.c index 64d4990..bc21c13 100644 --- a/mbuni/mmlib/mms_util.c +++ b/mbuni/mmlib/mms_util.c @@ -1778,3 +1778,14 @@ Octstr *extract_phonenum(Octstr *num, Octstr *unified_prefix) return phonenum; } + +void strip_quoted_string(Octstr *s) +{ + if (s == NULL) return; + + octstr_strip_blanks(s); + if (octstr_get_char(s, 0) == '"') { + octstr_delete(s, 0, 1); + octstr_delete(s, octstr_len(s)-1, 1); + } +} diff --git a/mbuni/mmlib/mms_util.h b/mbuni/mmlib/mms_util.h index 49bb6a4..94e6aa4 100644 --- a/mbuni/mmlib/mms_util.h +++ b/mbuni/mmlib/mms_util.h @@ -205,6 +205,9 @@ void strip_non_essential_headers(MIMEEntity *mime); /* Get phone number out of mms formatted one, and unify. */ Octstr *extract_phonenum(Octstr *num, Octstr *unified_prefix); +/* strip quotes off a quoted string. */ +void strip_quoted_string(Octstr *s); + /* load a shared object, then load a symbol from it. */ void *_mms_load_module(mCfgGrp *grp, char *config_key, char *symbolname, void *shell_builtin); diff --git a/mbuni/mmsc/mmsfromemail.c b/mbuni/mmsc/mmsfromemail.c index a9d1786..aea6fe9 100644 --- a/mbuni/mmsc/mmsfromemail.c +++ b/mbuni/mmsc/mmsfromemail.c @@ -52,6 +52,8 @@ static void strip_quotes(Octstr *s); static mCfg *cfg; static List *proxyrelays; + + int main(int argc, char *argv[]) { MIMEEntity *mm; @@ -183,11 +185,16 @@ int main(int argc, char *argv[]) if ((msgid = http_header_value(headers, octstr_imm("X-Mms-Message-ID"))) == NULL) msgid = http_header_value(headers, octstr_imm("Message-ID")); - if (msgid) - octstr_strip_blanks(msgid); - if (transid) - octstr_strip_blanks(transid); + strip_quoted_string(msgid); + strip_quoted_string(transid); + + info(0, "MM4 interface Received [message type: %s] [transaction id: %s] [origin: %s] [msgid: %s]", + mm4_type ? octstr_get_cstr(mm4_type) : "", + transid ? octstr_get_cstr(transid) : "", + orig_sys ? octstr_get_cstr(orig_sys) : "", + msgid ? octstr_get_cstr(msgid) : ""); + /* ... and remove non-essential ones */ http_header_remove_all(headers, "X-Mms-3GPP-MMS-Version"); http_header_remove_all(headers, "MIME-Version"); @@ -362,7 +369,7 @@ int main(int argc, char *argv[]) } else err = "Error-network-problem"; } - + break; case MM4_FORWARD_RES: case MM4_READ_REPLY_REPORT_RES: case MM4_DELIVERY_REPORT_RES: /* remove corresponding queue entry. */