<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19488">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Dialing API: Cancel a running async thread, may not cancel all calls<br><br>race condition: ast_dial_join() may not cancel outgoing call, if<br>function is called just after called party answer and before<br>application execution (bit is_running_app not yet set).<br><br>This fix adds ast_softhangup() calls in addition to existing<br>pthread_kill() when is_running_app is not set.<br><br>ASTERISK-30258<br><br>Change-Id: Idbdd5c15122159661aa8e996a42d5800083131e4<br>---<br>M main/dial.c<br>1 file changed, 27 insertions(+), 0 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/dial.c b/main/dial.c</span><br><span>index 944207c..3906bd0 100644</span><br><span>--- a/main/dial.c</span><br><span>+++ b/main/dial.c</span><br><span>@@ -1043,8 +1043,17 @@</span><br><span> ast_channel_unlock(chan);</span><br><span> }</span><br><span> } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_dial_channel *channel = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Now we signal it with SIGURG so it will break out of it's waitfor */</span><br><span> pthread_kill(thread, SIGURG);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* pthread_kill may not be enough, if outgoing channel has already got an answer (no more in waitfor) but is not yet running an application. Force soft hangup. */</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_LIST_TRAVERSE(&dial->channels, channel, list) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (channel->owner) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_softhangup(channel->owner, AST_SOFTHANGUP_EXPLICIT);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> AST_LIST_UNLOCK(&dial->channels);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19488">change 19488</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/+/19488"/><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: Idbdd5c15122159661aa8e996a42d5800083131e4 </div>
<div style="display:none"> Gerrit-Change-Number: 19488 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Frederic LE FOLL <frederic.lefoll@csgroup.eu> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>