天天看點

AG Projects msrprelay(開源MSRP Relay)centos下詳細安裝說明

專注三網融合之接入網/核心網等技術,音視訊信令和媒體傳輸相關協定

專家前輩入駐,談笑有鴻儒,往來無白丁,共同學習探讨IMS/IPPBX相關技術

歡迎同行加入IMS/IPPBX/VoIP/SIP QQ交流群: 255404741 (猛戳直接加群)
      

    AG Projects msrprelay是用強大的python腳本實作的msrp relay開源伺服器,有官方描述,哥就不在這裡瞎扯了:

This project implements an MSRP Relay (RFC 4976). Its main role is to help NAT traversal of MSRP based Instant Messaging and File Transfer sessions between SIP end-points located behind NAT.

下載下傳安裝dependencies

msrprelay依賴的軟體包如下:

python-gnutls-1.2.5.tar.gz

python-application-1.4.0.tar.gz

Twisted-14.0.0.tar.bz2

zope.interface-4.1.1.tar.gz

SQLObject-1.6.0.tar.gz

MySQL-python-1.2.5

在https://pypi.python.org/pypi中的search中分别輸入上述安裝包名字,下載下傳對應的安裝包,

進入目錄後執行python setup.py install 即可安裝相應的軟體

下載下傳安裝msrp

The software can be downloaded as a tar archive from:

http://download.ag-projects.com/MSRP/

python-msrplib-0.14.2.tar.gz

msrprelay-1.0.8.tar.gz 

安裝方法同上

運作msrprelay

INSTALL 文檔中有說明:

Start the MSRPRelay, either by executing:

./msrprelay --no-fork

or as a daemon, which is the default behaviour.

This can also be done using the init.d script:

/etc/init.d/msrprelay start

根本就沒有/etc/init.d/msrprelay,從源碼根路徑下直接運作

此運作不是daemon的方式(./msrprelay start可以daemon方式運作)

[[email protected] msrprelay-1.0.8]# pwd

/opt/msrprelay-1.0.8

[[email protected] msrprelay-1.0.8]# ./msrprelay --no-fork

Starting MSRP Relay 1.0.8

RelayFactory starting on 2855

另開一console檢視端口,預設采用标準的2855端口

[[email protected] msrprelay-1.0.8]# netstat -tulnp | grep python

tcp 0 0 0.0.0.0:2855 0.0.0.0:* LISTEN 6544/python

[[email protected] msrprelay-1.0.8]# 

傳輸檔案測試

具體詳細說明參考test/README 。

仿照說明測試步驟如下:

1. 建立用于傳輸的檔案

[[email protected] test]# pwd

/opt/msrprelay-1.0.8

[[email protected] msrprelay-1.0.8]# echo xxxxxxxxxxx >TODO.txt 

[[email protected] msrprelay-1.0.8]# echo yyyyyyyyyyy >>TODO.txt 

[[email protected] msrprelay-1.0.8]# 

2. start both clients in two console

console I of sender:

[[email protected] test]# ./msrp_send_file.py ../TODO.txt [email protected] 172.16.0.55

Password:

Sending initial AUTH

Got challenge, sending response AUTH

Path to send in SDP:

msrps://172.16.0.55:2855/EBu5/m2eo1QLtkUP3FOeNDEzOTkxNTQwMDguOTMwOjE3Mi4xNi4wLjU1;tcp msrps://localhost:12345//nhZNDamYUxKrl22;tcp

Destination path: 

console II of recevier:

[[email protected] test]#

[[email protected] test]# ./msrp_receive_file.py [email protected] 172.16.0.55

Password:

Sending initial AUTH

Got challenge, sending response AUTH

Path to send in SDP:

msrps://172.16.0.55:2855/Y82Mpnt4ZLvbYPD9iMct0zEzOTkxNTQwMjUuMTc2OjE3Mi4xNi4wLjU1;tcp msrps://localhost:12345/BIglF+5r9DIwtLth;tcp

Destination path: 

3. 互相指定對方的msrp destination path

檢視步驟2顯示的msrp path,将msrp_send_file.py輸出的msrp path粘貼到msrp_receive_file.py的“Destination path: ”的輸入提示後,反之依然:

console I of sender:

[[email protected] test]# ./msrp_send_file.py ../TODO.txt [email protected] 172.16.0.55

Password:

Sending initial AUTH

Got challenge, sending response AUTH

Path to send in SDP:

msrps://172.16.0.55:2855/EBu5/m2eo1QLtkUP3FOeNDEzOTkxNTQwMDguOTMwOjE3Mi4xNi4wLjU1;tcp msrps://localhost:12345//nhZNDamYUxKrl22;tcp

Destination path: msrps://172.16.0.55:2855/Y82Mpnt4ZLvbYPD9iMct0zEzOTkxNTQwMjUuMTc2OjE3Mi4xNi4wLjU1;tcp msrps://localhost:12345/BIglF+5r9DIwtLth;tcp

Starting transmission of "TODO.txt"

sent 0 of 24 bytes

File transfer completed.

Connection lost!

Sent 24 bytes in 10 seconds, (0.00 kb/s)

Connection lost

Connection was closed cleanly.

[[email protected] test]# 

console II of recevier:

[[email protected] test]#

[[email protected] test]# ./msrp_receive_file.py [email protected] 172.16.0.55

Password:

Sending initial AUTH

Got challenge, sending response AUTH

Path to send in SDP:

msrps://172.16.0.55:2855/Y82Mpnt4ZLvbYPD9iMct0zEzOTkxNTQwMjUuMTc2OjE3Mi4xNi4wLjU1;tcp msrps://localhost:12345/BIglF+5r9DIwtLth;tcp

Destination path: msrps://172.16.0.55:2855/EBu5/m2eo1QLtkUP3FOeNDEzOTkxNTQwMDguOTMwOjE3Mi4xNi4wLjU1;tcp msrps://localhost:12345//nhZNDamYUxKrl22;tcp

Receiving file "TODO.txt"

received 24 of 24 bytes

File transfer completed successfully.

Received 24 bytes in 0 seconds, (12.98 kb/s)

Connection lost!

Connection lost

Connection was closed cleanly.

[[email protected] test]#

4. 檢視結果

測試檔案果然從 /opt/msrprelay-1.0.8/TODO.txt傳輸到了 /opt/msrprelay-1.0.8/test/TODO.txt

[[email protected] test]# ls

msrp_receive_file.py msrp_send_file.py README TODO.txt

[[email protected] test]# cat TODO.txt

xxxxxxxxxxx

yyyyyyyyyyy

[[email protected] test]# cat ../TODO.txt

xxxxxxxxxxx

yyyyyyyyyyy

[[email protected] test]# 

更多資訊參考源碼INSTALL和README說明

參考檔案

http://www.msrprelay.org/projects/msrprelay/wiki/InstallationGuide

轉載請注明出處 http://blog.csdn.net/xuyunzhang/article/details/29354391  謝謝。