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?
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
Mark just commited a patch from me last week that does that.
--Mike
On Tuesday, April 8, 2003, at 04:20 PM, Jim Gottlieb wrote:
Quote:
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?
BTW, this doesn't go back/forward by 5 seconds, but you can change
that. Look at file.c. I added the ast_waitstream_fr function. You
can change the time in that function. I will soon be adding that to
voicemail.conf, so you can change it easier.
--Mike
On Tuesday, April 8, 2003, at 04:20 PM, Jim Gottlieb wrote:
Quote:
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 cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum