OpenSIPS一鍵安裝腳本以及OpenSIPs+N個FreeSWITCH 實戰技巧有哪些,很多新手對此不是很清楚,為了幫助大家解決這個難題,下面小編將為大家詳細講解,有這方面需求的人可以來學習下,希望你能有所收獲。
提供一個OpenSIPS的一鍵安裝包,OpenSIPs 可以作為FreeSwitch 的前端代理,實現多個FreeSwitch 負載均衡處理呼叫流量。
以 opensips-2.1.2.tar.gz 為例
安裝環境CentOS 6.x 64 bit
Step 1 Download
下載數據庫配置文件 修改數據庫信息
wget https://hk-area1-file.oss-cn-hongkong.aliyuncs.com/fsgui/init.conf
下載安裝腳本
wget https://hk-area1-file.oss-cn-hongkong.aliyuncs.com/fsgui/opensips_install.sh
安裝命令
sh opensips_install.sh
安裝完成 opensips 自定啟動
Step 2 啟動
/usr/local/sbin/opensipsctl start
停止
/usr/local/sbin/opensipsctl stop
Step 3 常用命令
/usr/local/sbin/opensipsctl start
ps -ef|grep opensips
/usr/local/sbin/opensipsctl stop
ps aux | grep opensips(查看進程)
netstat -ulpn|grep opensips(查看UDP鏈接狀態)
netstat -utpn|grep opensips(查看TCP鏈接狀態)
/usr/local/sbin/opensips -c 檢查配置是否正確
增加freeswitch 后端服務器
opensipsctl dispatcher show
dispatcher addgw <setid> <destination> <socket> <state> <weight> <attrs> [description]
* Examples: dispatcher addgw 1 sip:1.2.3.1:5050 '' 0 50 'og1' 'Outbound Gateway1'
* dispatcher addgw 2 sip:1.2.3.4:5050 '' 0 50 'og2' 'Outbound Gateway2'
* dispatcher rmgw 4
opensipsctl dispatcher addgw 1 sip:47.91.133.205:5099 "" 0 50 'us1' 'cs.wdjbp.com'
opensipsctl dispatcher addgw 1 sip:47.89.33.209:5099 "" 0 50 'us2' 'wandan.wdjbp.com'
insert into load_balancer (group_id,dst_uri,resources,description) values (1,'sip:47.91.133.205:5099','pstn=100','hk1');
insert into load_balancer (group_id,dst_uri,resources,description) values (1,'sip:47.89.33.209:5099','pstn=100','hk2');
opensipsctl fifo lb_reload
dispatcher show ..................... show dispatcher gateways
dispatcher reload ................... reload dispatcher gateways
dispatcher dump ..................... show in memory dispatcher gateways
dispatcher addgw <setid> <destination> <socket> <state> <weight> <attrs> [description]
.......................... add gateway
dispatcher rmgw <id> ................ delete gateway
增加freeswitch 后端服務器
opensipsctl dispatcher show
dispatcher gateways
opensipsctl dispatcher addgw 1 sip:182.92.158.206 "" 0 50 'hk1' 'hk1.wdjbp.com'
opensipsctl dispatcher addgw 1 sip:47.88.86.32 "" 0 50 'hk1' 'hk2.wdjbp.com'
SIP賬號登陸前 先確保
vi /usr/local/freeswitch/conf/vars.xml
修改了vars.xml中的 domain 參數
<X-PRE-PROCESS cmd="set" data="domain=2224{local_ip_v4}"/>
改為
<X-PRE-PROCESS cmd="set" data="domain=h6.wdjbp.com"/>
FS節點需要在ACL里面把 opensips 所在IP 加入白名單
測試驗證
看完上述內容是否對您有幫助呢?如果還想對相關知識有進一步的了解或閱讀更多相關文章,請關注億速云行業資訊頻道,感謝您對億速云的支持。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。