[Asterisk-Dev] fast-forward & rewind
Steven Critchfield
critch at basesys.com
Tue Apr 8 16:46:07 MST 2003
On Tue, 2003-04-08 at 18:20, Jim Gottlieb wrote:
> Hi. As part of porting a voicemail application from Dialogic to
> Asterisk, we need to give people the ability to rewind or fast-forward
> the message they are listening to.
>
> We allow them to press * or # to rewind or fast-forward five seconds,
> respectively. However, we could use some hints on how to do this under
> asterisk.
>
> We use ast_streamfile() ast_waitstream() to play the messages, and can
> allow the * or # to interrupt. We can also use lseek() to seek to a
> certain position in the file, but how do we know where in the file the
> playing was when the user interrupted?
>
> If we can know that, then we can lseek() back or forward from there.
>
> One possibility is to note the time we start playing the file and
> compare it to the time the DTMF interrupt happens, thus giving us a
> good idea of where in the file they were.
>
> Can anyone think of a better way, or is there some ast_ function we're
> not aware of that would help?
You need to check out
ast_seekstream
ast_tellstream
--
Steven Critchfield <critch at basesys.com>
More information about the asterisk-dev
mailing list