[asterisk-dev] [Code Review] Don't try to lookup purely numeric hostnames that don't match peers or try to send requests to failed lookups

Simon Perreault reviewboard at asterisk.org
Tue Oct 18 17:54:35 CDT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1532/#review4530
-----------------------------------------------------------

Ship it!


This is the right fix. I don't think this should be controversial for anyone.

- Simon


On Oct. 18, 2011, 2:57 p.m., Terry Wilson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1532/
> -----------------------------------------------------------
> 
> (Updated Oct. 18, 2011, 2:57 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This small patch fixes two issues:
> 1) If someone does exten => _XXXX,1,Dial(SIP/${EXTEN}) and ends up trying to dial a non-existent SIP peer, we currently resolve the numeric peer to an IP. While representing an IP as 1050 is technically legal, no one does this in the real world. IMHO, it is much better to not treat 1050 as 0.0.4.26 and send the request there when in the context of Asterisk this is almost always going to be expected to be a peer/extension. Granted, people shouldn't use extensions as peer names for a whole host of reasons, but they do it anyway and I think we should be following the principle of least surprise here. I have been told that earlier versions of Asterisk did not do lookups for numeric addresses either, so this was an accidental change of behavior in the first place.
> 
> 2) 1.8 currently will try to contact a host even if the address lookup fails. This is silly. The patch fixes it.
> 
> 
> This addresses bugs ASTERISK-17146 and ASTERISK-17716.
>     https://issues.asterisk.org/jira/browse/ASTERISK-17146
>     https://issues.asterisk.org/jira/browse/ASTERISK-17716
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/channels/chan_sip.c 341249 
> 
> Diff: https://reviewboard.asterisk.org/r/1532/diff
> 
> 
> Testing
> -------
> 
> I've tried dialing existing and non-existing numeric peers. Things work now, I don't see any breakage.
> 
> 
> Thanks,
> 
> Terry
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111018/4fa5d80e/attachment.htm>


More information about the asterisk-dev mailing list