From bf107c6f0f1cdfb8f78f984a596510215452f490 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 26 Apr 2011 09:43:22 -0500 Subject: [PATCH] FS-3269 --resolve --- src/switch_channel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index cfeb827949..7d351791fd 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1194,9 +1194,11 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state) { + switch_assert(channel); + for (;;) { if ((channel->state == channel->running_state && channel->running_state == want_state) || - switch_channel_down(other_channel) || switch_channel_down(channel)) { + (other_channel && !switch_channel_ready(other_channel)) || !switch_channel_ready(channel)) { break; } switch_yield(20000);