How to configure Airtel SIP trunk in Asterisk -vicidial-goautodial
How to configure Airtel SIP trunk in Asterisk -vicidial-goautodial
STEP 1: Configure the AIRTEL network IP to eth1
Assign the IP provided by airtel to one of the NIC in you server, for centos based server you may use below commands
ifconfig eth1 10.232.130.172/30
OR eid the ifcfg-eth1 file and manually enter the ip, OR if you have GUI manager configure manually.
vi /etc/sysconfig/network-scripts/ifcfg-eth1
then enter
IPADDR=10.232.131.172
PREFIX=30
ONBOOT=YES
*** Note: 10.232.131.172 is an example, you need to enter the airtel ip provided to you.
STEP 2: Configuring Route in linux to reach Airtel Network.
This step is required if the AIRTEL SBC IP and your IP is in different subnet then you need a static route to reach the SBC IP.
for eg : my SBC ip is 10.232.130.170
Edit the route-eth1 for manual entry for static route.Note this is for centos based server
vi /etc/sysconfig/network-scripts/route-eth1
and add below line
10.232.130.170/32 via 10.232.131.171
service network restart
then type route -n to make sure route is added
Step 3: Add static HOST entry
Airtel SIP Trunks only accepts traffic with header ims.airtel.in,
You need to enter a static host entry for ims.airtel.in with the SBC IP.
go to hosts file and add the host entry
vi /etc/hosts
and the line which is in bold letter below.
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
127.0.0.1 go.goautodial.org go
10.232.130.170 ims.airtel.in
save and exit
Step 4: SIP Carrier settings.
For Vicidial – goautodial you can use the admin utility to configure below settings.
For Freepbx you can use the GUI trunk configuration
For Plain Asterisk enter the below details in vi /etc/asterisk/sip.conf
register => +91441231234:PASSWORD:+91441231234@ims.airtel.in@ims.airtel.in/+91441231234
[airtelsip]
disallow=all
allow=all
type=friend
dtmfmode=rfc2833
qualify=yes
nat=force_rport,comedia
insecure=invite,port
host=ims.airtel.in
username=+914441231234@ims.airtel.in
secret=PASSWORD
fromdomain=ims.airtel.in
defaultexpirey=120
canreinvite=no
context=trunkinbound ; change this according to your inbound context
maxexpiry=600
progressinband=yes
STEP 4: Dialplan entry to Dialout.
For Vicidial /goautodial use the below dialplan
exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9X.,n,SipAddHeader(P-Preferred-Identity: <sip:+914441231234@ims.airtel.in>)
exten => _9X.,n,Progress()
exten => _9X.,n,Dial(SIP/${EXTEN:1}@airtelsip,,tTo)
exten => _9X.,n,Hangup()
For Plain asterisk or freepbx
exten => _9X.,1,SipAddHeader(P-Preferred-Identity: <sip:+914441231234@ims.airtel.in>)
exten => _9X.,n,Progress()
exten => _9X.,n,Dial(SIP/${EXTEN:1}@airtelsip)
exten => _9X.,n,Hangup()
Notes:
make sure the ims.airtel.in should resolve the airtel sbc ip.