<h1>Project "FreeSWITCH Source" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: 38b430f43f52efda748ceabb47341fca284103b0 (commit)
from: 4f5ca9e88dc1a94efa78878ca576d62345203ca2 (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Anthony Minessale
comments:
FS-3057
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_rtp.c b/src/switch_rtp.c</span>
<span style="color: #000080; font-weight: bold">index d0c22ce..bbb0468 100644</span>
<span style="color: #A00000">--- a/src/switch_rtp.c</span>
<span style="color: #00A000">+++ b/src/switch_rtp.c</span>
<span style="color: #800080; font-weight: bold">@@ -2396,7 +2396,7 @@ static void do_flush(switch_rtp_t *rtp_session)</span>
#define return_cng_frame() do_cng = 1; goto timer_check
<span style="color: #A00000">-static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t *bytes, switch_frame_flag_t *flags)</span>
<span style="color: #00A000">+static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t *bytes, switch_frame_flag_t *flags, switch_bool_t return_jb_packet)</span>
{
        switch_status_t status = SWITCH_STATUS_FALSE;
        stfu_frame_t *jb_frame;
<span style="color: #800080; font-weight: bold">@@ -2493,8 +2493,11 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t</span>
                stfu_n_eat(rtp_session->jb, rtp_session->last_read_ts,
                                 rtp_session->recv_msg.header.pt,
                                 rtp_session->recv_msg.body, *bytes - rtp_header_len, rtp_session->timer.samplecount);
<span style="color: #A00000">-                *bytes = 0;</span>
                status = SWITCH_STATUS_FALSE;
<span style="color: #00A000">+                if (!return_jb_packet) {</span>
<span style="color: #00A000">+                        return status;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                *bytes = 0;</span>
        }
        if (rtp_session->jb && !rtp_session->pause_jb && !rtp_session->checked_jb) {
<span style="color: #800080; font-weight: bold">@@ -2668,17 +2671,19 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_</span>
                        if ((switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOFLUSH) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH)) &&
                                rtp_session->read_pollfd) {
                                if (switch_poll(rtp_session->read_pollfd, 1, &fdr, 0) == SWITCH_STATUS_SUCCESS) {
<span style="color: #A00000">-                                        status = read_rtp_packet(rtp_session, &bytes, flags);</span>
<span style="color: #A00000">-                                        /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Initial %d\n", bytes); */</span>
<span style="color: #A00000">-                                        read_pretriggered = 1;</span>
<span style="color: #00A000">+                                        status = read_rtp_packet(rtp_session, &bytes, flags, SWITCH_FALSE);</span>
<span style="color: #00A000">+                                        /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Initial (%i) %d\n", status, bytes); */</span>
<span style="color: #00A000">+                                        if (status != SWITCH_STATUS_FALSE) {</span>
<span style="color: #00A000">+                                                read_pretriggered = 1;</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #A00000">-                                        if (switch_poll(rtp_session->read_pollfd, 1, &fdr, 0) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #A00000">-                                                /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Trigger %d\n", rtp_session->hot_hits); */</span>
<span style="color: #A00000">-                                                rtp_session->hot_hits += rtp_session->samples_per_interval;</span>
<span style="color: #A00000">-                                        } else {</span>
<span style="color: #A00000">-                                                rtp_session->hot_hits = 0;</span>
<span style="color: #A00000">-                                                switch_core_timer_sync(&rtp_session->timer);</span>
<span style="color: #A00000">-                                                goto recvfrom;</span>
<span style="color: #00A000">+                                        if (bytes) {</span>
<span style="color: #00A000">+                                                if (switch_poll(rtp_session->read_pollfd, 1, &fdr, 0) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                                                        /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Trigger %d\n", rtp_session->hot_hits); */</span>
<span style="color: #00A000">+                                                        rtp_session->hot_hits += rtp_session->samples_per_interval;</span>
<span style="color: #00A000">+                                                } else {</span>
<span style="color: #00A000">+                                                        rtp_session->hot_hits = 0;</span>
<span style="color: #00A000">+                                                }</span>
                                        }
                                        
                                        if (rtp_session->hot_hits >= rtp_session->samples_per_second * 5) {
<span style="color: #800080; font-weight: bold">@@ -2737,9 +2742,11 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_</span>
                }
                if (poll_status == SWITCH_STATUS_SUCCESS) {
<span style="color: #A00000">-                        if (!read_pretriggered) {</span>
<span style="color: #A00000">-                                status = read_rtp_packet(rtp_session, &bytes, flags);</span>
<span style="color: #A00000">-                                /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Read bytes %d\n", bytes); */</span>
<span style="color: #00A000">+                        if (read_pretriggered) {</span>
<span style="color: #00A000">+                                read_pretriggered = 0;</span>
<span style="color: #00A000">+                        } else {</span>
<span style="color: #00A000">+                                status = read_rtp_packet(rtp_session, &bytes, flags, SWITCH_TRUE);</span>
<span style="color: #00A000">+                                /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Read bytes (%i) %d\n", status, bytes); */</span>
                        }
                } else {
                        if (!SWITCH_STATUS_IS_BREAK(poll_status) && poll_status != SWITCH_STATUS_TIMEOUT) {
</pre></div>
========================================================================<pre>
Summary of changes:
src/switch_rtp.c | 39 +++++++++++++++++++++++----------------
1 files changed, 23 insertions(+), 16 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH Source</p>