Provider Configuration: Cordia

From FreeSWITCH Wiki
Jump to: navigation, search


If you're new to FreeSWITCH, make sure you have read the Getting Started( to get a good introduction on how FreeSWITCH works. It may also help to familiarize yourself on the configuration file layout ( before proceeding with these configurations.

Cordia have several SIP nodes, you may call/coordinate with our customer service to give you the details on where your FreeSWITCH (FS) should register and dial out, as well as credential details for your FS.

SIP Profile/Gateway configuration

Below is an example on how to use your sip credential on FS to register in a node. For those new in FS, you may put this in an empty file under freeswitch/conf/sip_profile/external and save it as an xml file.

  <gateway name="cordiatrunk1">
      <param name="username" value="yourDID"/>
      <param name="from-user" value="yourDID"/>
      <param name="extension" value="yourDID"/>
      <param name="password" value="your secret"/>
      <param name="expire-seconds" value="600"/>
      <param name="register" value="true"/>
      <param name="proxy" value="Cordia proxy/registrar hostname"/>
      <param name="retry-seconds" value="30"/>
      <param name="extension-in-contact" value="true"/>

When done with your xml configuration, you should reload the trunk profile by this command.

sofia profile external rescan|restart

then do

sofia status

to verify that your sip trunk is registered.

                     Name          Type                               Data      State
                 external       profile      sip:mod_sofia@10.XX.XX.XX:5080     RUNNING (0)
             cordiatrunk1       gateway       REGED
            internal-ipv6       profile           sip:mod_sofia@[::1]:5060      RUNNING (0)
                 internal       profile      sip:mod_sofia@10.XX.XX.XX:5060     RUNNING (0)
               10.XX.XX.XX        alias                           internal      ALIASED
3 profiles 1 alias

Dialing Out

If your sip endpoint is on default context then it's either you put the xml config within freeswitch/conf/dialplan/default.xml file or create a new xml file and put it under freeswitch/conf/dialplan/external.

 <extension name="Long Distance">
    <condition field="destination_number" expression="^(1|011)\d+$">
      <action application="set" data="effective_caller_id_number=yourDID"/>
      <action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/>
      <action application="set" data="hangup_after_bridge=true"/>
      <action application="bridge" data="sofia/gateway/cordiatrunk1/${destination_number}"/>

Incoming Call The configuration to handle incoming call can be place in freeswitch/conf/dialplan/public.xml file or an xml file under freeswitch/conf/dialplan/public.

 <extension name="public_did">
    <condition field="destination_number" expression="yourDID">
      <action application="set" data="domain_name=$${domain}"/>
      <action application="transfer" data="5199 XML default"/>

The above xml config assumes that the sip endpoint is on default context. What "transfer" application does is to traverse the content of freeswitch/conf/dialplan/default.xml, where in finally the extension can be bridge or connect to voicemail if the call fails.

<extension name="Local_Extension">
      <condition field="destination_number" expression="(5102|5103|5104|5105|5110|5111|5175|5199|5006)"
        <action application="set" data="dialed_extension=$1"/>
        <action application="export" data="dialed_extension=$1"/>
        <action application="set" data="hangup_after_bridge=true"/>
        <action application="set" data="continue_on_fail=true"/>
        <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
        <action application="answer"/>
        <action application="sleep" data="1000"/>
        <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>

When done with dialplan xml configuration, do reloadxml so changes on dialplan takes effect.


Trunking with Cordia is easy on FS. The above is working simple example. Should you need any help on this matter please do contact us. - DMN