Jeffrey Ollie
2014-Oct-23 02:13 UTC
[asterisk-users] PJSIP and NAT behind a dynamic IP address
What should the PJSIP configuration be if your external IP address is dynamic, as is common with most home networks, and probably a lot of small business networks as well? The external_media_address and external_signaling_address transport settings are static. It would be possible to write a script that would detect the external IP address and rewrite the pjsip configuration file, but since you can't change transports without a full restart of the server that doesn't seem very friendly. Is the only alternative to rely on your firewall/router to fix up the address in the SDP? -- Jeff Ollie
Scott Griepentrog
2014-Oct-23 05:47 UTC
[asterisk-users] PJSIP and NAT behind a dynamic IP address
If you review the current asterisk 12 sample pjsip config for extension 6002 (viewable here: http://svnview.digium.com/svn/asterisk/branches/12/configs/pjsip.conf.sample), you will find it contains the correct settings for an endpoint behind NAT. Specifically note that you need rewrite_contact enabled so that the contact address is rewritten to match the inbound SIP registration, and also with rtp_symmetric enabled to do the same thing for RTP. Also be aware that you will have less problems by omitting the transportline from the endpoint configuration altogether. It's generally not required to define that the endpoint is restricted to using a specific transport, and doing so interferes with the automatic transport selection, possibly including the symmetric SIP operation. On Wed, Oct 22, 2014 at 9:13 PM, Jeffrey Ollie <jeff at ocjtech.us> wrote:> What should the PJSIP configuration be if your external IP address is > dynamic, as is common with most home networks, and probably a lot of > small business networks as well? The external_media_address and > external_signaling_address transport settings are static. It would be > possible to write a script that would detect the external IP address > and rewrite the pjsip configuration file, but since you can't change > transports without a full restart of the server that doesn't seem very > friendly. Is the only alternative to rely on your firewall/router to > fix up the address in the SDP? > > -- > Jeff Ollie > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- [image: Digium logo] Scott Griepentrog Digium, Inc ? Software Developer 445 Jan Davis Drive NW ? Huntsville, AL 35806 ? US direct/fax: +1 256 428 6239 ? mobile: +1 256 580 6090 Check us out at: http://digium.com ? http://asterisk.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20141023/5340709a/attachment-0001.html>