IVR is an Interactive Voice Response which takes input from a caller, perform an action based on that input, and return a result to the caller. Traditionally, IVR systems have been very complex and expensive to implement. The aim of this tutorial is to showcase simple way to get IVR in Asterisk system.
This is a continuation of Tutorials on Asterisk and Software based PBX. You should have a working Asterisk system before trying to setup IVR in Asterisk. If you’re new and would like to install Asterisk, you can use our tutorial based on CentOS below:
Working of IVR:
When an incoming call get to IVR context, the first prompt tells the caller what IVR expects from the caller, a method of receiving input from the caller, logic to verify that the caller’s response is valid input, logic to determine what the next step of the IVR should be, and finally, a storage mechanism for the responses, if applicable.
Configure IVR in Asterisk
The IVR in Asterisk design shown here is for a small campus with the following offices as sample:
- Reception office
- Finance office
- DVC office
- Security office
- ICT office
- School Office
- Accommodation Office
You can modify all configurations to suit your use case. SIP users added to sip.conf file are as below.
The next step is to have the context ready to rock. The context is given below:
To make calls going to extension numbers 101-107 get to IVR in Asterisk context, we’ve to include IVR context in the main context for incoming calls. The file edited is
/etc/asterisk/extensions.conf. Then adding the following line of code,
Now whenever a person dial 101 and make a call, its processing will be done on IVR context. Key point to note is that all extension numbers used on IVR must be registered for a call to be routed.
If you have a separate call routing logic on extensions.conf for PSTN incoming calls, just include IVR context in it.
If you Love what we do, support us by downloading this tutorial as pdf from the link below: