/* FLUSH JITTERBUFFER When getting RFC2833 to reduce bleed through */
- RTP_BUG_ACCEPT_ANY_PAYLOAD = (1 << 11)
+ RTP_BUG_ACCEPT_ANY_PAYLOAD = (1 << 11),
/*
Make FS accept any payload type instead of dropping and returning CNG frame. Workaround while FS only supports a single payload per rtp session.
This should probably be a flag, but flag enum is already full!
*/
+
+ RTP_BUG_ALWAYS_AUTO_ADJUST = (1 << 12)
+
+ /*
+ Leave the auto-adjust behavior enableed permenantly rather than only at appropriate times. (IMPLICITLY sets RTP_BUG_ACCEPT_ANY_PACKETS)
+
+ */
+
+
} switch_rtp_bug_flag_t;
#ifdef _MSC_VER
if (switch_stristr("~FLUSH_JB_ON_DTMF", str)) {
*flag_pole &= ~RTP_BUG_FLUSH_JB_ON_DTMF;
}
+
+ if (switch_stristr("ALWAYS_AUTO_ADJUST", str)) {
+ *flag_pole |= (RTP_BUG_ALWAYS_AUTO_ADJUST | RTP_BUG_ACCEPT_ANY_PACKETS);
+ }
+
+ if (switch_stristr("~ALWAYS_AUTO_ADJUST", str)) {
+ *flag_pole &= ~(RTP_BUG_ALWAYS_AUTO_ADJUST | RTP_BUG_ACCEPT_ANY_PACKETS);
+ }
}
return;
}
- switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+ if ((rtp_session->rtp_bugs & RTP_BUG_ALWAYS_AUTO_ADJUST)) {
+ switch_rtp_set_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+ } else {
+ switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+ }
}
}
}
rtp_session->auto_adj_used = 1;
switch_rtp_set_remote_address(rtp_session, tx_host, switch_sockaddr_get_port(rtp_session->from_addr), 0, SWITCH_FALSE, &err);
- switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+ if ((rtp_session->rtp_bugs & RTP_BUG_ALWAYS_AUTO_ADJUST)) {
+ switch_rtp_set_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+ } else {
+ switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+ }
if (rtp_session->ice.ice_user) {
rtp_session->ice.addr = rtp_session->remote_addr;
}
}
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG, "Correct ip/port confirmed.\n");
- switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+ if ((rtp_session->rtp_bugs & RTP_BUG_ALWAYS_AUTO_ADJUST)) {
+ switch_rtp_set_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+ } else {
+ switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+ }
rtp_session->auto_adj_used = 0;
}
}
- if (bytes && rtp_session->autoadj_window) {
+ if (bytes && !(rtp_session->rtp_bugs & RTP_BUG_ALWAYS_AUTO_ADJUST) && rtp_session->autoadj_window) {
if (--rtp_session->autoadj_window == 0) {
switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
}