|
|
@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd; |
|
|
|
|
|
|
|
import com.genersoft.iot.vmp.conf.SipConfig; |
|
|
|
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.Qualifier;
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
@ -205,8 +206,10 @@ public class SIPRequestHeaderPlarformProvider { |
|
|
|
MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); |
|
|
|
// ceq
|
|
|
|
CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(1L, Request.MESSAGE); |
|
|
|
|
|
|
|
request = sipFactory.createMessageFactory().createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, |
|
|
|
MessageFactoryImpl messageFactory = (MessageFactoryImpl) sipFactory.createMessageFactory(); |
|
|
|
// 设置编码, 防止中文乱码
|
|
|
|
messageFactory.setDefaultContentEncodingCharset("gb2312"); |
|
|
|
request = messageFactory.createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, |
|
|
|
toHeader, viaHeaders, maxForwards); |
|
|
|
ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("APPLICATION", "MANSCDP+xml"); |
|
|
|
request.setContent(content, contentTypeHeader); |
|
|
|