起初 接到这任务 本以为很简单的事 因为自己在书上见过只要小改就可以让freeswitch支持webrtc 事与愿违啊 苍天弄人 啊
开始 修改freeswitch的配置 /conf/sip_profiles/internal.xml 将ws-binding 的注释取消 也就是将端口号5066 打开 使其支持websocket
书上说的以后只要添加上需要的解码器就可以使用 但是结果 压根用不了 (人家5066是不需要sll的 但FS 老人家不让你过 一定要SSl)
之后就是在一个劲的鼓捣 7443 端口号 也就是internal.xml文档里面的
完事之后 在/usr/local/freeswitch/certs 下将wss.pem 等文件拷贝进去就可以了
(还有一些参数的设置 不太清楚管不管用 先列出来
)
wss.pem等文件的生成可以参考网上的资料 (
Configure SSL for WebRTC
Create a Root tls key.
openssl genrsa -out rootCA.key 2048
Create a self signed cert using your key.
openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.pem
Fill out everything to the best of your ability. Make sure you include your fully qualified domain name. Create the directories Freeswitch will look for these keys.
mkdir /etc/freeswitch/certs
mkdir /etc/freeswitch/tls
Create wss.pem and dtls-srtp.crt files from your tls keys.
cat rootCA.pem rootCA.key > /etc/freeswitch/certs/wss.pem
cat rootCA.pem > /etc/freeswitch/tls/dtls-srtp.crt
Uncomment wss-binding and set the tls-cert-dir in your internal sip profile. These two lines should look like this in your /etc/freeswitch/sip_profiles/internal.xlm
nano /etc/freeswitch/sip_profiles/internal.xml
Change the default registration password to prevent the world from logging in and making calls on your server.
nano /etc/freeswitch/vars.xml
Reload the freeswitch settings by starting up the freeswitch console and executing reloadxml.
fs_cli
>reloadxml
>/exit
)
webrtc客户端 我使用的是 jssip开源的一个demo https://tryit.jssip.net/
使用谷歌浏览器 将证书添加 打开 https://139.129.13.218:7443/ws
之后在页面上输入相应的信息 并且将advanced settings 里面的session_timers取消
至此 客户端可以使用了
但是本人PC 一直使用不了 查看LOG文件是因为 AUDIO RTP REPORTS ERROR: [Remote Address Error!]
这个问题是因为ipV6 使得地址识别不了 因此不能用 下面的方法可以将ipv6的问题解决
只需要使用以下3条命令把IPv6的接口关闭即可,在命令提示符窗口中输入以下命令运行即可解决了关闭ipv6。
netsh interface teredo set state disable
netsh interface 6to4 set state disabled
netsh interface isatap set state disabled
或者 netsh interface IPV6 set global randomizeidentifier=disabled
netsh interface IPV6 set privacy state=disable
netsh interface ipv6 6to4 set state state=disabled
netsh interface ipv6 isatap set state state=disabled
netsh interface ipv6 set teredo=disable
好了 大功告成!!!!!!!!!!