<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: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;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        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:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>I am running opensips 1.8.3 with &nbsp;do_routing module <o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>A dial_rule prefix has 3 trunk gateways ( gw1,gw2,gw3)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>After do_routing(,)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>I am setting the $rU and fixing&nbsp; the To Tag header using uac_replace_to( and the call go to gw1 with correct TO tag as I set it ,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>but when calls fails on gw1 ,</span><span style='font-family:"Verdana","sans-serif"'>then &nbsp;I set the $rU in route[6] to go to second in route and it goes with bad TO header, since it goes with the same To header in the 1<sup>st</sup> invite <o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>That target gw1 <o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>1-how to fix the To header in the second invite to gw2<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Verdana","sans-serif"'>loadmodule &quot;uac.so&quot;<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>modparam(&quot;uac&quot;,&quot;restore_mode&quot;,&quot;auto&quot;)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>uac_replace_to(&quot;$avp(dst)&quot;,&quot;sip:$var(prefix)$avp(dst)@$td&quot;);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Verdana","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_on_failure(&quot;1&quot;);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>on failure_route[1] {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Verdana","sans-serif"'>if (!t_check_status(&quot;487&quot;)) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Verdana","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #xlog(&quot;------------route6-------\n&quot;);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Verdana","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $avp(failure_count) = $avp(failure_count) + 1;&nbsp; #480|486|603&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Verdana","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(6);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Verdana","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-family:"Verdana","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>Route[6]{<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>$rU = $var(prefix) + $avp(dst);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>uac_replace_to(&quot;sip:$var(prefix)$avp(dst)@$td&quot;);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'>Regards<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Verdana","sans-serif"'><o:p>&nbsp;</o:p></span></p></div></body></html>