Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] how to flush user input before READ()


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
ethy.brito at inexo.co...
Guest





PostPosted: Fri Jan 15, 2016 12:38 pm    Post subject: [asterisk-users] how to flush user input before READ() Reply with quote

Hi

how to flush user input before READ()?

I wrote a small script to ask for user password before granting access to
outside, but some telefones memorize the full user input, including "#".

So, when the user press redial, for instance 5556789#123, asterisk accepts the
number and the password "123" and gives access to the outside word to whomever
redials that terminal.

Any hints?

Cheers

Ethy

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
ethy.brito at inexo.co...
Guest





PostPosted: Mon Jan 18, 2016 8:33 am    Post subject: [asterisk-users] how to flush user input before READ() Reply with quote

Hi All.

No one ? Anyone?

Cheers

Ethy


On Fri, 15 Jan 2016 15:37:51 -0200
"Ethy H. Brito" <ethy.brito@inexo.com.br> wrote:

Quote:

Hi

how to flush user input before READ()?

I wrote a small script to ask for user password before granting access to
outside, but some telefones memorize the full user input, including "#".

So, when the user press redial, for instance 5556789#123, asterisk accepts the
number and the password "123" and gives access to the outside word to whomever
redials that terminal.

Any hints?

Cheers

Ethy

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--

Ethy H. Brito /"\
InterNexo Ltda. \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
+55 (12) 3797-6860 X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
S.J.Campos - Brasil / \

PGP key: http://www.inexo.com.br/~ethy/0xC3F222A0.asc

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Mon Jan 18, 2016 12:40 pm    Post subject: [asterisk-users] how to flush user input before READ() Reply with quote

On Mon, 18 Jan 2016, Ethy H. Brito wrote:

Quote:
Quote:
how to flush user input before READ()?

How about a read() to a dummy variable with a 1 second timeout to consume
the octothorpe and password?

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
ethy.brito at inexo.co...
Guest





PostPosted: Mon Jan 18, 2016 1:09 pm    Post subject: [asterisk-users] how to flush user input before READ() Reply with quote

On Mon, 18 Jan 2016 09:38:52 -0800 (PST)
Steve Edwards <asterisk.org@sedwards.com> wrote:

Quote:
On Mon, 18 Jan 2016, Ethy H. Brito wrote:

Quote:
Quote:
how to flush user input before READ()?

How about a read() to a dummy variable with a 1 second timeout to consume
the octothorpe and password?


It is an odd solution but i'll give it a try.

Thanx;

Ethy


Quote:

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--

Ethy H. Brito /"\
InterNexo Ltda. \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
+55 (12) 3797-6860 X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
S.J.Campos - Brasil / \

PGP key: http://www.inexo.com.br/~ethy/0xC3F222A0.asc

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
ethy.brito at inexo.co...
Guest





PostPosted: Tue Jan 19, 2016 6:55 am    Post subject: [asterisk-users] how to flush user input before READ() Reply with quote

On Mon, 18 Jan 2016 16:09:17 -0200
"Ethy H. Brito" <ethy.brito@inexo.com.br> wrote:

Quote:
On Mon, 18 Jan 2016 09:38:52 -0800 (PST)
Steve Edwards <asterisk.org@sedwards.com> wrote:

Quote:
On Mon, 18 Jan 2016, Ethy H. Brito wrote:

Quote:
Quote:
how to flush user input before READ()?

How about a read() to a dummy variable with a 1 second timeout to consume
the octothorpe and password?


It is an odd solution but i'll give it a try.

To close the thread, the solution did "flush" the input as a side effect of the
short timeout.

Thank you mr. Edwards.

Cheers

Ethy


Quote:

Thanx;

Ethy


Quote:

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--

Ethy H. Brito /"\
InterNexo Ltda. \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
+55 (12) 3797-6860 X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
S.J.Campos - Brasil / \

PGP key: http://www.inexo.com.br/~ethy/0xC3F222A0.asc

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--

Ethy H. Brito /"\
InterNexo Ltda. \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
+55 (12) 3797-6860 X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
S.J.Campos - Brasil / \

PGP key: http://www.inexo.com.br/~ethy/0xC3F222A0.asc

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Tue Jan 19, 2016 12:03 pm    Post subject: [asterisk-users] how to flush user input before READ() Reply with quote

Quote:
Quote:
Quote:
On Mon, 18 Jan 2016, Ethy H. Brito wrote:

Quote:
Quote:
how to flush user input before READ()?

Quote:
Quote:
On Mon, 18 Jan 2016 09:38:52 -0800 (PST)
Steve Edwards <asterisk.org@sedwards.com> wrote:

Quote:
Quote:
Quote:
How about a read() to a dummy variable with a 1 second timeout to
consume the octothorpe and password?

On Tue, 19 Jan 2016, Ethy H. Brito wrote:

Quote:
To close the thread, the solution did "flush" the input as a side effect
of the short timeout.

If 1 second is too long, you could write an AGI to use the 'wait for
digit' AGI command which allows the timeout to be specified in
milliseconds.

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
darcy at Vex.Net
Guest





PostPosted: Tue Jan 19, 2016 12:54 pm    Post subject: [asterisk-users] how to flush user input before READ() Reply with quote

On Tue, 19 Jan 2016 09:02:30 -0800 (PST)
Steve Edwards <asterisk.org@sedwards.com> wrote:
Quote:
Quote:
Quote:
Quote:
How about a read() to a dummy variable with a 1 second timeout to
consume the octothorpe and password?

If 1 second is too long, you could write an AGI to use the 'wait for
digit' AGI command which allows the timeout to be specified in
milliseconds.

If I understand it the OP has un-consumed input and is just looking for
the shortest possible time to read it. Would a read with a timeout of
zero do the job or would Asterisk optimize away the call?

--
D'Arcy J.M. Cain
System Administrator, Vex.Net
http://www.Vex.Net/ IM:darcy@Vex.Net
VoIP: sip:darcy@Vex.Net

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Tue Jan 19, 2016 2:50 pm    Post subject: [asterisk-users] how to flush user input before READ() Reply with quote

Quote:
On Tue, 19 Jan 2016 09:02:30 -0800 (PST) Steve Edwards
<asterisk.org@sedwards.com> wrote:

Quote:
Quote:
Quote:
Quote:
Quote:
How about a read() to a dummy variable with a 1 second timeout to
consume the octothorpe and password?

Quote:
Quote:
If 1 second is too long, you could write an AGI to use the 'wait for
digit' AGI command which allows the timeout to be specified in
milliseconds.

On Tue, 19 Jan 2016, D'Arcy J.M. Cain wrote:

Quote:
If I understand it the OP has un-consumed input and is just looking for
the shortest possible time to read it. Would a read with a timeout of
zero do the job or would Asterisk optimize away the call?

Good idea. I was looking at the 'read()' dox for 1.2 which doesn't say
much about the timeout values -- only that if it is 0, the default is
used. The default may be changed using the TIMEOUT() function. Maybe
setting the default to 0 and specifying 0 in read() may be fruitful.

More modern Asterisks (11.17) say the timeout can be a floating point
number. Maybe setting it to 0.1 (or 0.01) may do the trick.

Unfortunately, I don't have the time to play right now.

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services