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
This commit is contained in:
parent
ca44d9af17
commit
24cef98170
|
@ -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 (to && from && body) {
|
||||||
if ((p = strchr(to, '+')) && strncmp(to, CONF_CHAT_PROTO, strlen(CONF_CHAT_PROTO))) {
|
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);
|
freeme = switch_mprintf("%s+%s@%s", CONF_CHAT_PROTO, member->conference->name, member->conference->domain);
|
||||||
to = freeme;
|
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue