]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't autoadjust on break packets sent to ourself
authorMichael Jerris <mike@jerris.com>
Thu, 9 Oct 2008 22:44:48 +0000 (22:44 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 9 Oct 2008 22:44:48 +0000 (22:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9917 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_rtp.c

index c862cfa5966f61bb964430a9d2f85842301012c5..b175a42ba65df0549845d9a55c6cda3ff7ca43d8 100644 (file)
@@ -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;