Go to VPC network > Firewall rules, click Create Firewall Rule.
Give it a name e.g. sip. Under Target tags, type a tag name, e.g. sip.
Under Specified protocols and ports enter “udp:5060; udp:5160; udp:10000-20000” (without the quotes and assuming default FreePBX settings). Under Source IP ranges, enter 0.0.0.0/0 (or a restricted range if desired), then click Save.
You may want to restrict the “default-allow-http” firewall rule to your IP address as well
Go to VPC network > External IP addresses. For your instance, change the Type from Ephemeral to Static. Give it a name, e.g. mypbx. Click RESERVE.
Go back to Compute Engine > VM instances. Select your instance, click EDIT. Under Network tags add sip or whatever tag you chose above. Click Save.
If someone had a chance to try this I appreciate feedback to improve this setup. Google provides $300 credit anyway.
My issue is that the phones will stop registering from time to time without me changing anything in the setting. I did white list my location IP and the SIP trunking IP addresses. I have a static IP address for the FreePBX.
Any thoughts?
***I restarted the phones and the PBX and they seem to be working now. I will keep testing ***
So basically your PBX is behind NAT and you’re phones are behind NAT. You have two endpoints trying to connect to each other over the public Internet with NAT on both sides. You have this configured correctly on both ends?
The PBX is setup to show it is behind NAT? Has all the proper information for local networks, external IPs, etc? The extensions are setup to show they are also behind NAT? Since the default config assumes the PBX and phones are on the same LAN so they aren’t setup as being behind NAT by default.
Well this is a NAT issue. You should fix that and have things setup properly. When you reboot the phones, they are refreshing and resetting their NAT in the firewall/route which makes them show up as “Available” in the system.
This isn’t a “network” issue, it’s all in how you’ve got your NAT set up and both ends, as well as the routers and firewall configurations in between.
What driver are these extensions using? Chan_SIP or Chan_PJSIP? If Chan_SIP then under the Advanced tab you need to set the NAT option to Yes. If Chan_PSJIP, it’s NAT aware and will deal with it.