[globals]
;определяет аварийный режим работы.0 — нормальный,1 — авария,переадр. на соотв. зв. файл
ALERT-SIMF=0
[Local_Default_CallingRules]
include = set-cf-default
include = en-always-cf
include = dis-always-cf
include = en-busy-cf
include = dis-busy-cf
include = en-noanswer-cf
include = dis-noanswer-cf
include = set-cf-number
include = set-cf-vm
include = en-dnd
include = dis-dnd
include = vmm
include = account-code-check
include = en-force-to-outside
include = dis-force-to-outside
include = en-force-to-inside
include = force-to-businesshours
include = parkedcalls
include = conferences
include = ringgroups
include = voicemenus
include = queues
include = voicemailgroups
include = pagegroups
include = page_an_extension
include = pickup_specific_extension
include = speed-dial-match
include = default
;инклюдим вкл,выкл аварийного режима
include = en-alert-time
include = dis-alert-time
;вкл аварийного режима
[en-alert-time]
exten = *076,1,Answer
exten = *076,n,Set(GLOBAL(ALERT-SIMF)=1)
exten = *076,n,Wait(1)
exten = *076,n,Playback(beep)
exten = *076,n,Wait(1)
exten = *076,n,Hangup()
;выкл аварийного режима
[dis-alert-time]
exten = *077,1,Answer
exten = *077,n,Set(GLOBAL(ALERT-SIMF)=0)
exten = *077,n,Wait(1)
exten = *077,n,Playback(beep)
exten = *077,n,Wait(1)
exten = *077,n,Hangup()
;добавляем зв.файл если в группе никого нет или занято
[ringroups-custom-simferopol]
exten = 621,1,Wait(1)
exten = 621,n,Dial(SIP/101&SIP/102&SIP/100,20,TtKkXxc)
exten = 621,n,Background(record/vsezanyati)
exten = 621,n,Hangup
;проигрывается если включен аварийный режим
[alert-simf]
exten = s,1,Background(record/alarm)
exten = s,n,Hangup
;
[macro-incoming_simf_in]
exten = s,1,Set(CDR(userfield)=Inbound)
;проверяем влючен ли аварийный режим.Если да,то отправляем на alert-simf
exten = s,n,GotoIf($[«${ALERT-SIMF}» = «1»]?alert-simf,s,1)
exten = s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?Blacklist-Handle,s,1)
exten = s,n,FindForMobile(${CALLERID(num)})
exten = s,n,GotoIf($[${LEN(${MobileToExten})}>1]?mobile-exten-match,${MobileToExten},1)
exten = s,n,Set(TRUNKDID=${IF($[${ARG2}=s]?${CALLERID(name)}:${ARG2})})
exten = s,n,CktStdCall(chantype,0,0)
exten = s,n,Set(ARG2=${IF($[${REPLACEEXTEN}=0]?${ARG2}:.)})
exten = s,n,GotoByTimeCondition(micronet,voicemenu-custom-micronet,661,1,,custom-voice-mail,100,1,,Always-Hangup,s,1,)
exten = s,102,Goto(Blacklist-Handle,s,1)
[custom-voice-mail]
;добавляем свой голосовой файл перед записью
exten = 100,1,Background(record/golpochta)
exten = 100,2,Voicemail(100,s)