minor bug fixes: mm4 interface message parsing
This commit is contained in:
parent
483c6d658d
commit
4eb54ddffa
|
@ -1778,3 +1778,14 @@ Octstr *extract_phonenum(Octstr *num, Octstr *unified_prefix)
|
||||||
return phonenum;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -205,6 +205,9 @@ void strip_non_essential_headers(MIMEEntity *mime);
|
||||||
/* Get phone number out of mms formatted one, and unify. */
|
/* Get phone number out of mms formatted one, and unify. */
|
||||||
Octstr *extract_phonenum(Octstr *num, Octstr *unified_prefix);
|
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. */
|
/* load a shared object, then load a symbol from it. */
|
||||||
void *_mms_load_module(mCfgGrp *grp, char *config_key, char *symbolname,
|
void *_mms_load_module(mCfgGrp *grp, char *config_key, char *symbolname,
|
||||||
void *shell_builtin);
|
void *shell_builtin);
|
||||||
|
|
|
@ -52,6 +52,8 @@ static void strip_quotes(Octstr *s);
|
||||||
|
|
||||||
static mCfg *cfg;
|
static mCfg *cfg;
|
||||||
static List *proxyrelays;
|
static List *proxyrelays;
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
MIMEEntity *mm;
|
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)
|
if ((msgid = http_header_value(headers, octstr_imm("X-Mms-Message-ID"))) == NULL)
|
||||||
msgid = http_header_value(headers, octstr_imm("Message-ID"));
|
msgid = http_header_value(headers, octstr_imm("Message-ID"));
|
||||||
|
|
||||||
if (msgid)
|
strip_quoted_string(msgid);
|
||||||
octstr_strip_blanks(msgid);
|
strip_quoted_string(transid);
|
||||||
if (transid)
|
|
||||||
octstr_strip_blanks(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 */
|
/* ... and remove non-essential ones */
|
||||||
http_header_remove_all(headers, "X-Mms-3GPP-MMS-Version");
|
http_header_remove_all(headers, "X-Mms-3GPP-MMS-Version");
|
||||||
http_header_remove_all(headers, "MIME-Version");
|
http_header_remove_all(headers, "MIME-Version");
|
||||||
|
@ -362,7 +369,7 @@ int main(int argc, char *argv[])
|
||||||
} else
|
} else
|
||||||
err = "Error-network-problem";
|
err = "Error-network-problem";
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case MM4_FORWARD_RES:
|
case MM4_FORWARD_RES:
|
||||||
case MM4_READ_REPLY_REPORT_RES:
|
case MM4_READ_REPLY_REPORT_RES:
|
||||||
case MM4_DELIVERY_REPORT_RES: /* remove corresponding queue entry. */
|
case MM4_DELIVERY_REPORT_RES: /* remove corresponding queue entry. */
|
||||||
|
|
Loading…
Reference in New Issue