add fire-message-events profile param

This commit is contained in:
Anthony Minessale 2012-08-29 15:38:01 -05:00
parent fb9b69f469
commit 4fb38a93a4
1 changed files with 7 additions and 6 deletions

View File

@ -4379,8 +4379,6 @@ void sofia_presence_handle_sip_i_message(int status,
}
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
event->flags |= EF_UNIQ_HEADERS;
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
@ -4410,10 +4408,13 @@ void sofia_presence_handle_sip_i_message(int status,
switch_event_add_body(event, "%s", msg);
}
if (switch_event_dup(&event_dup, event) == SWITCH_STATUS_SUCCESS) {
event_dup->event_id = SWITCH_EVENT_RECV_MESSAGE;
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Name", switch_event_name(event->event_id));
switch_event_fire(&event_dup);
if (sofia_test_pflag(profile, PFLAG_FIRE_MESSAGE_EVENTS)) {
if (switch_event_dup(&event_dup, event) == SWITCH_STATUS_SUCCESS) {
event_dup->event_id = SWITCH_EVENT_RECV_MESSAGE;
event_dup->flags |= EF_UNIQ_HEADERS;
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Name", switch_event_name(event->event_id));
switch_event_fire(&event_dup);
}
}