sip.js基于 FreeSwitch的使用过程
2016-12-05 14:51
344 查看
sip.js基于 FreeSwitch的使用过程
tags:WebRTCsip.js FreeSwitch 音视频通话 创建时间:2016-10-23 13:29:05
http://139.196.40.50:8088/topics/9?r=1477200242
Configure FreeSWITCH
SIP.js has been tested with FreeSWITCH 1.5.14 without any modification to the source code of SIP.js or FreeSWITCH. Later versions of FreeSWITCH will require similar configuration.
System Setup
FreeSWITCH and SIP.js were tested using the following setup:
CentOS 6.6 minimal (x86_64)
FreeSWITCH 1.5.14
A public IP address to avoid NAT scenarios on the server side. Required Packages
Install the following dependencies:
git autoconf automake libtool gcc-c++ libuuid-devel zlib-devel libjpeg-devel ncurses-devel openssl-develUsing YUM, all dependencies can be installed with:
yum install git autoconf automake libtool gcc-c++ libuuid-devel zlib-devel libjpeg-devel ncurses-devel openssl-devel
Install FreeSWITCH
FreeSWITCH recommends using the latest version of FreeSWITCH from the FreeSWITCH git repo. This example uses FreeSWITCH tag v1.5.14.
```
cd /usr/local/src/ git clone https://freeswitch.org/stash/scm/fs/freeswitch.git cd /usr/local/src/freeswitch git checkout v1.5.14 ./bootstrap.sh ./configure make (This may take a few minutes.) make install
```
Configure FreeSWITCH
The default configuration files for FreeSWITCH are located in /usr/local/freeswitch/conf.
Start by editing the internal SIP profile sip_profiles/internal.xml. Uncomment the line to allow web sockets to talk to FreeSWITCH. No other configuration changes are necessary to make FreeSWITCH work with WebRTC.
``` <!--internal.xml--> <!-- Uncomment the following: --> <param name="ws-binding" value=":5066"/> ```
If you’d like to enable video as well as audio, adjust FreeSWITCH’s codec preferences to include VP8.
<!--vars.xml--> <X-PRE-PROCESS cmd="set" data="global_codec_prefs=PCMU,PCMA,VP8"> <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMU,PCMA,VP8"> ```
Start FreeSWITCH: /usr/local/freeswitch/bin/freeswitch.
Configure SIP.js
SIP.js works with FreeSWITCH without any special configuration parameters. The following UA is configured to connect to a default FreeSWITCH configuration. Replace 127.0.0.1 with the IP address of your FreeSWITCH server.
``` var config = { // Replace this IP address with your FreeSWITCH IP address uri: '1000@127.0.0.1', // Replace this IP address with your FreeSWITCH IP address // and replace the port with your FreeSWITCH port ws_servers: 'ws://127.0.0.1:5066', // FreeSWITCH Default Username authorizationUser: '1000', // FreeSWITCH Default Password password: '1234' }; var ua = new SIP.UA(config); ```
Troubleshooting
It is known that SIP.js and FreeSWITCH might not interop well if you have the following option enabled on FreeSWITCH:
``` <variable name="sip-force-contact" value="NDLB-connectile-dysfunction"/> ```
Firefox 34+ requires SIP.js 0.6.4 or later to interop with FreeSWITCH or Asterisk.
FreeSWITCH has a wiki article on WebRTC support.
转自:http://www.freeswitch.net.cn/122.html
$(".MathJax").remove();
相关文章推荐
- 图示ireport中使用javabean作数据源开发基于jasperreports报表过程
- 使用Node.js + Mongodb构建基于Cloud Foundry的项目
- 使用 Node.js 开发基于 JavaScript 的 RESTful应用
- 基于Node.js的文件服务器(使用Q重构代码)
- sofia sip开发六 寻找开发过程中遇到sofia sip库使用问题的解决方法
- 使用js实现基于可视布局信息的网页噪音去除的测试方法
- 基于gSOAP使用头文件的C语言版web service开发过程例子
- 基于gSOAP使用头文件的C语言版web service开发过程例子
- 对基于JUnit和Ant的测试用例执行过程使用Kieker(AspectJ)进行监控的方法
- 基于xAuth,打造QML+js OAuth验证过程
- JSSIP源码简介-关于SIP协议使用的一个JavaScript库/JS在通讯中的应用
- JSSIP源码简介-关于SIP协议使用的一个JavaScript库/JS在通讯中的应用
- 使用雅虎YUI Compressor压缩JS过程心得记录
- 仿QQ使用JAVA、C#、JS基于TCP交互的Demo
- 基于jQuery和flash使用js接口的网页mp3音乐播放器 -- JPlayer 用法详解
- JS中批量给元素绑定事件过程使用闭包解决
- JS中批量给元素绑定事件过程中的相关问题使用闭包解决
- js中document.write使用过程中的一点疑问解答
- 使用js过程中遇到的小问题总结(随使用情况不断添加)
- 基于gSOAP使用头文件的C语言版web service开发过程例子