SipBuilder UA 补充
This commit is contained in:
parent
d810236d62
commit
f0857df86e
@ -1,6 +1,5 @@
|
|||||||
package cn.skcks.docking.gb28181.sip.generic;
|
package cn.skcks.docking.gb28181.sip.generic;
|
||||||
|
|
||||||
import cn.skcks.docking.gb28181.constant.GB28181Constant;
|
|
||||||
import cn.skcks.docking.gb28181.sip.header.XGBVerHeader;
|
import cn.skcks.docking.gb28181.sip.header.XGBVerHeader;
|
||||||
import cn.skcks.docking.gb28181.sip.header.impl.XGBVerHeaderImpl;
|
import cn.skcks.docking.gb28181.sip.header.impl.XGBVerHeaderImpl;
|
||||||
import cn.skcks.docking.gb28181.sip.utils.SipUtil;
|
import cn.skcks.docking.gb28181.sip.utils.SipUtil;
|
||||||
@ -15,13 +14,14 @@ import javax.sip.address.AddressFactory;
|
|||||||
import javax.sip.address.SipURI;
|
import javax.sip.address.SipURI;
|
||||||
import javax.sip.header.*;
|
import javax.sip.header.*;
|
||||||
import javax.sip.message.MessageFactory;
|
import javax.sip.message.MessageFactory;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SipBuilder {
|
public class SipBuilder {
|
||||||
public static String DEFAULT_CHARSET = GB28181Constant.CHARSET;
|
public static String DEFAULT_CHARSET = StandardCharsets.UTF_8.name();
|
||||||
public static SipFactory getSipFactory(){
|
public static SipFactory getSipFactory(){
|
||||||
return SipFactory.getInstance();
|
return SipFactory.getInstance();
|
||||||
}
|
}
|
||||||
@ -41,6 +41,7 @@ public class SipBuilder {
|
|||||||
public static MessageFactory getMessageFactory(String charset){
|
public static MessageFactory getMessageFactory(String charset){
|
||||||
MessageFactoryImpl messageFactory = (MessageFactoryImpl)getSipFactory().createMessageFactory();
|
MessageFactoryImpl messageFactory = (MessageFactoryImpl)getSipFactory().createMessageFactory();
|
||||||
messageFactory.setDefaultContentEncodingCharset(charset);
|
messageFactory.setDefaultContentEncodingCharset(charset);
|
||||||
|
messageFactory.setDefaultUserAgentHeader(userAgentHeader);
|
||||||
log.debug("将使用 {} 编码 sip 消息", charset);
|
log.debug("将使用 {} 编码 sip 消息", charset);
|
||||||
return messageFactory;
|
return messageFactory;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user