[Asterisk-Dev] PHP AGI - seems to ignore anything but EXEC

Paul Cadach paul at odt.east.telecom.kz
Sun May 9 20:11:57 MST 2004


Hi,

Don't forget to add fflush($stdout) after issuing each command because PHP uses
buffering for its output.

I've uses next function to interact with Asterisk from PHP script and it works
well:
function ast_exec($command)
{
        global $stdin, $stdout;
        fputs($stdout, "$command\n");
        fflush($stdout);
        $str = chop(fgets($stdin, 1024));
        return($str);
}


WBR,
Paul.

----- Original Message -----
From: "Terence Parker" <terence at parker.com.hk>
To: <asterisk-dev at lists.digium.com>
Sent: Monday, May 10, 2004 9:30 AM
Subject: [Asterisk-Dev] PHP AGI - seems to ignore anything but EXEC


> I am attempting to write a PHP AGI application.... but seem to be having a
> few problems.
>
> The script executes properly and I am able to do things such as "EXEC
> FESTIVAL 'Testing 1 2 3'" - but anything that doesn't have EXEC doesn't seem
> to work. I don't quite understand why since surely EXEC is an AGI command
> just like all the other supported ones?
>
> For example:
>
> fputs ($stdout, "EXEC SayDigits 12345\n");        WORKS
> fputs ($stdout, "SAY DIGITS 12345 78#\n");       DOES NOT WORK.
>
> - and I can't figure out why.
>
> What I actually need to do is receive a string of DTMF from the caller but
> when I send the WAIT FOR DIGIT command nothing happens. So I got suspiscious
> and tried other commands - indeed, nothing works. "SAY NUMBER" doesn't
> either - I have to use EXEC for that too. Except, there is no CLI command I
> can use EXEC for is there for receiving DTMF?
>
> Thanks for any help.
>
> Terence
>
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>




More information about the asterisk-dev mailing list