add fire-message-events profile param
This commit is contained in:
parent
9c06cb34fe
commit
8672cf08fb
|
@ -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,11 +4408,14 @@ void sofia_presence_handle_sip_i_message(int status,
|
|||
switch_event_add_body(event, "%s", msg);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue