<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 14 (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: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;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I am working on a kamailio proxy with a very specific goal I need to accomplish.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">What I would like to do is a key-value lookup, utilizing the SDP&#8217;s media contact (c= line) IP as a key, and have a function return a value for that key. It appears that I can possibly accomplish this with the AVPops module, combined with
 DB_TEXT (maybe DB_MYSQL in the future) and a custom table with a custom query. The only thing I seem to be missing is the ability to extract the c= IP from the SDP, and store it as some kind of variable with which to do the lookup.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I&#8217;ve looked into the iptrtpproxy module as it seems to have a select: @iptrtpproxy.sdp_ip that could work, but that module is extreme overkill for my purposes, and I am running into some issues getting it built for my platform (Ubuntu server
 12.04). Also the documentation for that select states: &#8220;Return first rewritten IP provided at SDP c= line.&#8221; However, I&#8217;m looking for the original sdp_ip, and have some concern that this won&#8217;t return an IP that has not yet been re-written.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">My environment has a very specific 1:1 ratio of private network, to static public IP mappings. I currently have a successful OpenSER (1.3.2) deployment within this environment (running 5 years), which uses a hacked version of the old &#8220;mangler&#8221;
 module, with the function sdp_mangle_ip(&lt;network&gt;, &lt;ip&gt;). I could do something similar using textops-&gt;search_body() and nathelper-&gt;fix_nated_sdp(), but the risk of a typo or syntax error in the config file every time I have to make a change or add a network
 is fairly high. Less importantly, there is some extra overhead as the proxy will have to test for every network on every SDP looking for a match (this is what the current deployment does). Eventually I&#8217;d like to add a simple frontend to add/edit networks on
 the fly, so that no one is ever touching the config.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">What would you folks recommend for this? Should I look at building a custom module which only grabs the c= IP and stores it into an AVP? Am I not seeing another module that will expose that information for me already? Would it simply be
 easier to work on getting iptrtpproxy built, and utilizing it only for the purpose of extracting the information I need from the SDP?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Any insight would be most greatly appreciated.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Travis Hegner<o:p></o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">The information contained in this communication is confidential and is intended only for the use of the named recipient. Unauthorized use, disclosure, or copying is strictly prohibited and may be unlawful. If you have
 received this communication in error, you should know that you are bound to confidentiality, and should please immediately notify the sender or our IT Department at 866.459.4599.<br>
</font>
</body>
</html>