exten => 100,1,Dial(SIP/101)
include => others
[others]
exten => _X.,1,SET(RNDNUM=${RAND(1,9)})
exten => _X.,n,Background(vm-enter-num-to-call)
exten => _X.,n,SayDigits(${RNDNUM})
exten => _X.,n,Read(USANSWER,,1)
exten => _X.,n,GotoIf(${USANSWER}=${RNDNUM}?msgok:msgcancel)
exten => _X.,n,Hangup()
exten => _X.,n(msgok),Macro(makecall,${EXTEN})
exten => _X.,n,Hangup()
exten => _X.,n(msgcancel),Playback(vm-mismatch)
exten => _X.,n,Hangup()
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: debug
== Using SIP RTP CoS mark 5
-- Executing [6666666666@outgoing:1] Set("SIP/105-000000ac", "RNDNUM=4") in new stack
-- Executing [6666666666@outgoing:2] BackGround("SIP/105-000000ac", "vm-enter-num-to-call") in new stack
-- <SIP/105-000000ac> Playing 'vm-enter-num-to-call.ulaw' (language 'ru')
-- Executing [6666666666@outgoing:3] SayDigits("SIP/105-000000ac", "4") in new stack
-- <SIP/105-000000ac> Playing 'digits/4.ulaw' (language 'ru')
-- Executing [6666666666@outgoing:4] Read("SIP/105-000000ac", "USANSWER,,1") in new stack
-- Accepting a maximum of 1 digits.
-- User entered '6'
-- Executing [6666666666@outgoing:5] GotoIf("SIP/105-000000ac", "6=4?msgok:msgcancel") in new stack
-- Goto (outgoing,6666666666,7) // прим. соответствует метке msgok
-- Executing [6666666666@outgoing:7] Macro("SIP/105-000000ac", "makecall,6666666666") in new stack
-- Executing [s@macro-makecall:2] Dial("SIP/105-000000ac", "SIP/TRUNK/6666666666") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/TRUNK/6666666666
-- SIP/TRUNK-000000ad is making progress passing it to SIP/105-000000ac
== Spawn extension (macro-makecall, s, 2) exited non-zero on 'SIP/105-000000ac' in macro 'makecall'
== Spawn extension (outgoing, 6666666666, 7) exited non-zero on 'SIP/105-000000ac'
-- Executing [6666666666@outgoing:1] Set("SIP/105-000000ac", "RNDNUM=4") in new stack
-- Executing [6666666666@outgoing:2] BackGround("SIP/105-000000ac", "vm-enter-num-to-call") in new stack
-- <SIP/105-000000ac> Playing 'vm-enter-num-to-call.ulaw' (language 'ru')
-- Executing [6666666666@outgoing:3] SayDigits("SIP/105-000000ac", "4") in new stack
-- <SIP/105-000000ac> Playing 'digits/4.ulaw' (language 'ru')
-- Executing [6666666666@outgoing:4] Read("SIP/105-000000ac", "USANSWER,,1") in new stack
-- Accepting a maximum of 1 digits.
-- User entered '6'
-- Executing [6666666666@outgoing:5] GotoIf("SIP/105-000000ac", "6=4?msgok:msgcancel") in new stack
-- Goto (outgoing,6666666666,7) // прим. соответствует метке msgok
-- Executing [6666666666@outgoing:7] Macro("SIP/105-000000ac", "makecall,6666666666") in new stack
-- Executing [s@macro-makecall:2] Dial("SIP/105-000000ac", "SIP/TRUNK/6666666666") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/TRUNK/6666666666
-- SIP/TRUNK-000000ad is making progress passing it to SIP/105-000000ac
== Spawn extension (macro-makecall, s, 2) exited non-zero on 'SIP/105-000000ac' in macro 'makecall'
== Spawn extension (outgoing, 6666666666, 7) exited non-zero on 'SIP/105-000000ac'
Не зависимо от правильности ввода, совершается звонок. Помогите найти ошибку, пожалуйста (пробовал кавычки, пробелы; gotoif всегда возвращает 1)