<html 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 name=Titre content=""><meta name="Mots clés" content=""><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (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:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:Calibri;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Calibri;
color:windowtext;}
span.msoIns
{mso-style-type:export-only;
mso-style-name:"";
text-decoration:underline;
color:teal;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:Calibri;
mso-fareast-language:EN-US;}
@page WordSection1
{size:595.0pt 842.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body bgcolor=white lang=FR link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Hello<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>I am new with kamailio, and trying to add prefix to Request URI ($rU).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>I use branch_route, for $rU=”prefix”+$rU, i got two time prefix adding => prefix_prefix_original$rU<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>This is my code small code:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>request_route {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> if (is_method("INVITE")) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> $var(ip1)="51.254.245.58";<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> $var(port1)="33";<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> if(!t_is_set("branch_route")) route(FWD);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> xlog("L_ALERT","Route FWD is executed from ip:$si to ip:$rd \n");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> exit;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>route[FWD] {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> t_on_branch("CHECK");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> t_relay();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>branch_route[CHECK] {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> $rd=$var(ip1);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> $rU=$var(port1)+$rU;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'> xlog("L_ALERT","dst rewrited: $rU \n");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>LOG FILES :<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Mar 28 19:34:45 ns3033789 systemd[1]: Started LSB: Start the Kamailio SIP proxy server.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Mar 28 19:34:54 ns3033789 /usr/sbin/kamailio[2859]: ALERT: <script>: dst rewrited: 3322508983432<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Mar 28 19:34:54 ns3033789 /usr/sbin/kamailio[2859]: ALERT: <script>: Route FWD is executed from ip:51.254.245.57 to ip:5.135.177.203<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Mar 28 19:34:54 ns3033789 /usr/sbin/kamailio[2859]: ALERT: <script>: dst rewrited: 333322508983432<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Mar 28 19:34:54 ns3033789 /usr/sbin/kamailio[2859]: ALERT: <script>: Route FWD is executed from ip:5.135.177.203 to ip:51.254.245.58<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Mar 28 19:35:01 ns3033789 CRON[2915]: (root) CMD (/usr/local/rtm/bin/rtm 8 > /dev/null 2> /dev/null)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>^C<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>root@ns3033789:~# <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>May someone advise me<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Thank you in advance<o:p></o:p></span></p></div></body></html>