Need Help with Voicemail Application

I've actually made some reasonable progress on my voicemail application in the last day or so. I took the recording demo from the samples and extended it so that if the user presses any keys during the voice prompt, the prompt pauses and echos what the user entered, after four digits. Otherwise, there's a beep, after which the user may leave a voicemail message.

At this point, though, I'm a bit stuck. I'm using an "ask" as the "OGM" so I can get the DTMF digits from the user when they enter them, but it would appear that the "incomplete" event may then occur either when the user enters no input at all (in which case I want to use "record" to record a message) or the user enters an incorrect PIN (which the four digits are meant to represent, so that the script would give the user two more attempts to succeed, then hang up). The page for "ask" also includes references to a "nomatch" event, which is promising, but there's absolutely no sample code there, only the resulting JSON, and I haven't been able to figure out how to get from one to the other.

Can you help? What I need is to be able to differentiate between a user entering no digits during a spoken prompt and entering the incorrect four digits during the prompt. On top of that, I need for the user to be able to make three attempts to enter a correct PIN, but only if they enter any digits in the first place. I've seen a few examples of entering digits in the samples, but they're all like "enter a ZIP code" and not "enter the correct PIN".

I'm intending to post my code to Github for anyone to use and would put there what I have so far, but I haven't quite got the hang of git yet.


Thanks for your help,



Please sign in to leave a comment.