]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Don't flip CID on recover if that's done already.
authorAndrey Volk <andywolk@gmail.com>
Tue, 22 Jun 2021 21:06:37 +0000 (00:06 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:48 +0000 (22:00 +0300)
src/switch_channel.c

index 9a57466042960649845ce4ef68af8b7dc7e99970..7c5ae934b39a22c20b034c6419168714e6d50b4f 100644 (file)
@@ -3220,6 +3220,12 @@ SWITCH_DECLARE(void) switch_channel_flip_cid(switch_channel_t *channel)
        const char *tmp = NULL;
 
        switch_mutex_lock(channel->profile_mutex);
+
+       if (switch_channel_test_flag(channel, CF_RECOVERING) && switch_true(switch_channel_get_variable(channel, "channel_cid_flipped"))) {
+               switch_mutex_unlock(channel->profile_mutex);
+               return;
+       }
+
        if (channel->caller_profile->callee_id_name) {
                tmp = channel->caller_profile->caller_id_name;
                switch_channel_set_variable(channel, "pre_transfer_caller_id_name", channel->caller_profile->caller_id_name);
@@ -3244,6 +3250,8 @@ SWITCH_DECLARE(void) switch_channel_flip_cid(switch_channel_t *channel)
                channel->caller_profile->callee_id_number = tmp;
        }
 
+       switch_channel_set_variable(channel, "channel_cid_flipped", "yes");
+
        switch_mutex_unlock(channel->profile_mutex);