Discussion:
[asterisk-users] Options for bridging channels in a smart bridge
Jean Aunis
2017-07-05 16:45:51 UTC
Permalink
Hello,

I am struggling with a problem which I thought would be an easy one :
bridging several channels together in a *smart* bridge. I emphasize
*smart* : I want my bridge to be a native_rtp one when only two channels
are involved, and switch to softmix technology when a third channel
comes in.

I thought I could use ConfBridge for that, but it creates a bridge that
is not smart (it is of type softmix even if two channels only are involved).

I can do this with ARI of course, but handling transfers will become
quite difficult : I will receive replace_channels events, and channel
optimization will not be performed. I managed to have something working
this way, but I had to write a lot of code and some situations are very
tricky to debug.

The easiest way I found was to write a piece if dialplan mixing
BridgeWait, Bridge and BridgeAdd. This works well, transfers are handled
by the Asterisk core, and the bridge is smart. Still, it requires to
maintain a list of bridged channels in order to call BridgeWait, Bridge
and BridgeAdd in the right order and with the right parameters.

Can you think of any other way (hopefully easier) to achieve this ?

Regards

Jean
Joshua Colp
2017-07-05 16:51:50 UTC
Permalink
Post by Jean Aunis
Hello,
bridging several channels together in a *smart* bridge. I emphasize
*smart* : I want my bridge to be a native_rtp one when only two channels
are involved, and switch to softmix technology when a third channel
comes in.
I thought I could use ConfBridge for that, but it creates a bridge that
is not smart (it is of type softmix even if two channels only are involved).
I can do this with ARI of course, but handling transfers will become
quite difficult : I will receive replace_channels events, and channel
optimization will not be performed. I managed to have something working
this way, but I had to write a lot of code and some situations are very
tricky to debug.
The easiest way I found was to write a piece if dialplan mixing
BridgeWait, Bridge and BridgeAdd. This works well, transfers are handled
by the Asterisk core, and the bridge is smart. Still, it requires to
maintain a list of bridged channels in order to call BridgeWait, Bridge
and BridgeAdd in the right order and with the right parameters.
Can you think of any other way (hopefully easier) to achieve this ?
Not really, there's no cookie cutter application that behaves as you
need using the bridging API.
--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Jean AUNIS
2017-07-05 19:04:00 UTC
Permalink
On Wed, Jul 5, 2017,
Hello, I am struggling with a
problem which I thought would be an easy one : bridging several channels
together in a *smart* bridge. I emphasize *smart* : I want my bridge to
be a native_rtp one when only two channels are involved, and switch to
softmix technology when a third channel comes in. I thought I could use
ConfBridge for that, but it creates a bridge that is not smart (it is of
type softmix even if two channels only are involved). I can do this with
ARI of course, but handling transfers will become quite difficult : I
will receive replace_channels events, and channel optimization will not
be performed. I managed to have something working this way, but I had to
write a lot of code and some situations are very tricky to debug. The
easiest way I found was to write a piece if dialplan mixing BridgeWait,
Bridge and BridgeAdd. This works well, transfers are handled by the
Asterisk core, and the bridge is smart. Still, it requires to maintain a
list of bridged channels in order to call BridgeWait, Bridge and
BridgeAdd in the right order and with the right parameters. Can you
think of any other way (hopefully easier) to achieve this ?
Not
really, there's no cookie cutter application that behaves as you
need
using the bridging API.

Thank you for your quick answer.

Do you think
it could make sense to add an option to the ConfBridge application for
this ? Personally I would say "not really", because many ConfBridge
features may become unusable when the bridge is in native_rtp
technology.
Joshua Colp
2017-07-05 20:41:01 UTC
Permalink
On Wed, Jul 5, 2017, at 04:04 PM, Jean AUNIS wrote:

<snip>
Post by Jean AUNIS
Thank you for your quick answer.
Do you think
it could make sense to add an option to the ConfBridge application for
this ? Personally I would say "not really", because many ConfBridge
features may become unusable when the bridge is in native_rtp
technology.
I don't really know. This is really the first time anyone has ever
brought it up that I've seen so it's certainly not something people are
wanting. As for the implementation ConfBridge was never designed or
written with such a thing in mind, so the repercussions of doing so are
an unknown. It may be as easy as turning the feature on and it "just
works" including knowing when features and such are enabled, or maybe
not.
--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Jean Aunis
2017-07-06 06:37:10 UTC
Permalink
Post by Joshua Colp
<snip>
Post by Jean AUNIS
Thank you for your quick answer.
Do you think
it could make sense to add an option to the ConfBridge application for
this ? Personally I would say "not really", because many ConfBridge
features may become unusable when the bridge is in native_rtp
technology.
I don't really know. This is really the first time anyone has ever
brought it up that I've seen so it's certainly not something people are
wanting. As for the implementation ConfBridge was never designed or
written with such a thing in mind, so the repercussions of doing so are
an unknown. It may be as easy as turning the feature on and it "just
works" including knowing when features and such are enabled, or maybe
not.
I see. I will probably keep using my dialplan hack for the moment, and
maybe I will consider patching ConfBridge or writing my own application
in the future.
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo
Continue reading on narkive:
Loading...