Blogs
Take a look at the things that interest us.
How to create a IVR menu in Asterisk dial plan
Last week we got an interesting question from one of our customers. We needed to create an IVR menu that was able to send multiple audio responses.
Usecase
- User calls
- User hears audio response
- User presses number on keypad
- User hears audio response related to this number.
In this post, I would like to give you a basic dial plan example to help you get started with your IVR menu.
What is a IVR menu
IVR stands for Interactive Voice Response and is used to describe a system where a caller navigates through a system by using the touch-tone keys on their phone keypad.
Our Asterisk IVR menu
Let's get started with our example.
Let's start with creating a context call me.
# incoming call
[callme]
Now let's answer the incoming call.
exten => s,1,Answer
Now it's time to play our first audio file.
exten => s,n,Playback(audio/play-this-audio-file.mp3)
After this, we'll monitor if the keypad is used.
exten => s,n,WaitExten(3)
exten => s,n,Goto(s,1)
When the keypad is used we will play the number audio files.
exten => 1,1,Noop(user pressed 1)
exten => 1,n,Playback(audio/play-this-audio-file.mp3)
exten => 2,1,Noop(user pressed 2)
exten => 2,n,Playback(audio/play-this-audio-file.mp3)
Our completed dial plan would look like this.
# incoming call
[callme]
exten => s,1,Answer
exten => s,n,Playback(audio/play-this-audio-file.mp3)
exten => s,n,WaitExten(3)
exten => s,n,Goto(s,1)
exten => 1,1,Noop(user pressed 1)
exten => 1,n,Playback(audio/play-this-audio-file.mp3)
exten => 2,1,Noop(user pressed 2)
exten => 2,n,Playback(audio/play-this-audio-file.mp3)
How would you like to use the Asterisk IVR menu? Let us know in the comments below.
There are no comments.