[Asterisk-Users] help needed with read()

Steven Critchfield critch at basesys.com
Wed Jun 23 13:16:00 MST 2004


On Wed, 2004-06-23 at 15:10, Sathya wrote:
> Thanks Steve.

Please do not group reply or reply all. 

> 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 ?

Better than what? It is easy, and if programmed half decent, it is
secure. 

> 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 ?

Depends. You can use a Goto, you could allow your AGI to set the
extension, context, and priority to exit upon. Unless you need that data
in the AGI, you could just not read it and let the dialplan jump there. 

> > -----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>
> >
> >
> 
-- 
Steven Critchfield  <critch at basesys.com>




More information about the asterisk-users mailing list