<p>sungtae kim has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11368">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">main/pbx.c: Fixed to call the ast_softhangup()<br><br>If the channel moved to the normal dialplan from the stasis() application,<br>it doesn't create a SoftChannelRequest(AMI)/ChannelHangupRequest(ARI) events<br>for Hangup() application or when the Dialplan is over.<br>Fixed it to call the those events create handler properly.<br><br>ASTERISK-28336<br><br>Change-Id: I6652359e42bb9fe3f2c44c03df4365c183baf73d<br>---<br>M res/ari/resource_channels.c<br>M res/res_stasis.c<br>2 files changed, 8 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/68/11368/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c</span><br><span>index bdb3534..5a55450 100644</span><br><span>--- a/res/ari/resource_channels.c</span><br><span>+++ b/res/ari/resource_channels.c</span><br><span>@@ -885,11 +885,17 @@</span><br><span> </span><br><span>         if (!ast_strlen_zero(origination->appdata)) {</span><br><span>             struct ast_app *app = pbx_findapp("Stasis");</span><br><span style="color: hsl(120, 100%, 40%);">+                int ret;</span><br><span> </span><br><span>                 if (app) {</span><br><span>                   ast_verb(4, "Launching Stasis(%s) on %s\n", origination->appdata,</span><br><span>                               ast_channel_name(ast_dial_answered(dial)));</span><br><span style="color: hsl(0, 100%, 40%);">-                     pbx_exec(ast_dial_answered(dial), app, origination->appdata);</span><br><span style="color: hsl(120, 100%, 40%);">+                      ret = pbx_exec(ast_dial_answered(dial), app, origination->appdata);</span><br><span style="color: hsl(120, 100%, 40%);">+                        if (!ret) {</span><br><span style="color: hsl(120, 100%, 40%);">+                           /* The channel was already hungup in the Stasis().</span><br><span style="color: hsl(120, 100%, 40%);">+                             * So we steal the answered channel so don't make hangup again. */</span><br><span style="color: hsl(120, 100%, 40%);">+                                ast_dial_answered_steal(dial);</span><br><span style="color: hsl(120, 100%, 40%);">+                        }</span><br><span>            } else {</span><br><span>                     ast_log(LOG_WARNING, "No such application 'Stasis'\n");</span><br><span>            }</span><br><span>diff --git a/res/res_stasis.c b/res/res_stasis.c</span><br><span>index 114a43f..5118bc4 100644</span><br><span>--- a/res/res_stasis.c</span><br><span>+++ b/res/res_stasis.c</span><br><span>@@ -1593,12 +1593,7 @@</span><br><span>              ast_channel_unlock(chan);</span><br><span> </span><br><span>                if (!chan_hungup) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     struct ast_pbx_args pbx_args;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                   memset(&pbx_args, 0, sizeof(pbx_args));</span><br><span style="color: hsl(0, 100%, 40%);">-                     pbx_args.no_hangup_chan = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                    res = ast_pbx_run_args(chan, &pbx_args);</span><br><span style="color: hsl(120, 100%, 40%);">+                  res = ast_pbx_run_args(chan, NULL);</span><br><span>          }</span><br><span>    }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11368">change 11368</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/+/11368"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I6652359e42bb9fe3f2c44c03df4365c183baf73d </div>
<div style="display:none"> Gerrit-Change-Number: 11368 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>