提交 aa439630 authored 作者: Anthony Minessale's avatar Anthony Minessale

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
上级 63e7cfc8
...@@ -660,6 +660,7 @@ typedef enum { ...@@ -660,6 +660,7 @@ typedef enum {
SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY, SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY,
SWITCH_MESSAGE_INDICATE_AUDIO_SYNC, SWITCH_MESSAGE_INDICATE_AUDIO_SYNC,
SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA, SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA,
SWITCH_MESSAGE_INDICATE_UUID_CHANGE,
SWITCH_MESSAGE_INVALID SWITCH_MESSAGE_INVALID
} switch_core_session_message_types_t; } switch_core_session_message_types_t;
......
...@@ -1192,6 +1192,7 @@ SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session_t *se ...@@ -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_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session_t *session, const char *use_uuid)
{ {
switch_event_t *event; switch_event_t *event;
switch_core_session_message_t msg = { 0 };
switch_assert(use_uuid); switch_assert(use_uuid);
...@@ -1202,6 +1203,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session ...@@ -1202,6 +1203,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session
return SWITCH_STATUS_FALSE; 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_create(&event, SWITCH_EVENT_CHANNEL_UUID);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-Unique-ID", session->uuid_str); 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); switch_core_hash_delete(session_manager.session_table, session->uuid_str);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论