Telemarketers are the worst. They have no souls. They feed off of the misery of others. No one likes them. Luckily, a nice British gentleman by the name of Lenny has come to save the day.
I first heard about Lenny from an article I saw on Reddit. Lenny simply consists of a few lines of code in Asterisk and a handful of voice recordings, but he has the power to thwart the evil telemarketers of the world by sending them into an endlessly frustrating loop of inane conversation.
Setting up Lenny in FreePBX is a pretty simple task, and is also a really nice primer into Asterisk custom contexts, and the power of scripting.
First, you will want to create the Lenny custom context in Asterisk. SSH into your FreePBX and use your favorite editor to edit /etc/asterisk/extensions_custom.conf. Add the following lines of code:
[Lenny] exten => talk,1,Set(i=${IF($["0${i}"="016"]?7:$[0${i}+1])}) same => n,ExecIf($[${i}=1]?MixMonitor(${UNIQUEID}.wav)) same => n,Playback(Lenny/Lenny${i}) same => n,BackgroundDetect(Lenny/backgroundnoise,1500)
Save and exit the extensions_custom.conf file.
Next, use WinSCP to copy the Lenny sound files into /var/lib/asterisk/sounds/Lenny (you may have to create the /Lenny directory).
*** Note: If you are using FreePBX 13, the sound directory is /var/lib/asterisk/sounds/en/Lenny.
Download the Lenny sound files here.
Now that you have the Lenny sound files in place, and the Asterisk custom context, it’s time to configure FreePBX to use Lenny as a destination. Log into the FreePBX admin interface and choose Admin –> Custom Destinations.
Add a new custom destination with these settings:
Custom Destination: Lenny,talk,1
Description: Lenny
Click ‘Submit Changes’ followed by the ‘Apply Changes’ button. You can now use the Lenny custom context as a destination in FreePBX.
What can you do with this custom destination?
If you are interested in manually transferring calls to Lenny, you can set up a new virtual extension and set all of the ‘Optional Destinations’ at the bottom of the page to your Lenny custom destination.
If you want to set up a dedicated DID for Lenny, simply create a new inbound route and set your destination to the Lenny custom destination. If you can spare the DID, this would be incredibly useful for having a spare number to give out when filling out online forms, going to conventions, or any time you KNOW you’re only giving out your number because you’re gonna get calls.
Finally – you can set up Lenny as an IVR option to just generally fool with people – it’s endlessly entertaining.
Make sure you periodically check your Lenny recordings for hours of entertainment!