arm64架构下docker部署freeswitch
1、上传解压目录到/opt/hjj
通过网盘分享的文件:hjj_muluxia_SIP.tar.gz
链接: https://pan.baidu.com/s/1DySwGfkS9vlbqYHKzE_jGg?pwd=agak 提取码: agak
2、导入镜像
cd images
docker load -i freeswitch.tar
docker load -i nginx.tar
或者
docker pull humahe/freeswitch:v1.10.12
docker pull nginx:latest
3、修改配置文件改成本地IP,在 FreeSWITCH 配置中,conf/sip_profiles/internal.xml 和 conf/sip_profiles/external.xml 是两个核心的 SIP 配置文件,分别用于 内部 SIP 配置文件(internal profile) 和 外部 SIP 配置文件(external profile)
cd /opt/hjj/freeswitch
sed -i 's/192.168.8.60/10.90.11.45/g' conf/sip_profiles/internal.xml
sed -i 's/192.168.8.60/10.90.11.45/g' conf/sip_profiles/external.xml
4、部署freeswitch
docker run --net=host --name freeswitch \-e SOUND_RATES=8000:16000 \-e SOUND_TYPES=music:en-us-callie \-v /opt/hjj/freeswitch:/usr/local/freeswitch \humahe/freeswitch:v1.10.12
5、测试用两个windows电脑通过PortSIP测试sip是否通信成功
window安装的客户端
通过网盘分享的文件:portsip-uc-client-61.40.0 (1).msi
链接: https://pan.baidu.com/s/1V3lLuvpa-BhBymnNeIHdjg?pwd=pvcr 提取码: pvcr
–来自百度网盘超级会员v2的分享
用户和密码在这个目录下/opt/hjj/freeswitch/conf/directory/default/
6、测试网页是否成功
1、修改配置
vim /opt/hjj/sipjs-demo/index.html
主要修改以下几项const serverIP = '10.90.11.45';const wssPort = '7443';const wsPort = '5066';const user = '1001';const password = 'password';const useWss = true; // Set to false to use ws instead of wss
2、部署网页版客户端
docker run -d -p 81:80 -p 8443:443 --name sipjs-container -v /opt/hjj/sipjs-demo/nginx.conf:/etc/nginx/conf.d/default.conf -v /opt/hjj/sipjs-demo/index.html:/usr/share/nginx/html/index.html -v /opt/hjj/sipjs-demo/sip.js:/usr/share/nginx/html/sip.js -v /opt/hjj/sipjs-demo/ssl:/etc/nginx/ssl nginx:latest
电脑测试网页拨打app
先访问7443信任之后再通过8443拨打电话
https://10.90.11.45:7443/
https://10.90.11.45:8443/
调式freeswitch用的命令
- 查看实时注册状态
fs_cli -x "sofia status profile internal reg"
- SIP模块是否激活
fs_cli -x "sofia status profile internal"
5, 验证 SIP 服务:
fs_cli -x "sofia status"
遇到的报错
freeswitch webrtc- CODEC NEGOTIATION ERROR. SDP
2019-01-08 17:39:49.221806 [ERR] mod_sofia.c:2343 CODEC NEGOTIATION ERROR. SDP:
v=0
o=- 3481799438673358832 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS MP9KUnaULVHFpwTqhoSfv1fphnZ1jZqMmqsP
m=audio 57630 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 192.168.1.19
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2382557538 1 udp 2113937151 192.168.1.19 57630 typ host generation 0 network-cost 999
a=ice-ufrag:B3vK
a=ice-pwd:V7sBbym5dh+buN6G60VzS1zZ
a=ice-options:trickle
a=fingerprint:sha-256 01:E0:C0:8A:2A:6D:3A:C1:89:51:01:1D:49:A1:BB:93:7F:BF:09:0D:20:18:1A:FB:5A:32:B0:35:71:FF:79:FB
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=rtcp-mux
a=rtcp-fb:111 transport-cc
a=ssrc:1707582762 cname:IEUyTgVxrZhvH1Wf
a=ssrc:1707582762 msid:MP9KUnaULVHFpwTqhoSfv1fphnZ1jZqMmqsP 8824eac9-c860-4baa-bcd6-ae06a2103a4f
a=ssrc:1707582762 mslabel:MP9KUnaULVHFpwTqhoSfv1fphnZ1jZqMmqsP
a=ssrc:1707582762 label:8824eac9-c860-4baa-bcd6-ae06a2103a4f
修改internal.xml
在xml的最后添加
<param name="apply-candidate-acl" value="rfc1918.auto"/>
<param name="apply-candidate-acl" value="localnet.auto"/>