]> git.ipfire.org Git - thirdparty/asterisk.git/commit
ConfBridge: Rework announcer channel methodology 09/3509/2
authorMark Michelson <mmichelson@digium.com>
Wed, 10 Aug 2016 20:14:09 +0000 (15:14 -0500)
committerMark Michelson <mmichelson@digium.com>
Thu, 18 Aug 2016 14:51:14 +0000 (09:51 -0500)
commitd9749887361252f7486bd5aaf3d3a8f046831a3d
treeefebf0ce6cee606aa7127d0cb69794df13ccae4f
parent41e9bf60aa99c063d7dd0d10ab80a1053f4c15af
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
apps/app_confbridge.c
apps/confbridge/conf_chan_announce.c
apps/confbridge/include/confbridge.h