I want to allow users to dial my DID
Then, hear my ginger3 intro
Then, depending on the number that they press, provide a total via MATH.
Comments.  Will this work?


exten => 866,1,Goto(tommath,s,1)
[tommath]
exten => s,1,Read(NUMBER,ginger3,2,skip,5)
exten => s,n,Gotoif($["${NUMBER}" = "14"]?onefour)
exten => s,n,Gotoif($["${NUMBER}" = "24"]?twofour)
exten => s,n,Gotoif($["${NUMBER}" = "34"]?threefour)
exten => s,n,Gotoif($["${NUMBER}" = "20"]?done)
exten => s,playback(system) - error message
exten => s,n,Set(TOTAL=0)
exten => s,n(onefour),Set(TOTAL1=${MATH(${TOTAL}+500,int)})
exten => s,n,Goto(tommath,s,1)
exten => s,n(twofour),Set(TOTAL2=${MATH(${TOTAL+TOTAL1}+200,int)})
exten => s,n,Goto(tommath,s,1)
exten => s,n(threefour),Set(TOTAL3=${MATH(${TOTAL+TOTAL1+TOTAL2}+300,int)})
exten => s,n,Goto(tommath,s,1)
exten => s,n(done),SayNumber(${TOTAL=TOTAL1+TOTAL2+TOTAL3})
exten => s,n,playback(vm-goodbye)
exten => s,n,hangup

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to