]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update caller_profile to have correct uuid when using custom uuid from originate...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 1 Dec 2010 16:31:28 +0000 (10:31 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 1 Dec 2010 16:31:37 +0000 (10:31 -0600)
src/switch_core_session.c

index fc7648155ac0f6874db3cc2f6db87f1bda6f0ebd..2567d177129ae4e512a2e5260b91dc1810a1497d 100644 (file)
@@ -1327,6 +1327,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session
 {
        switch_event_t *event;
        switch_core_session_message_t msg = { 0 };
+       switch_caller_profile_t *profile;
 
        switch_assert(use_uuid);
 
@@ -1343,6 +1344,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session
        msg.string_array_arg[1] = use_uuid;
        switch_core_session_receive_message(session, &msg);
 
+       if ((profile = switch_channel_get_caller_profile(session->channel))) {
+               profile->uuid = switch_core_strdup(profile->pool, use_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_core_hash_delete(session_manager.session_table, session->uuid_str);