]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add stupid 2833 crap
authorAnthony Minessale <anthony.minessale@gmail.com>
Sun, 28 Jan 2007 02:38:52 +0000 (02:38 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sun, 28 Jan 2007 02:38:52 +0000 (02:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4070 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/mod/endpoints/mod_sofia/mod_sofia.c
src/switch_rtp.c

index 569b168d8e29df9ce27c05784cd6d7e5718ee365..da384d4741546aef64b69b2c42fe72049686a3cf 100644 (file)
@@ -240,6 +240,7 @@ typedef enum {
        SWITCH_RTP_FLAG_MINI              - Use mini RTP when possible
        SWITCH_RTP_FLAG_DATAWAIT          - Do not return from reads unless there is data even when non blocking
        SWITCH_RTP_FLAG_BUGGY_2833    - Emulate the bug in cisco equipment to allow interop
+       SWITCH_RTP_FLAG_PASS_RFC2833     - Pass 2833 (ignore it)
 </pre>
  */
 typedef enum {
@@ -255,7 +256,8 @@ typedef enum {
        SWITCH_RTP_FLAG_BREAK = ( 1 << 9),
        SWITCH_RTP_FLAG_MINI = ( 1 << 10),
        SWITCH_RTP_FLAG_DATAWAIT = (1 << 11),
-       SWITCH_RTP_FLAG_BUGGY_2833 = (1 << 12)
+       SWITCH_RTP_FLAG_BUGGY_2833 = (1 << 12),
+       SWITCH_RTP_FLAG_PASS_RFC2833 = (1 << 13)
 } switch_rtp_flag_t;
 
 /*!
index b634e59aa59b00dbfba4354ae399aa50f397f141..c17e1b6fbe8fa4c6ce4d29947b080924c8a76c2d 100644 (file)
@@ -141,7 +141,8 @@ typedef enum {
        PFLAG_BLIND_REG = (1 << 1),
        PFLAG_AUTH_ALL = (1 << 2),
        PFLAG_FULL_ID = (1 << 3),
-       PFLAG_PRESENCE = (1 << 4)
+       PFLAG_PRESENCE = (1 << 4),
+       PFLAG_PASS_RFC2833 = (1 << 5)
 } PFLAGS;
 
 typedef enum {
@@ -1402,6 +1403,7 @@ static switch_status_t activate_rtp(private_object_t *tech_pvt)
        int bw, ms;
        switch_channel_t *channel;
        const char *err = NULL;
+    char *val = NULL;
        switch_rtp_flag_t flags;
        switch_status_t status;
        char tmp[50];
@@ -1431,6 +1433,10 @@ static switch_status_t activate_rtp(private_object_t *tech_pvt)
                flags |= SWITCH_RTP_FLAG_BUGGY_2833;
        }
 
+    if (tech_pvt->profile->flags & PFLAG_PASS_RFC2833 || ((val = switch_channel_get_variable(channel, "pass_rfc2833")) && switch_true(val))) {
+        flags |= SWITCH_RTP_FLAG_PASS_RFC2833;
+    }
+
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "RTP [%s] %s:%d->%s:%d codec: %u ms: %d\n",
                                          switch_channel_get_name(channel),
                                          tech_pvt->local_sdp_audio_ip,
@@ -4983,6 +4989,10 @@ static switch_status_t config_sofia(int reload)
                                                if (switch_true(val)) {
                                                        profile->pflags |= PFLAG_PRESENCE;
                                                }
+                                       } else if (!strcasecmp(var, "pass-rfc2833")) {
+                                               if (switch_true(val)) {
+                                                       profile->pflags |= PFLAG_PASS_RFC2833;
+                                               }
                                        } else if (!strcasecmp(var, "auth-calls")) {
                                                if (switch_true(val)) {
                                                        profile->pflags |= PFLAG_AUTH_CALLS;
index 4b074b27002cbb01d8fb7300b28f5c0b6bd3d49c..ea425483fe46e6a89807291b98f90b909011f9ef 100644 (file)
@@ -840,7 +840,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                }
 
                /* RFC2833 ... TBD try harder to honor the duration etc.*/
-               if (rtp_session->recv_msg.header.pt == rtp_session->te) {
+               if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833) && rtp_session->recv_msg.header.pt == rtp_session->te) {
                        unsigned char *packet = (unsigned char *) rtp_session->recv_msg.body;
                        int end = packet[1]&0x80;
                        int duration = (packet[2]<<8) + packet[3];