<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;}
@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]--></head><body lang=PT link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'>Greetings, <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language: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 lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language: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 lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language: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 lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language: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 lang=EN-US style='color:black;mso-fareast-language: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 lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'>From: "+351411110097" <sip:I2116446I_500@xxx.xxx.xxx.xxx>;tag=99A730303736313103579CC4<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'>In this case the restore is done correctly<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language: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 lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language: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 lang=EN-US style='color:black;mso-fareast-language:EN-US'>To : "+351411110097" <sip:I2116446I_500@xxx.xxx.xxx.xxx>;tag=99A730303736313103579CC4<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language: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 lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language: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 lang=EN-US style='color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language:EN-US'>If you need more information please let me know.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black;mso-fareast-language: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></body></html>