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