[asterisk-users] Pattern Extension not working in Dialplan

Anurag Rana anuragrana31189 at gmail.com
Mon Sep 8 14:53:23 CDT 2014


​Thanks. I will try it. Meanwhile I was trying below code.

call goes to 'test' context and from there is passed to macro 'age'.
In 'age' macro when I am using any patter to accept even single digit, its
not working. So instead of using pattern I hardcoded the extension, but
still when I am pressing the key '2' it is throwing below error.
Please note that when diaplan execution is inside macro 'age', it searches
the extension inside its parent context 'test'...why? am I do something
wrong?

[test]
exten=>s,1,Macro(age)

[macro-age]
exten=>s,1,Background(my/age)
exten=>s,2,WaitExten(15)
exten=>s,3,NoOp(${AGE})
exten=>s,n,GotoIf($[${LEN(${AGE})} > 0]?notEmpty)
exten=>s,n,Goto(s,1)
exten=>s(notEmpty),n,Background(my/thank-you)
exten=>s,n,Wait(1)

exten=>2,1,(TEMP=${EXTEN})   ;; exten=>_X,1,(TEMP=${EXTEN}) is also not
working
exten=>2,n,Read(AGE,,1,10)
exten=>2,n,Set(AGE=${${TEMP}*10+${AGE}})
exten=>2,n,Goto(s,3)
​


-----
​ OUTPUT -----​


​ == Using SIP RTP CoS mark 5
    -- Executing [s at test:1] Wait("SIP/101-00000005", "1") in new stack
    -- Executing [s at test:2] Macro("SIP/101-00000005", "age") in new stack
    -- Executing [s at macro-age:1] BackGround("SIP/101-00000005", "my/age")
in new stack
    -- <SIP/101-00000005> Playing 'my/age.slin' (language 'en')
[Sep  9 00:55:11] WARNING[9759][C-00000005]: pbx.c:6696 __ast_pbx_run:*
Invalid extension '2', but no rule 'i' or 'e' in context 'test'*
    -- Executing [h at test:1] NoOp("SIP/101-00000005", ",,,,,") in new stack
[Sep  9 00:55:11] NOTICE[9759]: pbx_spool.c:402 attempt_thread: Call
completed to SIP/XXXXXXXX
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140909/6e7e2069/attachment.html>


More information about the asterisk-users mailing list