[Asterisk-code-review] ConfBridge: Rework announcer channel methodology (asterisk[certified/13.8])
Mark Michelson
asteriskteam at digium.com
Thu Aug 18 10:46:51 CDT 2016
Mark Michelson has uploaded a new patch set (#2).
Change subject: ConfBridge: Rework announcer channel methodology
......................................................................
ConfBridge: Rework announcer channel methodology
One feature that confbridge has is the ability to play sounds to all
participants in the conference. Prior to this commit, the algorithm for
this was as follows:
* Grab the playback lock
* Push the conference announcer channel into the bridge
* Play back the sound
* Pull the conference announcer channel from the bridge
* Release the playback lock
The issue here is that the act of adding the playback channel to the
bridge and removing it for each announcement is expensive. Amongst the
expenses:
* The announcer channel is imparted into the bridge, meaning a new
thread is spun up for each playback.
* When the announcer is added or removed from the bridge, it results
in the BRIDGEPEER channel variable being set on all channels in the
bridge. This requires keeping the bridge locked and locking each
individual channel in order to set it.
* There's also just the general overhead of adding the channel and
removing it from the bridge. The bridge potentially has to reconfigure
every single time
With this commit, the paradigm for playing back announcements has
shifted.
* The announcer channel is now added to the bridge when the conference
is allocated, and it is hung up when the conference is destroyed.
* A taskprocessor is used to queue playbacks onto the announcer channel.
This keeps the behavior from before where playbacks do not overlap.
* The announcer channel is no longer placed into the bridge as
departable. Since we are not constantly removing the channel from
the bridge, it is safe to add the channel using an independent thread
and simply hang the channel up when it is time for the conference to
be destroyed.
The use of the taskprocessor for playbacks opens up the interesting
possibility of having asynchronous announcements played. In this commit,
however, the behavior is still exactly the same as it previously was.
ASTERISK-26289
Reported by Mark Michelson
Change-Id: Ic5cd2c4b98a1eaa1715eb7a5b35d62f1a76d78a5
---
M apps/app_confbridge.c
M apps/confbridge/conf_chan_announce.c
M apps/confbridge/include/confbridge.h
3 files changed, 232 insertions(+), 86 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/05/3505/2
--
To view, visit https://gerrit.asterisk.org/3505
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic5cd2c4b98a1eaa1715eb7a5b35d62f1a76d78a5
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.8
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
More information about the asterisk-code-review
mailing list