我试图从SIpJs打电话给Asterisk 12.我的同伴就在这里
[6002]
type=friend
secret=6002
host=dynamic
context=public
transport=ws
avpf=yes
icesupport=no
encryption = no
我的JsSip代码在这里
var configuration = {
'ws_servers': 'ws://192.168.0.102:8088/ws',
'uri': 'sip:6002@192.168.0.102',
'password': '6002'
};
var options = {
'eventHandlers': eventHandlers,
'mediaConstraints': {'audio': true, 'video': false}
};
function call() {
coolPhone.call('sip:6003@192.168.0.102', options);
}
这是相应的注册,但当我打电话给"打电话"函数星号记录此错误
Rejecting secure audio stream without encryption details: audio 46421 RTP/SAVPF 111 103 104 0 8 106 105 13 126
JSSIp错误在这里
调用失败,原因是:SDP不兼容
有人能帮助我吗?
答案 0 :(得分:2)
首先,您需要为DTLS创建证书。然后从每个对等端启用DTLS。
使用以下命令创建证书。(将X.X.X.X替换为星号服务器IP)
mkdir /etc/asterisk/keys
cd ${ASTERISKSOURCE_PATH}/contrib/scripts/
./ast_tls_cert -C X.X.X.X -O "My Super Company" -d /etc/asterisk/keys
然后在同伴中添加以下按键:
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS