LoginSignup
1
0

More than 5 years have passed since last update.

Server MAN VPS CentOS6.5 SIPp3.6 で WAV音源 を RTP Stream に流してみた② *SIPpシナリオ作成*

Last updated at Posted at 2016-08-17

『Server MAN VPS CentOS6.5 SIPp3.6 で WAV音源 を RTP Stream に流してみた① *環境構築編*』
こちらの記事の続きです。

■目的

SIPpで用意したwav音源をRTPで送信すること ※DTMF入力
 ◇Server MAN VPS CentOS6.5 SIPp3.6 で WAV音源 を RTP Stream に流してみた① *環境構築編*
 ◆Server MAN VPS CentOS6.5 SIPp3.6 で WAV音源 を RTP Stream に流してみた② *SIPpシナリオ作成*

■環境構成

  • DTI ServersMan@VPS Entry プラン 月額467円(税抜)
  • CentOS release 6.5 (Final)
  • SIPp v3.6-dev-88-g04c3874-TLS-PCAP-RTPSTREAM built Aug 16 2016, 19:24:25.

★上記の環境構築は①で済んでいるので、SIPpシナリオ作成し、WAV音源をRTP Streamに載せて送信できるところまでをメモ★

■作業の流れ

① SIPpデフォルトシナリオとして uac が存在するので、任意のディレクトリにエクスポート
② WAV音源の準備(※今回は、Codec:g711 ulaw)
③ エクスポートしたuac.xmlシナリオにrtp_streamを追加
④ tcpdumpコマンドで RTP/SIPキャプチャ、SIPp実行スクリーン上でのRTP Packet 送信の確認

■実際の作業内容

① SIPpデフォルトシナリオとして uac が存在するので、任意のディレクトリにエクスポート
 sipp -sd uac > uac.xml
 ※今回は、着側からRTPを送信しないので uas はエクスポートしない。


② WAV音源の準備(※今回は、Codec:g711 ulaw)
こちらからいただきました。
SPECIAL THANKS‼
Voxeo's Global Developer and Support Portal

soxiコマンドでコーデック確認します。
G711 u-lawであることが確認できます。


# soxi dtmf-star.wav
Input File : 'dtmf-star.wav'
Channels : 1
Sample Rate : 8000
Precision : 14-bit
Duration : 00:00:00.20 = 1600 samples ~ 15 CDDA sectors
Sample Encoding: 8-bit u-law


③ エクスポートしたuac.xmlシナリオにrtp_streamを追加

参考:Media/RTP command


参考:Media/RTP command


★200 OK 後の ACKの下にpauseタグがあるので、その部分にrtp_streamを追加★
</send>
<!-- This delay can be customized by the -d command-line option -->
<!-- or by adding a 'milliseconds = "value"' option here. -->
<pause milliseconds="3000"/>
<nop>
<action>
<exec rtp_stream="dtmf-star.wav,1,0"/>
</action>
</nop>


④ tcpdumpコマンドで RTP/SIPキャプチャ、SIPp実行スクリーン上でのRTP Packet 送信(※赤枠)の確認

tcpdump -i any -v -s0 udp -w [output filename]

SIPp実行コマンド

uas側
sipp -sn uas
uac側
sipp -sf uac_wav.xml -p 5061 -r 0 -i [local ip address] [destination ip address]

SIPp実行画面 uas, uac

RTP/SIPをキャプチャしたファイルをWiresharkで開いてみる。
赤枠部分でRTPがG711 PCMU(u-law)で送信していることが確認できる。
 ※Wiresharkの機能で音も聞けるので、実際の音を確認する場合はそちらを使用する。
wireshark rtp/sip image


以上

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0