<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8617">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
George Joseph: Looks good to me, approved
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_softmix: Clear "talking" when a channel is put on hold<br><br>This patch clears the talking flag from the channel (if already set), and<br>notifies listeners when that channel is put on hold. Note however, if the<br>endpoint continues to send audio frames and these are received by the bridge<br>then that channel will be put back into a "talking" state even though they<br>are on hold.<br><br>ASTERISK-27755 #close<br><br>Change-Id: I930e16c4662810f9f02043d69062f88173c5e2ef<br>---<br>M bridges/bridge_softmix.c<br>1 file changed, 37 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c<br>index b572192..dcd3271 100644<br>--- a/bridges/bridge_softmix.c<br>+++ b/bridges/bridge_softmix.c<br>@@ -667,6 +667,30 @@<br> <br> /*!<br> * \internal<br>+ * \brief Clear talking flag, stop contributing to mixing and notify handlers.<br>+ * \since 13.21.0, 15.4.0<br>+ *<br>+ * \param bridge_channel Which channel's talking to clear<br>+ *<br>+ * \return Nothing<br>+ */<br>+static void clear_talking(struct ast_bridge_channel *bridge_channel)<br>+{<br>+ struct softmix_channel *sc = bridge_channel->tech_pvt;<br>+<br>+ if (sc->talking) {<br>+ ast_mutex_lock(&sc->lock);<br>+ ast_slinfactory_flush(&sc->factory);<br>+ sc->talking = 0;<br>+ ast_mutex_unlock(&sc->lock);<br>+<br>+ /* Notify that we are no longer talking. */<br>+ ast_bridge_channel_notify_talking(bridge_channel, 0);<br>+ }<br>+}<br>+<br>+/*!<br>+ * \internal<br> * \brief Check for voice status updates.<br> * \since 13.20.0<br> *<br>@@ -677,23 +701,14 @@<br> */<br> static void softmix_bridge_check_voice(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)<br> {<br>- struct softmix_channel *sc = bridge_channel->tech_pvt;<br>-<br>- if (sc->talking<br>- && bridge_channel->features->mute) {<br>+ if (bridge_channel->features->mute) {<br> /*<br> * We were muted while we were talking.<br> *<br> * Immediately stop contributing to mixing<br> * and report no longer talking.<br> */<br>- ast_mutex_lock(&sc->lock);<br>- ast_slinfactory_flush(&sc->factory);<br>- sc->talking = 0;<br>- ast_mutex_unlock(&sc->lock);<br>-<br>- /* Notify that we are no longer talking. */<br>- ast_bridge_channel_notify_talking(bridge_channel, 0);<br>+ clear_talking(bridge_channel);<br> }<br> }<br> <br>@@ -717,6 +732,17 @@<br> */<br> <br> switch (frame->subclass.integer) {<br>+ case AST_CONTROL_HOLD:<br>+ /*<br>+ * Doing anything for holds in a conference bridge could be considered a bit<br>+ * odd. That being said, in most cases one would probably want the talking<br>+ * flag cleared when 'hold' is pressed by the remote endpoint, so go ahead<br>+ * and do that here. However, that is all we'll do. Meaning if for some reason<br>+ * the endpoint continues to send audio frames despite pressing 'hold' talking<br>+ * will once again be detected for that channel.<br>+ */<br>+ clear_talking(bridge_channel);<br>+ break;<br> case AST_CONTROL_VIDUPDATE:<br> ast_bridge_queue_everyone_else(bridge, NULL, frame);<br> break;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8617">change 8617</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/8617"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: certified/13.18 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I930e16c4662810f9f02043d69062f88173c5e2ef </div>
<div style="display:none"> Gerrit-Change-Number: 8617 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>