[Core] Don't flip CID on recover if that's done already.

This commit is contained in:
Andrey Volk 2021-06-23 00:06:37 +03:00
parent 35e8ad8f70
commit cd4f7bf729

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