Im trying to create a custom application via the AGI. I want to authenticate the users that dial in with a userid and pin. However, the number of digits in the PIN and userid are variable, and therefore I need to allow the user to "press enter" by hitting the pound key. How would I accomplish this in the AGI? stream_file doesnt seem to work, since it only allows one digit to be pressed. get_data seems to only allow a fixed number of digits to be entered. Thanks Gary Franczyk
----- Original Message ----- From: "Gary Franczyk" <gary@de-scribe.com> To: <asterisk-users@lists.digium.com> Sent: Tuesday, January 20, 2004 10:51 AM Subject: [Asterisk-Users] Enter Pin followed by Pound key> Im trying to create a custom application via the AGI. I want to > authenticate the users that dial in with a userid and pin. However, the > number of digits in the PIN and userid are variable, and therefore I needto> allow the user to "press enter" by hitting the pound key. How would I > accomplish this in the AGI? > > stream_file doesnt seem to work, since it only allows one digit to be > pressed. > get_data seems to only allow a fixed number of digits to be entered.Sorry if I'm speaking out of school, as I have never programmed AGIs, but from what you described, the stream_file taking one digit at a time should be sufficient. string entry while (keypressed != #) { entry += keypressed } In this way, you could "build up" your string of digits. Don't know how AGI is working specifically, but hopefully this will trigger some thought or idea.> > > Thanks > Gary Franczyk > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Philipp von Klitzing
2004-Jan-20 12:31 UTC
[Asterisk-Users] Enter Pin followed by Pound key
Hi!> Im trying to create a custom application via the AGI. I want to > authenticate the users that dial in with a userid and pin. However, the > number of digits in the PIN and userid are variable, and therefore I need to > allow the user to "press enter" by hitting the pound key. How would I > accomplish this in the AGI?Did you look at the appliation Digit()? If you must use AGI then EXEC Digit ... might do it for you.> stream_file doesnt seem to work, since it only allows one digit to be > pressed. > get_data seems to only allow a fixed number of digits to be entered.Why not use either of those repetitively and check in your AGI script if # was the digit, then accumlate what you have? Cheers, Philipp
This has worked for me.... my $empid = $AGI->get_data('employee',-1,5); It is set to accept 5 digits but hitting pound before the fifth digit works to satisfy. -gcc -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Gary Franczyk Posted At: Tuesday, January 20, 2004 11:52 AM Posted To: Asterisk User Group Conversation: [Asterisk-Users] Enter Pin followed by Pound key Subject: [Asterisk-Users] Enter Pin followed by Pound key Im trying to create a custom application via the AGI. I want to authenticate the users that dial in with a userid and pin. However, the number of digits in the PIN and userid are variable, and therefore I need to allow the user to "press enter" by hitting the pound key. How would I accomplish this in the AGI? stream_file doesnt seem to work, since it only allows one digit to be pressed. get_data seems to only allow a fixed number of digits to be entered. Thanks Gary Franczyk _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users