You probably have to do a<br><br>exten => s,1,n,Set(TOTAL=0)<br><br>in the start of the call, to initialize the TOTAL variable<br><br><div class="gmail_quote">On Sun, Jan 31, 2010 at 4:29 AM, Thomas Perron <span dir="ltr"><<a href="mailto:thomas.perron@gmail.com">thomas.perron@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">thanks for the response.<br>
I tried to simplify and am now tuning the following, but it is not<br>
responding with anything.<br>
something wrong with timing?<br>
here is what I have:<br>
<br>
exten => 1625,1,Answer()<br>
exten => 1625,n,Set(TOTAL=${MATH(${TOTAL}+500,int)})<br>
exten => 1625,n,WaitExten(3)<br>
exten => 9625,1,Answer()<br>
exten => 9625,n,SayNumber(${TOTAL})<br>
<br>
<br>
output from the console ....<br>
<br>
[Jan 30 22:25:16] WARNING[22987]: func_math.c:194 math: '' is not a valid number<br>
-- Executing [1625@default:2] Set("SIP/64.85.162.137-c00d10e0",<br>
"TOTAL=") in new stack<br>
-- Executing [1625@default:3]<br>
WaitExten("SIP/64.85.162.137-c00d10e0", "3") in new stack<br>
[Jan 30 22:25:19] WARNING[22987]: pbx.c:7855 pbx_builtin_waitexten:<br>
Timeout but no rule 't' in context 'default'<br>
== Spawn extension (default, 1625, 3) exited non-zero on<br>
'SIP/64.85.162.137-c00d10e0'<br>
<div><div></div><div class="h5"><br>
<br>
2010/1/30 Håkon Nessjøen <<a href="mailto:haakon@avelia.no">haakon@avelia.no</a>>:<br>
> Try something like:<br>
><br>
> exten => 1,1,WaitExten(3)<br>
> exten => 1,1,Set(TOTAL=${MATH(${TOTAL}+500,int)})<br>
> exten => 1,n,WaitExten(3)<br>
> exten => 2,1,Set(TOTAL=${MATH(${TOTAL}+200,int)})<br>
> exten => 2,n,WaitExten(3)<br>
> exten => 3,1,Set(TOTAL=${MATH(${TOTAL}+300,int)})<br>
> exten => 3,n,WaitExten(3)<br>
> exten => 9,1,SayNumber(${TOTAL})<br>
><br>
> Or something. Never used either math or saynumber before, but according to<br>
> the documentation, something like this should work..<br>
><br>
><br>
> On Sat, Jan 30, 2010 at 3:06 PM, Thomas Perron <<a href="mailto:thomas.perron@gmail.com">thomas.perron@gmail.com</a>><br>
> wrote:<br>
>><br>
>> total up for current call.<br>
>> then read back the number<br>
>><br>
>><br>
>><br>
>> 2010/1/30 Håkon Nessjøen <<a href="mailto:haakon@avelia.no">haakon@avelia.no</a>>:<br>
>> > For all calls combined, or for the current call?<br>
>> ><br>
>> > On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron <<a href="mailto:thomas.perron@gmail.com">thomas.perron@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> I want to create a script for IVR that compiles responses, aggregates<br>
>> >> them to a total number.<br>
>> >> Then, run an equation based on the result.<br>
>> >><br>
>> >> Press 1 for X (X is a positive number 500)<br>
>> >> Press 2 for Y (Y is a positive number 200)<br>
>> >> Press 3 for Z (Z is a positive number 300)<br>
>> >><br>
>> >> Press 20 to calculate the results<br>
>> >> = 500+200+300 =1000<br>
>> >> then,<br>
>> >> exten => s,n,Read(NUMBER,,1000)<br>
>> >> exten => s,n,SayDigits(${NUMBER})<br>
>> >><br>
>> >> --<br>
>> >> _____________________________________________________________________<br>
>> >> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
>> >><br>
>> >> asterisk-users mailing list<br>
>> >> To UNSUBSCRIBE or update options visit:<br>
>> >> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
>> ><br>
>> ><br>
>> > --<br>
>> > _____________________________________________________________________<br>
>> > -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
>> ><br>
>> > asterisk-users mailing list<br>
>> > To UNSUBSCRIBE or update options visit:<br>
>> > <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
>> ><br>
>><br>
>> --<br>
>> _____________________________________________________________________<br>
>> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
>><br>
>> asterisk-users mailing list<br>
>> To UNSUBSCRIBE or update options visit:<br>
>> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
><br>
><br>
> --<br>
> _____________________________________________________________________<br>
> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
><br>
> asterisk-users mailing list<br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br>