All; I have a question regarding the Astdb. When reading more than a few values, it can take quite a while to grab several values in the astdb using say, asterisk -rx "database show" > output.txt and work with that and then set a new value such as asterisk -rx "database put $key $value". The whole process can take over 1 second for EACH ENTRY which adds up for more than a few keys. What I do now is dump the entire Astdb using "db_dump185" in about 0.003 ms, and then read the entire Astdb output as a hash and then manipulate key, value pairs that way. The entire process will take me less than 0.020 ms total. My problem is this. I am unable to find a corresponding way of doing this in reverse. That is, I do not have a corresponding way to write the new values back to the Astdb. The most obvious way of writing to the Astdb is by using PERL's DB_File. I tried compiling DB_File using the Berkeley 1.85 lib and header to no avail. I've had no luck with db_load either. Any insight at all to write many values to the Astdb quickly would be greatly appreciated. Regards; _________________________________________________________________ Windows Live?: E-mail. Chat. Share. Get more ways to connect. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090124/2210d97f/attachment.htm
external DB? like mysql? 2009/1/24 <cbbs70a at hotmail.com>> All; > I have a question regarding the Astdb. When reading more than a few > values, it can take quite a while to grab several values in the astdb using > say, asterisk -rx "database show" > output.txt and work with that and then > set a new value such as asterisk -rx "database put $key $value". The whole > process can take over 1 second for EACH ENTRY which adds up for more than a > few keys. > > What I do now is dump the entire Astdb using "db_dump185" in about 0.003 > ms, and then read the entire Astdb output as a hash and then manipulate key, > value pairs that way. The entire process will take me less than 0.020 ms > total. > My problem is this. I am unable to find a corresponding way of doing this > in reverse. That is, I do not have a corresponding way to write the new > values back to the Astdb. The most obvious way of writing to the Astdb is by > using PERL's DB_File. I tried compiling DB_File using the Berkeley 1.85 lib > and header to no avail. I've had no luck with db_load either. Any insight at > all to write many values to the Astdb quickly would be greatly appreciated. > Regards; > > > ------------------------------ > Windows Live?: E-mail. Chat. Share. Get more ways to connect. Check it > out.<http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009> > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- (\__/) (='.'=)This is Bunny. Copy and paste bunny into your (")_(")signature to help him gain world domination. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090124/16101aac/attachment.htm
On Sat, Jan 24, 2009 at 11:00:58AM -0500, cbbs70a at hotmail.com wrote:> > All; > I have a question regarding the Astdb. When reading more than a few values, it can > take quite a while to grab several > values in the astdb using say, asterisk -rx "database show" > > output.txt and work with that and then set a new value such as asterisk > -rx "database put $key $value". The whole process can take over 1 > second for EACH ENTRY which adds up for more than a few keys.Either do that through the manager interface, or (if you want to batch commands) send them directly over the unix-domain socket asterisk.ctl . -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir