diff --git a/src/switch_channel.c b/src/switch_channel.c index d4ed3ec140..de19eaef93 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -910,7 +910,7 @@ SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, sw state = switch_channel_get_running_state(other_channel); mystate = switch_channel_get_running_state(channel); - if (mystate != ostate || state >= CS_HANGUP || mystate == want_state) { + if (mystate == want_state || state >= CS_HANGUP || mystate >= CS_HANGUP) { break; } switch_cond_next();