<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/1202/">https://reviewboard.asterisk.org/r/1202/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On May 3rd, 2011, 1:53 p.m., <b>Simon Perreault</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch looks very wrong to me.
What are you trying to accomplish?</pre>
</blockquote>
<p>On May 3rd, 2011, 2:13 p.m., <b>Paul Belanger</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The problem is documented in the issue, but basically if you dial an no exist SIP peer, Asterisk will continue to dial and transmit INVITES to a bogus IP.
https://issues.asterisk.org/file_download.php?file_id=28015&type=bug</pre>
</blockquote>
<p>On May 3rd, 2011, 2:16 p.m., <b>Simon Perreault</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Yes I understand that. But I don't understand how your patch addresses that issue. Can you please explain what the new code in your patch is intended to do, at a lower level than just "fix issue 18514"? I'm having trouble understanding why a call to getnameinfo() is needed at all.</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Sure, at first pass getaddrinfo() would return success for SIP/1050. But SIP/1050 is not a peer, so Asterisk assume it is a hostname.
[Dec 20 23:45:29] DEBUG[2288] netsock2.c: Splitting '1050' gives...
Adding getaddrinfo() does a second level check to confirm it is a valid hostname and if not returns the following error:
[Apr 29 10:08:44] ERROR[12988]: netsock2.c:263 ast_sockaddr_resolve: Unable to resolve hostname '1050': Name or service not known
Which we can handle and stop Dial() from continuing. If it is correct, that is why I'm asking for a review. My socket programing is weak, and looking for feedback / suggestions. </pre>
<br />
<p>- Paul</p>
<br />
<p>On May 3rd, 2011, 1:36 p.m., Paul Belanger wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Paul Belanger.</div>
<p style="color: grey;"><i>Updated 2011-05-03 13:36:52</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I spend some time last week trying to resolve an issue when you Dial() an unknown SIP peer. EG: Dial(SIP/blah). When we moved to IPv6 support we changed the way lookups were done. I took some time to research on the Internet, and found a few examples of how to use getnameinfo() as an additional error check for getaddrinfo().</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Local testing and user on issue tracker.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/view.php?id=18514">18514</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>trunk/channels/chan_sip.c <span style="color: grey">(314598)</span></li>
<li>trunk/main/netsock2.c <span style="color: grey">(314598)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1202/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>