Routing inbound calls to extentions with did intact
Hello All, I use freeswitch to route inbound calls to some of the PBX's we host, and I use the following method (Below) to do so. It's been working great (20,000 calls in the first month without a problem), but I wanted to get a second opinion to see if there was a better way to do such a thing (keeping the DID intact). Any help would be appreciated. (I used an example DID and extention) <extension name="setdid"> <condition field="destination_number" expression="^setdid$"> <action application="set" data="dialed_ext=${did}"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="disable_q850_reason=true"/> <action application="bridge" data="sofia/internal/${did}${regex(${sofia_contact(${user})}|^[^\@]+(.*)|%1)}"/> </condition> </extension> <extension name="13125551234"> <condition field="destination_number" expression="^13125551234$"> <action application="set" data="user=user1002"/> <action application="set" data="did=${destination_number}"/> <action application="execute_extension" data="setdid"/> </condition> </extension> Thanks!
Check out http://wiki.freeswitch.org/wiki/Function_sofia_contact specifically the syntax using the ^. Does this get you what you want, if not, how close is it? We could add a similar syntax for other behavior. Could you explain what exactly you want different in the sip packet? On Aug 22, 2012, at 10:52 AM, Ian Halliday <ihalliday@ndevix.com> wrote:
Hello All,
I use freeswitch to route inbound calls to some of the PBX's we host, and I use the following method (Below) to do so. It's been working great (20,000 calls in the first month without a problem), but I wanted to get a second opinion to see if there was a better way to do such a thing (keeping the DID intact). Any help would be appreciated. (I used an example DID and extention)
<extension name="setdid"> <condition field="destination_number" expression="^setdid$"> <action application="set" data="dialed_ext=${did}"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="disable_q850_reason=true"/> <action application="bridge" data="sofia/internal/${did}${regex(${sofia_contact(${user})}|^[^\@]+(.*)|%1)}"/> </condition> </extension>
<extension name="13125551234"> <condition field="destination_number" expression="^13125551234$"> <action application="set" data="user=user1002"/> <action application="set" data="did=${destination_number}"/> <action application="execute_extension" data="setdid"/> </condition> </extension>
participants (2)
-
Ian Halliday
-
Michael Jerris