[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sr-users
Subject:    Re: [SR-Users] TOPOS + RE-INVITE problem - Contact IP not updated
From:       Patrick Karton <patrickarton () hotmail ! com>
Date:       2022-05-24 8:04:04
Message-ID: AM0PR0402MB377807D3A8BC436D44C5F203DFD79 () AM0PR0402MB3778 ! eurprd04 ! prod ! outlook ! com
[Download RAW message or body]

Hello,

try to apply this setting for topos module.

modparam("topos", "contact_mode", 0)

10.10.70.70 does not put the full contact uri in the R-INVITE.

try put contact_mode to 0 (and not 1 or 2).

________________________________
De : sr-users <sr-users-bounces@lists.kamailio.org> de la part de c c \
<c@netcontrol.fr> Envoyé : lundi 23 mai 2022 08:38
À : sr-users@lists.kamailio.org <sr-users@lists.kamailio.org>
Objet : [SR-Users] TOPOS + RE-INVITE problem - Contact IP not updated


It seems that TOPOS is not working properly on RE-INVITE and stop masking IP and \
contact on some RE-INVITE.

When a RE-INVITE is send with Kamailio IP as Request-URI TOPOS is not operating.


Note : we are using the HTABLE trick to rewrite $ru and match the call but we would \
need to have TOPOS re-evaluating the dialog once done.


We use a standard configuration with 2 modifications.

  1.  in route[DISPATCH] to set the HTABLE

if(is_method("INVITE")) {
 $sht(ct=>$ci::$ft) = $sel(contact.uri);
}


  1.  in route[WITHINDLG] to find the call if R-URI = myself

if(has_totag() && uri==myself) {
 if($sht(ct=>$ci::$ft) != $null && $T_reply_code > 400) $shtex(ct=>$ci::$ft) = 10 ;
  if($sht(ct=>$ci::$tt) != $null) {
     $ru = $sht(ct=>$ci::$tt);
     if (is_method("BYE")) $shtex(ct=>$ci::$tt) = 10 ;
     route(RELAY);
  }
}


As you can see in the PCAP the RE-INVITE goes directly to calling stating with the \
Contact not updated and the 200 OK is also sent to called party with wrong Contact \
info too.

<https://github.com/kamailio/kamailio/files/8730489/topos-issue.zip>


This behavior breaks the BYE procedure.


Any advice ?


Chris


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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);" class="elementToProof"> Hello,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);" class="elementToProof"> <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);" class="elementToProof"> try to apply this setting for topos \
module.</div> <div style="font-family: Calibri, Arial, Helvetica, sans-serif; \
font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof"> <pre \
class="programlisting" style="font-family:monospace;background-color:rgb(252, 255, \
252);border:1px solid rgb(153, 204, \
204);padding-left:15pt;overflow:auto;border-radius:2.5px;font-size:15px">modparam(&quot;topos&quot;, \
&quot;contact_mode&quot;, 0)</pre> <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);" class="elementToProof"> 10.10.70.70 does not put the full \
contact uri in the R-INVITE.</div> <div style="font-family: Calibri, Arial, \
Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof"> \
<br> </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);" class="elementToProof"> try put contact_mode to 0 (and not 1 or \
2).</div> <div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> <br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" \
style="font-size:11pt"><b>De :</b> sr-users \
&lt;sr-users-bounces@lists.kamailio.org&gt; de la part de c c \
&lt;c@netcontrol.fr&gt;<br> <b>Envoyé :</b> lundi 23 mai 2022 08:38<br>
<b>À :</b> sr-users@lists.kamailio.org &lt;sr-users@lists.kamailio.org&gt;<br>
<b>Objet :</b> [SR-Users] TOPOS + RE-INVITE problem - Contact IP not updated</font>
<div>&nbsp;</div>
</div>
<div>
<div style="font-family:arial,helvetica,sans-serif; font-size:12pt; color:#000000">
<div>
<p dir="auto" style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); \
font-size:14px; font-style:normal; font-variant-ligatures:normal; \
font-variant-caps:normal; font-weight:400; letter-spacing:normal; orphans:2; \
text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; \
word-spacing:0px; background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> It seems that TOPOS is not working properly on \
RE-INVITE and stop masking IP and contact on some RE-INVITE.</p> <p dir="auto" \
style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); font-size:14px; \
font-style:normal; font-variant-ligatures:normal; font-variant-caps:normal; \
font-weight:400; letter-spacing:normal; orphans:2; text-align:start; text-indent:0px; \
text-transform:none; white-space:normal; widows:2; word-spacing:0px; \
background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> When a RE-INVITE is send with Kamailio IP as \
Request-URI TOPOS is not operating.</p> <p dir="auto" style="box-sizing:border-box; \
margin:0px; color:rgb(36,41,47); font-size:14px; font-style:normal; \
font-variant-ligatures:normal; font-variant-caps:normal; font-weight:400; \
letter-spacing:normal; orphans:2; text-align:start; text-indent:0px; \
text-transform:none; white-space:normal; widows:2; word-spacing:0px; \
background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> <br>
</p>
<p dir="auto" style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); \
font-size:14px; font-style:normal; font-variant-ligatures:normal; \
font-variant-caps:normal; font-weight:400; letter-spacing:normal; orphans:2; \
text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; \
word-spacing:0px; background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> Note : we are using the HTABLE trick to rewrite $ru \
and match the call but we would need to have TOPOS re-evaluating the dialog once \
done.</p> <p dir="auto" style="box-sizing:border-box; margin:0px; \
color:rgb(36,41,47); font-size:14px; font-style:normal; \
font-variant-ligatures:normal; font-variant-caps:normal; font-weight:400; \
letter-spacing:normal; orphans:2; text-align:start; text-indent:0px; \
text-transform:none; white-space:normal; widows:2; word-spacing:0px; \
background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> <br>
</p>
<p dir="auto" style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); \
font-size:14px; font-style:normal; font-variant-ligatures:normal; \
font-variant-caps:normal; font-weight:400; letter-spacing:normal; orphans:2; \
text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; \
word-spacing:0px; background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> We use a standard configuration with 2 \
modifications.</p> <ol dir="auto" style="box-sizing:border-box; padding-left:2em; \
margin-top:0px; margin-bottom:16px; color:#24292f; font-size:14px; font-style:normal; \
font-variant-ligatures:normal; font-variant-caps:normal; font-weight:400; \
letter-spacing:normal; orphans:2; text-align:start; text-indent:0px; \
text-transform:none; white-space:normal; widows:2; word-spacing:0px; \
background-color:#ffffff; text-decoration-style:initial; \
text-decoration-color:initial"> <li style="box-sizing:border-box; margin-left:0px">in \
route[DISPATCH] to set the HTABLE</li></ol> <div class="x_snippet-clipboard-content \
x_notranslate x_position-relative x_overflow-auto" style="box-sizing:border-box; \
overflow:auto!important; color:#24292f; font-size:14px; font-style:normal; \
font-variant-ligatures:normal; font-variant-caps:normal; font-weight:400; \
letter-spacing:normal; orphans:2; text-align:start; text-indent:0px; \
text-transform:none; white-space:normal; widows:2; word-spacing:0px; \
background-color:#ffffff; text-decoration-style:initial; \
text-decoration-color:initial"> <pre class="x_notranslate" \
style="box-sizing:border-box; font-family:ui-monospace,SFMono-Regular,'SF \
Mono',Menlo,Consolas,'Liberation Mono',monospace; font-size:11.9px; margin-top:0px; \
margin-bottom:16px; padding:16px; overflow:auto; line-height:1.45; \
border-radius:6px"><code style="box-sizing:border-box; \
font-family:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,'Liberation \
Mono',monospace; font-size:11.9px; padding:0px; margin:0px; background:transparent; \
border-radius:6px; word-break:normal; white-space:pre; border:0px; display:inline; \
overflow:visible; line-height:inherit">if(is_method(&quot;INVITE&quot;)) {  \
$sht(ct=&gt;$ci::$ft) = $sel(contact.uri); }
</code></pre>
</div>
<ol start="2" dir="auto" style="box-sizing:border-box; padding-left:2em; \
margin-top:0px; margin-bottom:16px; color:#24292f; font-size:14px; font-style:normal; \
font-variant-ligatures:normal; font-variant-caps:normal; font-weight:400; \
letter-spacing:normal; orphans:2; text-align:start; text-indent:0px; \
text-transform:none; white-space:normal; widows:2; word-spacing:0px; \
background-color:#ffffff; text-decoration-style:initial; \
text-decoration-color:initial"> <li style="box-sizing:border-box; margin-left:0px">in \
route[WITHINDLG] to find the call if R-URI = myself</li></ol> <div \
class="x_snippet-clipboard-content x_notranslate x_position-relative x_overflow-auto" \
style="box-sizing:border-box; overflow:auto!important; color:#24292f; font-size:14px; \
font-style:normal; font-variant-ligatures:normal; font-variant-caps:normal; \
font-weight:400; letter-spacing:normal; orphans:2; text-align:start; text-indent:0px; \
text-transform:none; white-space:normal; widows:2; word-spacing:0px; \
background-color:#ffffff; text-decoration-style:initial; \
text-decoration-color:initial"> <pre class="x_notranslate" \
style="box-sizing:border-box; font-family:ui-monospace,SFMono-Regular,'SF \
Mono',Menlo,Consolas,'Liberation Mono',monospace; font-size:11.9px; margin-top:0px; \
margin-bottom:16px; padding:16px; overflow:auto; line-height:1.45; \
border-radius:6px"><code style="box-sizing:border-box; \
font-family:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,'Liberation \
Mono',monospace; font-size:11.9px; padding:0px; margin:0px; background:transparent; \
border-radius:6px; word-break:normal; white-space:pre; border:0px; display:inline; \
overflow:visible; line-height:inherit">if(has_totag() &amp;&amp; uri==myself) {  \
if($sht(ct=&gt;$ci::$ft) != $null &amp;&amp; $T_reply_code &gt; 400) \
$shtex(ct=&gt;$ci::$ft) = 10 ;   if($sht(ct=&gt;$ci::$tt) != $null) {
     $ru = $sht(ct=&gt;$ci::$tt);
     if (is_method(&quot;BYE&quot;)) $shtex(ct=&gt;$ci::$tt) = 10 ;
     route(RELAY);
  }
}
</code></pre>
</div>
<p dir="auto" style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); \
font-size:14px; font-style:normal; font-variant-ligatures:normal; \
font-variant-caps:normal; font-weight:400; letter-spacing:normal; orphans:2; \
text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; \
word-spacing:0px; background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> As you can see in the PCAP the RE-INVITE goes \
directly to calling stating with the Contact not updated and the 200 OK is also sent \
to called party with wrong Contact info too.</p> <p dir="auto" \
style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); font-size:14px; \
font-style:normal; font-variant-ligatures:normal; font-variant-caps:normal; \
font-weight:400; letter-spacing:normal; orphans:2; text-align:start; text-indent:0px; \
text-transform:none; white-space:normal; widows:2; word-spacing:0px; \
background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> <a \
href="https://github.com/kamailio/kamailio/files/8730489/topos-issue.zip" \
data-auth="NotApplicable" style="box-sizing:border-box; background-color:transparent; \
text-decoration:none"></a></p> <p dir="auto" style="box-sizing:border-box; \
margin:0px; color:rgb(36,41,47); font-size:14px; font-style:normal; \
font-variant-ligatures:normal; font-variant-caps:normal; font-weight:400; \
letter-spacing:normal; orphans:2; text-align:start; text-indent:0px; \
text-transform:none; white-space:normal; widows:2; word-spacing:0px; \
background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> <br>
</p>
<p dir="auto" style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); \
font-size:14px; font-style:normal; font-variant-ligatures:normal; \
font-variant-caps:normal; font-weight:400; letter-spacing:normal; orphans:2; \
text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; \
word-spacing:0px; background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> This behavior breaks the BYE procedure.</p>
<p dir="auto" style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); \
font-size:14px; font-style:normal; font-variant-ligatures:normal; \
font-variant-caps:normal; font-weight:400; letter-spacing:normal; orphans:2; \
text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; \
word-spacing:0px; background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> <br>
</p>
<p dir="auto" style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); \
font-size:14px; font-style:normal; font-variant-ligatures:normal; \
font-variant-caps:normal; font-weight:400; letter-spacing:normal; orphans:2; \
text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; \
word-spacing:0px; background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> Any advice ?</p>
<p dir="auto" style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); \
font-size:14px; font-style:normal; font-variant-ligatures:normal; \
font-variant-caps:normal; font-weight:400; letter-spacing:normal; orphans:2; \
text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; \
word-spacing:0px; background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> <br>
</p>
<p dir="auto" style="box-sizing:border-box; margin:0px; color:rgb(36,41,47); \
font-size:14px; font-style:normal; font-variant-ligatures:normal; \
font-variant-caps:normal; font-weight:400; letter-spacing:normal; orphans:2; \
text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; \
word-spacing:0px; background-color:rgb(255,255,255); text-decoration-style:initial; \
text-decoration-color:initial"> Chris</p>
</div>
</div>
</div>
</body>
</html>



__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

--===============0090157781==--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic