Well, after 12 hours at this, my brain hurts.
Andreas, I've been trying to get the lcr module to work.
I'd really appreciate some pointers or help. :)
OpenSER is not attempting to contact the second gw. It just sits there forever trying to
connect to the first. I even tried setting fr_inv_timer, but it has no effect. The
openser.cfg is probably full of errors too, but I can definitely see it trying to connect
to the first gw, and it never tries the second. I purposely shut Asterisk down on the
first.
Here's my mysql database tables:
mysql> select * from lcr;
+--------+----------+--------+----------+
| prefix | from_uri | grp_id | priority |
+--------+----------+--------+----------+
| | % | 1 | 1 |
| | % | 2 | 2 |
+--------+----------+--------+----------+
2 rows in set (0.00 sec)
mysql> select * from gw;
+-----------+--------+-----------+------+------------+-----------+--------+
| gw_name | grp_id | ip_addr | port | uri_scheme | transport | prefix |
+-----------+--------+-----------+------+------------+-----------+--------+
| asterisk1 | 1 | 369797312 | 5060 | 1 | 1 | |
| asterisk2 | 2 | 386574528 | 5060 | 1 | 1 | |
+-----------+--------+-----------+------+------------+-----------+--------+
2 rows in set (0.00 sec)
And here's the relevant snippets from openser.cfg:
modparam("lcr","fr_inv_timer",1)
# Standard openser.cfg down to here
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
};
# I added the line below
route(2);
# More standard openser.cfg lines
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
append_hf("P-hint: usrloc applied\r\n");
#I added the route[2] block
route[2] {
if (!load_gws()) {
sl_send_reply("500", "Server Internal Error - Cannot load
gateways");
xlog ("L_INFO","Not found");
return;
} else {
xlog ("L_INFO","Gateways loaded");
}
if (!next_gw()) {
sl_send_reply("503", "Service not available, no gateways
found");
xlog ("L_INFO","No more gateways");
return;
} else {
xlog ("L_INFO","Found a gateway");
}
xlog ("L_INFO","Calling t_relay");
t_on_failure("2");
t_relay();
exit;
}
failure_route[2]
{
if(method == "INVITE" && t_check_status("408|500|503"))
{
if (!next_gw())
{
t_reply("503", "Service not available, no more gateways");
return;
}
t_on_failure("2");
t_relay();
}
}
-----Original Message-----
From: Andreas Granig [mailto:andreas.granig@inode.info]
Sent: Thu 11/24/2005 5:24 PM
To: Douglas Garstang
Cc: users(a)openser.org
Subject: Re: [Users] Dispatcher module - Does it actually work?
Douglas Garstang wrote:
Andy, no. No one has suggested using the lcr module,
and I wasn't even aware of it until you mentioned it just now. I took a look at the
module docs, they're way beyond my current understanding. it. I'll have to do some
reading. Does it allow you to try another route when one is not responding?
Yes. You have to define a set of destinations which you can load in the
script using load_gws(), and every call to next_gw() sets the ip/port of
another destination as ruri, until no more destinations are available.
You can find an example here:
http://linguin.org/ser/lcr_cap/lcr_config_example.txt
It's for a lcr-version which I have extended a little to be able to
group destinations according to their capabilities
(
http://linguin.org/ser.php#lcr-cap), but you should at least get the
idea on how to do it with the vanilla lcr module (just leave out the
argument in load_gws()).
Andy