Solved Need help with On Premise SIP trunk with Dynamic IP on ISP Double NAT

Status
Not open for further replies.

kavijoshi

Customer
Joined
Dec 17, 2020
Messages
8
Reaction score
1
Hi
I am currently evaluating 3cx free version to connect remote workers on Android phones with our on-premise SIP Trunk. Our SIP Trunk provider has given a phyical line to our premises with IP details to their SBC and Gateway to connect our PBX.
Our internet connection is dynamic IP and it has multiple NAT on their ISP side.
So far I have searched extensively on this forum and considered the following scenario:
1. Tried PBX on cloud (AWS) with public IP and connect SIP trunk on-premise with 3cx SBC. I know this is a non-supported configuration. We obtained only incoming call from SIP trunk to 3cx with one-way audio (3cx to SIP). PS: Earlier we have used 3CX SBC to connect with on-premise Dinstar GSM Gateway without any issue.
2. PBX on premise with SIP trunk and FQDN with remote android phones. This should connect well but since our Internet is dynamic ip and multiple NAT on ISP side, port forwarding and ddns is not possible.
3. PBX on cloud with VPN to on-premise SIP trunk. Will need to configure VPN on another instance in AWS along with 3cx. But here AWS doesnot allow editing the gateway routing. We have to use their own Site-to-Site VPN service which is very expensive.

Can anyone suggest a cost-effective solution so that we can connect the SIP trunk with 3CX and do calling from remote android phones over general internet outside of the premise network?
 
Hi @kavijoshi

I am still unsure about your configuration but the first thing i would recommend is using a supported provider to eliminate any guess work on the SIP Trunk side. The supported provider list can be found here: https://www.3cx.com/partners/sip-trunks/

Now specifically to your scenario there are 2 things you need to resolve separately so this works. First i would install the PBX on premise since your SIP Trunk comes with a dedicate physical line and terminates there.
You will probably need a second NIC on the 3CX server and you will need to add some static routes to route the provider traffic through the correct NIC. The registrar of your trunk should be the SBC IP they provided. That NIC must not have a gateway configured to it.

The second thing is to make sure that your Android clients work separately from the trunk. Make sure they can connect to the PBX when outside the network and make calls between 2 android clients to make sure you have 2 way audio. If you do then you should be OK. If not then make sure your ports are forwarded correctly and pass the firewall checker. if you are having issues with your ISP then getting a static public IP might be a good idea.
 
Hi @YiannisH_3CX
Thank you for the response.
We donot have 3CX supported SIP Trunks in India.

I did the configuration similar to what you have described and I have also followed the instructions mentioned in this link: https://www.3cx.com/docs/asia-sip-trunk-singtel/

3CX is installed on a raspberry pi and connected to SIP trunk via LAN port (eth0) and to internet/extension network via Wifi (wlan0).

I have set the static routes as described in the tutorial and I can ping the SBC IP and internet links successfully. So it is correctly routing the ping requests.

When testing extensions locally, we can receive the incoming call from SIP to 3CX and 2 way-audio works fine.
However, Outgoing calls are not going from 3CX to SIP. I did a capture on the 3CX management console Activity Log (eth0 and wlan0 both separately) and found that outgoing call communication is not going to the NIC connected to SIP Trunk. All communication is only within NIC connected to internet and extensions.
Any ideas how to resolve this?
 
In that case you have configured the static routes wrong. Run a capture on the PBX and select to capture all interfaces and check where the requests are going and what IP the requests are leaving from. The static routes are a part of the OS. If configured correctly it will work. The PBX is not aware of the that configuration.
 
With multiple attempts on playing with routing and configuration, still the outgoing calls are not going. Inbound Works Fine.
Any advice will be appreciated.

Wire capture now does show SIP requests going to NIC connected with Trunk provider.

Following is the config:
3cx installed on Windows 10
NIC1 IP (Internet facing Interface) : 192.168.29.50 (Gateway IP: 192.168.29.1)
NIC2 IP (SIP Trunk Interface): 100.65.164.100 (Gateway IP: 100.65.164.97, Trunk SBC IP: 100.64.216.4)

Route Print Output:
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.29.1 192.168.29.50 55
100.64.216.0 255.255.255.0 100.65.164.97 100.65.164.100 2
100.65.164.96 255.255.255.240 On-link 100.65.164.100 257
100.65.164.100 255.255.255.255 On-link 100.65.164.100 257
100.65.164.111 255.255.255.255 On-link 100.65.164.100 257
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
192.168.4.0 255.255.255.0 On-link 192.168.4.3 5
192.168.4.3 255.255.255.255 On-link 192.168.4.3 261
192.168.4.255 255.255.255.255 On-link 192.168.4.3 261
192.168.29.0 255.255.255.0 On-link 192.168.29.50 311
192.168.29.50 255.255.255.255 On-link 192.168.29.50 311
192.168.29.255 255.255.255.255 On-link 192.168.29.50 311
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 192.168.29.50 311
224.0.0.0 240.0.0.0 On-link 100.65.164.100 257
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 192.168.29.50 311
255.255.255.255 255.255.255.255 On-link 100.65.164.100 257
===========================================================================
 
3CX SIP trunk config: Generic

1. Registrar/Server/Gateway Hostname or IP:
100.64.216.4

2. Main Trunk No: 9876543210

3. Select which IP to use in 'Contact' (SIP) and 'Connection'(SDP) fields: 100.65.164.100
 
This issue is now resolved. The issue was incorrect SIP request to the SIP Trunk. Captured wireshark data from a direct SIP softphone and adjusted the 3cx SIP Outbound Parameter to match it. Then outbound call worked.
 
  • Like
Reactions: NickD_3CX
Glad to see the issue has been resolved and thank you for updating the thread with your solution
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,324
Messages
591,897
Members
165,475
Latest member
lastshadow