[asterisk-users] Read Timeout

Dan Journo dan at keshercommunications.com
Tue Apr 20 09:49:47 CDT 2010


Hi Danny,

There seems to be a syntax error with your solution but i can't pin point it.

This is what happens when I hit "1".

   -- Executing [s at macro-screen:2] Read("SIP/magrathea-00001ec6", "ACCEPT|priv-instruct-custom|1") in new stack
    -- Accepting a maximum of 1 digits.
    -- <SIP/magrathea-00001ec6> Playing 'priv-instruct-custom' (language 'en')
    -- User entered '1'
[2010-04-20 15:46:59] WARNING[25723]: ast_expr2.fl:415 ast_yyerror: ast_yyerror():  syntax error: syntax error, unexpected '(', expecting $end; Input:
LEN(1) < 1
   ^
[2010-04-20 15:46:59] WARNING[25723]: ast_expr2.fl:419 ast_yyerror: If you have questions, please refer to doc/channelvariables.txt.
    -- Executing [s at macro-screen:3] GotoIf("SIP/magrathea-00001ec6", "LEN?no") in new stack
    -- Goto (macro-screen,s,5)
    -- Executing [s at macro-screen:5] Set("SIP/magrathea-00001ec6", "MACRO_RESULT=CONTINUE") in new stack
    -- Executing [s at macro-screen:6] Wait("SIP/magrathea-00001ec6", "0.1") in new stack

Thanks
Dan

From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Danny Nicholas
Sent: 20 April 2010 14:19
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] Read Timeout

Not necessarily the best way, but here's how I handle this type of thing in 1.4.X
macro-screen]
exten => s,1,Wait(0.2)
exten => s,n,Read(ACCEPT|priv-instruct-custom|1)
exten => s,n,GotoIf($[LEN(${ACCEPT})  <  1 ] ?no)
exten => s,n,GotoIf($[${ACCEPT} = 1 ] ?yes:no)
exten => s,n(no),Set(MACRO_RESULT=CONTINUE)
exten => s,n(yes),Wait(0.1)


________________________________
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Dan Journo
Sent: Tuesday, April 20, 2010 8:12 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] Read Timeout

Hello,

I use the following macro to screen calls when they come in.

Priv-instruct-custom says "press 1 to accept, press 2 to reject"

However, when no input is made (or the call goes to my mobile's voicemail and therefore no input is made), the result is that the ACCEPT variable is not set and then the GotoIf statement fails.

How can I resolve this? Can I simply preset the ACCEPT variable to 2, or will the read cmd override the ACCEPT variable with nothing if it times out?

[macro-screen]
exten => s,1,Wait(0.2)
exten => s,n,Read(ACCEPT|priv-instruct-custom|1)
exten => s,n,GotoIf($[${ACCEPT} = 1 ] ?yes:no)
exten => s,n(no),Set(MACRO_RESULT=CONTINUE)
exten => s,n(yes),Wait(0.1)

Many thanks
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100420/87ac5f48/attachment.htm 


More information about the asterisk-users mailing list