I have a custom extension for our monitoring system zabbix, it send a call via asterisk to inform us with the problem on our servers,
the problem that I should add custom extension for each problem on each server and I have many extensions there to serve all alerts,
I need to know if I can use a varibles inside customer extension so I can reduce the file and arrange it
sample of extension I use
[HOSTRECOVERY|PROBLEMPROBLEMTYPE]
exten => h,1,Hangup
exten => s,1,Set(LOOPCOUNT=0)
exten => s,n,GotoIf($[“${CDR(disposition)}” = “ANSWERED”]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=1)
exten => s,n,agi(googletts.agi,"text to speach depenfs on the problem and hostname ",en)
exten => s,n,WaitExten(,)
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
exten => i,1,Playback(invalid)
exten => i,n,Goto(loop,1)
exten => t,1,Goto(loop,1)
exten => loop,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => loop,n,GotoIf($[${LOOPCOUNT} > 7]?hang,1)
exten => loop,n,Goto(HOSTRECOVERY|PROBLEMPROBLEMTYPE,s,begin)
Thanks