AMPUSER database empty for extension

I didn’t found this problem on forum so decided to write.

Asterisk 13.22.0

One extension we have occured to not screen outboundcid when calling outside. I don’t know it was from beginning or from moment in time. Just got this incident now. Everything works fine for this user, calls, cdrs etc.
Problem is in the database. When i connect to sqlite database and select from astdb for AMPUSER/60886 i see all the variables:

/AMPUSER/60886/outboundcid|xxxxxxxxxx (changed fo Xes to hide)
/AMPUSER/60886/cidname|User 60886

but when i type in Asterisk CLI> database show AMPUSER/60886
I see only one line:

/AMPUSER/60886/accountcode : 60050
1 results found.

For all other extension I see full configuration after typing database show AMPUSER/XXXXX. Only this one has a problem. Deleting and Creating this number again doesn’t help. The same situation. So I suppose Asterisk can’t see /AMPUSER/60886/outboundcid|xxxxxxxxxx and does not present this number outside. Call logs suggest the same.

Only difference I see in configuration for this extension is that “Internal Automatic Answer” (I translate from polish) isn’t set neither ‘Off’ nor ‘Intercom’. In all others I have ‘Off’. Here I can’t change this. After Submit and Reload configuration it stays the same.

Anyone can help? Any suggestions?

Try repairing the DB?

A word from a veteran, Never EVER use the sqlite3 client to connect to astdb.sqlite3 while asterisk is running, the asterisk code is ‘thread safe’ but not ‘multiuser’ aware and your database WILL, sooner or later, get locked in an unresolvable state , even for read-only ops (BTDT :wink: )

The Asterisk database shell has " database query '. . . ’ " which wraps such as you are doing safely, start with

database query "select * from astdb "

Thanks for that! Didn’t think about this danger about sqlite3 and asterisk!

after typing:

database query “select * from astdb where key like ‘/AMPUSER/60886%’;”

asterisk shows all the variables perfectly in CLI. But after:

database show AMPUSER/60886

shows only one line:
/AMPUSER/60886/accountcode : 60050

Is my only solution repairing the DB as PitzKey suggest?

sqlite3 ‘repair’ is pretty well ;limited to dumping, deleting and then importing

Look carefully for missing ‘/’ when using ‘families’ , the database grew into sqlite3 from ‘berkely’ which is very simplistic in nature lacking any ‘relations’ between tables to be repaired

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.