]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 22 Apr 2006 16:06:55 +0000 (16:06 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 22 Apr 2006 16:06:55 +0000 (16:06 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1229 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/switch_rtp.c

index f0962e040f81032cb4833b0c3d36afec87994851..7513418892e8f7b54847b84a44c6e7915ced5dd9 100644 (file)
@@ -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;
 
 
index 898656da9f1c14de33ada26758f1764ab5f44e06..16eb1e5ad8e1171d8b05b51f54c375222f5a0ebf 100644 (file)
@@ -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:
index cdadd363adc135e0d0d81c1640e6fa6a4293548b..dfa3db978166ec88bba6424c5123e54d82755bda 100644 (file)
@@ -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);