mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
fix edge case endless loop that can get a channel stuck
This commit is contained in:
@@ -776,17 +776,17 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
|
||||
state = switch_channel_get_state(other_channel);
|
||||
running_state = switch_channel_get_running_state(other_channel);
|
||||
|
||||
if (state == running_state) {
|
||||
if (switch_channel_down_nosig(other_channel) || switch_channel_down_nosig(channel)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (state < CS_HANGUP && state == running_state) {
|
||||
|
||||
if (--loops < 1) {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
switch_channel_hangup(other_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
}
|
||||
|
||||
if (switch_channel_down_nosig(other_channel) || switch_channel_down_nosig(channel)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (running_state == CS_RESET) {
|
||||
switch_channel_set_state(other_channel, CS_SOFT_EXECUTE);
|
||||
}
|
||||
@@ -803,7 +803,7 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
|
||||
} else {
|
||||
loops = max;
|
||||
}
|
||||
|
||||
|
||||
switch_yield(20000);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user