Summary:ASTERISK-08332: [patch] allow asterisk database to be used for static configuration for files
Reporter:Tony Zhao (tony zhao)Labels:
Date Opened:2006-12-11 13:57:05.000-0600Date Closed:2011-06-07 14:02:50
Versions:Frequency of
Environment:Attachments:( 0) app_voicemail.svndiff
( 1) ast2astdb.pl
( 2) res_config_astdb.c
Description:Allow asterisk databse to be used for static configuration files.
No realtime is implemented due to the lack of transcation model in the Asterisk database.

This is useful for dynmaically configuring sip, iax, vociemail files through a web interface and issuing an reload through the manager.  For example, users can add their own sip phones through the web.



; Asterisk database static configuration examples
sip.conf => astdb,asterisk
iax.conf => astdb,asterisk
voicemail.conf => astdb,asterisk
test.conf => astdb,asterisk

Please see uploaded file for more info.
Comments:By: Tony Zhao (tony zhao) 2006-12-11 13:58:49.000-0600

Also added perl utility to load config files into database for initialization.

By: Tony Zhao (tony zhao) 2006-12-11 14:04:13.000-0600


Added realtime password writing (when user changes password) to Asterisk Database if the option is set in voicemail.conf.

; Should the voicemail passwords be stored in a database in realtime
; ex. realtimepwd=[database name],[table name]

Currently I don't think the passwords are being written to database if a user changes password, it is hradwired to the files.  I only added it for Asterisk Database, but it should be flexible to extend to odbc, etc...

By: Joshua C. Colp (jcolp) 2006-12-18 20:47:04.000-0600

I have to be honest in that I think this is rather cool... but the real question is - why did you write it? :D

By: Tony Zhao (tony zhao) 2006-12-19 19:56:18.000-0600

For small number of phones that want the functionality of a database but does not want to be bothered with an external database like SQL, ODBC, etc...

A out of box solution...

By: Tilghman Lesher (tilghman) 2007-01-25 17:51:12.000-0600

This code is so thread-unsafe it's not funny.  Please read the manpage for strtok(3).  If you want to do any parsing at all, please use the AST_STANDARD_APP_ARGS() and AST_NONSTANDARD_APP_ARGS() macros and please ast_strdupa() the values before parsing them.

Also, you need to call ast_db_freetree() or else you have a very large memory leak.

The formatting also needs to be fixed.  The indentation is inconsistent.

By: Serge Vecher (serge-v) 2007-03-15 11:07:39

tony, any updates here?

By: Joshua C. Colp (jcolp) 2007-06-27 17:33:30

I'm suspending this issue since it's been quite some time now and there has been no response. If you have an updated patch per Corydon's comments please feel free to reopen with it.