;! from wget http://pbxinaflash.com/lsupport.tgz
;# // BEGIN Lenny Remake
; version 0.3.2 copyright: none claimed. Enjoy!
exten => 53669,1,Answer
exten => 53669,n,Set(TIMEOUT(absolute)=600)
exten => 53669,n,Set(MACHINE=0)
exten => 53669,n,Set(OPTION=5)
exten => 53669,n,Set(TALK_DETECTED=0)
exten => 53669,n,Set(RECORDING=${UNIQUEID})
;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); use this orig from lenny.txt # OR next line with existing sounds/ adding "crackle hello this is Lenny...." :-
;exten => 53669,n,Playback(en/this-call-may-be&en/recorded&Lenny01) ; Enable this to use existing ( joined-up with '&' ) sound files(3):- en/this-call-may-be&en/Recorded&Lenny01}
;#Expl-NOTE edit a CUT from en/this-call-may-be-monitored-or-recorded omitting 'monitored-or' # & adding '&Lenny01' (rapid crackle-hello-thisisLenny) to keep interest-distract from recorded msg. .
;exten => 53669,n,Playback(en/this-call-may-be-recorded&lenny/Lenny01) ; this requires the newly edited sound files this-call-may-be-recorded
exten => 53669,n,Gosub(playit(Lenny01))
exten => 53669,n,Gosub(playit(Lenny02))
exten => 53669,n,Gosub(playitonce(Lenny03))
exten => 53669,n,Gosub(playitonce(Lenny04))
exten => 53669,n,Gosub(playitonce(Lenny05))
exten => 53669,n,Gosub(playitonce(Lenny06))
exten => 53669,n,Gosub(playitonce(Lenny07))
exten => 53669,n,Gosub(playitonce(Lenny08))
exten => 53669,n,Gosub(playitonce(Lenny09))
exten => 53669,n,Gosub(playitonce(Lenny10))
exten => 53669,n,Gosub(playitonce(Lenny11))
exten => 53669,n,Gosub(playitonce(Lenny12))
exten => 53669,n,Gosub(playitonce(Lenny13))
exten => 53669,n,Gosub(playitonce(Lenny14))
exten => 53669,n,Gosub(playitonce(Lenny15))
exten => 53669,n,Gosub(playitonce(Lenny02))
exten => 53669,n,Gosub(playitonce(Lenny03))
exten => 53669,n,Gosub(playitonce(Lenny06))
exten => 53669,n,Gosub(playitonce(Lenny08))
exten => 53669,n,Gosub(playitonce(Lenny09))
exten => 53669,n,Gosub(playitonce(Lenny10))
exten => 53669,n,Gosub(playitonce(Lenny14))
exten => 53669,n,Playback(en/tt-monkeys)
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(noresponse),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}"="INITIALSILENCE-2500-2500"]?noresponse)
;exten => 53669,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn2:mach2)
exten => 53669,n(mach2),WaitForSilence(2000,1)
exten => 53669,n(humn2),Return
exten => 536691,1,NoOp(Rerouting inbound call...)
;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)
exten => 536691,n,Set(SENDTO=53669)
exten => 536691,n,System(echo "Channel: local/${SENDTO}@from-internal" > /tmp/lenny.call)
exten => 536691,n,System(echo "MaxRetries: 0" >> /tmp/lenny.call)
exten => 536691,n,System(echo "RetryTime: 3" >> /tmp/lenny.call)
exten => 536691,n,System(echo "WaitTime: 30" >> /tmp/lenny.call)
exten => 536691,n,System(echo "Context: bridgit" >> /tmp/lenny.call)
exten => 536691,n,System(echo "Extension: 4" >> /tmp/lenny.call)
exten => 536691,n,System(echo "Priority: 1" >> /tmp/lenny.call)
exten => 536691,n,System(mv /tmp/lenny.call /var/spool/asterisk/outgoing)
;# // END Lenny Remake