From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Matt Hamilton Sent: Sunday, November 20, 2011 1:25 PM To: asterisk-users@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.
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users