]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add SWITCH_MESSAGE_INDICATE_UUID_CHANGE to warn a session when the uuid has changed
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 22 Oct 2009 14:54:29 +0000 (14:54 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 22 Oct 2009 14:54:29 +0000 (14:54 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15193 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/switch_core_session.c

index 2b6aadebe8729b64e010ee63c10aa32452857026..37fd18c022ea551615841ad5251137c6415397f8 100644 (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;
 
index d883477219612d96be609f2aab4870a9b84162d2..f99287c67b81a6a31db58cb81c7c0725bd49a02e 100644 (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);