FreeSWITCH Integration
To integrate FreeSWITCH with NetBorder SS7 Gateway, we need to register FreeSWITCH to NSG.
To integrate FreeSWITCH with NSG, the following FreeSWITCH configuration files are required to be modified:
Sofia Profile
To have FreeSWITCH register to NSG you need to create a new "gateway" in a SIP profile.
Below is a sample "gateway" for use with NSG:
<gateways>
<gateway name="sangoma">
<param name="username" value="sangoma"/>
<param name="password" value="sangoma"/>
<param name="realm" value="<ip address of NSG server>:5062"/>
<param name="dialplan" value="XML"/>
<param name="context" value="from-NSG"/>
</gateway>
</gateways> |
The example above shows how FreeSWITCH will register to NSG using the default credentials set-up in NSG (in this case sangoma:sangoma). For security reasons it is advisable to change these default parameters.
NSG does not authorize itself when sending incoming calls from the PSTN so the SIP profile you add the gateway to must have the option "auth-calls" set to "false". By default the FreeSWITCH profile "external" meets this requirements
Dial plan
<context name="from-NSG">
<extension name="incoming_call">
<condition field="destination_number" expression="^(.*)$" break="never">
<!-- extract the span name from the SIP-X headers -->
<action application="set" data="span=${sip_h_X-freetdm-SpanName}"/>
<!-- log that we have an incoming call from NSG and which span the call came in on--->
<action application="log" data="INFO Incoming call from NSG on span=${span}"/>
<!-- answer the call...if this is not run, the "echo" application will run in "early media" -->
<action application="answer" data=""/>
<!-- use the "echo" application to confirm there is 2 way audio. Delay audio by 1s so that echo cancelers don't cause problems -->
<action application="echo" data="1000"/>
</condition>
</extension>
</context>
<context name="to-NSG">
<extension name="outgoing_call">
<condition field="destination_number" expression="^(.*)$" break="never">
<action application="bridge" data="sofia/<profile name>/${destination_number}@sangoma/>
</condition>
</extension>
</context> |
Freeswitch & NSG On The Same System
When running FreeSWITCH and NSG on the same system it is possible to run the CLI command "nsg_cli" and be connected to the FreeSWITCH cli rather then the NSG cli. Below is what the nsg_cli should look like if it looks like the second output then you are connecting the FreeSWITCH cli rather then the NSG cli. To resolve this just simply add the following file " /root/.nsg_cli_conf" as shown below and this will resolve the issue. If there is still issues create a Sangoma support ticket at support.sangoma.com and provide this URL in your description of the issue.
/root/.nsg_cli_conf:
[default]
;overide any default options here
loglevel => 6
host => 127.0.0.1
port => 8022
password => ClueCon
debug => 2 |
The output below is what nsg_cli should show you:
nsg_cli:
The output below is what the nsg_cli should NOT show you:
nsg_cli: