From 24cef98170246308969834b1a16618f2980bd39f Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 29 Jul 2008 15:07:47 +0000 Subject: [PATCH] only treat the right event types as a message (MODAPP-116) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9196 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../mod_conference/mod_conference.c | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 7cadba3cee..abd2f044b2 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -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 (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; + 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); }