]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix some regessions and sync namespace of some vars
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 16 Feb 2013 23:59:59 +0000 (17:59 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 1 Apr 2013 02:27:25 +0000 (21:27 -0500)
src/mod/applications/mod_fifo/mod_fifo.c
src/mod/applications/mod_fsv/mod_fsv.c
src/mod/applications/mod_mp4/mod_mp4.cpp
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/rtp.c
src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_core_media.c

index 685517beefc00c0c19b7378dad3ad509b013450d..f670ed06c6b7b6a4be9c01ce3bb4d3fbc9a4e157 100644 (file)
@@ -1415,9 +1415,9 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
 
        if (!total) goto end;
 
-       if ((codec = switch_event_get_header(pop, "variable_sip_use_codec_name"))) {
-               const char *rate = switch_event_get_header(pop, "variable_sip_use_codec_rate");
-               const char *ptime = switch_event_get_header(pop, "variable_sip_use_codec_ptime");
+       if ((codec = switch_event_get_header(pop, "variable_rtp_use_codec_name"))) {
+               const char *rate = switch_event_get_header(pop, "variable_rtp_use_codec_rate");
+               const char *ptime = switch_event_get_header(pop, "variable_rtp_use_codec_ptime");
                char nstr[256] = "";
 
                if (strcasecmp(codec, "PCMU") && strcasecmp(codec, "PCMA")) {
index 8a7e27c09c0d0092c2912ab9de664e0de91310ff..8eecd58e1e36f24719f20026969565027f731d2e 100644 (file)
@@ -337,7 +337,7 @@ SWITCH_STANDARD_APP(play_fsv_function)
                goto end;
        }
 
-       switch_channel_set_variable(channel, "sip_force_video_fmtp", h.video_fmtp);
+       switch_channel_set_variable(channel, "rtp_force_video_fmtp", h.video_fmtp);
        switch_channel_answer(channel);
 
        if ((read_vid_codec = switch_core_session_get_video_read_codec(session))) {
index 56cbf538770ccda6c3abcc247ddbb16aea83e32c..dfe93ea4cb03972588da4c520420eae5ab1efa46 100644 (file)
@@ -415,7 +415,7 @@ SWITCH_STANDARD_APP(play_mp4_function)
                }
                */
 
-               switch_channel_set_variable(channel, "sip_force_video_fmtp", vc.videoTrack().fmtp.c_str());
+               switch_channel_set_variable(channel, "rtp_force_video_fmtp", vc.videoTrack().fmtp.c_str());
                switch_channel_answer(channel);
 
                if ((read_vid_codec = switch_core_session_get_video_read_codec(session))) {
index 7d204b5257fbbc5a26892ffde9152518009ab7c2..f483a0c8c6cbccc639c346486bb7ab76fe61d9b8 100644 (file)
@@ -4274,7 +4274,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
                if (!(vval = switch_channel_get_variable(o_channel, "sip_copy_multipart")) || switch_true(vval)) {
                        switch_ivr_transfer_variable(session, nsession, SOFIA_MULTIPART_PREFIX_T);
                }
-               switch_ivr_transfer_variable(session, nsession, "sip_video_fmtp");
+               switch_ivr_transfer_variable(session, nsession, "rtp_video_fmtp");
                switch_ivr_transfer_variable(session, nsession, "sip-force-contact");
                switch_ivr_transfer_variable(session, nsession, "sip_sticky_contact");
                if (!cid_locked) {
index 46c69df20d6e8fd163e8999348f087fe9bf2b4d7..691395eeddba7e27de4ac75d129055ad9799d498 100644 (file)
@@ -646,7 +646,7 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
                                                                                  SWITCH_LOG_DEBUG, "Setting Jitterbuffer to %dms (%d frames) (%d max frames) (%d max drift)\n", 
                                                                                  len, qlen, maxqlen, max_drift);
                                                switch_channel_set_flag(tech_pvt->channel, CF_JITTERBUFFER);
-                                               if (!switch_false(switch_channel_get_variable(tech_pvt->channel, "sip_jitter_buffer_plc"))) {
+                                               if (!switch_false(switch_channel_get_variable(tech_pvt->channel, "rtp_jitter_buffer_plc"))) {
                                                        switch_channel_set_flag(tech_pvt->channel, CF_JITTERBUFFER_PLC);
                                                }
                                        } else {
index 5a788867fe31086415788c64ae7fc26bb93df519..7e8b8322364241cd8970bf90db77122d556743e2 100644 (file)
@@ -1829,14 +1829,14 @@ int sofia_recover_callback(switch_core_session_t *session)
        tech_pvt->mparams.remote_port = atoi(switch_str_nil(switch_channel_get_variable(channel, "sip_network_port")));
        tech_pvt->caller_profile = switch_channel_get_caller_profile(channel);
 
-       if ((tmp = switch_channel_get_variable(tech_pvt->channel, "sip_2833_send_payload"))) {
+       if ((tmp = switch_channel_get_variable(tech_pvt->channel, "rtp_2833_send_payload"))) {
                int te = atoi(tmp);
                if (te > 64) {
                        tech_pvt->te = te;
                } 
        }
 
-       if ((tmp = switch_channel_get_variable(tech_pvt->channel, "sip_2833_recv_payload"))) {
+       if ((tmp = switch_channel_get_variable(tech_pvt->channel, "rtp_2833_recv_payload"))) {
                int te = atoi(tmp);
                if (te > 64) {
                        tech_pvt->recv_te = te;
@@ -1884,7 +1884,7 @@ int sofia_recover_callback(switch_core_session_t *session)
        switch_core_session_get_recovery_crypto_key(session, SWITCH_MEDIA_TYPE_AUDIO, "srtp_remote_audio_crypto_key");
        switch_core_session_get_recovery_crypto_key(session, SWITCH_MEDIA_TYPE_VIDEO, "srtp_remote_video_crypto_key");
 
-       if ((tmp = switch_channel_get_variable(channel, "sip_local_sdp_str"))) {
+       if ((tmp = switch_channel_get_variable(channel, "rtp_local_sdp_str"))) {
                tech_pvt->mparams.local_sdp_str = switch_core_session_strdup(session, tmp);
        }
 
index 29a6853b48928d68563d5a35e14b18a0d0a8c5c1..1fb4ce510d03511b781d92e498c2d4782dccb3f0 100644 (file)
@@ -1283,7 +1283,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
                                                                                                          (int) codec_ms
                                                                                                          );
 
-                                                                       switch_channel_set_variable_printf(session->channel, "sip_h_X-Broken-PTIME", "Adv=%d;Sent=%d",
+                                                                       switch_channel_set_variable_printf(session->channel, "rtp_h_X-Broken-PTIME", "Adv=%d;Sent=%d",
                                                                                                                                           (int) engine->codec_ms, (int) codec_ms);
 
                                                                        engine->codec_ms = codec_ms;
@@ -1585,10 +1585,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_set_video_codec(switch_core_se
 
                        }
                        
-                       switch_channel_set_variable(session->channel, "sip_use_video_codec_name", v_engine->codec_params.rm_encoding);
-                       switch_channel_set_variable(session->channel, "sip_use_video_codec_fmtp", v_engine->codec_params.rm_fmtp);
-                       switch_channel_set_variable_printf(session->channel, "sip_use_video_codec_rate", "%d", v_engine->codec_params.rm_rate);
-                       switch_channel_set_variable_printf(session->channel, "sip_use_video_codec_ptime", "%d", 0);
+                       switch_channel_set_variable(session->channel, "rtp_use_video_codec_name", v_engine->codec_params.rm_encoding);
+                       switch_channel_set_variable(session->channel, "rtp_use_video_codec_fmtp", v_engine->codec_params.rm_fmtp);
+                       switch_channel_set_variable_printf(session->channel, "rtp_use_video_codec_rate", "%d", v_engine->codec_params.rm_rate);
+                       switch_channel_set_variable_printf(session->channel, "rtp_use_video_codec_ptime", "%d", 0);
 
                }
        }
@@ -1620,14 +1620,17 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_set_codec(switch_core_session_
                if (!force) {
                        switch_goto_status(SWITCH_STATUS_SUCCESS, end);
                }
-               if (strcasecmp(a_engine->read_impl.iananame, a_engine->codec_params.iananame) ||
-                       a_engine->read_impl.samples_per_second != a_engine->codec_params.rm_rate ||
-                       a_engine->codec_ms != (uint32_t) a_engine->read_impl.microseconds_per_packet / 1000) {
+               if (strcasecmp(a_engine->read_impl.iananame, a_engine->codec_params.rm_encoding) ||
+                       (uint32_t) a_engine->read_impl.microseconds_per_packet / 1000 != a_engine->codec_params.codec_ms ||
+                       a_engine->read_impl.samples_per_second != a_engine->codec_params.rm_rate ) {
+                       
 
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, 
                                                          "Changing Codec from %s@%dms@%dhz to %s@%dms@%luhz\n",
-                                                         a_engine->read_impl.iananame, a_engine->read_impl.microseconds_per_packet / 1000,
+                                                         a_engine->read_impl.iananame, 
+                                                         a_engine->read_impl.microseconds_per_packet / 1000,
                                                          a_engine->read_impl.samples_per_second,
+
                                                          a_engine->codec_params.rm_encoding, 
                                                          a_engine->codec_params.codec_ms,
                                                          a_engine->codec_params.rm_rate);
@@ -1679,10 +1682,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_set_codec(switch_core_session_
 
        a_engine->write_codec.session = session;
 
-       switch_channel_set_variable(session->channel, "sip_use_codec_name", a_engine->codec_params.iananame);
-       switch_channel_set_variable(session->channel, "sip_use_codec_fmtp", a_engine->codec_params.rm_fmtp);
-       switch_channel_set_variable_printf(session->channel, "sip_use_codec_rate", "%d", a_engine->codec_params.rm_rate);
-       switch_channel_set_variable_printf(session->channel, "sip_use_codec_ptime", "%d", a_engine->codec_params.codec_ms);
+       switch_channel_set_variable(session->channel, "rtp_use_codec_name", a_engine->codec_params.iananame);
+       switch_channel_set_variable(session->channel, "rtp_use_codec_fmtp", a_engine->codec_params.rm_fmtp);
+       switch_channel_set_variable_printf(session->channel, "rtp_use_codec_rate", "%d", a_engine->codec_params.rm_rate);
+       switch_channel_set_variable_printf(session->channel, "rtp_use_codec_ptime", "%d", a_engine->codec_params.codec_ms);
 
 
        switch_assert(a_engine->read_codec.implementation);
@@ -2061,21 +2064,21 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
        greedy = !!switch_media_handle_test_media_flag(smh, SCMF_CODEC_GREEDY);
        scrooge = !!switch_media_handle_test_media_flag(smh, SCMF_CODEC_SCROOGE);
 
-       if ((val = switch_channel_get_variable(channel, "sip_codec_negotiation"))) {
+       if ((val = switch_channel_get_variable(channel, "rtp_codec_negotiation"))) {
                if (!strcasecmp(val, "generous")) {
                        greedy = 0;
                        scrooge = 0;
-                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : generous\n" );
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "rtp_codec_negotiation overriding sofia inbound-codec-negotiation : generous\n" );
                } else if (!strcasecmp(val, "greedy")) {
                        greedy = 1;
                        scrooge = 0;
-                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : greedy\n" );
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "rtp_codec_negotiation overriding sofia inbound-codec-negotiation : greedy\n" );
                } else if (!strcasecmp(val, "scrooge")) {
                        scrooge = 1;
                        greedy = 1;
-                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : scrooge\n" );
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "rtp_codec_negotiation overriding sofia inbound-codec-negotiation : scrooge\n" );
                } else {
-                   switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation ignored invalid value : '%s' \n", val );    
+                   switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "rtp_codec_negotiation ignored invalid value : '%s' \n", val );    
                }               
        }
 
@@ -2101,7 +2104,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                }
        }
 
-       if ((val = switch_channel_get_variable(session->channel, "sip_liberal_dtmf")) && switch_true(val)) {
+       if ((val = switch_channel_get_variable(session->channel, "rtp_liberal_dtmf")) && switch_true(val)) {
                switch_channel_set_flag(session->channel, CF_LIBERAL_DTMF);
        }
 
@@ -2149,7 +2152,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
 
 
        if (switch_media_handle_test_media_flag(smh, SCMF_DISABLE_HOLD) ||
-               ((val = switch_channel_get_variable(session->channel, "sip_disable_hold")) && switch_true(val))) {
+               ((val = switch_channel_get_variable(session->channel, "rtp_disable_hold")) && switch_true(val))) {
                sendonly = 0;
        } else {
 
@@ -2158,7 +2161,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                        if (switch_core_media_toggle_hold(session, sendonly)) {
                                reneg = switch_media_handle_test_media_flag(smh, SCMF_RENEG_ON_HOLD);
                                
-                               if ((val = switch_channel_get_variable(session->channel, "sip_renegotiate_codec_on_hold"))) {
+                               if ((val = switch_channel_get_variable(session->channel, "rtp_renegotiate_codec_on_hold"))) {
                                        reneg = switch_true(val);
                                }
                        }
@@ -2169,7 +2172,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
        if (reneg) {
                reneg = switch_media_handle_test_media_flag(smh, SCMF_RENEG_ON_REINVITE);
                
-               if ((val = switch_channel_get_variable(session->channel, "sip_renegotiate_codec_on_reinvite"))) {
+               if ((val = switch_channel_get_variable(session->channel, "rtp_renegotiate_codec_on_reinvite"))) {
                        reneg = switch_true(val);
                }
        }
@@ -2337,7 +2340,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                        for (attr = m->m_attributes; attr; attr = attr->a_next) {
 
                                if (!strcasecmp(attr->a_name, "rtcp") && attr->a_value) {
-                                       switch_channel_set_variable(session->channel, "sip_remote_audio_rtcp_port", attr->a_value);
+                                       switch_channel_set_variable(session->channel, "rtp_remote_audio_rtcp_port", attr->a_value);
                                        a_engine->remote_rtcp_port = atoi(attr->a_value);
                                } else if (!strcasecmp(attr->a_name, "ptime") && attr->a_value) {
                                        ptime = atoi(attr->a_value);
@@ -2348,7 +2351,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                                        int crypto_tag;
 
                                        if (!(smh->mparams->ndlb & SM_NDLB_ALLOW_CRYPTO_IN_AVP) && 
-                                               !switch_true(switch_channel_get_variable(session->channel, "sip_allow_crypto_in_avp"))) {
+                                               !switch_true(switch_channel_get_variable(session->channel, "rtp_allow_crypto_in_avp"))) {
                                                if (m->m_proto != sdp_proto_srtp && !got_webrtc) {
                                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "a=crypto in RTP/AVP, refer to rfc3711\n");
                                                        match = 0;
@@ -2664,21 +2667,21 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Set 2833 dtmf send payload to %u\n", best_te);
                                        if (a_engine->rtp_session) {
                                                switch_rtp_set_telephony_event(a_engine->rtp_session, (switch_payload_t) best_te);
-                                               switch_channel_set_variable_printf(session->channel, "sip_2833_send_payload", "%d", best_te);
+                                               switch_channel_set_variable_printf(session->channel, "rtp_2833_send_payload", "%d", best_te);
                                        }
                                } else {
                                        te = smh->mparams->recv_te = smh->mparams->te = (switch_payload_t) best_te;
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Set 2833 dtmf send/recv payload to %u\n", te);
                                        if (a_engine->rtp_session) {
                                                switch_rtp_set_telephony_event(a_engine->rtp_session, te);
-                                               switch_channel_set_variable_printf(session->channel, "sip_2833_send_payload", "%d", te);
+                                               switch_channel_set_variable_printf(session->channel, "rtp_2833_send_payload", "%d", te);
                                                switch_rtp_set_telephony_recv_event(a_engine->rtp_session, te);
-                                               switch_channel_set_variable_printf(session->channel, "sip_2833_recv_payload", "%d", te);
+                                               switch_channel_set_variable_printf(session->channel, "rtp_2833_recv_payload", "%d", te);
                                        }
                                }
                        } else {
                                /* by default, use SIP INFO if 2833 is not in the SDP */
-                               if (!switch_false(switch_channel_get_variable(channel, "sip_info_when_no_2833"))) {
+                               if (!switch_false(switch_channel_get_variable(channel, "rtp_info_when_no_2833"))) {
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "No 2833 in SDP.  Disable 2833 dtmf and switch to INFO\n");
                                        switch_channel_set_variable(session->channel, "dtmf_type", "info");
                                        smh->mparams->dtmf_type = DTMF_INFO;
@@ -2730,13 +2733,13 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                                                //framerate = atoi(attr->a_value);
                                        }
                                        if (!strcasecmp(attr->a_name, "rtcp") && attr->a_value) {
-                                               switch_channel_set_variable(session->channel, "sip_remote_video_rtcp_port", attr->a_value);
+                                               switch_channel_set_variable(session->channel, "rtp_remote_video_rtcp_port", attr->a_value);
                                                v_engine->remote_rtcp_port = atoi(attr->a_value);
                                        } else if (!got_video_crypto && !strcasecmp(attr->a_name, "crypto") && !zstr(attr->a_value)) {
                                                int crypto_tag;
                                                
                                                if (!(smh->mparams->ndlb & SM_NDLB_ALLOW_CRYPTO_IN_AVP) && 
-                                                       !switch_true(switch_channel_get_variable(session->channel, "sip_allow_crypto_in_avp"))) {
+                                                       !switch_true(switch_channel_get_variable(session->channel, "rtp_allow_crypto_in_avp"))) {
                                                        if (m->m_proto != sdp_proto_srtp && !got_webrtc) {
                                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "a=crypto in RTP/AVP, refer to rfc3711\n");
                                                                match = 0;
@@ -2790,7 +2793,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                                if (mimp) {
                                        if ((v_engine->codec_params.rm_encoding = switch_core_session_strdup(session, (char *) rm_encoding))) {
                                                char tmp[50];
-                                               const char *mirror = switch_channel_get_variable(session->channel, "sip_mirror_remote_video_codec_payload");
+                                               const char *mirror = switch_channel_get_variable(session->channel, "rtp_mirror_remote_video_codec_payload");
 
                                                v_engine->codec_params.pt = (switch_payload_t) map->rm_pt;
                                                v_engine->codec_params.rm_rate = map->rm_rate;
@@ -2806,9 +2809,9 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                                                switch_snprintf(tmp, sizeof(tmp), "%d", v_engine->codec_params.remote_sdp_port);
                                                switch_channel_set_variable(session->channel, SWITCH_REMOTE_VIDEO_IP_VARIABLE, v_engine->codec_params.remote_sdp_ip);
                                                switch_channel_set_variable(session->channel, SWITCH_REMOTE_VIDEO_PORT_VARIABLE, tmp);
-                                               switch_channel_set_variable(session->channel, "sip_video_fmtp", v_engine->codec_params.rm_fmtp);
+                                               switch_channel_set_variable(session->channel, "rtp_video_fmtp", v_engine->codec_params.rm_fmtp);
                                                switch_snprintf(tmp, sizeof(tmp), "%d", v_engine->codec_params.agreed_pt);
-                                               switch_channel_set_variable(session->channel, "sip_video_pt", tmp);
+                                               switch_channel_set_variable(session->channel, "rtp_video_pt", tmp);
                                                switch_core_media_check_video_codecs(session);
 
                                                v_engine->codec_params.recv_pt = (switch_payload_t)map->rm_pt;
@@ -2818,7 +2821,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                                                }
 
                                                switch_snprintf(tmp, sizeof(tmp), "%d", v_engine->codec_params.recv_pt);
-                                               switch_channel_set_variable(session->channel, "sip_video_recv_pt", tmp);
+                                               switch_channel_set_variable(session->channel, "rtp_video_recv_pt", tmp);
                                                if (!match && vmatch) match = 1;
 
                                                check_ice(smh, SWITCH_MEDIA_TYPE_VIDEO, sdp, m);
@@ -3061,7 +3064,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_proxy_remote_addr(switch_core_
                                switch_port_t remote_rtcp_port = v_engine->remote_rtcp_port;
 
                                if (!remote_rtcp_port) {
-                                       if ((rport = switch_channel_get_variable(session->channel, "sip_remote_video_rtcp_port"))) {
+                                       if ((rport = switch_channel_get_variable(session->channel, "rtp_remote_video_rtcp_port"))) {
                                                remote_rtcp_port = (switch_port_t)atoi(rport);
                                        }
                                }
@@ -3099,7 +3102,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_proxy_remote_addr(switch_core_
                        switch_goto_status(SWITCH_STATUS_BREAK, end);
                }
 
-               if ((rport = switch_channel_get_variable(session->channel, "sip_remote_audio_rtcp_port"))) {
+               if ((rport = switch_channel_get_variable(session->channel, "rtp_remote_audio_rtcp_port"))) {
                        remote_rtcp_port = (switch_port_t)atoi(rport);
                }
 
@@ -3621,7 +3624,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
                switch_port_t remote_rtcp_port = a_engine->remote_rtcp_port;
                                
                if (!remote_rtcp_port) {
-                       if ((rport = switch_channel_get_variable(session->channel, "sip_remote_audio_rtcp_port"))) {
+                       if ((rport = switch_channel_get_variable(session->channel, "rtp_remote_audio_rtcp_port"))) {
                                remote_rtcp_port = (switch_port_t)atoi(rport);
                        }
                }
@@ -3706,7 +3709,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
 
                switch_channel_set_flag(session->channel, CF_FS_RTP);
 
-               switch_channel_set_variable_printf(session->channel, "sip_use_pt", "%d", a_engine->codec_params.agreed_pt);
+               switch_channel_set_variable_printf(session->channel, "rtp_use_pt", "%d", a_engine->codec_params.agreed_pt);
 
                if ((val = switch_channel_get_variable(session->channel, "rtp_enable_vad_in")) && switch_true(val)) {
                        vad_in = 1;
@@ -3794,7 +3797,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
 
 
                if ((val = switch_channel_get_variable(session->channel, "rtcp_audio_interval_msec")) || (val = smh->mparams->rtcp_audio_interval_msec)) {
-                       const char *rport = switch_channel_get_variable(session->channel, "sip_remote_audio_rtcp_port");
+                       const char *rport = switch_channel_get_variable(session->channel, "rtp_remote_audio_rtcp_port");
                        switch_port_t remote_rtcp_port = a_engine->remote_rtcp_port;
 
                        if (!remote_rtcp_port && rport) {
@@ -3895,7 +3898,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), 
                                                                          SWITCH_LOG_DEBUG, "Setting Jitterbuffer to %dms (%d frames)\n", jb_msec, qlen);
                                        switch_channel_set_flag(session->channel, CF_JITTERBUFFER);
-                                       if (!switch_false(switch_channel_get_variable(session->channel, "sip_jitter_buffer_plc"))) {
+                                       if (!switch_false(switch_channel_get_variable(session->channel, "rtp_jitter_buffer_plc"))) {
                                                switch_channel_set_flag(session->channel, CF_JITTERBUFFER_PLC);
                                        }
                                } else {
@@ -3936,13 +3939,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
                if (smh->mparams->te) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Set 2833 dtmf send payload to %u\n", smh->mparams->te);
                        switch_rtp_set_telephony_event(a_engine->rtp_session, smh->mparams->te);
-                       switch_channel_set_variable_printf(session->channel, "sip_2833_send_payload", "%d", smh->mparams->te);
+                       switch_channel_set_variable_printf(session->channel, "rtp_2833_send_payload", "%d", smh->mparams->te);
                }
 
                if (smh->mparams->recv_te) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Set 2833 dtmf receive payload to %u\n", smh->mparams->recv_te);
                        switch_rtp_set_telephony_recv_event(a_engine->rtp_session, smh->mparams->recv_te);
-                       switch_channel_set_variable_printf(session->channel, "sip_2833_recv_payload", "%d", smh->mparams->recv_te);
+                       switch_channel_set_variable_printf(session->channel, "rtp_2833_recv_payload", "%d", smh->mparams->recv_te);
                }
 
                if (a_engine->codec_params.recv_pt != a_engine->codec_params.agreed_pt) {
@@ -4047,7 +4050,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
                                switch_channel_clear_flag(session->channel, CF_REINVITE);
 
                                if (!remote_rtcp_port) {
-                                       if ((rport = switch_channel_get_variable(session->channel, "sip_remote_video_rtcp_port"))) {
+                                       if ((rport = switch_channel_get_variable(session->channel, "rtp_remote_video_rtcp_port"))) {
                                                remote_rtcp_port = (switch_port_t)atoi(rport);
                                        }
                                }
@@ -4191,7 +4194,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
 
 
                                if ((val = switch_channel_get_variable(session->channel, "rtcp_video_interval_msec")) || (val = smh->mparams->rtcp_video_interval_msec)) {
-                                       const char *rport = switch_channel_get_variable(session->channel, "sip_remote_video_rtcp_port");
+                                       const char *rport = switch_channel_get_variable(session->channel, "rtp_remote_video_rtcp_port");
                                        switch_port_t remote_port = v_engine->remote_rtcp_port;
                                        if (rport) {
                                                remote_port = (switch_port_t)atoi(rport);
@@ -4262,7 +4265,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
                                        switch_rtp_set_recv_pt(v_engine->rtp_session, v_engine->codec_params.recv_pt);
                                }
 
-                               switch_channel_set_variable_printf(session->channel, "sip_use_video_pt", "%d", v_engine->codec_params.agreed_pt);
+                               switch_channel_set_variable_printf(session->channel, "rtp_use_video_pt", "%d", v_engine->codec_params.agreed_pt);
                                v_engine->ssrc = switch_rtp_get_ssrc(v_engine->rtp_session);
                                switch_channel_set_variable_printf(session->channel, "rtp_use_video_ssrc", "%u", v_engine->ssrc);
 
@@ -4688,7 +4691,7 @@ SWITCH_DECLARE(void)switch_core_media_set_local_sdp(switch_core_session_t *sessi
 
        if (smh->mparams->mutex) switch_mutex_lock(smh->mparams->mutex);
        smh->mparams->local_sdp_str = dup ? switch_core_session_strdup(session, sdp_str) : (char *) sdp_str;
-       switch_channel_set_variable(session->channel, "sip_local_sdp_str", smh->mparams->local_sdp_str);
+       switch_channel_set_variable(session->channel, "rtp_local_sdp_str", smh->mparams->local_sdp_str);
        if (smh->mparams->mutex) switch_mutex_unlock(smh->mparams->mutex);
 }
 
@@ -4704,14 +4707,14 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
        int use_cng = 1;
        const char *val;
        const char *family;
-       const char *pass_fmtp = switch_channel_get_variable(session->channel, "sip_video_fmtp");
-       const char *ov_fmtp = switch_channel_get_variable(session->channel, "sip_force_video_fmtp");
-       const char *append_audio = switch_channel_get_variable(session->channel, "sip_append_audio_sdp");
+       const char *pass_fmtp = switch_channel_get_variable(session->channel, "rtp_video_fmtp");
+       const char *ov_fmtp = switch_channel_get_variable(session->channel, "rtp_force_video_fmtp");
+       const char *append_audio = switch_channel_get_variable(session->channel, "rtp_append_audio_sdp");
        char srbuf[128] = "";
        const char *var_val;
        const char *username;
        const char *fmtp_out;
-       const char *fmtp_out_var = switch_channel_get_variable(session->channel, "sip_force_audio_fmtp");
+       const char *fmtp_out_var = switch_channel_get_variable(session->channel, "rtp_force_audio_fmtp");
        switch_event_t *map = NULL, *ptmap = NULL;
        const char *b_sdp = NULL;
        int verbose_sdp = 0;
@@ -5228,7 +5231,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
                                        pass_fmtp = NULL;
 
                                        if (switch_channel_get_partner_uuid(session->channel)) {
-                                               if ((of = switch_channel_get_variable_partner(session->channel, "sip_video_fmtp"))) {
+                                               if ((of = switch_channel_get_variable_partner(session->channel, "rtp_video_fmtp"))) {
                                                        pass_fmtp = of;
                                                }
                                        }
@@ -5236,7 +5239,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
                                        if (ov_fmtp) {
                                                pass_fmtp = ov_fmtp;
                                        }// else { // seems to break eyebeam at least...
-                                               //pass_fmtp = switch_channel_get_variable(session->channel, "sip_video_fmtp");
+                                               //pass_fmtp = switch_channel_get_variable(session->channel, "rtp_video_fmtp");
                                        //}
                                }
 
@@ -6059,7 +6062,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
                                                                                  SWITCH_LOG_DEBUG, "Setting Jitterbuffer to %dms (%d frames) (%d max frames) (%d max drift)\n", 
                                                                                  len, qlen, maxqlen, max_drift);
                                                switch_channel_set_flag(session->channel, CF_JITTERBUFFER);
-                                               if (!switch_false(switch_channel_get_variable(session->channel, "sip_jitter_buffer_plc"))) {
+                                               if (!switch_false(switch_channel_get_variable(session->channel, "rtp_jitter_buffer_plc"))) {
                                                        switch_channel_set_flag(session->channel, CF_JITTERBUFFER_PLC);
                                                }
                                        } else {
@@ -6110,7 +6113,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
                                const char *val;
                                int ok = 0;
                                
-                               if (!(val = switch_channel_get_variable(session->channel, "sip_jitter_buffer_during_bridge")) || switch_false(val)) {
+                               if (!(val = switch_channel_get_variable(session->channel, "rtp_jitter_buffer_during_bridge")) || switch_false(val)) {
                                        if (switch_channel_test_flag(session->channel, CF_JITTERBUFFER) && switch_channel_test_cap_partner(session->channel, CC_FS_RTP)) {
                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
                                                                                  "%s PAUSE Jitterbuffer\n", switch_channel_get_name(session->channel));                                        
@@ -6970,6 +6973,7 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s
        port = switch_channel_get_variable(session->channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE);
 
 
+
        if (switch_channel_test_flag(session->channel, CF_PROXY_MODE)  || !(ip && port)) {
                return;
        } else {
@@ -6982,20 +6986,32 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s
        v_engine = &smh->engines[SWITCH_MEDIA_TYPE_VIDEO];
 
 
-       a_engine->codec_params.iananame = a_engine->codec_params.rm_encoding = (char *) switch_channel_get_variable(session->channel, "sip_use_codec_name");
-       a_engine->codec_params.rm_fmtp = (char *) switch_channel_get_variable(session->channel, "sip_use_codec_fmtp");
+       a_engine->codec_params.iananame = a_engine->codec_params.rm_encoding = (char *) switch_channel_get_variable(session->channel, "rtp_use_codec_name");
+       a_engine->codec_params.rm_fmtp = (char *) switch_channel_get_variable(session->channel, "rtp_use_codec_fmtp");
+
+       if ((tmp = switch_channel_get_variable(session->channel, "rtp_2833_send_payload"))) {
+               smh->mparams->te = atoi(tmp);
+       }
 
-       if ((tmp = switch_channel_get_variable(session->channel, "sip_use_codec_rate"))) {
+       if ((tmp = switch_channel_get_variable(session->channel, "rtp_2833_recv_payload"))) {
+               smh->mparams->recv_te = atoi(tmp);
+       }
+
+       if ((tmp = switch_channel_get_variable(session->channel, "rtp_use_codec_rate"))) {
                a_engine->codec_params.rm_rate = atoi(tmp);
        }
 
-       if ((tmp = switch_channel_get_variable(session->channel, "sip_use_codec_ptime"))) {
+       if ((tmp = switch_channel_get_variable(session->channel, "rtp_use_codec_ptime"))) {
                a_engine->codec_params.codec_ms = atoi(tmp);
        }
 
-       if ((tmp = switch_channel_get_variable(session->channel, "sip_use_pt"))) {
+       if ((tmp = switch_channel_get_variable(session->channel, "rtp_use_pt"))) {
                a_engine->codec_params.pt = a_engine->codec_params.agreed_pt = (switch_payload_t)atoi(tmp);
        }
+
+       if ((tmp = switch_channel_get_variable(session->channel, "rtp_audio_recv_pt"))) {
+               a_engine->codec_params.recv_pt = a_engine->codec_params.agreed_pt = (switch_payload_t)atoi(tmp);;
+       }
                        
        switch_core_media_set_codec(session, 1, smh->mparams->codec_flags);
 
@@ -7017,13 +7033,16 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s
        }
 
        if (switch_channel_test_flag(session->channel, CF_VIDEO)) {
-               if ((tmp = switch_channel_get_variable(session->channel, "sip_use_video_pt"))) {
+               if ((tmp = switch_channel_get_variable(session->channel, "rtp_use_video_pt"))) {
                        v_engine->codec_params.pt = v_engine->codec_params.agreed_pt = (switch_payload_t)atoi(tmp);
                }
+               
+               if ((tmp = switch_channel_get_variable(session->channel, "rtp_video_recv_pt"))) {
+                       v_engine->codec_params.recv_pt = a_engine->codec_params.agreed_pt = (switch_payload_t)atoi(tmp);;
+               }
 
-
-               v_engine->codec_params.rm_encoding = (char *) switch_channel_get_variable(session->channel, "sip_use_video_codec_name");
-               v_engine->codec_params.rm_fmtp = (char *) switch_channel_get_variable(session->channel, "sip_use_video_codec_fmtp");
+               v_engine->codec_params.rm_encoding = (char *) switch_channel_get_variable(session->channel, "rtp_use_video_codec_name");
+               v_engine->codec_params.rm_fmtp = (char *) switch_channel_get_variable(session->channel, "rtp_use_video_codec_fmtp");
 
                ip = switch_channel_get_variable(session->channel, SWITCH_LOCAL_VIDEO_IP_VARIABLE);
                port = switch_channel_get_variable(session->channel, SWITCH_LOCAL_VIDEO_PORT_VARIABLE);
@@ -7032,11 +7051,11 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s
 
                switch_channel_set_flag(session->channel, CF_VIDEO_POSSIBLE);
 
-               if ((tmp = switch_channel_get_variable(session->channel, "sip_use_video_codec_rate"))) {
+               if ((tmp = switch_channel_get_variable(session->channel, "rtp_use_video_codec_rate"))) {
                        v_engine->codec_params.rm_rate = atoi(tmp);
                }
 
-               if ((tmp = switch_channel_get_variable(session->channel, "sip_use_video_codec_ptime"))) {
+               if ((tmp = switch_channel_get_variable(session->channel, "rtp_use_video_codec_ptime"))) {
                        v_engine->codec_params.codec_ms = atoi(tmp);
                }
 
@@ -7054,17 +7073,16 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s
        if (switch_core_media_activate_rtp(session) != SWITCH_STATUS_SUCCESS) {
                return;
        }
-                       
+
+
        if (switch_core_media_ready(session, SWITCH_MEDIA_TYPE_AUDIO)) {
-               if ((tmp = switch_channel_get_variable(session->channel, "sip_audio_recv_pt"))) {
-                       switch_core_media_set_recv_pt(session, SWITCH_MEDIA_TYPE_AUDIO, (switch_payload_t)atoi(tmp));
-               }
+               switch_core_media_set_recv_pt(session, SWITCH_MEDIA_TYPE_AUDIO, a_engine->codec_params.recv_pt);
+               switch_rtp_set_telephony_event(a_engine->rtp_session, smh->mparams->te);
+               switch_rtp_set_telephony_recv_event(a_engine->rtp_session, smh->mparams->recv_te);
        }
 
        if (switch_core_media_ready(session, SWITCH_MEDIA_TYPE_VIDEO)) {
-               if ((tmp = switch_channel_get_variable(session->channel, "sip_video_recv_pt"))) {
-                       switch_core_media_set_recv_pt(session, SWITCH_MEDIA_TYPE_AUDIO, (switch_payload_t)atoi(tmp));
-               }
+               switch_core_media_set_recv_pt(session, SWITCH_MEDIA_TYPE_VIDEO, v_engine->codec_params.recv_pt);
        }
 
 }