[Serdev] Weight and prefix/strip column in the lcr table
Francesco Bottà
francesco.botta at eutelia.it
Wed Mar 9 11:18:53 UTC 2005
Hi Andreas,
I've patched your lcr.diff with lcr_mod.c and I've adjusted ser_mysql.sh script with the new table gw_cap. Everything compiles, but SER crash.
Below some info useful for troubleshooting:
root at rmlnx-sipexp:/# ser -V
version: ser 0.9.1 (i386/linux)
flags: STATS: Off, EXTRA_DEBUG, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
@(#) $Id: main.c,v 1.197 2004/12/03 19:09:31 andrei Exp $
main.c compiled on 11:54:46 Mar 9 2005 with gcc 3.3
Here the output of backtrace (gdb /usr/local/sbin/ser core)
#0 0x400ab613 in strlen () from /lib/libc.so.6
(gdb) bt
#0 0x400ab613 in strlen () from /lib/libc.so.6
#1 0x40387995 in load_cap_gws (_m=0x812d448, cap=0x0, _s2=0x0) at lcr_mod.c:764
#2 0x403870a6 in load_gws (_m=0x812d448, cap=0x0, _s2=0x0) at lcr_mod.c:614
#3 0x0804fd99 in do_action (a=0x811d138, msg=0x812d448) at action.c:610
#4 0x08050257 in run_actions (a=0x811d138, msg=0x812d448) at action.c:718
#5 0x0806d7c4 in eval_elem (e=0x811d168, msg=0x812d448) at route.c:605
#6 0x0806d9f1 in eval_expr (e=0x811d168, msg=0x812d448) at route.c:654
#7 0x0806dac4 in eval_expr (e=0x811d198, msg=0x812d448) at route.c:670
#8 0x0804fc99 in do_action (a=0x811d3d8, msg=0x812d448) at action.c:586
#9 0x08050257 in run_actions (a=0x811cfb8, msg=0x812d448) at action.c:718
#10 0x0804f2ad in do_action (a=0x81175c8, msg=0x812d448) at action.c:375
#11 0x08050257 in run_actions (a=0x8117598, msg=0x812d448) at action.c:718
#12 0x0804fd2c in do_action (a=0x8117e68, msg=0x812d448) at action.c:600
#13 0x08050257 in run_actions (a=0x8117e68, msg=0x812d448) at action.c:718
#14 0x0804fd62 in do_action (a=0x8117e98, msg=0x812d448) at action.c:603
#15 0x08050257 in run_actions (a=0x8117e98, msg=0x812d448) at action.c:718
#16 0x0804fd62 in do_action (a=0x8117ec8, msg=0x812d448) at action.c:603
#17 0x08050257 in run_actions (a=0x8117ec8, msg=0x812d448) at action.c:718
#18 0x0804fd62 in do_action (a=0x8117ef8, msg=0x812d448) at action.c:603
#19 0x08050257 in run_actions (a=0x8117ef8, msg=0x812d448) at action.c:718
#20 0x0804fd2c in do_action (a=0x8118288, msg=0x812d448) at action.c:600
#21 0x08050257 in run_actions (a=0x81166f8, msg=0x812d448) at action.c:718
#22 0x0804fd2c in do_action (a=0x81182b8, msg=0x812d448) at action.c:600
#23 0x08050257 in run_actions (a=0x8112088, msg=0x812d448) at action.c:718
#24 0x0806a993 in receive_msg (
buf=0x80d5140 "INVITE sip:05751944945 at sipexp.voip.eutelia.it SIP/2.0\r\nVia: SIP/2.0/UDP 62.94.49.72:5060;branch=z9hG4bK-stt-311\r\nFrom: 0662293702 <sip:0662293702 at sipexp.voip.eutelia.it:5060>;tag=hXP-32069\r\nTo: <sip:0"..., len=1028, rcv_info=0xbffff6a0) at receive.c:165
#25 0x0807df3a in udp_rcv_loop () at udp_server.c:458
#26 0x0805beb5 in main_loop () at main.c:1032
#27 0x0805d0c7 in main (argc=2, argv=0xbffff7e4) at main.c:1568
(gdb)
MYSQL Section:
mysql> select * from lcr;
+--------+----------+--------+----------+
| prefix | from_uri | grp_id | priority |
+--------+----------+--------+----------+
| % | % | 1 | 1 |
+--------+----------+--------+----------+
mysql> select * from gw;
+------------+------------+------+--------+
| gw_name | ip_addr | port | grp_id |
+------------+------------+------+--------+
| sipgw01-rm | 2563857982 | 5060 | 1 |
| sipgw02-rm | 2580635198 | 5060 | 1 |
+------------+------------+------+--------+
2 rows in set (0.00 sec)
mysql> select * from gw_grp;
+--------+----------+--------+
| grp_id | grp_name | cap_id |
+--------+----------+--------+
| 1 | postpaid | 1 |
+--------+----------+--------+
1 row in set (0.01 sec)
mysql> select * from gw_cap;
+--------+-----------+------------+-----------------+
| cap_id | cap_value | cap_prefix | cap_description |
+--------+-----------+------------+-----------------+
| 1 | 1 | 491 | Postpaid_trunk |
+--------+-----------+------------+-----------------+
1 row in set (0.00 sec)
and below a snippet of my ser.cfg related to LCR operations:
# Comment if Call Type Checking is performed on SPS
consume_credentials();
if (!load_gws()) {
sl_send_reply("500", "Internal server error, Cannot load gateways");
break;
};
if (!next_gw()) {
sl_send_reply("503", "Service not available - No gateways");
break;
};
setflag(2);
# CLIP is default
remove_hf("Remote-Party-ID");
# Comment if CLIP/CLIR is managed on SPS
append_rpid_hf("<", ">;party=calling;id-type=subscriber;screen=yes;privacy=off");
append_hf("P-hint: Call_From_Postpaid_User\r\n");
t_on_failure("1");
t_relay();
break;
What is wrong??
Many thanx
Verbal
----- Original Message -----
From: "Andreas Granig" <andreas.granig at inode.info>
To: "Francesco Bottà" <francesco.botta at eutelia.it>
Cc: <serdev at lists.iptel.org>; <jh at lohi.tutpro.com>
Sent: Tuesday, March 08, 2005 2:55 PM
Subject: Re: [Serdev] Weight and prefix/strip column in the lcr table
> Francesco Bottà wrote:
> > I've a question regarding your great module (lcr). Is it possible to add 3 new columns to lcr table, where the first take into account the weight of the single gateway (some gateway with T1/E1, some others with BRI and so on) and the second and the third columns can change the R-URI (prefix and strip some digits from the user part) before the calls is being relayed...?!?
>
> Since we do set the bearer capability based on prefixes on our gateways,
> I've spent some time extending the lcr module (the 0.9.0-backport), see
> http://lists.iptel.org/pipermail/serusers/2005-March/016397.html
>
> It basically does the things you described except stripping digits from
> ruri-user.
>
> Andy
More information about the Serdev
mailing list