[asterisk-dev] STUN support in chan_sip revisited

Kevin P. Fleming kpfleming at digium.com
Mon Aug 9 09:39:20 CDT 2010


On 08/08/2010 02:16 PM, Simon Perreault wrote:
> On 08/06/2010 06:23 PM, David Vossel wrote:
>> What you do you all think about using STUN as a way to simply detect
>> when a network's external IP address has changed?  There is a common
>> problem people have who are using Asterisk behind a NAT with an
>> external dynamic IP address.  Anytime the external IP changes, all
>> the external SIP devices the Asterisk box has registered to will be
>> sending calls to the wrong address until the SIP registration is
>> renewed.  In the past people have had to respond to this problem by
>> forcing Asterisk to restart in order to renew all their SIP
>> registrations.  Since there are freely available STUN servers  all
>> over the place it seems like giving Asterisk the ability to use a
>> STUN server as a way to detect a network address change would be a
>> great idea.  By doing this, any channel drivers that register with
>> external devices can be made aware of the IP change and automatically
>> renew their registrations.
> 
> Two questions:
> 
> - How do you deal with NATs that have a pool of public addresses?

If the STUN requests are being sent often enough, the NAT binding will
be kept open, and the IP address reported will not change.

> - What's the problem with using a small expiry parameter value in the
> register line?

As Olle already pointed out, the operator of the registrar will hate you
:-) Seriously, this is something that could easily be considered abuse
of their system, if you did it often enough to ensure you didn't have
large windows where incoming calls would be lost (for any business
registering DIDs with a provider, they would likely not want this window
to be longer than a minute or two at the most, and prefer it to be much
less).

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list