Asterisk behind a dynamic IP address

I thought I read somewhere that if the correct versions of Asterisk and pjsip are used that Asterisk can now track and use a dynamic IP as long as stun_monitor is used. I would like to find the minimum Asterisk and pjsip versions needed for this to work. Also, does the latest “factory” pjsip version of 2.6 have this feature or is a specially “modified by Asterisk” version required?

It’s not a feature of PJSIP itself, it’s a feature of the code in Asterisk. The latest version of Asterisk has it, and the next version will allow the external_media_address to be a hostname as well so it can point to a dynamic DNS address and be regularly updated.

1 Like

So that feature is the equivalent to the chan_sip option externhost ?

Yes. The option is separated to cover signaling and media, but together they are equivalent to externhost.

I got it now, So you can use a domain name also instead of IP, but would be helpful to include such information on the sample configuration files, because I was reading about such setting but it doesnt say you can use domain name

external_media_address= ; External IP address to use in RTP handling ; (default: “”)

external_signaling_address= ; External address for SIP signalling (default:

I’d suggest filing an issue with that.

Please let me be sure I understand. I see your point about external_media_address but my dynamic IP won’t ever be in DNS. Are the two features you refer to mutually exclusive? If I use the stun_monitor method will my [correct external] address be populated where it should be? Must I use Asterisk 14.6 or can an LTS version be used? Thanks

STUN monitor is only used to determine that the external address has changed and to trigger things to occur, it is not used to populate the external address options as of this time. This was not available in chan_sip and isn’t available in chan_pjsip. A dynamic DNS hostname must be used.