[asterisk-users] Please dont tell me this is impossible

CDR venefax at gmail.com
Fri Jun 29 09:06:10 CDT 2012


This is from the documentation of Perl-AGI
"$AGI->stream_file($filename, $digits, $offset)
Executes AGI Command "STREAM FILE $filename $digits [$offset]"
This command instructs Asterisk to play the given sound file and
listen for the given dtmf digits. The fileextension must not be used
in the filename because Asterisk will find the most appropriate file
type. $filename can be an array of files or a single filename.
Example: $AGI->stream_file('demo-echotest', '0123');
$AGI->stream_file(['demo-echotest', 'demo-welcome'], '0123');
Returns: -1 on error or hangup, 0 if playback completes without a
digit being pressed, or the ASCII numerical value of the digit if a
digit was pressed"

It does not mention that it returns the offset at which the file
stopped playing. Also, if you could get that number, then restarting
the stream would result, I guess, in an audible interruption. Please
advise how to get the offset on the result and I will try.
Yours
Philip



On Fri, Jun 29, 2012 at 6:27 AM, Thorsten Göllner <tg at ovm-group.com> wrote:
> Am 29.06.2012 11:38, schrieb CDR:
>
>> I have been fighting all night with version 1.8 and have not found a
>> way to do this with any command or Perl AGI->command. I need to play a
>> file and wait until the customer presses at least $maxdigits to
>> return, BUT, the file must continue playing until $maxdigits is
>> received or $timeout has expired. So far I found impossible to achieve
>> this functionality. Am I missing something?
>> Philip
>
>
> The Playcommand will be interrupted by the key but the agi result contains
> the offset. So you can play this file from offset again until you $maxdigits
> has been pressed. Take a look here:
> https://wiki.asterisk.org/wiki/display/AST/AGICommand_STREAM+FILE
>



More information about the asterisk-users mailing list