Airtel SIP Trunk configuration in Asterisk
Topic: How to configure Airtel sip trunk in asterisk-vicidial-Freepbx
Overview: Airtel Sip Trunk
Airtel SIP trunk is an advanced voice connectivity solution via network, it replaces traditional multiple fixed PSTN with a single Physical line that support 1000 plus calls simultaneous calls.
Airtel SIP Trunk reduces the cost of multiple lines, as well hardware requirement for PRI Trunks.
Network Connectivity:
Airtel SIP trunk is provided to customer via dedicated SBC gateway and router, for which you need a additional ethernet port on your asterisk server or you need to setup your LAN in the same subnet range provide by airtel. ref below Pic for better understanding.
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 edit the ifcfg-eth1 file and manually enter the ip, OR if you have GUI manager configure manually.
vi /etc/sysconfig/network-scripts/ifcfg-eth1then enterIPADDR=10.232.131.172PREFIX=30ONBOOT=YES
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.
ip route add 10.232.130.0/24 via 10.232.131.171 dev eth1
ip route showorroute -n
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.
vi /etc/hosts
# 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 localhost6127.0.0.1 go.goautodial.org go10.232.130.170 ims.airtel.in
Step 4: SIP Carrier settings.
register => +91441231234:PASSWORD:+91441231234@ims.airtel.in@ims.airtel.in/+91441231234
[airtelsip]disallow=allallow=alltype=frienddtmfmode=rfc2833qualify=yesnat=force_rport,comediainsecure=invite,porthost=ims.airtel.inusername=+914441231234@ims.airtel.insecret=PASSWORDfromdomain=ims.airtel.indefaultexpirey=120canreinvite=nocontext=trunkinbound ; change this according to your inbound contextmaxexpiry=600progressinband=yes
STEP 5: 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()
Conclusion:
Hope this article is useful , for professional support reach me at skype:striker24x7