[AsteriskBrasil] Cadeado Asterisk, erro de dbget
José Carlos Messias
zehkarlos em gmail.com
Segunda Junho 23 18:29:11 BRT 2008
[cadeado]
;cadastrar senha cadeado
exten => _0110XXXX,1,NoCDR()
exten => _0110XXXX,2,Set(senha=${DB(cadepwd/${CALLERID(num)})});
exten => _0110XXXX,3,GoToIf($["${senha}" = ""]?5:4)
exten => _0110XXXX,4,Hangup
exten => _0110XXXX,5,Set(DB(cadepwd/${CALLERID(num)})=${EXTEN:4})
exten => _0110XXXX,6,Wait(2)
exten => _0110XXXX,7,Playback(beep)
exten => _0110XXXX,8,Playback(beep)
exten => _0110XXXX,9,Playback(beep)
exten => _0110XXXX,10,Hangup
;trocar senha cadeado
exten => _0120XXXXXXXX,1,NoCDR()
exten => _0120XXXXXXXX,2,Set(cadp=${DB(cadepwd/${CALLERID(num)})});
exten => _0120XXXXXXXX,3,GoToIf($["${cadp}" = "${EXTEN:4:4}"]?4:9)
exten => _0120XXXXXXXX,4,Set(DB(cadepwd/${CALLERID(num)})=${EXTEN:8})
exten => _0120XXXXXXXX,5,Wait(2)
exten => _0120XXXXXXXX,6,Playback(beep)
exten => _0120XXXXXXXX,7,Playback(beep)
exten => _0120XXXXXXXX,8,Playback(beep)
exten => _0120XXXXXXXX,9,Hangup
exten => _0120XXXXXXXX,10,Hangup
;colocar cadeado
exten => _0130XXXX,1,NoCDR()
exten => _0130XXXX,2,Set(cadp=${DB(cadepwd/${CALLERID(num)})});
exten => _0130XXXX,3,GoToIf($["${cadp}" = "${EXTEN:4}"]?4:9)
exten => _0130XXXX,4,Set(DB(cadeado/${CALLERID(num)})=y
exten => _0130XXXX,5,Wait(2)
exten => _0130XXXX,6,Playback(beep)
exten => _0130XXXX,7,Playback(beep)
exten => _0130XXXX,8,Playback(beep)
exten => _0130XXXX,9,Hangup
exten => _0130XXXX,10,Hangup
;retirar cadeado
exten => _0140XXXX,1,NoCDR()
exten => _0140XXXX,2,Set(cad=${DB(cadepwd/${CALLERID(num)})});
exten => _0140XXXX,3,GoToIf($["${cad}" = "${EXTEN:4}"]?4:10)
exten => _0140XXXX,4,DBdel(cadeado/${CALLERID(num)})
;exten => _0140XXXX,4,Set(DB(cadeado/${CALLERID(num)})=n
exten => _0140XXXX,5,Wait(2)
exten => _0140XXXX,6,Playback(beep)
exten => _0140XXXX,7,Playback(beep)
exten => _0140XXXX,8,Playback(beep)
exten => _0140XXXX,9,Hangup
exten => _0140XXXX,10,Hangup
na macro
exten=>s,n,Set(CAD=${DB(cadeado/${CALLERID(num)}):0:1}) ;checa cadeado/trava
exten=>s, n,GotoIf($["${CAD}" = "y"]?end) ;se estiver com cadeado faz
hangup, desliga
exten=>s, n(end),Hangup()
More information about the AsteriskBrasil
mailing list