mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 07:04:17 +00:00
add fire-message-events profile param
This commit is contained in:
1 parent
5c00f6638c
commit
fb9b69f469
3 files changed
+24
-1
No files matched your search
@@ -4349,7 +4349,7 @@ void sofia_presence_handle_sip_i_message(int status,
|
||||
if (nh) {
|
||||
char hash_key[512];
|
||||
private_object_t *tech_pvt;
|
||||
switch_event_t *event;
|
||||
switch_event_t *event, *event_dup;
|
||||
char *to_addr;
|
||||
char *from_addr;
|
||||
char *p;
|
||||
@@ -4379,6 +4379,8 @@ 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);
|
||||
|
||||
@@ -4407,6 +4409,14 @@ void sofia_presence_handle_sip_i_message(int status,
|
||||
if (msg) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user