]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add RTP_BUG_IGNORE_MARK_BIT to list of bug tolerances
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 7 Jun 2010 19:06:41 +0000 (14:06 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 7 Jun 2010 19:06:41 +0000 (14:06 -0500)
src/include/switch_types.h
src/mod/endpoints/mod_sofia/sofia.c
src/switch_rtp.c

index 02f21a04d370b24c3986ec2c2641b52de7d7e2d8..d4f328802c261a907438e2f414907cfd5f6cbca8 100644 (file)
@@ -554,7 +554,7 @@ typedef enum {
         */
 
 
-       RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833 = (1 << 1)
+       RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833 = (1 << 1),
                /*
                   Sonus wrongly expects that, when sending a multi-packet 2833 DTMF event, The sender
                   should increment the RTP timestamp in each packet when, in reality, the sender should
@@ -573,6 +573,19 @@ typedef enum {
 
                   This flag will cause each packet to have a new timestamp.
                 */
+
+
+       RTP_BUG_IGNORE_MARK_BIT = (1 << 2)
+
+       /*
+         A Huawei SBC has been discovered that sends the mark bit on every single RTP packet.
+         Since this causes the RTP stack to flush it's buffers, it horribly messes up the timing on the channel.
+
+         This flag will do nothing when an inbound packet contains the mark bit.
+
+        */
+
+
 } switch_rtp_bug_flag_t;
 
 #ifdef _MSC_VER
index cb709d12b889de508febf32601380f155205646e..2d5c43eafaa716a1c3eac1b036363811b1a5f8f1 100644 (file)
@@ -2125,6 +2125,13 @@ static void parse_rtp_bugs(sofia_profile_t *profile, const char *str)
                profile->auto_rtp_bugs &= ~RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833;
        }
 
+       if (switch_stristr("RTP_BUG_IGNORE_MARK_BIT", str)) {
+               profile->auto_rtp_bugs |= RTP_BUG_IGNORE_MARK_BIT;
+       }       
+
+       if (switch_stristr("~RTP_BUG_IGNORE_MARK_BIT", str)) {
+               profile->auto_rtp_bugs &= ~RTP_BUG_IGNORE_MARK_BIT;
+       }       
 
 }
 
index 13edd4d330c57ca9b5b3aac79e28a177ed432268..0efbf24e973744e5b24c35c5b097bc4aa52192e8 100644 (file)
@@ -2043,7 +2043,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
 
        if (rtp_session->jb && rtp_session->recv_msg.header.version == 2 && *bytes) {
                if (rtp_session->recv_msg.header.m && rtp_session->recv_msg.header.pt != rtp_session->recv_te && 
-                       !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
+                       !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO) && !(rtp_session->rtp_bugs & RTP_BUG_IGNORE_MARK_BIT)) {
                        stfu_n_reset(rtp_session->jb);
                }
 
@@ -2395,7 +2395,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                }
 
                if (bytes && rtp_session->recv_msg.header.m && rtp_session->recv_msg.header.pt != rtp_session->recv_te && 
-                       !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
+                       !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO) && !(rtp_session->rtp_bugs & RTP_BUG_IGNORE_MARK_BIT)) {
                        rtp_flush_read_buffer(rtp_session, SWITCH_RTP_FLUSH_ONCE);
                }