AMPUSER database empty for extension


(Sebastian) #1

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

FreePBX 14.0.5.25
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/rvolume|
/AMPUSER/60886/password|1111
/AMPUSER/60886/ringtimer|0
/AMPUSER/60886/cfringtimer|0
/AMPUSER/60886/concurrency_limit|3
/AMPUSER/60886/noanswer|
/AMPUSER/60886/recording|
/AMPUSER/60886/outboundcid|xxxxxxxxxx (changed fo Xes to hide)
/AMPUSER/60886/cidname|User 60886
/AMPUSER/60886/cidnum|60886
/AMPUSER/60886/voicemail|novm
/AMPUSER/60886/intercom|enabled
/AMPUSER/60886/recording/in/external|dontcare
/AMPUSER/60886/recording/out/external|dontcare
/AMPUSER/60886/recording/in/internal|dontcare
/AMPUSER/60886/recording/out/internal|dontcare
/AMPUSER/60886/recording/ondemand|disabled
/AMPUSER/60886/recording/priority|10
/AMPUSER/60886/dictate/enabled|disabled
/AMPUSER/60886/dictate/format|ogg
/AMPUSER/60886/dictate/email|
/AMPUSER/60886/dictate/from|ZGljdGF0ZUBmcmVlcGJ4Lm9yZw==
/AMPUSER/60886/language|
/AMPUSER/60886/queues/qnostate|usestate
/AMPUSER/60886/answermode|disabled
/AMPUSER/60886/device|60886
/AMPUSER/60886/answermode|disabled
/AMPUSER/60886/answermode|disabled
/AMPUSER/60886/answermode|disabled
/AMPUSER/60886/answermode|disabled
/AMPUSER/60886/hint|SIP/60886&Custom:DND60886,CustomPresence:60886
/AMPUSER/60886/accountcode|60050

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?


(Itzik) #2

Try repairing the DB?


#3

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 "


(Sebastian) #4

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?


#5

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


(system) closed #6

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