I am at my witts end…i have used the phpagi and did most of the functions…but can not get the most important ones to work. I need get_variable to work…please someone respond with a sample and not just a phrase like “go look here”. my issues are:
- can not get_variable to bring in the value of $foo.
- i can not use echo to display the value, how can i display it ?
- it shows up as an array in the database, why? how can i print an array value?
I am in much pain…any help would be appriciated.
this is the sample that i am talking about please someone --fix it --please?
i have an extension.conf file :
exten => 298,1,NoOp(${foo})
exten => 298,2,Set(foo=1212)
exten => 298,3,Answer
exten => 298,4,AGI(input9.php|${foo})
exten => 298,5,Hangup
I have an input9.php file that looks like this:
<?php set_time_limit(30); require('phpagi.php'); $agi = new AGI(); $agi->answer(); $fooo = $agi->get_variable($foo); $agi->text2wav("You entered " . $fooo); // echo $fooo ; // mysql stuff $dbhost = "localhost"; $dbuser = "root"; $dbname = "asterisk"; $dbpass = "nd"; // connect to db mysql_connect($dbhost, $dbuser, $dbpass) or die ("Failed to connect to the database!"); mysql_select_db($dbname) or die(mysql_error()); $query = "insert into pbook values ('$mynum', '$fooo');"; $result = mysql_query($query) or die(mysql_error()); $agi->text2wav('Goodbye'); $agi->hangup(); ?>