<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></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-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi there. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So I’m fighting what must be a bit of a common problem here but the usual googling isn’t really helping me out.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">A bit of background: <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Classic Nat scenario of a sip handset behind a NAT firewall over the internet to VoIP SBC setup using Kamailio 3.3 and RTPProxy and Freeswitch as the registrar / calls server behind kamailio.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">(please excuse the beautiful ASCI art)                                                                                                                 
<o:p></o:p></p>
<p class="MsoNormal">                                                                                                                    --------------<o:p></o:p></p>
<p class="MsoNormal">                                                                                                  ---- ----|  RTPproxy |-------<o:p></o:p></p>
<p class="MsoNormal">---------------              ------------                                       |               --------------            |      ---------------<o:p></o:p></p>
<p class="MsoNormal">|SIP Phone|--------|Firewall |---------internet-------------|  kamailio   |-----------|Freeswitch|<o:p></o:p></p>
<p class="MsoNormal">---------------              ------------                                                        --------------                    ---------------<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">SIP Phones can register fine (over TCP or TLS, Kam offloads TLS if used) however when establishing  a call the SIPPhone sends its local network IP address within the SDP instead of the firewalls external address. Causing media to me miss
 directed by the RTP Proxy.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ve put a phone in with STUN to check that this is the only issue and that phone works fine .Usually in this situation  we would just use STUN or TURN / ICE to get around the issue however the handsets that we are working with (and have
 to work with for other reasons) do not support any of these technologies. So I’ve been forced to try and find another solution.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I was hoping to find some method within kamailio / RTPproxy to resolve this. I could just rewrite the SDP in certain situations but that feels a little bit brutal if I’m honest. I’ve heard of  RTPproxy being able to do some sort of rtp
 latching where it can correct its destination ip address after it receives its first rtp packets from the SIP Phone after being forwarded by the onsite firewall but other than this ‘word of mouth’ suggestion I’ve not managed to find  any detail of this functionality
 in the usual online resources. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Can anyone suggest any other potential methods for getting around this problem?
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Many Thanks<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Rob<o:p></o:p></p>
</div>
</body>
</html>