FreeSWITCH BSNL VoIP outgoing works - No FS Incoming INVITE entry but works on Zoiper (STUN?)

  • Thread starter Thread starter iammyself
  • Start date Start date
  • Replies Replies 4
  • Views Views 580
Messages
3
Location
India
ISP
BSNL
Thank you @sloj @Audioctor @pillaicha and others for your excellent guide threads on configuring BSNL VoIP on softphones & PBX instances.

So I got Digisol 1GE+1FE+1VOIP XPON ONU from BSNL LCO that came with INTERNET and VOICE WAN profiles. I created VOIP_INTERNET WAN profile in both ways:
  • In Route Full Cone NAT mode, added static route and tried both DMZ/port mapping to the FreeSWITCH - 10.6.x.y private IP is assigned to WAN profile and 192.168.100.x IP to FS instance. old Asus OpenWRT 10 year router doesn't have VLAN ID>4 support and WiFi support although Asus FW supports WiFi. No worries about WiFi anyway as I use this one to primarily add a route between two subnets I use in my home (different ISPs).
  • In Bridge mode, VLAN 1849 802.1p: 7 on ONU to OpenWRT (thanks @varkey) to FS Hyper-V Instance (for ease of checkpoint snapshots) - 10.6.x.y private IP is assigned to OpenWRT iface, PC Hyper-V Virtual Switch and the FS instance eth1 - eth0 on FS is from another NIC on the PC (Dual NIC)
In both the above cases, I can ping and REGISTER with the UTIMS SIP server. On FreeSWITCH instance, I have an extension created and internal users can do both out/incoming calls. BSNL SIP Gateway is created and it registers with the following message and can do outgoing calls after setting EXPIRE to a low 100s.

I have also set ONU Firewall to disabled and am not behind CGNAT and happy to receive PUBLIC IP although entire VoIP is on 10.x.y.z private network. Hopefully

On Zoiper Windows, it can register and receive calls but I don't remember right away if it could do outgoing calls though. Zoiper INVITE Wireshark is below:
INVITE sip:+MY_PHONE_NUMBER@BSNL.ANOTHER.SIP.IP:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP BSNL.VoIP.Server.IP;branch=blah
Route: <sip:10.6.a.b:60553;lr>
From:"CALLING_PARTY_PHONE_NUMBER"<sip:0CALLING_PARTY_PHONE_NUMBER@10.190.BSNL.SIP_SERVER>;tag=foo-bar
To:"0_MY_PHONE_NUMBER"<sip:0_MY_PHONE_NUMBER@10.190.BSNL.SIP_SERVER>
Supported: 100rel,timer
Content-Type: application/sdp
Session-Expires: 900
Call-ID: call-foo-bar-blah-blah**
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,UPDATE,REGISTER,INFO,PRACK,SUBSCRIBE,NOTIFY,MESSAGE
Max-Forwards: 66
Content-Length:260
P-Called-Party-ID: <sip:0091_MY_PHONE_NUMBER@2_digit_state_code.ftth.utims.bsnl.in;user=phone>
CSeq:1 INVITE
Contact: <sip:0CALLING_PARTY_PHONE_NUMBER@BSNL.VoIP.Server.IP;tps=btpsh-12345-67890-abcde

REGISTER: sip_one_way - Diffchecker (Left ones are Zoiper Logs and Right ones are FS) # Assuming 192.168.0.10 is the Zoiper Client / FreeSWITCH Server IP (Behind NAT) I tried changing some values for ease of REGISTER comparision.

I installed siproxd using Open-WRT package manager and the service siproxd status confirms it is "running" but when I set this as the SIP GW proxy IP in FS, it can not REGISTER.

I have another ISP router's downstream connected to Open-WRT WAN and BSNL ONU LAN connected to br-lan (Lan iface) which is the reason for below config:
config siproxd general
# Custom options allow using OpenWRT network names, and defaults should
# work out-of-the-box. If your SIP devices do not REGISTER externally,
# you may also need to open firewall ports: tcp/udp 5060, udp 7070-7089.
option interface_inbound lan
option interface_outbound lan
option enable_rtp_proxy 1
option outbound_proxy BSNL.VoIP.Server.IP:5060

I am guessing the missing inbound route from WAN gateway to the 10.6.x.y IP as @Rajneesh Rana mentioned here. So my questions are:
  1. What am I doing wrong with siproxd? Is this mandatory? What headers is this changing that can fix incoming calls? CONTACT or VIA?
  2. FS uses ext-sip-ip for both CONTACT/VIA header in REGISTER; However for INVITE there is a possibility of using a different host
  3. Is there a possibility of incoming route being set on BSNL end from SIP GW range to Voice WAN range (10.144.x.y) that incoming works here?
  4. How Zoiper is able to get INVITEs on ROUTE -> Router -> PC/Phone? STUN reports Internet WAN public IP as per Wireshark.
I don't see any entry in tcpdump/sngrep for Incoming calls :( For outbound calls, audio is clear to both parties.

Please guide.
 
I have stopped using the VOIP setup long ago. VOIP runs on private IP range in BSNL, either on static address like mine or dynamic address based on configuration from their end. The important part was finding the inbound route that enabled the VOIP client to receive data which I did with Resource Monitor on Windows and it was the same range as my SIP server, so I added a route on the ONT.

I didn't use Siproxd as my setup was simply trying to use only ONT for configuration and in my case SIP ALG was the alternative which was available on ONT. With the way things are setup, only one client can work as there is a registration period. So multiple client setup can get a little complicated. Might work but I didn't test long enough to confirm. Start with a single client and then explore from there.
 
Thank you @sloj for the reply. I see the incoming INVITES from different SIP server but in the same 10.0.0.0/8.

Let's say if BSNL SIP proxy is at 10.192.24.y, call originated from 10.191.26.x taking the route of 10.6.108.x which is in the VOICE_INTERNET WAN gateway subnet. I understand adding route from your WAN IP to SIP server. How are you able to add the return route on the inbound path (SIP server side)?

By static IP, are you subscribed to (L)FMT service? It is DHCP in my case. I checked with my local BSNL CSCs and they suggested they are NOT offering it anymore even at the risk of losing the free public dynamic non-CGNAT IP. Wings is an option but they shifted to a new portal for some states, so online sign up isn't available anymore and the marketing person is exploring this option and I will get to know sometime this week.

Router SIP ALG is expected to work only when we are running on default 5060. In my checks, Zoiper used a random 60553 port so not sure if that can help. Also I intend to use a non 5060 as there are multiple bots doing port scans on the default one.

If I can get this working, I intend to use this system as a personal local call screener based on inspiration from this video as nothing seems to be stopping the spam calls from random numbers these days. Not interested in online TC or GA call screening services. Basically do call forwarding to this number from mobiles and answer only the important calls on linphone and rest can go to voicemail that I can check during the weekends at leisure.

If nothing helps with FTTH VoIP incoming, Wings is my last hope to achieve the above. I intend to just have one active registration and tested with only one active registration most of the time. I did have VOICE WAN active few days ago in the previous tests but had been disabling it to avoid any unexpected results in the last week. I am happy even if this works with one registration as I intend to use this as a GW in Virtual IPPBX that can ring the desired Softphone as needed.
 
Yes, adding 10.0.0.0/8 was what I did. You won't need to add a separate one for return route. On the router, NAT takes over and that's where the problem starts but SIP ALG takes care of it. If you disabled SIP ALG, then something like Yate or Microsip takes care of it at the application level by rewriting the IP address.

No, back then we were given static IP (still in private range) for VOIP but I guess they later moved to DHCP for ease of configuration.
 
Just tested using MicroSIP and was able to make Outgoing and receive Incoming Calls. So the issue appears to be FS GW incorrect handling of IP rewrites/NAT traversal and may not be related to routing. I will try FPBX or FS again tomorrow.
 
Back