EXEC READ

Discussion in 'General' started by nancy, Sep 9, 2009.

  1. nancy

    Joined:
    Aug 5, 2009
    Messages:
    17
    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

    $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

    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