|
|
@ -1,6 +1,7 @@
|
|
|
|
#!/bin/bash
|
|
|
|
#!/bin/bash
|
|
|
|
#ajw v1.01 - jukebox for asterisk wizard
|
|
|
|
#ajw v1.02 - jukebox for asterisk wizard
|
|
|
|
#Jay Moore/NQ4T - https://git.pickmy.org/dewdude/ajw
|
|
|
|
#Jay Moore/NQ4T - https://git.pickmy.org/dewdude/ajw
|
|
|
|
|
|
|
|
#Twitter: @Music_OnHold
|
|
|
|
#Licensed under GPL-3.0-or-later
|
|
|
|
#Licensed under GPL-3.0-or-later
|
|
|
|
|
|
|
|
|
|
|
|
# Works like this:
|
|
|
|
# Works like this:
|
|
|
@ -10,7 +11,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
setup() {
|
|
|
|
printf "[$name-main]\nexten = s,1,Answer()\nsame =n,Set(VOLUME(TX)=$vol)\nsame = n,Set(c=$name-main)\nsame = n(return),Set(m=1)\nsame = n(loop),Background($rootfolder/$introfile)\n"
|
|
|
|
printf "[$name-main]\nexten = s,1,Answer()\nsame =n,Set(VOLUME(TX)=$vol)\nsame = n,Set(c=$name-main)\nsame = n(return),Set(m=1)\nsame = n(loop),Background($rootfolder/$introfile)\n"
|
|
|
|
printf "same = n,WaitExten($delay)\nsame = n,Set(m=\$[\${m} + 1])\nsame = n,GoToIf(\$[\"\${m}\" < \"$loop\"]?loop)\nsame = n,Background($rootfolder/$goodbye)\nsame = n,Hangup()\n\n"
|
|
|
|
[ "$delay" -ne 0 ] printf "same = n,WaitExten($delay)\n"
|
|
|
|
|
|
|
|
printf "same = n,Set(m=\$[\${m} + 1])\nsame = n,GoToIf(\$[\"\${m}\" < \"$loop\"]?loop)\nsame = n,Background($rootfolder/$goodbye)\nsame = n,Hangup()\n\n"
|
|
|
|
} >> $name-juke.conf
|
|
|
|
} >> $name-juke.conf
|
|
|
|
|
|
|
|
|
|
|
|
album() {
|
|
|
|
album() {
|
|
|
@ -20,7 +22,7 @@ printf "exten = _%02dXX,1,Set(aa=$rootfolder/$folder)\n" $a
|
|
|
|
printf "same = n,GoTo(cart-player,*\${EXTEN:-2},1)\n\n"
|
|
|
|
printf "same = n,GoTo(cart-player,*\${EXTEN:-2},1)\n\n"
|
|
|
|
} >> $name-juke.conf
|
|
|
|
} >> $name-juke.conf
|
|
|
|
|
|
|
|
|
|
|
|
printf "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n |a|j|w| - asterisk jukebox wizard\n version 1.0 - Jay Moore/NQ4T\n https://git.pickmy.org/dewdude/jaw\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n"
|
|
|
|
printf "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n |a|j|w| - asterisk jukebox wizard\n version 1.02 - Jay Moore/NQ4T\n https://git.pickmy.org/dewdude/jaw\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n"
|
|
|
|
printf "Pick a name/identifier for this jukebox: "
|
|
|
|
printf "Pick a name/identifier for this jukebox: "
|
|
|
|
read name
|
|
|
|
read name
|
|
|
|
printf "\nEnter the root folder name of your jukebox: "
|
|
|
|
printf "\nEnter the root folder name of your jukebox: "
|
|
|
@ -29,7 +31,7 @@ printf "\nEnter the filename of your menu/intro: "
|
|
|
|
read introfile
|
|
|
|
read introfile
|
|
|
|
printf "\nHow many times do you want it to play? "
|
|
|
|
printf "\nHow many times do you want it to play? "
|
|
|
|
read loop
|
|
|
|
read loop
|
|
|
|
printf "\nHow many seconds between intro play? "
|
|
|
|
printf "\nHow many seconds between intro play? (Enter 0 for no delay)"
|
|
|
|
read delay
|
|
|
|
read delay
|
|
|
|
printf "\nEnter the filename of your exit file: "
|
|
|
|
printf "\nEnter the filename of your exit file: "
|
|
|
|
read goodbye
|
|
|
|
read goodbye
|
|
|
@ -37,7 +39,7 @@ printf "\nEnter a channel volume (I recommend -3): "
|
|
|
|
read vol
|
|
|
|
read vol
|
|
|
|
printf "\nWriting Basic Configuration.\n\nAuto-Generating Albums\n\n"
|
|
|
|
printf "\nWriting Basic Configuration.\n\nAuto-Generating Albums\n\n"
|
|
|
|
setup;
|
|
|
|
setup;
|
|
|
|
asd=/var/lib/asterisk/sounds/en
|
|
|
|
asd=/var/lib/asterisk/sounds/en/astjuke
|
|
|
|
dir=$(ls $asd/$rootfolder -l | awk '/^d/ {print $9}')
|
|
|
|
dir=$(ls $asd/$rootfolder -l | awk '/^d/ {print $9}')
|
|
|
|
a=0
|
|
|
|
a=0
|
|
|
|
for folder in $dir
|
|
|
|
for folder in $dir
|
|
|
@ -52,4 +54,4 @@ a=$((a + 1))
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
printf "\n\nDone.\n\n\nYour jukebox is located at $name-juke.conf.\n"
|
|
|
|
printf "\n\nDone.\n\n\nYour jukebox is located at $name-juke.conf.\n"
|
|
|
|
printf "Make sure to include 8track-player.conf in some dial plan somewhere."
|
|
|
|
printf "Make sure to include it and the player conf in your dial plan somewhere.\n\n\n\n"
|