Commit 0cb68938b82953fc07a8ae37a59fa18974dd3642

Authored by 648540858
1 parent 97fef952

优化sip协议栈调用

src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
... ... @@ -63,7 +63,7 @@ public class SipLayer implements CommandLineRunner {
63 63 private void addListeningPoint(String monitorIp, int port){
64 64 SipStackImpl sipStack;
65 65 try {
66   - sipStack = (SipStackImpl)SipFactory.getInstance().createSipStack(DefaultProperties.getProperties( userSetting.getSipLog()));
  66 + sipStack = (SipStackImpl)SipFactory.getInstance().createSipStack(DefaultProperties.getProperties("GB28181_SIP", userSetting.getSipLog()));
67 67 sipStack.setMessageParserFactory(new GbStringMsgParserFactory());
68 68 } catch (PeerUnavailableException e) {
69 69 logger.error("[SIP SERVER] SIP服务启动失败, 监听地址{}失败,请检查ip是否正确", monitorIp);
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/conf/DefaultProperties.java
... ... @@ -12,9 +12,9 @@ import java.util.Properties;
12 12 */
13 13 public class DefaultProperties {
14 14  
15   - public static Properties getProperties(boolean sipLog) {
  15 + public static Properties getProperties(String name, boolean sipLog) {
16 16 Properties properties = new Properties();
17   - properties.setProperty("javax.sip.STACK_NAME", "GB28181_SIP");
  17 + properties.setProperty("javax.sip.STACK_NAME", name);
18 18 // properties.setProperty("javax.sip.IP_ADDRESS", ip);
19 19 // 关闭自动会话
20 20 properties.setProperty("javax.sip.AUTOMATIC_DIALOG_SUPPORT", "off");
... ...