FreeSWITCH
As with 3CX, this pays attention to the TO header, and therefore requires less configuration that the other systems.
Configuring the Trunk
Create a new file in the configuration directory of FreeSWITCH (default /usr/local/freeswitch/conf) /sip_profiles/external/numbergroup.xml with the following content:
<code><include>
<gateway name=”numbergroup”>
<param name=”realm” value=”sip.numbergroup-services.com”/>
<param name=”username” value=”<username>”/>
<param name=”password” value=”<password>”/>
<param name=”register” value=”true”/>
<param name=”expire-seconds” value=”3600″/>
<param name=”retry-seconds” value=”3600″/>
<param name=”caller-id-in-from” value=”true”/>
<param name=”extension” value=”auto_to_user”/>
<param name=”caller-id-type” value=”pid”/>
</gateway>
</include></code>
Outbound calls
Add the following extension to the default context. This is usually stored in /dialplan/default.xml
<extension name=”numbergroup”>
<condition field=”destination_number” expression=”^(0\d{10})$”>
<action application=”bridge” data=”sofia/gateway/numbergroup/$1″ />
</condition>
</extension>
The expression is a regular expression. In this case it routes all calls to 11 digit numbers beginning with a 0, so all UK national calls, through numbergroup.
Inbound Calls
Set the destination of the DID in the numbergroup control panel to the trunk. To route a DID to an extension, use this as a template in /dialplan/public.xml, where DID is in the international format, beginning with 44:
<extension name=”<DID>”>
<condition field=”destination_number” expression=”<DID>”>
<action application=”transfer” data=”<extension>” />
</condition>
</extension>
