How to configure tata sip trunk in asterisk vicidial

TATA SIP Trunk in Asterisk

Topic: How to configure tata sip trunk in asterisk vicidial

Tata sip trunk configuration in asterisk

  About: Tata Tele Business Services

    Tata Tele Business Services (TTBS), belonging to the prestigious Tata Group of Companies, is the country’s leading enabler of connectivity and communication solutions for businesses. With services ranging from connectivity, collaboration, cloud, security, IoT, and marketing solutions, TTBS offers the largest portfolio of ICT services for businesses in India. With an unwavering focus on customer-centricity and innovation, TTBS continues to garner recognition from customers and peers alike.

  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 asterisk 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 eth1
ip route add 10.0.70.0/24 via 10.0.70.71 dev eth1
Command to check the routes
ip route show
or
route -n 
the above route will be flushed once device rebooted, to persist the configuration you need to edit the /etc/sysconfig/network-scripts/route- files or set the route using network managers like yast lan for opensuse.

  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 settings
register => 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

For vicidial/goautodial Dialers dialplan
exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)
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,Tto)
exten => _9X.,n,Hangup()
For asterisk/Freepbx Dialers dialplan
exten => _9X.,1,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()
Note:
_9X., where 9 is the Dial Prefix.
once above entry done, do a asterisk reload by typing asterisk -rx "reload"

  Inbound Dialplan

Enter the below dialplan after the last line of extensions.conf (vi /etc/asterisk/extensions.conf)
For Vicidial/goautodial 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(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 registration
the output should show registered
command to check SIP peer status

sip show peers
the 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

10 Comments
  • Mateusz Domański
    Mateusz Domański December 30, 2020 at 2:07 AM

    Ładnie to wygląda.

  • Unknown
    Unknown February 17, 2021 at 5:46 PM

    Hi there i configured freepbx with above config everything is working fine, however i am not able to dial out with DID, only my pilot number is going as outbound CID.
    please help resolving the issue

    • Ajit Kumar
      Ajit Kumar February 19, 2021 at 5:06 PM

      YOU NEED TO SET PROPER CALLERID IN EACH SIP EXTENSIONS.
      IF STILL FACING ISSUE, REACH MY ON MY SKYPE: striker24x7

  • Anonymous
    Anonymous October 29, 2022 at 1:56 PM

    Hi Striker,
    I'm facing issue related to Got SIP response 482 “Loop Detected”
    On asterisk. We are using TATA SIP trunk and on same server we are using inbound/outbound calling.

    Please can you please guide or give me any solution for this issues.

  • Anonymous
    Anonymous October 29, 2022 at 7:47 PM

    what about sip trunk outbound proxy

  • Anonymous
    Anonymous October 29, 2022 at 7:49 PM

    what if need to configure with outbound proxy

  • Anonymous
    Anonymous October 29, 2022 at 7:49 PM

    Tata

  • RBasak
    RBasak June 28, 2023 at 2:09 PM

    configured same on elastix pbx but outgoing is not working always 403 forbidden error

  • Anonymous
    Anonymous November 14, 2023 at 11:32 PM

    Hi striker,
    previous i got a connection with 6809 series and exactly with your setup it was perfect.
    now i got a new sip delivered by tata and the pilot starts with 6902 and its not working anymore, after several go through and by talking to them, they told me user will be 14 digit like 009133-then the number as user name, and they mixup 5060 and 5061 to register .. so after adding 5061 in registry string it got registered and incoming working but still peers is unreachable and cant make outbound calls... pls help

  • Anonymous
    Anonymous May 12, 2024 at 10:30 AM

    sip registered but voice not receive

Add Comment
comment url