From 1748885aae77d086f50dfd2059715eacd02c3b3f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 22 Apr 2006 16:06:55 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1229 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_types.h | 2 ++ src/mod/endpoints/mod_dingaling/mod_dingaling.c | 12 ++++++------ src/switch_rtp.c | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index f0962e040f..7513418892 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -101,12 +101,14 @@ SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs; SWITCH_VAD_FLAG_TALKING - Currently Talking SWITCH_VAD_FLAG_EVENTS_TALK - Fire events when talking is detected SWITCH_VAD_FLAG_EVENTS_NOTALK - Fire events when not talking is detected + SWITCH_VAD_FLAG_CNG - Send CNG */ typedef enum { SWITCH_VAD_FLAG_TALKING = ( 1 << 0 ), SWITCH_VAD_FLAG_EVENTS_TALK = ( 1 << 1 ), SWITCH_VAD_FLAG_EVENTS_NOTALK = ( 1 << 2 ), + SWITCH_VAD_FLAG_CNG = ( 1 << 3) } switch_vad_flag_t; diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 898656da9f..16eb1e5ad8 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -941,16 +941,16 @@ static switch_status channel_receive_message(switch_core_session *session, switc switch (msg->message_id) { case SWITCH_MESSAGE_INDICATE_BRIDGE: if (tech_pvt->rtp_session) { - //switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER); - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "De-activate timed RTP!\n"); - switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK); + switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "De-activate timed RTP!\n"); + //switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK); } break; case SWITCH_MESSAGE_INDICATE_UNBRIDGE: if (tech_pvt->rtp_session) { - //switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER); - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Re-activate timed RTP!\n"); - switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK); + switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Re-activate timed RTP!\n"); + //switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK); } break; default: diff --git a/src/switch_rtp.c b/src/switch_rtp.c index cdadd363ad..dfa3db9781 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -810,7 +810,7 @@ static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datale if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_TALKING)) { send = 1; } else { - if (++rtp_session->vad_data.cng_count >= rtp_session->vad_data.cng_freq) { + if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_CNG) && ++rtp_session->vad_data.cng_count >= rtp_session->vad_data.cng_freq) { rtp_session->send_msg.header.pt = SWITCH_RTP_CNG_PAYLOAD; memset(rtp_session->send_msg.body, 255, SWITCH_RTP_CNG_PAYLOAD); //rtp_session->send_msg.header.ts = htonl(rtp_session->vad_data.ts);