update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1229 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
fcd00280f1
commit
1748885aae
|
@ -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
|
||||
</pre>
|
||||
*/
|
||||
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;
|
||||
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue