summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-09-19 09:38:30 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-09-19 12:49:06 -0600
commit828a0611bceb1c17556e290aabc4d6c7abdbae3b (patch)
treef11451e20504d3107db4fb9c443df9916972dcdf
parent839c35adab090ebee8fd3e971623a20defc1231d (diff)
res_pjsip_pubsub: Check for Content-Type header in rx_notify_request
pubsub_on_rx_notify_request wasn't checking for a null Content-Type header before checking that it was application/simple-message-summary. ASTERISK-27279 Reported by: Ross Beer Change-Id: Iec2a6c4d2e74af37ff779ecc9fd35644c5c4ea52
-rw-r--r--res/res_pjsip_pubsub.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index ac074c776..6c6e2b6a5 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -3584,10 +3584,12 @@ error:
return PJ_TRUE;
}
+static pjsip_media_type simple_message_summary;
+
static pj_bool_t pubsub_on_rx_notify_request(pjsip_rx_data *rdata)
{
- if (pj_stricmp2(&rdata->msg_info.msg->body->content_type.type, "application") == 0 &&
- pj_stricmp2(&rdata->msg_info.msg->body->content_type.subtype, "simple-message-summary") == 0) {
+ if (rdata->msg_info.msg->body &&
+ pjsip_media_type_cmp(&rdata->msg_info.msg->body->content_type, &simple_message_summary, 0) == 0) {
return pubsub_on_rx_mwi_notify_request(rdata);
}
return PJ_FALSE;
@@ -5423,6 +5425,8 @@ static int load_module(void)
return AST_MODULE_LOAD_DECLINE;
}
+ pjsip_media_type_init2(&simple_message_summary, "application", "simple-message-summary");
+
if (ast_sched_start_thread(sched)) {
ast_log(LOG_ERROR, "Could not start scheduler thread for publication expiration\n");
ast_sched_context_destroy(sched);