[incoming-call]
;Работают правила по времени
exten => s,1, GotoIfTime(8:00-20:00,mon-fri,*,*?ivr-main,s,1)
exten => s,n, GotoIfTime(8:00-17:00,sat,*,*?ivr-main,s,1)
exten => s,n, GotoIfTime(10:00-15:00,sun,*,*?ivr-main,s,1)
exten => s,n, Playback(nonworkinghours)
exten => s,n, Goto(autoanswer,s,1)
exten => _X.,1, GotoIfTime(8:00-20:00,mon-fri,*,*?ivr-main,${EXTEN},1)
same => n, GotoIfTime(8:00-17:00,sat,*,*?ivr-main,${EXTEN},1)
same => n, GotoIfTime(10:00-15:00,sun,*,*?ivr-main,${EXTEN},1)
same => n, Playback(nonworkinghours)
same => n, Goto(autoanswer,s,1)
exten => 456,1,Dial(SIP/100&SIP/100&SIP/102,60,t))
exten => 456,1,NoOp(100 8sec 100+101 8sec 100+101+102)
same => n,Set(AGENT_EXT=NO)
same => n,ExecIF($["${DEVICE_STATE(SIP/100)}"="NOT_INUSE"]?Set(AGENT_EXT=${AGENT_EXT}&SIP/100))
same => n,ExecIF($["${AGENT_EXT}" != "NO"]?Dial(${AGENT_EXT:3}${FORWARD},8,t))
same => n,Set(AGENT_EXT=NO)
same => n,ExecIF($["${DEVICE_STATE(SIP/100)}"="NOT_INUSE"]?Set(AGENT_EXT=${AGENT_EXT}&SIP/100))
same => n,ExecIF($["${DEVICE_STATE(SIP/101)}"="NOT_INUSE"]?Set(AGENT_EXT=${AGENT_EXT}&SIP/101))
same => n,ExecIF($["${AGENT_EXT}" != "NO"]?Dial(${AGENT_EXT:3}${FORWARD},8,t))
same => n,Set(AGENT_EXT=NO)
same => n,ExecIF($["${DEVICE_STATE(SIP/100)}"="NOT_INUSE"]?Set(AGENT_EXT=${AGENT_EXT}&SIP/100))
same => n,ExecIF($["${DEVICE_STATE(SIP/101)}"="NOT_INUSE"]?Set(AGENT_EXT=${AGENT_EXT}&SIP/101))
same => n,ExecIF($["${DEVICE_STATE(SIP/102)}"="NOT_INUSE"]?Set(AGENT_EXT=${AGENT_EXT}&SIP/102))
same => n,ExecIF($["${AGENT_EXT}" != "NO"]?Dial(${AGENT_EXT:3}${FORWARD},60,t))
same => n,Hangup()
[100]
...
context=SIP-PHONE-100
[101]
...
context=SIP-PHONE-101
[SIP-PHONE-100]
include => internal
include => city
include => mg ; междугородка
[SIP-PHONE-101]
include => internal
include => city
[city]
exten => _NXXXXX,1,Dial(SIP/prov/${EXTEN},60,t)
[mg]
exten => _8NXXXXXXXXX,1,Dial(SIP/prov/${EXTEN},60,t)
возможно будет проще использовать сразу разделитель "\""
не проверял