下面学习的是设备远程控制的流程,和设备信息、设备目录、设备状态的流程差不多,主要是描述的协议字段不同,模拟SPVMN系统向源设备发送远程启动控制指令,记录下交互的消息,详细研究了下:
转载请注明出处:http://blog.csdn.net/longlong530
一.环境搭建:
环境准备:http://blog.csdn.net/longlong530/article/details/9176989
UAC(模拟IPC):
IP:192.168.10.177(同事人不在~,直接用自己的机子模拟了下)
Port:5061
UAS(模拟SIP服务器):
IP:192.168.10.177
Port:5060
<?xml version="1.0"?> <Control> <CmdType>DeviceControl</CmdType> <SN>17298</SN> <DeviceID>34020000001320000001</DeviceID> <TeleBoot>Boot</TeleBoot> </Control>4.点击发送消息,右边对话框即可显示消息交互的过程。(图就不截了~)
MESSAGE sip:34020000001320000001@3402000000 SIP/2.0 Call-ID: [email protected] CSeq: 1 MESSAGE From: <sip:34020000002000000001@3402000000>;tag=58726327_53173353_c2be9be1-4121-42af-b4e2-e4896ab42120 To: <sip:34020000001320000001@3402000000> Max-Forwards: 70 Content-Type: Application/MANSCDP+xml Route: <sip:[email protected]:5061;line=9a1ca01668b5778;lr> Via: SIP/2.0/UDP 192.168.10.177:5060;branch=z9hG4bKc2be9be1-4121-42af-b4e2-e4896ab42120_53173353_18042259617961 Content-Length: 164 <?xml version="1.0"?> <Control> <CmdType>DeviceControl</CmdType> <SN>17298</SN> <DeviceID>34020000001320000001</DeviceID> <TeleBoot>Boot</TeleBoot> </Control>
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.10.177:5060;branch=z9hG4bKc2be9be1-4121-42af-b4e2-e4896ab42120_53173353_18042259617961 From: <sip:34020000002000000001@3402000000>;tag=58726327_53173353_c2be9be1-4121-42af-b4e2-e4896ab42120 To: <sip:34020000001320000001@3402000000>;tag=3874540817 Call-ID: [email protected] CSeq: 1 MESSAGE User-Agent: eXosip/3.6.0 Content-Length: 0
MESSAGE sip:[email protected] SIP/2.0 Via: SIP/2.0/UDP 192.168.10.177:5061;rport=5061;branch=z9hG4bK3569164341;received=192.168.10.177 From: <sip:192.168.10.177:5060>;tag=3889968117 To: <sip:[email protected]> Call-ID: 2825372510 CSeq: 20 MESSAGE Content-Type: Application/MANSCDP+xml Max-Forwards: 70 User-Agent: eXosip/3.6.0 Content-Length: 162 <?xml version="1.0"?> <Response> <CmdType>DeviceControl</CmdType> <SN>17298</SN> <DeviceID>34020000001320000001</DeviceID> <Result>OK</Result> </Response>
SIP/2.0 200 OK To: <sip:[email protected]>;tag=70215966_53173353_3fef6c77-3ced-484e-9fe7-8905f724c295 Via: SIP/2.0/UDP 192.168.10.177:5061;rport=5061;branch=z9hG4bK3569164341;received=192.168.10.177 CSeq: 20 MESSAGE Call-ID: 2825372510 From: <sip:192.168.10.177:5060>;tag=3889968117 Content-Length: 0