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:
Anthony Minessale 2009-10-22 14:54:29 +00:00
parent 63e7cfc815
commit aa439630c9
2 changed files with 8 additions and 0 deletions

View File

@ -660,6 +660,7 @@ typedef enum {
SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY,
SWITCH_MESSAGE_INDICATE_AUDIO_SYNC,
SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA,
SWITCH_MESSAGE_INDICATE_UUID_CHANGE,
SWITCH_MESSAGE_INVALID
} switch_core_session_message_types_t;

View File

@ -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);