本文提供一個(gè)OpenSIPS的一鍵安裝包,OpenSIPs 可以作為FreeSwitch 的前端代理,實(shí)現(xiàn)多個(gè)FreeSwitch 負(fù)載均衡處理呼叫流量。以opensips-2.1.2.tar.gz 為例
安裝環(huán)境CentOS 6.x 64 bit
Step 1?Download
下載數(shù)據(jù)庫(kù)配置文件 修改數(shù)據(jù)庫(kù)信息
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 自定啟動(dòng)
Step 2 啟動(dòng)
/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(查看進(jìn)程)
netstat -ulpn|grep opensips(查看UDP鏈接狀態(tài))
netstat -utpn|grep opensips(查看TCP鏈接狀態(tài))
/usr/local/sbin/opensips -c? 檢查配置是否正確
增加freeswitch 后端服務(wù)器
opensipsctl?? dispatcher show
dispatcher addgw [description]
?? *Examples:? dispatcher addgw 1sip:1.2.3.1:5050 '' 0 50 'og1' 'Outbound Gateway1'
??*??????????? dispatcher addgw 2sip: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 1sip: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 ..................... showdispatcher gateways
dispatcher reload ...................reload dispatcher gateways
dispatcher dump ..................... showin memory dispatcher gateways
dispatcher addgw [description]
??????????????? .......................... addgateway
dispatcher rmgw ................delete gateway
增加freeswitch 后端服務(wù)器
opensipsctl?? dispatcher show
dispatcher gateways
opensipsctl dispatcher addgw 1sip: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'