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