Код: Выделить всё
[myIVR]
exten => s,1,GotoIfTime(7:59-20:01|mon-fri|*|*?myIVR,s,n(startt))
exten => s,n,GotoIfTime(20:01-7:59|mon-fri|*|*?Close,s,1)
exten => s,n(startt),Answer(); Ответ
exten => s,n(!!1privet),Background(!!1privet) ; Приветствие
exten => s,n(!!2press_1),Background(!!2press_1) ; Рассказываем о возможности набрать цифры 1,2 и т.д.
exten => s,n(!!3press_2),Background(!!3press_2)
exten => s,n(!!4press_3),Background(!!4press_3)
exten => s,n(!!blabla),Background(!!blabla)
exten => s,n,WaitExten(2) ; Ожидание ввода от пользователя
exten => 1,1,Playback(!!bla)
exten => 1,2,Playback(!!blabla)
exten => 1,3,Set(fname=IN-${STRFTIME(${EPOCH},,%Y%m%d%H%M)}-${CALLERID(number)}-TO${EXTEN})
exten => 1,4,MixMonitor(${fname}.wav)
exten => 1,5,Dial(SIP/102&SIP/103&SIP/104&SIP/108&SIP/107&SIP/105&SIP/106,10) ;Звоним группе
exten => 1,6,Hangup()
exten => 2,1,Background(!!bla)
exten => 2,2,Set(fname=IN-${STRFTIME(${EPOCH},,%Y%m%d%H%M)}-${CALLERID(number)}-TO${EXTEN})
exten => 2,3,MixMonitor(${fname}.wav)
exten => 2,4,Dial(SIP/201,10); Звоним кому-то
exten => 2,5,Dial(Dahdi/g0/8блаблапереадресация) ;
exten => 2,6,Hangup()
exten => 3,1,Background(!!bla)
exten => 3,2,Set(fname=IN-${STRFTIME(${EPOCH},,%Y%m%d%H%M)}-${CALLERID(number)}-TO${EXTEN})
exten => 3,3,MixMonitor(${fname}.wav)
exten => 3,4,Dial(SIP/203,20)
exten => 3,5,Hangup()
exten => _1XN,1,Playback(!!bla)
exten => _1XN,2,Playback(!!blabla)
exten => _1XN,3,Set(fname=IN-${STRFTIME(${EPOCH},,%Y%m%d%H%M)}-${CALLERID(number)}-TO${EXTEN})
exten => _1XN,4,MixMonitor(${fname}.wav)
exten => _1XN,5,Dial(SIP/${EXTEN},10); Звоним кому-то
exten => _1XN,6,Hangup()
exten => i,1,Background(!!nomer_ne_sushestvuet)
exten => i,n,Goto(myIVR,1,1) ; Переводим звонок группе
exten => t,1,Goto(myIVR,1,1)) ; По таймауту тоже переводим группе
exten => t,n,Hangup() ; и вешаем трубку (на всякий случай)
Код: Выделить всё
include => myIVR
по таймауту имеем сброс :
Код: Выделить всё
Accepting call from 'блабланомер' to 'другойблабланомер' on channel 0/2, span 1
-- Executing [блабланомер@from-pstn:1] Set("DAHDI/2-1", "__FROM_DID=блабланомер") in new stack
-- Executing [блабланомер@from-pstn:2] NoOp("DAHDI/2-1", "Received an unknown call with DID set to блабланомер") in new stack
-- Executing [блабланомер@from-pstn:3] Goto("DAHDI/2-1", "s,a2") in new stack
-- Goto (from-pstn,s,2)
-- Executing [s@from-pstn:2] BackGround("DAHDI/2-1", "!!1privet") in new stack
-- DAHDI/1-1 is proceeding passing it to SIP/303-095442e8
-- <DAHDI/2-1> Playing '!!1privet.slin' (language 'en')
-- DAHDI/1-1 answered SIP/303-095442e8
-- Executing [s@from-pstn:3] BackGround("DAHDI/2-1", "!!2press_1") in new stack
-- <DAHDI/2-1> Playing '!!2press_1.slin' (language 'en')
-- Executing [s@from-pstn:4] BackGround("DAHDI/2-1", "!!3press_2") in new stack
-- <DAHDI/2-1> Playing '!!3press_2.slin' (language 'en')
-- Executing [s@from-pstn:5] BackGround("DAHDI/2-1", "!!4press_3") in new stack
-- <DAHDI/2-1> Playing '!!4press_3.slin' (language 'en')
-- Executing [s@from-pstn:6] BackGround("DAHDI/2-1", "!!blabla") in new stack
-- <DAHDI/2-1> Playing '!!blabla.slin' (language 'en')
-- Auto fallthrough, channel 'DAHDI/2-1' status is 'UNKNOWN'
-- Executing [h@from-pstn:1] Hangup("DAHDI/2-1", "") in new stack
== Spawn extension (from-pstn, h, 1) exited non-zero on 'DAHDI/2-1'
-- Hungup 'DAHDI/2-1'
-- Channel 0/1, span 1 got hangup request, cause 16
Код: Выделить всё
-- Accepting call from 'блабланомер' to 'другойблабланомер' on channel 0/2, span 1
-- Executing [блабланомер@from-pstn:1] Set("DAHDI/2-1", "__FROM_DID=блабланомер") in new stack
-- Executing [блабланомер@from-pstn:2] NoOp("DAHDI/2-1", "Received an unknown call with DID set to блабланомер") in new stack
-- Executing [блабланомер@from-pstn:3] Goto("DAHDI/2-1", "s,a2") in new stack
-- Goto (from-pstn,s,2)
-- Executing [s@from-pstn:2] BackGround("DAHDI/2-1", "!!1privet") in new stack
-- <DAHDI/2-1> Playing '!!1privet.slin' (language 'en')
-- DAHDI/1-1 is proceeding passing it to SIP/303-095442e8
-- DAHDI/1-1 answered SIP/303-095442e8
Здесь я ввожу неверный номер, например, 123456, который нигде не прописан
== CDR updated on DAHDI/2-1
-- Executing [123456@from-pstn:1] Set("DAHDI/2-1", "__FROM_DID=123456") in new stack
-- Executing [123456@from-pstn:2] NoOp("DAHDI/2-1", "Received an unknown call with DID set to 123456") in new stack
-- Executing [123456@from-pstn:3] Goto("DAHDI/2-1", "s,a2") in new stack
-- Goto (from-pstn,s,2)
И начинается опять сначала
-- Executing [s@from-pstn:2] BackGround("DAHDI/2-1", "!!1privet") in new stack
-- <DAHDI/2-1> Playing '!!1privet.slin' (language 'en')