[svn-commits] marquis: branch group/pinana-publish-1.4 r296509 - /team/group/pinana-publish...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Nov 27 22:55:49 CST 2010


Author: marquis
Date: Sat Nov 27 22:55:45 2010
New Revision: 296509

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=296509
Log:
More cleanups, and now less crashiness.

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=296509&r1=296508&r2=296509
==============================================================================
--- team/group/pinana-publish-1.4/channels/chan_sip.c (original)
+++ team/group/pinana-publish-1.4/channels/chan_sip.c Sat Nov 27 22:55:45 2010
@@ -9841,7 +9841,7 @@
 	return 0;
 }
 
-static int sip_devicestate_publish(struct sip_pvt *dialog, struct statechange *sc)
+static int sip_devicestate_publish(struct sip_publisher *p, struct statechange *sc)
 {
 	/* XXX MARQUIS Just a template for now */
 	return 0;
@@ -19498,9 +19498,19 @@
 		ao2_ref(publisher, -1);
 		return NULL;
 	}
-	ast_string_field_set(publisher, name, name);
-	ast_string_field_set(publisher, host, host);
-	ast_string_field_set(publisher, domain, domain);
+	if (name) {
+		ast_log(LOG_WARNING, "Setting name\n");
+		ast_string_field_set(publisher, name, name);
+	}
+	if (host) {
+		ast_string_field_set(publisher, host, host);
+		ast_log(LOG_WARNING, "Setting host\n");
+	}
+	if (domain) {
+		ast_string_field_set(publisher, domain, domain);
+		ast_log(LOG_WARNING, "Setting domain\n");
+	}
+
 
 	if (!(filter_head = ast_calloc(1, sizeof(*filter_head)))) {
 		return NULL;
@@ -19568,12 +19578,10 @@
 	struct ast_variable *v;
 	char *cat = NULL;
 	struct sip_publisher *publisher;
-	struct sip_subscriber *subscriber;
 	while ( (cat = ast_category_browse(pcfg, cat)) ) {
-		const char* type = NULL;
-		const char* name = NULL;
-		const char* host = NULL;
-		const char* domain = NULL;
+		char* type = NULL;
+		char* host = NULL;
+		char* domain = NULL;
 		char* filter = NULL;
 		if (!strcasecmp(cat, "general")) {
 					continue;
@@ -19590,12 +19598,13 @@
 				domain = ast_strdupa(v->value);
 			}
 		}
+
 		if (!type) {
 			ast_log(LOG_WARNING, "Section '%s' lacks type\n", cat);
 			continue;
 		}
-		if (!strcasecmp(type, "publish") || !strcasecmp(type, "bidirectional")) {
-			publisher = sip_publisher_init(name, host, domain, filter);
+		if (!strcasecmp(type, "presence")) {
+			publisher = sip_publisher_init(cat, host, domain, filter);
 			if (publisher) {
 				ao2_link(devstate_publishers, publisher);
 			}




More information about the svn-commits mailing list