From: Anthony Minessale Date: Sat, 11 Oct 2008 16:28:05 +0000 (+0000) Subject: possible fix for MODENDP-140 X-Git-Tag: v1.0.2~846 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8684256756c05f82f8bb042735fdab2efb7333ad;p=thirdparty%2Ffreeswitch.git possible fix for MODENDP-140 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9960 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_loopback/mod_loopback.c b/src/mod/endpoints/mod_loopback/mod_loopback.c index c40a721062..34453bdbcd 100644 --- a/src/mod/endpoints/mod_loopback/mod_loopback.c +++ b/src/mod/endpoints/mod_loopback/mod_loopback.c @@ -75,6 +75,7 @@ struct private_object { 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 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses 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 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc 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);