[Asterisk-Users] help needed with read()

Sathya sathyaw at sbcglobal.net
Wed Jun 23 13:10:13 MST 2004


Thanks Steve.

I thought it is better that agi be run without any user interactions. When
called, It will do its thing and give back the control to extension.conf. Is
it not ?

Back to my question, lets say I want to use the digits collected by read()
to dial out an extension. how do I do that ?

cheers

Sathya

> -----Original Message-----
> From: asterisk-users-admin at lists.digium.com
> [mailto:asterisk-users-admin at lists.digium.com]On Behalf Of Steven
> Critchfield
> Sent: Wednesday, June 23, 2004 9:03 AM
> To: asterisk-users at lists.digium.com
> Subject: Re: [Asterisk-Users] help needed with read()
>
>
> On Wed, 2004-06-23 at 10:12, Sathya wrote:
> > asterisk*CLI>
> >   -= Info about application 'Read' =-
> >
> > [Synopsis]:
> > Read a variable
> >
> > [Description]:
> >   Read(variable[|filename]):  Reads a '#' terminated string of
> digits from
> > the user, optionally playing a given filename first.  Returns
> -1 on hangup or
> > error and 0 otherwise.
> >
> > I need to collect a variable length digit string terminated by # and
> > then pass those digits  to an agi script. I can do this as follows
> > (when I know the length of the string).
> >
> > exten => s,1,BackGround(please-enter-the-fourdigit-pin)
> > exten => s,2,DigitTimeout,5
> > exten => s,3,ResponseTimeout,10
> > exten => _XXXX,1, agi, agiscript.agi
> > I would like to use Read() here, like
> >
> > exten => s,1,BackGround(please-enter-the-pin)
> > exten => s,2,Background(followed-by-pound)
> > exten => s,3,DigitTimeout,5
> > exten => s,4,ResponseTimeout,10
> > exten => s,5,Read(${EXTEN})
> > exten => ???????/
>
> First, if you are going to be going to AGI, why not just ask for the
> digits inside of AGI? It seems like it is more appropriate that way.
> Read is for when you can accomplish what you want without jumping to
> AGI.
>
> Also, be wary that Background will allow a user to interupt the prompt
> with a digit press. This is the normal expected behavior. You would want
> to use playback.
>
> --
> Steven Critchfield  <critch at basesys.com>
>
>





More information about the asterisk-users mailing list