<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Once I&nbsp;commented out the 3 lines below it works fine to failover.<BR>
&nbsp;<BR>
failure_route[1]{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("&nbsp;&nbsp;&nbsp;&nbsp; FAILED FAILURE_ROUTE[1]\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(t_any_timeout()){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("&nbsp;&nbsp;&nbsp;&nbsp; TIMEOUT!\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_branch();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("&nbsp;&nbsp;&nbsp;&nbsp; host is now $rd; all is $ru\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>}<BR>
&nbsp;<BR>
Just so I understand this correctly, there is not need for a failover route in my case necessarily correct? The only reason I am going to keep this in&nbsp;here is so that the TIMEOUT! can notify me of a host failure and then I can remove the record from DNS&nbsp;so it doesn't keep trying it.<BR>
&nbsp;<BR>
One curious thing is that if say the first invite&nbsp;gets a 401 unauthorized from the 2nd server&nbsp;(the one that is online) when the client responds with&nbsp;its appropriate second invite with the authorization info&nbsp;kamailio 3.1.0 retries&nbsp;the dead host again&nbsp;whereas 1.5.5 does not retry the dead host a second time. That in 1.5.5. could have been a fluke because it completely requeries dns&nbsp;for each invite so it may just have been luke that 10 of the 10 times I tested it it randomly choose the&nbsp;live host the second invite?<BR>
&nbsp;<BR>
Either way this appears to work now.<BR>
&nbsp;<BR>
One question that did result from these tests is that a&nbsp;typical transaction looks like:<BR>
0(2856) ERROR: &lt;script&gt;: [Mon Nov 29 20:30:34 2010] INVITE<BR>&nbsp;0(2856) ERROR: &lt;script&gt;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FAILED FAILURE_ROUTE[1]<BR>&nbsp;0(2856) ERROR: &lt;script&gt;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TIMEOUT!<BR>&nbsp;0(2856) ERROR: &lt;script&gt;: [Mon Nov 29 20:30:35 2010] ACK<BR>&nbsp;0(2856) ERROR: &lt;script&gt;: [Mon Nov 29 20:30:35 2010] INVITE<BR><BR>
With no FAILED FAILURE_ROUTE[1] or TIMEOUT! on the second invite even though it did timeout. As I am typing this the idea came to me that the reason it didn't fail the second time around is because it did not receive a 401 the second time. If this is the case then &nbsp;what happens when the client isn't unauthorized? Or will the server always reply with a 401 the first time?<BR>
&nbsp;<BR>
-Eric<BR>
&nbsp;<BR>
&gt; Date: Mon, 29 Nov 2010 14:48:25 +0100<BR>&gt; From: ibc@aliax.net<BR>&gt; To: marius.zbihlei@1and1.ro<BR>&gt; CC: sr-users@lists.sip-router.org<BR>&gt; Subject: Re: [SR-Users] Failover with SRV records<BR>&gt; <BR>&gt; 2010/11/29 marius zbihlei &lt;marius.zbihlei@1and1.ro&gt;:<BR>&gt; &gt;&gt; AFAIR using raw sockets checking ICMP notifications would be possible<BR>&gt; &gt;&gt; (not yet implemented, but possible as I remember from a thread with<BR>&gt; &gt;&gt; Andrei).<BR>&gt; &gt;&gt;<BR>&gt; &gt;<BR>&gt; &gt; Possible, but not easily implementable, as ICMP Host unreachable are sent<BR>&gt; &gt; asynchronously from the kernel. Also the current sendto() call does not<BR>&gt; &gt; guarantee delivery on all Unixes (Linux should be fine), &nbsp;connected UDP<BR>&gt; &gt; sockets are to be used instead.<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; IMHO this would be very useful because if a UDP port is unreachable<BR>&gt; &gt;&gt; and there is a ICMP notification about it, the proxy should generate<BR>&gt; &gt;&gt; an internal 503 (transport error) rather than a 408 (fr_timer<BR>&gt; &gt;&gt; timeout).<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt;<BR>&gt; &gt;<BR>&gt; &gt; Well, this means that we should disable dns_failover (or equivalents)<BR>&gt; &gt; completely and handle ICMP errors in failure_route blocks(just test if the<BR>&gt; &gt; transaction issued a 503).<BR>&gt; <BR>&gt; Humm, I expect that when discovering the destination (DNS SRV) N<BR>&gt; branches should be generated in serial forking fashion in case there<BR>&gt; are various priorities in the received response, am I wrong?<BR>&gt; <BR>&gt; <BR>&gt; &gt; If I recall RFC 3263 , this would mean another<BR>&gt; &gt; server discovery (as the new request generates a new transaction) so again<BR>&gt; &gt; there is the possibility that the broken host is selected. If we use this<BR>&gt; &gt; dns fallback(IMHO this is a nice feature- I personally rely on this) how do<BR>&gt; &gt; we decide to generate a 503 ?<BR>&gt; <BR>&gt; 503 should be the final winning response in case all the branches fail.<BR>&gt; <BR>&gt; <BR>&gt; &gt; If the host is already a IP address, that it would be ok to send a 503, as<BR>&gt; &gt; no DNS failover is possible.<BR>&gt; <BR>&gt; Yes.<BR>&gt; <BR>&gt; <BR>&gt; &gt; Ideas?<BR>&gt; <BR>&gt; I think that what I've proposed in this mail requires a big change,<BR>&gt; so... not sure if it's feasible right now.<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; -- <BR>&gt; Iņaki Baz Castillo<BR>&gt; &lt;ibc@aliax.net&gt;<BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<BR>&gt; sr-users@lists.sip-router.org<BR>&gt; http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<BR><BR>                                               </body>
</html>