解决级联通道名称中文乱码
parent
4010ed6c23
commit
344994c7f0
|
@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||||
|
import gov.nist.javax.sip.message.MessageFactoryImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
// import org.springframework.beans.factory.annotation.Qualifier;
|
// import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -205,8 +206,10 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70);
|
MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70);
|
||||||
// ceq
|
// ceq
|
||||||
CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(1L, Request.MESSAGE);
|
CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(1L, Request.MESSAGE);
|
||||||
|
MessageFactoryImpl messageFactory = (MessageFactoryImpl) sipFactory.createMessageFactory();
|
||||||
request = sipFactory.createMessageFactory().createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader,
|
// 设置编码, 防止中文乱码
|
||||||
|
messageFactory.setDefaultContentEncodingCharset("gb2312");
|
||||||
|
request = messageFactory.createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader,
|
||||||
toHeader, viaHeaders, maxForwards);
|
toHeader, viaHeaders, maxForwards);
|
||||||
ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("APPLICATION", "MANSCDP+xml");
|
ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("APPLICATION", "MANSCDP+xml");
|
||||||
request.setContent(content, contentTypeHeader);
|
request.setContent(content, contentTypeHeader);
|
||||||
|
|
|
@ -172,6 +172,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
|
||||||
private void transmitRequest(ParentPlatform parentPlatform, Request request, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws SipException {
|
private void transmitRequest(ParentPlatform parentPlatform, Request request, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws SipException {
|
||||||
if("TCP".equals(parentPlatform.getTransport())) {
|
if("TCP".equals(parentPlatform.getTransport())) {
|
||||||
tcpSipProvider.sendRequest(request);
|
tcpSipProvider.sendRequest(request);
|
||||||
|
|
||||||
} else if("UDP".equals(parentPlatform.getTransport())) {
|
} else if("UDP".equals(parentPlatform.getTransport())) {
|
||||||
udpSipProvider.sendRequest(request);
|
udpSipProvider.sendRequest(request);
|
||||||
}
|
}
|
||||||
|
@ -264,9 +265,9 @@ 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>GB28181 Video Platform</DeviceName>\r\n");
|
deviceInfoXml.append("<DeviceName>WVP-GB28181</DeviceName>\r\n");
|
||||||
deviceInfoXml.append("<Manufacturer>Manufacturer</Manufacturer>\r\n");
|
deviceInfoXml.append("<Manufacturer>WVP</Manufacturer>\r\n");
|
||||||
deviceInfoXml.append("<Model>wvp-28181</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");
|
||||||
deviceInfoXml.append("<Result>OK</Result>\r\n");
|
deviceInfoXml.append("<Result>OK</Result>\r\n");
|
||||||
deviceInfoXml.append("</Response>\r\n");
|
deviceInfoXml.append("</Response>\r\n");
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class AckRequestProcessor extends SIPRequestAbstractProcessor {
|
||||||
zlmrtpServerFactory.startSendRtpStream(param);
|
zlmrtpServerFactory.startSendRtpStream(param);
|
||||||
} else {
|
} else {
|
||||||
System.out.println("等待设备推流.......");
|
System.out.println("等待设备推流.......");
|
||||||
Thread.sleep(2000);
|
Thread.sleep(1000);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class ZLMHttpHookListener {
|
||||||
// String app = json.getString("app");
|
// String app = json.getString("app");
|
||||||
// String stream = json.getString("stream");
|
// String stream = json.getString("stream");
|
||||||
|
|
||||||
ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, json);
|
ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_shell_login, json);
|
||||||
if (subscribe != null) subscribe.response(json);
|
if (subscribe != null) subscribe.response(json);
|
||||||
|
|
||||||
JSONObject ret = new JSONObject();
|
JSONObject ret = new JSONObject();
|
||||||
|
|
Loading…
Reference in New Issue