<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19669">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_adsi: Fix major regression caused by media format rearchitecture.<br><br>The commit that rearchitected media formats,<br>a2c912e9972c91973ea66902d217746133f96026 (ASTERISK_23114)<br>introduced a regression by improperly translating code in res_adsi.c.<br>In particular, the pointer to the frame buffer was initialized<br>at the top of adsi_careful_send, rather than dynamically updating it<br>for each frame, as is required.<br><br>This resulted in the first frame being repeatedly sent,<br>rather than advancing through the frames.<br>This corrupted the transmission of the CAS to the CPE,<br>which meant that CPE would never respond with the DTMF acknowledgment,<br>effectively completely breaking ADSI functionality.<br><br>This issue is now fixed, and ADSI now works properly again.<br><br>ASTERISK-29793 #close<br><br>Change-Id: Icdeddf733eda2981c98712d1ac9cddc0db507dbe<br>---<br>M res/res_adsi.c<br>1 file changed, 31 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/69/19669/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_adsi.c b/res/res_adsi.c</span><br><span>index f8a2f56..c273c00 100644</span><br><span>--- a/res/res_adsi.c</span><br><span>+++ b/res/res_adsi.c</span><br><span>@@ -157,7 +157,6 @@</span><br><span>       struct ast_frame outf = {</span><br><span>            .frametype = AST_FRAME_VOICE,</span><br><span>                .subclass.format = ast_format_ulaw,</span><br><span style="color: hsl(0, 100%, 40%);">-             .data.ptr = buf,</span><br><span>     };</span><br><span>   int amt;</span><br><span> </span><br><span>@@ -171,6 +170,7 @@</span><br><span>                   *remain = *remain - amt;</span><br><span>             }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+         outf.data.ptr = buf;</span><br><span>                 outf.datalen = amt;</span><br><span>          outf.samples = amt;</span><br><span>          if (ast_write(chan, &outf)) {</span><br><span>@@ -211,6 +211,7 @@</span><br><span>              } else if (remain) {</span><br><span>                         *remain = inf->datalen - amt;</span><br><span>             }</span><br><span style="color: hsl(120, 100%, 40%);">+             outf.data.ptr = buf;</span><br><span>                 outf.datalen = amt;</span><br><span>          outf.samples = amt;</span><br><span>          if (ast_write(chan, &outf)) {</span><br><span>@@ -236,6 +237,7 @@</span><br><span> </span><br><span>  if (ast_channel_adsicpe(chan) == AST_ADSI_UNAVAILABLE) {</span><br><span>             /* Don't bother if we know they don't support ADSI */</span><br><span style="color: hsl(120, 100%, 40%);">+         ast_log(LOG_WARNING, "ADSI is not supported for %s\n", ast_channel_name(chan));</span><br><span>            errno = ENOSYS;</span><br><span>              return -1;</span><br><span>   }</span><br><span>@@ -255,7 +257,7 @@</span><br><span>                      for (;;) {</span><br><span>                           if (((res = ast_waitfor(chan, waittime)) < 1)) {</span><br><span>                                  /* Didn't get back DTMF A in time */</span><br><span style="color: hsl(0, 100%, 40%);">-                                        ast_debug(1, "No ADSI CPE detected (%d)\n", res);</span><br><span style="color: hsl(120, 100%, 40%);">+                                   ast_verb(4, "No ADSI CPE detected (%d)\n", res);</span><br><span>                                   if (!ast_channel_adsicpe(chan)) {</span><br><span>                                            ast_channel_adsicpe_set(chan, AST_ADSI_UNAVAILABLE);</span><br><span>                                         }</span><br><span>@@ -291,7 +293,7 @@</span><br><span>                              ast_frfree(f);</span><br><span>                       }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-                   ast_debug(1, "ADSI Compatible CPE Detected\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                     ast_verb(4, "ADSI Compatible CPE Detected\n");</span><br><span>             } else {</span><br><span>                     ast_debug(1, "Already in data mode\n");</span><br><span>            }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19669">change 19669</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/19669"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: Icdeddf733eda2981c98712d1ac9cddc0db507dbe </div>
<div style="display:none"> Gerrit-Change-Number: 19669 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>