Skip to main content

Provider Voip Innovations (USA)

www.voipinnovations.com

Last Update: 24 September 2012

This example assumes altering the default configuration included with FreeSWITCH. Custom contexts and such will require tweaking. ${FS Install DIR} is used to represent the directory in which FreeSWITCH is installed, by default this is /usr/local/freeswitch.

Outbound Calling

You'll need a few bits to get this working. First, add a Gateway profile to ${FS Install DIR}/conf/sip_profiles/external/voipinnovations.xml

  <include>
<gateway name="voipinnovations">
<param name="username" value="user"/>
<param name="password" value="pass"/>
<param name="proxy" value="64.136.174.30"/>
<param name="context" value="public"/>
<param name="register" value="false"/>
</gateway>
</include>

The username and password fields are not used by VI, but are required by FreeSWITCH to create the gateway. The IP address they give you might be '64.136.174.35' instead of .30 listed above, check your welcome packet.

This should be just about enough to get outbound calling working. You just need to add one thing to the default dialplan to tell FS to send outbound calls to that gateway. Open up ${FS Install DIR}/conf/diaplans/default/01_example.com.xml. We'll use this as our template. Inside you should see this:

<include>

<extension name="local.example.com">
<condition field="${toll_allow}" expression="local"/>
<condition field="destination_number" expression="^(\d{7})$">
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
<action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/>
<action application="bridge" data="sofia/gateway/${default_gateway}/1${default_areacode}$1"/>
</condition>
</extension>

<extension name="domestic.example.com">
<condition field="${toll_allow}" expression="domestic"/>
<condition field="destination_number" expression="^(\d{11})$">
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
<action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/>
<action application="bridge" data="sofia/gateway/${default_gateway}/$1"/>
</condition>
</extension>

<extension name="international.example.com">
<condition field="${toll_allow}" expression="international"/>
<condition field="destination_number" expression="^(011\d+)$">
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
<action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/>
<action application="bridge" data="sofia/gateway/${default_gateway}/$1"/>
</condition>
</extension>

</include>

VI can't handle the 7 digit numbers and doesn't at time of writing do International termination, so you can remove the first and third extension sections. We'll alter the second extension as well, leaving you with something like this:

<include>

<extension name="voipinnovations">
<condition field="destination_number" expression="^(\d{11})$">
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
<action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/>
<action application="bridge" data="sofia/gateway/voipinnovations/$1"/>
</condition>
</extension>

</include>

Please note that this assumes an 11 digit dialed number from the phone. To allow 10 digit dialing as well, you can modify the condition as follows.

<condition field="destination_number" expression="^1?(\d{10})$">

Inbound Calling

For inbound calling, we need to add their IP to the ACL rules. The file ${FS Install DIR}/conf/autoload_configs/acl.conf.xml should have a section like this:

   <list name="domains" default="deny">
<node type="allow" domain="$${domain}"/>
</list> 

Add a line with their IP address like so:

    <list name="domains" default="deny">
<node type="allow" domain="$${domain}"/>
<node type="allow" domain="64.136.174.30"/>
</list>

Then open up ${FS Install DIR}/conf/sip_profiles/external.xml and make sure it has these two lines:

  <param name="auth-calls" value="false"/>
<param name="apply-inbound-acl" value="domains"/>

If your switch is behind NAT, you may have to add the apply-inbound-acl line to ${FS Install DIR}/conf/sip_profiles/internal.xml. Watch the FS console for errors about unauthenticated calls being rejected by the internal context before altering it, and leave auth-calls true in the internal profile.

Last, but not least, you'll need to add a section to ${FS Install DIR}/conf/dialplan/public/00_inbound_did.xml to route the individual DIDs. The framework of the file is pretty easy to follow. The only thing that should be noted is that by default VI sends the DNIS in E.164 format [2] so you would need to either consider that when making your route, or alter the number of transmit digit in their portal. The example below assumes you're set to receive E.164

  <extension name="8005551212">
<condition field="destination_number" expression="^(\+18005551212)$">
<action application="set" data="domain_name=$${domain}"/>
<action application="transfer" data="1000 XML default"/>
</condition>
</extension>