freeswitch+webrtc

本文详细介绍了如何配置Freeswitch以支持WebRTC,并解决了配置过程中遇到的一些常见问题,如端口设置、证书生成及IPv6导致的连接错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

起初 接到这任务 本以为很简单的事  因为自己在书上见过只要小改就可以让freeswitch支持webrtc 事与愿违啊  苍天弄人 啊
开始  修改freeswitch的配置  /conf/sip_profiles/internal.xml   将ws-binding  的注释取消  也就是将端口号5066 打开 使其支持websocket
  
  书上说的以后只要添加上需要的解码器就可以使用  但是结果  压根用不了  (人家5066是不需要sll的 但FS 老人家不让你过 一定要SSl)
  
  之后就是在一个劲的鼓捣 7443 端口号  也就是internal.xml文档里面的
  
  <param name="tls-cert-dir" value="/usr/local/freeswitch/certs"/>
  <param name="wss-binding" value=":7443"/>
  
  完事之后 在/usr/local/freeswitch/certs  下将wss.pem 等文件拷贝进去就可以了
  
  (还有一些参数的设置  不太清楚管不管用 先列出来   <X-PRE-PROCESS cmd="set" data="internal_auth_calls=true"/>
                                                    <X-PRE-PROCESS cmd="set" data="external_auth_calls=ture"/>
   )
   
   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
<param name="tls-cert-dir" value="/etc/freeswitch/certs"/>
<param name="wss-binding" value=":7443"/>
Change the default registration password to prevent the world from logging in and making calls on your server.
nano /etc/freeswitch/vars.xml
<X-PRE-PROCESS cmd="set" data="default_password=your_cool_new_password"/>
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
      
      
      好了  大功告成!!!!!!!!!!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值