You receive a channel variable for every SIP header, and it shouldn't be a problem to build a regular expression to extract the dialed number from Diversion string.

You can also call "info" application at the beginning of the dialplan and see all the variables that are available.



On May 1, 2016 20:30, "Joseph Waite" <joelists@tm.net.uk> wrote:
Hi Guys

We have a Freeswitch based FusionPBX setup which registers to our main SIP Switch with Registering trunks.

Outbound Calls work fine, however I’m having issues with using multiple inbound numbers.

If I setup a destination with the username of the trunk then all calls received on the trunk goto that destination.

If I setup each DID on its own then calls fails.

In the invite I see To: <sip:trunkuser@providerip:5080>

I see the DID dialled in the following in the SIP message

Diversion: numberdialed <tel:numberdialed>;reason=unknown;counter=1;privacy=off

Is there a setting I can add somewhere to the trunk config to tell it to use the value in Diversion?


Any help greatly appreciated.

Regards

Joseph Waite
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org