[asterisk-commits] marquis: branch group/pinana-publish-1.4 r290059 - /team/group/pinana-publish...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Oct 2 18:29:58 CDT 2010


Author: marquis
Date: Sat Oct  2 18:29:54 2010
New Revision: 290059

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=290059
Log:
Test for publisher struct initialization and link into ao2 container.

Modified:
    team/group/pinana-publish-1.4/channels/chan_sip.c

Modified: team/group/pinana-publish-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pinana-publish-1.4/channels/chan_sip.c?view=diff&rev=290059&r1=290058&r2=290059
==============================================================================
--- team/group/pinana-publish-1.4/channels/chan_sip.c (original)
+++ team/group/pinana-publish-1.4/channels/chan_sip.c Sat Oct  2 18:29:54 2010
@@ -19011,6 +19011,7 @@
 static void publisher_destructor_cb(void *data)
 {
 	struct sip_publisher *publisher = data;
+	ao2_unlink(devstate_publishers, publisher);
 	ast_string_field_free_memory(publisher);
 }
 
@@ -19108,10 +19109,16 @@
 			continue;
 		}
 		if (!strcasecmp(type, "publish") || !strcasecmp(type, "bidirectional")) {
-			sip_publisher_init(name, host, domain, filter);
+			publisher = sip_publisher_init(name, host, domain, filter);
+			if (publisher) {
+				ao2_link(devstate_publishers, publisher);
+			}
 		}
 		if (!strcasecmp(type, "subscribe") || !strcasecmp(type, "bidirectional")) {
-			sip_subscriber_init(name, host, domain, filter);
+			subscriber = sip_subscriber_init(name, host, domain, filter);
+			if (subscriber) {
+				/* Link subscriber once container exists */
+			}
 		}
 	}
 




More information about the asterisk-commits mailing list