]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add rtp_manual_video_rtp_bugs
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 16 Oct 2012 22:42:54 +0000 (18:42 -0400)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 16 Oct 2012 22:43:00 +0000 (18:43 -0400)
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_rtp.c

index 939ced971a50d336800f7c1c90338860176b0eee..3f26a26fff7f2223e2944fc4c1a080f4a1f79284 100644 (file)
@@ -1885,6 +1885,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                sofia_glue_check_video_codecs(tech_pvt);
                                sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 1);
                                sofia_set_pflag(tech_pvt->profile, PFLAG_RENEG_ON_REINVITE);
+                               sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
                        }
                        
                        sofia_glue_do_invite(session);
index ec78404542a0bb836fa831c47b166af0425e3ac7..d195c3482f6411e93032e2abc6410858fad3b585 100644 (file)
@@ -653,6 +653,7 @@ struct sofia_profile {
        uint32_t max_registrations_perext;
        switch_rtp_bug_flag_t auto_rtp_bugs;
        switch_rtp_bug_flag_t manual_rtp_bugs;
+       switch_rtp_bug_flag_t manual_video_rtp_bugs;
        uint32_t ib_calls;
        uint32_t ob_calls;
        uint32_t ib_failed_calls;
@@ -821,6 +822,7 @@ struct private_object {
        uint8_t codec_reinvites;
        nua_event_t want_event;
        switch_rtp_bug_flag_t rtp_bugs;
+       switch_rtp_bug_flag_t video_rtp_bugs;
        switch_codec_implementation_t read_impl;
        switch_codec_implementation_t write_impl;
        char *user_via;
index 488a73586ae2c03de2382a73ef209e1a364772b9..0b50da6d6823321f639664f1284f88f7c8799629 100644 (file)
@@ -4621,6 +4621,8 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                sofia_glue_parse_rtp_bugs(&profile->auto_rtp_bugs, val);
                                        } else if (!strcasecmp(var, "manual-rtp-bugs")) {
                                                sofia_glue_parse_rtp_bugs(&profile->manual_rtp_bugs, val);
+                                       } else if (!strcasecmp(var, "manual-video-rtp-bugs")) {
+                                               sofia_glue_parse_rtp_bugs(&profile->manual_video_rtp_bugs, val);
                                        } else if (!strcasecmp(var, "dbname")) {
                                                profile->dbname = switch_core_strdup(profile->pool, val);
                                        } else if (!strcasecmp(var, "presence-hosts")) {
index d1a335693f24c6b7a1a54008bec64409b9e4e2c2..8568a5bc42a853f03f93eee9c4338c2904539ce1 100644 (file)
@@ -2967,6 +2967,7 @@ switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int
 
                                switch_core_session_receive_message(tech_pvt->session, &msg);
 
+
                        }
 
                        switch_channel_set_variable(tech_pvt->channel, "sip_use_video_codec_name", tech_pvt->video_rm_encoding);
@@ -3702,6 +3703,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
                        switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_VIDEO_IP_VARIABLE, tech_pvt->adv_sdp_audio_ip);
                        switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_VIDEO_PORT_VARIABLE, tmp);
 
+
                        if (tech_pvt->video_rtp_session && sofia_test_flag(tech_pvt, TFLAG_REINVITE)) {
                                const char *rport = NULL;
                                switch_port_t remote_rtcp_port = 0;
@@ -3815,6 +3817,13 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
                                }
 
 
+
+                               if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_manual_video_rtp_bugs"))) {
+                                       sofia_glue_parse_rtp_bugs(&tech_pvt->video_rtp_bugs, val);
+                               }
+                               
+                               switch_rtp_intentional_bugs(tech_pvt->video_rtp_session, tech_pvt->video_rtp_bugs | tech_pvt->profile->manual_video_rtp_bugs);
+
                                if (tech_pvt->video_recv_pt != tech_pvt->video_agreed_pt) {
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, 
                                                                          "%s Set video receive payload to %u\n", switch_channel_get_name(tech_pvt->channel), tech_pvt->video_recv_pt);
@@ -5314,7 +5323,6 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
                                        }
                                }
 
-
                                if (mimp) {
                                        if ((tech_pvt->video_rm_encoding = switch_core_session_strdup(session, (char *) rm_encoding))) {
                                                char tmp[50];
index ab7bc29eb12288406d3a6834815665bc1797f6e2..93eb42c6951f418c3ec4323160c77edbe93d546e 100644 (file)
@@ -3456,9 +3456,9 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                        rtp_session->recv_msg.header.pt != 13 && 
                        rtp_session->recv_msg.header.pt != rtp_session->recv_te && 
                        (!rtp_session->cng_pt || rtp_session->recv_msg.header.pt != rtp_session->cng_pt) && 
-                       rtp_session->recv_msg.header.pt != rtp_session->rpayload) {
+                       rtp_session->recv_msg.header.pt != rtp_session->rpayload && !(rtp_session->rtp_bugs & RTP_BUG_ACCEPT_ANY_PACKETS)) {
                        /* drop frames of incorrect payload number and return CNG frame instead */
-                       return_cng_frame();
+                       return_cng_frame();                     
                }
 
                if (!bytes && (io_flags & SWITCH_IO_FLAG_NOBLOCK)) {