Re: Passing Argument from Asterisk to Perl
Posted by:
Padmaja T N
Date: September 27, 2007 06:12AM
I have tried in this way, but could not find any solution.
in extensions.conf
***********************
exten => 444,18,AGI(insert_db.pl|${intime}|${outtime}|${telephone_num});
in insert_db.pl
************************
#!/usr/bin/perl -Tw
use DBI;
use File::Copy;
#use Asterisk::AGI;
$table_name = "schedule";
# the name of the box the MySQL database is running on
$hostname = "192.168.1.99";
# the name of the database our tables are kept
$database = "asterisk";
# username to connect to the database
$username = "root";
# password to connect to the database
$password = "aDfasoAd12";
#print "Connecting to database\n";
$dbh= DBI->connect("dbi:mysql:dbname= $database;host=$hostname", "$username", "$password");
#$statement = "SELECT TollfreeNumber from $table_name where Availability=\"1\" group by TollfreeNumber";
$statement = "INSERT into $table_name values($ARGV[0],$ARGV[1],$ARGV[2])";
$result = $dbh->prepare($statement);
$result->execute();
exit;
Subject
Written By
Posted
September 26, 2007 05:35AM
Re: Passing Argument from Asterisk to Perl
September 27, 2007 06:12AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.