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下载《君语电话》,拨号效果如图
注:查阅各种资源后调通,分享给有需要的人。