]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
increment app before execute in case it returns to execute it will go to the next...
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 25 Sep 2008 14:25:59 +0000 (14:25 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 25 Sep 2008 14:25:59 +0000 (14:25 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9645 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core_state_machine.c
src/switch_ivr_bridge.c

index 7c05cc26713ec03d0fe84c74042155718ff4814e..ea6af4bde76c0c39f82a8e44acdae499a7f30431 100644 (file)
@@ -137,20 +137,23 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)
        }
 
        while (switch_channel_get_state(session->channel) == CS_EXECUTE && extension->current_application) {
+               switch_caller_application_t *current_application = extension->current_application;
+
+               extension->current_application = extension->current_application->next;
+
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Execute %s(%s)\n", switch_channel_get_name(session->channel),
-                                                 extension->current_application->application_name, switch_str_nil(extension->current_application->application_data));
+                                                 current_application->application_name, switch_str_nil(current_application->application_data));
 
                if (switch_core_session_execute_application(session,
-                                                                                                       extension->current_application->application_name,
-                                                                                                       extension->current_application->application_data) != SWITCH_STATUS_SUCCESS) {
+                                                                                                       current_application->application_name,
+                                                                                                       current_application->application_data) != SWITCH_STATUS_SUCCESS) {
                        return;
                }
 
                if (switch_channel_test_flag(session->channel, CF_RESET)) {
                        goto top;
                }
-
-               extension->current_application = extension->current_application->next;
+               
        }
 
        if (switch_channel_get_state(session->channel) == CS_EXECUTE) {
index b97cf750e70dca2a8c09ddced23dbf1bd9af0d8f..840b276f4ec1dd391f08329e5978f904c82d9ca7 100644 (file)
@@ -136,7 +136,9 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
        switch_channel_wait_for_flag(chan_b, CF_BRIDGED, SWITCH_TRUE, 10000, chan_a);
 
        if (!switch_channel_test_flag(chan_b, CF_BRIDGED)) {
-               switch_channel_hangup(chan_b, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+               if (!(switch_channel_test_flag(chan_b, CF_TRANSFER) || switch_channel_get_state(chan_b) == CS_RESET)) {
+                       switch_channel_hangup(chan_b, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+               }
                goto end_of_bridge_loop;
        }