[SR-Users] dmq_usrloc, usrloc:db_mode 3, and PostgreSQL

Alex Balashov abalashov at evaristesys.com
Fri Dec 15 20:31:06 CET 2017


Hi,

Running bleeding-edge branch 5.1 clone here.

dmq_usrloc replication works fine when using in-memory only backing for
the underlying usrloc module, i.e. db_mode 0. I haven't tried mode 1 and
mode 2.

I use mode 3, so that contacts are immediately persisted straight to a
local database. The database flavour is PostgreSQL in this case.

When new contacts replicated via dmq_usrloc come in, I get this in the
Kamailio log:

Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: <core> [db.c:465]: db_use_table(): invalid parameter value
Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: usrloc [udomain.c:817]: db_load_urecord_by_ruid(): failed to use table location
Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: WARNING: dmq_usrloc [usrloc_sync.c:147]: delete_contact(): AOR/Contact not found
Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: <core> [db.c:465]: db_use_table(): invalid parameter value
Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: usrloc [udomain.c:817]: db_load_urecord_by_ruid(): failed to use table location
Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: WARNING: dmq_usrloc [usrloc_sync.c:147]: delete_contact(): AOR/Contact not found

I added some code to lib/srdb1/db.c to print the parameter name and the
location being passed to db_use_table():

  */
 int db_use_table(db1_con_t* _h, const str* _t)
 {
+       LM_ERR("DB handle = %p\n", _h);
+
        if (!_h || !_t || !_t->s) {
-               LM_ERR("invalid parameter value\n");
+               LM_ERR("invalid parameter value %.*s\n", _t->len, _t->s);
                return -1;
        }

And got this:

Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: <core> [db.c:462]: db_use_table(): DB handle = (nil)
Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: <core> [db.c:465]: db_use_table(): invalid parameter value location
Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: usrloc [udomain.c:631]: db_load_urecord(): failed to use table location
Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: <core> [db.c:462]: db_use_table(): DB handle = (nil)
Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: <core> [db.c:465]: db_use_table(): invalid parameter value location
Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: usrloc [ucontact.c:679]: db_insert_ucontact(): sql use_table failed
Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]: ERROR: usrloc [urecord.c:582]: insert_ucontact(): failed to insert in database

So, it appears the DB handle being passed here is NULL is in this
situation.

The same AOR is present in 'ul.dump' RPC command when using db_mode 0. 

Please advise? :)

-- Alex

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list