[SR-Users] issue with usr_loc db_mode

Henry Fernandes henry at usinternet.com
Thu May 8 18:20:08 CEST 2014


There are no errors in the log about this.  

Yesterday, I tried db_mode=2 (with default 'timer_interval' of 60 seconds) and it's better now, although still not working properly.  There are still some records that are not in the 'location' table in the database.

For example, I have a phone that has a registration expirations are set to 1 hour (3600 seconds).  Currently, this record is not in the database however "kamctl ul show" shows the following:

AOR:: phoneUsername
	Contact:: sip:phoneUsername at a.b.c.d:62544 Q=
		Expires:: 3123
		Callid:: f1e0aa72-eb0d28e2-c3737132 at 10.1.0.14
		Cseq:: 52
		User-agent:: PolycomVVX-VVX_500-UA/4.1.6.4835
		State:: CS_SYNC
		Flags:: 0
		Cflag:: 0
		Socket:: udp:a.b.c.d:5060
		Methods:: 8159
		Ruid:: uloc-536a9e57-3137-2
		Reg-Id:: 0

In other words, it's been more than 60 seconds but the database is not up to date.  This is similar to what I see with db_mode=1.  In that case, the database is often missing more than 50% of the registered phones.

Here are the parameters I'm using for the USRLOC module.

modparam("usrloc", "db_url", WRITE_DBURL)
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "use_domain", 0)

-H


On 2014-05-08, at 1:00 AM, Daniel-Constantin Mierla <miconda at gmail.com> wrote:

> Hello,
> 
> any db_mode>0 in 3.3 is safe for not losing registrations upon kamailio restart (e.g., db_mode=2 writes to db on time and at shutdown, so nothing is lost as well). db_mode=1 should do that in realtime, indeed.
> 
> I'm not aware of any issue with db_mode=1, being used in quite some deployments. Can you check the syslog to see if there is any error reported there?
> 
> If you use mysql, then you can enable logging the queries and then check if for each registration there is a mysql query to insert/update/delete a record.
> 
> Cheers,
> Daniel
> 
> On 08/05/14 00:08, Henry Fernandes wrote:
>> I'm using Kamailio 3.3 and the USRLOC module to track registrations.  I have set "db_mode" to 1 because I want to store all registration info to the database and I want the database to be up to date (in case I need to restart Kamailio).
>> 
>> Unfortunately, this doesn't work as I expect.  When I query the database, it has far fewer entries in the "location" table than are registered to Kamailio (which I find with a "kamctl ul show").  Also, when I restart Kamailio, I lose some of the registrations for my phones.
>> 
>> Am I misunderstanding the behaviour for db_mode=1?  Isn't it supposed to keep the database up to date?
>> -H
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> 
> -- 
> Daniel-Constantin Mierla - http://www.asipto.com
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> 
> 
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




More information about the sr-users mailing list