Revision
15343
Author
gmaruzz
Date
2009-11-04 03:52:55 -0600 (Wed, 04 Nov 2009)

Log Message

skypiax: added 'report_incoming_chatmessages' configuration file per_interface setting. To activate it, put its value to '1' or 'true', any other value will be 'false'. Defualts to 'true'

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c (15342 => 15343)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2009-11-04 09:06:25 UTC (rev 15342)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2009-11-04 09:52:55 UTC (rev 15343)
@@ -1133,6 +1133,7 @@
 			char *tcp_cli_port = NULL;
 			char *tcp_srv_port = NULL;
 			char *skype_user = NULL;
+			char *report_incoming_chatmessages = "true";
 
 			uint32_t interface_id = 0, to = 0, max = 0;
 
@@ -1162,6 +1163,8 @@
 					hold_music = val;
 				} else if (!strcasecmp(var, "skype_user")) {
 					skype_user = val;
+				} else if (!strcasecmp(var, "report_incoming_chatmessages")) {
+					report_incoming_chatmessages = val;
 				} else if (!strcasecmp(var, "tcp_cli_port")) {
 					tcp_cli_port = val;
 				} else if (!strcasecmp(var, "tcp_srv_port")) {
@@ -1277,6 +1280,13 @@
 				switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].destination, destination);
 				switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context);
 
+				if(!strcmp(report_incoming_chatmessages, "true") || !strcmp(report_incoming_chatmessages, "1")){
+					globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages = 1;
+				}else {
+					globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages = 0; //redundant, just in case
+
+				}
+
 				DEBUGA_SKYPE
 					("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n",
 					 SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].X11_display);
@@ -1303,6 +1313,11 @@
 				DEBUGA_SKYPE
 					("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n",
 					 SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].context);
+
+				DEBUGA_SKYPE
+					("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages=%d\n",
+					 SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages);
+
 				WARNINGA("STARTING interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
 
 				switch_threadattr_create(&skypiax_api_thread_attr, skypiax_module_pool);
@@ -1392,6 +1407,7 @@
 				DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].dialplan=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].dialplan);
 				DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].destination=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].destination);
 				DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].context);
+				DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].report_incoming_chatmessages=%d\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].report_incoming_chatmessages);
 			}
 		}
 	}
@@ -2283,6 +2299,11 @@
 
 	DEBUGA_SKYPE("received CHATMESSAGE on interface %s\n", SKYPIAX_P_LOG, tech_pvt->name);
 
+	if(!tech_pvt->report_incoming_chatmessages){
+		DEBUGA_SKYPE("I will not generate an Event, report_incoming_chatmessages is %d\n", SKYPIAX_P_LOG, tech_pvt->report_incoming_chatmessages);
+		return 0;
+	}
+
 	if (!zstr(tech_pvt->session_uuid_str)) {
 		session = switch_core_session_locate(tech_pvt->session_uuid_str);
 	}

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h (15342 => 15343)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h	2009-11-04 09:06:25 UTC (rev 15342)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h	2009-11-04 09:52:55 UTC (rev 15343)
@@ -270,6 +270,7 @@
 
 	chatmessage_t chatmessages[MAX_CHATMESSAGES];
 	chat_t chats[MAX_CHATS];
+	uint32_t report_incoming_chatmessages;
 };
 
 typedef struct private_object private_t;