[asterisk-dev] bridge_builtin_features.c playback to both channels in bridge

Richard Mudgett rmudgett at digium.com
Mon Nov 20 11:55:49 CST 2017


On Mon, Nov 20, 2017 at 7:03 AM, Steve Davies <davies147 at gmail.com> wrote:

> Hi,
>
> Perhaps the answer to this will be pointing me at some documentation -
> That is fine, but I've failed to find it so far, so forgive me if the
> following is a dumb question.
>
> With Asterisk-11 I added a built-in feature which allowed a very
> customised version of stopping call recording on a bridge, playing back
> different messages to each channel, and so forth based on some channel
> variables, and depending whether the feature was enabled per channel.
>
> I want to port this to Asterisk-15, but am struggling to understand the
> new bridge playback methods. I variously see ast_bridge_channel_queue_playfile(),
> ast_bridge_channel_write_playfile(), or even one followed by the other.
>
> What I'd like to do is queue playback message(s) to both halves of a
> bridge simultaneously so that the bridge will resume once all messages on
> both channels are complete.
>
> An a first read-through, I was fairly convinced that I would be able to
> just call ast_bridge_channel_queue_playfile() as many times as needed on
> both the bridge, and peer channels, and magic would happen, until I saw the
> code in bridges/bridge_builtin_features.c: start_automixmonitor(), after
> which I became most confused :)
>
> Help please?
>

Reaching across the bridge is not allowed.  A channel in a bridge is not
supposed to know
who it is exchanging frames with because the channel could be exchanging
frames with zero
or more other channels at any given time.  Over time, the participant
channels in the bridge
could change.  Channels could be added, removed, or swapped with other
channels in the bridge.

ast_bridge_channel_queue_playfile() - This function queues the playfile
onto the channel itself
for the channel to play the file.

ast_bridge_channel_write_playfile() - This function puts the playfile
request into the bridge for
the other channels in the bridge to play the file.  The bridge handles
distributing the request to
all other channels in the bridge according to the bridge technology.

More information can be found here [1].

Richard

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Bridging+Project
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20171120/f3fb3fca/attachment.html>


More information about the asterisk-dev mailing list