[SR-Users] db_redis and user

Joan Salvatella joan at bookline.io
Mon Apr 1 12:46:24 CEST 2019


Hi Andrew,

 

Unfortunately it wasn’t this parameter. It turns out that the default schema shipped with db_redis stores the values as timestamp but retrieves them as integers despite this parameter. I have issued a bug in Github to let them know about it.

 

Thanks! 

 

From: Andrew White <andrew at uconnected.com.au>
Date: Sunday, 31 March 2019 at 08:08
To: "Kamailio (SER) - Users Mailing List" <sr-users at lists.kamailio.org>
Cc: <joan at bookline.io>, Fede Buldin <fede at bookline.io>
Subject: Re: [SR-Users] db_redis and user

 

Hi Joan,

 

My guess is you’re providing a string value from the phones/terminals, rather than an integer value.

 

 9(39) ERROR: <core> [db_ut.c:92]: db_str2int(): Unexpected characters: [-03-29 18:16:36]

 9(39) ERROR: <core> [db_val.c:76]: db_str2val(): error while converting integer value from string

 9(39) ERROR: db_redis [redis_dbase.c:1062]: db_redis_convert_row(): Failed to convert redis column 'expires' to db value

 

I’m guessing the string given is “2019-03-29 18:16:38”. I don’t know the location DB well in Kamailio, but I’d guess this is meant to be an epoch timestamp.

 

I’ve not really ever used usrloc, but having a look, I’d say maybe you need to set the “expires_type” value in the module? https://www.kamailio.org/docs/modules/devel/modules/usrloc.html#usrloc.p.expires_type

 

Someone who knows USRLOC could probably confirm this!

Best of luck fellow Redis user!

________________________________

Andrew White - Director
uConnected
Email: andrew at uconnected.com.au
Web: www.uConnected.com.au



On 30 Mar 2019, at 5:17 am, Joan Salvatella <juansalvatella at gmail.com> wrote:

 

Hello,

 

We are working on a project that's using two active-active Kamailio 5.2 instances that redirect traffic to several Asterisk 15.4 instances. Kamailio is acting as a registrar and should store the location information of the registered terminals. The backend database is db_redis.

 

Phone terminals get registered and the information gets looked up from the subscriber schema in redis (That's cool) but we are having problems with the locations. This is the related code:

 

modparam("db_redis", "keys", "location=entry:ruid&usrdom:username,domain&timer:partition,keepalive")

 

if(ds_is_from_list("1", "2", "sip:$fd:5080")) {

    record_route();

    route(INVITE_ASTERISK);

    exit;

}

 

route[INVITE_ASTERISK] {

    xlog("L_INFO", "[R-INVITE-RESOLVER:$ci] Entering ASTERISK INVITE resolver\n");

    if (!lookup("location")) {

                                sl_send_reply("404", "User Not Found");

                                return;

                }

    route(INVITE_POSTROUTE);

}

 

route[INVITE_POSTROUTE] {

   rtpproxy_manage();

   t_on_reply("MAIN_REPLY");

 

    if(!t_relay()) 

                                sl_reply_error();

}

 

When looking up the location schema this errors appear:

 

9(39) WARNING: db_redis [redis_dbase.c:1098]: db_redis_perform_query(): performing full table scan on table 'location' while performing query

 9(39) WARNING: db_redis [redis_dbase.c:1101]: db_redis_perform_query():   scan key 0 is 'expires'

 9(39) WARNING: db_redis [redis_dbase.c:1101]: db_redis_perform_query():   scan key 1 is 'expires'

 9(39) ERROR: <core> [db_ut.c:92]: db_str2int(): Unexpected characters: [-03-29 18:16:36]

 9(39) ERROR: <core> [db_val.c:76]: db_str2val(): error while converting integer value from string

 9(39) ERROR: db_redis [redis_dbase.c:1062]: db_redis_convert_row(): Failed to convert redis column 'expires' to db value

 9(39) ERROR: db_redis [redis_dbase.c:1231]: db_redis_perform_query(): Failed to convert redis reply for row

 9(39) ERROR: db_redis [redis_dbase.c:1243]: db_redis_perform_query(): failed to perform the query

 9(39) ERROR: db_redis [redis_dbase.c:1829]: db_redis_query(): failed to do the query

 9(39) ERROR: usrloc [udomain.c:981]: udomain_contact_expired_cb(): db_query failed

 

Any hints?

 

Thanks and regards,

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190401/2a05361f/attachment.html>


More information about the sr-users mailing list