<h1>Project "FreeSWITCH Source" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: 2582d71689191909fd8a62b5f5693ebd1b4dc8d1 (commit)
from: 3546654615f88058fb6769fe79e07162602fa4af (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Moises Silva
comments:
freetdm: use packet_len as the base length in tone generation
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c</span>
<span style="color: #000080; font-weight: bold">index 1e282d1..bd4e896 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftdm_io.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftdm_io.c</span>
<span style="color: #800080; font-weight: bold">@@ -3588,7 +3588,7 @@ static FIO_READ_FUNCTION(ftdm_raw_read)</span>
}
/* This function takes care of automatically generating DTMF or FSK tones when needed */
<span style="color: #A00000">-static ftdm_status_t handle_tone_generation(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)</span>
<span style="color: #00A000">+static ftdm_status_t handle_tone_generation(ftdm_channel_t *ftdmchan)</span>
{
        /*
         * datalen: size in bytes of the chunk of data the user requested to read (this function
<span style="color: #800080; font-weight: bold">@@ -3650,9 +3650,7 @@ static ftdm_status_t handle_tone_generation(ftdm_channel_t *ftdmchan, ftdm_size_</span>
        /* if we picked a buffer, time to read from it and write the linear data to the device */
        if (buffer) {
                uint8_t auxbuf[1024];
<span style="color: #A00000">-                /* we initialize dlen to datalen, which is the size in bytes the </span>
<span style="color: #A00000">-                 * user wants to read (typically chunks of 160 bytes, 20ms G.711) */</span>
<span style="color: #A00000">-                ftdm_size_t dlen = datalen;</span>
<span style="color: #00A000">+                ftdm_size_t dlen = ftdmchan->packet_len;</span>
                ftdm_size_t len, br, max = sizeof(auxbuf);
                
                /* if the codec is not linear, then data is really twice as much cuz
<span style="color: #800080; font-weight: bold">@@ -3662,10 +3660,10 @@ static ftdm_status_t handle_tone_generation(ftdm_channel_t *ftdmchan, ftdm_size_</span>
                }
                /* we do not expect the user chunks to be bigger than auxbuf */
<span style="color: #A00000">-                ftdm_assert(dlen <= sizeof(auxbuf), "Unexpected size for user data chunk size\n");</span>
<span style="color: #00A000">+                ftdm_assert((dlen <= sizeof(auxbuf)), "Unexpected size for user data chunk size\n");</span>
                /* dblen is the size in use for dtmf_buffer or fsk_buffer, and dlen is the size
<span style="color: #A00000">-                 * of the read chunks of the user, we pick the smaller one */</span>
<span style="color: #00A000">+                 * of the io chunks to write, we pick the smaller one */</span>
                len = dblen > dlen ? dlen : dblen;
                /* we can't read more than the size of our auxiliary buffer */
<span style="color: #800080; font-weight: bold">@@ -3770,7 +3768,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read(ftdm_channel_t *ftdmchan, void *data</span>
                        rdata[i] = ftdmchan->rxgain_table[rdata[i]];
                }
        }
<span style="color: #A00000">-        handle_tone_generation(ftdmchan, *datalen);</span>
<span style="color: #00A000">+        handle_tone_generation(ftdmchan);</span>
        if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_TRANSCODE) && ftdmchan->effective_codec != ftdmchan->native_codec) {
                if (ftdmchan->native_codec == FTDM_CODEC_ULAW && ftdmchan->effective_codec == FTDM_CODEC_SLIN) {
</pre></div>
========================================================================<pre>
Summary of changes:
libs/freetdm/src/ftdm_io.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 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>