Multiple endpoints with enterprise originate

Consider this example: a customer wants to know if they can route a call to two different people. Person number one (Alice) prefers that her desk phone ring
first, and then her mobile phone. Person number two (Bob) prefers that his desk phone and his mobile phone ring simultaneously. Whoever answers first-Alice or Bob-will take the call and all the other outbound calls will stop ringing.

This complicated scenario requires the use of FreeSWITCH's enterprise originate. The basic idea of an enterprise originate is that there are individual originates that are connected in a larger "enterprise". In our example, Alice's phones might be dialed like this:

<action application="bridge" 
data="[leg_timeout=10]user/Alice| 
[leg_timeout=20]sofia/gateway/my_gw/${alice_mobile}"/> 

And for Bob:

<action application="bridge" 
data="[leg_timeout=10]user/Bob| 
[leg_timeout=20]sofia/gateway/my_gw/${bob_mobile}"/> 

Each of these individual bridge attempts would work for calling either Alice or Bob, but not both at the same time. To accomplish this, put both of these into a single bridge action and separate them with the special :_: sequence. Here is an example:

<action application="bridge" 
data="<ignore_early_media=true>[leg_timeout=10]user/Alice| 
[leg_timeout=20]sofia/gateway/my_gw/${alice_mobile}:_: 
[leg_timeout=10]user/Bob| 
[leg_timeout=20]sofia/gateway/my_gw/${bob_mobile}"/> 

In this case, when the inbound leg hits this bridge app, FreeSWITCH will initiate two separate "originates"-one for reaching Alice and the other for reaching Bob. The effect here is that FreeSWITCH tries to reach Alice, by calling her desk phone and then her mobile while at the same time calling Bob at his desk phone and his mobile phone. If anyone answers then the whole "enterprise" stops and the call is connected to the endpoint that answered.

Note that we are forced to use ignore_early_media=true, because we are creating so many call legs. There is no way to pick just one source of early media (ringing) and use it. Be sure to set the ringback or transfer_ringback variables if you need to supply some kind of ringing signal to the calling party.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset