打開client客戶端,按下語音對講按鈕,發送語音給相機。
1.測試環境搭建
client:某個國際知名的VMS客戶端軟件。運行電腦的IP:192.168.1.155。
server:happytime-onvif-server模擬軟件,其支持Back Channel Connection規範。運行電腦的IP:192.168.1.97。
抓包工具:Wireshark。
2.抓包數據
(1)
client -> server
Real Time Streaming Protocol
Request: DESCRIBE rtsp://192.168.1.97:554/test.mp4&t=unicast&p=udp&ve=H264&w=1280&h=720&ae=PCMU&sr=8000 RTSP/1.0\r\n
CSeq: 1\r\n
Accept: application/sdp\r\n
User-Agent: CmRtspClient 10.3a.136\r\n
Bandwidth: 384000\r\n
Require: www.onvif.org/ver20/backchannel\r\n
\r\n
server -> client
Real Time Streaming Protocol
Response: RTSP/1.0 200 OK\r\n
Server: happytime rtsp server 3.8\r\n
CSeq: 1\r\n
Date: Wed, Jun 05 2019 03:22:26 GMT\r\n
Session: 28692
Content-Base: rtsp://192.168.1.97:554/test.mp4&t=unicast&p=udp&ve=H264&w=1280&h=720&ae=PCMU&sr=8000\r\n
Content-type: application/sdp
Content-length: 542
\r\n
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): - 0 0 IN IP4 192.168.1.97
Session Name (s): session
Connection Information (c): IN IP4 192.168.1.97
Time Description, active time (t): 0 0
Session Attribute (a): control:*
Session Attribute (a): range:npt=0-20.735
Media Description, name and address (m): video 0 RTP/AVP 96
Media Attribute (a): rtpmap:96 H264/90000
Media Attribute (a): fmtp:96 packetization-mode=1;profile-level-id=00001F;sprop-parameter-sets=Z0KAH5ZSAKALdJQEBAUAAAMAAQAAAwAyhA==,aMuNSA==
Media Attribute (a): control:realvideo
Media Description, name and address (m): audio 0 RTP/AVP 0
Media Attribute (a): rtpmap:0 PCMU/8000/2
Media Attribute (a): recvonly
Media Attribute (a): control:realaudio
Media Description, name and address (m): application 0 RTP/AVP 98
Media Attribute (a): rtpmap:98 vnd.onvif.metadata/90000
Media Attribute (a): control:metadata
Media Description, name and address (m): audio 0 RTP/AVP 0
Media Attribute (a): rtpmap:0 PCMU/8000/1
Media Attribute (a): sendonly
Media Attribute (a): control:audioback
(2)
client -> server
Real Time Streaming Protocol
Request: SETUP rtsp://192.168.1.97:554/test.mp4&t=unicast&p=udp&ve=H264&w=1280&h=720&ae=PCMU&sr=8000/audioback RTSP/1.0\r\n
CSeq: 2\r\n
User-Agent: CmRtspClient 10.3a.136\r\n
Transport: RTP/AVP;unicast;client_port=6588-6589
Require: www.onvif.org/ver20/backchannel\r\n
\r\n
server -> client
Real Time Streaming Protocol
Response: RTSP/1.0 200 OK\r\n
Server: happytime rtsp server 3.8\r\n
CSeq: 2\r\n
Date: Wed, Jun 05 2019 03:22:26 GMT\r\n
Session: 28692;timeout=60
Transport: RTP/AVP/UDP;unicast;client_port=6588-6589;server_port=30294-30295
\r\n
(3)
client -> server
Real Time Streaming Protocol
Request: PLAY rtsp://192.168.1.97:554/test.mp4&t=unicast&p=udp&ve=H264&w=1280&h=720&ae=PCMU&sr=8000 RTSP/1.0\r\n
Session: 28692
CSeq: 3\r\n
User-Agent: CmRtspClient 10.3a.136\r\n
Range: npt=0.000-\r\n
Require: www.onvif.org/ver20/backchannel\r\n
\r\n
server -> client
Real Time Streaming Protocol
Response: RTSP/1.0 200 OK\r\n
Server: happytime rtsp server 3.8\r\n
CSeq: 3\r\n
Date: Wed, Jun 05 2019 03:22:26 GMT\r\n
Range: npt=0.000-\r\n
Session: 28692
\r\n
(4)client開始發送語音
Real-Time Transport Protocol
10.. .... = Version: RFC 1889 Version (2)
..0. .... = Padding: False
...0 .... = Extension: False
.... 0000 = Contributing source identifiers count: 0
1... .... = Marker: True
Payload type: ITU-T G.711 PCMU (0)
Sequence number: 41530
Timestamp: 2830117314
Synchronization Source identifier: 0xc1428b85 (3242363781)
Payload: 7ffefe7fffffffff7e7e7e7eff7fff7fffffffffffff7fff...
(5)client停止發送語音
Real Time Streaming Protocol
Request: TEARDOWN rtsp://192.168.1.97:554/test.mp4&t=unicast&p=udp&ve=H264&w=1280&h=720&ae=PCMU&sr=8000 RTSP/1.0\r\n
Session: 18716
CSeq: 4\r\n
User-Agent: CmRtspClient 10.3a.136\r\n
Require: www.onvif.org/ver20/backchannel\r\n
MS-Reason: [705]RtspDisconnect/\r\n
\r\n