Have VoiceMail check a database?

Is it possible to have a caller in the voice mail input a variable that is used to check a database?
The idea is;

  • Caller gets the main greeting of voicemail.
    “If you know your parties extension enter it now. For Tech support press 1…”
  • Caller presses 1 and hears
    "Please enter your account number"
  • Caller dials ‘1234’
  • System checks a database and retrieves the line for the customer ‘1234’
    ([Cust] 1234, [Active] 1, [Type] 1, [Calls] 25, [Route] 100)
  • IF [Active] = 1
    Save ([Calls] = [Calls] +1)
    IF [Route] not “” transfer to [route]
    ELSE transfer to hunt group
    Else play "Your account does not seem to be active"
    Return to main greeting

Not in voicemail but you could do it with a IVR and a custom AGI script.

1 Like

By the time you get to Voicemail, you’re too late. There are lots of other ways to do this: the one Tony recommends in definitely an easy one.

No matter how you do it, though, it is going to require custom code in a special context for this to work.

If you have a budget for this, it’s the type of thing we do in paid support.

I guess my (old school) mind was thinking the IVR was in the voice mail.

Where can I go to read up on making the needed scripts/IVR for custom features?

You want a block of Asterisk dialplan in the file /etc/asterisk/extensions_custom.conf and then reference it using the Custom Destinations module:

If you just want to set up an IVR, you should look at the IVR modules under “Applications”. You’ll need to record voice prompts for that to work, but from your original message, it should be fairly obvious to do what you are looking for from there.

The only bit that’s missing (which would be custom code) can be written by reviewing the code for entering a PIN in voicemail. From there, you can do all sort of things based on the “return value” you get from consulting the database and validating the PIN.