[Freeswitch-svn] [commit] r11315 - in freeswitch/trunk/src: . mod/endpoints/mod_portaudio

FreeSWITCH SVN anthm at freeswitch.org
Tue Jan 20 10:36:02 PST 2009


Author: anthm
Date: Tue Jan 20 12:36:02 2009
New Revision: 11315

Log:
FSCORE-274

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
   freeswitch/trunk/src/switch_channel.c

Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	Tue Jan 20 12:36:02 2009
@@ -1455,7 +1455,7 @@
 			} else {
 				switch_channel_t *channel = switch_core_session_get_channel(tp->session);
 				switch_set_flag_locked(tp, TFLAG_ANSWER);
-				switch_channel_answer(channel);
+				switch_channel_mark_answered(channel);
 				add_pvt(tp, PA_MASTER);
 			}
 		} else {
@@ -1469,7 +1469,7 @@
 		if (!switch_test_flag(tp, TFLAG_ANSWER)) {
 			switch_channel_t *channel = switch_core_session_get_channel(tp->session);
 			switch_set_flag_locked(tp, TFLAG_ANSWER);
-			switch_channel_answer(channel);
+			switch_channel_mark_answered(channel);
 			add_pvt(tp, PA_MASTER);
 			x++;
 			break;

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Tue Jan 20 12:36:02 2009
@@ -1633,7 +1633,7 @@
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel_t *channel, const char *file, const char *func, int line)
 {
 	switch_core_session_message_t msg;
-	switch_status_t status;
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
 	switch_assert(channel != NULL);
 
@@ -1649,14 +1649,12 @@
 		return SWITCH_STATUS_SUCCESS;
 	}
 
-	if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
-		return SWITCH_STATUS_SUCCESS;
+	if (!switch_channel_test_flag(channel, CF_OUTBOUND)) {
+		msg.message_id = SWITCH_MESSAGE_INDICATE_PROGRESS;
+		msg.from = channel->name;
+		status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
 	}
 
-	msg.message_id = SWITCH_MESSAGE_INDICATE_PROGRESS;
-	msg.from = channel->name;
-	status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
-	
 	if (status == SWITCH_STATUS_SUCCESS) {
 		switch_channel_perform_mark_pre_answered(channel, file, func, line);
 	} else {
@@ -1669,7 +1667,7 @@
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel_t *channel, const char *file, const char *func, int line)
 {
 	switch_core_session_message_t msg;
-	switch_status_t status;
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
 	switch_assert(channel != NULL);
 
@@ -1685,14 +1683,12 @@
 		return SWITCH_STATUS_SUCCESS;
 	}
 
-	if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
-		return SWITCH_STATUS_SUCCESS;
+	if (!switch_channel_test_flag(channel, CF_OUTBOUND)) {
+		msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING;
+		msg.from = channel->name;
+		status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
 	}
-
-	msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING;
-	msg.from = channel->name;
-	status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
-
+	
 	if (status == SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Ring Ready %s!\n", channel->name);
 	} else {
@@ -1782,7 +1778,7 @@
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *channel, const char *file, const char *func, int line)
 {
 	switch_core_session_message_t msg;
-	switch_status_t status;
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
 	switch_assert(channel != NULL);
 
@@ -1793,15 +1789,13 @@
 	if (switch_channel_test_flag(channel, CF_ANSWERED)) {
 		return SWITCH_STATUS_SUCCESS;
 	}
-
-	if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
-		return SWITCH_STATUS_SUCCESS;
+	
+	if (!switch_channel_test_flag(channel, CF_OUTBOUND)) {
+		msg.message_id = SWITCH_MESSAGE_INDICATE_ANSWER;
+		msg.from = channel->name;
+		status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
 	}
 
-	msg.message_id = SWITCH_MESSAGE_INDICATE_ANSWER;
-	msg.from = channel->name;
-	status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
-
 	if (status == SWITCH_STATUS_SUCCESS) {
 		switch_channel_perform_mark_answered(channel, file, func, line);
 	} else {



More information about the Freeswitch-svn mailing list