I've search the world over.... but I haven't figured out a way to have valid/invalid options for entry when using the Read command... I need to set a variable, but only want to allow certain values to be valid options for that variable... Any ideas? Thanks in advance.. -JC -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080824/a2495fea/attachment.htm
> I've search the world over.... but I haven't figured out a way tohave> valid/invalid options for entry when using the Read command... > I need to set a variable, but only want to allow certain values to be > valid options for that variable...I hope I understand your question. You can use Read(<var-name>,<msg>,<length of input>); You can then use switch to control the input. Alternatively, you can use WaitExten() instead of Read(). Also, try to code your dialplan using AEL2 instead of AEL.
You first use the Read application : exten => s,n,Read(ANS|filetoplay) And then use GotoIfs by checking the ${ANS} variable to do the logic (re-ask if bad response, else continue in dialplan). On Sun, 2008-08-24 at 23:10 -0700, Joe Carroll wrote:> I?ve search the world over?. but I haven?t figured out a way to have > valid/invalid options for entry when using the Read command? > > > > I need to set a variable, but only want to allow certain values to be > valid options for that variable? > > > > Any ideas? > > > > Thanks in advance.. > > > > -JC > > > > > > > > > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Joe Carroll wrote:> > I?ve search the world over?. but I haven?t figured out a way to have > valid/invalid options for entry when using the Read command? > > I need to set a variable, but only want to allow certain values to be > valid options for that variable? > > Any ideas? > > Thanks in advance.. >If you use a goto based on the variable afterwards, it should jump to the 'i' (invalid) if the option entered does not exist. Does that make enough sense? If not, feel free to ask more questions.... paulH