I want to create a script for IVR that compiles responses, aggregates them to a total number. Then, run an equation based on the result. Press 1 for X (X is a positive number 500) Press 2 for Y (Y is a positive number 200) Press 3 for Z (Z is a positive number 300) Press 20 to calculate the results = 500+200+300 =1000 then, exten => s,n,Read(NUMBER,,1000) exten => s,n,SayDigits(${NUMBER})
For all calls combined, or for the current call? On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron <thomas.perron at gmail.com>wrote:> I want to create a script for IVR that compiles responses, aggregates > them to a total number. > Then, run an equation based on the result. > > Press 1 for X (X is a positive number 500) > Press 2 for Y (Y is a positive number 200) > Press 3 for Z (Z is a positive number 300) > > Press 20 to calculate the results > = 500+200+300 =1000 > then, > exten => s,n,Read(NUMBER,,1000) > exten => s,n,SayDigits(${NUMBER}) > > -- > _____________________________________________________________________ > -- 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100130/b7472ccd/attachment.htm
total up for current call. then read back the number 2010/1/30 H?kon Nessj?en <haakon at avelia.no>:> For all calls combined, or for the current call? > > On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron <thomas.perron at gmail.com> > wrote: >> >> I want to create a script for IVR that compiles responses, aggregates >> them to a total number. >> Then, run an equation based on the result. >> >> Press 1 for X (X is a positive number 500) >> Press 2 for Y (Y is a positive number 200) >> Press 3 for Z (Z is a positive number 300) >> >> Press 20 to calculate the results >> = 500+200+300 =1000 >> then, >> exten => s,n,Read(NUMBER,,1000) >> exten => s,n,SayDigits(${NUMBER}) >> >> -- >> _____________________________________________________________________ >> -- 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 > > > -- > _____________________________________________________________________ > -- 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 >
Try something like: exten => 1,1,WaitExten(3) exten => 1,1,Set(TOTAL=${MATH(${TOTAL}+500,int)}) exten => 1,n,WaitExten(3) exten => 2,1,Set(TOTAL=${MATH(${TOTAL}+200,int)}) exten => 2,n,WaitExten(3) exten => 3,1,Set(TOTAL=${MATH(${TOTAL}+300,int)}) exten => 3,n,WaitExten(3) exten => 9,1,SayNumber(${TOTAL}) Or something. Never used either math or saynumber before, but according to the documentation, something like this should work.. On Sat, Jan 30, 2010 at 3:06 PM, Thomas Perron <thomas.perron at gmail.com>wrote:> total up for current call. > then read back the number > > > > 2010/1/30 H?kon Nessj?en <haakon at avelia.no>: > > For all calls combined, or for the current call? > > > > On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron <thomas.perron at gmail.com> > > wrote: > >> > >> I want to create a script for IVR that compiles responses, aggregates > >> them to a total number. > >> Then, run an equation based on the result. > >> > >> Press 1 for X (X is a positive number 500) > >> Press 2 for Y (Y is a positive number 200) > >> Press 3 for Z (Z is a positive number 300) > >> > >> Press 20 to calculate the results > >> = 500+200+300 =1000 > >> then, > >> exten => s,n,Read(NUMBER,,1000) > >> exten => s,n,SayDigits(${NUMBER}) > >> > >> -- > >> _____________________________________________________________________ > >> -- 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 > > > > > > -- > > _____________________________________________________________________ > > -- 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 > > > > -- > _____________________________________________________________________ > -- 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100130/6e55de0a/attachment.htm
what is wrong with this please: ;exten => 4,1,WaitExten(3) exten => 4,1,Set(TOTAL=${MATH(${TOTAL}+500,int)}) exten => 4,n,WaitExten(3) exten => 2,1,Set(TOTAL=${MATH(${TOTAL}+200,int)}) exten => 2,n,Waitexten(3) exten => 3,1,Set(TOTAL=${MATH(${TOTAL}+300,int)}) exten => 3,n,WaitExten(3) exten => 9,1,SayNumber(${TOTAL})
> > does dtmf any any variable that i can capture and use w/ some logic like > > in the case of a gotoif > > Anyone have a clue what this means? Anyone? Anyone?How about this: "does dtmf transmit any variable that i can capture and use w/ some logic like [in the case of a] gotoif" Philipp
Clue, If a caller keys in "4 5 3" will some variable return "453"? I ASSume yes, since you can make menu selections with DTMF, "obviously" you can process the results further or in other ways than that. Cary -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Steve Edwards Sent: Sunday, January 31, 2010 2:29 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] MATH On Sun, 31 Jan 2010, Thomas Perron wrote:> does dtmf any any variable that i can capture and use w/ some logic > like in the case of a gotoifAnyone have a clue what this means? Anyone? Anyone? -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _____________________________________________________________________ -- 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
Here's how I would do this based on the post "below" (it's below in outlook express) Exten => 866,1,Goto(tommath,s,1) [tommath] - exten => s,1,Read(NUMBER,instruct,2,skip,5) - exten => s,n,Gotoif($["${NUMBER}" = "1"]?one) - exten => s,n,Gotoif($["${NUMBER}" = "2"]?two) - exten => s,n,Gotoif($["${NUMBER}" = "3"]?three) - exten => s,n,Gotoif($["${NUMBER}" = "20"]?done) - exten => s,playback(system) - error message - exten => s,n,Goto(tommath,s,1) - exten => s,n(one),Set(TOTAL=${MATH(${TOTAL}+500,int)}) - exten => s,n,Goto(tommath,s,1) - exten => s,n(two),Set(TOTAL=${MATH(${TOTAL}+200,int)}) - exten => s,n,Goto(tommath,s,1) - exten => s,n(three),Set(TOTAL=${MATH(${TOTAL}+300,int)}) - exten => s,n,Goto(tommath,s,1) - exten => s,n(done),SayNumber(${TOTAL}) - exten => s,n,playback(vm-goodbye) - exten => s,n,hangup Regards, Danny Nicholas -- -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Thomas Perron Sent: Saturday, January 30, 2010 7:48 AM To: asterisk-users at lists.digium.com Subject: [asterisk-users] MATH I want to create a script for IVR that compiles responses, aggregates them to a total number. Then, run an equation based on the result. Press 1 for X (X is a positive number 500) Press 2 for Y (Y is a positive number 200) Press 3 for Z (Z is a positive number 300) Press 20 to calculate the results = 500+200+300 =1000 then, exten => s,n,Read(NUMBER,,1000) exten => s,n,SayDigits(${NUMBER}) -- _____________________________________________________________________ -- 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
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