Commit Graph

178 Commits

Author SHA1 Message Date
Sean Bright ca931c9436 app.c: Allow ampersands in playback lists to be escaped.
Any function or application that accepts a `&`-separated list of
filenames can now include a literal `&` in a filename by wrapping the
entire filename in single quotes, e.g.:

```
exten = _X.,n,Playback('https://example.com/sound.cgi?a=b&c=d'&hello-world)
```

Fixes #172

UpgradeNote: Ampersands in URLs passed to the `Playback()`,
`Background()`, `SpeechBackground()`, `Read()`, `Authenticate()`, or
`Queue()` applications as filename arguments can now be escaped by
single quoting the filename. Additionally, this is also possible when
using the `CONFBRIDGE` dialplan function, or configuring various
features in `confbridge.conf` and `queues.conf`.
2023-11-28 19:52:03 +00:00
Naveen Albert 4fbaf86a2b app_confbridge: Add end_marked_any option.
Adds the end_marked_any option, which can be used
to kick a user from a conference if any marked user
leaves.

ASTERISK-30211 #close

Change-Id: I9e8da7ccb892e522546c0f2b5476d172e022c2f5
2022-09-11 16:22:08 -05:00
Naveen Albert 0699c275d8 app_confbridge: Add missing AMI documentation.
Documents the ConfbridgeListRooms AMI response,
which is currently not documented.

ASTERISK-30020 #close

Change-Id: Id6fff7a936244bae7b52686301eb740c1169cdea
2022-08-01 08:44:31 -05:00
Naveen Albert 2843e5678d app_confbridge: Always set minimum video update interval.
Currently, if multiple video-enabled ConfBridges are
conferenced together, we immediately get into a scenario
where an infinite sequence of video updates fills up
the taskprocessor queue and causes memory consumption
to climb unabated until Asterisk is killed. This is due
to the core bridging mechanism that provides video updates
(softmix_bridge_write_control in bridge_softmix.c)
continously updating all the channels in the bridge with
video updates.

The logic to do so in the core is that the video updates
should be provided if the video_update_discard property
for the bridge is 0, or if enough time has elapsed since
the last video update. Thus, we already have a safeguard
built in to ensure the scenario described above does not
happen. Currently, however, this safeguard is not being
adequately ensured.

In app_confbridge, the video_update_discard property
defaults to 2000, which is a healthy value that should
completely prevent this issue. However, this value is
only set onto the bridge in the SFU video mode. This
leaves video modes such as follow_talker completely
vulnerable, since video_update_discard will actually
be 0, since the default or set value was never applied.
As a result, the core bridging mechanism will always
try to provide video updates regardless of when the last
one was sent.

To prevent this issue from happening, we now always
set the video_update_discard property on the bridge
with the value from the bridge profile. The app_confbridge
defaults will thus ensure that infinite video updates
no longer happen in any video mode.

ASTERISK-29907 #close

Change-Id: I4accb2536ac62797950468e9930f12ef7dd486b2
2022-07-13 18:04:29 -05:00
Naveen Albert bcc18ca9f5 general: Fix various typos.
ASTERISK-30089 #close

Change-Id: I1f5db911fd05a3a211c522c13e990fa1d0e62275
2022-07-12 07:46:03 -05:00
Naveen Albert 51d262af12 xmldocs: Improve examples.
Use example tags instead of regular para tags
where possible.

ASTERISK-30090

Change-Id: Iada8bbfda08f30b118cedf2d040bbb21e4966ec5
2022-06-09 03:47:41 -05:00
Naveen Albert 432a1d2d7e app_confbridge: Add function to retrieve channels.
Adds the CONFBRIDGE_CHANNELS function which can be used
to retrieve a comma-separated list of channels, filtered
by a particular type of participant category. This output
can then be used with functions like UNSHIFT, SHIFT, POP,
etc.

ASTERISK-30036 #close

Change-Id: I1950aff932437476dc1abab6f47fb4ac90520b83
2022-05-13 08:07:48 -05:00
Michael Cargile a2679b0ee2 apps/confbridge: Added hear_own_join_sound option to control who hears sound_join
Added the hear_own_join_sound option to the confbridge user profile to
control who hears the sound_join audio file. When set to 'yes' the user
entering the conference and the participants already in the conference
will hear the sound_join audio file. When set to 'no' the user entering
the conference will not hear the sound_join audio file, but the
participants already in the conference will hear the sound_join audio
file.

ASTERISK-29931
Added by Michael Cargile

Change-Id: I856bd66dc0dfa057323860a6418c1371d249abd2
2022-05-02 15:45:31 -05:00
Naveen Albert 0c70d497bc documentation: Adds versioning information.
Adds version information for applications, functions,
and manager events/actions.

This is not completely exhaustive by any means but
covers most new things added that have release
versioning information in the issue tracker.

ASTERISK-29940 #close

Change-Id: I506401e93c799715dbbe97c0a8ba18af2bf5e131
2022-04-26 17:40:39 -05:00
Alexander Traud cc025026b7 progdocs: Fix for Doxygen, the hidden parts.
ASTERISK-29779

Change-Id: If338163488498f65fa7248b60e80299c0a928e4b
2021-12-02 10:37:38 -06:00
Alexander Traud 196c24df22 apps: Fix for Doxygen.
ASTERISK-29740

Change-Id: Icb6fbcfea0a5f1c82caa5001902b6a786adbf307
2021-11-18 10:37:56 -06:00
Josh Soref eb03b18ff9 apps: Spelling fixes
Correct typos of the following word families:

simultaneously
administrator
directforward
attachfmt
dailplan
automatically
applicable
nouns
explicit
outside
sponsored
attachment
audio
spied
doesn't
counting
encoded
implements
recursively
emailaddress
arguments
queuerules
members
priority
output
advanced
silencethreshold
brazilian
debugging
argument
meadmin
formatting
integrated
sneakiness

ASTERISK-29714

Change-Id: Ie5ecaec91c00b26309da4e51cfc0991a5bb7d092
2021-11-16 05:38:29 -06:00
Naveen Albert 35437879e5 app_confbridge: New ConfKick() application
Adds a new ConfKick() application, which may
be used to kick a specific channel, all channels,
or all non-admin channels from a specified
conference bridge, similar to existing CLI and
AMI commands.

ASTERISK-29446

Change-Id: I5d96b683880bfdd27b2ab1c3f2e897c5046ded9b
2021-06-08 18:16:18 -05:00
Naveen Albert 5f8cabc232 app_confbridge: New option to prevent answer supervision
A new user option, answer_channel, adds the capability to
prevent answering the channel if it hasn't already been
answered yet.

ASTERISK-29440

Change-Id: I26642729d0345f178c7b8045506605c8402de54b
2021-06-08 15:42:54 -05:00
George Joseph 773f424c7f app_confbridge/bridge_softmix: Add ability to force estimated bitrate
app_confbridge now has the ability to set the estimated bitrate on an
SFU bridge.  To use it, set a bridge profile's remb_behavior to "force"
and set remb_estimated_bitrate to a rate in bits per second.  The
remb_estimated_bitrate parameter is ignored if remb_behavior is something
other than "force".

Change-Id: Idce6464ff014a37ea3b82944452e56cc4d75ab0a
2020-10-02 08:04:31 -05:00
Joshua C. Colp 6cfc6ff53c confbridge: Add support for disabling text messaging.
When in a conference bridge it may be necessary to have
text messages disabled for specific participants or for
all. This change adds a configuration option, "text_messaging",
which can be used to enable or disable this on the
user profile. By default existing behavior is preserved
as it defaults to "yes".

ASTERISK-28841

Change-Id: I30b5d9ae6f4803881d1ed9300590d405e392bc13
2020-04-20 12:03:22 -05:00
Joshua C. Colp 89b7144fbd confbridge: Add support for specifying maximum sample rate.
ConfBridge has the ability to move between different sample
rates for mixing the conference bridge. Up until now there has
only been the ability to set the conference bridge to mix at
a specific sample rate, or to let it move between sample rates
as necessary. This change adds the ability to configure a
conference bridge with a maximum sample rate so it can move
between sample rates but only up to the configured maximum.

ASTERISK-28658

Change-Id: Idff80896ccfb8a58a816e4ce9ac4ebde785963ee
2019-12-16 09:54:21 -06:00
George Joseph f3e5419d41 app_confbridge: Attended transfer event fixup
When a channel already in a conference bridge is attended transfered
to another extension, or when an existing call is attended
transferred into a conference bridge, we now generate ConfbridgeJoin
and ConfbridgeLeave events for the entering and departing channels.

Change-Id: Id7709cfbceb26fbcb828b2d0d2a6b2fbeaf028e1
2019-06-13 14:07:16 -06:00
Joshua Colp 80dba268ea app_confbridge: Add "all" variants of REMB behavior.
When producing a combined REMB value the normal behavior
is to have a REMB value which is unique for each sender
based on all of their receivers. This can result in one
sender having low bitrate while all the rest are high.

This change adds "all" variants which produces a bridge
level REMB value instead. All REMB reports are combined
together into a single REMB value that is the same for
each sender.

ASTERISK-28401

Change-Id: I883e6cc26003b497c8180b346111c79a131ba88c
2019-05-02 07:29:08 -06:00
Alexei Gradinari cb1a08bdcb confbridge: announce to the marked users when they join an empty conference
Currently the file sound_only_person is not played when a marked
user (with announce_only_user=yes) joins an empty conference.

This patch fixes it.

ASTERISK-28201 #close

Change-Id: I85b67687e6b220939c3af8091d83a70a7b174cf4
2018-12-12 12:15:49 -05:00
Corey Farrell 021ce938ca
astobj2: Remove legacy ao2_container_alloc routine.
Replace usage of ao2_container_alloc with ao2_container_alloc_hash or
ao2_container_alloc_list.  Remove ao2_container_alloc macro.

Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088
2018-11-21 09:56:16 -05:00
George Joseph 8d1c6bb6e6 bridge_softmix: Add SDP "label" attribute to streams
Adding the "label" attribute used for participant info correlation
was previously done in app_confbridge but it wasn't working
correctly because it didn't have knowledge about which video
streams belonged to which channel.  Only bridge_softmix has that
data so now it's set when the bridge topology is changed.

ASTERISK-28107

Change-Id: Ieddeca5799d710cad083af3fcc3e677fa2a2a499
2018-10-24 08:41:23 -05:00
Corey Farrell 5ab94d2a3e
taskprocessor: Warn on unused result from pushing task.
Add attribute_warn_unused_result to ast_taskprocessor_push,
ast_taskprocessor_push_local and ast_threadpool_push.  This will help
ensure we perform the necessary cleanup upon failure.

Change-Id: I7e4079bd7b21cfe52fb431ea79e41314520c3f6d
2018-10-17 09:14:05 -04:00
George Joseph f10c7b6eeb app_confbridge: Use bridge join hook to send join and leave events
The first attempt at publishing confbridge events to participants
involved publishing them at the same time stasis events were
created.  This caused issues with bridge and channel locks.  The
second attempt involved publishing them when the stasis events
were received by the code that published the confbridge AMI events.
This caused timing issues because, depending on resources available,
the event could be received before channels actually joined the
bridge and would therefore fail to send messages to the participant.

This attempt reverts to the original mechanism with one exception.
The join and leave events are published via bridge join and leave
hooks.  This guarantees the states of the channels and bridge and
provides deterministic timing for event publishing.

Change-Id: I2660074f8a30a5224cb953d5e047ee84484a9036
2018-09-28 07:33:16 -05:00
Robert Mordec 9d3f3a4b0a app_confbridge: Bridge and announcers not removed if conference ends quickly
If a conference is ended very quickly after it was created (i.e., the
first user immediately hangs up) then the conference bridge and announcer
channels are not removed.

When a conference is created, the push_announcer() function is added to
the playback queue task processor and the conference object reference is
bumped.  If a conference is ended while the push_announcer() function is
still going then the ao2_cleanup(conference) at the end of
push_announcer() will call the destructor function -
destroy_conference_bridge().

The destroy_conference_bridge() function will then add the
hangup_playback() task to the playback queue and will wait for it to end.
Since it is already a current task of the playback queue it will wait
forever.

This patch makes the conference thread call push_announcer() directly.
This way the conference object reference bump is not needed.  Since the
playback queue task processor is only used by the conference thread
itself, there is no danger of trying to play announcements before the
announcer is pushed to the bridge.

ASTERISK-27870 #close

Change-Id: I947a50fb121422d90fd1816d643a54d75185a477
2018-06-29 10:07:06 -06:00
George Joseph 5f12e2bd07 app_confbridge: Move participant info code to confbridge_manager.
With the participant info code in app_confbridge, we were still
in the process of adding the channel to the bridge when trying to send
an in-dialog MESSAGE.  This caused 2 threads to grab the channel
blocking flag at the same time.  To mitigate this, the participant
info code was moved to confbridge_manager so it runs after all
channel/bridge actions have finished.

Change-Id: I228806ac153074f45e0b35d5236166e92e132abd
2018-06-26 15:18:35 -06:00
George Joseph e7a7506f9c app_confbridge: Enable sending events to participants
ConfBridge can now send events to participants via in-dialog MESSAGEs.
All current Confbridge events are supported, such as ConfbridgeJoin,
ConfbridgeLeave, etc.  In addition to those events, a new event
ConfbridgeWelcome has been added that will send a list of all
current participants to a new participant.

For all but the ConfbridgeWelcome event, the JSON message contains
information about the bridge, such as its id and name, and information
about the channel that triggered the event such as channel name,
callerid info, mute status, and the MSID labels for their audio and
video tracks. You can use the labels to correlate callerid and mute
status to specific video elements in a webrtc client.

To control this behavior, the following options have been added to
confbridge.conf:

bridge_profile/enable_events:  This must be enabled on any bridge where
events are desired.

user_profile/send_events:  This must be set for a user profile to send
events.  Different user profiles connected to the same bridge can have
different settings.  This allows admins to get events but not normal
users for instance.

user_profile/echo_events:  In some cases, you might not want the user
triggering the event to get the event sent back to them.  To prevent it,
set this to false.

A change was also made to res_pjsip_sdp_rtp to save the generated msid
to the stream so it can be re-used.  This allows participant A's video
stream to appear as the same label to all other participants.

Change-Id: I26420aa9f101f0b2387dc9e2fd10733197f1318e
2018-06-13 09:12:18 -06:00
William McCall a7f4121238 app_confbridge: Add talking indicator for ConfBridgeList AMI response
When an AMI client connects, it cannot determine if a user was talking
prior to a transition in the user speaking state (which would generate
a ConfbridgeTalking event). This patch causes app_confbridge to track the
talking state and make this state available via ConfBridgeList.

ASTERISK-27877 #close

Change-Id: I19b5284f34966c3fda94f5b99a7e40e6b89767c6
2018-06-01 07:46:30 -06:00
Joshua Colp 8de3fa2b56 bridge_softmix / app_confbridge: Add support for REMB combining.
This change adds the ability for multiple REMB reports in
bridge_softmix to be combined according to a configured
behavior into a single report. This single report is sent
back to the sender of video, which adjusts the encoding bitrate
to be at or below the bitrate of the report. The available
behaviors are: lowest, highest, and average. Lowest uses the
lowest received bitrate. Highest uses the highest received
bitrate. Average goes through the received bitrates adding
them to the previous average and creates a new average.

Other behaviors can be added in the future and the existing
average one may be adjusted, but this provides the foundation
to do so.

Support for configuring which behavior to use has been
added to app_confbridge.

ASTERISK-27804

Change-Id: I9eafe4e7c1f72d67074a8d6acb26bfcf19322b66
2018-04-17 11:25:17 -06:00
Joshua Colp 0f6431e8e4 app_confbridge / bridge_softmix: Add ability to configure REMB interval.
This change adds a configuration option to app_confbridge which can be
used to set the interval at which we will send a combined REMB (remote
estimated maximum bitrate) frame to sources of video. The bridging API
has also been extended slightly to allow setting this so bridge_softmix
can use it.

ASTERISK-27786

Change-Id: I0e49eae60f369c86434414f3cb8278709c793c82
2018-04-03 08:13:11 -06:00
Richard Mudgett 67cd90f10d app_confbridge: ConfbridgeList event has standard channel shapshot headers.
* Made the AMI ConfbridgeList action's ConfbridgeList events output all
the standard channel snapshot headers instead of a few hand-coded channel
snapshot headers.  The benefit is that the CallerIDName gets disruptive
characters like CR, LF, Tab, and a few others escaped.  However, an empty
CallerIDName is now output as "<unknown>" instead of "<no name>".

ASTERISK-27651

Change-Id: Iaf7d54a9d40194c2db060bc9b4979fab6720d977
2018-02-05 13:47:30 -06:00
Richard Mudgett f4b161440b app_confbridge: Add the Muted header to ConfbridgeJoin AMI event.
ASTERISK-27651

Change-Id: Idef2ca54d242d1b894efd3fc7b360bc6fd5bdc34
2018-02-05 13:47:30 -06:00
Corey Farrell 527cf5a570 Remove redundant module checks and references.
This removes references that are no longer needed due to automatic
references created by module dependencies.

In addition this removes most calls to ast_module_check as they were
checking modules which are listed as dependencies.

Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
2018-01-24 13:37:29 -05:00
Corey Farrell 5380fb9978 app_confbridge: Fix NULL check in action_kick_last.
The check for last_user == NULL needs to happen before we dereference
the variable, previously it was possible for us to check flags of a NULL
last_user.

Change-Id: I274f737aa8af9d2d53e4a78cdd7ad57561003945
2018-01-08 19:47:38 -05:00
Corey Farrell e82b921c35 Modules: Fix issues with CLI completion.
* Stop using ast_module_helper to check if a module is loaded, use
  ast_module_check instead (app_confbridge and app_meetme).
* Stop ast_module_helper from listing reload classes when needsreload
  was not requested.

ASTERISK-27378

Change-Id: Iaed8c1e4fcbeb242921dbac7929a0fe75ff4b239
2017-10-30 01:39:20 -04:00
Sean Bright 06cc5ae9ff confbridge: Handle user hangup during name recording
This prevents orphaned CBAnn channels from getting stuck in the bridge.

ASTERISK-26994 #close
Reported by: James Terhune

Change-Id: I5e43e832a9507ec3f2c59752cd900b41dab80457
2017-08-29 09:28:11 -05:00
Joshua Colp 680c491a62 bridge_softmix / res_rtp_asterisk: Fix packet loss and renegotiation issues.
This change does a few things to improve packet loss and renegotiation:

1. On outgoing RTP streams we will now properly reflect out of order
packets and packet loss in the sequence number. This allows the
remote jitterbuffer to better reorder things.

2. Video updates can now be discarded for a period of time
after one has been sent to prevent flooding of clients.

3. For declined and removed streams we will now release any
media session resources associated with them. This was not
previously done and caused an issue where old state was being
used for a new stream.

4. RTP bundling was not actually removing bundled RTP instances
from the parent. This has been resolved by removing based on
the RTP instance itself and not the SSRC.

5. The code did not properly handle explicitly unbundling an
RTP instance from its parent. This now works as expected.

ASTERISK-27143

Change-Id: Ibd91362f0e4990b6129638e712bc8adf0899fd45
2017-07-19 13:23:26 +00:00
Sergej Kasumovic 26f149ab0a app_confbridge: Make sure name recordings are always removed from the filesystem
This commit fixes two possible scenarios:

* When recording name and if during recording you hangup, file is never
removed. This is due to the fact file location is nulled.
* When recording name and if you hangup during thank-you prompt, file
is never removed.

ASTERISK-27123 #close

Change-Id: I39b7271408b4b54ce880c5111a886aa8f28c2625
2017-07-14 07:50:13 -05:00
Joshua Colp 1a24543124 Merge "Confbridge: Add "sfu" video mode to bridge profile options." 2017-06-06 07:05:13 -05:00
Mark Michelson 39d14834f8 Confbridge: Add "sfu" video mode to bridge profile options.
A previous commit added plumbing to bridge_softmix to allow for an SFU
experience with Asterisk. This commit adds an option to app_confbridge
that allows for a confbridge to actually make use of the SFU video mode.

SFU mode is implemented in a "set it and forget it" kind of way. That
is, when the bridge is created, if SFU mode is enabled, then the video
mode gets set to SFU and cannot be changed. Future improvements may
allow for a hybrid experience (e.g. forward multiple video streams,
specifically those of the most recent talkers), but for this addition,
no such capability is present.

Change-Id: I87bbcb63dec6dbbb42488f894871b86f112b2020
2017-05-30 10:24:20 -05:00
Robert Mordec 36e90952ec app_confbridge: Race between removing and playing name recording while leaving
When user leaves a conference, its channel calls async_play_sound_file()
in order to play the name announcement and then unlinks the sound file.
The async_play_sound_file() function adds a task to conference playback queue,
which then runs playback_common() function in a different thread.

It leads to a race condition when, in some cases, channel thread may unlink
the sound file before playback_common() had a chance to open it.

This patch creates a file deletion task, that is queued after playback.

ASTERISK-27012 #close

Change-Id: I412f7922d412004b80917d4e892546c15bd70dd3
2017-05-23 07:20:01 -05:00
George Joseph 747beb1ed1 modules: change module LOAD_FAILUREs to LOAD_DECLINES
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed
to AST_MODULE_LOAD_DECLINE.  This prevents asterisk from exiting
if a module can't be loaded.  If the user wishes to retain the
FAILURE behavior for a specific module, they can use the "require"
or "preload-require" keyword in modules.conf.

A new API was added to logger: ast_is_logger_initialized().  This
allows asterisk.c/check_init() to print to the error log once the
logger subsystem is ready instead of just to stdout.  If something
does fail before the logger is initialized, we now print to stderr
instead of stdout.

Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2017-04-12 15:57:21 -06:00
frahaase 5b1796f59d Binaural synthesis (confbridge): DTMF conference management.
DTMF configuration options for the binaural softmix bridge:
toggle binaural rendering (per channel).

ASTERISK-26292

Change-Id: Ibfe708b9fe26097c1798fcbfcc4dc461267d8af8
2017-02-24 15:13:56 -06:00
frahaase 094c26aa68 Binaural synthesis (confbridge): Adds binaural synthesis to bridge_softmix.
Adds binaural synthesis to bridge_softmix (via convolution using libfftw3).
Binaural synthesis is conducted at 48kHz.
For a conference, only one spatial representation is rendered.
The default rendering is applied for mono-capable channels.

ASTERISK-26292

Change-Id: Iecdb381b6adc17c961049658678f6219adae1ddf
2017-02-23 10:34:58 -07:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Mark Michelson ac02bbd9a0 ConfBridge: Make some announcements asynchronous.
Confbridge announcements tend to block a channel while they are being
played. In some circumstances, this is warranted since you want that
particular channel not to hear the announcement (Example: "John Doe has
entered the conference"). For others it makes less sense.

This change first introduces methods for playing sounds asynchronously
into the conference. This is very similar to how synchronous sounds are
played, except the channel initiating the playback does not wait for the
sound to complete before moving on.

Asynchronous announcements are used for two circumstances:
* Sounds played for a user after they have left the bridge
* Sounds that play first to a single user and then the rest of the
  conference (if the channel and conference use the same language)

ASTERISK-26289 #close
Reported by Mark Michelson

Change-Id: Ie486bb3de1646d50894489030326a423e594ab0a
2016-09-07 09:12:41 -05:00
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
Joshua Colp 065d810d3f Revert "ConfBridge: Rework announcer channel methodology"
This reverts commit 5aa8773052.

Change-Id: I9ab45776e54a54ecf1bac9ae62d976dec30ef491
2016-08-23 05:54:02 -05:00
Mark Michelson 5aa8773052 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
2016-08-18 09:51:24 -05:00
Jaco Kroon 8923c9ac96 app_confbridge: Add a regcontext option for confbridge bridge profiles.
This patch allows for having app_confbridge register the name of the
conference as an extension into a specific context, similar to
regcontext for chan_sip.  This variant is not quite as involved as the
one in chan_sip and doesn't allow for multiple contexts or custom
extensions, you can only specify the context and the conference name
will always be used as the extension to register.

ASTERISK-25989 #close

Change-Id: Icacf94d9f2b5dfd31ef36f6cb702392619a7902f
2016-05-09 08:18:56 -05:00