Once again Nerd Vittles has created another kick ass script that needs to be shared. I have written of earlier versions of this software however these guys have also added a nice and simple web panel as well.
I have re-packaged the tar file here since for some reason TB 2.6 doesn’t seem to like when I upload .tgz file extensions.
This feature is so handy – not just for wake-up notifications but also as a friendly reminder to do something or call someone.
I encourage you to read the authors post here – it will help you with installation and give you a much better description.
Since Youtube is such a wonderful source for all types of media – I decided to modify a script written by one of the guys at T*UG for quick and easy Youtube audio conversion for Asterisk playback (Music on hold or dial out prank goodness).
To get it going you need mplayer, sox, mpg123 and lynx (if you are using Trixbox to convert you can add the DAG repo, disable it and install the dependencies using –enablerepo=rpmforge)
So without further adieu, the script :
#!/bin/sh
echo "Downloading and converting..."
FILE=$1
URL=$2
RES=`lynx -source "$URL" | grep fullscreenUrl | cut -d'&' -f4,8` > /dev/null 2>&1
mplayer "http://www.youtube.com/get_video?$RES" -dumpaudio -dumpfile temp.mp3 > /dev/null 2>&1
mpg123 -w temp.wav temp.mp3 > /dev/null 2>&1
sox temp.wav -c 1 -r 8000 -w $FILE.wav > /dev/null 2>&1
rm temp.wav
rm temp.mp3
echo "Your file is ready - "$FILE.wav"
Usage :./script <new-file-name> <youtube-link>
You can test the audio quality by calling 425 606 3524 – this is my IPKall DID, it goes straight to Hold Music.
This sure can be a lot of fun, but remember : with great power comes great responsibility – don’t prank people you don’t know.
Have fun!
I was having some one way audio issues with IPKall – here is the solution (examine bottom two entries) :
The key here is mapping incoming 5060 to internal 5068 and 10000 to internal 20000. Voila!
You also want to make sure you have :
externip=<extenal ip address>
externhost=<fqdn, unless you have externip set>
localnet=10.0.0.0/255.255.255.0
srvlookup=yes
nat=yes
in the /etc/asterisk/sip_custom.conf file.
See how the Cisco services menu interfaces with the web services panel – plus a factory reset for proof.
Here are some images of the script in action.


