How to configure JIO sip trunk in asterisk

 JIO SIP trunk configuration in Asterisk PBX

TOPIC : How to configure JIO sip trunk in asterisk

Jio Sip trunking with asterisk


  About JIO SIP trunk :

           Reliance Jio Leading telecom vendor in INDIA, who also provides ISDN/E1 trunk via Ethernet in SIP Protocol (ie VOIP) to customer similar to SIP trunk provided by TATA/AIRTEL.
    As shown in the picture below JIO provides a dedicate network to connect to there SIP gateway to register the SIP trunk.
Either you need to have dedicate ethernet port in asterisk server to connect to jio network, or redesign the network setup to opt to JIO subnet.

jio sip trunk lan settings

  JIO sip trunk details:

            Once you have purchased  the new jio sip trunk, you will be provided with below details

DID numbers
Pilot number
SIP gateway IP & Media IP
Jio Network subnet range (server IP,subnet, gateway IP)

  Step 1: Network Connection

            As show in picture above ,connect your Asterisk server to the JIO network and assign the IP address from the subnet provided by jio either to a second ethernet or existing ethernet port(based on your network design).
The network configuration is not covered here , it might defer between OS type you are using, but concept is same.

  Step 2:  JIO SIP Proxy Static route

       If you are connecting JIO to your existing networks as pre the picture shown, then you might need a dedicate route to reach the JIO SIP Proxy also media ip.
Strict RTP switching to RTP target address 
Check your OS network settings to set static route to jio network.
Sample JIO Sip details

SIP proxy ip    :100.64.216.4
Media IP          :100.64.216.4
ServerIP           : 100.65.161.116
gateway ip       :100.65.161.113
interface           : Eth1
Centos 7 command to set a static route to SIP proxy ip and media ip
ip route add 100.64.216.4 via 100.65.161.113 dev eth1
ip route add 100.64.216.5 via 100.65.161.113 dev eth1
Command to check the routes
ip route show 
or
route -n

  Step 3: JIO SIP peer configuration sip.conf

     Once you have setup the network , make sure you are able to reach the JIO gateway and SIP gateway ip by ping command.
       enter the below sip settings in you asterisk sip.conf,  if are using Freepbx you can create the same in Gui trunk settings, similar for vicidial/goautodial under carrier settings.

[jiosiptrunk]
type=friend
disallow=all
allow=alaw
allow=ulaw
allow=g729
host=100.XXX.XXX.XXX ;this is jio sip proxy ip
fromdomain=100.XXX.XXX.XXX ;this is jio sip proxy ip
qualify=yes
dtmfmode=rfc2833
nat=no
context=from-trunk  ;context to receive inbound calls
sendrpid=yes
trustrpid=yes

  Step 4: asterisk dialplan for jio sip

Note: The key factor to dial out via JIO , you need to set proper caller-id while dialing out.
Use the below dialplan , alter according to your requirement.
For vanilla Asterisk :

exten => _X.,1,Set(CALLERID(num)=+914412345678)
exten => _X.,2,Dial(SIP/jiosiptrunk/${EXTEN})
exten => _X.,3,Hangup
;+914412345678 is my pilot no, you have to enter your pilot no or any number from the DID range

Vicidial / Goautodial
exten => _X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _X.,2,Set(CALLERID(num)=+914412345678)
exten => _X.,3,Dial(SIP/jiosiptrunk/${EXTEN},,tTo)
exten => _X.,4,Hangup
;+914412345678 is my pilot no, you have to enter your pilot no or any number from the DID range

Freepbx 

    If  you want individual CID for each user make sure each user extension is configured with outbound callerid with there DID number. 
For Freepbx, you need create outbound route , with necessary Dial pattern and make sure to set the ROUTE CID (either pilot or DID numbers)

  Conclusion:

Hope the above tutorial is helpful to configure the JIO siptrunk in your sip server.
For professional support reach me via skype: striker24x7 
Youtube Channel : https://www.youtube.com/c/striker24x7

Next Post Previous Post
17 Comments
  • Mithun
    Mithun December 15, 2020 at 2:39 PM

    Hi i have configured the JIO sip line as per the above but the auto calls are not landing on agent page. What shall i need to enable on routing extensions 8368.

    • gopi baskar
      gopi baskar December 15, 2020 at 10:04 PM

      have you set the callerid in dialplan or campaing?
      can you post your cli log and dialplan used

    • Mithun
      Mithun December 28, 2020 at 11:18 PM

      Hi i have tried both.

    • gopi baskar
      gopi baskar December 31, 2020 at 10:31 AM

      what dialplan you are using, can you post the cli log

    • jyotirmoy
      jyotirmoy February 7, 2021 at 1:42 PM

      sir please help me i have problem in goautodial

    • gopi baskar
      gopi baskar February 7, 2021 at 8:54 PM

      let me know your problem in detail

  • Unknown
    Unknown March 13, 2021 at 6:02 PM

    Dear Striker
    I just configured jio sip trunk but no voice is coming calls are maturing fine.
    1st NIC we have jio sip trunk and on 2nd NIC we have internet with static ip
    can you suggest me .....thanks in advance

    • gopi baskar
      gopi baskar March 15, 2021 at 11:42 AM

      add a static route for the jip media ip

  • Bhuvnesh Sharma
    Bhuvnesh Sharma March 24, 2021 at 8:25 PM

    Hi,
    With Jio SIP trunk, both incoming/outgoing call are working.
    Only problem is incoming call disconnects are 5-6 seconds. Even both parties can hear each other. What could be the reason. Please suggest

    • Bhuvnesh Sharma
      Bhuvnesh Sharma April 27, 2021 at 11:24 AM

      Hi,

      Sorry i could not reply you back. Anyway i have sorted out the voice issue by disabling NAT under Asterisk SIP Settings.
      But is there any other work around for this. Actually i want to keep NAT enable for calling from outside as my PBX is running behind firewall.

    • gopi baskar
      gopi baskar April 28, 2021 at 10:19 PM

      disable nat to specific trunk

    • Bhuvnesh Sharma
      Bhuvnesh Sharma July 17, 2021 at 5:16 PM

      Hi,

      Incoming call on my JIO SIP trunk is disconnecting after 6 second. Please help.
      Please find below cli logs:

      == Spawn extension (from-internal, 901, 1) exited non-zero on 'SIP/901-00000005'
      -- SIP/901-00000005 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
      -- Called SIP/901
      -- Connected line update to SIP/JIO-00000004 prevented.
      -- SIP/901-00000005 is ringing
      -- Connected line update to SIP/JIO-00000004 prevented.
      -- SIP/901-00000005 answered SIP/JIO-00000004
      -- Channel SIP/901-00000005 joined 'simple_bridge' basic-bridge <17d1cde9-8d8a-40b3-88a6-04cda4571390>
      -- Channel SIP/JIO-00000004 joined 'simple_bridge' basic-bridge <17d1cde9-8d8a-40b3-88a6-04cda4571390>
      [2021-07-17 11:40:39] NOTICE[2581]: chan_sip.c:28825 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 901
      [2021-07-17 11:40:41] WARNING[2581]: chan_sip.c:4142 retrans_pkt: Retransmission timeout reached on transmission 14175160…

  • Unknown
    Unknown September 14, 2021 at 2:00 PM

    How to write registry for jio sip trunk in sip.conf please tell

  • Unknown
    Unknown September 14, 2021 at 2:07 PM

    How to write registry for jio trunk in sip.conf

    • gopi baskar
      gopi baskar September 14, 2021 at 9:54 PM

      jio sip is on ip based..
      if they have provided username secret then add them in sip.conf
      as register => above your actual sip peer configuration

  • Govind Bairwa
    Govind Bairwa June 29, 2022 at 12:38 PM

    Really Helpful,
    Thanks

  • Anonymous
    Anonymous September 6, 2022 at 8:25 PM

    Really useful post. It's working for me

Add Comment
comment url