So I have tried both a Grandstream and a Vega gateway. Both seem to communicate better with FreePBX if they do not use SIP registration. Why would I want to use SIP Registration on an analog gateway? Is unregistered the “best” way to set up an analog gateway?
You only need registration if your gateway is changing IP address. If it’s statically assigned in your own network, then just specify the IP in the host= line of the trunk definition.
OK. That makes sense. So if I have a static IP on my PBX, and a static IP on my analog gateway, then SIP registration is not necessary, and it is best to use the gateway unregistered.
This is going to be “IP-based authentication”. It is, by far, the simplest (and some argue the most secure) authentication mode. The only thing that might mess you up is that some of your connections may be asymmetric; your inbound calls could be coming from an IP address that doesn’t accept your outbound calls.
Many providers (VOIP Innovations, for example) have several IP addresses for “inbound” calls and only have a couple that do both. It’s not completely automatic, so you’re still going to have to understand when to use “peer” and “friend” types.