Asterisk:使用 AMD 检测机器或人类

问题描述 投票:0回答:3

我正在实现一个星号服务器。

我正在使用 PJSUA 将 wav 文件通过星号服务器发送到我的手机。

这是我的扩展.conf

[appel-sortant] ; Initialisation                                                                                                                                                                                                             
exten => _X.,1,Set(LOOP=0)
exten => _X.,2,Set(MAX=3)                                                                                                                                                                                                  
exten => _X.,n,Set(ASTREINTE=${EXTEN})
exten => _X.,n,Goto(astreinte,${EXTEN},10)                                                                                                                                                                               
exten => _X.,500,Hangup

[astreinte]
exten => _X.,10,Dial(SIP/${ASTREINTE}@forfait-ovh,20,gS(10))
exten => _X.,n,AMD()
exten => _X.,n,NoOp(${DIALSTATUS}) ; Here got ANSWER status
exten => _X.,n,NoOp(${AMDSTATUS}) ; Here got MACHINE or NOTSURE
exten => _X.,n,Hangup

我的问题是:

1/ 当我在从 PJSUA 发送 wav 文件的同时拨打我的电话号码时,通话结束时 AMDSTATUS 为 MACHINE

2/ 如果我在没有 wav 文件的情况下使用 pjsua 进行呼叫,则会收到 AMDSTATUS = NOTSURE。

AMD() 检测的是应答机还是呼叫机?

这是我的 Pjsua 线路文件:

pjsua --null-audio --local-port=5061 --id sip:[email protected] --registrar sip:192.168.X.X --realm * --username username --password password --auto-play --play-file=./sounds/sound.wav sip:[email protected]

我目前使用 asterisk 1.6.2.9-2squeeze。

sip asterisk pjsip
3个回答
1
投票

您需要尝试 AMD 函数中的设置。您有以下参数:

AMD([initialSilence[,greeting[,afterGreetingSilence[,totalAnalysis Time[,miniumWordLength[,betweenWordSilence[,maximumNumberOfWords[,silenceThreshold[,maximumWordLength]]]]]]]]])

initialSilence - Is maximum initial silence duration before greeting.
    If this is exceeded set as MACHINE
greeting - is the maximum length of a greeting.
    If this is exceeded set as MACHINE
afterGreetingSilence - Is the silence after detecting a greeting.
    If this is exceeded set as HUMAN
totalAnalysis Time - Is the maximum time allowed for the algorithm
    to decide HUMAN or MACHINE
miniumWordLength - Is the minimum duration of Voice considered to be a word
betweenWordSilence - Is the minimum duration of silence after a word to consider the audio that follows to be a new word
maximumNumberOfWords - Is the maximum number of words in a greeting
    If this is exceeded set as MACHINE
silenceThreshold - How long do we consider silence
maximumWordLength - Is the maximum duration of a word to accept.
    If exceeded set as MACHINE

根据 pjsua 应用程序检测到的静音、声音和声音长度模式,您应该能够确定这些参数的正确值,以实现您想要的结果。


1
投票

是 - AMD() 检测答录机是否接听。它可能返回的值是: 机器|人类 |不确定 |挂断

我不知道该函数的内部工作原理,但如果您正在播放 wav 文件 - amd() 可能认为它确实是一个答录机。

您的场景似乎提供了正确的结果。你的拨号方案和 Pjsua 线路对我来说似乎很好。


0
投票

星号SWPBX_AMD_STATUS:机器:INITIALSILENCE-2500-2500 每次,STATUS 都会不断地提出 MACHINE。 无论你如何改变amd.conf的值,结果都是一样的 原因是什么

© www.soinside.com 2019 - 2024. All rights reserved.