diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 5ee08038b4..655e395bf6 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -2460,6 +2460,10 @@ static uint8_t negotiate_sdp(switch_core_session_t *session, sdp_session_t *sdp) if (!cng_pt && !strcasecmp(map->rm_encoding, "CN")) { cng_pt = tech_pvt->cng_pt = (switch_payload_t)map->rm_pt; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set comfort noise payload to %u\n", cng_pt); + if (tech_pvt->rtp_session) { + switch_rtp_set_cng_pt(tech_pvt->rtp_session, tech_pvt->cng_pt); + switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_AUTO_CNG); + } } if (match) { diff --git a/src/switch_rtp.c b/src/switch_rtp.c index c609115bb2..03b3424280 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -820,11 +820,10 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ check = (uint8_t)(switch_core_timer_check(&rtp_session->timer) == SWITCH_STATUS_SUCCESS); if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTO_CNG) && - rtp_session->timer.samplecount >= (rtp_session->last_write_ts + (rtp_session->packet_size * 5))) { + rtp_session->timer.samplecount >= (rtp_session->last_write_ts + (rtp_session->packet_size * 50))) { uint8_t data[2] = {0}; switch_frame_flag_t flags = SFF_NONE; data[0] = 127; - printf("WTF %u %u\n", rtp_session->timer.samplecount, (rtp_session->last_write_ts + (rtp_session->packet_size * 5))); rtp_session->last_write_ts = rtp_session->timer.samplecount; rtp_session->seq = ntohs(rtp_session->seq) + 1; rtp_session->seq = htons(rtp_session->seq);