提交 24cef981 authored 作者: Michael Jerris's avatar Michael Jerris

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
上级 ca44d9af
...@@ -1820,21 +1820,23 @@ static void conference_loop_output(conference_member_t *member) ...@@ -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) { if (switch_core_session_dequeue_event(member->session, &event) == SWITCH_STATUS_SUCCESS) {
char *from = switch_event_get_header(event, "from"); if (event->event_id == SWITCH_EVENT_MESSAGE) {
char *to = switch_event_get_header(event, "to"); char *from = switch_event_get_header(event, "from");
char *proto = switch_event_get_header(event, "proto"); char *to = switch_event_get_header(event, "to");
char *subject = switch_event_get_header(event, "subject"); char *proto = switch_event_get_header(event, "proto");
char *hint = switch_event_get_header(event, "hint"); char *subject = switch_event_get_header(event, "subject");
char *body = switch_event_get_body(event); char *hint = switch_event_get_header(event, "hint");
char *p, *freeme = NULL; 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))) { if (to && from && body) {
freeme = switch_mprintf("%s+%s@%s", CONF_CHAT_PROTO, member->conference->name, member->conference->domain); if ((p = strchr(to, '+')) && strncmp(to, CONF_CHAT_PROTO, strlen(CONF_CHAT_PROTO))) {
to = freeme; 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); switch_event_destroy(&event);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论