SWITCH_RTP_FLAG_BREAK - Stop what you are doing and return SWITCH_STATUS_BREAK
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
</pre>
*/
typedef enum {
SWITCH_RTP_FLAG_VAD = (1 << 8),
SWITCH_RTP_FLAG_BREAK = ( 1 << 9),
SWITCH_RTP_FLAG_MINI = ( 1 << 10),
- SWITCH_RTP_FLAG_DATAWAIT = (1 << 11)
+ SWITCH_RTP_FLAG_DATAWAIT = (1 << 11),
+ SWITCH_RTP_FLAG_BUGGY_2833 = (1 << 12)
} switch_rtp_flag_t;
/*!
TFLAG_REFER = (1 << 17),
TFLAG_NOHUP = (1 << 18),
TFLAG_XFER = (1 << 19),
- TFLAG_NOMEDIA = (1 << 20)
+ TFLAG_NOMEDIA = (1 << 20),
+ TFLAG_BUGGY_2833 = (1 << 21)
} TFLAGS;
static struct {
char *key;
char *xferto;
char *kick;
+ char *origin;
unsigned long rm_rate;
switch_payload_t pt;
switch_mutex_t *flag_mutex;
flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_RAW_WRITE | SWITCH_RTP_FLAG_AUTOADJ | SWITCH_RTP_FLAG_DATAWAIT);
+ if (switch_test_flag(tech_pvt, TFLAG_BUGGY_2833)) {
+ flags |= SWITCH_RTP_FLAG_BUGGY_2833;
+ }
+
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,
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
+ if ((tech_pvt->origin = switch_core_session_strdup(session, (char *) sdp->sdp_origin->o_username))) {
+ if (strstr(tech_pvt->origin, "CiscoSystemsSIP-GW-UserAgent")) {
+ switch_set_flag_locked(tech_pvt, TFLAG_BUGGY_2833);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activate Buggy RFC2833 Mode!\n");
+ }
+ }
+
for (m = sdp->sdp_media; m ; m = m->m_next) {
if (m->m_type == sdp_media_audio) {
sdp_rtpmap_t *map;
switch_rtp_write_manual(rtp_session,
rtp_session->dtmf_data.out_digit_packet,
4,
- 1,
+ switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BUGGY_2833) ? 0 : 1,
rtp_session->te,
rtp_session->dtmf_data.timestamp_dtmf,
rtp_session->dtmf_data.out_digit_seq++,