0

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

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

这是我的 extension.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:username@192.168.X.X --registrar sip:192.168.X.X --realm * --username username --password password --auto-play --play-file=./sounds/sound.wav sip:0123456789@192.168.X.X

我目前在星号 1.6.2.9-2squeeze 上。

4

2 回答 2

1

是 - AMD() 检测应答机是否接听。它可以返回的可能值是: MACHINE | 人类 | 通知 | 挂断

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

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

于 2012-08-14T15:04:55.813 回答
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 应用程序检测到的静音模式、声音和声音长度,您应该能够确定这些参数的正确值以实现您想要的结果。

于 2012-08-16T01:48:15.920 回答