天天看点

海康摄像头GB28181对接

必须要素:

1.      必须包含subject头域

2.      SDP中session name必须填写Play

3.      SDP中不能懈怠audio

4.      SDP中的video必须携带PS属性

以上4要素缺一不可。

示例:

1.      正确流程

P1->IPC

INVITEsip:[email protected] SIP/2.0

Via: SIP/2.0/UDP192.168.50.22:5060;branch=32dbcde3

From: "1001"<sip:[email protected]>;tag=591cf984

Contact:<sip:[email protected]:5060>

To:<sip:[email protected]>

Call-ID:[email protected]

CSeq: 172 INVITE

Max-Forwards: 70

Subject:34020000001320000001:0,1001:0

Content-Type: application/sdp

Content-Length: 381

v=0

o=root 853265891 853265891 IN IP4192.168.50.22

s=Play

c=IN IP4 192.168.50.22

t=0 0

m=video 19690 RTP/AVP 126 125 99 34 96

a=rtpmap:126 H264/90000

a=fmtp:126 profile-level-id=42e01e

a=rtpmap:125 H264S/90000

a=fmtp:125 profile-level-id=42e01e

a=rtpmap:99 MP4V-ES/90000

a=fmtp:99 profile-level-id=3

a=rtpmap:96 PS/90000

IPC->P1

SIP/2.0 200 OK

Via: SIP/2.0/UDP192.168.50.22:5060;branch=32dbcde3

From: "1001"<sip:[email protected]>;tag=591cf984

To:<sip:[email protected]>;tag=1292444290

Call-ID:[email protected]

CSeq: 172 INVITE

Contact:<sip:[email protected]:5060>

Content-Type: application/sdp

User-Agent: IP Camera

Content-Length:   267

v=0

o=1005 1935 1935 IN IP4 192.168.50.171

s=play

c=IN IP4 192.168.50.171

t=0 0

m=video 15060 RTP/AVP 96

a=sendonly

a=rtpmap:96 PS/90000

2.      不正确流程

P1->IPC

INVITEsip:[email protected] SIP/2.0

Via: SIP/2.0/UDP192.168.50.22:5060;branch=55b46723

From: "1001"<sip:[email protected]>;tag=1a72242e

Contact: <sip:[email protected]:5060>

To:<sip:[email protected]>

Call-ID:[email protected]

CSeq: 170 INVITE

Max-Forwards: 70

Subject:34020000001320000001:0,1001:0

Content-Type: application/sdp

Content-Length: 553

v=0

o=root 1437886243 1437886243 IN IP4192.168.50.22

s=Play

c=IN IP4 192.168.50.22

t=0 0

m=audio38406 RTP/AVP 0 8 3 114 18

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:3 GSM/8000

a=rtpmap:114 AMR/8000

a=fmtp:114 mode-set=7

a=rtpmap:18 G729/8000

m=video24674 RTP/AVP 126 125 99

a=recvonly

a=rtpmap:126 H264/90000

a=fmtp:126 profile-level-id=42e01e

a=rtpmap:125 H264S/90000

a=fmtp:125 profile-level-id=42e01e

a=rtpmap:99 MP4V-ES/90000

a=fmtp:99 profile-level-id=3

IPC->P1

SIP/2.0 200 OK

Via: SIP/2.0/UDP 192.168.50.22:5060;branch=55b46723

From: "1001"<sip:[email protected]>;tag=1a72242e

To:<sip:[email protected]>;tag=2000948179

Call-ID:[email protected]

CSeq: 170 INVITE

Contact:<sip:[email protected]:5060>

Content-Type: application/sdp

User-Agent: IP Camera

Content-Length:   108

v=0

o=1005 3764 3764 IN IP4 192.168.50.171

s=play

c=IN IP4 192.168.50.171

t=0 0

m=video 15060RTP/AVP

继续阅读