mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-31 07:34:19 +00:00
add SWITCH_MESSAGE_INDICATE_UUID_CHANGE to warn a session when the uuid has changed
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15193 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
63e7cfc815
commit
aa439630c9
2 files changed
+8
No files matched your search
@@ -1192,6 +1192,7 @@ SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session_t *se
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session_t *session, const char *use_uuid)
|
||||
{
|
||||
switch_event_t *event;
|
||||
switch_core_session_message_t msg = { 0 };
|
||||
|
||||
switch_assert(use_uuid);
|
||||
|
||||
@@ -1202,6 +1203,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
msg.message_id = SWITCH_MESSAGE_INDICATE_UUID_CHANGE;
|
||||
msg.from = switch_channel_get_name(session->channel);
|
||||
msg.string_array_arg[0] = session->uuid_str;
|
||||
msg.string_array_arg[1] = use_uuid;
|
||||
switch_core_session_receive_message(session, &msg);
|
||||
|
||||
switch_event_create(&event, SWITCH_EVENT_CHANNEL_UUID);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-Unique-ID", session->uuid_str);
|
||||
switch_core_hash_delete(session_manager.session_table, session->uuid_str);
|
||||
|
||||
Reference in new issue
Block a user