When Asterisk receives a REGISTER and the endpoint is behind NAT it will place the public IP address and port in the REGISTER, while keeping the original value in “x-ast-orig-host”.
If the REGISTER already contains the public IP address and port in the REGISTER, then Asterisk can’t place an original value in “x-ast-orig-host” because it doesn’t have one. This can happen if the endpoint discovers its public IP address and port before sending the REGISTER, and uses it instead of the LAN IP address and port.
Some routers with SIP support can also result in the REGISTER being changed to have the public IP address and port, removing the LAN IP address and port as well so it would not show up.
Remove the commenting for the debug at the end of the file and it will dump the raw data out below the grid so you can actually see what it’s parsing to get that information
GXP 2000 ----> OK Public and private address
Grandstream|GXP2000|1.2.5.3 URI: PUBLIC IP Via: PUBLIC IP CallID: 172.30.140.105
GXP 1610 ----> ONLY PUBLIC IP
Gramdstream|GXP1610|1.0.7.6| URI: PUBLIC IP Via: PUBLIC IP CallID: Not an IP
Other network \ firewall (Linux based)
GXP 2000 ----> OK Public and private address
( the same as above… but same different values in VIA, here there is Private IP) URI: PUBLIC IP Via: 172.16.10.224 CallID: 172.16.10.224
GXP 1610 ----> OK Public and private address URI: PUBLIC IP Via: 172.16.10.112 CallID: Not an IP