Inline bridge parameter with mod_distributor

Status
Not open for further replies.

EasyBB

Active Member
Oct 23, 2016
240
33
28
Australia
Is it possible at all to use inline bridge parameter with mod_distributor?

Suppose I have two gateways that normally be used in the bridge as:
Code:
[parameter=value1]sofia/external/gw1_uuid/$1
[parameter=value2]sofia/external/gw2_uuid/$1

How do I use these gateways in a distributor while injecting different values to the parameter based on the gateway chosen?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
Just an idea, I have not tried this. Could you use a variable array with the returned gateway as the key? For example:
(with reference to https://freeswitch.org/confluence/display/FREESWITCH/mod_distributor)
You call distributor with your list name...
Code:
<action application="bridge" data="sofia/gateway/${distributor(3gw)}/$1"/>

If you created a channel variable array, maybe something like this...
Code:
<action application="set" data="mycli[gateway1]=0123456"/>
<action application="set" data="mycli[gateway2]=0654321"/>
<action application="set" data="mycli[gateway3]=0987654"/>

Then set the parameter as follows...
Code:
[parameter=${mycli[${distributor(3gw)}]}]sofia/external/${distributor(3gw)}/$1

As I say, it's just an idea.
 
Status
Not open for further replies.