From: Andrey Volk Date: Tue, 22 Jun 2021 21:06:37 +0000 (+0300) Subject: [Core] Don't flip CID on recover if that's done already. X-Git-Tag: v1.10.7^2~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea74d2a5d6800c4697abeba41cbe8b9c923972ba;p=thirdparty%2Ffreeswitch.git [Core] Don't flip CID on recover if that's done already. --- diff --git a/src/switch_channel.c b/src/switch_channel.c index 9a57466042..7c5ae934b3 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -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);