Rate this page:

IVR usage example: multi-level menu

Most of IVRs nowadays provide a caller with the number of options that can be chosen in a multi-level menu. While this kind of IVR can be built using vanilla VoxEngine javascript code, it's better to use a helper module (Modules.IVR) we created to simplify the process. It lets developers build IVR menus in scenarios much faster and write less code for that. Let's build the following IVR using the module:

It's rather simple, but have many input types: noinput, select, inputfixed, and inputunknown. VoxEngine scenario for this IVR menu:

Scenario code

Scenario code

This works exactly as it appears: IVR suggests a caller choose one of the options:

  • Press 1 to know the current time. Nothing else
  • Press 2 to enter an extension number of an employee. In the code above, it can be only the "100" extension, as specified on line 45-47. If the extension number "100" is specified, a scenario will try to make a PSTN call to the number specified on line 136. It should be a rented Voximplant number
  • Press 3 to forward a call to a US phone number. After choosing this option, a caller should enter a valid US phone number and press pound. The specified number can be any of valid US phone numbers, not necessarily a Voximplant's one


Go to the Applications section of the Voximplant Control panel, create an IVR application and an IVR-scenario inside of it. Then create an IVR-rule in the Routing tab of the application with the following settings:

Finally, switch to the Numbers tab of the IVR application, choose the Available attach a virtual/real phone number to this application and the rule:

Finally, switch to the Numbers tab with the Attached and Available sections. Switch to Available, select a rented virtual/real Voximplant number, and click Attach. In the window opened, specify IVR-rule, then click Attach.

Now all incoming calls will be forwarded to the IVR-scenario and processed by it.