[call] exten => 459,1,Answer() exten => 459,n,Playback(hello -world) exten => 459,n(first),Noop(-- TO ENTER NUMBER PRESS 1 --) exten => 459,n,Waitexten(4) exten => 459,n,GotoIf($["${EXTEN}" == "459"]?call,459,first) exten => 459,n(second),Noop(-- TO ENTER NUMBER PRESS 2 --) exten => 459,n,Waitexten(10) exten => 459,n(summ),Noop(-- PRESS 3 IF YOU WANT TO SUMM NUMBERS --) exten => 459,n,Waitexten(10) exten => 1,1,Noop(-- PRESS 1 --) exten => 1,n,Read(num1) exten => 1,n,GotoIf($["${num1}" == "1"]?call,459,second) exten => 2,1,Noop(-- PRESS 2 --) exten => 2,2,Read(num2) exten => 2,n,GotoIf($["${num1}" != ""] && $["${num2}" == "2"]?call,459,summ) exten => 3,1,Noop(SUMM is: $[${num1} + ${num2}]) exten => 3,n,HangUp() 

Tell me how to determine if the subscriber did not press anything 3 times, then end the call.

    1 answer 1

    If nothing is pressed, then processing goes to exten => t. Add about this logic:

     exten => t,1,NoOP(-- Nothing pressed --) same => n,ExecIf($[ "${ATTEMPT}" == "" ]?Set(ATTEMPT=1):Set(ATTEMPT=${MATH(${ATTEMPT}+1,int)})) same => n,ExecIf($[ ${ATTEMPT} > 2 ]?Hangup:Goto(459,first))