[asterisk-dev] extending bridging API

Joshua Colp jcolp at digium.com
Mon Feb 8 13:51:29 CST 2010


----- "Klaus Darilion" <klaus.mailinglists at pernau.at> wrote:

> Hi!
> 
> I just tried to understand how the new bridging API works, and how I
> can 
> extend it, but I am not sure how/where to extend it. Thus I have some
> 
> questions :-)
> 
> For example the bridge should react on AST_CONTROL_* frames. If a 
> participant puts the call on hold, and AST_CONTROL_HOLD is received on
> 
> the participants channel, the participant should be muted. Or if 
> AST_CONTROL_CONNECTED_LINE is received, the other participants should
> be 
> informed about the new line identity.

It's the responsibility of the bridging technology in use to propagate frames
as it sees fit.
 
> Where would this kind of features be implemented? Adding a new bridge
> 
> implementation in the bridges/ directory or by adding the code to 
> main/bridging.c?

The bridging core itself doesn't care about frames like this, you would have
to extend it to intercept them.
 
> Further, these features should be configurable, thus I guess I have to
> 
> add new options to ConfBridge() application. But how will the features
> 
> be signaled to the bridging core? Adding new capabilities, or a new 
> flag, when calling ast_bridge_new()?
> 
> Further, AFAIS there are callbacks from the bridging core to the 
> application, but only DTMF events are supported. How/where do I have
> to 
> extend the hooks to signal e.g. AST_CONTROL_CONNECTED_LINE to the 
> calling application too?

Hooks are implemented at the bridging core level. The place where you
would want to insert hook code to intercept control frames would be
in the ast_bridge_handle_trip function.
 
> Finally, is it somehow possible to stream audio only to a single 
> participant? Consider this (rather stupid) example: A participant 
> changes line identity and AST_CONTROL_CONNECTED_LINE is received. Now,
> I 
> want to playback to this single participant "The other participants
> will 
> be informed about your new identity", and maybe playback to all other
> 
> participants "user x changed its identity to Y". Is this possible from
> 
> within the calling application? E.g. the ConfBridge application
> receives 
> the event that a participant sent AST_CONTROL_CONNECTED_LINE and then
> 
> ConfBridge instructs the bridging core to play certain voice prompts
> to 
> certain participants?

This is partially outside the scope of the bridging API. For individual playback
to a specific channel you can use audiohooks to have the audio mixed in or replace
the existing audio. For group playback to the bridge you can use the Bridge channel
like app_confbridge already does.

The goal I had for the bridging API was not to duplicate things we already have
(like audiohooks) so thus it provides no way to do audio insertion on a specific
channel in a bridge.

Good luck!

-- 
Joshua Colp
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org



More information about the asterisk-dev mailing list