<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9028">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><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 (i.e., the<br>first user immediately hangs up) then the conference bridge and announcer<br>channels are not removed.<br><br>When a conference is created, the push_announcer() function is added to<br>the playback queue task processor and the conference object reference is<br>bumped. If a conference is ended while the push_announcer() function is<br>still going then the ao2_cleanup(conference) at the end of<br>push_announcer() will call the destructor function -<br>destroy_conference_bridge().<br><br>The destroy_conference_bridge() function will then add the<br>hangup_playback() task to the playback queue and will wait for it to end.<br>Since it is already a current task of the playback queue it will wait<br>forever.<br><br>This patch makes the conference thread call push_announcer() directly.<br>This way the conference object reference bump is not needed. Since the<br>playback queue task processor is only used by the conference thread<br>itself, there is no danger of trying to play announcements before the<br>announcer is pushed to the bridge.<br><br>ASTERISK-27870 #close<br><br>Change-Id: I947a50fb121422d90fd1816d643a54d75185a477<br>---<br>M apps/app_confbridge.c<br>1 file changed, 3 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c</span><br><span>index 2bc6014..2f9c632 100644</span><br><span>--- a/apps/app_confbridge.c</span><br><span>+++ b/apps/app_confbridge.c</span><br><span>@@ -1457,25 +1457,19 @@</span><br><span> /*!</span><br><span> * \brief Push the announcer channel into the bridge</span><br><span> *</span><br><span style="color: hsl(0, 100%, 40%);">- * This runs in the playback queue taskprocessor.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \param data A confbridge_conference</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param conference Conference bridge to push the announcer to</span><br><span> * \retval 0 Success</span><br><span> * \retval -1 Failed to push the channel to the bridge</span><br><span> */</span><br><span style="color: hsl(0, 100%, 40%);">-static int push_announcer(void *data)</span><br><span style="color: hsl(120, 100%, 40%);">+static int push_announcer(struct confbridge_conference *conference)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- struct confbridge_conference *conference = data;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> if (conf_announce_channel_push(conference->playback_chan)) {</span><br><span> ast_hangup(conference->playback_chan);</span><br><span> conference->playback_chan = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(conference);</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span> ast_autoservice_start(conference->playback_chan);</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(conference);</span><br><span> return 0;</span><br><span> }</span><br><span> </span><br><span>@@ -1588,7 +1582,7 @@</span><br><span> return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_taskprocessor_push(conference->playback_queue, push_announcer, ao2_bump(conference))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (push_announcer(conference)) {</span><br><span> ao2_unlink(conference_bridges, conference);</span><br><span> ao2_ref(conference, -1);</span><br><span> ao2_unlock(conference_bridges);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9028">change 9028</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/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: merged </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: 5 </div>
<div style="display:none"> Gerrit-Owner: Robert Mordec <r.mordec@slican.pl> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>