[asterisk-users] Deleting AstDB family at start
Danny Nicholas
danny at debsinc.com
Mon Nov 21 11:27:20 CST 2011
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Matt Hamilton
Sent: Sunday, November 20, 2011 1:25 PM
To: asterisk-users at lists.digium.com
Subject: [asterisk-users] Deleting AstDB family at start
Is it possible to delete the keys belonging to a family in AstDB at Asterisk
startup? I would like to repopulate it from another source each time
Asterisk is restarted.
I know there is a DBdeltree(<family>) function. Is there a context that only
runs once (automatically) at Asterisk startup (so that I can call this
function)?
Also is AstDB lookup faster than a func_odbc lookup? Is there a faster way
to perform a lookup in Asterisk; e.g. create a lookup table in memory
perhaps?
I'm new to Asterisk...
Thanks,
Matt
After a little research and testing, these are my answers:
Is it possible to delete the keys belonging to a family in AstDB at Asterisk
startup? I would like to repopulate it from another source each time
Asterisk is restarted.
not explicitly. The [general] context is executed at asterisk reload
(answer to question 2), but doesn't execute dialplan functions. You could
put a call in /usr/sbin/safe_asterisk to clear your keys using a "local
call" in /var/spool/asterisk/outgoing
[clearkeys]
Exten => start,1,answer()
Exten => start,n,dbdeltree(foo)
Exten => start,n,hangup
Also is AstDB lookup faster than a func_odbc lookup? IMO yes since Asterisk
has a built-in connection to it's Berkley or SQLite database and the odbc
lookup has to go through more layers.
Finally
Is there a faster way to perform a lookup in Asterisk; e.g. create a lookup
table in memory perhaps?
Set and retrieve Global variables for small searches.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20111121/550f8ec5/attachment-0001.htm>
More information about the asterisk-users
mailing list