[asterisk-commits] mmichelson: branch mmichelson/pub_sub r385719 - in /team/mmichelson/pub_sub/r...

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


Author: mmichelson
Date: Mon Apr 15 11:16:55 2013
New Revision: 385719

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385719
Log:
Fix some bugs with solicited MWI.

* Register the AOR option "mailboxes"
* Be sure to pass along the SUBSCRIBE request when creating the subscription.


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

Modified: team/mmichelson/pub_sub/res/res_sip/location.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pub_sub/res/res_sip/location.c?view=diff&rev=385719&r1=385718&r2=385719
==============================================================================
--- team/mmichelson/pub_sub/res/res_sip/location.c (original)
+++ team/mmichelson/pub_sub/res/res_sip/location.c Mon Apr 15 11:16:55 2013
@@ -256,6 +256,7 @@
 	ast_sorcery_object_field_register(sorcery, "aor", "max_contacts", "0", OPT_UINT_T, 0, FLDSET(struct ast_sip_aor, max_contacts));
 	ast_sorcery_object_field_register(sorcery, "aor", "remove_existing", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_aor, remove_existing));
 	ast_sorcery_object_field_register_custom(sorcery, "aor", "contact", "", permanent_uri_handler, NULL, 0, 0);
+	ast_sorcery_object_field_register(sorcery, "aor", "mailboxes", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_aor, mailboxes));
 
 	return 0;
 }

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=385719&r1=385718&r2=385719
==============================================================================
--- team/mmichelson/pub_sub/res/res_sip_mwi.c (original)
+++ team/mmichelson/pub_sub/res/res_sip_mwi.c Mon Apr 15 11:16:55 2013
@@ -134,7 +134,7 @@
 }
 
 static struct mwi_subscription *mwi_subscription_alloc(struct ast_sip_endpoint *endpoint,
-		enum ast_sip_subscription_role role, unsigned int is_solicited)
+		enum ast_sip_subscription_role role, unsigned int is_solicited, pjsip_rx_data *rdata)
 {
 	struct mwi_subscription *sub;
 	const char *endpoint_id = ast_sorcery_object_get_id(endpoint);
@@ -157,7 +157,7 @@
 	 */
 	if (is_solicited) {
 		sub->sip_sub = ast_sip_create_subscription(&mwi_handler,
-				role, endpoint, NULL);
+				role, endpoint, rdata);
 		if (!sub->sip_sub) {
 			ao2_cleanup(sub);
 			return NULL;
@@ -349,7 +349,7 @@
 		return NULL;
 	}
 
-	sub = mwi_subscription_alloc(endpoint, AST_SIP_NOTIFIER, 1);
+	sub = mwi_subscription_alloc(endpoint, AST_SIP_NOTIFIER, 1, rdata);
 	if (!sub) {
 		return NULL;
 	}
@@ -473,7 +473,7 @@
 	 * incoming SUBSCRIBE by pretending that we are the subscriber
 	 */
 	if (endpoint->aggregate_mwi) {
-		aggregate_sub = mwi_subscription_alloc(endpoint, AST_SIP_SUBSCRIBER, 0);
+		aggregate_sub = mwi_subscription_alloc(endpoint, AST_SIP_SUBSCRIBER, 0, NULL);
 		if (!aggregate_sub) {
 			return 0;
 		}
@@ -481,7 +481,7 @@
 
 	mailboxes = ast_strdupa(endpoint->mailboxes);
 	while ((mailbox = strsep(&mailboxes, ","))) {
-		struct mwi_subscription *sub = aggregate_sub ?: mwi_subscription_alloc(endpoint, AST_SIP_SUBSCRIBER, 0);
+		struct mwi_subscription *sub = aggregate_sub ?: mwi_subscription_alloc(endpoint, AST_SIP_SUBSCRIBER, 0, NULL);
 		RAII_VAR(struct mwi_stasis_subscription *, mwi_stasis_sub,
 				mwi_stasis_subscription_alloc(mailbox, sub), ao2_cleanup);
 		if (mwi_stasis_sub) {




More information about the asterisk-commits mailing list