[置顶] 【GBT28181开发:SIP协议实践】之设备信息查询

今天学习的是设备信息查询的流程,模拟SPVMN系统向源设备查询其设备信息,记录下交互的消息,详细研究了下:

转载请注明出处:http://blog.csdn.net/longlong530


一.环境搭建:

环境准备:http://blog.csdn.net/longlong530/article/details/9176989

UAC(模拟IPC):

IP:192.168.10.117

Port:5061


UAS(模拟SIP服务器):

IP:192.168.10.177

Port:5060


SPVMN操作过程:
1.先选择调测设备类型
2.打开UAC.exe完成注册( http://blog.csdn.net/longlong530/article/details/9179513)
3.点击设备信息查询,会在左边的文本框中显示xml。
4.点击发送消息,右边对话框即可显示消息交互的过程。


二.业务时序图:

[置顶] 【GBT28181开发:SIP协议实践】之设备信息查询_第1张图片


三.消息详解:

第一步,UAS-->UAC
设备信息查询命令采用Message消息
Content-type头域为Application/MANSCDP+xml,设备信息查询命令采用MANSCDP协议格式,具体参见GBT28181国标。
请求命令包含命令类型(CmdType)、命令序列号(SN)、设备编码(DeviceID)

MESSAGE sip:34020000001320000001@3402000000 SIP/2.0
Call-ID: [email protected]
CSeq: 1 MESSAGE
From: <sip:34020000002000000001@3402000000>;tag=45359626_53173353_3b4a4c3b-9b96-4bf7-a32a-072b56420ab0
To: <sip:34020000001320000001@3402000000>
Max-Forwards: 70
Content-Type: Application/MANSCDP+xml
Route: <sip:[email protected]:5061;line=f3c01344ba6f6fc;lr>
Via: SIP/2.0/UDP 192.168.10.177:5060;branch=z9hG4bK3b4a4c3b-9b96-4bf7-a32a-072b56420ab0_53173353_3448746354628
Content-Length: 130

<?xml version="1.0"?>
<Query>
<CmdType>DeviceInfo</CmdType>
<SN>17430</SN>
<DeviceID>34020000001320000001</DeviceID>
</Query>

第二步,UAC-->UAS
UAC收到请求后,立马返回200 0K响应
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.10.177:5060;branch=z9hG4bK3b4a4c3b-9b96-4bf7-a32a-072b56420ab0_53173353_3448746354628
From: <sip:34020000002000000001@3402000000>;tag=45359626_53173353_3b4a4c3b-9b96-4bf7-a32a-072b56420ab0
To: <sip:34020000001320000001@3402000000>;tag=2269697979
Call-ID: [email protected]
CSeq: 1 MESSAGE
User-Agent: eXosip/3.6.0
Content-Length: 0

第三步,UAC-->UAS
源设备响应服务器的设备信息查询请求,同样采用MANSCDP协议,返回查询结果、设备厂商、设备固件版本等信息
MESSAGE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.10.117:5061;rport=5061;branch=z9hG4bK2567361867;received=192.168.10.117
From: <sip:192.168.10.177:5060>;tag=1879737663
To: <sip:[email protected]>
Call-ID: 1510942636
CSeq: 20 MESSAGE
Content-Type: Application/MANSCDP+xml
Max-Forwards: 70
User-Agent: eXosip/3.6.0
Content-Length: 249

<?xml version="1.0"?>
<Response>
<CmdType>DeviceInfo</CmdType>
<SN>17430</SN>
<DeviceID>34020000001320000001</DeviceID>
<Result>OK</Result>
<Manufacturer>ChaoYuan</Manufacturer>
<Model>ITS - 1.0</Model>
<Firmware>V1.0</Firmware>
</Response>

第四步,UAS-->UAC
服务器收到响应后,立马返回200 OK响应,整个查询业务结束。
SIP/2.0 200 OK
To: <sip:[email protected]>;tag=80978101_53173353_21fba447-b513-465d-a905-d8ba95dc39e4
Via: SIP/2.0/UDP 192.168.10.117:5061;rport=5061;branch=z9hG4bK2567361867;received=192.168.10.117
CSeq: 20 MESSAGE
Call-ID: 1510942636
From: <sip:192.168.10.177:5060>;tag=1879737663
Content-Length: 0


你可能感兴趣的:(SIP,设备信息查询)