[Freeswitch-svn] [commit] r9960 - freeswitch/trunk/src/mod/endpoints/mod_loopback

Freeswitch SVN anthm at freeswitch.org
Sat Oct 11 12:28:06 EDT 2008


Author: anthm
Date: Sat Oct 11 12:28:05 2008
New Revision: 9960

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c

Log:
possible fix for MODENDP-140

Modified: freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c	Sat Oct 11 12:28:05 2008
@@ -75,6 +75,7 @@
 	unsigned char cng_databuf[10];
 	switch_timer_t timer;
 	switch_caller_profile_t *caller_profile;
+	int32_t bowout_frame_count;
 };
 typedef struct private_object private_t;
 
@@ -163,6 +164,8 @@
 	switch_set_flag((&tech_pvt->cng_frame), SFF_CNG);
 	tech_pvt->cng_frame.datalen = 2;
 
+	tech_pvt->bowout_frame_count = (tech_pvt->read_codec.implementation->actual_samples_per_second / 
+							 tech_pvt->read_codec.implementation->samples_per_frame) * 3;
 
 	switch_core_session_set_read_codec(session, &tech_pvt->read_codec);
 	switch_core_session_set_write_codec(session, &tech_pvt->write_codec);
@@ -560,7 +563,8 @@
 		switch_channel_test_flag(tech_pvt->channel, CF_BRIDGED) &&
 		switch_channel_test_flag(tech_pvt->other_channel, CF_BRIDGED) &&
 		switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED) &&
-		switch_channel_test_flag(tech_pvt->other_channel, CF_ANSWERED) 
+		switch_channel_test_flag(tech_pvt->other_channel, CF_ANSWERED) &&
+		!--tech_pvt->bowout_frame_count <= 0
 		) {
 		const char *a_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
 		const char *b_uuid = switch_channel_get_variable(tech_pvt->other_channel, SWITCH_SIGNAL_BOND_VARIABLE);



More information about the Freeswitch-svn mailing list