]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add RTP_BUG_ACCEPT_ANY_PACKETS to disable dropping invalid packets for interop with...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 8 Sep 2011 13:57:28 +0000 (08:57 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 8 Sep 2011 13:57:28 +0000 (08:57 -0500)
src/include/switch_types.h
src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_rtp.c

index 312e0bd342280d497cf419a0616ceac082a41439..eb4de9ade71defb02acd16b7e6f3ab2d2cb5a17e 100644 (file)
@@ -680,6 +680,16 @@ typedef enum {
          This flag will treat every dtmf as if it were 50ms and queue it on recipt of the leading packet rather than at the end.
         */
 
+
+       RTP_BUG_ACCEPT_ANY_PACKETS = (1 << 7)
+
+       /*
+         Oracle's Contact Center Anywhere (CCA) likes to use a single RTP socket to send all its outbound audio.
+         This messes up our ability to auto adjust to NATTED RTP and causes us to ignore its audio packets.
+         This flag will allow compatibility with this dying product.
+       */
+
+
 } switch_rtp_bug_flag_t;
 
 #ifdef _MSC_VER
index adc0c5347f6950456efff8c7007cc30c547c07ee..77c18428328400796d1b14c3f9ffff12d1dde623 100644 (file)
@@ -6553,6 +6553,14 @@ void sofia_glue_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str
        if (switch_stristr("~IGNORE_DTMF_DURATION", str)) {
                *flag_pole &= ~RTP_BUG_IGNORE_DTMF_DURATION;
        }
+
+       if (switch_stristr("ACCEPT_ANY_PACKETS", str)) {
+               *flag_pole |= RTP_BUG_ACCEPT_ANY_PACKETS;
+       }
+
+       if (switch_stristr("~ACCEPT_ANY_PACKETS", str)) {
+               *flag_pole &= ~RTP_BUG_ACCEPT_ANY_PACKETS;
+       }
 }
 
 char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sofia_dispatch_event_t *de, sofia_nat_parse_t *np)
index 6d51bf296311e42b305720f7b6921bc27bd7ebda..02c440ca6f51fd66b6144d882860477849ce176d 100644 (file)
@@ -3135,7 +3135,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                                        goto recvfrom;
 
                                }
-                       } else if (!switch_cmp_addr(rtp_session->from_addr, rtp_session->remote_addr)) {
+                       } else if (!(rtp_session->rtp_bugs & RTP_BUG_ACCEPT_ANY_PACKETS) && !switch_cmp_addr(rtp_session->from_addr, rtp_session->remote_addr)) {
                                goto recvfrom;
 
                        }