FreePBX | Register | Issues | Wiki | Portal | Support

Random IVR code

Tags: #<Tag:0x00007f74a3688a20> #<Tag:0x00007f74a3688778>

(Bigunk) #1

Okay, so just like anyone, I hate telemarketers, so with deference to NoMoRobo, I set up an IVR on my machine that asks you to hit 77 to let your call through, else you get voicemail. I think NoMoRobo has a way of randomizing the code and telling the caller the new random digits. Can we do this?

(Dave Burgess) #2

Yes, but not with the current IVR app.

(Bigunk) #3

Okay, so the next question would be what app is there?

(Dave Burgess) #4

As far as I know, and right now, there’s only the current IVR app. So, if you wanted to extend the IVR you would need to write a new IVR app or build a new set of custom contexts that implement the scheme you are trying to implement.

The current IVR app should be open source, so creating a new one that extends the old one to add this functionality would be an option.

If you are willing to change your requirements a little bit, you could use the existing IVR app and accept several different combinations, each guided by a random/time-based audio clip.

The tricky part is that the audio would have to change for a random selection to work - the IVR behind the announcement reacts to the key presses. It really has no relationship to the announcement at all.

One final note - the fact that you are dropping your callers into an IVR is usually enough to stop a robodialer. As long as your “0” entry doesn’t connect you to something useful, your IVR isn’t actually talking to a real human most of the time anyway. When I answer my cell phone to an unknown number, I just greet them with “Thank you for calling my cell phone. If you want to speak to a human being, please stay on the line and I will be glad to talk to you if you are a real person.”

This hits the Answering Machine Detection and almost all of the callers quit before I get the words out.

(Bigunk) #5

I see what you’re saying here. Ill play with that and see what I can do, Thank you.

(TheJames) #6

you can do this with a little custom dialplan if needed.

(Lorne Gaetz) #7

Lazy Saturday and it’s too wet to rake leaves.

  • create a Custom Destination with a goto string of bender-blocker,s,1
  • choose the Return option and set the destination to where ever you want legit calls to go
  • route calls through an Announcement saying something like “please enter the following digits”
  • then route to the Custom Destination.
  • add the following lines to the file /etc/asterisk/extensions_custom.conf
exten => s,1,Noop(Entering context bender-blocker in extensions_custom.conf)
exten => s,n,Answer
exten => s,n,Set(Count=0)
exten => s,n(restart),set(goal=${RAND(0,9)}${RAND(0,9)}${RAND(0,9)}${RAND(0,9)}) ; generates a 4 digit number, modify as req'd
exten => s,n,SayDigits(${goal})
exten => s,n,Read(dtmf-in,,${LEN(${goal})},,,10)   ; 10 second timeout, modify as req'd
exten => s,n,execif($["${dtmf-in}"="${goal}"]?Return)      ;  if input matches, send back to FreePBX 

; give caller multiple chances
exten => s,n,Set(Count=$[${Count}+1])
exten => s,n,gotoif($["${Count}"="3"]?finish)   ; bail after 3rd attempt
exten => s,n,Playback(challenge_try_again)      ; sub your own recording
exten => s,n,goto(restart)

; what do you want to do with calls that fail?
exten => s,n(finish),hangup

Custom Destination to Voicemail
Of Robocalls and Whitelists
Decir CallerID
(Itzik) #8

This is cool! I would actually give a 2nd chance to re-enter the random number and then send it to Blacklist.

(Lorne Gaetz) #9

Dialplan modified to give caller multiple chances. To blacklist the caller, you would change the finish to:

exten => s,n(finish),Set(DB(blacklist/${CALLERID(number)})=1)
exten => s,n,hangup

Alternatively you might want to send to VM in case you catch a legit call:

exten => s,n(finish),Goto(*5005,from-internal,1)
exten => s,n,hangup