[Freeswitch-svn] [commit] r4885 - in freeswitch/trunk: libs/libdingaling/src src/mod/endpoints/mod_dingaling

Freeswitch SVN anthm at freeswitch.org
Sat Apr 7 17:13:55 EDT 2007


Author: anthm
Date: Sat Apr  7 17:13:54 2007
New Revision: 4885

Modified:
   freeswitch/trunk/libs/libdingaling/src/libdingaling.c
   freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c

Log:
merge 1

Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c	(original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c	Sat Apr  7 17:13:54 2007
@@ -559,6 +559,8 @@
 		globals.logger(DL_LOG_DEBUG, "FixME!!! node=[%s]\n", node?node:"");		
 	} else if (pak->subtype == IKS_TYPE_GET) {
 		if ((iq = iks_new("iq"))) {
+			int all = 0;
+
 			iks_insert_attrib(iq, "from", handle->login);
 			iks_insert_attrib(iq, "to", pak->from->full);
 			iks_insert_attrib(iq, "id", pak->id);
@@ -576,13 +578,17 @@
 			if (!(tag = iks_insert (query, "identity"))) {
 				goto fail;
 			}
+			
+			if (!strcasecmp(ns, FEATURE_DISCO) && !node) {
+				all++;
+			}
 
 			iks_insert_attrib(tag, "category", "gateway");
 			iks_insert_attrib(tag, "type", "voice");
 			iks_insert_attrib(tag, "name", "LibDingaLing");
 
 			for (x = 0; FEATURES[x].name; x++) {
-				if (!ns || !strcasecmp(ns, FEATURES[x].name)) {
+				if (all || !ns || !strcasecmp(ns, FEATURES[x].name)) {
 					if (!(tag = iks_insert (query, "feature"))) {
 						goto fail;
 					}

Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Sat Apr  7 17:13:54 2007
@@ -108,7 +108,9 @@
 	char *login;
 	char *password;
 	char *message;
+#ifdef AUTO_REPLY
 	char *auto_reply;
+#endif
 	char *dialplan;
 	char *ip;
 	char *extip;
@@ -723,13 +725,15 @@
 			if (ll) {
 				if ((xmltxt = strchr(ll, ':'))) {
 					*xmltxt++ = '\0';
-					xml = switch_xml_parse_str(xmltxt, strlen(xmltxt));
-					form = switch_xml_toxml(xml);
-					switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, level, 
-									  "%s:\n-------------------------------------------------------------------------------\n"
-									  "%s\n", ll, form);
-					switch_xml_free(xml);
-					free(data);
+					if (strlen(xmltxt) > 2) {
+						xml = switch_xml_parse_str(xmltxt, strlen(xmltxt));
+						form = switch_xml_toxml(xml);
+						switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, level, 
+										  "%s:\n-------------------------------------------------------------------------------\n"
+										  "%s\n", ll, form);
+						switch_xml_free(xml);
+						free(data);
+					}
 				}
 			}
 		} else {
@@ -1959,8 +1963,10 @@
 		switch_set_flag(profile, TFLAG_TIMER);
 	} else if (!strcasecmp(var, "dialplan")) {
 		profile->dialplan = switch_core_strdup(module_pool, val);
+#ifdef AUTO_REPLY // gotta fix looping on this
 	} else if (!strcasecmp(var, "auto-reply")) {
 		profile->auto_reply = switch_core_strdup(module_pool, val);
+#endif
 	} else if (!strcasecmp(var, "name")) {
 		profile->name = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "message")) {
@@ -2396,6 +2402,8 @@
 					switch_mutex_unlock(profile->mutex);
 					if (is_special(to)) {
 						ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call", profile->avatar);
+					} else {
+						ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Authenticated.\nCome to ClueCon!\nhttp://www.cluecon.com", profile->avatar);
 					}
 #if 0
 					if (is_special(to)) {
@@ -2491,12 +2499,13 @@
 			char *proto = MDL_CHAT_PROTO;
 			char *pproto = NULL, *ffrom = NULL;
 			char *hint;
-
+#ifdef AUTO_REPLY
 			if (profile->auto_reply) {
 				ldl_handle_send_msg(handle,
 									(profile->user_flags & LDL_FLAG_COMPONENT) ? to : ldl_handle_get_login(profile->handle), from, "",
 									profile->auto_reply);
 			}
+#endif
 
 			if (strchr(to, '+')) {
 				pproto = strdup(to);



More information about the Freeswitch-svn mailing list