MazeMiami Posted November 24, 2008 Posted November 24, 2008 (edited) For Some Reason $num wont loop like the rest it should increase by one number on each loop here is what i have $num = 1 $FileF = "Female_"&$num&".wav " $FileM = "male_"&$num&"m.wav" $extF = 3003 $extM = 3004 Do Send("cp /root/voice/female/"&$FileF&" /var/spool/asterisk/voicemail/default/"&$extF&"/unavail.wav{enter}") Send("cd /var/spool/asterisk/voicemail/default/"&$extF&"/ {enter}") send("sox -t wav unavail.wav -r 8000 -c1 -t gsm unavail.gsm resample -ql {enter}") Send("cd /var/spool/asterisk/voicemail/default/"&$extF&"/ {enter}") send("rm unavail.wav {enter}") send("y {enter}") $extF = $extF + 2 $num = $num + 1 Until $num = 177 Edited November 24, 2008 by MazeMiami
liteswap Posted November 24, 2008 Posted November 24, 2008 For Some Reason $num wont loop like the rest it should increase by one number on each loop here is what i have $num = 1 $FileF = "Female_"&$num&".wav " $FileM = "male_"&$num&"m.wav" $extF = 3003 $extM = 3004 Do Send("cp /root/voice/female/"&$FileF&" /var/spool/asterisk/voicemail/default/"&$extF&"/unavail.wav{enter}") Send("cd /var/spool/asterisk/voicemail/default/"&$extF&"/ {enter}") send("sox -t wav unavail.wav -r 8000 -c1 -t gsm unavail.gsm resample -ql {enter}") Send("cd /var/spool/asterisk/voicemail/default/"&$extF&"/ {enter}") send("rm unavail.wav {enter}") send("y {enter}") $extF = $extF + 2 $num = $num + 1 Until $num = 177 Looks as if it should work. A common debugging technique is to add something like this: msgbox(0,"",$num) to the end of but inside the loop so oyu can check what's happening to that variable (or any otehr variable). That should help you determine what the problem is.
MazeMiami Posted November 24, 2008 Author Posted November 24, 2008 Just ran that little test and the loop is going up but why isn't the the file changing see any error i may be missing ? I'm confused yet again
liteswap Posted November 24, 2008 Posted November 24, 2008 Just ran that little test and the loop is going up but why isn't the the file changing see any error i may be missing ? I'm confused yet againTry a different loop egWhile $num < 178<do stuff>WEnd
youknowwho4eva Posted November 24, 2008 Posted November 24, 2008 (edited) It's better to use $num += 1 then $num = $num + 1 and is this an Iphone program? those directories look familiar. Edit: woohoo 300th post. My spamming is massified Edited November 24, 2008 by youknowwho4eva Giggity
zorphnog Posted November 24, 2008 Posted November 24, 2008 You have to reset your male/female file variables every time the $num variable changes. So: $num = 1 $FileF = "Female_" & $num & ".wav " $FileM = "male_" & $num & "m.wav" $extF = 3003 $extM = 3004 Do Send("cp /root/voice/female/" & $FileF & " /var/spool/asterisk/voicemail/default/"&$extF&"/unavail.wav{enter}") Send("cd /var/spool/asterisk/voicemail/default/" & $extF & "/ {enter}") send("sox -t wav unavail.wav -r 8000 -c1 -t gsm unavail.gsm resample -ql {enter}") Send("cd /var/spool/asterisk/voicemail/default/" & $extF & "/ {enter}") send("rm unavail.wav {enter}") send("y {enter}") $extF = $extF + 2 $num = $num + 1 $FileF = "Female_" & $num & ".wav" $FileM = "male_" & $num & "m.wav" Until $num = 177
MazeMiami Posted November 24, 2008 Author Posted November 24, 2008 Nice thanks a lot works ! Now would you mind explaining why i have to do that for this and not the other strings ? Thanks Again!!
Tomb Posted November 24, 2008 Posted November 24, 2008 It's better to use $num += 1 then $num = $num + 1neither way is better.
zorphnog Posted November 24, 2008 Posted November 24, 2008 Nice thanks a lot works !Now would you mind explaining why i have to do that for this and not the other strings ?Thanks Again!!What do you mean not for the other strings? What other strings are you talking about?Using a variable within a variable is not a persistent/dynamic process, its static. Meaning that once you set a variable it does not change even if the variable within it does.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now