<br><br><div class="gmail_quote">On Thu, Apr 1, 2010 at 10:26 AM, Brett Nemeroff <span dir="ltr">&lt;<a href="mailto:brett@nemeroff.com">brett@nemeroff.com</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;">
Where is your failure route? :)<br>
-Brett<br>
<div><div></div><div class="h5"><br></div></div></blockquote><div><br>I intentionally chose to not include it, along with the other 200 lines of config, for simplicity, but you&#39;re right, given this is a failure, I clearly should&#39;ve, duh :)<br>
<br>failure_route[2] {<br>        if (t_was_cancelled()) {<br>                xlog( &quot;L_NOTICE&quot;, &quot;[$Tf] FR: transaction cancelled - exiting\n&quot; );<br>                exit;<br>                }<br><br>        # If fr_timer expires t_check_status(&quot;408&quot;) is true, although $rs is &lt;null&gt;<br>
         if( t_check_status(&quot;408&quot;) ){<br>                xlog( &quot;L_NOTICE&quot;, &quot;[$Tf] FR: $ci -- TIMEOUT for Gateway $rd\n&quot; );<br>         } else {<br>                xlog( &quot;L_NOTICE&quot;, &quot;[$Tf] FR: $ci -- $rs reason $rr\n&quot; );<br>
                }<br><br>        # 403 -- typically ISDN network says &#39;not a valid number&#39; etc..<br>        if( t_check_status(&quot;403&quot;) ){<br>                xlog(&quot;L_WARN&quot;, &quot;[$Tf] FR: $ci -- SIP-$rs Forbidden -&gt; ISDN Cause Code 1\n&quot; );<br>
                return;<br>                }<br><br>        if( ds_next_domain() ){<br>                xlog( &quot;L_NOTICE&quot;, &quot;[$Tf] FR: $ci Next gateway $fU -&gt; $tU via $rd \n&quot; );<br><br>                t_on_failure(&quot;2&quot;);<br>
<br>                if( !t_relay() ){<br>                        xlog( &quot;L_WARN&quot;, &quot;[$Tf] FR: $ci -- ERROR - Cannot t_relay() -- $fU -&gt; $tU via $rd\n&quot; );<br>                        return;<br>                        }<br>
                return;<br>        } else {<br>                xlog( &quot;L_WARN&quot;, &quot;[$Tf] FR: $ci No more gateways -&gt; 503.\n&quot; );<br>                t_reply(&quot;503&quot;, &quot;Service unavailable -- no more gateways&quot; );<br>
                return;<br>                }<br><br>        }<br><br> - Jock<br><br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div class="h5">
On Thu, Apr 1, 2010 at 11:20 AM, Jock McKechnie<br>
&lt;<a href="mailto:jock.mckechnie@gmail.com">jock.mckechnie@gmail.com</a>&gt; wrote:<br>
&gt; Greetings all;<br>
&gt;<br>
&gt; I&#39;m attempting to set up a fail-over only scenario using dispatcher and am<br>
&gt; encountering some problems. I&#39;m using dispatcher since we&#39;re already<br>
&gt; utilising it for load balancing, so it makes sense to reuse the tool, and<br>
&gt; according to the OpenSIPS 1.6 dispatcher module documentation it supports<br>
&gt; fail-over.<br>
&gt;<br>
&gt; If the destination server is running, everything works as expected - algo 8<br>
&gt; (which OpenSIPS logs as not found and defaulting to the first entry) pushes<br>
&gt; the call to the first server at all times. However if I block the route to<br>
&gt; the destination server like so:<br>
&gt; /sbin/route add -host 192.168.0.99 reject<br>
&gt; Then instead of failing over I get a SIP 477 (Send failed) error.<br>
&gt;<br>
&gt; The chunk of routing looks like so:<br>
&gt;<br>
&gt; xlog(&quot;L_WARN&quot;, &quot;[$Tf] Found failover, working on set: 1101\n&quot;);<br>
&gt; if (!ds_select_domain(&quot;1101&quot;, &quot;8&quot;)) {<br>
&gt;     t_reply(&quot;503&quot;, &quot;Unable to locate failover set requested&quot;);<br>
&gt;     return;<br>
&gt;     };<br>
&gt;<br>
&gt; route(1);<br>
&gt; };<br>
&gt;<br>
&gt; route[1] {<br>
&gt; t_on_failure(&quot;2&quot;);<br>
&gt;<br>
&gt; xlog(&quot;L_WARN&quot;, &quot;Attempting to relay call to $ru\n&quot;);<br>
&gt;<br>
&gt; if (!t_relay()) {<br>
&gt;     xlog(&quot;L_WARN&quot;, &quot;[$Tf] t_relay fail\n&quot;);<br>
&gt;     return;<br>
&gt;     }<br>
&gt; return;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; The log contains:<br>
&gt; [Thu Apr  1 11:14:35 2010] Found failover, working on set: 1101<br>
&gt; WARNING:dispatcher:ds_select_dst: algo 8 not implemented - using first<br>
&gt; entry...<br>
&gt; Attempting to relay call to <a href="http://sip:+12125551212@192.168.0.99:5060" target="_blank">sip:+12125551212@192.168.0.99:5060</a><br>
&gt; ERROR:core:udp_send: sendto(sock,0xb3b9bd28,1039,0,0xb3ba2cf4,16): Network<br>
&gt; is unreachable(101)<br>
&gt; ERROR:tm:msg_send: udp_send failed<br>
&gt; ERROR:tm:t_forward_nonack: sending request failed<br>
&gt; [Thu Apr  1 11:14:35 2010] Found failover, working on set: 1101<br>
&gt; WARNING:dispatcher:ds_select_dst: algo 8 not implemented - using first<br>
&gt; entry...<br>
&gt; Attempting to relay call to <a href="http://sip:+12125551212@192.168.0.99:5060" target="_blank">sip:+12125551212@192.168.0.99:5060</a><br>
&gt;<br>
&gt; This suggests to me that instead of failing over it&#39;s simply retrying the<br>
&gt; first entry, which it shouldn&#39;t be, and after finding it out for a second<br>
&gt; time (and thus exhausting the two-entry set), gives up.<br>
&gt;<br>
&gt; Any thoughts?<br>
&gt;<br>
&gt;  - JP<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
&gt;<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br>