sigh
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9940 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
a75febf88f
commit
8fe7bcfe05
|
@ -1274,22 +1274,23 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||||
return_cng_frame();
|
return_cng_frame();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bytes <= rtp_header_len) {
|
if (bytes && bytes <= 12) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) {
|
if (bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) {
|
||||||
const char *tx_host;
|
if (++rtp_session->autoadj_tally >= 10) {
|
||||||
const char *old_host;
|
const char *tx_host;
|
||||||
char bufa[30], bufb[30];
|
const char *old_host;
|
||||||
tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
|
char bufa[30], bufb[30];
|
||||||
old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);
|
|
||||||
if ((switch_sockaddr_get_port(rtp_session->from_addr) != rtp_session->remote_port) || strcmp(tx_host, old_host)) {
|
|
||||||
const char *err;
|
|
||||||
uint32_t old = rtp_session->remote_port;
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(tx_host) && switch_sockaddr_get_port(rtp_session->from_addr) > 0) {
|
tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
|
||||||
if (++rtp_session->autoadj_tally >= 10) {
|
old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);
|
||||||
|
if ((switch_sockaddr_get_port(rtp_session->from_addr) != rtp_session->remote_port) || strcmp(tx_host, old_host)) {
|
||||||
|
const char *err;
|
||||||
|
uint32_t old = rtp_session->remote_port;
|
||||||
|
|
||||||
|
if (!switch_strlen_zero(tx_host) && switch_sockaddr_get_port(rtp_session->from_addr) > 0) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
|
||||||
"Auto Changing port from %s:%u to %s:%u\n", old_host, old, tx_host,
|
"Auto Changing port from %s:%u to %s:%u\n", old_host, old, tx_host,
|
||||||
switch_sockaddr_get_port(rtp_session->from_addr));
|
switch_sockaddr_get_port(rtp_session->from_addr));
|
||||||
|
@ -1299,7 +1300,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bytes && rtp_session->autoadj_window) {
|
if (bytes && rtp_session->autoadj_window) {
|
||||||
if (--rtp_session->autoadj_window == 0) {
|
if (--rtp_session->autoadj_window == 0) {
|
||||||
switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
|
switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
|
||||||
|
|
Loading…
Reference in New Issue