PIONEERS Lenny Is Back!

hoolahoous

New Member
Joined
Nov 7, 2010
Messages
15
Reaction score
2
If you have the freepbx distro you need to add a blank amd.conf file in the asterisk configuration directory. Then restart asterisk and it will work.


thanks tm1000, that was it ! once i added the file and restarted it started to work.

I had a similar scripts (with my kids talking) few years back and I maxed out voipuser account by giving out my number to telemarketers in UK. had loads of fun. It broke after an upgrade and i didn't fix it later since I didn't have time. (attaching the script). This script starts with a four year old kid engaging telemarketer. After few sentences, telemarketer hears another six year old kid taking over conversation. it dangles a carrot too 'do you want to talk to dad'. if telemarketer stays silent for more than few seconds, six year old would keep saying 'hello'/'are you there' etc. in few different tones. there were few background shouts to 'dad, are you coming' to keep telemarketer hooked.
if there is any interest in further development (using AMD and making it more efficient) on this script, I can make this script and kids sound recordings GPL.

Code:
[custom-kidsrevenge]
; initialize parameters
exten => s,1,Set(FOUR_YEAR_OLD_COUNT=0)
exten => s,n,Set(SIX_YEAR_OLD_COUNT=1)
exten => s,n,Set(SIX_YEAR_OLD_HELLO=1)
; start recording and answer
exten => s,n,Set(CALLFILENAME=telekids-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
exten => s,n,Monitor(wav,${CALLFILENAME},m)
exten => s,n,Ringing
exten => s,n,Wait(7)
exten => s,n,Answer
; start the fun
exten => s,n,Playback(telekids/1silence)
exten => s,n,Goto(fouryearoldloop,s,1)
 
[fouryearoldloop]
; fouryearold doesn't have hellos, so just keep incrementing regardless of silence or talk
exten => s,1,Set(FOUR_YEAR_OLD_COUNT=$[${FOUR_YEAR_OLD_COUNT} + 1])
; if all of fouryearold's voices are done then move over to sixyearold
exten => s,n,GoToIf($["${FOUR_YEAR_OLD_COUNT}" = "7"]?sixyearold,s,1)
exten => s,n,Playback(telekids/fouryearold/${FOUR_YEAR_OLD_COUNT})
exten => s,n,BackgroundDetect(telekids/10silence,600,200,110000)
exten => s,n,Goto(fouryearoldloop,s,1)
exten => talk,1,Goto(fouryearoldloop,s,1)
 
[sixyearold]
; only play these sounds once
exten => s,1,Playback(telekids/sixyearold/a_GiveItToMeLetMeTalk)
exten => s,n,Wait(1)
exten => s,n,Playback(telekids/sixyearold/a_doYouWantToSpeakToDad)
exten => s,n,Wait(2)
; after playing move to sixyearold loop
exten => s,n,Goto(sixyearoldloop,s,1)
 
[sixyearoldloop]
; check of silence and if silence is detected, jump to hello loop
exten => s,1,BackgroundDetect(telekids/sixyearold/${SIX_YEAR_OLD_COUNT},600,200,110000)
exten => s,n,BackgroundDetect(telekids/10silence,600,200,110000)
exten => s,n,Goto(sixyearold_hello_loop,s,1)
; voice detected so play sound and increment
exten => talk,1,Set(SIX_YEAR_OLD_HELLO=1)
exten => talk,n,Set(SIX_YEAR_OLD_COUNT=$[${SIX_YEAR_OLD_COUNT} + 1])
exten => talk,n,GoToIf($["${SIX_YEAR_OLD_COUNT}" = "10"]?resetsixyearold,s,1:sixyearoldloop,s,1)
; this will probably never be called
exten => s,n,Hangup()
 
[sixyearold_hello_loop]
; play hello and increment hello counter
exten => s,1,Playback(telekids/sixyearoldhellos/${RAND(1,7)})
exten => s,2,Set(SIX_YEAR_OLD_HELLO=$[${SIX_YEAR_OLD_HELLO} + 1])
; if hello is played 7 times then hangup
exten => s,3,GoToIf($["${SIX_YEAR_OLD_HELLO}" = "7"]?dohangup,s,1:sixyearoldloop,s,1)
 
[resetsixyearold]
; if other side keeps speaking then start over
exten => s,1,Set(SIX_YEAR_OLD_COUNT=1)
exten => s,2,Set(SIX_YEAR_OLD_HELLO=1)
exten => s,3,Goto(sixyearoldloop,s,1)
 
[dohangup]
; bye bye
exten => s,1,Hangup
 

mbellot

Active Member
Joined
Dec 15, 2008
Messages
407
Reaction score
190
Please attach your revision to a forum post or email to [email protected] and I will try to add 1.4 support for the module.

Here you go. It's completely NOT pretty, but it does work.

I added the Ringing and Wait commands because Lenny was answering without any ringing.

The only odd thing I've noticed is the destination shown in the CDR is "h" (hangup). Would be nice to see Lenny's name there, if only for giggles.

Code:
;# // BEGIN Lenny Remake for Asterisk v1.4
exten => 53669,1,Answer
exten => 53669,n,Ringing
exten => 53669,n,Wait(2)
exten => 53669,n,Set(MACHINE=0)
exten => 53669,n,Set(OPTION=5)
exten => 53669,n,Set(TALK_DETECTED=0)
exten => 53669,n,Set(RECORDING=/tmp/Lenny-${UNIQUEID}.wav)

;exten => 53669,n,MixMonitor(${RECORDING})
;exten => 53669,n,NoOp(Recording will be available: ${RECORDING})
;exten => 53669,n,Playback(en/this-call-may-be-monitored-or-recorded)

exten => 53669,n,Playback(lenny/Lenny01)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny02)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny03)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny04)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny05)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny06)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny07)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny08)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny09)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny10)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny11)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny12)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny13)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny14)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny15)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny02)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny03)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny06)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny08)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny09)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny10)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(lenny/Lenny14)
exten => 53669,n,WaitForSilence(1500)
exten => 53669,n,Playback(en/tt-monkeys)
exten => 53669,n,Hangup


;# // END Lenny Remake
 

tm1000

Schmoozecom INC/FreePBX
Joined
Dec 1, 2009
Messages
1,360
Reaction score
78
That would be great!

thanks tm1000, that was it ! once i added the file and restarted it started to work.

I had a similar scripts (with my kids talking) few years back and I maxed out voipuser account by giving out my number to telemarketers in UK. had loads of fun. It broke after an upgrade and i didn't fix it later since I didn't have time. (attaching the script). This script starts with a four year old kid engaging telemarketer. After few sentences, telemarketer hears another six year old kid taking over conversation. it dangles a carrot too 'do you want to talk to dad'. if telemarketer stays silent for more than few seconds, six year old would keep saying 'hello'/'are you there' etc. in few different tones. there were few background shouts to 'dad, are you coming' to keep telemarketer hooked.
if there is any interest in further development (using AMD and making it more efficient) on this script, I can make this script and kids sound recordings GPL.

Code:
[custom-kidsrevenge]
; initialize parameters
exten => s,1,Set(FOUR_YEAR_OLD_COUNT=0)
exten => s,n,Set(SIX_YEAR_OLD_COUNT=1)
exten => s,n,Set(SIX_YEAR_OLD_HELLO=1)
; start recording and answer
exten => s,n,Set(CALLFILENAME=telekids-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
exten => s,n,Monitor(wav,${CALLFILENAME},m)
exten => s,n,Ringing
exten => s,n,Wait(7)
exten => s,n,Answer
; start the fun
exten => s,n,Playback(telekids/1silence)
exten => s,n,Goto(fouryearoldloop,s,1)
 
[fouryearoldloop]
; fouryearold doesn't have hellos, so just keep incrementing regardless of silence or talk
exten => s,1,Set(FOUR_YEAR_OLD_COUNT=$[${FOUR_YEAR_OLD_COUNT} + 1])
; if all of fouryearold's voices are done then move over to sixyearold
exten => s,n,GoToIf($["${FOUR_YEAR_OLD_COUNT}" = "7"]?sixyearold,s,1)
exten => s,n,Playback(telekids/fouryearold/${FOUR_YEAR_OLD_COUNT})
exten => s,n,BackgroundDetect(telekids/10silence,600,200,110000)
exten => s,n,Goto(fouryearoldloop,s,1)
exten => talk,1,Goto(fouryearoldloop,s,1)
 
[sixyearold]
; only play these sounds once
exten => s,1,Playback(telekids/sixyearold/a_GiveItToMeLetMeTalk)
exten => s,n,Wait(1)
exten => s,n,Playback(telekids/sixyearold/a_doYouWantToSpeakToDad)
exten => s,n,Wait(2)
; after playing move to sixyearold loop
exten => s,n,Goto(sixyearoldloop,s,1)
 
[sixyearoldloop]
; check of silence and if silence is detected, jump to hello loop
exten => s,1,BackgroundDetect(telekids/sixyearold/${SIX_YEAR_OLD_COUNT},600,200,110000)
exten => s,n,BackgroundDetect(telekids/10silence,600,200,110000)
exten => s,n,Goto(sixyearold_hello_loop,s,1)
; voice detected so play sound and increment
exten => talk,1,Set(SIX_YEAR_OLD_HELLO=1)
exten => talk,n,Set(SIX_YEAR_OLD_COUNT=$[${SIX_YEAR_OLD_COUNT} + 1])
exten => talk,n,GoToIf($["${SIX_YEAR_OLD_COUNT}" = "10"]?resetsixyearold,s,1:sixyearoldloop,s,1)
; this will probably never be called
exten => s,n,Hangup()
 
[sixyearold_hello_loop]
; play hello and increment hello counter
exten => s,1,Playback(telekids/sixyearoldhellos/${RAND(1,7)})
exten => s,2,Set(SIX_YEAR_OLD_HELLO=$[${SIX_YEAR_OLD_HELLO} + 1])
; if hello is played 7 times then hangup
exten => s,3,GoToIf($["${SIX_YEAR_OLD_HELLO}" = "7"]?dohangup,s,1:sixyearoldloop,s,1)
 
[resetsixyearold]
; if other side keeps speaking then start over
exten => s,1,Set(SIX_YEAR_OLD_COUNT=1)
exten => s,2,Set(SIX_YEAR_OLD_HELLO=1)
exten => s,3,Goto(sixyearoldloop,s,1)
 
[dohangup]
; bye bye
exten => s,1,Hangup
 

hoolahoous

New Member
Joined
Nov 7, 2010
Messages
15
Reaction score
2
okay guys help me out. creating a sourceforge entry. what licence I should use ? GPL may restrict it's usage in commercial entities. I want to have it available to everyone (commercial or personal) ?
 

tm1000

Schmoozecom INC/FreePBX
Joined
Dec 1, 2009
Messages
1,360
Reaction score
78
You should really use github. I really dislike sourceforge. But the license is GPL. FreePBX is GPL

okay guys help me out. creating a sourceforge entry. what licence I should use ? GPL may restrict it's usage in commercial entities. I want to have it available to everyone (commercial or personal) ?
 

hoolahoous

New Member
Joined
Nov 7, 2010
Messages
15
Reaction score
2
Here you go..

https://github.com/qwertangel/Hello-You-There

This is first checkin with no testing. I can add collaborators who are willing to contribute. BTW I think people who are interested in this script should move to new thread. Don't want want Lenny to get upset. LOL..

edit: i just checked, the script works but needs tweaking with silence/detection. I can also get my kids to record new prompts if anyone can do a better script.. :) all GPL of course.
 

sukasem

Guru
Joined
Sep 13, 2008
Messages
142
Reaction score
26
Here you go..

https://github.com/qwertangel/Hello-You-There

This is first checkin with no testing. I can add collaborators who are willing to contribute. BTW I think people who are interested in this script should move to new thread. Don't want want Lenny to get upset. LOL..

edit: i just checked, the script works but needs tweaking with silence/detection. I can also get my kids to record new prompts if anyone can do a better script.. :) all GPL of course.

May be after 6yrs old came back "I can't find my dad. Do you want to talk with my grand pa" then pass to Lenny. :D
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,202
Reaction score
5,224
Just a heads up. Don't use BackgroundDetect! It's dangerous because it also accepts DTMF digits which are passed to your dialplan for processing. It's also pretty lousy at voice detection, especially with soft-spoken callers. That's why we moved to the AMD + WaitForSilence approach.

Using WaitForSilence without AMD is problematic because it never detects somebody on the other end of the call. The current design is to use a combination of AMD and WaitForSilence on the first couple of voice prompts to detect an actual person on the other end of the call and also to make certain they are playing along on the call by interacting with Lenny. After that, you can switch to pure WaitForSilence processing for the remainder of the prompts.

Multiple voices are a great idea. But let's try to perfect Lenny's AMD + WaitForSilence code for the processing part. Then we can drop in new voices in a modular way.

The current dialplan methodology looks like this where playit is the subroutine for detecting a human followed by silence and playitonce is the subroutine for pure WaitForSilence processing...

Code:
exten => 53669,1,Answer
exten => 53669,n,Set(TIMEOUT(absolute)=600) ; set a 10-minute automatic hangup
 
exten => 53669,n,Gosub(playit(Lenny01))
exten => 53669,n,Gosub(playit(Lenny02))
exten => 53669,n,Gosub(playitonce(Lenny03))
exten => 53669,n,Gosub(playitonce(Lenny04))
; additional voice prompts can be added here
exten => 53669,n,Hangup
 
exten => 53669,n(playit),NoOp(Lenny speaks and repeats until reponse)
exten => 53669,n,Set(LOCAL(lennyclip)=${ARG1})
exten => 53669,n(oncemo),Set(TALK_DETECTED=0)
exten => 53669,n,Background(lenny/${lennyclip})
exten => 53669,n,AMD(2500,1500,800,5000,100,50,3,256)
exten => 53669,n,NoOp(${AMDCAUSE})
exten => 53669,n,GotoIf($["${AMDCAUSE:0:17}"="INITIALSILENCE-25"]?reststop)
exten => 53669,n(mach),WaitForSilence(700,3)
exten => 53669,n,Goto(humn)
exten => 53669,n(reststop),WaitForSilence(800,2)
exten => 53669,n,Goto(oncemo)
exten => 53669,n(humn),Return
 
exten => 53669,n(playitonce),NoOp(Lenny speaks once)
exten => 53669,n,Set(LOCAL(lennyclip)=${ARG1})
exten => 53669,n,Background(lenny/${lennyclip})
exten => 53669,n,AMD(2500,1500,800,5000,100,50,3,256)
exten => 53669,n,NoOp(${AMDCAUSE})
exten => 53669,n,WaitForSilence(2000,1)
exten => 53669,n,Return
 

klingon888

Guru
Joined
Nov 23, 2007
Messages
90
Reaction score
4
Tried the latest version but Lenny keeps talking after the 3rd clip, even when the caller doesn't say anything. The very first version will not continue until the caller says something.

Hello... this is Lenny
caller speaks
Sorry, I can barely hear you
caller repeats
yes, yes, yes

From here on, lenny will keep talking even when the caller keeps quiet. Anyone seeing this? This is on brand new install of incrediblePi.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,202
Reaction score
5,224
We're assuming that someone is interacting with Lenny when you get past the second clip. That means, if the caller sits quietly, the clips will continue to progress after a 2-second interval of silence following each clip. If you'd prefer verification of speech from the caller after every clip, then simply change all of the playitonce entries to playit.
 

hoolahoous

New Member
Joined
Nov 7, 2010
Messages
15
Reaction score
2
It gives more reliability if there is silence detection and go into a loop which says a variation of 'hello/are you there' in different tones ? I had instances where telemarketers would call again and again and would try different variations of their questions/silence to see if it was a recording .. however silence detection trumped them every single time..

also suggestion to add lenny to my script would have a hurdle since lenny sound recordings may not be GPL..
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,202
Reaction score
5,224
It gives more reliability if there is silence detection and go into a loop which says a variation of 'hello/are you there' in different tones ? I had instances where telemarketers would call again and again and would try different variations of their questions/silence to see if it was a recording .. however silence detection trumped them every single time..
The objective is to get telemarketers to stop calling, not to perfect Lenny to the point of encouraging them to call more often. If they conclude it's an automated system and stop calling, then we've won. Can't do better than that. :gnorsi:

also suggestion to add lenny to my script would have a hurdle since lenny sound recordings may not be GPL..
We have secured permission to use the Lenny recordings. :mad5:
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,202
Reaction score
5,224
We asked for and received permission to redistribute the Lenny files. As my grandpappy used to say...

9781602532069_p0_v1_s260x420.JPG


Presumably, anyone else is free to contact Brian West and request any type of authorization that will make you sleep better. In the meantime, you're more than welcome to download the files from our site.
 

mbellot

Active Member
Joined
Dec 15, 2008
Messages
407
Reaction score
190
I am soooooo bummed right now.

Lenny had a seven minute conversation with someone, but when convert2mp3.sh kicked in it failed on the email step and then deleted both the wav and mp3 files. :(

Times like this I wish CentOS had an undelete command.

I have since fixed the script, but have temporarily commented out the mp3 removal as well just in case.

For anyone still running an old version, make sure you have mime-construct installed and the script pointing to the correct path. I didn't have it, and once I managed to install it the path was still wrong (it landed in /usr/bin instead of /usr/local/bin specified by the script).

I'm looking forward to hearing Lenny's next victim. :D
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,202
Reaction score
5,224
mbellot: As you've learned the hard way, if you're not using PBX in a Flash, then you need to ALWAYS carefully review our scripts and test, test, test before using them in a production environment.

There simply are too many dependencies on the thousands of permutations and combinations of CentOS/Debian, Asterisk, and FreePBX for us to address them all. We've all invested dozens of man-years in development of the platform to assure "it just works."

The simple fix is simply to run PBX in a Flash or Incredible PBX. Then you don't have to worry. :idea:
 

mbellot

Active Member
Joined
Dec 15, 2008
Messages
407
Reaction score
190
mbellot: As you've learned the hard way, if you're not using PBX in a Flash, then you need to ALWAYS carefully review our scripts and test, test, test before using them in a production environment.

There simply are too many dependencies on the thousands of permutations and combinations of CentOS/Debian, Asterisk, and FreePBX for us to address them all. We've all invested dozens of man-years in development of the platform to assure "it just works."

The simple fix is simply to run PBX in a Flash or Incredible PBX. Then you don't have to worry. :idea:

But I AM running PIAF, it's just a really OLD version. SSH banner says Gold daemon v1.7.9, further down it says PIAF v1.7.5.5. ;)

I've been playing with a VirtualBox version of PIAF-Green, but have limited time when I could manage an uninterrupted switch now that my kids are back in school. Maybe a late night once things settle down will get the job done, but until then I'll keep driving the classic I've got now.
 

Members online

Forum statistics

Threads
25,816
Messages
167,793
Members
19,246
Latest member
OctavianBebu
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