]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODENDP-302
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 20 Apr 2010 00:08:22 +0000 (19:08 -0500)
committerBrian West <brian@freeswitch.org>
Tue, 20 Apr 2010 16:08:39 +0000 (11:08 -0500)
src/mod/endpoints/mod_portaudio/mod_portaudio.c

index 0fe7f0bdcc8257ee444cd64badc42dca18319c7a..b2778d4f804fdbc2ba45d7d4c72b282544cd496b 100644 (file)
@@ -181,6 +181,17 @@ SWITCH_STANDARD_API(pa_cmd);
 static switch_status_t channel_on_init(switch_core_session_t *session)
 {
        switch_channel_t *channel = switch_core_session_get_channel(session);
+
+       /* Move channel's state machine to ROUTING */
+       switch_channel_set_state(channel, CS_ROUTING);
+
+       return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t channel_on_routing(switch_core_session_t *session)
+{
+
+       switch_channel_t *channel = switch_core_session_get_channel(session);
        private_t *tech_pvt = switch_core_session_get_private(session);
        switch_time_t last;
        int waitsec = globals.ring_interval * 1000000;
@@ -201,12 +212,8 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
        if (hold_file) {
                tech_pvt->hold_file = switch_core_session_strdup(session, hold_file);
        }
-
+       
        if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
-
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL INIT %d %d\n",
-                                                 switch_channel_get_name(channel), switch_channel_get_state(channel), switch_test_flag(tech_pvt, TFLAG_ANSWER));
-
                if (engage_device(0) != SWITCH_STATUS_SUCCESS) {
                        switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
                        return SWITCH_STATUS_FALSE;
@@ -309,14 +316,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
 
        switch_set_flag_locked(tech_pvt, TFLAG_IO);
 
-       /* Move channel's state machine to ROUTING */
-       switch_channel_set_state(channel, CS_ROUTING);
-
-       return SWITCH_STATUS_SUCCESS;
-}
 
-static switch_status_t channel_on_routing(switch_core_session_t *session)
-{
        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n",
                                          switch_channel_get_name(switch_core_session_get_channel(session)));
        return SWITCH_STATUS_SUCCESS;