GB28181协议——布防和报警订阅

GB28181协议——摄像机报警订阅

      • 注意
      • 通道布防
      • 布防结果
      • 报警订阅
      • 报警订阅结果
      • 报警通知
      • 取消报警订阅

注意

  1. 首先设置摄像机,将事件功能(移动侦测、视频遮挡)都启用。
    否则,布防和订阅报警后接收不到报警事件。

通道布防

SetGuard 布防
ResetGuard 撤防

》》》》》IPC
MESSAGE sip:34020000001110000001@3402000000 SIP/2.0
From: <sip:34020000002000000001@3402000000>;tag=bccedfd000004
To: <sip:34020000001110000001@3402000000>
Content-Length: 172
CSeq: 5 MESSAGE
Route: <sip:34020000001110000001>
Call-ID: 12345678900004
Via: SIP/2.0/UDP 192.168.1.101:5060;wlsscid=377aa9afcf1b36f;branch=123133532300004
Content-Type: Application/MANSCDP+xml
Max-Forwards: 70


<Control>
<CmdType>DeviceControlCmdType>
<SN>17294SN>
<DeviceID>34020000001310000001DeviceID>		//视频通道
<GuardCmd>SetGuardGuardCmd>
Control>
《《《《《 IPC
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.101:5060;wlsscid=377aa9afcf1b36f;branch=123133532300004
From: <sip:34020000002000000001@3402000000>;tag=bccedfd000004
To: <sip:34020000001110000001@3402000000>;tag=809085810
Call-ID: 12345678900004
CSeq: 5 MESSAGE
User-Agent: IP Camera
Content-Length: 0

布防结果

《《《《《 IPC	
MESSAGE sip:34020000002000000001@3402000000 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.64:5060;rport;branch=z9hG4bK375628128
From: <sip:34020000001110000001@3402000000>;tag=1239413282
To: <sip:34020000002000000001@3402000000>
Call-ID: 712071016
CSeq: 20 MESSAGE
Content-Type: Application/MANSCDP+xml
Max-Forwards: 70
User-Agent: IP Camera
Content-Length:   173


<Response>
<CmdType>DeviceControlCmdType>
<SN>17294SN>
<DeviceID>34020000001310000001DeviceID>
<Result>OKResult>
Response>
》》》》》IPC
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.64:5060;rport;branch=z9hG4bK375628128
To: <sip:34020000002000000001@3402000000>;tag=12341241234
From: <sip:34020000001110000001@3402000000>;tag=1239413282
Call-ID: 712071016
CSeq: 20 MESSAGE
User-Agent: General
Content-Length: 0

报警订阅

Expires : 为报警订阅有效期; 到期后需要重新订阅

》》》》》IPC
SUBSCRIBE sip:34020000001110000001@3402000000 SIP/2.0
From: <sip:[email protected]:5060>;tag=12341241234
To: <sip:34020000001110000001@3402000000>
Content-Length: 324
CSeq: 5 SUBSCRIBE
Call-ID: 12345678911
Via: SIP/2.0/UDP 192.168.1.101:5060;wlsscid=377aa9afcf1b36f;branch=123133532300005
Content-Type: Application/MANSCDP+xml
Max-Forwards: 70
Expires:300
Contact: <sip:[email protected]:5060>
Event: id=1984

 
<Query>
<CmdType>AlarmCmdType>
<SN>17430SN>
<DeviceID>34020000001110000001DeviceID>
<StartAlarmPriority>1StartAlarmPriority>
<EndAlarmPriority>4EndAlarmPriority>
<AlarmMethod>0AlarmMethod>
<StartTime>2020-12-14T09:58:25StartTime>
<EndTime>2020-12-14T10:03:25EndTime>
Query>

报警订阅结果

《《《《《 IPC	 
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.101:5060;wlsscid=377aa9afcf1b36f;branch=123133532300005
From: <sip:[email protected]:5060>;tag=12341241234
To: <sip:34020000001110000001@3402000000>;tag=1529982976
Call-ID: 12345678911
CSeq: 5 SUBSCRIBE
Contact: <sip:[email protected]:5060>
Content-Type: Application/MANSCDP+xml
Event: id=1984
User-Agent: IP Camera
Expires: 300
Content-Length:   165


<Response>
<CmdType>AlarmCmdType>
<SN>17430SN>
<DeviceID>34020000001110000001DeviceID>
<Result>OKResult>
Response>

报警通知

《《《《《 IPC	 
NOTIFY sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.64:5060;rport;branch=z9hG4bK221847117
From: <sip:34020000001110000001@3402000000>;tag=1529982976
To: <sip:[email protected]:5060>;tag=12341241234
Call-ID: 12345678911
CSeq: 2 NOTIFY
Contact: <sip:[email protected]:5060>
Content-Type: Application/MANSCDP+xml
Max-Forwards: 70
User-Agent: IP Camera
Subscription-State: active;expires=296
Event: id=1984
Content-Length:   285


<Notify>
<CmdType>AlarmCmdType>
<SN>1288SN>
<DeviceID>34020000001310000001DeviceID>
<AlarmPriority>4AlarmPriority>
<AlarmMethod>5AlarmMethod>
<AlarmTime>2020-12-14T09:58:30AlarmTime>
<Info>
<AlarmType>2AlarmType>
Info>
Notify>
》》》》》IPC
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.64:5060;rport;branch=z9hG4bK221847117
To: <sip:[email protected]:5060>;tag=12341241234
From: <sip:34020000001110000001@3402000000>;tag=1529982976
Call-ID: 12345678911
CSeq: 2 NOTIFY
User-Agent: General
Content-Length: 0

取消报警订阅

Expires:0 为取消订阅

》》》》》IPC 
SUBSCRIBE sip:34020000001110000001@3402000000 SIP/2.0
From: <sip:[email protected]:5060>;tag=12341241234
To: <sip:34020000001110000001@3402000000>
Content-Length: 324
CSeq: 5 SUBSCRIBE
Call-ID: 12345678911
Via: SIP/2.0/UDP 192.168.1.101:5060;wlsscid=377aa9afcf1b36f;branch=123133532300007
Content-Type: Application/MANSCDP+xml
Max-Forwards: 70
Expires:0
Contact: <sip:[email protected]:5060>
Event: id=1984

 
<Query>
<CmdType>AlarmCmdType>
<SN>17431SN>
<DeviceID>34020000001110000001DeviceID>
<StartAlarmPriority>1StartAlarmPriority>
<EndAlarmPriority>4EndAlarmPriority>
<AlarmMethod>0AlarmMethod>
<StartTime>2020-12-14T09:58:32StartTime>
<EndTime>2020-12-14T10:03:32EndTime>
Query>
《《《《《 IPC	
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.101:5060;wlsscid=377aa9afcf1b36f;branch=123133532300007
From: <sip:[email protected]:5060>;tag=12341241234
To: <sip:34020000001110000001@3402000000>;tag=1529982976
Call-ID: 12345678911
CSeq: 5 SUBSCRIBE
Contact: <sip:[email protected]:5060>
Content-Type: Application/MANSCDP+xml
Event: id=1984
User-Agent: IP Camera
Expires: 0
Content-Length:   165


<Response>
<CmdType>AlarmCmdType>
<SN>17431SN>
<DeviceID>34020000001110000001DeviceID>
<Result>OKResult>
Response>

你可能感兴趣的:(GB28181,gb28181,布防,报警,订阅)