1、拉取opensips/opensips:latest 镜像,拉取日期:2020-08-02,当前版本opensips 3.0
docker pull opensips/opensips
2、docker 运行
docker run -d -it --name sip -p 5060:5060/udp opensips/opensips
3、配置opensips.cfg
[root@localhost opensips]# pwd
/home/opensips
[root@localhost opensips]# docker cp sip:/etc/opensips/opensips.cfg .
//复制配置文件到本地
修改前
/* comment the next line to enable the auto discovery of local aliases
based on reverse DNS on IPs */
auto_aliases=no
listen=udp:172.17.0.2:5060
修改后
/* comment the next line to enable the auto discovery of local aliases
based on reverse DNS on IPs */
auto_aliases=no
//如果需要在公网下使用,这里可以配置公网ip,端口映射后亲测可用
advertised_address="192.168.1.170"
alias="192.168.1.170"
listen=udp:172.17.0.2:5060
[root@localhost opensips]# docker cp opensips.cfg sip:/etc/opensips/opensips.cfg
[root@localhost opensips]# docker restart sip
4、安卓市场或appstore下载《君语电话》,拨号效果如图

本文详细介绍了如何从拉取OpenSIPS Docker镜像开始,到运行容器、配置opensips.cfg,最后通过《君语电话》应用进行拨号测试的全过程。特别强调了公网配置与端口映射的方法。
最低0.47元/天 解锁文章
2095





