[Freeswitch-svn] [commit] r9196 - freeswitch/trunk/src/mod/applications/mod_conference

Freeswitch SVN mikej at freeswitch.org
Tue Jul 29 11:07:47 EDT 2008


Author: mikej
Date: Tue Jul 29 11:07:47 2008
New Revision: 9196

Modified:
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c

Log:
only treat the right event types as a message (MODAPP-116)

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	Tue Jul 29 11:07:47 2008
@@ -1820,21 +1820,23 @@
 
 
 		if (switch_core_session_dequeue_event(member->session, &event) == SWITCH_STATUS_SUCCESS) {
-			char *from = switch_event_get_header(event, "from");
-			char *to = switch_event_get_header(event, "to");
-			char *proto = switch_event_get_header(event, "proto");
-			char *subject = switch_event_get_header(event, "subject");
-			char *hint = switch_event_get_header(event, "hint");
-			char *body = switch_event_get_body(event);
-			char *p, *freeme = NULL;
-
-			if (to && from && body) {
-				if ((p = strchr(to, '+')) && strncmp(to, CONF_CHAT_PROTO, strlen(CONF_CHAT_PROTO))) {
-					freeme = switch_mprintf("%s+%s@%s", CONF_CHAT_PROTO, member->conference->name, member->conference->domain);
-					to = freeme;
+			if (event->event_id == SWITCH_EVENT_MESSAGE) {
+				char *from = switch_event_get_header(event, "from");
+				char *to = switch_event_get_header(event, "to");
+				char *proto = switch_event_get_header(event, "proto");
+				char *subject = switch_event_get_header(event, "subject");
+				char *hint = switch_event_get_header(event, "hint");
+				char *body = switch_event_get_body(event);
+				char *p, *freeme = NULL;
+
+				if (to && from && body) {
+					if ((p = strchr(to, '+')) && strncmp(to, CONF_CHAT_PROTO, strlen(CONF_CHAT_PROTO))) {
+						freeme = switch_mprintf("%s+%s@%s", CONF_CHAT_PROTO, member->conference->name, member->conference->domain);
+						to = freeme;
+					}
+					chat_send(proto, from, to, subject, body, hint);
+					switch_safe_free(freeme);
 				}
-				chat_send(proto, from, to, subject, body, hint);
-				switch_safe_free(freeme);
 			}
 			switch_event_destroy(&event);
 		}



More information about the Freeswitch-svn mailing list