]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3170 this was specific to the user channel which is not a real channel in every...
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 21 Mar 2011 17:01:51 +0000 (12:01 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 21 Mar 2011 17:01:51 +0000 (12:01 -0500)
src/switch_channel.c
src/switch_ivr_originate.c

index 784577c642234fda1e1b0b2dec54b86b547c62d9..7d246893f7172acf9bacd0eb4a48e4008b8ede5b 100644 (file)
@@ -1562,6 +1562,10 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_get_running_state(switch_c
 
 SWITCH_DECLARE(int) switch_channel_state_change_pending(switch_channel_t *channel) 
 {
+       if (switch_channel_down(channel) || !switch_core_session_in_thread(channel->session)) {
+               return 0;
+       }
+
        return channel->running_state != channel->state;
 }
 
index c418d40e3644d50ca6d974c7efeab73f7400e103..33e9d9a0bca815d12f9f3a44161620ea9094de1e 100644 (file)
@@ -3625,7 +3625,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                        }
                }
                
-               while(switch_channel_get_state(bchan) != switch_channel_get_running_state(bchan) && switch_channel_up(bchan)) switch_cond_next();
+
+               while(switch_channel_state_change_pending(bchan)) {
+                       switch_cond_next();
+               }
+
+
                switch_ivr_sleep(*bleg, 0, SWITCH_TRUE, NULL);
        }