<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello David,</p>
<p>did I got your correctly that another Kamailio "downstream" also uses the uac module for rewriting?</p>
<p>In this case your guess might be correct, that the rr and uac modules are confused because of the two same headers in one Route header.</p>
<p>Two workarounds:</p>
<p>- set other header name in uac with rr_from_store_param and rr_to_store_param <br>
</p>
<p>- use the dialog module and use restore_mode dialog to get rid of the Route header</p>
<p>Cheers,</p>
<p>Henning<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">Am 30.08.19 um 21:19 schrieb David Costa:<br>
</div>
<blockquote type="cite" cite="mid:045d01d55f67$d9c03420$8d409c60$@simplesnet.pt">
<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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Texto de bal\00E3o Car\00E1cter";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EstiloCorreioElectrnico17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.TextodebaloCarcter
        {mso-style-name:"Texto de bal\00E3o Car\00E1cter";
        mso-style-priority:99;
        mso-style-link:"Texto de bal\00E3o";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
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]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">Greetings,
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">I have a Kamailio proxy with uac_replace for To and From Headers. So far everything has worked correctly.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">However, I now have a client who encodes my Calling Number too and I’m getting some issues in the restore mechanics. I have the restore setup as "auto" and it's info is stored
 in "vsf" and "vst" parameters of Record-Route.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">On replies sent by my client I have the following Record-Route and From Header (Note : My Kamailio has two IPs which makes it insert two RR headers ):
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">Record-Route: <sip:xxx.xxx.xxx.xxx;r2=on;lr;ftag=99A730303736313103579CC4;tbk_i=1_2_Y;tbk_o=128_11_Y;vsf=AAAAABgGBAMDAAUBBQAJDndyAwMcHwIdHQsWHwUDNw--;vst=AAAAABgGBAMHDQgJDQECA3RyAwMcHwIdGgQeHAIFAnVzZXI9cGhvbmU-;did=f74.78e2><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">Record-Route: <sip:xxx.xxx.xxx.xxx;r2=on;lr;ftag=99A730303736313103579CC4;tbk_i=1_2_Y;tbk_o=128_11_Y;vsf=AAAAABgGBAMDAAUBBQAJDndyAwMcHwIdHQsWHwUDNw--;vst=AAAAABgGBAMHDQgJDQECA3RyAwMcHwIdGgQeHAIFAnVzZXI9cGhvbmU-;did=f74.78e2><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">From: "+351411110097"
<a class="moz-txt-link-rfc2396E" href="mailto:sip:I2116446I_500@xxx.xxx.xxx.xxx">
<sip:I2116446I_500@xxx.xxx.xxx.xxx></a>;tag=99A730303736313103579CC4<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">In this case the restore is done correctly<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">When the client sends me a BYE request I have the following Route Header and To Header<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">Route : <sip:xxx.xxx.xxx.xxx;r2=on;lr;ftag=99A730303736313103579CC4;tbk_i=1_2_Y;tbk_o=128_11_Y;vsf=AAAAABgGBAMDAAUBBQAJDndyAwMcHwIdHQsWHwUDNw--;vst=AAAAABgGBAMHDQgJDQECA3RyAwMcHwIdGgQeHAIFAnVzZXI9cGhvbmU-;did=f74.78e2>,<sip:xxx.xxx.xxx.xxx;r2=on;lr;ftag=99A730303736313103579CC4;tbk_i=1_2_Y;tbk_o=128_11_Y;vsf=AAAAABgGBAMDAAUBBQAJDndyAwMcHwIdHQsWHwUDNw--;vst=AAAAABgGBAMHDQgJDQECA3RyAwMcHwIdGgQeHAIFAnVzZXI9cGhvbmU-;did=f74.78e2><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">To : "+351411110097"
<a class="moz-txt-link-rfc2396E" href="mailto:sip:I2116446I_500@xxx.xxx.xxx.xxx">
<sip:I2116446I_500@xxx.xxx.xxx.xxx></a>;tag=99A730303736313103579CC4<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">In this scenario, the To after restore is :  To :"+351411110097" <sip:<b>Q4525417L_<>G</b>xxx.xxx.xxx.xxx>;tag=99A730303736313103579CC4, which throws an internal error on
 Kamailio about bad URI and also makes our MediaGateway reply with a "Bad Request".<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">Can this error be caused by the restore of the uac_replace mechanics? Both Record Route URIs are on different headers while the both Route URIs are on the same Route header.
 Can this be the reason?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US">If you need more information please let me know.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-US">Best Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">David Costa<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">-- 
Henning Westerholt - <a class="moz-txt-link-freetext" href="https://skalatan.de/blog/">https://skalatan.de/blog/</a>
Kamailio services - <a class="moz-txt-link-freetext" href="https://skalatan.de/services">https://skalatan.de/services</a></pre>
</body>
</html>