添加user-agent,修复deviceINfo查询设备名称
parent
95ed662935
commit
408df377b7
|
@ -15,6 +15,7 @@ import javax.sip.message.Request;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,6 +61,12 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
|
|
||||||
request = sipFactory.createMessageFactory().createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader,
|
request = sipFactory.createMessageFactory().createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader,
|
||||||
toHeader, viaHeaders, maxForwards);
|
toHeader, viaHeaders, maxForwards);
|
||||||
|
|
||||||
|
List<String> agentParam = new ArrayList<>();
|
||||||
|
agentParam.add("wvp-pro");
|
||||||
|
UserAgentHeader userAgentHeader = sipFactory.createHeaderFactory().createUserAgentHeader(agentParam);
|
||||||
|
request.addHeader(userAgentHeader);
|
||||||
|
|
||||||
ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml");
|
ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml");
|
||||||
request.setContent(content, contentTypeHeader);
|
request.setContent(content, contentTypeHeader);
|
||||||
return request;
|
return request;
|
||||||
|
@ -103,6 +110,11 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
ExpiresHeader expires = sipFactory.createHeaderFactory().createExpiresHeader(Integer.parseInt(platform.getExpires()));
|
ExpiresHeader expires = sipFactory.createHeaderFactory().createExpiresHeader(Integer.parseInt(platform.getExpires()));
|
||||||
request.addHeader(expires);
|
request.addHeader(expires);
|
||||||
|
|
||||||
|
List<String> agentParam = new ArrayList<>();
|
||||||
|
agentParam.add("wvp-pro");
|
||||||
|
UserAgentHeader userAgentHeader = sipFactory.createHeaderFactory().createUserAgentHeader(agentParam);
|
||||||
|
request.addHeader(userAgentHeader);
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,6 +214,11 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
messageFactory.setDefaultContentEncodingCharset("gb2312");
|
messageFactory.setDefaultContentEncodingCharset("gb2312");
|
||||||
request = messageFactory.createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader,
|
request = messageFactory.createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader,
|
||||||
toHeader, viaHeaders, maxForwards);
|
toHeader, viaHeaders, maxForwards);
|
||||||
|
List<String> agentParam = new ArrayList<>();
|
||||||
|
agentParam.add("wvp-pro");
|
||||||
|
UserAgentHeader userAgentHeader = sipFactory.createHeaderFactory().createUserAgentHeader(agentParam);
|
||||||
|
request.addHeader(userAgentHeader);
|
||||||
|
|
||||||
ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("APPLICATION", "MANSCDP+xml");
|
ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("APPLICATION", "MANSCDP+xml");
|
||||||
request.setContent(content, contentTypeHeader);
|
request.setContent(content, contentTypeHeader);
|
||||||
return request;
|
return request;
|
||||||
|
|
|
@ -263,7 +263,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
|
||||||
deviceInfoXml.append("<CmdType>DeviceInfo</CmdType>\r\n");
|
deviceInfoXml.append("<CmdType>DeviceInfo</CmdType>\r\n");
|
||||||
deviceInfoXml.append("<SN>" +sn + "</SN>\r\n");
|
deviceInfoXml.append("<SN>" +sn + "</SN>\r\n");
|
||||||
deviceInfoXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n");
|
deviceInfoXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n");
|
||||||
deviceInfoXml.append("<DeviceName>WVP-GB28181</DeviceName>\r\n");
|
deviceInfoXml.append("<DeviceName>" + parentPlatform.getName() + "</DeviceName>\r\n");
|
||||||
deviceInfoXml.append("<Manufacturer>WVP</Manufacturer>\r\n");
|
deviceInfoXml.append("<Manufacturer>WVP</Manufacturer>\r\n");
|
||||||
deviceInfoXml.append("<Model>wvp-28181-2.0</Model>\r\n");
|
deviceInfoXml.append("<Model>wvp-28181-2.0</Model>\r\n");
|
||||||
deviceInfoXml.append("<Firmware>2.0.202103</Firmware>\r\n");
|
deviceInfoXml.append("<Firmware>2.0.202103</Firmware>\r\n");
|
||||||
|
|
Loading…
Reference in New Issue