スポイラーに隠された、tk。 画面を引き裂きます。
# Call-file Channel: SIP/cc_peer/ivr >----------\ Callerid: Robot | /--< Context: robot-test | | Extension: s | | | | | [robot-test] | | [ivr] | | exten => s,1,NoOp(Wait for init) <--/ \-----> exten => s,1,NoOp(IVR Start) same => n,Set(STATUS=) same => n,Answer() same => n,WaitExten(10) same => n,GotoIf($["${CURL(localhost/ping)}"!="PONG"]?err,1) /----------------------< same => n,Macro(robot,00) exten => 00,1,NoOp(Init done) <------------------------------/ same => n,Background(welcome) same => n,Wait(1) same => n(again),Background(press_1_for_status) same => n,SendDTMF(1) ; Press 1 for status >----------------\ same => n,WaitExten(5) same => n,WaitExten(10) \ same => n,Goto(err,1) \ exten => 10,1,NoOp(Status check) <---------------------------\ \--------------------> exten => 1,1,NoOp(Status check) <---------------------------------\ same => n,Wait(1) \-------------------------< same => n,Macro(robot,10) | same => n,SendDTMF(1234) ; Send pin code >----------------------------------------> same => n,Read(PIN,enter_pin,4) | same => n,WaitExten(10) same => n,Set(STATUS=${CURL(localhost/status?pin=${PIN})}) | same => n,GotoIf($["${STATUS}"=="ON"]?on) | exten => _1[12],1,NoOp(Status) <--------------------------------------------------\ same => n,GotoIf($["${STATUS}"=="OFF"]?off) | same => n,ExecIf($[${EXTEN}==11]?MSet(CURRENT=ON,NEW=OFF)) | same => n,Goto(err,1) | same => n,ExecIf($[${EXTEN}==12]?MSet(CURRENT=OFF,NEW=ON)) |---< same => n(on),Macro(robot,11) | same => n,GotoIf($["${STATUS}"==""]?toggle) | same => n,Background(status_on) | same => n,ExecIf($["${STATUS}"=="${CURRENT}"]?System(echo GOOD >> /cc_check.log)) | same => n,Goto(s,again) | same => n,ExecIf($["${STATUS}"!="${CURRENT}"]?System(echo BAD >> /cc_check.log)) \---< same => n(off),Macro(robot,12) | same => n,Hangup() same => n,Background(status_off) | same => n(toggle),NoOp(Toggle status) same => n,Goto(s,again) | same => n,Set(STATUS=${NEW}) /--------------------------------------------------------------------------------------------/ same => n,Set(RES=${CURL(localhost/status,status=${NEW})}) / exten => err,1,NoOp(Error occured) same => n,Wait(1) / /------< same => n,Macro(robot,99) same => n,SendDTMF(1) ; Press 1 for status >--------------------/ / same => n,Playback(error) same => n,WaitExten(10) / same => n,Hangup() / exten => i,1,System(echo BAD >> /cc_check.log) <---------------------------/ [macro-robot] exten => s,1,ExecIf($["${CALLERID(name)}"!="Robot"]?MacroExit()) same => n,Wait(1) same => n,SendDTMF(${ARG1})