[asterisk-commits] mmichelson: branch mmichelson/pub_sub r385741 - /team/mmichelson/pub_sub/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 15 11:36:10 CDT 2013


Author: mmichelson
Date: Mon Apr 15 11:36:06 2013
New Revision: 385741

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385741
Log:
Fix a couple more bugs in unsolicited MWI

* Don't try to grab the serializer from the SIP subscription since the SIP subscription does not exist
* Add Event header to outgoing NOTIFY requests.


Modified:
    team/mmichelson/pub_sub/res/res_sip_mwi.c

Modified: team/mmichelson/pub_sub/res/res_sip_mwi.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pub_sub/res/res_sip_mwi.c?view=diff&rev=385741&r1=385740&r2=385741
==============================================================================
--- team/mmichelson/pub_sub/res/res_sip_mwi.c (original)
+++ team/mmichelson/pub_sub/res/res_sip_mwi.c Mon Apr 15 11:36:06 2013
@@ -220,6 +220,7 @@
 	const char *state_name;
 	pjsip_msg_body *msg_body;
 	pjsip_sub_state_hdr *sub_state;
+	pjsip_event_hdr *event;
 	pjsip_tx_data *tdata;
 	const pjsip_hdr *allow_events = pjsip_evsub_get_allow_events_hdr(NULL);
 	if (!endpoint) {
@@ -240,12 +241,18 @@
 		state_name = "terminated";
 		break;
 	}
+
 	sub_state = pjsip_sub_state_hdr_create(tdata->pool);
 	pj_cstr(&sub_state->sub_state, state_name);
 	if (reason) {
 		pj_cstr(&sub_state->reason_param, reason);
 	}
 	pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *) sub_state);
+
+	event = pjsip_event_hdr_create(tdata->pool);
+	pj_cstr(&event->event_type, "message-summary");
+	pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *) event);
+
 	pjsip_msg_add_hdr(tdata->msg, pjsip_hdr_shallow_clone(tdata->pool, allow_events));
 	msg_body = pjsip_msg_body_create(tdata->pool, &mwi_type->type, &mwi_type->subtype, body_text);
 	tdata->msg->body = msg_body;
@@ -452,7 +459,7 @@
 	}
 
 	if (stasis_mwi_state_type() == stasis_message_type(msg)) {
-		struct ast_taskprocessor *serializer = ast_sip_subscription_get_serializer(mwi_sub->sip_sub);
+		struct ast_taskprocessor *serializer = mwi_sub->is_solicited ? ast_sip_subscription_get_serializer(mwi_sub->sip_sub) : NULL;
 		ast_sip_push_task(serializer, serialized_notify, mwi_sub);
 	}
 }




More information about the asterisk-commits mailing list