Wednesday, 19 July 2017

Freeswitch SIP Trunk

SIP TRUNK

1. get the account details from domain.com
   
    username:siptrunk
    password: 123456


2. create a external profile as  gateway as below
open sip_profiles/external/onsip-trunk.xml a file

add below lines
<include>
  <gateway name="siptrunk">
  <param name="username" value="siptrunk"/>
  <param name="password" value="123456"/>
  <param name="proxy" value="domain.com:5080"/>
  <param name="register-proxy" value="domain.com:5080"/>
  <param name="register" value="false"/>
  <param name="register-transport" value="udp"/>
  <!--How many seconds before a retry when a failure or timeout occurs -->
  <param name="retry-seconds" value="30"/>
  <!--Use the callerid of an inbound call in the from field on outbound calls via this gateway -->
  <param name="caller-id-in-from" value="false"/>
  <param name="from-domain" value="domain.com"/>
  <param name="extension-in-contact" value="true"/>
  <param name="liberal-dtmf" value="true"/>
  </gateway>
</include>



3.reload the external profile

sofia profile external restart.

4. check the gateway with  below command

sofia status




5. Make a dialplan with gateway


<extension name="domain.com">
    <!-- The following line detects 11 digit outbound calls -->
    <condition field="destination_number" expression="^(\d{11})$">     
      <!-- This sets the outbound gateway as "siptrunk" ,
           which was defined in your OnSIP Trunking user profile 
           as the "gateway name" parameter.                      
           We've also appended the "000" outbound prefix         
           to the dialed number.-->
      <action application="bridge" data="sofia/gateway/onsip-trunk.com/000$1"/>
    </condition>
  </extension>

6. Reload the dialplan xml  in cli reloadxml

7. Make a call it will hit the siptrunk.

Refer: https://support.onsip.com/hc/en-us/articles/203675304-FreeSwitch-Configuration-for-OnSIP-Trunking
 

No comments:

Post a Comment