AGI-PHP, problem getting the variable

Augustino

Joined
Aug 5, 2009
Messages
9
Likes
0
Points
0
#1
I tried with this, but the variable is empty, but in the asterisk CLI, is getting the variable correctly, but in the PHP script the variable is empty, Why?

This is my script
Code:
$agi->text2wav('Digita tu numero y despues presiona la tecla gato');
$agi->exec('Read', 'mivar|beep|14||2|50');
$mivar = $agi->get_variable(mivar);
$agi->verbose($mivar);
if ($myvar['result'] == 1 && $myvar['data'] != '') {
$agi->text2wav('Es'.$myvar['data']);
} else {
$agi->text2wav('No introdujo la variable jajaja');
}
And this is showing the asterisk CLI
Code:
AGI Script Executing Application: (Read) Options: (mivar|beep|14||2|50)
-- User entered '23548412'
/var/lib/asterisk/agi-bin/a.php,: Array
/var/lib/asterisk/agi-bin/a.php,: (
/var/lib/asterisk/agi-bin/a.php,: [code] => 200
/var/lib/asterisk/agi-bin/a.php,: [result] => 0
/var/lib/asterisk/agi-bin/a.php,: [data] =>
/var/lib/asterisk/agi-bin/a.php,: )
/var/lib/asterisk/agi-bin/a.php,:
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,886
Members
17,563
Latest member
dineshr
Top