docker 部署freeswitch(非编译方式)

一:安装部署

1.拉取镜像

参考:https://hub.docker.com/r/safarov/freeswitch

复制代码
 docker pull safarov/freeswitch

2.启动镜像

复制代码
docker run --net=host --name freeswitch \
           -e SOUND_RATES=8000:16000 \
           -e SOUND_TYPES=music:en-us-callie \
           -v /home/xx/freeswitch-sounds:/usr/share/freeswitch/sounds \
           -v /etc/freeswitch/:/etc/freeswitch \
           safarov/freeswitch

启动后出错:

这里的错误影响不是很大,可以不用管,主要是把语音相关文件补回去,不然拨打后拿文件会出错

手动下载:freeswitch-sounds-en-us-callie-8000-1.0.51.tar 解压到/home/xx/freeswitch-sounds

操作后重启镜像

3.宿主机关防火墙

复制代码
  sudo systemctl stop firewalld
  sudo systemctl disable firewalld
  sudo systemctl status firewalld

4.至此基本能用了,使用方式

账号:1000到1019

密码:/etc/freeswitch/vars.xml

查找关键字:default_password,就能看到

服务器地址:宿主机ip:5060,例如:1.1.1.1:5060

二:添加账号

参考目录:/etc/freeswitch/directory/default

下面1000.xml,拷贝把文件名和内容的1000全部替换,例如1020

添加后进入容器

复制代码
  docker exec -it freeswitch  /bin/bash

执行

复制代码
fs_cli -x "reloadxml"

生效

三:拨打定制特定号码服务端的响应计划

举例:想要配置拨打10086的时候,先振铃5秒,再拨打一段语音,然后挂断

打开/etc/freeswitch/dialplan/default.xml

添加下面的配置

复制代码
  <extension name="zhauto_answer">
        <condition field="destination_number" expression="^10086$">
            <action application="ring_ready"/>
            <action application="sleep" data="5000"/>
            <action application="answer"/>
            <action application="sleep" data="1000"/>
            <action application="playback" data="/usr/share/freeswitch/sounds/partita-no-3-in-e-major-bwv-1006-1-preludio.wav"/>
            <action application="hangup"/>
        </condition>
    </extension>

重启容器即可

相关推荐
退役小学生呀9 天前
三、kubectl使用详解
云原生·容器·kubernetes·k8s
API开发9 天前
苹果芯片macOS安装版Homebrew(亲测) ,一键安装node、python、vscode等,比绿色软件还干净、无污染
vscode·python·docker·nodejs·openssl·brew·homebrew
程序员小潘9 天前
Kubernetes多容器Pod实战
云原生·容器·kubernetes
进击的码码码码N9 天前
Docker 镜像加速
运维·docker·容器
Q_w77429 天前
基于 Docker 的服务部署探索(Day 2)
运维·docker·容器
white.tie9 天前
docker方式启动Jenkins
docker·容器·jenkins
IT成长日记10 天前
【Docker基础】Docker容器管理:docker pause详解
运维·docker·容器·docker pause
Koma_zhe10 天前
【ToolJet远程开发】Ubuntu+Docker结合内网穿透技术搭建ToolJet远程开发环境
linux·ubuntu·docker
没有口袋啦10 天前
Docker 服务无法启动问题
运维·docker·容器
微信公众号:AI创造财富10 天前
Docker 安装 ModelScope(推荐流程)
spring cloud·docker·eureka