wardmundy
Nerd Uno
- Joined
- Oct 12, 2007
- Messages
- 19,206
- Reaction score
- 5,228
Great news. For those of you that have been missing Lenny, we're delighted to report that Brian West, the author of the site, has given us permission to pass along the Lenny sound recordings. He is actively working to find a better home for It's Lenny in the not too distant future as well. If this is all Greek to you, visit Reddit for some quick entertainment.
FREE DEMO: If you'd like to "try before you buy" (joke! ), we've put up a system to let you take Lenny for a spin. Here's the IPkall number: 1-206-424-6913. For purists, here is a SIP URI courtesy of our RentPBX sponsors and SIP2SIP:[email protected].
While you're waiting on ItsLenny.com to return, here's an easy way to roll your own. Someone on another forum posted some of the sound recordings and we've added a script to go along with them so that you can host this on your own PIAF server.
LEGALESE: Recording other people without their knowledge or permission is a slippery slope. For those in the U.S., it is legal in some states and not in others. Some require only the callee's permission while others require permission from the callee and caller. You're NOT the problem. The problem is the caller. The important point to remember is the situs of the caller determines the state law that prevails (in the U.S. only). We have no idea what the rules are elsewhere so consult your attorney, or don't record or, at the very least, give callers notice that they are being recorded. Here's a table of the state laws but we have not verified any of it. If there is any chance you will have callers or blacklisted callers from two-party consent states or foreign countries, then activate the "This call is being recorded component" below. Or, better yet, leave call recording disabled on all calls. And, remember, the NSA may be listening as well.
BY USING ANYTHING THAT FOLLOWS, YOU ASSUME ALL LEGAL RESPONSIBILITY FOR YOUR ACTIONS!!!
PREREQUISITES: We've tested this successfully on PBX in a Flash servers running Asterisk 1.8 and Asterisk 11. On other platforms, YMMV!
INSTALLATION: Log into your server as root and issue the following commands:
Code:
#!/bin/bash
mkdir /var/lib/asterisk/sounds/lenny
chown asterisk:asterisk /var/lib/asterisk/sounds/lenny
cd /var/lib/asterisk/sounds/lenny
wget http://pbxinaflash.com/Lenny.tgz
tar zxvf Lenny.tgz
rm Lenny.tgz
cd /tmp
wget http://pbxinaflash.com/lsupport.tgz
tar zxvf lsupport.tgz
rm lsupport.tgz
sed -i '\:// BEGIN Lenny Remake:,\:// END Lenny Remake:d' /etc/asterisk/extensions_custom.conf
sed -i '/\[from-internal-custom\]/r /tmp/lenny.txt' /etc/asterisk/extensions_custom.conf
rm lenny.txt
mv 3.gsm /var/lib/asterisk/sounds/lenny
cd /var/lib/asterisk/sounds/lenny
chown asterisk:asterisk *
chmod 755 *
echo " " >> /etc/asterisk/extensions_custom.conf
echo "[bridgit]" >> /etc/asterisk/extensions_custom.conf
echo "exten => 4,1,Pickup(701@from-internal)" >> /etc/asterisk/extensions_custom.conf
echo "exten => 4,2,Pickup(777@from-internal)" >> /etc/asterisk/extensions_custom.conf
echo " " >> /etc/asterisk/extensions_custom.conf
asterisk -rx "dialplan reload"
echo "Try it out by dialing 53669 from any extension on your PBX."
BLACKLIST MOD: If you want to use Lenny for your BlackList callers, you'll need to install the lgaetz BlackList MOD. Once installed, open the Lenny Blacklist MOD under Other in FreePBX and configure it to look like this:
REDIRECTING RINGING INBOUND CALLS TO LENNY: At least on the Yealink T46G, we've got dialplan code working that lets you push a button and redirect ringing inbound calls to Lenny. This only works while the inbound calls are ringing. You can test it by dialing a monitored extension and pressing the Lenny button while the call is ringing. On the Yealink, here's what our DSSKey entry looks like:
If you've followed the install above, you will note that a [bridgit] context has been added at the bottom of /etc/asterisk/extensions_custom.conf. This is where you tell Asterisk which calls to intercept and forward to Lenny at extension 53669. As configured, it will forward ringing calls to extension 701 and ring group 777 when you press a button on your phone that has been mapped to dial 536691. You can change the extensions to meet your requirements, or you can add additional ones by expanding the entries with 4,3 and 4,4 entries in [bridgit].
Code:
[bridgit]
exten => 4,1,Pickup(701@from-internal)
exten => 4,2,Pickup(777@from-internal)
REDIRECTING RINGING CALLS TO OTHER EXTENSIONS: We've included dialplan code at the top of extensions_custom.conf called ;# // BEGIN Lenny Remake. If you scroll down to the 536691 section, you will see that 3 lines have been commented out:
Code:
;exten => 536691,n,Flite("After the beep, enter extension or press pound for Lenny.")
;exten => 536691,n,Read(SENDTO,beep,7)
;exten => 536691,n,GotoIf($["foo${SENDTO}" = "foo"]?5:6)
By uncommenting these 3 lines, you will be able to forward ringing calls to any extensions by simply keying in the extension number after you press the Lenny button. If you only press #, the call will be forwarded to Lenny at extension 53669.
ENABLING RECORDING OF CALLS: At the top of same section of the dialplan, you will see that 3 lines are commented out in the 53669 section:
Code:
;exten => 53669,n,MixMonitor(/tmp/Lenny/${RECORDING}.wav)
;exten => 53669,n,NoOp(Recording will be available: /tmp/Lenny/${RECORDING}.wav)
;exten => 53669,n,Playback(en/this-call-may-be-monitored-or-recorded)
Uncommenting the first two will enable recording of every Lenny call. Uncommenting the third line (highly recommended) plays a warning at the beginning of every call notifying the caller that they're being recorded.
EMAILING RECORDINGS TO YOURSELF: The easiest way to get the recorded calls is to email them to yourself once or more each day. A script to convert the recordings to MP3s and email them to you and delete the recordings would look like this. Just plug in your email address and save as /root/convert2mp3.sh.
Code:
#!/bin/bash
# name of this script: convert2mp3.sh
# wav to mp3 and email the results to:
email="[email protected]"
cd /tmp/Lenny
for i in *.wav; do
if [ -e "$i" ]; then
file=`basename "$i" .wav`
lame -h -b 64 "$i" "$file.mp3"
rm "$file.wav"
/usr/local/bin/mime-construct --file "$file.mp3" --to $email --from root@localhost --type audio/mpeg --subject "Lenny recording"
rm "$file.mp3"
fi
done
# end of script
Then add the following entry to /etc/crontab to get the emails at 1:06 a.m. each day:
Code:
6 1 * * * root /root/convert2mp3.sh >/dev/null 2>&1
Let us know if you have problems.