Код: Выделить всё
[mera-callback-out2] ; сюда падаем после ответа
exten => s,1,Answer()
exten => s,n,Set(Prohod=0)
exten => s,n,Wait(1)
;Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])
exten => s,n(nach),Read(EXT,callback/priglash,18,,,5)
exten => s,n,Set(Prohod=${MATH(${Prohod}+1)})
exten => s,n,GotoIF($[${Prohod} > 5]?t,1) ; рубим криворуких после 5 попыток
exten => s,n,GotoIf($[${LEN(${EXT})} >= 6]?${EXT},1:i,1)
exten => _8XXXXXXXXXX,1,Dial(SIP/kamailio-callback/${EXTEN},60)
exten => _8XXXXXXXXXX,n,Set(CALLBACK_EXTEN=${EXTEN})
exten => _8XXXXXXXXXX,n,NoOp(DIALSTATUS: ${DIALSTATUS})
exten => _8XXXXXXXXXX,n,Goto(s-${DIALSTATUS},1)
exten => _NXXXXX,1,Dial(SIP/kamailio-callback/${EXTEN},60)
exten => _NXXXXX,n,Set(CALLBACK_EXTEN=${EXTEN})
exten => _NXXXXX,n,NoOp(DIALSTATUS: ${DIALSTATUS})
exten => _NXXXXX,n,Goto(s-${DIALSTATUS},1)
exten => s-BUSY,1,Goto(busy,1)
exten => s-NOANSWER,1,Goto(noanswer,1)
exten => _s-.,1,Goto(hz,1)
exten => busy,1,PlayBack(callback/busy)
exten => busy,n,Goto(mera-callback-menu,s,1)
exten => noanswer,1,PlayBack(callback/no_answer)
exten => noanswer,n,Goto(mera-callback-menu,s,1)
exten => hz,1,PlayBack(callback/chanuval)
exten => hz,n,Goto(mera-callback-menu,s,1)
exten => i,1,PlayBack(callback/bad_nom)
exten => i,n,Goto(mera-callback-out2,s,nach)
exten => t,1,PlayBack(callback/timeout)
exten => t,n,Hangup()
[mera-callback-menu] ; это для выбора что делать (1- повторный набор, 2 - на другой номер если не отвечает первый)
exten => s,1,Background(callback/menu)
exten => s,n,WaitExten
exten => 1,1,PlayBack(callback/repeat)
exten => 1,n,Goto(mera-callback-out2,${CALLBACK_EXTEN},1)
exten => 2,1,Goto(mera-callback-out2,s,nach)
exten => i,1,PlayBack(callback/bad_nom)
exten => i,n,Goto(mera-callback-menu,s,1)
exten => t,1,PlayBack(callback/timeout)
exten => t,n,Hangup()
Код: Выделить всё
== Using SIP RTP CoS mark 5
> Channel SIP/multifon-00000007 was answered.
-- Executing [s@mera-callback-out2:1] Answer("SIP/multifon-00000007", "") in new stack
-- Executing [s@mera-callback-out2:2] Set("SIP/multifon-00000007", "Prohod=0") in new stack
-- Executing [s@mera-callback-out2:3] Wait("SIP/multifon-00000007", "1") in new stack
-- Executing [s@mera-callback-out2:4] Read("SIP/multifon-00000007", "EXT,callback/priglash,18,,,5") in new stack
-- Accepting a maximum of 18 digits.
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File callback/priglash does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open callback/priglash (format 0x4 (ulaw)): No such file or directory
-- User disconnected
-- Executing [s@mera-callback-out2:5] Set("SIP/multifon-00000007", "Prohod=1.000000") in new stack
-- Executing [s@mera-callback-out2:6] GotoIf("SIP/multifon-00000007", "0?t,1") in new stack
-- Executing [s@mera-callback-out2:7] GotoIf("SIP/multifon-00000007", "0?,1:i,1") in new stack
-- Goto (mera-callback-out2,i,1)
-- Executing [i@mera-callback-out2:1] Playback("SIP/multifon-00000007", "bad_nom") in new stack
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File bad_nom does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open bad_nom (format 0x4 (ulaw)): No such file or directory
[Aug 8 12:28:33] WARNING[1601]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/multifon-00000007 for bad_nom
-- Executing [i@mera-callback-out2:2] Goto("SIP/multifon-00000007", "mera-callback-out2,s,nach") in new stack
-- Goto (mera-callback-out2,s,4)
-- Executing [s@mera-callback-out2:4] Read("SIP/multifon-00000007", "EXT,callback/priglash,18,,,5") in new stack
-- Accepting a maximum of 18 digits.
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File callback/priglash does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open callback/priglash (format 0x4 (ulaw)): No such file or directory
-- User disconnected
-- Executing [s@mera-callback-out2:5] Set("SIP/multifon-00000007", "Prohod=2.000000") in new stack
-- Executing [s@mera-callback-out2:6] GotoIf("SIP/multifon-00000007", "0?t,1") in new stack
-- Executing [s@mera-callback-out2:7] GotoIf("SIP/multifon-00000007", "0?,1:i,1") in new stack
-- Goto (mera-callback-out2,i,1)
-- Executing [i@mera-callback-out2:1] Playback("SIP/multifon-00000007", "bad_nom") in new stack
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File bad_nom does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open bad_nom (format 0x4 (ulaw)): No such file or directory
[Aug 8 12:28:33] WARNING[1601]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/multifon-00000007 for bad_nom
-- Executing [i@mera-callback-out2:2] Goto("SIP/multifon-00000007", "mera-callback-out2,s,nach") in new stack
-- Goto (mera-callback-out2,s,4)
-- Executing [s@mera-callback-out2:4] Read("SIP/multifon-00000007", "EXT,callback/priglash,18,,,5") in new stack
-- Accepting a maximum of 18 digits.
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File callback/priglash does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open callback/priglash (format 0x4 (ulaw)): No such file or directory
-- User disconnected
-- Executing [s@mera-callback-out2:5] Set("SIP/multifon-00000007", "Prohod=3.000000") in new stack
-- Executing [s@mera-callback-out2:6] GotoIf("SIP/multifon-00000007", "0?t,1") in new stack
-- Executing [s@mera-callback-out2:7] GotoIf("SIP/multifon-00000007", "0?,1:i,1") in new stack
-- Goto (mera-callback-out2,i,1)
-- Executing [i@mera-callback-out2:1] Playback("SIP/multifon-00000007", "bad_nom") in new stack
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File bad_nom does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open bad_nom (format 0x4 (ulaw)): No such file or directory
[Aug 8 12:28:33] WARNING[1601]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/multifon-00000007 for bad_nom
-- Executing [i@mera-callback-out2:2] Goto("SIP/multifon-00000007", "mera-callback-out2,s,nach") in new stack
-- Goto (mera-callback-out2,s,4)
-- Executing [s@mera-callback-out2:4] Read("SIP/multifon-00000007", "EXT,callback/priglash,18,,,5") in new stack
-- Accepting a maximum of 18 digits.
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File callback/priglash does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open callback/priglash (format 0x4 (ulaw)): No such file or directory
-- User disconnected
-- Executing [s@mera-callback-out2:5] Set("SIP/multifon-00000007", "Prohod=4.000000") in new stack
-- Executing [s@mera-callback-out2:6] GotoIf("SIP/multifon-00000007", "0?t,1") in new stack
-- Executing [s@mera-callback-out2:7] GotoIf("SIP/multifon-00000007", "0?,1:i,1") in new stack
-- Goto (mera-callback-out2,i,1)
-- Executing [i@mera-callback-out2:1] Playback("SIP/multifon-00000007", "bad_nom") in new stack
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File bad_nom does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open bad_nom (format 0x4 (ulaw)): No such file or directory
[Aug 8 12:28:33] WARNING[1601]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/multifon-00000007 for bad_nom
-- Executing [i@mera-callback-out2:2] Goto("SIP/multifon-00000007", "mera-callback-out2,s,nach") in new stack
-- Goto (mera-callback-out2,s,4)
-- Executing [s@mera-callback-out2:4] Read("SIP/multifon-00000007", "EXT,callback/priglash,18,,,5") in new stack
-- Accepting a maximum of 18 digits.
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File callback/priglash does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open callback/priglash (format 0x4 (ulaw)): No such file or directory
-- User disconnected
-- Executing [s@mera-callback-out2:5] Set("SIP/multifon-00000007", "Prohod=5.000000") in new stack
-- Executing [s@mera-callback-out2:6] GotoIf("SIP/multifon-00000007", "0?t,1") in new stack
-- Executing [s@mera-callback-out2:7] GotoIf("SIP/multifon-00000007", "0?,1:i,1") in new stack
-- Goto (mera-callback-out2,i,1)
-- Executing [i@mera-callback-out2:1] Playback("SIP/multifon-00000007", "bad_nom") in new stack
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File bad_nom does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open bad_nom (format 0x4 (ulaw)): No such file or directory
[Aug 8 12:28:33] WARNING[1601]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/multifon-00000007 for bad_nom
-- Executing [i@mera-callback-out2:2] Goto("SIP/multifon-00000007", "mera-callback-out2,s,nach") in new stack
-- Goto (mera-callback-out2,s,4)
-- Executing [s@mera-callback-out2:4] Read("SIP/multifon-00000007", "EXT,callback/priglash,18,,,5") in new stack
-- Accepting a maximum of 18 digits.
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File callback/priglash does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open callback/priglash (format 0x4 (ulaw)): No such file or directory
-- User disconnected
-- Executing [s@mera-callback-out2:5] Set("SIP/multifon-00000007", "Prohod=6.000000") in new stack
-- Executing [s@mera-callback-out2:6] GotoIf("SIP/multifon-00000007", "1?t,1") in new stack
-- Goto (mera-callback-out2,t,1)
-- Executing [t@mera-callback-out2:1] Playback("SIP/multifon-00000007", "timeout") in new stack
[Aug 8 12:28:33] WARNING[1601]: file.c:663 ast_openstream_full: File timeout does not exist in any format
[Aug 8 12:28:33] WARNING[1601]: file.c:958 ast_streamfile: Unable to open timeout (format 0x4 (ulaw)): No such file or directory
[Aug 8 12:28:33] WARNING[1601]: app_playback.c:475 playback_exec: ast_streamfile failed on SIP/multifon-00000007 for timeout
-- Executing [t@mera-callback-out2:2] Hangup("SIP/multifon-00000007", "") in new stack
== Spawn extension (mera-callback-out2, t, 2) exited non-zero on 'SIP/multifon-00000007'
[Aug 8 12:28:33] NOTICE[1601]: pbx_spool.c:366 attempt_thread: Call completed to SIP/multifon/79251891044
i-peak*CLI>