[asterisk-users] Adding 4000 Lines to asteriskdb via asterisk -rx ?

Tzafrir Cohen tzafrir.cohen at xorcom.com
Thu Jan 11 05:31:47 MST 2007


On Thu, Jan 11, 2007 at 10:28:27AM +0000, Gordon Henderson wrote:
> On Mon, 8 Jan 2007, Christoph Adomeit wrote:
> 
> >Are there some external utilities to lock and update the asteriskdb ?
> >Is there a better way ?
> 
> A bit late on this and I see that there's a nice bit of perl posted to use 
> the manager interface, but I've been doing something similar by writing a 
> file which is then #included by extensions.conf, then zeroing the file 
> after an asterisk -rx 'extensions reload' ('diaplan reload' for the 1.4 
> people out there)
> 
> Eg. lines of:
> 
> DB(speedDialNum/10)=07712191046
> DB(speedDialNam/10)=Gordon
> DB(speedDialRNum/191046)=10

This is really an abuse.

However, consider that a dialplan can be generated gynamically using
"add extension" from the CLI. So just use a few:

  asterisk -rx "add extension ..."

(dialplan add extension, in 1.4 syntax). If you think that this is not
efficient enough, then there was a recent thread in this list about
making this operation much more efficient.

Oh, this is this thread. Hmm...

Any reason not to use the manager approach (or writing directly to the
unix domain socket, as I have suggested, if you really hate creating a
manager interface user)?

A dialplan is something to be executed at call time. If you need to do
something that is not from the context of a channel, use the manager
interface (or the CLI, which is rather equivalent).

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir


More information about the asterisk-users mailing list