AGI-PHP, problem getting the variable

Discussion in 'General' started by Augustino, Sep 10, 2009.

  1. Augustino

    Joined:
    Aug 5, 2009
    Messages:
    9
    Likes Received:
    0
    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,:
     

Share This Page