Revision
17340
Author
brian
Date
2010-04-20 11:08:39 -0500 (Tue, 20 Apr 2010)

Log Message

MODENDP-302

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c (17339 => 17340)


--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	2010-04-20 16:08:39 UTC (rev 17339)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	2010-04-20 16:08:39 UTC (rev 17340)
@@ -181,6 +181,17 @@
 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 @@
 	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 @@
 
 	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;