下面学习的是设备目录查询的流程,和设备信息的流程差不多,主要是描述的协议字段不同,模拟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
- MESSAGE sip:34020000001320000001@3402000000 SIP/2.0
- Call-ID: [email protected]
- CSeq: 1 MESSAGE
- From: <sip:34020000002000000001@3402000000>;tag=08052615_53173353_7e47bbc7-c29c-4299-803b-71f7367975bb
- To: <sip:34020000001320000001@3402000000>
- Max-Forwards: 70
- Content-Type: Application/MANSCDP+xml
- Route: <sip:[email protected]:5061;line=5c2d93a668f3d3b;lr>
- Via: SIP/2.0/UDP 192.168.10.177:5060;branch=z9hG4bK7e47bbc7-c29c-4299-803b-71f7367975bb_53173353_9686809251402
- Content-Length: 125
- <?xml version="1.0"?>
- <Query>
- <CmdType>Catalog</CmdType>
- <SN>248</SN>
- <DeviceID>34020000001320000001</DeviceID>
- </Query>
第二步,UAC-->UAS
- SIP/2.0 200 OK
- Via: SIP/2.0/UDP 192.168.10.177:5060;branch=z9hG4bK7e47bbc7-c29c-4299-803b-71f7367975bb_53173353_9686809251402
- From: <sip:34020000002000000001@3402000000>;tag=08052615_53173353_7e47bbc7-c29c-4299-803b-71f7367975bb
- To: <sip:34020000001320000001@3402000000>;tag=883575767
- Call-ID: [email protected]
- CSeq: 1 MESSAGE
- User-Agent: eXosip/3.6.0
- Content-Length: 0
第三步,UAC-->UAS
- MESSAGE sip:[email protected] SIP/2.0
- Via: SIP/2.0/UDP 192.168.10.177:5061;rport=5061;branch=z9hG4bK3917727870;received=192.168.10.177
- From: <sip:192.168.10.177:5060>;tag=2228745831
- To: <sip:[email protected]>
- Call-ID: 3993662053
- CSeq: 20 MESSAGE
- Content-Type: Application/MANSCDP+xml
- Max-Forwards: 70
- User-Agent: eXosip/3.6.0
- Content-Length: 877
- <?xml version="1.0"?>
- <Response>
- <CmdType>Catalog</CmdType>
- <SN>248</SN>
- <DeviceID>34020000001320000001</DeviceID>
- <SumNum>1</SumNum>
- <DeviceList Num="1">
- <Item>
- <DeviceID>34020000001320000001</DeviceID>
- <Name>IPC</Name>
- <Manufacturer>ChaoYuan</Manufacturer>
- <Model>TEST001</Model>
- <Owner>Owner1</Owner>
- <CivilCode>CivilCode1</CivilCode>
- <Block>Block1</Block>
- <Address>Address1</Address>
- <Parental>0</Parental>
- <ParentID>34020000001320000001</ParentID>
- <SafetyWay>0</SafetyWay>
- <RegisterWay>1</RegisterWay>
- <CertNum>CertNum1</CertNum>
- <Certifiable>0</Certifiable>
- <ErrCode>400</ErrCode>
- <EndTime>2099-12-31T23:59:59</EndTime>
- <Secrecy>0</Secrecy>
- <IPAddress>192.168.10.117</IPAddress>
- <Port>6000</Port>
- <Password>Password1</Password>
- <Status>OK</Status>
- <Longitude>171.3</Longitude>
- <Latitude>34.2</Latitude>
- </Item>
- </DeviceList>
- </Response>
第四步,UAS-->UAC
- SIP/2.0 200 OK
- To: <sip:[email protected]>;tag=26545395_53173353_019caa42-43f0-4b6c-a07f-a9c2bfa80f34
- Via: SIP/2.0/UDP 192.168.10.177:5061;rport=5061;branch=z9hG4bK3917727870;received=192.168.10.177
- CSeq: 20 MESSAGE
- Call-ID: 3993662053
- From: <sip:192.168.10.177:5060>;tag=2228745831
- Content-Length: 0