Problem with the script

Hi all,

I’m actually trying to store all the info of my peers (sip, iax…) in a MySQL database.
I think i’ve well configured all of my files but there is no way to retrieve the peers from the database. This work is supposed to be done by the retrieve_sip_conf_from_mysql.conf for the SIP peers, but it’s not.
I tryed to execute this script directly un command line and i have the following message :

Can’t call method “selectall_arrayref” on an undefined value at ./ line 60.

I tryed a lot of things for a week and nothing is going better.
So i’d like to know if somebody else has also have this probleme and how to resolve it, mayby some files are missing or some includes but i don’t find which.

Thanks and forgive my english ^^

are you using A@H/AMP or just “borrowing” the script from a setup ?

if it’s a modified version, it might pay to post it here for scrutiny.

No i’m using the normal Asterisk, and i’ve installed the FreePBX (new name of AMP) and didn’t modified the perl script.

The lines where is the problem are :

$statement = “SELECT keyword,data from $table_name where id=0 and keyword <> ‘account’ and flags <> 1”;
my $result = $dbh->selectall_arrayref($statement);
unless ($result) {
# check for errors after every single database call
print “dbh->selectall_arrayref($statement) failed!\n”;
print “DBI::err=[$DBI::err]\n”;
print “DBI::errstr=[$DBI::errstr]\n”;

Wich type of value needs selectall_arryref… Why doesn’t it work since it’s the original file…
I’m totally loosed.

So nobody has an idea ?

Why a file in an addon which works for everybody doesn’t works for me ?

you’ve probably already answered your own question, by stating that you don’t think you have all the dependencies installed. i would start there. make sure your Perl implementation is up to date, make sure you have all the mySQL stuff installed and up to date too.

I’ve just install the perl-devel, i think i already have the dependencies… but it still doesn’t work. (I use Perl 5.8.7)

There is something strange : it works for the mailbox, AMP write the infos of my mailboxes in the voicemail.conf…

Dont’t understand.

It seems that nothing but hard values for username & password for connecting to the database works… but it works, so…