Hello,
the prefix_route module was written by SER guys, when Kamailio and SER
were split projects, and it uses what we refer as DB APIv2 (specific for
ser project), while db_cluster implements DB APIv1 (specific for
kamailio project).
From my point of view, it will be easier to add support
for DB APIv1 in
prefix_route module than implementing DB APIv2 in db_cluster. I
think
there very few modules implementing DB APIv2 at this moment (maybe
around 5) and perhaps they should get support for DB APIv1.
Cheers,
Daniel
On 10/10/16 10:05, Martin Nyström wrote:
Hi,
I have an issue when I am unable to get prefix_route to work together
with db_cluster. If I set the db_url manually it works great, pointing
it to a specific database. However we need the redundancy for this module.
Dispatcher uses the same cluster without any issues.
The following are my configuration sets:
# DB CLUSTER (db_cluster.inc)
loadmodule *"db_cluster.so"*
modparam(*"db_cluster"*, *"connection"*,
*"KAMDB01=>mysql://kamailio:password123@192.168.55.10/kamailio"*)
modparam(*"db_cluster"*, *"connection"*,
*"KAMDB02=>mysql://kamailio:password123@192.168.55.11/kamailio"*)
modparam(*"db_cluster"*, *"cluster"*,
*"AccCluster=>KAMDB02=9s9s;KAMDB01=4s4s"*)
modparam(*"db_cluster"*, *"cluster"*,
*"Settings=>KAMDB02=9s9s;KAMDB01=4s4s"*)
# KAMAILIO.CFG (kamailio.cfg)
# PREFIX ROUTE MODPARAM
loadmodule "prefix_route.so"
include_file "db_cluster.inc"
modparam(*"prefix_route"*, *"db_url"*,
*"cluster://Settings"*)
modparam(*"prefix_route"*, *"db_table"*, *"prefix_route"*)
modparam(*"prefix_route"*, *"exit"*, 1)
Syslog output:
Oct10 09:53:03 kamailio01 /usr/local/sbin/kamailio[5225]: ERROR:
<core> [db_cmd.c:122]: db_cmd(): DB driver cluster does not implement
mandatory db_cmd function
Oct10 09:53:03 kamailio01 /usr/local/sbin/kamailio[5225]: ERROR:
<core> [db_cmd.c:168]: db_cmd(): db_cmd: Cannot create db_cmd structure
Oct10 09:53:03 kamailio01 /usr/local/sbin/kamailio[5225]: ERROR:
prefix_route [prefix_route.c:126]: pr_db_load(): prefix_route:
db_load(): db_cmd() failed
Oct10 09:53:03 kamailio01 /usr/local/sbin/kamailio[5225]: :
prefix_route [prefix_route.c:214]: mod_init(): prefix_route: db_load()
failed
Oct10 09:53:03 kamailio01 /usr/local/sbin/kamailio[5225]: ERROR:
<core> [sr_module.c:974]: init_mod(): Error *while*initializing module
prefix_route (usr/local/lib64/kamailio/modules/prefix_route.so)
Oct10 09:53:03 kamailio01 /usr/local/sbin/kamailio[5225]: INFO: <core>
[sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
Ubuntu 14.04LTS
version: kamailio 4.3.6 (x86_64/linux) 105a17
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
SHM_MMAP, PKG_MALLOC, DBG_QM_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 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 105a17
compiled on 10:06:12 Oct 4 2016 with gcc 4.8.4
Thank you.
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Oct 24-26, 2016 -
http://www.asipto.com