<p>Robert Mordec has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9028">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_confbridge: Bridge and announcers not removed if conference ends quickly<br><br>If a conference is ended very quickly after it was created, ie. first user<br>immediatlely hangs up, conference bridge and announcer channels are<br>not removed.<br><br>When conference is created, push_announcer() function is added to playback<br>queue task processor and conference object reference is bumped. If conference<br>is ended while push_announcer() function is still going,<br>ao2_cleanup(conference) at the end of push_announcer() will call<br>the destructor function - destroy_conference_bridge().<br><br>The destroy_conference_bridge() function will then add hangup_playback task<br>to playback queue and will wait for it to end. Since it is already<br>a current task from playback queue it will wait forever.<br><br>This patch removes announcer channels at the end of push_announcer() if<br>by then the conference object reference counter is decreased to 1.<br>This prevents conference destructor from trying to remove the announcer<br>and locking up in the process.<br><br>ASTERISK-27870 #close<br><br>Change-Id: I947a50fb121422d90fd1816d643a54d75185a477<br>---<br>M apps/app_confbridge.c<br>1 file changed, 11 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/28/9028/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c<br>index f3f0fdf..2b8d7c0 100644<br>--- a/apps/app_confbridge.c<br>+++ b/apps/app_confbridge.c<br>@@ -1460,6 +1460,17 @@<br> }<br> <br> ast_autoservice_start(conference->playback_chan);<br>+<br>+ if (ao2_ref(conference, 0) == 1) {<br>+ /* Looks like our conference ended as soon as it started and playback channel<br>+ * is no longer needed. This prevents conference destructor from locking up<br>+ * while waiting for playback queue taksprocessor to finish this task.<br>+ */<br>+ ast_autoservice_stop(conference->playback_chan);<br>+ ast_hangup(conference->playback_chan);<br>+ conference->playback_chan = NULL;<br>+ }<br>+<br> ao2_cleanup(conference);<br> return 0;<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9028">change 9028</a>. To unsubscribe, 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/9028"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I947a50fb121422d90fd1816d643a54d75185a477 </div>
<div style="display:none"> Gerrit-Change-Number: 9028 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Robert Mordec <r.mordec@slican.pl> </div>