Commit ddfe4a7b2dceac56047a5018af8b34454afb9a20

Authored by 648540858
Committed by GitHub
2 parents dbe6ece6 39a5c8e2

Merge pull request #524 from TristingChen/fixed--processTimeout

fixed--解决ssrc默认开启失败的问题,解决信令超时设备下线的bug
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
... ... @@ -131,7 +131,7 @@ public class Device {
131 131 /**
132 132 * 是否开启ssrc校验,默认关闭,开启可以防止串流
133 133 */
134   - private boolean ssrcCheck;
  134 + private boolean ssrcCheck = true;
135 135  
136 136 /**
137 137 * 地理坐标系, 目前支持 WGS84,GCJ02 TODO CGCS2000
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/event/SipSubscribe.java
... ... @@ -88,8 +88,8 @@ public class SipSubscribe {
88 88 this.type = "timeout";
89 89 this.msg = "消息超时未回复";
90 90 this.statusCode = -1024;
91   - this.callId = timeoutEvent.getClientTransaction().getDialog().getCallId().getCallId();
92 91 this.dialog = timeoutEvent.getClientTransaction().getDialog();
  92 + this.callId = this.dialog != null?timeoutEvent.getClientTransaction().getDialog().getCallId().getCallId(): null;
93 93 }else if (event instanceof TransactionTerminatedEvent) {
94 94 TransactionTerminatedEvent transactionTerminatedEvent = (TransactionTerminatedEvent)event;
95 95 this.type = "transactionTerminated";
... ... @@ -109,8 +109,8 @@ public class SipSubscribe {
109 109 this.type = "deviceNotFoundEvent";
110 110 this.msg = "设备未找到";
111 111 this.statusCode = -1024;
112   - this.callId = deviceNotFoundEvent.getDialog().getCallId().getCallId();
113 112 this.dialog = deviceNotFoundEvent.getDialog();
  113 + this.callId = this.dialog != null ?deviceNotFoundEvent.getDialog().getCallId().getCallId() : null;
114 114 }
115 115 }
116 116 }
... ... @@ -130,6 +130,9 @@ public class SipSubscribe {
130 130 }
131 131  
132 132 public void removeErrorSubscribe(String key) {
  133 + if(key == null){
  134 + return;
  135 + }
133 136 errorSubscribes.remove(key);
134 137 errorTimeSubscribes.remove(key);
135 138 }
... ... @@ -139,6 +142,9 @@ public class SipSubscribe {
139 142 }
140 143  
141 144 public void removeOkSubscribe(String key) {
  145 + if(key == null){
  146 + return;
  147 + }
142 148 okSubscribes.remove(key);
143 149 okTimeSubscribes.remove(key);
144 150 }
... ...