Как заставить asterisk ждать полного завершения скрипта?
Код: Выделить всё
[ivr-main]
exten => s,1,NoOp(-----Start IVR-----)
exten => s,n,Playback(/var/lib/asterisk/sounds/custom/Welcome_gsm)
exten => s,n,Answer
exten => s,n,NoOp(---Start check abon---)
exten => s,n,Verbose(Check DB if response 5)
exten => s,n,AGI(ivr-main.sh, ${CALLERID(num)})
exten => s,n,GotoIf($["${response}" = "5"]?connection:notconnection)
exten => s,n(notconnection),Goto(ext-queues,001,3)
exten => s,n(connection),GotoIf($["${uid}" = "1"]?exist:notexist)
exten => s,n,Verbose(Uid if notexist 1 ${uid})
exten => s,n,GoToIf($["${uid}" = "1"]?exist:notexist)
exten => s,n(exist),Goto(ext-queues,001,3)
exten => s,n,Verbose(Deposit if exist deb 1 ${deposit})
exten => s,n(notexist),GotoIf($["${deposit}" = "2"]?debtor:notdebtor)
exten => s,n(debtor),Playback(/var/lib/asterisk/sounds/custom/thanks_opinion_gsm)
exten => s,n,Wait(1)
exten => s,n(debtor),Goto(ivr-digit-money,s,1)
exten => s,n,Verbose(Deposit if exist ping 3 ${ping})
exten => s,n(notdebtor),GotoIf($["${ping}" = "4"]?allok:notok)
exten => s,n(allok),Playback(/var/lib/asterisk/sounds/custom/thanks_opinion_gsm)
exten => s,n(allok),Goto(ivr-digit-sw,s,1)
exten => s,n(notok),Goto(ext-queues,001,3)
[ivr-digit-money]
exten => s,1,NoOp(Start IVR money)
exten => s,n,Background(/var/lib/asterisk/sounds/custom/thanks_opinion_gsm)
exten => s,n,Background(silence/10,m)
exten => s,n,Background(/var/lib/asterisk/sounds/custom/thanks_opinion_gsm)
exten => s,n,Background(silence/10,m)
exten => s,n,Macro(hangupcall,)
exten => 1,1,NoOp(Press one money)
exten => 1,n,Background(/var/lib/asterisk/sounds/custom/thanks_opinion_gsm)
exten => 1,n,Macro(hangupcall,)
exten => 2,1,Goto(ext-queues,001,3)
[ivr-digit-sw]
exten => s,1,NoOp(Start IVR sw)
exten => s,n,Background(/var/lib/asterisk/sounds/custom/thanks_opinion_gsm)
exten => s,n,Background(silence/10,m)
exten => s,n,Background(/var/lib/asterisk/sounds/custom/thanks_opinion_gsm)
exten => s,n,Background(silence/10,m)
exten => s,n,Macro(hangupcall,)
exten => 1,1,NoOp(Press one sw)
exten => 1,n,AGI(create_tt.sh, ${CALLERID(num)})
exten => 1,n,NoOp(---Start check DB ivr-sw---)
exten => 1,n,Verbose(Check DB if response ${ttexist} 2 )
exten => 1,n,GotoIf($["${ttexist}" = "2"]?connection:notconnection)
exten => 1,n(connection),GotoIf($["${ttexist}" = "2"]?ticketswexist:ticketswnoexist)
exten => 1,n(notconnection),Goto(ext-queues,001,3)
Vladyslav Makogon, [14.06.19 17:56]
exten => 1,n,Verbose(Chek tt if exist tt 2 ${ttexist})
;exten => 1,n,GotoIf($["${ttexist}" = "2"]?ticketswexist:ticketswnoexist)
exten => 1,n(ticketswexist),Playback(/var/lib/asterisk/sounds/custom/queue_2018_gsm)
exten => 1,n,Macro(hangupcall,)
exten => 1,n(ticketswnoexist),Goto(ivr-create-tt,s,1)
exten => 2,1,Goto(ext-queues,001,3)
[ivr-create-tt]
exten => s,1,NoOp(Start IVR create ttt)
exten => s,n,Playback(/var/lib/asterisk/sounds/custom/thanks_opinion_gsm)
exten => s,n,Macro(hangupcall,)