<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Hi Vlad,<br><br>Thanks for your response. There was a problem with one of the asterisk configurations and it was replying with 404 (not found). I fixed it, the reply codes are 200 now, and everything is running fine.<br>However, case 3 below confuses me a little:<br>1. When there was no response from Asterisk (Asterisk not running), the node was set to Pending. (as expected)<br>2. When I started asterisk, the node still showed Pending because the reply code wasn't 200, but 404. (as expected)<br>3. At Opensips start, if Asterisk was running, the node was set to Active even if the reply code was 404. (?)<br><br>Anyway, the problem is gone. Thanks again.<br>Matt<br><br><br><br><div><hr id="stopSpelling">Date: Fri, 25 Nov 2011 12:23:22 +0200<br>From: vladpaiu@opensips.org<br>To: users@lists.opensips.org<br>Subject: Re: [OpenSIPS-Users] dispatcher - not getting out of Pending mode<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<title></title>
Hello,<br>
<br>
What reply code doe the Asterisk replies have ? <br>
If it's not 200 Ok, you might want to check out the
options_reply_codes parameter [1] .<br>
<br>
[1]
<a class="ecxmoz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id292810" target="_blank">http://www.opensips.org/html/docs/modules/devel/dispatcher.html#id292810</a><br>
<br>
Regards,<br>
<pre class="ecxmoz-signature">Vlad Paiu
OpenSIPS Developer</pre>
<br>
On 11/25/2011 05:12 AM, Matt Hamilton wrote:
<blockquote cite="mid:BAY170-W869CCB06A79012CDD96284B3CF0@phx.gbl">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</style>
<div dir="ltr">
<br>
I'm testing dispatcher with failover (tesitng both
probing_modes: automatic with 1, and 0 with failure_route).
Opensips is dispatching calls to 2 Asterisk servers. If I stop
one of the Asterisk servers, that node becomes Pending as
expected, but when I restart the node, it doesn't turn Active
again.<br>
<br>
Here is my test: <br>
<br>
<br>
1. I start Opensips with both Asterisk nodes Active (Asterisk is
running on both servers)<br>
ds_list ( opensipsctl fifo ds_list) shows both nodes Active<br>
<br>
2. I stop Asterisk in Server B<br>
ds_list shows 2nd node as "P" pretty much right away for mode 1,
and after the 1st failed request comes for mode 2<br>
So far, everything is OK<br>
<br>
3. I start Asterisk in server B<br>
ds_list still shows Server B as Pending (both for mode 1 and 2);
however, it never goes back to Active unless I restart Opensips<br>
<br>
<br>
If I start Opensips when one of the nodes Pending (Asterisk
off), and later start Asterisk on that node, ds_list still
doesn't report it Active.<br>
<br>
<br>
The log (debug=4) shows both nodes sending the <OPTION>
reply, but for some reason ds_list doesn't reflect that, and
ds_select_dst ignores the new "active" node.<br>
<br>
<br>
Any suggestions? I'm pretty sure I'm missing something very
simple.<br>
<br>
<br>
Below is my code. <br>
<br>
Thanks,<br>
Matt<br>
<br>
<br>
<br>
<br>
###############################################################################################<br>
<br>
# gateways<br>
1 sip:10.0.1.128:5060<br>
1 sip:10.0.1.129:5060<br>
<br>
<br>
<br>
###############################################################################################<br>
<br>
modparam("dispatcher",
"list_file","/usr/local/etc/opensips/dispatcher.list")<br>
modparam("dispatcher", "flags", 2) <br>
modparam("dispatcher", "dst_avp", "$avp(271)")<br>
modparam("dispatcher", "grp_avp", "$avp(272)")<br>
modparam("dispatcher", "cnt_avp", "$avp(273)")<br>
modparam("dispatcher", "hash_pvar", "$si") <br>
modparam("dispatcher", "ds_ping_method", "OPTIONS")<br>
modparam("dispatcher", "ds_ping_interval", 1) <br>
modparam("dispatcher", "ds_probing_mode", 0) <br>
modparam("dispatcher", "ds_probing_threshhold", 1) <br>
<br>
modparam("tm", "fr_timer", 3)<br>
<br>
<br>
<br>
route{<br>
if (!ds_is_in_list("$si", "$sp")) { /* if it's not
asterisk replying back to opensips */<br>
t_on_failure("1");<br>
ds_select_dst("1", "7"); <br>
}<br>
route(1);<br>
}<br>
<br>
route[1] {<br>
if (!t_relay()) {<br>
sl_reply_error();<br>
};<br>
exit;<br>
}<br>
<br>
<br>
failure_route[1]{<br>
if (t_was_cancelled()) {<br>
exit;<br>
}<br>
if (t_check_status("408")) {<br>
ds_mark_dst("p");<br>
<br>
t_on_failure("1"); <br>
ds_next_dst();<br>
route(1);<br>
}<br>
}<br>
<br>
<br>
###############################################################################################<br>
<br>
</div>
<pre><fieldset class="ecxmimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="ecxmoz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="ecxmoz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users</div>                                            </div></body>
</html>