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

GB28181 专栏收录该内容
5 篇文章 2 订阅

注意

  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

<?xml version="1.0"?>
<Control>
<CmdType>DeviceControl</CmdType>
<SN>17294</SN>
<DeviceID>34020000001310000001</DeviceID>		//视频通道
<GuardCmd>SetGuard</GuardCmd>
</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

<?xml version="1.0" encoding="GB2312"?>
<Response>
<CmdType>DeviceControl</CmdType>
<SN>17294</SN>
<DeviceID>34020000001310000001</DeviceID>
<Result>OK</Result>
</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:34020000002000000001@192.168.1.101: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:34020000002000000001@192.168.1.101:5060>
Event: id=1984

<?xml version="1.0"?> 
<Query>
<CmdType>Alarm</CmdType>
<SN>17430</SN>
<DeviceID>34020000001110000001</DeviceID>
<StartAlarmPriority>1</StartAlarmPriority>
<EndAlarmPriority>4</EndAlarmPriority>
<AlarmMethod>0</AlarmMethod>
<StartTime>2020-12-14T09:58:25</StartTime>
<EndTime>2020-12-14T10:03:25</EndTime>
</Query>

报警订阅结果

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

<?xml version="1.0" encoding="GB2312"?>
<Response>
<CmdType>Alarm</CmdType>
<SN>17430</SN>
<DeviceID>34020000001110000001</DeviceID>
<Result>OK</Result>
</Response>

报警通知

《《《《《 IPC	 
NOTIFY sip:34020000002000000001@192.168.1.101: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:34020000002000000001@192.168.1.101:5060>;tag=12341241234
Call-ID: 12345678911
CSeq: 2 NOTIFY
Contact: <sip:34020000001110000001@192.168.1.64:5060>
Content-Type: Application/MANSCDP+xml
Max-Forwards: 70
User-Agent: IP Camera
Subscription-State: active;expires=296
Event: id=1984
Content-Length:   285

<?xml version="1.0" encoding="GB2312"?>
<Notify>
<CmdType>Alarm</CmdType>
<SN>1288</SN>
<DeviceID>34020000001310000001</DeviceID>
<AlarmPriority>4</AlarmPriority>
<AlarmMethod>5</AlarmMethod>
<AlarmTime>2020-12-14T09:58:30</AlarmTime>
<Info>
<AlarmType>2</AlarmType>
</Info>
</Notify>
》》》》》IPC
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.64:5060;rport;branch=z9hG4bK221847117
To: <sip:34020000002000000001@192.168.1.101: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:34020000002000000001@192.168.1.101: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:34020000002000000001@192.168.1.101:5060>
Event: id=1984

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

<?xml version="1.0" encoding="GB2312"?>
<Response>
<CmdType>Alarm</CmdType>
<SN>17431</SN>
<DeviceID>34020000001110000001</DeviceID>
<Result>OK</Result>
</Response>
  • 1
    点赞
  • 5
    评论
  • 3
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

评论 5 您还未登录,请先 登录 后发表或查看评论
©️2022 CSDN 皮肤主题:像素格子 设计师:CSDN官方博客 返回首页

打赏作者

yangops

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值