Inbound SIP calls answered in a different FreePBX

Hi al!

I have 2 FreePBX boxes in the same LAN. Both are connected to the same internet conexion, so they use same public IP.

The problem is… when someaone calls to BOX 1 public phone number, BOX 2 answer the call, sending it to AnyCID/AnyDID inbound rule, so BOX 1 can’t get inbound calls working.

Is it normal? Every inbound call from outside is answered always by BOX 2.

Can anyone help me? Any explanation please?

Thanks!!

I forgot saying…

Both boxes have different account registered to same SIP provider, but public numbers are different as well. If I register the account of BOX1 with a sofphone in a different LAN, it works normally.

Thank you

If they use the same public IP, there is literally nothing that you can do if the traffic is being directed to the same ports.

Your best option would be to set different ports for box 1 vs box 2 and work with your provider on this. Then configure your router/firewall appropriately. Alternatively, talk to your ISP about getting a second IP address. Then assign them as needed for your two boxes.

Think of an IP address as a street address, and your LAN as a big apartment building. If you send a package to 123.456.789.123, it will only know to go to the front of the apartment building (your router). The router has to be able to differentiate between all the internal units (192.168.1.xxx) but without that information on the package, the router is just going to go “hey is anybody waiting for mail” and whoever says something first gets it (if they just don’t return it to sender). If you have ports assigned to specific devices, or different public IPs, the router can do its job and route the traffic accordingly, provided that you have rules for that set up.

Thank you Overkill, very good explanation.

I have no ports recirected to any box. I supose the problem is the default Sip port. Next time I’ll try to use different SIP port in one of the two boxes.

Regards.

What router/edge device are you using on your network?

I’m using a linux based hardware firewall. It’s a comertial product, developed by a local company.

You should try forwarding a range of ports to one box versus another (5000-5499, 10000-14999 ==> box1 + 5500-5999, 15000-20000 ==> box 2) or get mutliple IPs from your ISP to map to each box. Specifics I can’t help you with as my experience is primarily with SonicWALL/Untangle devices.

Ideally what you’d do is create two NAT rules (example for box 1 below):
FROM ORIGINAL = Any, FROM TRANSLATED = Original
TO ORIGINAL = Public IP, TO TRANSLATED = Box 1 Internal IP
PORTS/SERVICES ORIGINAL = Port ranges defined above, TRANSLATED = Original

If you had unique public IPs, you could just create a NAT rule that translates the public IP to the internal IP.