我們用SIP 客戶端呼叫的時候,經常遇到複雜的網絡NAT環境,這個時候需要我們安裝STUN Server / Turn Server 做穿透用。
這裏簡單記錄下 STUN Server的安裝啓動步驟:
yum -y install gcc
yum -y install make
yum -y install boost # For Boost
yum -y install openssl # For OpenSSL
wget http://www.stunprotocol.org/stunserver-1.2.3.tgz
tar zxvf stunserver-1.2.3.tgz
cd stunserver
make
檢查環境 是否OK
./stuntestcode
nohup /usr/local/stunserver/stunserver --mode basic --primaryinterface 172.31.78.132 &
nohup ./stunserver --mode full --primaryinterface eth0 --altinterface eth0 &
全功能模式 需要2個IP
./stunserver --mode full --primaryinterface 47.52.229.136 --altinterface 172.31.78.132
nohup ./stunserver --mode basic --primaryinterface 172.31.78.132
基本模式 1個IP
./stunserver --mode basic --primaryinterface 47.52.229.136 --altinterface 172.31.78.132
./stunserver --help 查看 參數說明!