Asterisk Integration
To integrate Asterisk with NetBorder SS7 Gateway, we need to register Asterisk to NSG.
To integrate Asterisk with NSG, the following Asterisk configuration files are required to be modified:
sip.conf
NSG expects the application server to register a SIP connection so that NSG knows where to send incoming call requests from the PSTN to.
Also, to make outbound dialing easier one should add a profile for NSG to the sip.conf configuration.
Add the following line in your Asterisk "sip.conf" to have asterisk register with NSG:
[general]
register = > sangoma:sangoma@<ip address of NSG server>: 5062 |
The default credentials of NSG is sangoma : sangoma. It is recommended not to keep the default values if installing NSG on a public IP address. Verify the change of the default registration credentials in NSG
To allow outbound calling add the following SIP profile to Asterisk's "sip.conf' file:
[authentication]
[NSG]
type=peer
host=<IP address of NSG server>
port=5062
qualify=yes
context=from=nsg |
NSG extensions.conf Sample
[from-nsg]
exten => _X.,1, set(span=${SIP_HEADER(X-freetdm-SpanName)})
exten => _X.,n,noop(NSG -> incoming call on span=${span})
exten => _X.,n,answer()
exten => _X.,n,playback(demo-congrats)
exten => _X.,n,hangup()
[to-nsg]
exten => _X.,1,SIPAddHeader(X-FreeTDM-Screen: 3)
exten => _X.,2, dial(sip/${EXTEN}-g=g1-h=a@NSG)
;g=g1 -> This defines the group. This example is using group 1 or g1.
;h=a -> This defines the hunting order. a for Ascending and A for descending.
;NSG -> This defines the chan_sip peer. This should be a peer that is configured to send/receive calls from NSG. |
read() Application
If you are planning to use the Asterisk read() application to receive DTMF from a PSTN line you need to switch NSG to use SIP INFO messages for DTMF events (RFC-2976) rather then the default RFC-2833 method.
Un-comment the following from /usr/local/NSG/conf/sip_profiles/internal.xml
Restart the NSG using "service sangoma-media-gateway restart" CLI command
By default NSG uses RFC2833 to transmit DTMF events/tones to the application server and the current the architecture of NSG is that such incoming RTP frames are used to trigger the transmission of RFC2833 events.
When the Asterisk read() application is in the process of "reading" dtmf digits it does not send any RTP frames to NSG...which in turns causes NSG to not process new DTMF events. Switching to SIP info message for DTMF will resolve this issue