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

How to use AMD Answering Machine Detection on Asterisk in Oracle Linux 9.3

  • 00:37 cat /etc/os-release
  • 00:53 systemctl status asterisk.service
  • 01:11 cd /etc/asterisk/
  • 01:33 vim /etc/extensions.conf
  • 02:00 asterisk -rvvvvvvvvvvvvvv
  • 02:12 dialplan reload
  • 03:51 exit
  • 04:03 cat amd.conf
7831

To Use AMD - Answering Machine Detection On Asterisk On Oracle Linux 9.3

Introduction:

This application attempts to detect an answering machine, based on the timing patterns. This application is usually used by outbound calls originating from either call files or the Asterisk Manager Interface. This application sets the AMDSTATUS variable is set to one of the following, to show what type of call was detected.

Procedure:

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 ~]# systemctl status asterisk.service
● asterisk.service - LSB: Asterisk PBX
     Loaded: loaded (/etc/rc.d/init.d/asterisk; generated)
     Active: active (running) since Mon 2024-02-19 04:02:05 IST; 2 months 18 days ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1001 ExecStart=/etc/rc.d/init.d/asterisk start (code=exited, status=0/SUCCESS)
   Main PID: 1062
      Tasks: 37 (limit: 21739)
     Memory: 63.3M
        CPU: 8.945s
     CGroup: /system.slice/asterisk.service
             ├─1056 /bin/sh /usr/sbin/safe_asterisk
             └─5831 /usr/sbin/asterisk -f -vvvg -c

Feb 19 04:02:05 linuxhelp systemd[1]: Starting LSB: Asterisk PBX...
Feb 19 04:02:05 linuxhelp asterisk[1001]: Starting asterisk:
Feb 19 04:02:05 linuxhelp systemd[1]: asterisk.service: Can't open PID file /run/asterisk/asterisk.pid (yet?) after start: Operation not permitted
Feb 19 04:02:05 linuxhelp systemd[1]: asterisk.service: Supervising process 1062 which is not our child. We'll most likely not notice when it exits.
Feb 19 04:02:05 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 by using the below command

[root@linuxhelp asterisk]# vim /etc/extensions.conf
[internal]
exten => 167,1,Answer()
exten => 167,n,AMD()
exten => 167,n,GotoIf("${AMDSTATUS}" = "HUMAN"]?allow:deny)
exten => 167,n(deny),WaitForSilence(20)
exten => 167,n,Playback(asterisk-friend)
exten => 167,n,Hangup()
exten => 167,n(allow),NoOp(Call from the ${EXTEN} is Detected as a Human)
exten => 167,n,Dial(PJSIP/${EXTEN})
exten => 167,n,Playback(im-sorry)
exten => 167,n,Hangup()

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

[root@linuxhelp asterisk]# 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 = 6252)
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.000009 sec
    -- Time to restore hints and swap in new dialplan: 0.000009 sec
    -- Time to delete the old dialplan: 0.000009 sec
    -- Total time merge_contexts_delete: 0.000027 sec
    -- pbx_config successfully loaded 1 contexts (enable debug for details).

Step 7: Make a call from 168 to 167 by using the Zoiper and Microsip Software as shown in the below image. Snap1

Output:-

linuxhelp*CLI> 
    -- Executing [167@internal:1] Answer("PJSIP/168-00000002", "") in new stack
       > 0x7fefdc03d1f0 -- Strict RTP learning after remote address set to: 192.168.6.102:4000
    -- Executing [167@internal:2] AMD("PJSIP/168-00000002", "") in new stack
    -- AMD: PJSIP/168-00000002 168 (N/A) (Fmt: ulaw)
    -- AMD: initialSilence [2500] greeting [1500] afterGreetingSilence [800] totalAnalysisTime [5000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [2] silenceThreshold [256] maximumWordLength [5000] 
       > 0x7fefdc03d1f0 -- Strict RTP switching to RTP target address 192.168.6.102:4000 as source
    -- AMD: Channel [PJSIP/168-00000002]. Changed state to STATE_IN_SILENCE
    -- AMD: Channel [PJSIP/168-00000002]. ANSWERING MACHINE: silenceDuration:2500 initialSilence:2500
    -- Executing [167@internal:3] GotoIf("PJSIP/168-00000002", ""MACHINE" = "HUMAN"]?allow:deny") in new stack
    -- Goto (internal,167,7)
    -- Executing [167@internal:7] NoOp("PJSIP/168-00000002", "Call from the 167 is Detected as a Human") in new stack
    -- Executing [167@internal:8] Dial("PJSIP/168-00000002", "PJSIP/167") in new stack
    -- Called PJSIP/167
    -- PJSIP/167-00000003 is ringing
       > 0x7fefdc03d1f0 -- Strict RTP learning complete - Locking on source address 192.168.6.102:4000
       > 0x7fefdc02ea00 -- Strict RTP learning after remote address set to: 192.168.6.102:8000
       > 0x7fefdc02ea00 -- Strict RTP switching to RTP target address 192.168.6.102:8000 as source
    -- PJSIP/167-00000003 answered PJSIP/168-00000002
    -- Channel PJSIP/167-00000003 joined 'simple_bridge' basic-bridge <aaeed59b-b235-4114-9cbc-1f1b4f5a81e5>
    -- Channel PJSIP/168-00000002 joined 'simple_bridge' basic-bridge <aaeed59b-b235-4114-9cbc-1f1b4f5a81e5>
       > Bridge aaeed59b-b235-4114-9cbc-1f1b4f5a81e5: switching from simple_bridge technology to native_rtp
       > Locally RTP bridged 'PJSIP/168-00000002' and 'PJSIP/167-00000003' in stack
       > 0x7fefdc02ea00 -- Strict RTP learning complete - Locking on source address 192.168.6.102:8000
    -- Channel PJSIP/167-00000003 left 'native_rtp' basic-bridge <aaeed59b-b235-4114-9cbc-1f1b4f5a81e5>
    -- Channel PJSIP/168-00000002 left 'native_rtp' basic-bridge <aaeed59b-b235-4114-9cbc-1f1b4f5a81e5>
  == Spawn extension (internal, 167, 8) exited non-zero on 'PJSIP/168-00000002'
linuxhelp*CLI>

Step 8: Exit from the asterisk CLI mode by using the below command.

linuxhelp*CLI> exit

Step 9: Path of the amd.conf file where we edit the AMD configuration by using the below command

[root@linuxhelp asterisk]# cat amd.conf
;
; Answering Machine Detection Configuration
;

[general]
total_analysis_time = 5000	; Maximum time allowed for the algorithm to decide
				; on whether the audio represents a HUMAN, or a MACHINE
silence_threshold = 256		; If the average level of noise in a sample does not reach
				; this value, from a scale of 0 to 32767, then we will consider
				; it to be silence.
;playback_file = 		; Audio file to play while AMD is running, so the caller
				; does not just hear silence. Note that specifying this here
				; will apply to ALL AMD runs, so you may wish to set it
				; in the dialplan as an argument to AMD() instead.
				; Default is no audio file (not to play anything).

; Greeting ;
initial_silence = 2500		; Maximum silence duration before the greeting.
				; If exceeded, then the result is detection as a MACHINE.
after_greeting_silence = 800	; Silence after detecting a greeting.
				; If exceeded, then the result is detection as a HUMAN
greeting = 1500			; Maximum length of a greeting. If exceeded, then the
				; result is detection as a MACHINE.

; Word detection ;
min_word_length = 100		; Minimum duration of Voice to considered as a word
maximum_word_length = 5000	; Maximum duration of a single Voice utterance allowed.
between_words_silence = 50	; Minimum duration of silence after a word to consider
				; the audio what follows as a new word

maximum_number_of_words = 2	; Maximum number of words in the greeting
				; If exceeded, then the result is detection as a MACHINE

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps to use AMD Answering Machine Detection on Asterisk on Oracle Linux 9.3. Your feedback is much welcome.

Tags:
michael
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is the use of AMD?

A

Attempt to detect answering machines.

Q

What are the different types of AMDSTATUS?

A

MACHINE, HUMAN, NOTSURE, HANGUP

Q

How to use the AMD application on an Asterisk dialplan?

A

Syntax : exten => extension,priority,AMD()

Q

Where is the AMD configuration file located?

A

/etc/asterisk/amd.conf

Q

How to reload the dialplan?

A

dialplan reload

Related Tutorials in How to use AMD Answering Machine Detection on Asterisk in Oracle Linux 9.3

Related Tutorials in How to use AMD Answering Machine Detection on Asterisk in 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 use AMD Answering Machine Detection on Asterisk in Oracle Linux 9.3

Related Forums in How to use AMD Answering Machine Detection on Asterisk in 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 use AMD Answering Machine Detection on Asterisk in Oracle Linux 9.3

Related News in How to use AMD Answering Machine Detection on Asterisk in 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 Isaac ?
How to run windows application in linux

I need to run the windows application in my Linux machine, instead of installing from yum repo or any other repos. How to do that..??

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.