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]

Reply via email to