• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to create basic IVR on Asterisk

  • 00:43 lsb_release -a
  • 01:10 systemctl status asterisk
  • 01:29 cd /etc/asterisk/
  • 01:36 vim extensions.conf
  • 09:16 asterisk -rvvvvvvvvvvvvvvvvvvvvvvvvvv
  • 09:23 dialplan reload
7623

To Create Basic IVR on Asterisk

Introduction

IVR stands for Interactive Voice Response, a technology that automates routine customer service interactions by permitting callers to interact using touch-tone digits or their voice. A basic example of an IVR application is an automated attendant or voice menu: callers are presented with a recorded menu and respond by selecting a digit or, in some cases, by entering an extension number.

Procedure

Step 1: Check the OS version by using the below command

root@linuxhelp1:~# lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:    22.04
Codename:    jammy

Step 2: Check the status of the Asterisk by using the below command

root@linuxhelp1:~# systemctl status asterisk
● asterisk.service - LSB: Asterisk PBX
     Loaded: loaded (/etc/init.d/asterisk; generated)
     Active: active (running) since Thu 2023-07-27 07:25:18 IST; 2 weeks 1 day ago
       Docs: man:systemd-sysv-generator(8)
      Tasks: 71 (limit: 4537)
     Memory: 121.0M
        CPU: 13min 58.637s
     CGroup: /system.slice/asterisk.service
             └─1427 /usr/sbin/asterisk

Jul 27 07:25:18 linuxhelp1 systemd[1]: Starting LSB: Asterisk PBX...
Jul 27 07:25:18 linuxhelp1 asterisk[1404]:  * Starting Asterisk PBX: asterisk
Jul 27 07:25:18 linuxhelp1 asterisk[1404]:    ...done.
Jul 27 07:25:18 linuxhelp1 systemd[1]: Started LSB: Asterisk PBX.
Jul 27 07:25:25 linuxhelp1 asterisk[1427]: radcli: rc_read_config: rc_read_config: can't open /etc/radiusc>
Jul 27 07:25:25 linuxhelp1 asterisk[1427]: radcli: rc_read_config: rc_read_config: can't open /etc/radiusc>

Step 3: Move to the Asterisk directory by using the below command

root@linuxhelp1:~# cd /etc/asterisk/

Step 4: Edit the extensions.conf file to add IVR by using the below command

root@linuxhelp1:/etc/asterisk# vim extensions.conf
Add the following lines
[internal]
exten => 168,1,Background(pls-wait-connect-call)
exten => 168,n,Goto(test,s,1)
[test]

exten => s,1,Answer()
 same => n,Background(press-1&or&press2)
 same => n,WaitExten()

exten => 1,1,Playback(you-entered)
 same => n,SayNumber(${EXTEN})
 same => n,Dial(PJSIP/168,20)
 same => n,Hangup()

exten => 2,1,Playback(you-entered)
 same => n,SayNumber(${EXTEN})
 same => n,Dail(PJSIP/169,20)
 same => n,Hangup()

exten => i,1,Playback(option-is-invalid)

Step 5: Login to the Asterisk CLI mode by using the below command

root@linuxhelp1:/etc/asterisk# asterisk -rvvvvvvvvvvvvvvvvvvvvvvvvvv
Asterisk 20.3.1, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 20.3.1 currently running on linuxhelp1 (pid = 1427)

Step 6: Reload the dialplan by using the below command

linuxhelp1*CLI> dialplan reload
Dialplan reloaded.
    -- Including switch 'DUNDi/e164' in context 'ael-dundi-e164-switch'
    -- Including switch 'Lua/' in context 'public'
    -- Including switch 'Lua/' in context 'local'
    -- Including switch 'Lua/' in context 'demo'
    -- Including switch 'Lua/' in context 'default'
    -- Time to scan old dialplan and merge leftovers back into the new: 0.000382 sec
    -- Time to restore hints and swap in new dialplan: 0.000004 sec
    -- Time to delete the old dialplan: 0.000132 sec
    -- Total time merge_contexts_delete: 0.000518 sec
    -- pbx_config successfully loaded 27 contexts (enable debug for details).

Output of the basic IVR on the Asterisk
    -- Contact 169/sip:169@192.168.6.101:50089;transport=TCP;ob is now Reachable.  RTT: 3.135 msec
    -- Executing [168@internal:1] BackGround("PJSIP/167-00000024", "pls-wait-connect-call") in new stack
       > 0x7f533805a750 -- Strict RTP learning after remote address set to: 192.168.6.101:4000
       > 0x7f533805a750 -- Strict RTP learning after remote address set to: 192.168.6.101:4000
    -- <PJSIP/167-00000024> Playing 'pls-wait-connect-call.ulaw' (language 'en')
       > 0x7f533805a750 -- Strict RTP switching to RTP target address 192.168.6.101:4000 as source
    -- Executing [168@internal:2] Goto("PJSIP/167-00000024", "test,s,1") in new stack
    -- Goto (test,s,1)
    -- Executing [s@test:1] Answer("PJSIP/167-00000024", "") in new stack
    -- Executing [s@test:2] BackGround("PJSIP/167-00000024", "press-1&or&press2") in new stack
    -- <PJSIP/167-00000024> Playing 'press-1.ulaw' (language 'en')
    -- <PJSIP/167-00000024> Playing 'or.ulaw' (language 'en')
[Aug 11 07:48:42] WARNING[13945][C-0000001c]: file.c:824 ast_openstream_full: File press2 does not exist in any format
[Aug 11 07:48:42] WARNING[13945][C-0000001c]: file.c:1303 ast_streamfile: Unable to open press2 (format (ulaw)): No such file or directory
[Aug 11 07:48:42] WARNING[13945][C-0000001c]: pbx_builtins.c:1256 pbx_builtin_background: ast_streamfile failed on PJSIP/167-00000024 for press-1&or&press2
    -- Executing [s@test:3] WaitExten("PJSIP/167-00000024", "") in new stack
       > 0x7f533805a750 -- Strict RTP learning complete - Locking on source address 192.168.6.101:4000
    -- Executing [1@test:1] Playback("PJSIP/167-00000024", "you-entered") in new stack
    -- <PJSIP/167-00000024> Playing 'you-entered.ulaw' (language 'en')
    -- Executing [1@test:2] SayNumber("PJSIP/167-00000024", "1") in new stack
    -- <PJSIP/167-00000024> Playing 'digits/1.ulaw' (language 'en')
    -- Executing [1@test:3] Dial("PJSIP/167-00000024", "PJSIP/168,20") in new stack
    -- Called PJSIP/168
    -- PJSIP/168-00000025 is ringing
  == Everyone is busy/congested at this time (1:1/0/0)
    -- Executing [1@test:4] Hangup("PJSIP/167-00000024", "") in new stack
  == Spawn extension (test, 1, 4) exited non-zero on 'PJSIP/167-00000024'
linuxhelp1*CLI>
Disconnected from Asterisk server
Asterisk cleanly ending (0).
Executing last minute cleanups

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps How to Create a Basic IVR on Asterisk. Your feedback is much welcome.

Tags:
caden
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is an abbreviation of IVR in an Asterisk?

A

IVR stands for Interactive Voice Response

Q

What is Asterisk IVR?

A

A technology that automates routine customer service interactions by allowing callers to interact using touch-tone digits or their voice.

Q

What is the use of the IVR?

A

An IVR application is an automated attendant or voice menu: callers are presented with a recorded menu and respond by selecting a digit or, in some cases, by entering an extension number.

Q

How many types of IVR are there?

A

The two basic types of IVR services are inbound and outbound.

Q

How many options should an IVR have?

A

Five Options in IVR on Asterisk

Related Tutorials in How to create basic IVR on Asterisk

Related Tutorials in How to create basic IVR on Asterisk

How to install Meld tool in Ubuntu
How to install Meld tool in Ubuntu
Feb 25, 2017
How to install Dconf-Editor on Ubuntu 18.04
How to install Dconf-Editor on Ubuntu 18.04
Jul 14, 2018
How to install and update OpenSSL on Ubuntu 16.04
How to install and update OpenSSL on Ubuntu 16.04
Mar 9, 2017
How to install GLib 2.0 on Ubuntu 17.04
How to install GLib 2.0 on Ubuntu 17.04
May 22, 2017
How to Install Android Emulator on Ubuntu 20.4.1
How to Install Android Emulator on Ubuntu 20.4.1
Jul 13, 2021
How To Install AnyDesk on Ubuntu 16.04
How To Install AnyDesk on Ubuntu 16.04
Apr 4, 2018
How to install Genymotion 2.12.1 on Ubuntu 18.04
How to install Genymotion 2.12.1 on Ubuntu 18.04
Jul 9, 2018
How to install Timeshift 18.4 on Ubuntu 18.04
How to install Timeshift 18.4 on Ubuntu 18.04
Jul 6, 2018

Related Forums in How to create basic IVR on Asterisk

Related Forums in How to create basic IVR on Asterisk

Ubuntu
matthew class=
Failed to enable unit: Refusing to operate on linked unit file sshd.service
Apr 15, 2019
Ubuntu
mason class=
Passwd: You may not view or modify password information for root On Ubuntu 19.04
May 27, 2019
Ubuntu
isaac class=
/etc/apt/sources.list Permission denied
May 18, 2017
Ubuntu
yousuf class=
lsb_release command not working : Debian
Jan 18, 2018
ifconfig command
jackbrookes class=
what is the location of the ifconfig program on your machine?
Jan 4, 2018
Ubuntu
mason class=
"E: Package 'php-mcrypt' has no installation candidate" error on Ubuntu 20.4.1
Mar 15, 2021
NFS
luke class=
clnt_create: RPC: Program not registered
Apr 25, 2017
Apache
isaac class=
How to disable apache welcome page on Ubuntu
Dec 15, 2018

Related News in How to create basic IVR on Asterisk

Related News in How to create basic IVR on Asterisk

How To Install Mixxx on Ubuntu 16.04
How To Install Mixxx on Ubuntu 16.04
Oct 11, 2017
Ubuntu 17.04 released with greater expectations
Ubuntu 17.04 released with greater expectations
Apr 15, 2017
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Mar 1, 2017
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Sep 2, 2017
Ubuntu Unity is no more: One Linux dream has been axed
Ubuntu Unity is no more: One Linux dream has been axed
Apr 7, 2017
What’s next for Ubuntu Linux Desktop?
What’s next for Ubuntu Linux Desktop?
Apr 11, 2017
Say Hi to Ubuntu's new mascot
Say Hi to Ubuntu's new mascot
Mar 22, 2019
KDE Connect App was removed from Google Play Store and brought back in 24 hours
KDE Connect App was removed from Google Play Store and brought back in 24 hours
Mar 22, 2019
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Sebastian ?
How to change non required to required field in SuiteCRM Custom/Default Modules

How to change not required to the required field in SuiteCRM Custom/Default Modules?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.