Asterisk Answering Machine Detection (AMD) Configuration
Asterisk Answering Machine Detection configuration :
Asterisk Answering Machine Detection Dialplan logic, Let’s you differentiate between the real Human and the Machine, Like Voicemail box. There are few situation in call center applications where we want to transfer the call to Agent only if the real person answers the call, This logic is called Live Person Detection.
Here is the Asterisk Dialplan logic to detect between the Answering Machine and Human. It’s work pretty well for many cases.
extension.conf
1 2 3 4 5 6 7 8 9 10 11 12 |
[amd] exten=> _X.,1,Answer() exten=> _X.,n,Background(silence/1) exten=> _X.,n,amd() exten=> _X.,n,NoOp(${AMDSTATUS}) exten=> _X.,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach) exten=> _X.,n(mach),NoOp(OOPS ! We've got a Machine .. !!!!!) exten=> _X.,n,WaitForSilence(4500,2,16) ;exten=> s,n,Playback(${VOICEFILE}) exten=> _X.,n,Hangup() exten=> _X.,n(humn),NoOp( We've got a human on the line!) exten=> _X.,n,Hangup() |
Note : background(silence/1) is very important here.
amd.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[general] initial_silence = 2500 ; Maximum silence duration before the greeting. ; If exceeded then MACHINE. greeting = 1500 ; Maximum length of a greeting. If exceeded then MACHINE. after_greeting_silence = 800 ; Silence after detecting a greeting. ; If exceeded then HUMAN total_analysis_time = 5000 ; Maximum time allowed for the algorithm to decide ; on a HUMAN or MACHINE min_word_length = 100 ; Minimum duration of Voice to considered as a word 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 = 3 ; Maximum number of words in the greeting. ; If exceeded then MACHINE silence_threshold = 256 |
Sample Output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
-- Executing [100@amd:1] Answer("SIP/voipgw-00000067", "") in new stack -- Executing [100@amd:2] BackGround("SIP/voipgw-00000067", "silence/1") in new stack -- <SIP/voipgw-00000067> Playing 'silence/1.gsm' (language 'en') > 0x7f99c40154a0 -- Probation passed - setting RTP source address to 139.59.73.111:16670 -- Executing [100@amd:3] AMD("SIP/voipgw-00000067", "") in new stack -- AMD: SIP/voipgw-00000067 (N/A) (N/A) (Fmt: alaw) -- AMD: initialSilence [2500] greeting [1500] afterGreetingSilence [800] totalAnalysisTime [5000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [3] silenceThreshold [256] maximumWordLength [5000] -- AMD: Channel [SIP/voipgw-00000067]. Detected Talk, previous silence duration: 40 -- AMD: Channel [SIP/voipgw-00000067]. Detected Talk, previous silence duration: 40 -- AMD: Channel [SIP/voipgw-00000067]. Detected Talk, previous silence duration: 20 -- AMD: Channel [SIP/voipgw-00000067]. Changed state to STATE_IN_SILENCE -- AMD: Channel [SIP/voipgw-00000067]. Detected Talk, previous silence duration: 60 -- AMD: Channel [SIP/voipgw-00000067]. ANSWERING MACHINE: voiceDuration:1500 greeting:1500 -- Executing [100@amd:4] NoOp("SIP/voipgw-00000067", "MACHINE") in new stack -- Executing [100@amd:5] GotoIf("SIP/voipgw-00000067", "0?humn:mach") in new stack -- Goto (amd,100,6) -- Executing [100@amd:6] NoOp("SIP/voipgw-00000067", "OOPS ! We've got a Machine .. !!!!!") in new stack -- Executing [100@amd:7] WaitForSilence("SIP/voipgw-00000067", "4500,2,16") in new stack -- Waiting 2 time(s) for 4500 ms silence with 16 timeout -- Executing [100@amd:8] Hangup("SIP/voipgw-00000067", "") in new stack |
Thanks man. Helped me a lot!
thanks for yout post, using in my dialer.