TATA SIP Trunk in Asterisk
Topic: How to configure tata sip trunk in asterisk vicidialAbout: Tata Tele Business Services
TATA SIP trunk Network Settings:
Tata SIP trunk is provided with a dedicated network from tata tele service, that is you will be provided with a router with dedicated subnet, either you need to have two ethernet interface in your dialer to connect to tata network and also connect to your existing network, or you need to have a router which can support two networks with proper routing.
Below is sample architecture of dialer setup with two ethernet interface, eth-0 connected to existing network and eth-1 connected to TATA network.
TATA SIP trunk Details:
Once you have purchased the TATA SIP trunk, you will be provided with the below details,
DID Range and Pilot Number
Username and password
TATA network subnet range
SIP gateway and Media IP
TATA network Static route If you are connecting TATA network to your existing networks as pre the picture shown, then you might need a static route to reach the JIO SIP Proxy also media ip.
Check your OS network settings to set static route to jio network.
Linux command to set a static route to SIP proxy ip and media ip
command to set route is linux systems
ip route add 10.0.70.2 via 10.0.70.71 dev eth1Command to check the routes
ip route add 10.0.70.0/24 via 10.0.70.71 dev eth1
ip route show
or
route -n
TATA SIP Carrier Settings
For vici dial based dialers you can use the admin portal to create the sip trunk or you can use the sip.conf file to create the sip trunk settings.
SIP Registration settingsregister => 66810000:1234:66810000@10.0.70.2/66810000
SIP Peer Settings
[tatasip]
type=friend
disallow=all
allow=alaw
allow=ulaw
allow=g729
host=10.0.70.2 ;this is tata SBC ip
dtmfmode=rfc2833
nat=no
canreinvite=no
context=tataincomming
insecure=invite,port
Additional SIP settings for TATA SIP
edit the sip.conf file and add the below lines.
vi /etc/asterisk/sip.conf
defaultexpiry=600
progressinband=yes
TATA SIP trunk Asterisk Dialplan
Outbound Dialplan
For vicidial / goautodial you can use the ADMIN-Carrier- Dialplan entry and for asterisk users you need to enter in extensions.conf under default context
exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)For asterisk/Freepbx Dialers dialplan
exten => _9X.,n,SipAddHeader(P-Preferred-Identity: <sip:66810000@10.0.70.18>)
exten => _9X.,n,Progress()
exten => _9X.,n,Dial(SIP/0${EXTEN:1}@tatasip)
exten => _9X.,n,Hangup()
exten => _9X.,1,SipAddHeader(P-Preferred-Identity: <sip:66810000@10.0.70.18>)Note:
exten => _9X.,n,Progress()
exten => _9X.,n,Dial(SIP/0${EXTEN:1}@tatasip)
exten => _9X.,n,Hangup()
_9X., where 9 is the Dial Prefix.
once above entry done, do a asterisk reload by typing asterisk -rx "reload"
Inbound Dialplan
[tataincomming]
exten => _X.,1,Goto(s,1)
exten => s,1,Noop(Let us look deeper into the soul of the invite)
exten => s,n,Set(pseudodid=${SIP_HEADER(To)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => s,n,Goto(trunkinbound,${pseudodid},1)
Then in Vicidial GUI create DID's under INBOUND tab with your respective Tata DID no
for me its 66810000
For those using Freepbx/elastix/ or plain asterisk which uses from-pstn as inbound context use the below dialplan in extensions.conf
[tataincomming]
exten => _X.,1,Goto(s,1)
exten => s,1,Noop(Let us look deeper into the soul of the invite)
exten => s,n,Set(pseudodid=${SIP_HEADER(To)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => s,n,Goto(from-pstn,${pseudodid},1)
Tata Sip Trunk status:
To check the SIP trunk status in asterisk run the below in asterisk cli.
command to goto asterisk cli
asterisk -vvvvr
Command to check SIP registration status
sip show registrationthe output should show registered
command to check SIP peer status
sip show peersthe output should show OK for Tata sip.
Conclusion
Hope the tutorial is helpful, if you like the blog share and subscribe, for any professional support reach me on my skype: striker24x7