<p>Friendly Automation <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11356">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Benjamin Keith Ford: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stasis: Hangup channel for Local channel No such extension error<br><br>When we use early bridge with create and dial from stasis using Local channel<br>and the dialplan does not any entry the it is returned from core_local.c with<br>No such extension .<br><br>In such case asterisk locks up till the channel is not hangup with the error<br>Exceptionally long voice queue length<br><br>* Found that in such case app_control_dial fails on ast_call method and<br> return -1<br>* Since it is called from stasis_app_send_command_async and return -1 does<br> not cause resources to be freed and since no PBX exist it is not able to<br> read from channel causing exceptionally long queue<br>* After putting this code found that the channel was releasing immediately<br> and resources were freed.<br><br>ASTERISK-28399<br>Reported by: Abhay Gupta<br>Tested by: Abhay Gupta<br><br>Change-Id: I0a55c923fc6995559f808d63b9488762b4489318<br>---<br>M res/stasis/control.c<br>1 file changed, 11 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/stasis/control.c b/res/stasis/control.c</span><br><span>index 6bac6e8..d3ea7d7 100644</span><br><span>--- a/res/stasis/control.c</span><br><span>+++ b/res/stasis/control.c</span><br><span>@@ -1634,6 +1634,17 @@</span><br><span> }</span><br><span> </span><br><span> if (ast_call(chan, args->dialstring, 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* If call fails normally this channel would then just be normally hung up and destroyed.</span><br><span style="color: hsl(120, 100%, 40%);">+ * In this case though the channel is being handled by the ARI control thread and dial</span><br><span style="color: hsl(120, 100%, 40%);">+ * bridge which needs to be notified that the channel should be hung up. To do this we</span><br><span style="color: hsl(120, 100%, 40%);">+ * queue a soft hangup which will cause each to wake up, see that the channel has been</span><br><span style="color: hsl(120, 100%, 40%);">+ * hung up, and then destroy it.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ int hangup_flag;</span><br><span style="color: hsl(120, 100%, 40%);">+ hangup_flag = ast_bridge_setup_after_goto(chan) ? AST_SOFTHANGUP_DEV : AST_SOFTHANGUP_ASYNCGOTO;</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_channel_lock(chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_softhangup_nolock(chan, hangup_flag);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_channel_unlock(chan);</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11356">change 11356</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/+/11356"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I0a55c923fc6995559f808d63b9488762b4489318 </div>
<div style="display:none"> Gerrit-Change-Number: 11356 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Abhay Gupta <abhay@avissol.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>