[asterisk-commits] kmoore: branch kmoore/stasis-mwi r383216 - in /team/kmoore/stasis-mwi: apps/ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 15 09:16:48 CDT 2013


Author: kmoore
Date: Fri Mar 15 09:16:44 2013
New Revision: 383216

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383216
Log:
Take advantage of stasis unsubscription functions returning NULL

Modified:
    team/kmoore/stasis-mwi/apps/app_voicemail.c
    team/kmoore/stasis-mwi/channels/chan_dahdi.c
    team/kmoore/stasis-mwi/channels/chan_iax2.c
    team/kmoore/stasis-mwi/channels/chan_mgcp.c
    team/kmoore/stasis-mwi/channels/chan_sip.c
    team/kmoore/stasis-mwi/channels/chan_skinny.c
    team/kmoore/stasis-mwi/channels/sig_pri.c
    team/kmoore/stasis-mwi/main/app.c
    team/kmoore/stasis-mwi/main/channel.c
    team/kmoore/stasis-mwi/res/res_jabber.c
    team/kmoore/stasis-mwi/res/res_xmpp.c

Modified: team/kmoore/stasis-mwi/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/apps/app_voicemail.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/apps/app_voicemail.c (original)
+++ team/kmoore/stasis-mwi/apps/app_voicemail.c Fri Mar 15 09:16:44 2013
@@ -12675,8 +12675,7 @@
 	poll_thread_run = 0;
 
 	if (mwi_sub_sub) {
-		stasis_unsubscribe(mwi_sub_sub);
-		mwi_sub_sub = NULL;
+		mwi_sub_sub = stasis_unsubscribe(mwi_sub_sub);
 	}
 
 	ast_mutex_lock(&poll_lock);

Modified: team/kmoore/stasis-mwi/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_dahdi.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_dahdi.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_dahdi.c Fri Mar 15 09:16:44 2013
@@ -5956,10 +5956,12 @@
 		}
 	}
 	ast_free(p->cidspill);
-	if (p->use_smdi)
+	if (p->use_smdi) {
 		ast_smdi_interface_unref(p->smdi_iface);
-	if (p->mwi_event_sub)
-		stasis_unsubscribe(p->mwi_event_sub);
+	}
+	if (p->mwi_event_sub) {
+		p->mwi_event_sub = stasis_unsubscribe(p->mwi_event_sub);
+	}
 	if (p->vars) {
 		ast_variables_destroy(p->vars);
 	}
@@ -5972,8 +5974,9 @@
 
 	ast_mutex_destroy(&p->lock);
 	dahdi_close_sub(p, SUB_REAL);
-	if (p->owner)
+	if (p->owner) {
 		ast_channel_tech_pvt_set(p->owner, NULL);
+	}
 	ast_free(p);
 }
 

Modified: team/kmoore/stasis-mwi/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_iax2.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_iax2.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_iax2.c Fri Mar 15 09:16:44 2013
@@ -12393,8 +12393,9 @@
 	if (peer->dnsmgr)
 		ast_dnsmgr_release(peer->dnsmgr);
 
-	if (peer->mwi_event_sub)
-		stasis_unsubscribe(peer->mwi_event_sub);
+	if (peer->mwi_event_sub) {
+		peer->mwi_event_sub = stasis_unsubscribe(peer->mwi_event_sub);
+	}
 
 	ast_string_field_free_memory(peer);
 }

Modified: team/kmoore/stasis-mwi/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_mgcp.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_mgcp.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_mgcp.c Fri Mar 15 09:16:44 2013
@@ -4525,7 +4525,7 @@
 	}
 
 	if (e->mwi_event_sub) {
-		stasis_unsubscribe(e->mwi_event_sub);
+		e->mwi_event_sub = stasis_unsubscribe(e->mwi_event_sub);
 	}
 
 	if (e->chanvars) {

Modified: team/kmoore/stasis-mwi/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_sip.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_sip.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_sip.c Fri Mar 15 09:16:44 2013
@@ -5226,8 +5226,9 @@
 /*! Destroy mailbox subscriptions */
 static void destroy_mailbox(struct sip_mailbox *mailbox)
 {
-	if (mailbox->event_sub)
-		stasis_unsubscribe(mailbox->event_sub);
+	if (mailbox->event_sub) {
+		mailbox->event_sub = stasis_unsubscribe(mailbox->event_sub);
+	}
 	ast_free(mailbox);
 }
 
@@ -27620,7 +27621,7 @@
 
 	AST_LIST_TRAVERSE(&peer->mailboxes, mailbox, entry) {
 		struct stasis_topic *mailbox_specific_topic;
-		stasis_unsubscribe(mailbox->event_sub);
+		mailbox->event_sub = stasis_unsubscribe(mailbox->event_sub);
 
 		ast_str_reset(uniqueid);
 		ast_str_set(&uniqueid, 0, "%s@%s", mailbox->mailbox, S_OR(mailbox->context, "default"));

Modified: team/kmoore/stasis-mwi/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_skinny.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_skinny.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_skinny.c Fri Mar 15 09:16:44 2013
@@ -8701,8 +8701,9 @@
 				}
 				ast_mutex_unlock(&sub->lock);
 			}
-			if (l->mwi_event_sub)
-				stasis_unsubscribe(l->mwi_event_sub);
+			if (l->mwi_event_sub) {
+				l->mwi_event_sub = stasis_unsubscribe(l->mwi_event_sub);
+			}
 			ast_mutex_unlock(&l->lock);
 			manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: Skinny\r\nPeer: Skinny/%s@%s\r\nPeerStatus: Unregistered\r\n", l->name, d->name);
 			unregister_exten(l);

Modified: team/kmoore/stasis-mwi/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/sig_pri.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/channels/sig_pri.c (original)
+++ team/kmoore/stasis-mwi/channels/sig_pri.c Fri Mar 15 09:16:44 2013
@@ -8849,8 +8849,7 @@
 #if defined(HAVE_PRI_MWI)
 	for (idx = 0; idx < ARRAY_LEN(pri->mbox); ++idx) {
 		if (pri->mbox[idx].sub) {
-			stasis_unsubscribe(pri->mbox[idx].sub);
-			pri->mbox[idx].sub = NULL;
+			pri->mbox[idx].sub = stasis_unsubscribe(pri->mbox[idx].sub);
 		}
 	}
 #endif	/* defined(HAVE_PRI_MWI) */
@@ -8921,8 +8920,7 @@
 	/* Prepare the mbox[] for use. */
 	for (i = 0; i < ARRAY_LEN(pri->mbox); ++i) {
 		if (pri->mbox[i].sub) {
-			stasis_unsubscribe(pri->mbox[i].sub);
-			pri->mbox[i].sub = NULL;
+			pri->mbox[i].sub = stasis_unsubscribe(pri->mbox[i].sub);
 		}
 	}
 #endif	/* defined(HAVE_PRI_MWI) */

Modified: team/kmoore/stasis-mwi/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/main/app.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/main/app.c (original)
+++ team/kmoore/stasis-mwi/main/app.c Fri Mar 15 09:16:44 2013
@@ -99,8 +99,7 @@
 	struct mwi_topic *topic = obj;
 	ast_free(topic->uniqueid);
 	topic->uniqueid = NULL;
-	stasis_unsubscribe(topic->forward);
-	topic->forward = NULL;
+	topic->forward = stasis_unsubscribe(topic->forward);
 	ao2_cleanup(topic->topic);
 	topic->topic = NULL;
 }
@@ -2798,8 +2797,7 @@
 {
 	ao2_cleanup(mwi_topic_all);
 	mwi_topic_all = NULL;
-	stasis_caching_unsubscribe(mwi_topic_cached);
-	mwi_topic_cached = NULL;
+	mwi_topic_cached = stasis_caching_unsubscribe(mwi_topic_cached);
 	ao2_cleanup(mwi_message_type);
 	mwi_message_type = NULL;
 	ao2_cleanup(mwi_topics);

Modified: team/kmoore/stasis-mwi/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/main/channel.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/main/channel.c (original)
+++ team/kmoore/stasis-mwi/main/channel.c Fri Mar 15 09:16:44 2013
@@ -8637,8 +8637,7 @@
 	__channel_varset = NULL;
 	ao2_cleanup(__channel_topic_all);
 	__channel_topic_all = NULL;
-	stasis_caching_unsubscribe(__channel_topic_all_cached);
-	__channel_topic_all_cached = NULL;
+	__channel_topic_all_cached = stasis_caching_unsubscribe(__channel_topic_all_cached);
 	ast_data_unregister(NULL);
 	ast_cli_unregister_multiple(cli_channel, ARRAY_LEN(cli_channel));
 	if (channels) {

Modified: team/kmoore/stasis-mwi/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/res/res_jabber.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/res/res_jabber.c (original)
+++ team/kmoore/stasis-mwi/res/res_jabber.c Fri Mar 15 09:16:44 2013
@@ -4769,7 +4769,7 @@
 	ast_manager_unregister("JabberSend");
 	ast_custom_function_unregister(&jabberstatus_function);
 	if (mwi_sub) {
-		stasis_unsubscribe(mwi_sub);
+		mwi_sub = stasis_unsubscribe(mwi_sub);
 	}
 	if (device_state_sub) {
 		ast_event_unsubscribe(device_state_sub);

Modified: team/kmoore/stasis-mwi/res/res_xmpp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/res/res_xmpp.c?view=diff&rev=383216&r1=383215&r2=383216
==============================================================================
--- team/kmoore/stasis-mwi/res/res_xmpp.c (original)
+++ team/kmoore/stasis-mwi/res/res_xmpp.c Fri Mar 15 09:16:44 2013
@@ -1599,8 +1599,7 @@
 
 	if (!(client->device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE_CHANGE,
 							     xmpp_pubsub_devstate_cb, "xmpp_pubsub_devstate_subscription", client, AST_EVENT_IE_END))) {
-		stasis_unsubscribe(client->mwi_sub);
-		client->mwi_sub = NULL;
+		client->mwi_sub = stasis_unsubscribe(client->mwi_sub);
 		return;
 	}
 
@@ -3507,8 +3506,7 @@
 	}
 
 	if (client->mwi_sub) {
-		stasis_unsubscribe(client->mwi_sub);
-		client->mwi_sub = NULL;
+		client->mwi_sub = stasis_unsubscribe(client->mwi_sub);
 		xmpp_pubsub_unsubscribe(client, "message_waiting");
 	}
 




More information about the asterisk-commits mailing list