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

How to get DTMF Input with Background Audio on Asterisk on Oracle Linux 9.3

  • 00:41 cat /etc/os-release
  • 00:55 systemctl status asterisk
  • 01:11 cd /etc/asterisk/
  • 01:23 vim extensions.conf
  • 04:07 asterisk -rvvvvvvvvvvvvvvvvvvvvvvvvvvv
  • 04:27 dialplan reload
  • 05:12 vim extensions.conf
  • 05:38 asterisk -rvvvvvvvvvvvvvvvvvvvvvvvvvvv
  • 05:43 dialplan reload
7877

To Get DTMF Input With Background Audio On Asterisk On Oracle Linux 9.3

Introduction

Dual-tone multi-frequency (DTMF) refers to the auditory signals produced by a telephone keypad when numbers are pressed. These tones are conveyed through the voice channel and serve to operate automated systems and indicate user input, such as the desired phone number. Each key on the keypad corresponds to a unique pair of tones at distinct frequencies.

Procedure Steps

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

[root@linuxhelp ~]#  cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="9.3"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Oracle Linux Server 9.3"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:9:3:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://github.com/oracle/oracle-linux"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 9"
ORACLE_BUGZILLA_PRODUCT_VERSION=9.3
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=9.3

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

[root@linuxhelp ~]#  cat /etc/os-releasesystemctl status asterisk.service 
● asterisk.service - LSB: Asterisk PBX
     Loaded: loaded (/etc/rc.d/init.d/asterisk; generated)
     Active: active (running) since Mon 2024-07-01 00:33:42 IST; 1min 31s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 6259 ExecStart=/etc/rc.d/init.d/asterisk start (code=exited, status=0/SUCCESS)
   Main PID: 6289 (asterisk)
      Tasks: 42 (limit: 21739)
     Memory: 38.8M
        CPU: 806ms
     CGroup: /system.slice/asterisk.service
             ├─6287 /bin/sh /usr/sbin/safe_asterisk
             └─6289 /usr/sbin/asterisk -f -vvvg -c
Jul 01 00:33:42 linuxhelp systemd[1]: Starting LSB: Asterisk PBX...
Jul 01 00:33:42 linuxhelp asterisk[6259]: Starting asterisk:
Jul 01 00:33:42 linuxhelp systemd[1]: asterisk.service: Can't open PID file /run/asterisk/asterisk.pid (yet?) after start: >
Jul 01 00:33:42 linuxhelp systemd[1]: asterisk.service: Supervising process 6289 which is not our child. We'll most likely >
Jul 01 00:33:42 linuxhelp systemd[1]: Started LSB: Asterisk PBX.

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

[root@linuxhelp ~]# cd /etc/asterisk/

Step 4: Edit the extensions.conf file to modify the dialplan by using the below command

[root@linuxhelp ~]# vim extensions.conf
Add those Following Lines
exten => _XXX,1,playback(hello)
exten => _XXX,n, playback(zombies)
exten => _XXX,n,WaitExten()
exten => 1,1,NoOp(you entered extension 1)
exten => 2,1,NoOp(you entered extension 2)
exten => i,1,Playback(invalid)

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

[root@linuxhelp ~]# asterisk -rvvvvvvvvvvvvvv
Asterisk 20.5.0, 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.5.0 currently running on linuxhelp (pid = 5831)
linuxhelp*CLI>

Step 6: Reload the dialplan by using the below command

linuxhelp*CLI> dialplan reload
Dialplan reloaded.
    -- Time to scan old dialplan and merge leftovers back into the new: 0.000003 sec
    -- Time to restore hints and swap in new dialplan: 0.000004 sec
    -- Time to delete the old dialplan: 0.000002 sec
    -- Total time merge_contexts_delete: 0.000009 sec
    -- pbx_config successfully loaded 1 contexts (enable debug for details).
Output of the DTMF get input in asterisk dialplan context by using playback application.
xecuting [167@internal:1] Playback("PJSIP/168-00000000", "hello") in new stack
       > 0x7ffaa0044ff0 -- Strict RTP learning after remote address set to: 192.168.6.101:4002
    -- <PJSIP/168-00000000> Playing 'hello.ulaw' (language 'en')
       > 0x7ffaa0044ff0 -- Strict RTP switching to RTP target address 192.168.6.101:4002 as source
    -- Executing [167@internal:2] Playback("PJSIP/168-00000000", "zombies") in new stack
    -- <PJSIP/168-00000000> Playing 'zombies.ulaw' (language 'en')
       > 0x7ffaa0044ff0 -- Strict RTP learning complete - Locking on source address 192.168.6.101:4002
  == Spawn extension (internal, 167, 2) exited non-zero on 'PJSIP/168-00000000'

Step 7: Edit the extensions.conf file to use Background application by using the below command

[root@linuxhelp ~]# vim extensions.conf
Add the following lines
exten => _XXX,1,playback(hello)
exten => _XXX,n,Background(zombies)
exten => _XXX,n,WaitExten()
exten => 1,1,NoOp(you entered extension 1)
exten => 2,1,NoOp(you entered extension 2)
exten => i,1,Playback(invalid)

Step 8: Again login to the Asterisk CLI mode by using the below command.

[root@linuxhelp ~]# asterisk -rvvvvvvvvvvvvvv
Asterisk 20.5.0, 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.5.0 currently running on linuxhelp (pid = 5831)
linuxhelp*CLI>

Step 9: Reload the dialplan by using the below command

linuxhelp*CLI> dialplan reload
Dialplan reloaded.
    -- Time to scan old dialplan and merge leftovers back into the new: 0.000004 sec
    -- Time to restore hints and swap in new dialplan: 0.000003 sec
    -- Time to delete the old dialplan: 0.000004 sec
    -- Total time merge_contexts_delete: 0.000011 sec
    -- pbx_config successfully loaded 1 contexts (enable debug for details).
Output of the DTMF get input in asterisk dialplan context by using background application
executing [168@internal:1] Playback("PJSIP/167-00000001", "hello") in new stack
       > 0x7ffaa0056b80 -- Strict RTP learning after remote address set to: 192.168.6.101:8000
       > 0x7ffaa0056b80 -- Strict RTP switching to RTP target address 192.168.6.101:8000 as source
    -- <PJSIP/167-00000001> Playing 'hello.ulaw' (language 'en')
    -- Executing [168@internal:2] BackGround("PJSIP/167-00000001", "zombies") in new stack
    -- <PJSIP/167-00000001> Playing 'zombies.ulaw' (language 'en')
       > 0x7ffaa0056b80 -- Strict RTP learning complete - Locking on source address 192.168.6.101:8000
  == Spawn extension (internal, 168, 2) exited non-zero on 'PJSIP/167-00000001'
    -- Added contact 'sip:168@192.168.6.101:55160;ob' to AOR '168' with expiration of 300 seconds
    -- Removed contact 'sip:168@192.168.6.101:65485;ob' from AOR '168' due to remove existing
  == Contact 168/sip:168@192.168.6.101:65485;ob has been deleted

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps to get DTMF input on Asterisk Dialplan Context on Oracle Linux 9.3. Your feedback is much welcome.

Tags:
matthew
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is DTMF and how is it used in Asterisk?

A

DTMF stands for Dual-Tone Multi-Frequency. It is the signal that your phone sends when you press a telephone's touch keys. In Asterisk, DTMF is used to interact with menus and perform various functions like navigating IVR systems.

Q

How do I play background audio and still detect DTMF inputs?

A

You can use the Background() application to play an audio file and wait for DTMF input simultaneously
exten => 123,1,Answer()
same => n,Background(welcome-message)
same => n,WaitExten()

Q

Can background noise affect DTMF detection?

A

Yes, background noise can sometimes cause false detections or missed DTMF inputs. Ensuring high-quality audio files and using appropriate gain levels can help minimize these issues.

Q

How to enter into Asterisk CLI?

A

By using the following command
asterisk –rvvvvvvvvvvvv

Q

How to change the dialplan in an Asterisk?

A

By editing the extensions.conf file to change the dialplan

Related Tutorials in How to get DTMF Input with Background Audio on Asterisk on Oracle Linux 9.3

Related Tutorials in How to get DTMF Input with Background Audio on Asterisk on Oracle Linux 9.3

How to install Xrdp Server (Remote Desktop) on Oracle Linux 8.5
How to install Xrdp Server (Remote Desktop) on Oracle Linux 8.5
Oct 17, 2022
How to install and update OpenSSL on Debian 11.3
How to install and update OpenSSL on Debian 11.3
Oct 21, 2022
How to Install and Configure Mega in Linux
How to Install and Configure Mega in Linux
Jul 19, 2016
How to use Aureport command on Linux
How to use Aureport command on Linux
Nov 28, 2017
How to install and configure Asterisk in CentOS
How to install and configure Asterisk in CentOS
Jul 19, 2016
How to install Development tools on Linux
How to install Development tools on Linux
Jun 12, 2018
How to Install mod_ssl and SSL certificate on Oracle Linux
How to Install mod_ssl and SSL certificate on Oracle Linux
Dec 30, 2021
How to install Nextcloud on Ubuntu 22.04 version
How to install Nextcloud on Ubuntu 22.04 version
Jun 23, 2023

Related Forums in How to get DTMF Input with Background Audio on Asterisk on Oracle Linux 9.3

Related Forums in How to get DTMF Input with Background Audio on Asterisk on Oracle Linux 9.3

Linux
jayce class=
shasum command not found
May 5, 2017
Linux
stephan class=
How to list all samba users
Jan 12, 2018
pv command
muhammad class=
pvcreate command not found error
May 9, 2017
Linux
henry class=
Starting NFS daemon: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
Apr 25, 2017
ifconfig command
jackbrookes class=
what is the location of the ifconfig program on your machine?
Jan 4, 2018
Linux
baseer class=
single command to apply setfacl for multiple user at a time
Jan 23, 2018
Linux
beulah class=
What does mean by 0 0 value in fstab file
Jan 2, 2018
CentOS
mason class=
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)
Nov 20, 2018

Related News in How to get DTMF Input with Background Audio on Asterisk on Oracle Linux 9.3

Related News in How to get DTMF Input with Background Audio on Asterisk on Oracle Linux 9.3

Anbox, the Android-to-Linux tool the developers have been waiting for
Anbox, the Android-to-Linux tool the developers have been waiting for
Apr 17, 2017
Linus Torvalds stops signing Linux kernel RC tarballs
Linus Torvalds stops signing Linux kernel RC tarballs
May 17, 2017
Capsule8 Launches Linux-Based Container Security Platform
Capsule8 Launches Linux-Based Container Security Platform
Feb 14, 2017
Symantec updates Management console product
Symantec updates Management console product
Nov 22, 2017
Latest Linux driver release feature seven AMD Vega
Latest Linux driver release feature seven AMD Vega
Mar 23, 2017
A Newer and a Faster Window Manager for Tina (Linux Mint 19.2)
A Newer and a Faster Window Manager for Tina (Linux Mint 19.2)
Apr 9, 2019
Microsoft makes its Azure App service now available on Linux Systems
Microsoft makes its Azure App service now available on Linux Systems
Sep 7, 2017
Docker friendly Alpine Linux gets hardened Node.js
Docker friendly Alpine Linux gets hardened Node.js
Apr 19, 2017
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 Elijah ?
Remote Desktop Connection Has Stopped Working

When accessing my remote machine server using remote desktop on a windows machine I am getting this error

forum (1)

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.