PIONEERS Lenny Is Back!

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
lenny.jpg


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:

BRQ9dDcCMAAI_tq.jpg:large


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:

BRRJPZBCAAADgoY.jpg:large


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. :beta1:
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Excellent! It looks like Lenny is just a single recording file. This project begs for a selection of sound files to randomly choose from. If I overcome my crippling shyness, I will record a Buddy in Eastern Canadian twang (eh?).


Actually, it's 15 recordings presently. The more recordings, the merrier. I'm taking a recorder with us to record the mountain men next week.

2842161245_deliverance_remake125102656_sq_thumb_m_xlarge.jpeg
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,381
Reaction score
436
Excellent! It looks like Lenny is just a single recording file. This project begs for a selection of sound files to randomly choose from. If I overcome my crippling shyness, I will record a Buddy in Eastern Canadian twang (eh?).

If this isn't a job for a newfie I don't know what is. FYI in Ontario only one party has to agree to the recording :)
 

Trimline2

Guru
Joined
May 23, 2013
Messages
524
Reaction score
96
Here's the whole run down for recording laws - http://en.wikipedia.org/wiki/Telephone_recording_laws

I placed mine to be read in French - but it's purpose? How do you squeeze in "entertainment". Most, if not all of these calls, are made ignoring the Do Not Call Registry in the first place.
;exten => 53669,n,Playback(fr/this-call-may-be-monitored-or-recorded)
 

hernanp

New Member
Joined
Dec 30, 2007
Messages
7
Reaction score
0
"SIP URI courtesy of our RentPBX sponsors and SIP2SIP: [email protected]"


That sip uri is not working :(

Is there any other place where Lenny is up and running where to forward calls?
I 've installed it at home (raspi) , but would like to use it from my cell too, forwarding to a sip uri...
 

mbellot

Active Member
Joined
Dec 15, 2008
Messages
404
Reaction score
185
Ward - Excellent write-up, I'm going to have to try this when I get a chance.

One thing. The original Lenny.tgz (that gets unzipped into /var/lib/asterisk/sounds/lenny) includes a 3.gsm file, why is there another one in lsupport.tgz that overwrites the original?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Ward - Excellent write-up, I'm going to have to try this when I get a chance.

One thing. The original Lenny.tgz (that gets unzipped into /var/lib/asterisk/sounds/lenny) includes a 3.gsm file, why is there another one in lsupport.tgz that overwrites the original?


Some folks originally used the sound files from another forum, and it didn't include 3.gsm which is 3 seconds of silence. Aside from that, chalk it up to sloppy coding. :arabia:
 

Mango

www.toao.net
Joined
Aug 10, 2013
Messages
46
Reaction score
13
I was thrilled to discover Lenny this week. Unfortunately (in an ironic sort of way) I've done an excellent job of getting my phone number removed from a lot of telemarketing lists and haven't had any exciting results yet.

Ward, I wanted to let you know I corrected some errors in the files I made. I removed some background noise that shouldn't have been there, added comfort noise to 14, and also made a one minute comfort noise file. This seems to make Lenny sound more realistic in my testing. The new files don't have the leading 0 in front of the numbers but that could be easily replaced if necessary. Feel free to grab them from the other forum, if you want to!
 

mvoip

New Member
Joined
Dec 8, 2010
Messages
15
Reaction score
2
Hi Ward,
I have installed as described. When I call, I cannot get beyond "sorry I can barely hear you there" message. It keeps looping no matter how loud I speak. I tried to play with "BackgroundDetect(lenny/3,3000,30)", but cannot get it working. I have Asterisk 1.8.19.1 and FreePBX 2.10.1.1. Is it the FreePBX version?

Thanks.
 

mvoip

New Member
Joined
Dec 8, 2010
Messages
15
Reaction score
2
Upgraded to
FreePBX 2.11.0.10
still the same issue.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
I can ping the domain, but calls to that URI don't connect for me either. Is there perhaps a geographical filter? Regular PSTN calls to the IPKall DID do answer but all I get is SOS sounding tones.


Perhaps sip2sip.info has a filter of some sort. I think they throw calls in the bit bucket when your volume is above 90% of their users so that may be the problem for a bit. Try later and let us know.
 

randy7376

Defnyddiwr Gweithredol
Joined
Sep 29, 2010
Messages
864
Reaction score
144
I've decided to come play for a little while... ;)

I get the same thing. Watching the console and seeing that it's stuck in the loop, I keep getting "0 milliseconds of talk detected" and "TALK_DETECTED=0". Will have too dig deeper...
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Hi Ward,
I have installed as described. When I call, I cannot get beyond "sorry I can barely hear you there" message. It keeps looping no matter how loud I speak. I tried to play with "BackgroundDetect(lenny/3,3000,30)", but cannot get it working. I have Asterisk 1.8.19.1 and FreePBX 2.10.1.1. Is it the FreePBX version?

Thanks.

Please run the commands below to load the latest working release (recording disabled by default):
Code:
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
rm 3.gsm
asterisk -rx "dialplan reload"
 

tm1000

Schmoozecom INC/FreePBX
Joined
Dec 1, 2009
Messages
1,360
Reaction score
78
lgaetz

Anyway we can combine this into a module to avoid having to modify custom (not that I dont want users in there, just trying to make it more user friendly, upgradable)
 

mbellot

Active Member
Joined
Dec 15, 2008
Messages
404
Reaction score
185
Please run the commands below to load the latest working release (recording disabled by default):
Code:
cd /tmp
wget http://pbxinaflash.com/lsupport.tgz

404...

root@pbx:/tmp/tmp $ wget http://pbxinaflash.com/lsupport.tgz
--2013-08-12 15:42:44-- http://pbxinaflash.com/lsupport.tgz
Resolving pbxinaflash.com... 173.193.151.215
Connecting to pbxinaflash.com|173.193.151.215|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-08-12 15:42:45 ERROR 404: Not Found.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Ward, can you provide the license terms for this whole thing please, particularly the Lenny sound files. Neither the two tgz files give any hints nor the blog entry nor this thread.


Covered in the Nerd Vittles article.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
We've pulled the dialplan code until we can sort out a couple of bugs. Please delete your existing copy and reload Asterisk for the time being.

Code:
sed -i '\:// BEGIN Lenny Remake:,\:// END Lenny Remake:d' /etc/asterisk/extensions_custom.conf
 

Members online

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top