We user mySQL in certain instances of AGI and it works great. This information has helped us quite a bit. If you are using php - make sure you are using the CLI version.
Here is a code snip of how we are doing it.
#!/usr/local/bin/php -q
<?php
/**
* @package phpAGI_examples
* @version 2.0
*/
#
set_time_limit(60);
require('phpagi.php');
$agi = new AGI();
$agi->verbose("Launching AGI...");
#
$link = mysql_connect("0.0.0.0", "dbname", "dbpass")
or die("Could not connect: " . mysql_error());
#
mysql_select_db("dbname")
or die ('The database specified in database_name must exist and must be accessible by the user specified in mysql_connect');
#
$query = "SELECT * FROM yourtable";
$agi->verbose($query);
$result = mysql_query ($query)
or die('could not select yourtable file!');
$arow = mysql_fetch_array($result);
...and so on...
<?php
/**
* @package phpAGI_examples
* @version 2.0
*/
#
set_time_limit(60);
require('phpagi.php');
$agi = new AGI();
$agi->verbose("Launching AGI...");
#
$link = mysql_connect("0.0.0.0", "dbname", "dbpass")
or die("Could not connect: " . mysql_error());
#
mysql_select_db("dbname")
or die ('The database specified in database_name must exist and must be accessible by the user specified in mysql_connect');
#
$query = "SELECT * FROM yourtable";
$agi->verbose($query);
$result = mysql_query ($query)
or die('could not select yourtable file!');
$arow = mysql_fetch_array($result);
...and so on...
On 6/15/06, Frederic Jean <[EMAIL PROTECTED]> wrote:
Walid,Check the ASTCC agi script ; it just does exactly that:Cheers,Fred----- Original Message -----From: Walid AzabSent: Thursday, June 15, 2006 11:14Subject: [Asterisk-Users] AGI to read MySQL
Hello everyone,
I am not an expert in Asterisk programming yet. So, can someone help me put my first steps on how to use AGI to access MySQL tables and do queries. Any reference or help is appreciated. My target is to get Festival to read TTS from data stored in MySQL table based on the ID that the caller will input after his call is answered.
Thanks
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
--
Origination that includes real support!
http://www.VoIPStreet.com
_______________________________________________ --Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users