<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div><br>
</div>
<div>Caller <--> (internal_IP) Kamailio (external_IP) <---> Callee</div>
<div><br>
</div>
<div><br>
</div>
<div>I have this set up of kamailio with 2 interfaces.</div>
<div><br>
</div>
<div>i use topos module for topology hiding and what i want to do is to </div>
<div>send  external_IP in Contact Header of request relayed to Callee and internal_IP</div>
<div>in Contact Header of response relayed to Caller. </div>
<div><br>
</div>
<div>i noticed that : </div>
<div>when i use topos module with contact_mode to 0 </div>
<div>all Record-Route and Caller Via Header are removed and thats great.</div>
<div>but i dont find way to put 2 different  ip addresses in Request and Response Contact Header?</div>
<div><br>
</div>
<div>when i use contact_mode to 2 Record-Route and Caller Via Header are not anymore removed thats bad for
</div>
<div>topology hiding. And its seems we can not $xavu(_tps_=>contact_host)  parameter of module
</div>
<div>to put 2 different  ip addresses in Request and Response Contact Header.</div>
<div><br>
</div>
<div><br>
</div>
<div>What i want is : </div>
<div>- remove all Record-Route and Caller Via Header for request like when contact_mode to 0</div>
<div>- and put 2 different  ip addresses in Request and Response Contact Header</div>
<div><br>
</div>
<div>is it possible to achieve it ? </div>
<div><br>
</div>
Thanks.<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De :</b> sr-users <sr-users-bounces@lists.kamailio.org> de la part de Patrick Karton <patrickarton@hotmail.com><br>
<b>Envoyé :</b> jeudi 17 mars 2022 19:39<br>
<b>À :</b> Henning Westerholt <hw@gilawa.com>; Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Objet :</b> Re: [SR-Users] enable topology hiding on one side or dynamic ip in topoh module Contact and Via Header</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks For the link.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
but i dont know exactly how to make the topos module work!</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
i have enabled it on my kamailio script but i have some issues.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<ul>
<li> in the relayed request, received Via is removed and only kamailio Via is left. thats great for topology hiding.</li></ul>
<div>
<ul>
<li>in the relayed request there is no Contact Header. i assume the module removes the received one  and must insert a new one .</li></ul>
<div><br>
</div>
</div>
<div>loadmodule "db_text.so"
<div>loadmodule "topos.so"</div>
<div><br>
</div>
<div><br>
</div>
<div>modparam("db_text", "db_mode", 0)</div>
<div>modparam("db_text", "emptystring", 0)</div>
<div>modparam("db_text", "file_buffer_size", 8192)</div>
<div>modparam("db_text", "max_result_rows", 1000)</div>
<div><br>
</div>
<div>modparam("topos", "storage", "db")</div>
<div>modparam("topos", "db_url", "text:///home/sbc/database")</div>
<div>modparam("topos", "mask_callid", 0)</div>
<div>modparam("topos", "sanity_checks", 0)</div>
<div>modparam("topos", "contact_host", "127.0.0.1")</div>
<div>modparam("topos", "contact_mode", 0)</div>
<div><br>
</div>
<div><br>
</div>
<div>########### topos_t file table</div>
<div>id(int,auto) rectime(int,null) x_context(string,null) s_method(string,null) s_cseq(string,null) a_callid(string,null) a_uuid(string,null) b_uuid(string,null) direction(int,null) x_via(string,null) x_vbranch(string,null) x_rr(string,null) y_rr(string,null)
 s_rr(string,null) x_uri(string,null) a_contact(string,null) b_contact(string,null) as_contact(string,null) bs_contact(string,null) x_tag(string,null) a_tag(string,null) b_tag(string,null) a_srcaddr(string,null) b_srcaddr(string,null) a_socket(string,null)
 b_socket(string,null) </div>
<div><br>
</div>
<div>do i need to insert some records in table or the module does it ? </div>
<span></span><br>
</div>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>De :</b> Henning Westerholt <hw@gilawa.com><br>
<b>Envoyé :</b> jeudi 17 mars 2022 17:37<br>
<b>À :</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Cc :</b> Patrick Karton <patrickarton@hotmail.com><br>
<b>Objet :</b> RE: enable topology hiding on one side or dynamic ip in topoh module Contact and Via Header</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:Wingdings}
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.x_x_MsoNormal, li.x_x_MsoNormal, div.x_x_MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
a:link, span.x_x_MsoHyperlink
        {color:#0563C1;
        text-decoration:underline}
span.x_x_E-MailFormatvorlage19
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.x_x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:70.85pt 70.85pt 2.0cm 70.85pt}
ol
        {margin-bottom:0cm}
ul
        {margin-bottom:0cm}
-->
</style>
<div lang="DE" style="word-wrap:break-word">
<div class="x_x_WordSection1">
<p class="x_x_MsoNormal"><span style="">Hello,</span></p>
<p class="x_x_MsoNormal"><span style=""> </span></p>
<p class="x_x_MsoNormal"><span lang="EN-GB" style="">have a look at this event route:
</span><span style=""><a href="https://kamailio.org/docs/modules/5.5.x/modules/topos.html#topos.e.msg_outgoing"><span lang="EN-GB">https://kamailio.org/docs/modules/5.5.x/modules/topos.html#topos.e.msg_outgoing</span></a></span><span lang="EN-GB" style=""></span></p>
<p class="x_x_MsoNormal"><span lang="EN-GB" style=""> </span></p>
<p class="x_x_MsoNormal"><span style="">Cheers,</span></p>
<p class="x_x_MsoNormal"><span style=""> </span></p>
<p class="x_x_MsoNormal"><span style="">Henning</span></p>
<p class="x_x_MsoNormal"><span style=""> </span></p>
<div>
<p class="x_x_MsoNormal"><span lang="EN-GB" style="">-- </span></p>
<p class="x_x_MsoNormal"><span lang="EN-GB" style="">Henning Westerholt – </span>
<span style=""><a href="https://skalatan.de/blog/"><span lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a></span><span lang="EN-GB" style=""></span></p>
<p class="x_x_MsoNormal"><span lang="EN-GB" style="">Kamailio services – </span><span style=""><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a></span><span lang="EN-GB" style=""></span></p>
</div>
<p class="x_x_MsoNormal"><span lang="EN-GB" style=""> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org>
<b>On Behalf Of </b>Patrick Karton<br>
<b>Sent:</b> Wednesday, March 16, 2022 7:28 PM<br>
<b>To:</b> sr-users@lists.kamailio.org<br>
<b>Subject:</b> [SR-Users] enable topology hiding on one side or dynamic ip in topoh module Contact and Via Header</p>
</div>
</div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"> </p>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">Hello , </span></p>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">im using kamailio with two interfaces external and internal.</span></p>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black">i need a way either to : </span></p>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:71.4pt; text-indent:-18.0pt"><span style="font-size:10.0pt; font-family:Symbol; color:black"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><span style="font-size:12.0pt; color:black">enable topoh hiding only when outgoing interface is external ( mask contact and Via ip only when ougoing interface is external</span></p>
<p class="x_x_MsoNormal" style="margin-left:71.4pt; text-indent:-18.0pt"><span style="font-size:10.0pt; font-family:Symbol; color:black"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><span style="font-size:12.0pt; color:black">or if it is not possible to enable it only in one direction.i want to know how to configure dynamic(for example in xavp or avp) ip to put in Contact and Via when topoh is enabled.</span></p>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt">i see that the
<b>'mask_ip'</b> parameter of topoh module is a string. so we can not set a dynamic value here unfortunately.</span></p>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"> </p>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt">Thanks</span></p>
</div>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
<div>
<p class="x_x_MsoNormal" style="margin-left:35.4pt"><span style="font-size:12.0pt; color:black"> </span></p>
</div>
</div>
</div>
</div>
</body>
</html>