Registered but sqlite database doesn't get updated

Status
Not open for further replies.
Jul 15, 2021
102
9
18
33
Now and then when an user registers, the user is actually registered (as per his staus on the SIP client) but it doesn't get updated on the database, this results in no calls getting routed. If Sqlite is unable to write to database, it should not send an acknowledgement back to the client.

The extension can make outgoing calls but can't receiving incoming calls because of this. As I have a large SIP re-registration as the clients connect on TCP, the issue affects call setup. 2021-09-19 10:35:30.781727 [WARNING] sofia_reg.c:1794 SIP auth challenge (REGISTER) on sofia profile 'internal' for [13@192.168.1.2] from ip 192.168.1.13 2021-09-19 10:35:31.021569 [WARNING] switch_core_db.c:92 SQLite is BUSY, sane=299 [BEGIN EXCLUSIVE] 2021-09-19 10:36:19.941724 [DEBUG] sofia_presence.c:225 Can't find registered user 13@192.168.1.2
 
Jul 15, 2021
102
9
18
33
Let me clarify the debug message posted earlier, I freshly start a SIP client and it tries to register, the sip auth challenge appears on the logs, then the sqlite warning appears. In the SIP client the status is NOW registered.

However when you check the fusionpbx Status-> registrations - the client doesn't appear in the list on the website.

When you try to contact the client (whose registration resulted from sqlite warning), from another properly registered client, the can't find registered user message appears, I have cut down few log messages in between which showed the call attempt.
 
Jul 15, 2021
102
9
18
33
Also it might not have been an issue for others who have low registration time out, I have registration time out of 60 minutes as my clients connect via TCP.

My assumption is that the database gets updated (asynchronously) after the register response has been sent, so if database write fails due to thread racing condition, no re-attempt is being made to update the database.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,388
364
83
OK, I'll run a few tests on our latest test box and see if anything shows up. We too use long-ish registrations times, typically 1800 seconds and UDP. I have seen the SQLite warning but registration have always been there.

If I ask all the phones on a 2 or 3 hundred extension site to reboot, I will generally see the SQLite warning as all the extensions try to register more or less at the same time. But they do all register!
 
Jul 15, 2021
102
9
18
33
In my case there was no simultaneous registration, it was just one client trying to register, there were no active calls on the server, practically no load, except that I was watching fusionpbx webconsole. So it may be the website code which locks up database rather than registering sip clients.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,388
364
83
Noted. Just curious, have you done a full packet capture on the registration process for this device, just to prove it is not successfully registering and then unregistering for some unknown reason?
 
Status
Not open for further replies.