Install the Certificate into FreeSWITCHweb
Replace sipjs.com with the domain name that you used to generate the certificate.chrome
其餘還有配置在本文檔的 《Freeswitch/wss》的章節。websocket
echo '' >> /usr/local/freeswitch/certs/wss.pem &&app
cat cert.pem >> /usr/local/freeswitch/certs/wss.pem &&dom
cat privkey.pem >> /usr/local/freeswitch/certs/wss.pem &&socket
cat chain.pem >> /usr/local/freeswitch/certs/wss.pem網站
240(139)上放了我申請的 gt.hhxx.com 的數字證書。.net
https://blog.csdn.net/ererfei/article/details/783309733d
由於webRTC須要https,因此對應的FreeSWITCH提供WebSocket服務也要wssserver
conf/var.xml中有兩個開關,要設置true
<X-PRE-PROCESS cmd="set" data="internal_ssl_enable=true"/>
<X-PRE-PROCESS cmd="set" data="external_ssl_enable=true"/>
conf/sip_profiles/internal.xml 中確保wss配置打開(SIP 服務的端口是 5060 ,默認ws端口是5066,而wss的默認端口是7443):
<!-- for sip over websocket support -->
<param name="ws-binding" value=":5066"/>
<!-- for sip over secure websocket support -->
<!-- You need wss.pem in $${certs_dir} for wss or one will be created for you -->
<param name="wss-binding" value=":7443"/>
配置完成以後,重啓freeswitch生效。
https://my.oschina.net/andywang1988/blog/1928391
這裏有個關於 apply-candidate-acl
如今有幾個疑點:
1 chrome只容許https的網站使用攝像頭和mic,因此咱們的web須要用https(也要申請一張數字證書, 最好是用子域名申請而不是用ip申請)
2 freeswitch端須要用wss協議,也須要一張數字證書; (備註:若是freeswitch和web server放在同一臺機,可能能夠公用一張數字證書;)
3 防火牆須要容許一些端口,好比7443, 5060, 5066等等 還有一些動態的udp端口;
4 要確保演示用的主機上安裝了攝像頭和mic,而且容許chrome使用攝像頭和mic;
5 若是內網不能上外網而致使dns沒法解析, 能夠經過增長host文件的方式指定域名/ip映射關係。