1 | изначальная версия редактировать | |
Доброго дня! Исходя из этого, подредактировал под себя и получил следующее:
[gates]
exten => _7XXXXXXXXXX,1,Set(num=${EXTEN})
exten => _9XXXXXXXXXX,2,Goto(gate_variants,${RAND(1,6)},1)
[gate_variants]
exten => 1,1,Set(DO=1-2-3)
exten => 2,1,Set(DO=1-3-2)
exten => 3,1,Set(DO=2-1-3)
exten => 4,1,Set(DO=2-3-1)
exten => 5,1,Set(DO=3-1-2)
exten => 6,1,Set(DO=3-2-1)
exten => _[1-6],2,goto(s,1)
exten => s,1,Set(i=0)
exten => s,n(loop),Set(i=$[ i + 1])
exten => s,n,Set(do_now=${CUT(DO,-,${i})})
exten => s,n,GotoIF($[ "${do_now}" == "" ]?end)
exten => s,n,Dial(IAX2/manager${do_now}/${num},,g)
exten => s,n,Goto({DIALSTATUS},1)
exten => s,n(end),Hangup()
;
exten => BUSY,1,Goto(s,loop)
exten => CONGESTION,1,Goto(s,loop)
exten => FAIL,1,Goto(s,loop)
exten => NOANSWER,1,Goto(s,loop)
exten => ANSWER,1,Hangup
exten => ANSWERED,1,Hangup()
В итоге в логах получаю следующее:
== Using SIP RTP CoS mark 5
-- Executing [7XXXXXXXXXX@gates:1] Set("SIP/test-000001b1", "num=7XXXXXXXXXX") in new stack
-- Executing [7XXXXXXXXXX@gates:2] Goto("SIP/test-000001b1", "gate_variants,6,1") in new stack
-- Goto (gate_variants,6,1)
-- Executing [6@gate_variants:1] Set("SIP/test-000001b1", "DO=3-2-1") in new stack
-- Executing [6@gate_variants:2] Goto("SIP/test-000001b1", "s,1") in new stack
-- Goto (gate_variants,s,1)
-- Executing [s@gate_variants:1] Set("SIP/test-000001b1", "i=0") in new stack
[Mar 7 07:02:29] WARNING[25761]: ast_expr2.y:1286 op_plus: non-numeric argument
-- Executing [s@gate_variants:2] Set("SIP/test-000001b1", "i=1") in new stack
-- Executing [s@gate_variants:3] Set("SIP/test-000001b1", "do_now=3") in new stack
-- Executing [s@gate_variants:4] GotoIf("SIP/test-000001b1", "0?end") in new stack
-- Executing [s@gate_variants:5] Dial("SIP/test-000001b1", "IAX2/manager3/7XXXXXXXXXX,,g") in new stack
[Mar 7 07:02:29] WARNING[25761]: app_dial.c:2198 dial_exec_full: Unable to create channel of type 'IAX2' (cause 20 - Unknown)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [s@gate_variants:6] Goto("SIP/test-000001b1", "{DIALSTATUS},1") in new stack
-- Goto (gate_variants,{DIALSTATUS},1)
[Mar 7 07:02:29] WARNING[25761]: pbx.c:4971 __ast_pbx_run: Channel 'SIP/test-000001b1' sent into invalid extension '{DIALSTATUS}' in context 'gate_variants', but no invalid handler
Подскажите, где я накосячил?
P.S. На момент звонка manager3 был отключен.
2 | No.2 Revision редактировать |
Доброго дня! Исходя из этого, подредактировал под себя и получил следующее:
[gates]
exten => _7XXXXXXXXXX,1,Set(num=${EXTEN})
exten => _9XXXXXXXXXX,2,Goto(gate_variants,${RAND(1,6)},1)
_7XXXXXXXXXX,2,Goto(gate_variants,${RAND(1,6)},1)
[gate_variants]
exten => 1,1,Set(DO=1-2-3)
exten => 2,1,Set(DO=1-3-2)
exten => 3,1,Set(DO=2-1-3)
exten => 4,1,Set(DO=2-3-1)
exten => 5,1,Set(DO=3-1-2)
exten => 6,1,Set(DO=3-2-1)
exten => _[1-6],2,goto(s,1)
exten => s,1,Set(i=0)
exten => s,n(loop),Set(i=$[ i + 1])
exten => s,n,Set(do_now=${CUT(DO,-,${i})})
exten => s,n,GotoIF($[ "${do_now}" == "" ]?end)
exten => s,n,Dial(IAX2/manager${do_now}/${num},,g)
exten => s,n,Goto({DIALSTATUS},1)
exten => s,n(end),Hangup()
;
exten => BUSY,1,Goto(s,loop)
exten => CONGESTION,1,Goto(s,loop)
exten => FAIL,1,Goto(s,loop)
exten => NOANSWER,1,Goto(s,loop)
exten => ANSWER,1,Hangup
exten => ANSWERED,1,Hangup()
В итоге в логах получаю следующее:
== Using SIP RTP CoS mark 5
-- Executing [7XXXXXXXXXX@gates:1] Set("SIP/test-000001b1", "num=7XXXXXXXXXX") in new stack
-- Executing [7XXXXXXXXXX@gates:2] Goto("SIP/test-000001b1", "gate_variants,6,1") in new stack
-- Goto (gate_variants,6,1)
-- Executing [6@gate_variants:1] Set("SIP/test-000001b1", "DO=3-2-1") in new stack
-- Executing [6@gate_variants:2] Goto("SIP/test-000001b1", "s,1") in new stack
-- Goto (gate_variants,s,1)
-- Executing [s@gate_variants:1] Set("SIP/test-000001b1", "i=0") in new stack
[Mar 7 07:02:29] WARNING[25761]: ast_expr2.y:1286 op_plus: non-numeric argument
-- Executing [s@gate_variants:2] Set("SIP/test-000001b1", "i=1") in new stack
-- Executing [s@gate_variants:3] Set("SIP/test-000001b1", "do_now=3") in new stack
-- Executing [s@gate_variants:4] GotoIf("SIP/test-000001b1", "0?end") in new stack
-- Executing [s@gate_variants:5] Dial("SIP/test-000001b1", "IAX2/manager3/7XXXXXXXXXX,,g") in new stack
[Mar 7 07:02:29] WARNING[25761]: app_dial.c:2198 dial_exec_full: Unable to create channel of type 'IAX2' (cause 20 - Unknown)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [s@gate_variants:6] Goto("SIP/test-000001b1", "{DIALSTATUS},1") in new stack
-- Goto (gate_variants,{DIALSTATUS},1)
[Mar 7 07:02:29] WARNING[25761]: pbx.c:4971 __ast_pbx_run: Channel 'SIP/test-000001b1' sent into invalid extension '{DIALSTATUS}' in context 'gate_variants', but no invalid handler
Подскажите, где я накосячил?
P.S. На момент звонка manager3 был отключен.
Проект компании "АТС Дизайн"
Asterisk® и Digium® являются зарегистрированными торговыми марками компании
Digium, Inc., США.
IP АТС Asterisk распространяется под лицензией
GNU GPL.