asterisk/apps
Mark Michelson ded22c712a ConfBridge: Rework announcer channel methodology
NOTE: This patch was submitted earlier and reverted because of a failing
test. The test has been patched so that it adjusts for the changes here,
so this is being resubmitted for review.

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: Ica9fa4907c2f3728cdd1cf0bc564ef4eb40754a0
2016-08-23 13:03:05 -05:00
..
confbridge ConfBridge: Rework announcer channel methodology 2016-08-23 13:03:05 -05:00
Makefile Build System: Create Makefile macro MOD_ADD_SOURCE. 2015-04-14 12:53:03 -04:00
app_adsiprog.c AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro. 2015-05-13 16:34:23 -05:00
app_agent_pool.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_alarmreceiver.c AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro. 2015-05-13 16:34:23 -05:00
app_amd.c app_amd: Correct maximum_number_of_words functionality & documentation 2015-12-21 16:02:09 -08:00
app_authenticate.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_bridgeaddchan.c app_bridgeaddchan: ability to barge into existing call 2015-11-19 11:37:59 +13:00
app_bridgewait.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_cdr.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_celgenuserevent.c AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro. 2015-05-13 16:34:23 -05:00
app_chanisavail.c docs: Fix a few typo's in app docs (more then, resourse). 2015-11-06 16:46:31 -05:00
app_channelredirect.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_chanspy.c app_chanspy: fix audiohook options in non read-only mode 2016-05-03 17:17:48 -05:00
app_confbridge.c ConfBridge: Rework announcer channel methodology 2016-08-23 13:03:05 -05:00
app_controlplayback.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_dahdiras.c Fixes to include signal.h 2016-06-08 20:37:08 +03:00
app_db.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_dial.c app_dial: Improve documentation 2016-08-15 07:42:44 -05:00
app_dictate.c apps/app_dictate: Fix typo in attribution 2015-07-15 10:34:25 -05:00
app_directed_pickup.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_directory.c app_directory: Fix crash when using the alias option 'a'. 2015-06-11 14:59:25 -05:00
app_disa.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_dumpchan.c ast_format_cap_get_names: To display all formats, the buffer was increased. 2015-11-09 16:58:52 +01:00
app_echo.c app_echo: forward and generate VIDUPDATE frames 2016-03-29 10:39:49 -05:00
app_exec.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_externalivr.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_fax.c build_system: Fix some warnings highlighted by clang 2016-02-01 19:22:40 -06:00
app_festival.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_flash.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_followme.c followme: initialize all config items on reload 2016-08-17 18:51:31 +03:00
app_forkcdr.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_getcpeid.c AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro. 2015-05-13 16:34:23 -05:00
app_ices.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_image.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_ivrdemo.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_jack.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_macro.c pbx: Create pbx_include.c for management of 'struct ast_include'. 2016-07-15 05:34:29 -04:00
app_meetme.c build_system: Fix some warnings highlighted by clang 2016-02-01 19:22:40 -06:00
app_milliwatt.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_minivm.c build_system: Fix some warnings highlighted by clang 2016-02-01 19:22:40 -06:00
app_mixmonitor.c app_chanspy: Fix occasional deadlock with ChanSpy and Local channels. 2016-03-11 16:05:30 -06:00
app_morsecode.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_mp3.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_nbscat.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_originate.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_osplookup.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_page.c docs: Fix a few typo's in app docs (more then, resourse). 2015-11-06 16:46:31 -05:00
app_playback.c app_playback: Suppress warnings on playback if channel hung up 2015-05-20 19:10:49 -05:00
app_playtones.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_privacy.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_queue.c app_queue: Prevent crash when a call is forwarded to an invalid location 2016-08-11 13:56:19 -05:00
app_read.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_readexten.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_record.c app_record: RECORDED_FILE variable not being populated 2015-09-21 18:10:21 -05:00
app_saycounted.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_sayunixtime.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_senddtmf.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_sendtext.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_setcallerid.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_skel.c config: fix flags in uint option handler 2016-03-24 11:15:30 -05:00
app_sms.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_softhangup.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_speech_utils.c AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro. 2015-05-13 16:34:23 -05:00
app_stack.c AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro. 2015-05-13 16:34:23 -05:00
app_stasis.c app_stasis: Don't hang up if app is not registered 2016-03-16 11:18:28 -05:00
app_statsd.c StatsD: Add sample rate compatibility 2015-11-18 15:01:37 -06:00
app_system.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_talkdetect.c app_talkdetect: Make the module core supported. 2016-04-19 13:02:56 -05:00
app_test.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_transfer.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_url.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_userevent.c manager: Add <see-also> tags to relate UserEvent actions/apps/events 2016-08-15 07:40:35 -05:00
app_verbose.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_voicemail.c app_voicemail: Add taskprocessor alert level options. 2016-08-05 16:47:07 -04:00
app_voicemail.exports.in Remove some symbol exports that got missed in the removal of global symbols. 2012-06-15 15:33:41 +00:00
app_waitforring.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_waitforsilence.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_waituntil.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
app_while.c pbx: Create pbx_include.c for management of 'struct ast_include'. 2016-07-15 05:34:29 -04:00
app_zapateller.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
enter.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
leave.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00