[Freeswitch-svn] [commit] r10556 - in freeswitch/trunk/src: . include

FreeSWITCH SVN anthm at freeswitch.org
Wed Nov 26 20:03:00 PST 2008


Author: anthm
Date: Wed Nov 26 23:02:57 2008
New Revision: 10556

Log:
update

Modified:
   freeswitch/trunk/src/include/switch_channel.h
   freeswitch/trunk/src/switch_channel.c
   freeswitch/trunk/src/switch_ivr.c

Modified: freeswitch/trunk/src/include/switch_channel.h
==============================================================================
--- freeswitch/trunk/src/include/switch_channel.h	(original)
+++ freeswitch/trunk/src/include/switch_channel.h	Wed Nov 26 23:02:57 2008
@@ -488,6 +488,8 @@
 
 #define switch_channel_media_ready(_channel) ((switch_channel_test_flag(_channel, CF_ANSWERED) || switch_channel_test_flag(_channel, CF_EARLY_MEDIA)) && !switch_channel_test_flag(_channel, CF_PROXY_MODE))
 
+SWITCH_DECLARE(void) switch_channel_audio_sync(switch_channel_t *channel);
+
 /** @} */
 
 SWITCH_END_EXTERN_C

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Wed Nov 26 23:02:57 2008
@@ -166,6 +166,19 @@
 	return channel->hangup_cause;
 }
 
+
+SWITCH_DECLARE(void) switch_channel_audio_sync(switch_channel_t *channel) 
+{
+	if (switch_channel_media_ready(channel)) {
+		switch_core_session_message_t msg;
+		msg.message_id = SWITCH_MESSAGE_INDICATE_AUDIO_SYNC;
+		msg.from = channel->name;
+		switch_core_session_receive_message(channel->session, &msg);
+	}
+}
+
+
+
 SWITCH_DECLARE(switch_call_cause_t) switch_channel_cause_q850(switch_call_cause_t cause)
 {
 	if (cause <= SWITCH_CAUSE_INTERWORKING) {
@@ -1689,13 +1702,7 @@
 		switch_core_session_execute_application(channel->session, app, arg);
 	}
 
-
-	if (switch_channel_media_ready(channel)) {
-		switch_core_session_message_t msg;
-		msg.message_id = SWITCH_MESSAGE_INDICATE_AUDIO_SYNC;
-		msg.from = channel->name;
-		switch_core_session_receive_message(channel->session, &msg);
-	}
+	switch_channel_audio_sync(channel);
 
 	return SWITCH_STATUS_SUCCESS;
 }

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Wed Nov 26 23:02:57 2008
@@ -52,6 +52,8 @@
 	cng_frame.buflen = 2;
 	switch_set_flag((&cng_frame), SFF_CNG);
 
+	switch_channel_audio_sync(channel);
+
 	for (;;) {
 		now = switch_timestamp_now();
 		elapsed = (int32_t) ((now - start) / 1000);



More information about the Freeswitch-svn mailing list