Hello.
After upgrade kamailio and db, lcr module bad routing if entered *any value*to from_uri column in lcr_rule table: mysql> select * from lcr_rule where id=5; +----+--------+--------+-------------------------------+-------------+---------+---------+ | id | lcr_id | prefix | from_uri | request_uri | stopper | enabled | +----+--------+--------+-------------------------------+-------------+---------+---------+ | 5 | 1 | yyyy | sip:x[xx]\d{2}@xxx.xxx.xx.xx | NULL | 0 | 1 | +----+--------+--------+-------------------------------+-------------+---------+---------+ and load_gw(...) skip this rule, in log: INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <1/5>
If remove value from 'from_ui' - rule enabled and all work.
Why is turned off rule ?
Linux Debian squeeze, upgraded from "deb http://deb.kamailio.org/kamailiosqueeze main"
Alexey Mechanoshin writes:
mysql> select * from lcr_rule where id=5; +----+--------+--------+-------------------------------+-------------+---------+---------+ | id | lcr_id | prefix | from_uri | request_uri | stopper | enabled | +----+--------+--------+-------------------------------+-------------+---------+---------+ | 5 | 1 | yyyy | sip:x[xx]\d{2}@xxx.xxx.xx.xx | NULL | 0 | 1 | +----+--------+--------+-------------------------------+-------------+---------+---------+ and load_gw(...) skip this rule, in log: INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <1/5>
the above message comes if enabled rule target cannot be added because rule or gw is disabled.
If remove value from 'from_ui' - rule enabled and all work.
this seems to indicate that rule is not loaded if from_uri is present, but then you should get error message to syslog about bad from_uri.
i cannot say more without trying myself with your records.
-- juha
Hello and whansk for reply. Sorry for my bad english please. My config (working late in 3.2.x and not change): #!define WITH_LCR #!define LCR_RELAY ... #!ifdef WITH_LCR loadmodule "avpops.so" loadmodule "lcr.so" #!endif ... #!ifdef WITH_LCR modparam("lcr", "db_url",DBURL) modparam("lcr", "gw_uri_avp", "$avp(i:709)") modparam("lcr", "ruri_user_avp", "$avp(i:500)") modparam("lcr", "flags_avp", "$avp(i:712)") modparam("lcr", "lcr_id_avp", "$avp(s:lcr_id_avp)") #!endif ... request_route { xlog("L_INFO", "New request - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n"); .... # dispatch destinations to PSTN route(PSTN); # LCR route route(LCR); # user location service #route(LOCATION); route(RELAY); .. } # --=== LCR routing ===-- # route[LCR] { xlog("L_INFO","LCR: $rm <$ru>, rU=$rU and fu=$fu\n"); #!ifdef WITH_LCR #xlog("L_INFO", "request uri is <$ru> and\n"); # Будем проверять 'From uri' по базе. if (!load_gws(1, $rU, $fu)) { sl_send_reply("500", "Server Internal Error - Cannot load gateways"); exit; } else { $var(i) = 0; while(is_avp_set("$(avp(i:709)[$var(i)])")) { xlog("L_INFO", "loading gw_uri_avp[$var(i)]='$(avp(i:709)[$var(i)])' and var= $var(i)\n"); $var(i) = $var(i) + 1; } if(is_avp_set("$avp(i:709)")) { xlog("L_INFO", "Trying gateway '$avp(i:709)'\n"); } else { xlog("L_INFO", "No More Gateways …\n"); } # try the first matched gateway if (next_gw()) { xlog("L_INFO", "ruri_user_avp='$avp(i:500)'\n"); # Route to failure for failover #!ifdef LCR_RELAY route(RELAY); #!else route(LCRRELAY); #!endif } else { avp_print(); xlog("L_INFO", "Send back 503 code …\n"); sl_send_reply("503", "No available gateways"); exit; } } #!endif #sl_send_reply("503", "Service Unavailable"); #exit; return; } Try call: INFO: <script>: New request - M=INVITE RURI=sip:5499@192.168.101.50:5070 F= sip:5714@192.168.101.59 T=sip:5499@192.168.101.50:5070 IP=192.168.101.59 ID=99c1c267-3614-1230-1ab3-002655e85348 INFO: <script>: LCR: INVITE sip:5499@192.168.101.50:5070, rU=5499 and fu= sip:5714@192.168.101.59 INFO: <script>: No More Gateways … INFO: <script>: Send back 503 code …
SIP captre invite: *INVITE* sip:5499@192.168.101.50:5070 SIP/2.0 Via: SIP/2.0/UDP 192.168.101.59:5070;rport;branch=*z9hG4bK3cp0XvFZNvpea* Max-Forwards: 69 From: "5714" sip:5714@192.168.101.59;tag=*2BrZF33pQvegB* To: sip:5499@192.168.101.50:5070 Call-ID: *99c1c267-3614-1230-1ab3-002655e85348* CSeq: 29795589 *INVITE* Contact: sip:gw+redfs.proxy@192.168.101.59:5070;transport=udp;gw=redfs.proxy
User-Agent: FreeSWITCH-mod_sofia/1.1.beta1-git-7a147e4 2012-04-25 17-14-55 -0500 Allow: *INVITE*, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY Supported: timer, precondition, path, replaces Allow-Events: talk, hold, refer Content-Type: application/sdp Content-Disposition: session Content-Length: 248 X-CID: 912A0E22-BAA811E1-A590AB83-8626D1EF@192.168.101.9 X-FS-Support: update_display,send_info Remote-Party-ID: "5714" sip:5714@192.168.101.59;party=calling;screen=no;privacy=off
v=0 o=FreeSWITCH 1340238120 1340238121 IN IP4 192.168.101.59 s=FreeSWITCH c=IN IP4 192.168.101.59 t=0 0 m=audio 25186 RTP/AVP 98 101 13 a=rtpmap:98 iLBC/8000 a=fmtp:98 mode=20 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20
And from tables: mysql> select * from lcr_gw ; +----+--------+---------+----------------+----------+------+--------+------------+-----------+-------+--------+------+-------+---------+ | id | lcr_id | gw_name | ip_addr | hostname | port | params | uri_scheme | transport | strip | prefix | tag | flags | defunct | +----+--------+---------+----------------+----------+------+--------+------------+-----------+-------+--------+------+-------+---------+ | 1 | 1 | kaluga | 213.xxx.xxx.26 | NULL | 5060 | NULL | 1 | 1 | NULL | | NULL | 1 | NULL | | 2 | 1 | Kama | 192.168.101.59 | NULL | 5070 | NULL | 1 | 1 | NULL | NULL | NULL | 1 | NULL | | 3 | 1 | kaluga | 213.xxx.xxx.27 | NULL | 5060 | NULL | 1 | 1 | NULL | NULL | NULL | 1 | NULL | +----+--------+---------+----------------+----------+------+--------+------------+-----------+-------+--------+------+-------+---------+ 3 rows in set (0.00 sec)
mysql> select * from lcr_rule where id = 1 or id =5 ; +----+--------+--------+-------------------------------+-------------+---------+---------+ | id | lcr_id | prefix | from_uri | request_uri | stopper | enabled | +----+--------+--------+-------------------------------+-------------+---------+---------+ | 1 | 1 | 5498 | | NULL | 0 | 1 | | 5 | 1 | 5499 | sip:5[78]\d{2}@192.168.101.59 | NULL | 0 | 1 | +----+--------+--------+-------------------------------+-------------+---------+---------+ 2 rows in set (0.00 sec)
mysql> select * from lcr_rule_target; +----+--------+---------+-------+----------+--------+ | id | lcr_id | rule_id | gw_id | priority | weight | +----+--------+---------+-------+----------+--------+ | 1 | 1 | 1 | 1 | 10 | 1 | | 2 | 1 | 2 | 2 | 10 | 1 | | 3 | 1 | 3 | 2 | 10 | 1 | | 4 | 1 | 4 | 2 | 10 | 1 | | 5 | 1 | 5 | 1 | 10 | 1 | | 6 | 1 | 5 | 3 | 20 | 1 | | 7 | 1 | 6 | 1 | 10 | 1 | | 8 | 1 | 7 | 1 | 10 | 1 | | 9 | 1 | 8 | 1 | 10 | 1 | +----+--------+---------+-------+----------+--------+ 9 rows in set (0.00 sec)
Again, if number 549*8* then working:
INFO: <script>: New request - M=INVITE RURI=sip:5498@192.168.101.50:5070 F= sip:5714@192.168.101.59 T=sip:5498@192.168.101.50:5070 IP=192.168.101.59 ID=5e9e83b8-3617-1230-1ab3-002655e85348 INFO: <script>: LCR: INVITE sip:5498@192.168.101.50:5070, rU=5498 and fu= sip:5714@192.168.101.59 INFO: <script>: loading gw_uri_avp[0]='2|1|0|||444443349||5060||1|1' and var= 0 INFO: <script>: Trying gateway '2|1|0|||444443349||5060||1|1' INFO: <script>: ruri_user_avp='5498' INFO: <script>: Manage RtpProxy in route[NATMANAGE] INFO: <script>: Manage RtpProxy in route[NATMANAGE] INFO: <script>: Manage RtpProxy in route[NATMANAGE] INFO: <script>: New request - M=CANCEL RURI=sip:5498@192.168.101.50:5070 F= sip:5714@192.168.101.59 T=sip:5498@192.168.101.50:5070 IP=192.168.101.59 ID=5e9e83b8-3617-1230-1ab3-002655e85348 INFO: <script>: Manage RtpProxy in route[NATMANAGE] INFO: <script>: New request - M=ACK RURI=sip:5498@192.168.101.50:5070 F= sip:5714@192.168.101.59 T=sip:5498@192.168.101.50:5070 IP=192.168.101.59 ID=5e9e83b8-3617-1230-1ab3-002655e85348
2012/6/21 Juha Heinanen jh@tutpro.com
Alexey Mechanoshin writes:
mysql> select * from lcr_rule where id=5;
+----+--------+--------+-------------------------------+-------------+---------+---------+
| id | lcr_id | prefix | from_uri | request_uri | stopper | enabled |
+----+--------+--------+-------------------------------+-------------+---------+---------+
| 5 | 1 | yyyy | sip:x[xx]\d{2}@xxx.xxx.xx.xx | NULL | 0 | 1 |
+----+--------+--------+-------------------------------+-------------+---------+---------+
and load_gw(...) skip this rule, in log: INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <1/5>
the above message comes if enabled rule target cannot be added because rule or gw is disabled.
If remove value from 'from_ui' - rule enabled and all work.
this seems to indicate that rule is not loaded if from_uri is present, but then you should get error message to syslog about bad from_uri.
i cannot say more without trying myself with your records.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Attached.
2012/6/21 Juha Heinanen jh@tutpro.com
Alexey Mechanoshin writes:
And from tables:
i need relevant rows of the tables as sql insert statements so that i can install them easily into my db.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Alexey Mechanoshin writes:
Attached.
with your records in lcr tables, i do not get any syslog message about skipping anything when lcr tables are reloaded. since you did:
INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <1/5>
your tables are not the same.
-- juha
Stange ...
root@r59vredfs:/tmp# /etc/init.d/kamailio restart Restarting Kamailio: loading modules under /usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/ Listening on udp: xx.xxx.xxx.xxx:5060 udp: 192.168.101.50:5070 Aliases: udp: r59vredfs.kama.ocs.ru:5070 kamailio started. In syslog: Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[8313]: ERROR: ctl [ctl.c:379]: ERROR: ctl: could not delete unix socket /tmp/kamailio_ctl: Operation not permitted (1) Jun 21 16:05:21 r59vredfs kamailio: WARNING: <core> [socket_info.c:1392]: WARNING: fix_hostname: could not rev. resolve xx.xxx.xxx.xxx Jun 21 16:05:21 r59vredfs kamailio: INFO: <core> [tcp_main.c:4829]: init_tcp: using epoll_lt as the io watch method (auto detected) Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: usrloc [hslot.c:53]: locks array size 512 Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <1/5> Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <3/5> Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <1/6> Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <1/7> Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <1/8> Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 124928 Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 249856 Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: <core> [udp_server.c:179]: INFO: udp_init: SO_RCVBUF is initially 124928 Jun 21 16:05:21 r59vredfs /usr/sbin/kamailio[9536]: INFO: <core> [udp_server.c:230]: INFO: udp_init: SO_RCVBUF is finally 249856 ... #mqldump openser lcr_gw lcr_rule lcr_rule_target > test2.sql (change only external IP-s) 2012/6/21 Juha Heinanen jh@tutpro.com
Alexey Mechanoshin writes:
Attached.
with your records in lcr tables, i do not get any syslog message about skipping anything when lcr tables are reloaded. since you did:
INFO: lcr [lcr_mod.c:1493]: skipping disabled <gw/rule> = <1/5>
your tables are not the same.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Alexey Mechanoshin writes:
#mqldump openser lcr_gw lcr_rule lcr_rule_target > test2.sql (change only external IP-s)
i tried with test2.sql records and still i do not get any skipping messages to syslog. check that you are using kamailio 3.3.
-- juha
I'm confused... I do not know what is wrong i my system. Ok, full info and full config (change my external IP in bind only).
root@r59vredfs:~# echo $LANG *ru_RU.UTF-8* root@r59vredfs:~# LANG=C ; aptitude show kamailio Package: kamailio State: installed Automatically installed: no Version: 3.3.0+squeeze1 Priority: extra Section: comm Maintainer: Jon Bonilla manwe@aholab.ehu.es ... root@r59vredfs:~# LANG=C ; aptitude show mysql-server Package: mysql-server State: installed Automatically installed: no Version: 5.1.63-0+squeeze1 Priority: optional ...
root@r59vredfs:~# cat /etc/init.d/kamailio | grep DAEMON DAEMON=/usr/sbin/kamailio ... root@r59vredfs:~# /usr/sbin/kamailio -V version: kamailio *3.3.0* (x86_*64*/linux) flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: unknown compiled on 22:18:19 Jun 18 2012 with gcc 4.4.5 root@r59vredfs:~# kamctl mi version Server:: kamailio (3.3.0 (x86_64/linux)) Build:: mi_core.c compiled on 22:38:59 Jun 18 2012 with gcc 4.4.5 Flags:: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES GIT:: unknown root@r59vredfs:~# 2012/6/21 Juha Heinanen jh@tutpro.com
Alexey Mechanoshin writes:
#mqldump openser lcr_gw lcr_rule lcr_rule_target > test2.sql (change only external IP-s)
i tried with test2.sql records and still i do not get any skipping messages to syslog. check that you are using kamailio 3.3.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ok, simple core install, to other host, Debian x64 squeeze from this: http://cdimage.debian.org/debian-cd/6.0.5/amd64/iso-cd/debian-6.0.5-amd64-ne... #aptitude install mysql-server mc Create file and change: root@r59vsipgw:/etc/apt/sources.list.d# cat kamailio.list deb http://deb.kamailio.org/kamailio squeeze main deb-src http://deb.kamailio.org/kamailio squeeze main root@r59vsipgw:/etc/apt/sources.list.d#
and install official kamailo packages: kamailio, kamailio-carrierroute-modules, kamailio-mysql-modules, kamailio-utils-modules, kamailio-xml-modules, kamailio-xmlrpc-modules Create mysql openser dadabase, with all tables, and using test2.sql to insert lcr data. # kamdbctl create # mysql openser < test2.sql # mysqladmin flush-tables
Change *default* kamailio.cfg: #!define WITH_MYSQL ... loadmodule "avpops.so" loadmodule "lcr.so" ... modparam("lcr", "db_url",DBURL) modparam("lcr", "gw_uri_avp", "$avp(i:709)") modparam("lcr", "ruri_user_avp", "$avp(i:500)") ... and if restart kamailio, again skipping from syslog: skipping disabled <gw/rule> = <1/5> skipping disabled <gw/rule> = <3/5> and other :-(
Please help me! PS Attached my testted config
2012/6/21 Alexey Mechanoshin ales999@gmail.com
I'm confused... I do not know what is wrong i my system. Ok, full info and full config (change my external IP in bind only).
root@r59vredfs:~# echo $LANG *ru_RU.UTF-8* root@r59vredfs:~# LANG=C ; aptitude show kamailio Package: kamailio State: installed Automatically installed: no Version: 3.3.0+squeeze1 Priority: extra Section: comm Maintainer: Jon Bonilla manwe@aholab.ehu.es ... root@r59vredfs:~# LANG=C ; aptitude show mysql-server Package: mysql-server State: installed Automatically installed: no Version: 5.1.63-0+squeeze1 Priority: optional ...
root@r59vredfs:~# cat /etc/init.d/kamailio | grep DAEMON DAEMON=/usr/sbin/kamailio ... root@r59vredfs:~# /usr/sbin/kamailio -V version: kamailio *3.3.0* (x86_*64*/linux) flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: unknown compiled on 22:18:19 Jun 18 2012 with gcc 4.4.5 root@r59vredfs:~# kamctl mi version Server:: kamailio (3.3.0 (x86_64/linux)) Build:: mi_core.c compiled on 22:38:59 Jun 18 2012 with gcc 4.4.5 Flags:: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES GIT:: unknown root@r59vredfs:~# 2012/6/21 Juha Heinanen jh@tutpro.com
Alexey Mechanoshin writes:
#mqldump openser lcr_gw lcr_rule lcr_rule_target > test2.sql (change only external IP-s)
i tried with test2.sql records and still i do not get any skipping messages to syslog. check that you are using kamailio 3.3.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- "В связи с отсутствием интереса общественности, конец света отменяется" (с) ? С Уважением, Механошин Алексей
Alexey Mechanoshin writes:
and if restart kamailio, again skipping from syslog: skipping disabled <gw/rule> = <1/5> skipping disabled <gw/rule> = <3/5>
i tried again with your lcr table records (enclosed) and i do not get those skipping messages. i cannot do anything more unless i'm able to reproduce your problem.
-- juha
Hi,
Reviving this old thread, as we ran into the same issue as well. Turned out it was a small glitch in passing a pointer to the size variable to pcre, which was int instead of size_t, potentially causing stack overflows on 64bit machines and messing with the rule_id, so the entry got deactivated.
Richard has commited a fix today in trunk and 3.3, please try again to see if it works now. If not, setting debug=5 and grepping for "lcr" in the logs helps figuring out why the entry gets disabled.
Andreas
On 07/02/2012 08:48 AM, Juha Heinanen wrote:
Alexey Mechanoshin writes:
and if restart kamailio, again skipping from syslog: skipping disabled <gw/rule> = <1/5> skipping disabled <gw/rule> = <3/5>
i tried again with your lcr table records (enclosed) and i do not get those skipping messages. i cannot do anything more unless i'm able to reproduce your problem.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users