Manually editing the AstDB

I am using a bash script to initialize some parameters in AstDB. The other day I had some problems with the input parameters and some strange looking parameters were saved in the AstDB. This is an example:

/CFWD/Unc                           : 0                        
/DND                                    : 0                        
/usr/201/CFWD/Unc               : 0                        
/usr/201/DID                          : 123455     
/usr/201/DND                         : 0                        
/usr/202/CFWD/Unc                : 0                        
/usr/202/DID                           : 123456              
/usr/202/DND                          : 0                 

The script basically initiates some parameters that are accessible via /usr/ext_num/. As you can see, the first two parameters are a bit odd.

The problem that I have is that the command “database show usr” also prints out the entrys:

/CFWD/Unc                           : 0                        
/DND                                    : 0         

I do not know why this happens. As I said, the init script should initiate all the parameters in a form /usr/ext_num/. I think that the problem for the two parameters at hand is that there were some problems with the value of the extension pameter when data about the extension was typed in (backspace key was not working ok and printed out some strange characters that were saved in the input variable).

The second problem is that I can not delete the two entrys from the AstDB via Asterisk CLI (commands “database deltree CFWD” and database deltree DND" do not delete the entrys). Probably the “database deltree usr” would delete the problematc entrys, but will delete all other entrys also.

So the questions is - is there any possibility to manually edit the AstDB via editing the /var/lib/asterisk/astdb? What happens if I manually delete the /var/lib/asterisk/astdb file from the system?

Any other advice would also come in very handy :wink:

It will be recreated, empty, if you delete it. If you haven’t stored anything important in it, that should be safe.

Great thanks for the tip.

Any ideas on how to manually edit the AstDB so I get rid of the dodgy entrys? I hope that the AstDB delete is not the only way to go :smile: