From 839fd37831bf63fd8298f7390b02be6a4c9b45e5 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 9 Oct 2008 22:44:48 +0000 Subject: [PATCH] don't autoadjust on break packets sent to ourself git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9917 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_rtp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index c862cfa596..b175a42ba6 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -975,7 +975,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_ice(switch_rtp_t *rtp_sessio SWITCH_DECLARE(void) switch_rtp_break(switch_rtp_t *rtp_session) { - char o = 42; + int o = 42; switch_size_t len = sizeof(o); switch_assert(rtp_session != NULL); @@ -1267,7 +1267,14 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ goto end; } - if (bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) { + if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) { + switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_BREAK); + do_2833(rtp_session); + bytes = 0; + return_cng_frame(); + } + + if (bytes > 12 && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) { const char *tx_host; const char *old_host; char bufa[30], bufb[30]; @@ -1308,13 +1315,6 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ } } - if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) { - switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_BREAK); - do_2833(rtp_session); - bytes = 0; - return_cng_frame(); - } - if (bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA)) { /* Fast PASS! */ *flags |= SFF_PROXY_PACKET;