<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>Hello all,<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I am trying to understand how to configure nathelper and
rtpproxy to do media hairpinning to the OpenSIPs proxy between two call legs in
 the following 3 scenarios.  I have all of the signal routing working as
desired, and I have been able to directly connect media between clients and the
PSTN gateways, however, I need to find a way to hairpin on the OpenSIPs rtpproxy
directly, I am just trying to understand how I can hairpin and exchange the
media between the two call legs on the public side of the OpenSIPs proxy.  I have
been working with rtpproxy so far.  If this would be easier accomplished with
media proxy please point me in the right direction.  Also, if anyone is aware
of a problem in  that supporting all three scenarios  here is beyond the design
scope for an OpenSIPs solution (and I need to look at B2BUA purpose-built
options instead) please let me know (and maybe recommend a Free Open Source
B2BUA solution you have had any positive experience with).<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;
padding:0in 0in 1.0pt 0in'>

<p class=MsoNormal style='border:none;padding:0in'>Scenario 1: NAT client
termination to PSTN<o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Nat&#8217;d Client UAC  <span style='font-family:Wingdings'>à</span> 
OpenSIPS Public Int <span style='font-family:Wingdings'>à</span> AppServer w/
private IP (think of something like asterisk here)  = Leg 1.<o:p></o:p></p>

<p class=MsoNormal>AppServer w/private IP <span style='font-family:Wingdings'>à</span>
OpenSIPS Private Int <span style='font-family:Wingdings'>à</span> Public PSTN
GW = Leg 2<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>With end result being media flow as:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Nat&#8217;d Client UAC media <span style='font-family:Wingdings'>à</span>
OpenSIPS/SER public Int <span style='font-family:Wingdings'>à</span> Public PSTN
GW  - and<o:p></o:p></p>

<p class=MsoNormal>Public PSTN GW <span style='font-family:Wingdings'>à</span>
OpenSIPS/SER public Int <span style='font-family:Wingdings'>à</span> Nat&#8217;d
Client UAC pinhole<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Note:  The appserver in this case uses the same SDP
parameters to start Leg 2 as it received from OpenSIPS on Leg1, but generates a
different call id.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;
padding:0in 0in 1.0pt 0in'>

<p class=MsoNormal style='border:none;padding:0in'>Scenario 2:  PSTN
Origination to NAT clients<o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>PSTN GW <span style='font-family:Wingdings'>à</span>
OpenSIPS/SER Public Int <span style='font-family:Wingdings'>à</span> AppServer  w/
private IP = Leg 1.<o:p></o:p></p>

<p class=MsoNormal>AppServer w/ Private IP <span style='font-family:Wingdings'>à</span>
OpenSIPs Private Int <span style='font-family:Wingdings'>à</span> Nat&#8217;d
client UAS pinhole = Leg 2.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>With the same result media flow as:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Nat&#8217;d Client UAC media <span style='font-family:Wingdings'>à</span>
OpenSIPS/SER public Int <span style='font-family:Wingdings'>à</span> Public PSTN
GW  - and<o:p></o:p></p>

<p class=MsoNormal>Public PSTN GW <span style='font-family:Wingdings'>à</span>
OpenSIPS/SER public Int <span style='font-family:Wingdings'>à</span> Nat&#8217;d
Client UAS pinhole<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Note:  The appserver in this case uses the same SDP
parameters to start Leg 2 as it received from OpenSIPS on Leg1, but generates a
different call id.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;
padding:0in 0in 1.0pt 0in'>

<p class=MsoNormal style='border:none;padding:0in'>Scenario 3:  PSTN or NAT
clients directly to AppServer<o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>(PSTN GW ||  Nat&#8217;d Client) <span style='font-family:
Wingdings'>à</span> OpenSIPS/SER Public Int <span style='font-family:Wingdings'>à</span>
AppServer w/ Private IP.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>With the media flow as:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>(PSTN GW ||  Nat&#8217;d Client) <span style='font-family:
Wingdings'>à</span> OpenSIPS/SER Public Int <span style='font-family:Wingdings'>à</span>
AppServer w/ Private IP.<o:p></o:p></p>

<p class=MsoNormal>AppServer w/ Private IP <span style='font-family:Wingdings'>à</span>
OpenSIPS/SER Public Int <span style='font-family:Wingdings'>à</span> (PSTN GW
|| Nat&#8217;d Client --- same  one as is sending audio).<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Note:  The appserver in this case responds with its local
address/port as the connection info parameter in SDP.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;
padding:0in 0in 1.0pt 0in'>

<p class=MsoNormal style='border:none;padding:0in'>Noted &#8220;bug&#8221;<o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I am not sure if this is a &#8220;bug&#8221; or not, but the
&#8220;nortpproxy&#8221; string, if left to default, or set to anything other
than a blank string, has consistently been prepended with a null character.  I
have seen this in wireshark on various legs of various calls wherever it inserts
the custom SDP attribute.  This causes problems with my appserver, and it will
not process the message because of the null character.  Because of this, I have
had to disable the norttpproxy parameter with &#8216;modparam(&#8220;nathelper&#8221;,
&#8220;norrtpproxy_str&#8221;, &#8220;&#8221;)&#8217;.   If it is necessary to
actually set this to achieve the above, is there known workaround to preventing
the null character from being prepended to the attribute line?<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Kirk Stephens<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>