Commit Graph

136 Commits

Author SHA1 Message Date
Sean Bright 53fac14e41 app_confbridge: Don't emit warnings on valid configurations.
The numeric bridge profile options `internal_sample_rate` and
`maximum_sample_rate` are documented to accept the special values
`auto` and `none`, respectively. While these values currently work,
they also emit warnings when used which could be confusing for users.

In passing, also ensure that we only accept the documented range of
sample rate values between 8000 and 192000.

Fixes #546
2024-01-23 16:36:18 +00:00
Naveen Albert d1fb397cfc general: Fix broken links.
This fixes a number of broken links throughout the
tree, mostly caused by wiki.asterisk.org being replaced
with docs.asterisk.org, which should eliminate the
need for sporadic fixes as in f28047db36.

Resolves: #430
2023-12-08 13:11:54 +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 31887d636a app_confbridge: Fix memory leak on updated menu options.
If the CONFBRIDGE function is used to dynamically set
menu options, a memory leak occurs when a menu option
that has been set is overridden, since the menu entry
is not destroyed before being freed. This ensures that
it is.

Additionally, logic that duplicates the destroy function
is removed in lieu of the destroy function itself.

ASTERISK-28422 #close

Change-Id: I71cfb5c24e636984d41086d1333a416dc12ff995
2022-08-08 05:20:04 -05:00
Naveen Albert cf0f1829fb general: Remove obsolete SVN references.
There are a handful of files in the tree that
reference an SVN link for the coding guidelines.

This removes these because the links are dead
and the vast majority of source files do not
contain these links, so this is more consistent.

app_skel still maintains an (up to date) link
to the coding guidelines.

ASTERISK-30159 #close

Change-Id: I35bbb20f66982e98099cff3029ede20091ffdac7
2022-08-01 11:06:37 -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
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 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
George Joseph b9f42a717e app_confbridge: Plug ref leak of bridge channel with send_events
When send_events is enabled for a user, we were leaking a reference
to the bridge channel in confbridge_manager.c:send_message().  This
also caused the bridge snapshot to not be destroyed.

Change-Id: I87a7ae9175e3cd29f6d6a8750e0ec5427bd98e97
2020-06-10 11:03:04 -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
George Joseph 3667c5e1d2 bridges: Remove reliance on stasis caching
* The bridging core no longer uses the stasis cache for bridge
  snapshots.  The latest bridge snapshot is now stored on the
  ast_bridge structure itself.

* The following APIs are no longer available since the stasis cache
  is no longer used:
    ast_bridge_topic_cached()
    ast_bridge_topic_all_cached()

* A topic pool is now used for individual bridge topics.

* The ast_bridge_cache() function was removed since there's no
  longer a separate container of snapshots.

* A new function "ast_bridges()" was created to retrieve the
  container of all bridges.  Users formerly calling
  ast_bridge_cache() can use the new function to iterate over
  bridges and retrieve the latest snapshot directly from the
  bridge.

* The ast_bridge_snapshot_get_latest() function was renamed to
  ast_bridge_get_snapshot_by_uniqueid().

* A new function "ast_bridge_get_snapshot()" was created to retrieve
  the bridge snapshot directly from the bridge structure.

* The ast_bridge_topic_all() function now returns a normal topic
  not a cached one so you can't use stasis cache functions on it
  either.

* The ast_bridge_snapshot_type() stasis message now has the
  ast_bridge_snapshot_update structure as it's data.  It contains
  the last snapshot and the new one.

* cdr, cel, manager and ari have been updated to use the new
  arrangement.

Change-Id: I7049b80efa88676ce5c4666f818fa18ad1985369
2018-11-26 14:30:02 -07:00
Joshua Colp d0ccbb3377 stasis: Use an implementation specific channel snapshot cache.
Channels no longer use the Stasis cache for channel snapshots. Instead
they are stored in a hash table in stasis_channels which reduces the
number of Stasis messages created and allows better storage.

As a result the following APIs are no longer available since the stasis
cache is no longer used:
ast_channel_topic_cached()
ast_channel_topic_all_cached()

The ast_channel_cache_all() and ast_channel_cache_by_name() functions
now return an ao2_container of ast_channel_snapshots rather than
a container of stasis_messages therefore you can't (and don't need
to) call stasis_cache functions on it.

The ast_channel_topic_all() function now returns a normal topic not
a cached one so you can't use stasis cache functions on it either.

The ast_channel_snapshot_type() stasis message now has the
ast_channel_snapshot_update structure as it's data. It contains the
last snapshot and the new one.

ast_channel_snapshot_get_latest() still returns the latest snapshot.

The latest snapshot is now stored on the channel itself to eliminate
cache hits when Stasis messages that have the snapshot as a payload
are created.

ASTERISK-28102

Change-Id: I9334febff60a82d7c39703e49059fa3a68825786
2018-11-26 18:43:53 +00: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
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
George Joseph 34f3fe9552 app_confbridge: Use the SDP 'label' attribute to correlate users
Previously, the msid "label" attribute was used to correlate
participant info but because streams could be reused, the msid
wasn't being updated correctly when someone left the bridge and
another joined.

Now, instead of looking for the msid attribute on a channel's streams,
app_confbridge sets an "SDP:LABEL" attribute on the stream which
res_pjsip_sdp_rtp looks for.  If it finds it, it adds a "label"
attribute to the current sdp.

Change-Id: I6cbaa87fb59a2e0688d956e72d2d09e4ac20d5a5
2018-07-13 11:33:30 -05: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
Chris-Savinovich b437656c2e "confbridge show profile bridge" does not output "sfu" when video_mode is sfu
Fixes a bug on the "confbridge show profile bridge" cli command
that showed "video_mode=no video" when video_mode was set
to "sfu"

ASTERISK-27418  #close

Change-Id: I481e3172c7f872664c7ac7809879d541c9f031e9
2018-04-18 16:10:54 -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 f4b161440b app_confbridge: Add the Muted header to ConfbridgeJoin AMI event.
ASTERISK-27651

Change-Id: Idef2ca54d242d1b894efd3fc7b360bc6fd5bdc34
2018-02-05 13:47:30 -06:00
Richard Mudgett b9024197ab app_confbridge: Update dsp_silence_threshold and dsp_talking_threshold docs.
The dsp_talking_threshold does not represent time in milliseconds.  It
represents the average magnitude per sample in the audio packets.  This is
what the DSP uses to determine if a packet is silence or talking/noise.

Change-Id: If6f939c100eb92a5ac6c21236559018eeaf58443
2018-01-31 13:13:27 -06:00
Corey Farrell bf2d35931d aco: Minimize use of regex.
Remove nearly all use of regex from ACO users.  Still remaining:
* app_confbridge has a legitamate use of option name regex.
* ast_sorcery_object_fields_register is implemented with regex, all
  callers use simple prefix based regex.  I haven't decided the best
  way to fix this in both 13/15 and master.

Change-Id: Ib5ed478218d8a661ace4d2eaaea98b59a897974b
2017-12-15 10:14:31 -05:00
Joshua Colp 6fd3db51e8 app_confbridge: Only create a channel that records audio.
This change makes it so that the conference recorder channel
that is created only contains audio formats and an audio stream.
This is because the underlying application used by ConfBridge to
record, MixMonitor, only allows recording audio.

Having additional streams (and in particular a video stream) can
result in clients needlessly renegotiating to add a video stream
that will never receive video.

Change-Id: I89d38aedc9205eca7741d5435e73e73bb9de97a0
2017-09-19 07:56:00 -05:00
Joshua Colp c7edd0b493 Merge "app_confbridge: Document sfu video_mode value." 2017-08-23 13:05:35 -05:00
Richard Mudgett 5bbf7b2aad app_confbridge: Document sfu video_mode value.
Change-Id: I26e17df2c93f3933b23f78070603adbcc84ba204
2017-08-22 11:23:45 -05:00
Richard Mudgett f96536b1ea confbridge.h: Fix doxygen comments.
Change-Id: I16133166a85fdb557c66ffcbfe8128d0b4725b0e
2017-08-22 11:21:13 -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
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
George Joseph 0001834157 app_confbridge: Fix reference to cfg in menu_template_handler
menu_template_handler wasn't properly accounting for the fact that
it might be called both during a load/reload (which isn't really
valid but not prevented) and by a dialplan function.  In both cases
it was attempting to use the "pending" config which wasn't valid in
the latter case.  aco_process_config is also partly to blame because
it wasn't properly cleaning "pending" up when a reload was done and
no changes were made.  Both of these contributed to a crash if
CONFBRIDGE(menu,template) was called in a dialplan after a reload.

* aco_process_config now sets info->internal->pending to NULL
  after it unrefs it although this isn't strictly necessary in the
  context of this fix.
* menu_template_handler now uses the "current" config and silently
  ignores any attempt to be called as a result of someone uses the
  "template" parameter in the conf file.

Luckily there's no other place in the codebase where
aco_pending_config is used outside of aco_process_config.

ASTERISK-25506 #close
Reported-by: Frederic LE FOLL

Change-Id: Ib349a17d3d088f092480b19addd7122fcaac21a7
2017-05-04 20:13:55 -05:00
Richard Mudgett 57656e2b5b app_confbridge: Fix ConfbridgeTalking AMI event description.
Thanks to Chris Howard for pointing this out on the wiki.

Change-Id: I18e56de09a70e736b5d04719d45ef29cf0636705
2017-03-16 15:54:10 -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
Sean Bright 3f94373778 cli: Fix various CLI documentation and completion issues
* app_minivm: Use built-in completion facilities to complete optional
arguments.

* app_voicemail: Use built-in completion facilities to complete
optional arguments.

* app_confbridge: Add missing colons after 'Usage' text.

* chan_alsa: Use built-in completion facilities to complete optional
arguments.

* chan_sip: Use built-in completion facilities to complete optional
arguments. Add completions for 'load' for 'sip show user', 'sip show
peer', and 'sip qualify peer.'

* chan_skinny: Correct and extend completions for 'skinny reset' and
'skinny show line.'

* func_odbc: Correct completions for 'odbc read' and 'odbc write'

* main/astmm: Use built-in completion facilities to complete arguments
for 'memory' commands.

* main/bridge: Correct completions for 'bridge kick.'

* main/ccss: Use built-in completion facilities to complete arguments
for 'cc cancel' command.

* main/cli: Add 'all' completion for 'channel request hangup.' Correct
completions for 'core set debug channel.' Correct completions for 'core
show calls.'

* main/pbx_app: Remove redundant completions for 'core show
applications.'

* main/pbx_hangup_handler: Remove unused completions for 'core show
hanguphandlers all.'

* res_sorcery_memory_cache: Add completion for 'reload' argument of
'sorcery memory cache stale' and properly implement.

Change-Id: Iee58c7392f6fec34ad9d596109117af87697bbca
2017-02-13 11:33:15 -05: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
frahaase dce31f90ba Binaural synthesis (confbridge): On/off setting for binaural synthesis.
Adds setting to confbridge.conf (binaural_active) that determines if binaural
synthesis can be available in bridge_softmix.

ASTERISK-26292

Change-Id: I59dfcb8e55fe1df4ef32045882fea5bb58fc71db
2016-10-17 18:58:14 +00: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
Richard Mudgett a63656b419 Bridge system: Fix memory leaks and double frees on impart failure.
You cannot reference the passed in features struct after calling
ast_bridge_impart().  Even if the call fails.

Change-Id: I902b88ba0d5d39520e670fb635078a367268ea21
2016-04-22 15:45:47 -05:00
Richard Mudgett 1bc54aee80 app_confbridge: Only use b_profile options from the conference.
A user cannot set new bridge options after the conference is created by
the first user.  Attempting to do so is documented as undefined behavior.

This patch ensures that the bridge profile options used are from the
conference and not what a subsequent user may have tried to set.

Change-Id: I1b6383eba654679e5739d5a8de98199cf074a266
2016-02-05 11:57:48 -06:00