2

我在 Ubuntu 上使用 Asterisk 1.8。但是问题是我更改了 amd.conf 配置 AMD() 调用将 AMDSTATUS 检测为 MACHINE。请指导我正确设置 AMD 检测,如果有人拿起电话并说“嗨,这是某某”,而机器拿起 10 到 19 分钟的消息,然后发出哔哔声。如果有人可以为我解决这个问题,我愿意付费。

这是我的 amd.conf 设置:

[general]
initial_silence = 2250          ; Maximum silence duration before the greeting.
                                ; If exceeded then MACHINE.
greeting = 15000                ; Maximum length of a greeting. If exceeded then MACHINE.
after_greeting_silence = 2250   ; Silence after detecting a greeting.
                                ; If exceeded then HUMAN
total_analysis_time = 25000     ; Maximum time allowed for the algorithm to decide
                                ; on a HUMAN or MACHINE
min_word_length = 300           ; Minimum duration of Voice to considered as a word
between_words_silence = 250     ; Minimum duration of silence after a word to consider
                                ; the audio what follows as a new word
maximum_number_of_words = 8     ; Maximum number of words in the greeting.
                                ; If exceeded then MACHINE
silence_threshold = 500


here is my extensions.conf setting for this extension:
[AMDTEST]
exten=> s,1,Answer()
exten=> s,n,AMD()
exten=> s,n,NoOp(${AMDSTATUS})
exten=> s,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
exten=> s,n(mach),WaitForSilence(3000,1,20)
exten=> s,n,Playback(${VOICEFILE})
exten=> s,n,Hangup()
exten=> s,n(humn),WaitForSilence(500)
exten=> s,n,Playback(${VOICEFILE})
exten=> s,n,Hangup()



Output in Asterisk debug when I picked up the call and said 'Hi its me here'
Starting SIP/Vitelity-00000f92 at AMDTEST,1400,1 failed so falling back to exten 's'
    -- Executing [s@AMDTEST:1] Answer("SIP/Vitelity-00000f92", "") in new stack
    -- Executing [s@AMDTEST:2] AMD("SIP/Vitelity-00000f92", "") in new stack
    -- AMD: SIP/Vitelity-00000f92 7702002111 (N/A) (Fmt: slin)
    -- AMD: initialSilence [2250] greeting [15000] afterGreetingSilence [2250] totalAnalysisTime [25000] minimumWordLength [300] betweenWordsSilence [250] maximumNumberOfWords [8] silenceThreshold [256] maximumWordLength [5000] 
    -- AMD: Channel [SIP/Vitelity-00000f92]. Changed state to STATE_IN_SILENCE
    -- AMD: Channel [SIP/Vitelity-00000f92]. ANSWERING MACHINE: silenceDuration:2300 initialSilence:2250
    -- Executing [s@AMDTEST:3] NoOp("SIP/Vitelity-00000f92", "MACHINE") in new stack
    -- Executing [s@AMDTEST:4] GotoIf("SIP/Vitelity-00000f92", "0?humn:mach") in new stack
    -- Goto (AMDTEST,s,5)
    -- Executing [s@AMDTEST:5] WaitForSilence("SIP/Vitelity-00000f92", "3000,1,20") in new stack
    -- Waiting 1 time(s) for 3000 ms silence with 20 timeout
    -- Exiting with 3000ms silence >= 3000ms required
    -- Executing [s@AMDTEST:6] Playback("SIP/Vitelity-00000f92", "KC_TNA") in new stack
    -- <SIP/Vitelity-00000f92> Playing 'KC_TNA.gsm' (language 'en')
  == Spawn extension (AMDTEST, s, 6) exited non-zero on 'SIP/Vitelity-00000f92'
4

4 回答 4

4

我知道它有点旧的帖子。根据我的经验,它与 initial_silence 值和 total_analysis_time 值有关。设置以下内容:

 initial_silence=5100
 total_analysis_time=5000

这允许您的算法以正确的方式检测应答机。

于 2013-04-23T13:31:21.900 回答
2

你说得对,问题是我对 Asterisk AMD 没有那么丰富的经验。但经过大量阅读和反复试验后,我得到了这个工作正常(至少 80%)。最关键的是在调用 AMD() 之前添加后台命令。关键因素:1. 确保初始静音设置至少 3-4 秒(人的反应比机器快) 2. 确保您有足够的时间打招呼(典型的人打招呼在 2-3 秒内完成) 3. 微调等待根据经验检测机器后静音

这是扩展配置:

     [AMDTEST]
exten=> s,1,Answer()
exten=> s,2,Background(en_US/silence/1)
exten=> s,n,AMD()
exten=> s,n,NoOp(${AMDSTATUS})
exten=> s,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
exten=> s,n(mach),WaitForSilence(4500,2,16)
exten=> s,n,Playback(${VOICEFILE})
exten=> s,n,Hangup()
exten=> s,n(humn),Playback(${VOICEFILE})
exten=> s,n,Hangup()</code>

Amd.conf:
[general]
initial_silence = 4000      ; Maximum silence duration before the greeting.
                ; If exceeded then MACHINE.
greeting = 9000         ; Maximum length of a greeting. If exceeded then
 MACHINE.
after_greeting_silence = 2250   ; Silence after detecting a greeting.
                ; If exceeded then HUMAN
total_analysis_time = 15000 ; Maximum time allowed for the algorithm to deci
de
                ; on a HUMAN or MACHINE
min_word_length = 100       ; Minimum duration of Voice to considered as a w
ord
between_words_silence = 50  ; Minimum duration of silence after a word to co
nsider
                ; the audio what follows as a new word
maximum_number_of_words = 5 ; Maximum number of words in the greeting.
                ; If exceeded then MACHINE
silence_threshold = 256
于 2013-04-06T14:18:41.873 回答
0

您的检测原因由以下行描述:

ANSWERING MACHINE: silenceDuration:2300 initialSilence:2250

所以你增加了初始静音参数或者可能只是阈值。如果没有通话记录,几乎不可能得到正确的答案。

于 2013-03-30T18:50:17.560 回答
0

I want to share the observation. If you use call files - you need to have Background after Answer in your "IN LEG", otherwise AMD will not work

[CALLFILES-IN]
exten=> s,1,Answer()
exten=> s,2,Background(en/silence/1)
exten=> s,n,AMD()
于 2018-04-03T07:49:36.877 回答