No subject


Fri Sep 2 03:59:05 CDT 2011


I have some devices in the following scenario:

Asterisk server with public IP address
Mobile devices (clients):

When in internal network, no NAT between the client and the server
When in "roaming" (i.e. a Hotel with WiFi), the client is behing a NAT
When in 3G, operator transparent sip proxy so it looks as no NAT, but does =
not support symmetric RTP.
Sometime, the device gets a public IP with no NAT at all.
No NAT setting available in asterisk works for all these scenarios at the s=
ame time, and I can not request the user to activate different accounts dep=
ending on its location.

I have added a new NAT setting (nat=3Dauto) to the current ones. When set, =
chan_sip auto detects from the Via header, the recv sockaddr, and the rport=
 setting if the client is behind a NAT.

It also adds to cli interface results (sip show peer/s) info on this (so no=
w you could see "N" for NAT and nothing for no NAT as before, "a" for auto =
detect no NAT, and "A" for autodetect NAT.


This addresses bug ASTERISK-17860.
    https://issues.asterisk.org/jira/browse/ASTERISK-17860


Diffs (updated)
-----

  /trunk/channels/chan_sip.c 352610 =

  /trunk/channels/sip/include/sip.h 352610 =

  /trunk/configs/sip.conf.sample 352610 =


Diff: https://reviewboard.asterisk.org/r/1698/diff


Testing
-------


Thanks,

Terry


--===============0623751013845431257==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable




<html>
 <body>
  <div style=3D"font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor=3D"#f9f3c9" width=3D"100%" cellpadding=3D"8" style=3D"bor=
der: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href=3D"https://reviewboard.asterisk.org/r/1698/">https://reviewbo=
ard.asterisk.org/r/1698/</a>
     </td>
    </tr>
   </table>
   <br />


<table bgcolor=3D"#fefadf" width=3D"100%" cellspacing=3D"0" cellpadding=3D"=
8" style=3D"background-image: url('https://reviewboard.asterisk.org/media/r=
b/images/review_request_box_top_bg.png'); background-position: left top; ba=
ckground-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By Terry Wilson.</div>


<p style=3D"color: grey;"><i>Updated Jan. 26, 2012, 8:26 p.m.</i></p>



<h1 style=3D"color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</=
h1>
<table width=3D"100%" bgcolor=3D"#ffffff" cellspacing=3D"0" cellpadding=3D"=
10" style=3D"border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style=3D"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;">Addresses the issues in my previous review, and also adds Sy=
mmetric RTP to the list of things displayed with sip show peers.</pre>
  </td>
 </tr>
</table>


<h1 style=3D"color: #575012; font-size: 10pt; margin-top: 1.5em;">Descripti=
on </h1>
<table width=3D"100%" bgcolor=3D"#ffffff" cellspacing=3D"0" cellpadding=3D"=
10" style=3D"border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style=3D"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;">First, this patch as originally posted is from JIRA user ped=
ro-garcia. It has been in JIRA for a long while, and has finally come up to=
 be considered. There were some changes that I wanted to made to the origin=
al patch, so I tried contacting the author to get them to put the patch on =
reviewboard, but after a week I got no response. So, I&#39;m putting the or=
iginal patch up, then will immediately add a review with my changes. Many t=
hanks to pedro-garcia for his contribution.



More information about the asterisk-dev mailing list