[Asterisk-Users] agi command 'stream file' not working?

Steven Critchfield critch at basesys.com
Mon Feb 7 13:50:55 MST 2005


On Mon, 2005-02-07 at 15:18 -0500, Paul Zimm wrote:
> I'm running Asterisk CVS-v1-0-12/28/04
> I use a short php agi script to get the temperature from an opto22 module.
> STREAM FILE temperature does nothing, but SAY NUMBER works fine.
> What am I doing wrong?
> 
> #!/usr/bin/php -q
> <?
>   $output = @shell_exec('eiocl 192.168.10.212 2001 10 44 r ap');
>   $words = explode(" ", $output);
>   echo "STREAM FILE temperature X \n"; 
>   fflush( STDOUT ); 
>   echo "SAY NUMBER " .intval($words[count($words)-1]) ." X\n"; 
>   fflush( STDOUT ); 
> ?>

pbx*CLI> show agi stream file
 Usage: STREAM FILE <filename> <escape digits> [sample offset]
        Send the given file, allowing playback to be interrupted by the given
 digits, if any.  Use double quotes for the digits if you wish none to be
 permitted.  If sample offset is provided then the audio will seek to sample
 offset before play starts.  Returns 0 if playback completes without a digit
 being pressed, or the ASCII numerical value of the digit if one was pressed,
 or -1 on error or if the channel was disconnected.  Remember, the file
 extension must not be included in the filename.



Look closely at the description, Second sentence should explain what you
are doing wrong. 

Specifically, X is not a digit, you must either use "" for no
interuptions permitted or use 0123456789 for all digits available to
interupt. 
-- 
Steven Critchfield <critch at basesys.com>




More information about the asterisk-users mailing list