]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
only treat the right event types as a message (MODAPP-116)
authorMichael Jerris <mike@jerris.com>
Tue, 29 Jul 2008 15:07:47 +0000 (15:07 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 29 Jul 2008 15:07:47 +0000 (15:07 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9196 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_conference/mod_conference.c

index 7cadba3ceeed1a330464ad7e18aa2078c7f2c8ff..abd2f044b2440e2f131564086fe8488164d9e79d 100644 (file)
@@ -1820,21 +1820,23 @@ static void conference_loop_output(conference_member_t *member)
 
 
                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);
                }