Forgot the HOWITWORKS

master
Jay 2 years ago
parent 0d9a125842
commit 2da8430d52

@ -32,7 +32,7 @@ exten = s,1,Answer() # Answer the channel.
same = n,Set(VOLUME(TX)=-3) # Lower volume since that seems necessary.
same = n,Set(c=examplejuke-main) # Set the "c" variable so we can return to this context.
same = n(loop),Background(foobar/menu) # Label for "loop", plays the menu audio.
same = n,WaitExten(5) # Wait a few seconds
same = n,WaitExten(5) # Wait a few seconds (AJW won't write this if delay is skipped)
same = n,Set(m=$[${m} + 1]) # Increase "m" by one.
same = n,GoToIf($["${m}" < "5"]?loop) # Compare to "5", return to "loop" if true.
same = n,(goodbye)Background(foobar/bye) # It was false...good bye. "Goodbye" label.
@ -40,16 +40,25 @@ same = n,Hangup() # SLAM
exten = _00XX,1,Set(aa=foobar/00album) # Set the aa variable to the album directory for leading 00
same = n,GoToIf($["${EXTEN:-2}" = "00"]?8track-player,*11,1) # Check last two dialed. If album playback, pass total tracks as extension.
same = n,GoToIf($["${EXTEN:-2}" > "19"]?9999) # Make sure we don't exceed the actual number of tracks
same = n,GoTo(cart-player,*${EXTEN:-2},1) # Pass the last two digits to cart-player as *ext
same = 9999,Playback(option-is-invalid) # WRONG!
same = n,GoTo(examplejuke-main,s,1) # Go back and try again
exten = _01XX,1,Set(aa=foobar/01album) # Repeat for album leading 01
same = n,GoToIf($["${EXTEN:-2}" = "00"]?8track-player,*15,1)
same = n,GoToIf($["${EXTEN:-2}" > "19"]?9999)
same = n,GoTo(cart-player,*${EXTEN:-2},1)
same = 9999,Playback(option-is-invalid)
same = n,GoTo(examplejuke-main,s,1)
exten = _02XX,1,Set(aa=foobar/02album) # Album 02 is different. Files do not have a leading 0.
same = n,GoToIf($["${EXTEN:-2}" = "00"]?8track-player,#12,1) # Pass last two to 8track-player's # pattern.
same = n,GoToIf($["${EXTEN:-2}" > "19"]?9999) # Make sure we don't exceed the actual number of tracks
same = n,GoToIf($["${EXTEN:-2}" < "10"]?cart-player,#${EXTEN:-1},1) # If the last two are less than 10; pass to single digit to cart-player #ext
same = n,GoTo(cart-player,*${EXTEN:-2},1) # Use the "standard" call for tracks more than 10.
same = 9999,Playback(option-is-invalid) # WRONG!
same = n,GoTo(examplejuke-main,s,1) # Go back and try again
```
The setup for the jukeboxes has undergone about as much optimization as I think I can perform. I did trade a few variables for reducing the overall number of lines.

Loading…
Cancel
Save