Woops, should read the post I'm replying to :-P
On Wed, 1 Aug 2007, Simon P. Ditner wrote:
> Ah, you've all been getting too much sun... Since Asterisk 1.0:
>
> exten => s,1,Read(DEST,greetings)
> exten => s,n,Goto(${DEST},1)
> exten => _X.,1,NoOp(in yur dialplan answrn callz to ext ${EXTEN})
>
> Read expects '#' as a terminator, unless max digits is hit (default
> 255). See 'show application read' for additional options.
>
> Cheers,
> spd
>
> On 8/1/07, John Lange <[EMAIL PROTECTED]> wrote:
> > That seems like it would work also.
> >
> > But as already suggested, I think Read() is the proper way to go. I have
> > just implemented it with Read() and it seems to be working well with
> > only a few small issues.
> >
> > Read() accepts a file name to playback for the caller. Unfortunately it
> > doesn't work the same as Background() which allows you to supply
> > multiple file names separated with "&". This means if you need to
> > playback more than one phrase you have to do it with Background() which
> > leads to the second problem.
> >
> > Any key presses outside of the Read() match to the dialplan instead of
> > being put into the variable.
> >
> > But overall it looks very workable.
> >
> > Thanks everyone for their suggestions.
> >
> > John
> >
> > On Wed, 2007-08-01 at 15:31 -0400, Dave Donovan wrote:
> > > On 8/1/07, John Lange <[EMAIL PROTECTED]> wrote:
> > > >
> > > > How can you build a extension string that allows the caller to enter a
> > > > number followed by the "#" key when the number is a variable length?
> > > >
> > >
> > > Could you just have an extension that captures single digits, appends them
> > > to a variable and then exits when it gets '#'. It would be like a while
> > > loop that gets one char at a time.
> > >
> > > It's been a while since I've played with something like this so I'll
> > > include
> > > some pseudo code to illustrate the idea. It would have to be implemented
> > > as
> > > a macro I imagine. Some problems I can see already include the need for
> > > "autofallthrough=no" but I think that's a global setting that's best left
> > > at
> > > default (for 1.2 and up). Fortunately, using N instead of X removes all
> > > that extension sort order problems.
> > >
> > > [GetSomeDigits]
> > > ; Note this is just pseudo code, it won't work without modification
> > > exten => t,1, {$ReturnVar} = {$SomeVar}
> > > exten => t,2, {$SomeVar} = ""
> > >
> > > exten => _N,1, {$SomeVar} = {$SomeVar} + {$EXTEN}
> > >
> > > exten => #,1, {$ReturnVar} = {$SomeVar}
> > > exten => #,2, {$SomeVar} = ""
> > > exten => #,3, Noop(Exit and Return result)
> > >
> > > I'd be interested to know if I'm overlooking anything or whether others
> > > think that's feasible.
> > >
> > > Dave
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> | It ain't what you don't know that gets you into trouble. It's what
> | you know for sure that just ain't so. -- Mark Twain
> |
> | The Toronto Asterisk Users Group
> | Join the discussion group by visiting http://taug.ca
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]