[Freeswitch-svn] [commit] r4070 - in freeswitch/trunk/src: . include mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Sat Jan 27 21:38:53 EST 2007
Author: anthm
Date: Sat Jan 27 21:38:52 2007
New Revision: 4070
Modified:
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/switch_rtp.c
Log:
add stupid 2833 crap
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Sat Jan 27 21:38:52 2007
@@ -240,6 +240,7 @@
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 @@
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;
/*!
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Sat Jan 27 21:38:52 2007
@@ -141,7 +141,8 @@
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 @@
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 @@
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 @@
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;
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Sat Jan 27 21:38:52 2007
@@ -840,7 +840,7 @@
}
/* 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];
More information about the Freeswitch-svn
mailing list