[asterisk-dev] [Code Review] Don't keep the STUN socket open between STUN monitor checks.

Richard Mudgett rmudgett at digium.com
Wed Nov 23 12:57:05 CST 2011


> > The STUN server DNS address is refreshed periodically if the new
> > stunservermonitor option is enabled.
> 
> I'm jumping in without having looked at the code, so feel free to
> ignore
> this question if it doesn't make sense. Here goes...
> 
> Wouldn't make sense to make a new DNS request each time a STUN request
> is made? I mean go through the whole getaddrinfo(), socket(),
> connect(),
> send() sequence from the start each time.
> 
> That would eliminate the need to "monitor" the server's DNS entry and
> could make things simpler (but I haven't looked at the code).

If the DNS server rotates STUN server addresses for each request, it could
change the external address and port seen through the NAT.  This is why I
added the new option to enable the periodic DNS refreshes.

Richard



More information about the asterisk-dev mailing list