On Sun, 20 Feb 2005, Juha Heinanen wrote:
Java Rockx writes:
If so, can you tell me how I would structure my
failure_route or other
necessary code blocks?
basically you call next_gw() and if that succeeds you set failure route
again and call t_relay.
Hi,
Been trying out the LCR module from CVS (head, checkout today) and I can't
get it to work when the first gateway fails.
Setup:
mysql> select * from lcr;
+--------+----------+--------+----------+
| prefix | from_uri | grp_id | priority |
+--------+----------+--------+----------+
| | % | 1 | 0 |
+--------+----------+--------+----------+
mysql> select * from gw;
+------------------+-----------+------+--------+
| gw_name | ip_addr | port | grp_id |
+------------------+-----------+------+--------+
|
sip-gw.swip.net | 247264386 | 5060 | 1 |
|
sip2-gw.swip.net | 247264385 | 5060 | 1 |
+------------------+-----------+------+--------+
mysql> select * from gw_grp;
+--------+---------------+
| grp_id | grp_name |
+--------+---------------+
| 1 | PSTN Gateways |
+--------+---------------+
sip2-gw.swip.net doesn't exist i.e. requests to it will timeout.
In route{} I have:
if (!load_gws()) {
sl_send_reply("500", "Server Internal Error - Cannot load
gateways");
break;
};
And then calls to PSTN end up in route[4]
route[4]{
if (method=="INVITE" | method=="BYE") {
xlog("L_INFO","Routeblock 4 - Call not to customer, to
gateways\n");
};
t_on_failure("1");
if (!next_gw()) {
sl_send_reply("503", "Service not available - No
gateways");
break;
};
if (!t_relay()) {
sl_reply_error();
};
}
failure_route[1] {
xlog("L_INFO","Failureroute 1 - Get next gateway from
LCR\n");
if (!next_gw()) {
xlog("L_INFO","Failureroute 1 - No more gateways
available\n");
t_reply("503", "Service not available - No more
gateways");
break;
} else {
t_on_failure("1");
t_relay();
};
}
When I call and LCR selects the working gateway first it works ok, but
when it selects the gateway that doesn't exist I get this.
0(7028) Tue Mar 1 08:39:33 2005 - <null> - INVITE
Call-ID: 00036bc3-7aa52432-43a4bc4f-121393fe(a)130.244.194.233
From: sip:0856204081@sip-corporate1.testdomain.com
To: sip:0890510@sip-corporate1.testdomain.com
0(7028) Routeblock 2 - Calls from customers
0(7028) Call from customer: Test
0(7028) Call passed A-number check
0(7028) Routeblock 3 - To customer?
0(7028) Routeblock 4 - Call not to customer, to gateways
1(7032) Failureroute 1 - Get next gateway from LCR
1(7032) BUG: qm_free: bad pointer 0xb57a1bf0 (out of memory block!) - aborting
0(7028) child process 7032 exited by a signal 6
0(7028) core was generated
0(7028) INFO: dont_fork turned on, living on
2(7034) INFO: signal 15 received
0(7028) Thank you for flying ser
I have restarted ser after changing tables in mysql.
Any hints?
Best regard,
Thomas Björklund