Traditional Gateway connecting

From FreeSWITCH Wiki
Jump to: navigation, search

Contents

FreeSwitch Gateway Configuration Example

Copy the /usr/local/freeswitch/conf/directory/default/1000.xml to gateway.xml

<include>
  <user id="9999">                                //the sip id which you will edit in Gateway
    <params>
      <param name="password" value="xxxxxx"/>     //the password which you will edit in Gateway
      <param name="vm-password" value="1000"/>
    </params>
    <variables>
      <variable name="accountcode" value="9999"/>
      <variable name="user_context" value="public"/>
      <!--<variable name="effective_caller_id_name" value="Extension 9999"/> -->
      <variable name="effective_caller_id_name" value="Gateway"/>
      <variable name="effective_caller_id_number" value="9999"/>
      <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
      <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
    </variables>
  </user>
</include>

FreeSwitch Context (Outbound) Configuration Example

Edit the /usr/local/freeswitch/conf/dialplan/default.xml

  <extension name="GSM outbound">
    <condition field="destination_number" expression=""^0(\d+)$)$">   // dial with 0+the number you dialed.
      <action application="log" data="INFO Dinstar outbound to $1"/>
      <action application="bridge" data="sofia/internal/$1@xx.xx.xx.xx"/> // xx.xx.xx.xx is the gateway's IP address,also you can add the port number behind the IP with colon.     
    </condition>
  </extension>

FreeSwitch Context (Inbound) Configuration Example

Edit the /usr/local/freeswitch/conf/dialplan/public/00_inbound_did.xml

<include>
  <extension name="public_did">
    <condition field="destination_number" expression="(.+)">     //The DID number which the gateway will send to FreeSWITCH, you can match a number, even a string
      <action application="set" data="domain_name=$${domain}"/>
      <!-- This example maps the DID xxx to ring 1000 in the default context -->
      action application="transfer" data="1000 XML default"/>
    </condition>
  </extension>
</include>

The xml dialplan will lead the Gateway's inbound call to extension 1000.

The Gateway's configuration

  • Edit the username and password which added in FreeSWITCH
  • Add the FreeSWITCH's IP address and port 5080 in proxey server, register server just use IP address