]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix for FSCORE-191
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 18 Sep 2008 13:03:58 +0000 (13:03 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 18 Sep 2008 13:03:58 +0000 (13:03 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9589 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_rtp.c

index 140ac6044e3a9360a5f38391677cb844ec8338b8..956948d1ca4b8a2ac89c1d6c28c32edc1c88c483 100644 (file)
@@ -52,6 +52,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
                ((val = switch_channel_get_variable(tech_pvt->channel, "supress_cng")) && switch_true(val)) ||
                ((val = switch_channel_get_variable(tech_pvt->channel, "suppress_cng")) && switch_true(val))) {
                use_cng = 0;
+               tech_pvt->cng_pt = 0;
        }
 
        if (!force && !ip && !sr
@@ -1921,6 +1922,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
                        switch_rtp_set_telephony_event(tech_pvt->rtp_session, tech_pvt->te);
                }
                if (tech_pvt->cng_pt) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set comfort noise payload to %u\n", tech_pvt->cng_pt);
                        switch_rtp_set_cng_pt(tech_pvt->rtp_session, tech_pvt->cng_pt);
                }
 
@@ -2275,10 +2277,9 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
 
                                if (!cng_pt && !strcasecmp(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_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set comfort noise payload to %u\n", cng_pt);
                                                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);
                                        }
                                }
 
index 97d7d719e98ad0e8fc575cae41440a478f920615..05ccf70a900447efa69aa858047f841b6fd2ab18 100644 (file)
@@ -903,6 +903,7 @@ SWITCH_DECLARE(void) switch_rtp_set_telephony_event(switch_rtp_t *rtp_session, s
 SWITCH_DECLARE(void) switch_rtp_set_cng_pt(switch_rtp_t *rtp_session, switch_payload_t pt)
 {
        rtp_session->cng_pt = pt;
+       switch_set_flag(rtp_session, SWITCH_RTP_FLAG_AUTO_CNG);
 }
 
 SWITCH_DECLARE(switch_status_t) switch_rtp_activate_stun_ping(switch_rtp_t *rtp_session, const char *stun_ip, switch_port_t stun_port,