How can I redirect a hardcoded IP address to a hostname
Ahh, I understand, you can only use dotted-decimal format for the PBX address.
Usually, in the programming world, a "hardcoded IP" is a specific address written directly into the code, and cannot be changed at all. Sorry for the confusion.
In this case that does open up some options, including a VPN or a VPS running a Reverse Proxy, in combination with a Dynamic DNS provider (and a router that supports it). you may not need to travel with a router at all.
Provided your phone supports a VPN client, you can establish a VPN connection to a DDNS name that points to your home network. that will connect your phone to your LAN as though you were directly plugged into it. you can then access the PBX server by its private address on your LAN. If your phone does not support a native VPN client, you could use a cheap router at your location to create a site-to-site VPN link to home on the phones behalf.
so consider this scenario:
home public IP: 1.2.3.4
DDNS name: pbx.mynet.net --> 1.2.3.4
PBX IP: 10.0.1.1
you would set up a VPN on your router, and connect the phones VPN client to 'pbx.mynet.net', and in your IP phones PBX server address you would set 10.0.1.1.
|phone| >10.0.0.1> {|VPN| >pbx.mynet.net=1.2.3.4> |router|} >10.0.1.1> |PBX|
Another option would be a VPS, with a public IP. you would set up a reverse proxy to redirect traffic on port x to your DDNS name.
LAN public IP: 1.2.3.4
VPS IP: 4.3.2.1
DDNSName: pbx.mynet.net --> 1.2.3.4
proxy redirect: :1234 --> pbx.mynet.net:1234
PBX LAN address: 10.0.1.1
You would point your phones PBX server address to 4.3.2.1. when the VPS receives the packets, it will forward them to 1.2.3.4, and your port forward rules will forward the packets on to the PBX server.
|phone| >4.3.2.1> |VPS| >pbx.mynet.net=1.2.3.4> |Router NAT| >10.0.1.1> |PBX|