exten => _0033.,1,Set(NONOHFREIMINUTEN=$[200 - ${DB(nonoh/minutes1)} - ${DB(nonoh/minutes2)} - ${DB(nonoh/minutes3)} - ${DB(nonoh/minutes4)} - ${DB(nonoh/minutes5)} - ${DB(nonoh/minutes6)} - ${DB(nonoh/minutes7)}])
exten => _0033.,n,Set(12VOIPFREIMINUTEN=$[300 - ${DB(12voip/minutes1)} - ${DB(12voip/minutes2)} - ${DB(12voip/minutes3)} - ${DB(12voip/minutes4)} - ${DB(12voip/minutes5)} - ${DB(12voip/minutes6)} - ${DB(12voip/minutes7)}])
exten => _0033.,n,Set(JUSTVOIPFREIMINUTEN=$[300 - ${DB(justvoip/minutes1)} - ${DB(justvoip/minutes2)} - ${DB(justvoip/minutes3)} - ${DB(justvoip/minutes4)} - ${DB(justvoip/minutes5)} - ${DB(justvoip/minutes6)} - ${DB(justvoip/minutes7)}])
exten => _0033.,n,Set(SMSLISTOFREIMINUTEN=$[300 - ${DB(smslisto/minutes1)} - ${DB(smslisto/minutes2)} - ${DB(smslisto/minutes3)} - ${DB(smslisto/minutes4)} - ${DB(smslisto/minutes5)} - ${DB(smslisto/minutes6)} - ${DB(smslisto/minutes7)}])
exten => _0033.,n,Set(LIMIT_WARNING_FILE=noch60sekunden)
exten => _0033.,n,GotoIf($[${CALLERID(name):0:8} = callback]?keinplayback:)
exten => _0033.,n,Playback(kostenlos)
exten => _0033.,n(keinplayback),Set(CALLERID(all)=Anonymous)
exten => _0033.,n,Set(NONOHCALL=N)
exten => _0033.,n,Set(12VOIPCALL=N)
exten => _0033.,n,Set(JUSTVOIPCALL=N)
exten => _0033.,n,Set(SMSLISTOCALL=N)
exten => _0033.,n,GotoIf($[${SMSLISTOFREIMINUTEN} > 200]?smslistocall:)
exten => _0033.,n,GotoIf($[${JUSTVOIPFREIMINUTEN} > 200]?justvoipcall:)
exten => _0033.,n,GotoIf($[${12VOIPFREIMINUTEN} > 200]?twelvevoipcall:)
exten => _0033.,n,GotoIf($[${JUSTVOIPFREIMINUTEN} > 100]?justvoipcall:)
exten => _0033.,n,GotoIf($[${12VOIPFREIMINUTEN} > 100]?twelvevoipcall:)
exten => _0033.,n,GotoIf($[${NONOHFREIMINUTEN} > 100]?nonohcall:)
exten => _0033.,n,GotoIf($[${SMSLISTOFREIMINUTEN} > 100]?smslistocall:)
exten => _0033.,n,GotoIf($[${SMSLISTOFREIMINUTEN} > 50]?smslisto:)
exten => _0033.,n,GotoIf($[${JUSTVOIPFREIMINUTEN} > 50]?justvoip:)
exten => _0033.,n,GotoIf($[${12VOIPFREIMINUTEN} > 50]?twelvevoip:)
exten => _0033.,n,GotoIf($[${NONOHFREIMINUTEN} > 50]?nonoh:)
exten => _0033.,n,GotoIf($[${SMSLISTOFREIMINUTEN} > 20]?smslisto:)
exten => _0033.,n,GotoIf($[${JUSTVOIPFREIMINUTEN} > 20]?justvoip:)
exten => _0033.,n,GotoIf($[${12VOIPFREIMINUTEN} > 20]?twelvevoip:)
exten => _0033.,n,GotoIf($[${NONOHFREIMINUTEN} > 20]?nonoh:)
exten => _0033.,n(smslisto),GotoIf($[${JUSTVOIPFREIMINUTEN} > 0]?:nonoh)
exten => _0033.,n,PlayBack(vm-youhave)
exten => _0033.,n,SayNumber(${SMSLISTOFREIMINUTEN})
exten => _0033.,n,PlayBack(minutes)
exten => _0033.,n(smslistocall),Set(SMSLISTOCALL=Y)
exten => _0033.,n,Dial(SIP/${EXTEN}@smslisto,60,L($[${SMSLISTOFREIMINUTEN} * 60000]:$[$[${SMSLISTOFREIMINUTEN} * 60000] - 60000]))
exten => _0033.,n(justvoip),GotoIf($[${JUSTVOIPFREIMINUTEN} > 0]?:nonoh)
exten => _0033.,n,PlayBack(vm-youhave)
exten => _0033.,n,SayNumber(${JUSTVOIPFREIMINUTEN})
exten => _0033.,n,PlayBack(minutes)
exten => _0033.,n(justvoipcall),Set(JUSTVOIPCALL=Y)
exten => _0033.,n,Dial(SIP/${EXTEN}@justvoip,60,L($[${JUSTVOIPFREIMINUTEN} * 60000]:$[$[${JUSTVOIPFREIMINUTEN} * 60000] - 60000]))
exten => _0033.,n(nonoh),GotoIf($[${NONOHFREIMINUTEN} > 0]?:12voip)
exten => _0033.,n,PlayBack(vm-youhave)
exten => _0033.,n,SayNumber(${NONOHFREIMINUTEN})
exten => _0033.,n,PlayBack(minutes)
exten => _0033.,n(nonohcall),Set(NONOHCALL=Y)
exten => _0033.,n,Dial(SIP/${EXTEN}@nonoh,60,L($[${NONOHFREIMINUTEN} * 60000]:$[$[${NONOHFREIMINUTEN} * 60000] - 60000]))
exten => _0033.,n(twelvevoip),GotoIf($[${12VOIPFREIMINUTEN} > 0]?:voipdiscount)
exten => _0033.,n,PlayBack(vm-youhave)
exten => _0033.,n,SayNumber(${12VOIPFREIMINUTEN})
exten => _0033.,n,PlayBack(minutes)
exten => _0033.,n(twelvevoipcall),Set(12VOIPCALL=Y)
exten => _0033.,n,Dial(SIP/${EXTEN}@12voip,60,L($[${12VOIPFREIMINUTEN} * 60000]:$[$[${12VOIPFREIMINUTEN} * 60000] - 60000]))
exten => _0033.,n(voipdiscount),Dial,SIP/${EXTEN}@voipdiscount|60
exten => _0033.,n,Hangup
exten => h,1,GotoIf($[${NONOHCALL} = Y]?:4)
exten => h,2,GotoIf($[${ANSWEREDTIME} > 1]?:4)
exten => h,3,Set(DB(nonoh/minutes1)=$[${DB(nonoh/minutes1)} + $[$[${ANSWEREDTIME} + 59] / 60]])
exten => h,4,GotoIf($[${12VOIPCALL} = Y]?:7)
exten => h,5,GotoIf($[${ANSWEREDTIME} > 1]?:7)
exten => h,6,Set(DB(12voip/minutes1)=$[${DB(12voip/minutes1)} + $[$[${ANSWEREDTIME} + 59] / 60]])
exten => h,7,GotoIf($[${JUSTVOIPCALL} = Y]?:10)
exten => h,8,GotoIf($[${ANSWEREDTIME} > 1]?:10)
exten => h,9,Set(DB(justvoip/minutes1)=$[${DB(justvoip/minutes1)} + $[$[${ANSWEREDTIME} + 59] / 60]])
exten => h,10,GotoIf($[${SMSLISTOCALL} = Y]?:13)
exten => h,11,GotoIf($[${ANSWEREDTIME} > 1]?:13)
exten => h,12,Set(DB(smslisto/minutes1)=$[${DB(smslisto/minutes1)} + $[$[${ANSWEREDTIME} + 59] / 60]])
exten => h,13,Hangup