Astdb && perl && DB_File problems

Hi everyone. I’m trying to read/write an astdb file with a perl script.

Asterisk doesn’t see the records I add. They’re visible via my script, but not with the Asterisk.

I’ve noted, that then you add a database record using Asterisk, it adds family/value/key ending with the 0x00 symbol. That looks like a clue, but it’s not…

Does anyone have a working solution? What am I missing?
:unamused:

Hi

I never write direct to it, I use either Manager or via the CLI

Ian

Thanks for your answer…
Nobody reads my topic.

Probably, I better call it “seven nude girls and the asterisk”…

I’m reaching the astdb file on a NFS share.
The *server is somewhere else.
:unamused:

Hi

I did and answered, then you just post a sarcastic reply…

The location of the server and DB have no effect if using manager or via a cli command from a script.

Have fun.

Ian

Ian

Seemed like a humorous reply, not a sarcastic one.

On that topic, let’s change the subject to “7 nude girls…”

Thanks again for your answer, Ian!

Sorry about my joke :smiley:

I’ve re-read the info about CLI and Manager.

CLI: is it possible to access the command line without access to a file /var/run/asterisk.ctl ? /the path may deffer/

Manager: Is it known to be secure enough to be www-accessible ? maybe thats the way =/

But, for me it seems rather strange. Since other scripts feel good, accessing this NFS-share (for CDR, for wav-files, MOH), there should be an easy way to read/write this BerkeyDB file…

Thanks again!

HussainAkbar: Thank you! You’re right, my “7 girls” are continuation of your virgins :laughing:

Hi

Accessing the manager from a remote machine is/can be very secure. you limit access to manager via allow and deny to only 127.0.0.1 then use as client server style of script to make the changes, You never access directly.

Ian

So, if “the manager” is listening 127.0.0.1 only, your advise is to use something like ssh to reach the remote Asterisk server to run commands?

IMHO

The problem is: Asterisk reads the DB data into memory pools, syncing the pools and the real database is made in one-way-direction (write from memory to disk)… So Asterisk will never know, if something is changed on the disk, unless you restart Asterisk to see the changes =)

Even this cant be an idea, since Asterisk may call sync() at any time to write changes from memory to disk and erase all your changes…

Stupid question now :unamused: nobody ever program those kind of scripts? Thats not intresting? :confused:

Hi

What we do on ours and customer systems is
For example
on a remote webserver data is entered. when submited it is sent as a https post to a php script on asterisk, This script then makes a manager connection to Asterisk and then makes the relevent changes to the DB.

Various security measures are in place to stop other people sending requests to the asterisk php script. This makes for a secure system with no direct access to manager at all

Ian

Thanks again for the tip :smile:

As I’ve understood, you have http-server and php installed on your Asterisk servers?

Just to say, I dont like php at all =) Sorry… Its huge and buggy :smiley: I have a SingleBoardComputer at home, it has 32Mb of ssd and 32Mb of RAM and it’s happily running FreeBSD7.0 with Asterisk. There’s no place for 5 (?) Mb of libPHP :smile:

Oh! While I was typing, I’ve got an idea to mount (sshfs) remote Asterisk system to use it’s asterisk.ctl… like that I’d be able to use CLI, right?
:laughing:

I’ll be back, thanks!!!

So run php on another machine and limit manager to only allow connections from that machine.

Ian

Such a stipid idea :smiley:

firewall protected Manager is the only reasonable way

Thank you, Ian, and thank you for your patience :smile: