OK, I have decided to use htable to store the AVP returned by the LCR module.  I have everything working, except I have run into a strange issue with my failure_route logic.<br><br>Immediately after calling next_gw() in my initial REQUEST_ROUTE or FAILURE_ROUTE, I populate an htable which maps the socket I should send all in-dialog requests from.  This gets reset each time we call next_gw() in the event that a gateway can&#39;t service my request for some reason.  The issue I have is that on FAILURE_ROUTE scenarios where I am fetching the next gateway, it doesn&#39;t appear that the force_send_socket() is actually working for subsequent calls.  The real example I am seeing is below.  I am seeing my log in the ELSE statement, but Kamailio continues to send FROM X.X.X.180.  Not sure what I could be doing wrong... <br>
<br>
 <table style="border-collapse: collapse; width: 365pt;" border="0" cellpadding="0" cellspacing="0" width="487"><col style="width: 41pt;" width="55">
 <col style="width: 32pt;" width="43">
 <col style="width: 117pt;" span="2" width="156">
 <col style="width: 58pt;" width="77">
 <tbody><tr style="height: 12.75pt;" height="17">
  <td class="xl66" style="height: 12.75pt; width: 41pt;" height="17" width="55">method</td>
  <td class="xl66" style="width: 32pt;" width="43">status</td>
  <td class="xl66" style="width: 117pt;" width="156">fromip</td>
  <td class="xl66" style="width: 117pt;" width="156">toip</td>
  <td class="xl66" style="width: 58pt;" width="77">send_grp</td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65"><br></td>
  <td class="xl65">udp:X.X.X.190:5060</td>
  <td class="xl65">udp:X.X.X.179:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65"><br></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65">udp:<a href="http://216.82.224.202:5060">216.82.224.202:5060</a></td>
  <td class="xl65" align="right">1</td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65">100</td>
  <td class="xl65">udp:<a href="http://216.82.224.202:5060">216.82.224.202:5060</a></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65">408</td>
  <td class="xl65">udp:<a href="http://216.82.224.202:5060">216.82.224.202:5060</a></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65"><br></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65">udp:<a href="http://216.82.225.202:5060">216.82.225.202:5060</a></td>
  <td class="xl65" align="right">1</td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65">100</td>
  <td class="xl65">udp:<a href="http://216.82.225.202:5060">216.82.225.202:5060</a></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65">404</td>
  <td class="xl65">udp:<a href="http://216.82.225.202:5060">216.82.225.202:5060</a></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65"><br></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65">udp:<a href="http://209.249.3.78:5060">209.249.3.78:5060</a></td>
  <td class="xl65" align="right">0</td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65">100</td>
  <td class="xl65">udp:<a href="http://209.249.3.78:5060">209.249.3.78:5060</a></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65">503</td>
  <td class="xl65">udp:<a href="http://209.249.3.78:5060">209.249.3.78:5060</a></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65"><br></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65">udp:<a href="http://208.93.226.12:5060">208.93.226.12:5060</a></td>
  <td class="xl65" align="right">0</td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65">100</td>
  <td class="xl65">udp:<a href="http://208.93.226.12:5060">208.93.226.12:5060</a></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65">503</td>
  <td class="xl65">udp:<a href="http://208.93.226.12:5060">208.93.226.12:5060</a></td>
  <td class="xl65">udp:X.X.X.180:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">INVITE</td>
  <td class="xl65">503</td>
  <td class="xl65">udp:X.X.X.179:5060</td>
  <td class="xl65">udp:X.X.X.190:5060</td>
  <td class="xl65"><br></td>
 </tr>
 <tr style="height: 12.75pt;" height="17">
  <td class="xl65" style="height: 12.75pt;" height="17">ACK</td>
  <td class="xl65"><br></td>
  <td class="xl65">udp:X.X.X.190:5060</td>
  <td class="xl65">udp:X.X.X.179:5060</td>
  <td class="xl65"><br></td>
 </tr>
</tbody></table><br><br>if(next_gw()){<br>            $sht(send_grp=&gt;$ci) = $avp(i:712);    <br>    <br>            if($sht(send_grp=&gt;$ci) == 1){<br>                xlog(&quot;L_INFO&quot;, &quot;failure_route[1] - send_group==1; sending from .180 $ru&quot;);<br>
                force_send_socket(X.X.X.180:5060);<br>            }else if($sht(send_grp=&gt;$ci) == 2){<br>                xlog(&quot;L_INFO&quot;, &quot;failure_route[1] - send_group==2; sending from .180 $ru&quot;);<br>
                force_send_socket(X.X.X.189:5060);<br>            }else{<br>                xlog(&quot;L_INFO&quot;, &quot;failure_route[1] - default send group; sending from .179 $ru&quot;);<br>                force_send_socket(X.X.X.179:5060);<br>
            }    <br>                <br>            t_on_reply(&quot;1&quot;);<br>            t_on_failure(&quot;1&quot;);<br>            t_relay();<br>        }else{<br>            # let the reply go upstram - it is the default action<br>
            xlog(&quot;L_ERR&quot;, &quot;No Next Gateway - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n&quot;);<br>            exit;<br>        }<br><br><br><div class="gmail_quote">On Mon, Jun 28, 2010 at 4:41 AM, Iņaki Baz Castillo <span dir="ltr">&lt;<a href="mailto:ibc@aliax.net" target="_blank">ibc@aliax.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
2010/6/28 Juha Heinanen &lt;<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a>&gt;:<br>
<div><div></div><div>&gt; Ernest Mavrel writes:<br>
&gt;<br>
&gt;&gt; I use same scenario as Geoffrey. But I have problem with<br>
&gt;&gt; force_send_socket() in failure_route[1].<br>
&gt;&gt; If is first gw online, then everything is ok, force send socket work.<br>
&gt;&gt; But when first gw is offline and lcr try second gw, then message go<br>
&gt;&gt; trough socket which is called on first gw. I am using kamailio 1.4.2. Is<br>
&gt;&gt; this a bug?<br>
&gt;<br>
&gt; i don&#39;t know if it is a bug or not, but i call force_send_socket in<br>
&gt; branch route and it has worked as expected.<br>
<br>
</div></div>It&#39;s required to use to_gw_grp() in branch_route as changes done by<br>
LCR in the RURI are not visible until etering into branch_route.<br>
<font color="#888888"><br>
--<br>
</font><div>Iņaki Baz Castillo<br>
&lt;<a href="mailto:ibc@aliax.net" target="_blank">ibc@aliax.net</a>&gt;<br>
<br>
</div><div><div></div><div>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br>