Sorry, but I am using a self developed PHP-Library where I parse STDIN
myself. So I have no problem on this side. You are using a Perl-API?
There should be a method available for getting the AGI-Result-String?! I
never used Perl myself ...
Am 03.07.2012 16:13, schrieb CDR:
Yes, ai saw that information on the debug, but how do you bring it
inside a variable, so you may use it? I could not find a way. Maybe I
am missing something?
On Tue, Jul 3, 2012 at 9:20 AM, Thorsten Göllner <[email protected]> wrote:
I just tried it on asterisk 1.8.13 with "agi set debug on". The last log
line reveals it - streamfile return the endpos.
[2012-07-03 15:16:39] VERBOSE[7046] res_agi.c: <SIP/tgoellner-00000002>AGI
Rx << STREAM FILE /audio1/dtmf_detector/2.0 1234567890*#
[2012-07-03 15:16:39] VERBOSE[7046] res_agi.c: -- Playing
'/audio1/dtmf_detector/2.0' (escape_digits=1234567890*#) (sample_offset 0)
[2012-07-03 15:16:40] VERBOSE[7046] res_agi.c: <SIP/tgoellner-00000002>AGI
Tx >> 200 result=0 endpos=4800
So please doublecheck your result.
Am 03.07.2012 00:47, schrieb CDR:
1.8 is my version, until the new one is stable.
On Mon, Jul 2, 2012 at 4:57 PM, Thorsten Göllner <[email protected]> wrote:
What Asterisk version?
Am 02.07.2012 15:14, schrieb CDR:
Thanks. I already solved it using this command. The only issue was
that it gives you as return the ASCII code of the digit pressed
instead of the digit itself. For some reason my brain did not process
that detail. But it does work. However, the offset played is not
returned. Has anybody tested this and has a coding sample in perl?
Philip
On Mon, Jul 2, 2012 at 8:52 AM, Thorsten Göllner <[email protected]>
wrote:
So take a look here:
http://www.voip-info.org/wiki/view/stream+file
Am 29.06.2012 16:06, schrieb CDR:
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 <[email protected]>
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
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users