概述

我们在web客户端使用sip协议时用的比较多的是sipml5库和jssip库。

但是sip协议比较重,又复杂,所以freeswitch内部就自定义了一个verto协议,方便在web页面上使用音视频服务。

verto协议通过websocket传输信令,协议内部数据格式为json,这样比较符合互联网开发人员的习惯,同时比sip协议更加轻量化。

freeswitch有一个endpoint模块叫做mod_verto,是用来作为服务端的协议适配器。

freeswitch的源码中有几个支持verto协议的web客户端实现,分别是verto demo、video_demo和verto communicator等,都是基于js实现的。

verto客户端的源码在freeswitch-1.8.7_master\html5\verto目录下,用户可以自行查看。

今天我们主要介绍一下verto communicator的安装部署过程。

verto communicator

verto communicator的官方介绍页面:https://freeswitch.org/confluence/display/FREESWITCH/Verto+Communicator 。

verto communicator是基于nodejs安装部署的,源代码目录中已经有nodejs相关的工具配置文件,可以快速的安装、部署、构建和运行verto communicator客户端。

但是呵呵,这玩意用的人少,所以维护更新也少,安装过程中大坑小坑很多。

坑一,nodejs不熟悉。先去学习nodejs的教程和基本使用方法。

坑二,npm的包安装要区分全局和本地。先去学习npm工具的基本教程。

坑三,bower安装依赖库时,git链接各种问题。拆分命令,多次尝试。

坑四,grunt对nodejs版本有要求。centos7默认的nodejs版本最高只有6.17,需要使用至少8+的版本。

唯一欣慰的一点就是,在verto communicator目录下安装成功过一次,再把整个目录拷贝到其他地方,就可以直接使用了。

环境

centos:CentOS  release 7.0 (Final)或以上版本

freeswitch:v1.8.7

GCC:4.8.5

安装部署

进入verto communicator目录

cd  /root/freeswitch-1.8.7_master/html5/verto/verto_communicator

安装npm工具

yum install npm

安装nodejs版本管理工具n,安装nodejs的8+版本并选定

npm install -g n

n 8

n lts

n

使用n选定nodejs8版本后,重启ssh终端

安装工具bower和grunt

npm install -g bower grunt

使用npm安装依赖库

npm install

使用bower安装依赖库,这一步巨坑无比

方法一,默认方法,但是无限失败

bower --allow-root install

方法二,拆分依赖库安装步骤,最后再合并

诀窍是。。。多试几次,然后祈祷。。。因为我第2次重装的时候,怎么都是失败

mv  bower.json bower.json.back

bower --allow-root init

bower install --allow-root moment/moment@~2.9.0 --save

bower install --allow-root jquery@~2.1.4 --save

bower install --allow-root js-cookie/js-cookie@~1.4.1 --save

bower install --allow-root jquery-json@~2.5.1 --save

bower install --allow-root angular@~1.3.15 --save

bower install --allow-root angular-gravatar@~0.4.1 --save

bower install --allow-root bootstrap@~3.3.4 --save

bower install --allow-root angular-toastr@~1.4.1 --save

bower install --allow-root angular-sanitize@~1.3.15 --save

bower install --allow-root angular-route@~1.3.15 --save

bower install --allow-root bower-angular@~1.2.16 --save

bower install --allow-root angular-prompt@~1.1.1 --save

bower install --allow-root angular-animate@~1.3.15 --save

bower install --allow-root angular-cookies@~1.3.15 --save

bower install --allow-root angular-directive.g-signin@~0.1.2 --save

bower install --allow-root angular-fullscreen@~1.0.1 --save

bower install --allow-root ngstorage@~0.3.9 --save

bower install --allow-root humanize-duration#~3.10.0 --save

bower install --allow-root angular-timer@~1.3.3 --save

bower install --allow-root angular-tooltips@~0.1.21 --save

bower install --allow-root datatables@~1.10.8 --save

bower install --allow-root angular-bootstrap@~0.14.3 --save

bower install --allow-root mdbootstrap/bootstrap-material-design@~0.3.0 --save

bower install --allow-root angular-translate@~2.10.0 --save

bower install --allow-root angular-translate-loader-static-files@~2.10.0 --save

bower install --allow-root angular-click-outside@~2.9.2 --save

mv  bower.json.back  bower.json

修改bower.json文件:

"bootstrap-material-design": "~0.3.0"修改为         "bootstrap-material-design": "mdbootstrap/bootstrap-material-design#~0.3.0"

bower --allow-root install

使用grunt构建

grunt build --force

配置启动

在安装部署的所有步骤都成功的情况下,直接启动

[root@localhost verto_communicator]# grunt serve

Running "serve" task

Running "wiredep:app" (wiredep) task

Running "concurrent:server" (concurrent) task

Running "copy:styles" (copy) task

Copied 1 file

Done, without errors.

Execution Time (2021-09-16 09:19:36 UTC+8)

loading tasks               372ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 95%

loading grunt-contrib-copy    6ms  ▇ 2%

copy:styles                  13ms  ▇▇ 3%

Total 391ms

Running "postcss:dist" (postcss) task

>> 1 processed stylesheet created.

Running "browserSync:livereload" (browserSync) task

[Browsersync] Access URLs:

------------------------------------

Local: https://localhost:9001

External: https://192.168.0.152:9001

------------------------------------

[Browsersync] Serving files from: ../js/src/

[Browsersync] Serving files from: ./js

[Browsersync] Serving files from: .

[Browsersync] Watching files...

Running "watch" task

Waiting...

测试

浏览器打开URL:https://192.168.0.152:9001

按照freeswitch server的注册信息配置字段。

其中,websocket URL地址必须使用域名方式才能正常登陆,可以通过修改本地host,将域名直接指向fs注册服务器地址的方式来实现。

总结

verto协议是基于json的轻量化协议,在web应用中使用和实现都非常方便。

其中verto communicator在nodejs环境的安装部署过程中问题太多,而且难以解决,不推荐使用。(也可能是因为本人对nodejs不熟悉,如果有更好的解决方案,请留言,多谢)


空空如常

求真得真

freeswitch verto communicator客户端的更多相关文章

  1. FreeSWITCH 1.2.5.3 Step by Step Install

    Ubuntu: apt-get -y install build-essential automake autoconf git-core wget libtool apt-get -y instal ...

  2. freeswitch与外部网关链接

    我建了一个 Freeswitch 内核研究 交流群, 45211986, 欢迎加入, 另外,提供基于SIP的通信服务器及客户端解决方案, 承接 sip/ims 视频客户端开发,支持接入sip软交换,i ...

  3. FreeSWITCH 学习笔记

    [1]FreeSWITCH学习笔记 1.Windows安装包下载地址:http://files.freeswitch.org/windows/installer/ 2.源码下载地址:http://fi ...

  4. PKI系统深入介绍

    公钥基础设施(Public Key Infrastructure,简称PKI)是目前网络安全建设的基础与核心,是电子商务安全实施的基本保障,因 此,对PKI技术的研究和开发成为目前信息安全领域的热点. ...

  5. [转帖]PKI系统深入介绍

    PKI系统深入介绍 https://blog.csdn.net/liuhuiyi/article/details/7776825 2012年07月23日 20:17:01 liuhuiyi 阅读数 4 ...

  6. FreeSWITCH 客户端fs_cli连接设置(acl)

    FreeSWITCH 默认配置只能 在本机连接, 要从 外面连接, 就要配置: acl.conf.xml::network-lists/list event_socket.conf.xml::appl ...

  7. [原创]如何让freeswitch转发客户端自定义的INFO消息

    如何让freeswitch转发客户端自定义的INFO消息 英文概述: this article is about how to configure freeswitch to forward self ...

  8. FreeSWITCH视频直播

    大家都知道,如今,视频直播比较火啊. 今天,在FreeSWITCH精英群里分享了FreeSWITCH做视频直播相关的技术. 首先,要做直播就得有好机器.笔者买了一台阿里云的主机,买的是按量付费的,4核 ...

  9. freeswitch注册过程分析

    操作系统:debian8.5_x64freeswitch 版本 : 1.6.8 本文仅描述sip注册的简单场景,即话机直接向处于同一个局域网的fs进行注册. SIP协议的消息结构 消息框架 SIP协议 ...

随机推荐

  1. Linux系统安装MySql5.7并通过sql脚本导入数据

    为了下载到的MySQL版本和目标系统相互兼容,在开启之前,最好了解目标系统的相关信息. 查询系统版本: cat /etc/issue 查看系统位数 getconf LONG_BIT 选择MySQL 根 ...

  2. L1-027 出租 (20 分) java题解

    下面是新浪微博上曾经很火的一张图: 一时间网上一片求救声,急问这个怎么破.其实这段代码很简单,index数组就是arr数组的下标,index[0]=2 对应 arr[2]=1,index[1]=0 对 ...

  3. C#开发BIMFACE系列48 Nginx部署并加载离线数据包

    BIMFACE二次开发系列目录     [已更新最新开发文章,点击查看详细] 在前一篇博客<C#开发BIMFACE系列47 IIS部署并加载离线数据包>中详细介绍了IIS部署并访问的完整步 ...

  4. [源码解析]PyTorch如何实现前向传播(1) --- 基础类(上)

    [源码解析]PyTorch如何实现前向传播(1) --- 基础类(上) 目录 [源码解析]PyTorch如何实现前向传播(1) --- 基础类(上) 0x00 摘要 0x01 总体逻辑 0x02 废弃 ...

  5. linux系统(centos)下su和sudo命令的区别

    linux系统(centos)下su和sudo命令的区别 区别 我们在日常使用过程中,这2个命令很多时候能达到相同的效果,对细节区别十分模糊,这里进行简单的解释和区分.希望大家能够正确使用这2个命令, ...

  6. 单机CentOS 安装 TiDB

    目录 一.官网教程 二.安装步骤 1.下载并安装 TiUP: 2.声明一下环境变量,否则会找不到 tiup 命令 3.安装 TiUP 的 cluster 组件: 4.官方教程说,由于模拟多机部署,需要 ...

  7. 痞子衡嵌入式:超级下载算法RT-UFL v1.0在IAR EW for Arm下的使用

    痞子衡主导的"学术"项目 <RT-UFL - 一个适用全平台i.MXRT的超级下载算法设计> v1.0 版发布近 4 个月了,部分客户已经在实际项目开发调试中用上了这个 ...

  8. 性能利器 Takin 来了!首个生产环境全链路压测平台正式开源

    6 月 25 日,国内知名的系统高可用专家数列科技宣布开源旗下核心产品能力,对外开放生产全链路压测平台产品的源代码,并正式命名为 Takin. 目前中国人寿.顺丰科技.希音.中通快递.中国移动.永辉超 ...

  9. 锚点布局anchorlayout在kv中的引用

    from kivy.app import App from kivy.uix.anchorlayout import AnchorLayout from kivy.uix.button import ...

  10. seata代码控制回滚和临时挂起分布式事物

    seata代码控制回滚和临时挂起分布式事物 一.说明 二.功能实现 1.手动回滚分布式事物 2.临时挂起分布式事物 三.完整代码 四 参考链接 一.说明 此处只是简单的记录一下,使用了 Seata后, ...