New Version of Digital Gateway Connects To Asterisk
This document provides a detailed guide on connecting the digital network gateway to Asterisk.
Please follow the steps below to configure two-way communication between the phone and the gateway.
Outgoing calls: Make a call from the Asterisk SIP extension to the gateway via the SIP trunk.
Incoming calls: Make a call from the external line to the gateway, then call Asterisk via the SIP trunk 10000, and finally have Asterisk forward the call to the SIP extension.
Step 1. Create a SIP trunk in the Asterisk server
Add the following lines to /etc/asterisk/sip.conf to create a SIP trunk (1001) and a SIP extension (3002):
[1001]
username=1001
secret=1001
host=dynamic
port=5060
type=friend
context = from-gsm
[3002]
username=3002
secret=3002
host=dynamic port=5060
type=friend
context = from-internal
Step 2. Edit the dialing rules in Asterisk
Edit the dialing rules in /etc/asterisk/extensions.conf.
[from-internal]
exten => _x.,1,Dial(sip/1001/${EXTEN})
exten => _x.,n,hangup()
[from-gsm]
exten =>_x.,1,Dial(sip/3001)
exten =>_x.,n,Hangup()
Step 3. Create a SIP trunk on the digital gateway
Go to Profiles-> Select any profiles to add the SIP main server, and enter the Asterisk address.
After successfully adding and saving, go to Trunk Settings >> SIP Trunk (as shown in the figure below, the digital gateway acts as the client; if it is a point-to-point connection, disable registration and select “No”
and enter the remote IP address in the IP Direct Routing Table)
Dialing Test
Use SIP software (such as Xlite, eyeBeam) to register the SIP extension (3002). After completing the above steps, you can attempt to make a call.
Incoming call test: Dial the number of the network gateway port 1 using your phone to see if 3002 rings. If 3002 rings, your configuration is successful; otherwise, there is an issue with your configuration, please check.
Outgoing call test: Use the registered 3002 extension in the software phone to dial your phone number. If your mobile phone rings, it means your configuration is successful; otherwise, please check your configuration.