[asterisk-users] Time counting down and # detect

Steve Edwards asterisk.org at sedwards.com
Mon Mar 15 00:58:16 CDT 2010


Trying to un-top-post into something readable...

> > > > > On Fri, 2010-03-12 at 15:03 +0700, Pham Quy wrote:
> > > > >>
> > > > >> Here is the script  i want to make
> > > > >>
> > > > >> - Caller call to a number to record a message
> > > > >> - Asterisk answer and start recording message as following
> > > > >> 	+ User press * to start recording
> > > > >> 	+ Record is finished if:
> > > > >> 		+ User press #
> > > > >> 		+ OR message duration reach 60 second
> > > > >> 	+ Hangup
> > > > >>
> > > > >> How do you counting down 60s, and how to detect # (i make a test using
> > > > >> Read() but it cant read #)

> > > > On Fri, 12 Mar 2010, Pham Quy wrote:
> > > > 
> > > > > I figured that out, i can use monitor() function to record and using a
> > > > > loop to count down 60s.
> > > > >
> > > > > But I dont think it is best solution, any suggestion is appreciated.
> > > > > And still, how can i capture '#'?

> > > On Fri, 2010-03-12 at 10:43 +0000, Gordon Henderson wrote:
> > > > 
> > > > Have you reied reading the manual, or the wiki, or even just googling for 
> > > > asterisk recording?
> > > > 
> > > > You'll find the Record() application will do what you need to do regarding 
> > > > time and #.

> > On Sat, 2010-03-13 at 08:36 +0700, Pham Quy wrote:
> > > 
> > > What i'm doing now is that something like karaoke. While music is
> > > playing back, caller voice is being record by the way i mentioned
> > > earlier. I should give you the whole picture of what i'm doing.
> > > 
> > > I did google for it, and Monitor() function seem to be the best choice
> > > to do that.
> > > 
> > > I would prefer using Record() if somehow i could play back music while
> > > recording.

On Mon, 15 Mar 2010, Pham Quy wrote:

> I made a conclusion too soon, i couldnt count down while music was
> playing back.

Why can't you use read() as suggested? If you play a 60 second clip with a 
timeout of 1, why doesn't that fit your needs?

How about setting an absolute timeout for the channel, start recording, 
and then playback your music.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list