Commit c662a530989706b705142743e0095d5b7f331751
1 parent
a0cdc7c5
请求历史媒体下载增加回复事件处理ssrc与下级不一致情况
Showing
3 changed files
with
84 additions
and
93 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java
| ... | ... | @@ -15,26 +15,26 @@ import javax.sip.InvalidArgumentException; |
| 15 | 15 | import javax.sip.SipException; |
| 16 | 16 | import java.text.ParseException; |
| 17 | 17 | |
| 18 | -/** | |
| 19 | - * @description:设备能力接口,用于定义设备的控制、查询能力 | |
| 18 | +/** | |
| 19 | + * @description:设备能力接口,用于定义设备的控制、查询能力 | |
| 20 | 20 | * @author: swwheihei |
| 21 | - * @date: 2020年5月3日 下午9:16:34 | |
| 21 | + * @date: 2020年5月3日 下午9:16:34 | |
| 22 | 22 | */ |
| 23 | 23 | public interface ISIPCommander { |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * 云台方向放控制,使用配置文件中的默认镜头移动速度 |
| 27 | - * | |
| 27 | + * | |
| 28 | 28 | * @param device 控制设备 |
| 29 | 29 | * @param channelId 预览通道 |
| 30 | 30 | * @param leftRight 镜头左移右移 0:停止 1:左移 2:右移 |
| 31 | 31 | * @param upDown 镜头上移下移 0:停止 1:上移 2:下移 |
| 32 | 32 | */ |
| 33 | 33 | void ptzdirectCmd(Device device,String channelId,int leftRight, int upDown) throws InvalidArgumentException, ParseException, SipException; |
| 34 | - | |
| 34 | + | |
| 35 | 35 | /** |
| 36 | 36 | * 云台方向放控制 |
| 37 | - * | |
| 37 | + * | |
| 38 | 38 | * @param device 控制设备 |
| 39 | 39 | * @param channelId 预览通道 |
| 40 | 40 | * @param leftRight 镜头左移右移 0:停止 1:左移 2:右移 |
| ... | ... | @@ -42,28 +42,28 @@ public interface ISIPCommander { |
| 42 | 42 | * @param moveSpeed 镜头移动速度 |
| 43 | 43 | */ |
| 44 | 44 | void ptzdirectCmd(Device device,String channelId,int leftRight, int upDown, int moveSpeed) throws InvalidArgumentException, ParseException, SipException; |
| 45 | - | |
| 45 | + | |
| 46 | 46 | /** |
| 47 | 47 | * 云台缩放控制,使用配置文件中的默认镜头缩放速度 |
| 48 | - * | |
| 48 | + * | |
| 49 | 49 | * @param device 控制设备 |
| 50 | 50 | * @param channelId 预览通道 |
| 51 | 51 | * @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大 |
| 52 | 52 | */ |
| 53 | 53 | void ptzZoomCmd(Device device,String channelId,int inOut) throws InvalidArgumentException, ParseException, SipException; |
| 54 | - | |
| 54 | + | |
| 55 | 55 | /** |
| 56 | 56 | * 云台缩放控制 |
| 57 | - * | |
| 57 | + * | |
| 58 | 58 | * @param device 控制设备 |
| 59 | 59 | * @param channelId 预览通道 |
| 60 | 60 | * @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大 |
| 61 | 61 | */ |
| 62 | 62 | void ptzZoomCmd(Device device,String channelId,int inOut, int moveSpeed) throws InvalidArgumentException, ParseException, SipException; |
| 63 | - | |
| 63 | + | |
| 64 | 64 | /** |
| 65 | 65 | * 云台控制,支持方向与缩放控制 |
| 66 | - * | |
| 66 | + * | |
| 67 | 67 | * @param device 控制设备 |
| 68 | 68 | * @param channelId 预览通道 |
| 69 | 69 | * @param leftRight 镜头左移右移 0:停止 1:左移 2:右移 |
| ... | ... | @@ -73,10 +73,10 @@ public interface ISIPCommander { |
| 73 | 73 | * @param zoomSpeed 镜头缩放速度 |
| 74 | 74 | */ |
| 75 | 75 | void ptzCmd(Device device,String channelId,int leftRight, int upDown, int inOut, int moveSpeed, int zoomSpeed) throws InvalidArgumentException, SipException, ParseException; |
| 76 | - | |
| 76 | + | |
| 77 | 77 | /** |
| 78 | 78 | * 前端控制,包括PTZ指令、FI指令、预置位指令、巡航指令、扫描指令和辅助开关指令 |
| 79 | - * | |
| 79 | + * | |
| 80 | 80 | * @param device 控制设备 |
| 81 | 81 | * @param channelId 预览通道 |
| 82 | 82 | * @param cmdCode 指令码 |
| ... | ... | @@ -85,7 +85,7 @@ public interface ISIPCommander { |
| 85 | 85 | * @param combineCode2 组合码2 |
| 86 | 86 | */ |
| 87 | 87 | void frontEndCmd(Device device, String channelId, int cmdCode, int parameter1, int parameter2, int combineCode2) throws SipException, InvalidArgumentException, ParseException; |
| 88 | - | |
| 88 | + | |
| 89 | 89 | /** |
| 90 | 90 | * 前端控制指令(用于转发上级指令) |
| 91 | 91 | * @param device 控制设备 |
| ... | ... | @@ -103,7 +103,7 @@ public interface ISIPCommander { |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | 105 | * 请求回放视频流 |
| 106 | - * | |
| 106 | + * | |
| 107 | 107 | * @param device 视频设备 |
| 108 | 108 | * @param channelId 预览通道 |
| 109 | 109 | * @param startTime 开始时间,格式要求:yyyy-MM-dd HH:mm:ss |
| ... | ... | @@ -113,13 +113,13 @@ public interface ISIPCommander { |
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * 请求历史媒体下载 |
| 116 | - * | |
| 116 | + * | |
| 117 | 117 | * @param device 视频设备 |
| 118 | 118 | * @param channelId 预览通道 |
| 119 | 119 | * @param startTime 开始时间,格式要求:yyyy-MM-dd HH:mm:ss |
| 120 | 120 | * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss |
| 121 | 121 | * @param downloadSpeed 下载倍速参数 |
| 122 | - */ | |
| 122 | + */ | |
| 123 | 123 | void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, |
| 124 | 124 | String startTime, String endTime, int downloadSpeed, InviteStreamCallback inviteStreamCallback, InviteStreamCallback hookEvent, |
| 125 | 125 | SipSubscribe.Event errorEvent,SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException; |
| ... | ... | @@ -150,7 +150,7 @@ public interface ISIPCommander { |
| 150 | 150 | * 回放倍速播放 |
| 151 | 151 | */ |
| 152 | 152 | void playSpeedCmd(Device device, StreamInfo streamInfo, Double speed) throws InvalidArgumentException, ParseException, SipException; |
| 153 | - | |
| 153 | + | |
| 154 | 154 | /** |
| 155 | 155 | * 回放控制 |
| 156 | 156 | * @param device |
| ... | ... | @@ -162,55 +162,55 @@ public interface ISIPCommander { |
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | 164 | * 语音广播 |
| 165 | - * | |
| 165 | + * | |
| 166 | 166 | * @param device 视频设备 |
| 167 | 167 | * @param channelId 预览通道 |
| 168 | 168 | */ |
| 169 | 169 | void audioBroadcastCmd(Device device,String channelId); |
| 170 | - | |
| 170 | + | |
| 171 | 171 | /** |
| 172 | 172 | * 语音广播 |
| 173 | - * | |
| 173 | + * | |
| 174 | 174 | * @param device 视频设备 |
| 175 | 175 | */ |
| 176 | 176 | void audioBroadcastCmd(Device device, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException; |
| 177 | 177 | void audioBroadcastCmd(Device device) throws InvalidArgumentException, SipException, ParseException; |
| 178 | - | |
| 178 | + | |
| 179 | 179 | /** |
| 180 | 180 | * 音视频录像控制 |
| 181 | - * | |
| 181 | + * | |
| 182 | 182 | * @param device 视频设备 |
| 183 | 183 | * @param channelId 预览通道 |
| 184 | 184 | * @param recordCmdStr 录像命令:Record / StopRecord |
| 185 | 185 | */ |
| 186 | 186 | void recordCmd(Device device, String channelId, String recordCmdStr, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException; |
| 187 | - | |
| 187 | + | |
| 188 | 188 | /** |
| 189 | 189 | * 远程启动控制命令 |
| 190 | - * | |
| 190 | + * | |
| 191 | 191 | * @param device 视频设备 |
| 192 | 192 | */ |
| 193 | 193 | void teleBootCmd(Device device) throws InvalidArgumentException, SipException, ParseException; |
| 194 | 194 | |
| 195 | 195 | /** |
| 196 | 196 | * 报警布防/撤防命令 |
| 197 | - * | |
| 197 | + * | |
| 198 | 198 | * @param device 视频设备 |
| 199 | 199 | */ |
| 200 | 200 | void guardCmd(Device device, String guardCmdStr, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException; |
| 201 | - | |
| 201 | + | |
| 202 | 202 | /** |
| 203 | 203 | * 报警复位命令 |
| 204 | - * | |
| 204 | + * | |
| 205 | 205 | * @param device 视频设备 |
| 206 | 206 | * @param alarmMethod 报警方式(可选) |
| 207 | 207 | * @param alarmType 报警类型(可选) |
| 208 | 208 | */ |
| 209 | 209 | void alarmCmd(Device device, String alarmMethod, String alarmType, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException; |
| 210 | - | |
| 210 | + | |
| 211 | 211 | /** |
| 212 | 212 | * 强制关键帧命令,设备收到此命令应立刻发送一个IDR帧 |
| 213 | - * | |
| 213 | + * | |
| 214 | 214 | * @param device 视频设备 |
| 215 | 215 | * @param channelId 预览通道 |
| 216 | 216 | */ |
| ... | ... | @@ -221,7 +221,6 @@ public interface ISIPCommander { |
| 221 | 221 | * |
| 222 | 222 | * @param device 视频设备 |
| 223 | 223 | * @param channelId 通道id,非通道则是设备本身 |
| 224 | - * @param frontCmd 上级平台的指令,如果存在则直接下发 | |
| 225 | 224 | * @param enabled 看守位使能:1 = 开启,0 = 关闭 |
| 226 | 225 | * @param resetTime 自动归位时间间隔,开启看守位时使用,单位:秒(s) |
| 227 | 226 | * @param presetIndex 调用预置位编号,开启看守位时使用,取值范围0~255 |
| ... | ... | @@ -230,58 +229,58 @@ public interface ISIPCommander { |
| 230 | 229 | |
| 231 | 230 | /** |
| 232 | 231 | * 设备配置命令 |
| 233 | - * | |
| 232 | + * | |
| 234 | 233 | * @param device 视频设备 |
| 235 | 234 | */ |
| 236 | 235 | void deviceConfigCmd(Device device); |
| 237 | - | |
| 236 | + | |
| 238 | 237 | /** |
| 239 | 238 | * 设备配置命令:basicParam |
| 240 | - * | |
| 239 | + * | |
| 241 | 240 | * @param device 视频设备 |
| 242 | 241 | * @param channelId 通道编码(可选) |
| 243 | 242 | * @param name 设备/通道名称(可选) |
| 244 | 243 | * @param expiration 注册过期时间(可选) |
| 245 | 244 | * @param heartBeatInterval 心跳间隔时间(可选) |
| 246 | 245 | * @param heartBeatCount 心跳超时次数(可选) |
| 247 | - */ | |
| 246 | + */ | |
| 248 | 247 | void deviceBasicConfigCmd(Device device, String channelId, String name, String expiration, String heartBeatInterval, String heartBeatCount, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException; |
| 249 | 248 | |
| 250 | 249 | /** |
| 251 | 250 | * 查询设备状态 |
| 252 | - * | |
| 251 | + * | |
| 253 | 252 | * @param device 视频设备 |
| 254 | 253 | */ |
| 255 | 254 | void deviceStatusQuery(Device device, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException; |
| 256 | - | |
| 255 | + | |
| 257 | 256 | /** |
| 258 | 257 | * 查询设备信息 |
| 259 | - * | |
| 258 | + * | |
| 260 | 259 | * @param device 视频设备 |
| 261 | - * @return | |
| 260 | + * @return | |
| 262 | 261 | */ |
| 263 | 262 | void deviceInfoQuery(Device device) throws InvalidArgumentException, SipException, ParseException; |
| 264 | - | |
| 263 | + | |
| 265 | 264 | /** |
| 266 | 265 | * 查询目录列表 |
| 267 | - * | |
| 266 | + * | |
| 268 | 267 | * @param device 视频设备 |
| 269 | 268 | */ |
| 270 | 269 | void catalogQuery(Device device, int sn, SipSubscribe.Event errorEvent) throws SipException, InvalidArgumentException, ParseException; |
| 271 | - | |
| 270 | + | |
| 272 | 271 | /** |
| 273 | 272 | * 查询录像信息 |
| 274 | - * | |
| 273 | + * | |
| 275 | 274 | * @param device 视频设备 |
| 276 | 275 | * @param startTime 开始时间,格式要求:yyyy-MM-dd HH:mm:ss |
| 277 | 276 | * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss |
| 278 | 277 | * @param sn |
| 279 | 278 | */ |
| 280 | 279 | void recordInfoQuery(Device device, String channelId, String startTime, String endTime, int sn, Integer Secrecy, String type, SipSubscribe.Event okEvent, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException; |
| 281 | - | |
| 280 | + | |
| 282 | 281 | /** |
| 283 | 282 | * 查询报警信息 |
| 284 | - * | |
| 283 | + * | |
| 285 | 284 | * @param device 视频设备 |
| 286 | 285 | * @param startPriority 报警起始级别(可选) |
| 287 | 286 | * @param endPriority 报警终止级别(可选) |
| ... | ... | @@ -293,33 +292,33 @@ public interface ISIPCommander { |
| 293 | 292 | */ |
| 294 | 293 | void alarmInfoQuery(Device device, String startPriority, String endPriority, String alarmMethod, |
| 295 | 294 | String alarmType, String startTime, String endTime, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException; |
| 296 | - | |
| 295 | + | |
| 297 | 296 | /** |
| 298 | 297 | * 查询设备配置 |
| 299 | - * | |
| 298 | + * | |
| 300 | 299 | * @param device 视频设备 |
| 301 | 300 | * @param channelId 通道编码(可选) |
| 302 | 301 | * @param configType 配置类型: |
| 303 | 302 | */ |
| 304 | 303 | void deviceConfigQuery(Device device, String channelId, String configType, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException; |
| 305 | - | |
| 304 | + | |
| 306 | 305 | /** |
| 307 | 306 | * 查询设备预置位置 |
| 308 | - * | |
| 307 | + * | |
| 309 | 308 | * @param device 视频设备 |
| 310 | 309 | */ |
| 311 | 310 | void presetQuery(Device device, String channelId, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException; |
| 312 | - | |
| 311 | + | |
| 313 | 312 | /** |
| 314 | 313 | * 查询移动设备位置数据 |
| 315 | - * | |
| 314 | + * | |
| 316 | 315 | * @param device 视频设备 |
| 317 | 316 | */ |
| 318 | 317 | void mobilePostitionQuery(Device device, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException; |
| 319 | 318 | |
| 320 | 319 | /** |
| 321 | 320 | * 订阅、取消订阅移动位置 |
| 322 | - * | |
| 321 | + * | |
| 323 | 322 | * @param device 视频设备 |
| 324 | 323 | * @return true = 命令发送成功 |
| 325 | 324 | */ | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
| ... | ... | @@ -56,7 +56,7 @@ public class SIPCommander implements ISIPCommander { |
| 56 | 56 | |
| 57 | 57 | @Autowired |
| 58 | 58 | private SIPSender sipSender; |
| 59 | - | |
| 59 | + | |
| 60 | 60 | @Autowired |
| 61 | 61 | private SIPRequestHeaderProvider headerProvider; |
| 62 | 62 | |
| ... | ... | @@ -180,7 +180,7 @@ public class SIPCommander implements ISIPCommander { |
| 180 | 180 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); |
| 181 | 181 | ptzXml.append("</Info>\r\n"); |
| 182 | 182 | ptzXml.append("</Control>\r\n"); |
| 183 | - | |
| 183 | + | |
| 184 | 184 | Request request = headerProvider.createMessageRequest(device, ptzXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 185 | 185 | |
| 186 | 186 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()),request); |
| ... | ... | @@ -243,8 +243,8 @@ public class SIPCommander implements ISIPCommander { |
| 243 | 243 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); |
| 244 | 244 | ptzXml.append("</Info>\r\n"); |
| 245 | 245 | ptzXml.append("</Control>\r\n"); |
| 246 | - | |
| 247 | - | |
| 246 | + | |
| 247 | + | |
| 248 | 248 | Request request = headerProvider.createMessageRequest(device, ptzXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 249 | 249 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()),request, errorEvent, okEvent); |
| 250 | 250 | |
| ... | ... | @@ -364,8 +364,7 @@ public class SIPCommander implements ISIPCommander { |
| 364 | 364 | */ |
| 365 | 365 | @Override |
| 366 | 366 | public void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, |
| 367 | - String startTime, String endTime, | |
| 368 | - InviteStreamCallback inviteStreamCallback, InviteStreamCallback hookEvent, | |
| 367 | + String startTime, String endTime, InviteStreamCallback inviteStreamCallback, InviteStreamCallback hookEvent, | |
| 369 | 368 | SipSubscribe.Event okEvent, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException { |
| 370 | 369 | |
| 371 | 370 | |
| ... | ... | @@ -411,8 +410,7 @@ public class SIPCommander implements ISIPCommander { |
| 411 | 410 | content.append("a=setup:active\r\n"); |
| 412 | 411 | content.append("a=connection:new\r\n"); |
| 413 | 412 | } |
| 414 | - } else | |
| 415 | - { | |
| 413 | + } else { | |
| 416 | 414 | if ("TCP-PASSIVE".equalsIgnoreCase(streamMode)) { |
| 417 | 415 | content.append("m=video " + ssrcInfo.getPort() + " TCP/RTP/AVP 96 97 98 99\r\n"); |
| 418 | 416 | } else if ("TCP-ACTIVE".equalsIgnoreCase(streamMode)) { |
| ... | ... | @@ -543,11 +541,10 @@ public class SIPCommander implements ISIPCommander { |
| 543 | 541 | content.append("a=downloadspeed:" + downloadSpeed + "\r\n"); |
| 544 | 542 | |
| 545 | 543 | content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc |
| 546 | - | |
| 544 | + | |
| 547 | 545 | HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", ssrcInfo.getStream(), true, null, mediaServerItem.getId()); |
| 548 | 546 | // 添加订阅 |
| 549 | - subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject json) -> | |
| 550 | - { | |
| 547 | + subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject json) -> { | |
| 551 | 548 | hookEvent.call(new InviteStreamInfo(mediaServerItem, json,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()).getCallId(), "rtp", ssrcInfo.getStream())); |
| 552 | 549 | subscribe.removeSubscribe(hookSubscribe); |
| 553 | 550 | hookSubscribe.getContent().put("regist", false); |
| ... | ... | @@ -632,7 +629,7 @@ public class SIPCommander implements ISIPCommander { |
| 632 | 629 | broadcastXml.append("<TargetID>" + device.getDeviceId() + "</TargetID>\r\n"); |
| 633 | 630 | broadcastXml.append("</Notify>\r\n"); |
| 634 | 631 | |
| 635 | - | |
| 632 | + | |
| 636 | 633 | |
| 637 | 634 | Request request = headerProvider.createMessageRequest(device, broadcastXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 638 | 635 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request); |
| ... | ... | @@ -652,7 +649,7 @@ public class SIPCommander implements ISIPCommander { |
| 652 | 649 | broadcastXml.append("<TargetID>" + device.getDeviceId() + "</TargetID>\r\n"); |
| 653 | 650 | broadcastXml.append("</Notify>\r\n"); |
| 654 | 651 | |
| 655 | - | |
| 652 | + | |
| 656 | 653 | |
| 657 | 654 | Request request = headerProvider.createMessageRequest(device, broadcastXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 658 | 655 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent); |
| ... | ... | @@ -683,7 +680,7 @@ public class SIPCommander implements ISIPCommander { |
| 683 | 680 | cmdXml.append("<RecordCmd>" + recordCmdStr + "</RecordCmd>\r\n"); |
| 684 | 681 | cmdXml.append("</Control>\r\n"); |
| 685 | 682 | |
| 686 | - | |
| 683 | + | |
| 687 | 684 | |
| 688 | 685 | Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 689 | 686 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent,okEvent); |
| ... | ... | @@ -707,7 +704,7 @@ public class SIPCommander implements ISIPCommander { |
| 707 | 704 | cmdXml.append("<TeleBoot>Boot</TeleBoot>\r\n"); |
| 708 | 705 | cmdXml.append("</Control>\r\n"); |
| 709 | 706 | |
| 710 | - | |
| 707 | + | |
| 711 | 708 | |
| 712 | 709 | Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 713 | 710 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request); |
| ... | ... | @@ -766,7 +763,7 @@ public class SIPCommander implements ISIPCommander { |
| 766 | 763 | } |
| 767 | 764 | cmdXml.append("</Control>\r\n"); |
| 768 | 765 | |
| 769 | - | |
| 766 | + | |
| 770 | 767 | |
| 771 | 768 | Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 772 | 769 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent,okEvent); |
| ... | ... | @@ -795,7 +792,7 @@ public class SIPCommander implements ISIPCommander { |
| 795 | 792 | cmdXml.append("<IFameCmd>Send</IFameCmd>\r\n"); |
| 796 | 793 | cmdXml.append("</Control>\r\n"); |
| 797 | 794 | |
| 798 | - | |
| 795 | + | |
| 799 | 796 | |
| 800 | 797 | Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 801 | 798 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request); |
| ... | ... | @@ -843,7 +840,7 @@ public class SIPCommander implements ISIPCommander { |
| 843 | 840 | cmdXml.append("</HomePosition>\r\n"); |
| 844 | 841 | cmdXml.append("</Control>\r\n"); |
| 845 | 842 | |
| 846 | - | |
| 843 | + | |
| 847 | 844 | |
| 848 | 845 | Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 849 | 846 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent,okEvent); |
| ... | ... | @@ -906,7 +903,7 @@ public class SIPCommander implements ISIPCommander { |
| 906 | 903 | cmdXml.append("</BasicParam>\r\n"); |
| 907 | 904 | cmdXml.append("</Control>\r\n"); |
| 908 | 905 | |
| 909 | - | |
| 906 | + | |
| 910 | 907 | |
| 911 | 908 | Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 912 | 909 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent); |
| ... | ... | @@ -929,7 +926,7 @@ public class SIPCommander implements ISIPCommander { |
| 929 | 926 | catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 930 | 927 | catalogXml.append("</Query>\r\n"); |
| 931 | 928 | |
| 932 | - | |
| 929 | + | |
| 933 | 930 | |
| 934 | 931 | Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 935 | 932 | |
| ... | ... | @@ -953,7 +950,7 @@ public class SIPCommander implements ISIPCommander { |
| 953 | 950 | catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 954 | 951 | catalogXml.append("</Query>\r\n"); |
| 955 | 952 | |
| 956 | - | |
| 953 | + | |
| 957 | 954 | |
| 958 | 955 | Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 959 | 956 | |
| ... | ... | @@ -978,7 +975,7 @@ public class SIPCommander implements ISIPCommander { |
| 978 | 975 | catalogXml.append(" <DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 979 | 976 | catalogXml.append("</Query>\r\n"); |
| 980 | 977 | |
| 981 | - | |
| 978 | + | |
| 982 | 979 | |
| 983 | 980 | Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 984 | 981 | |
| ... | ... | @@ -1023,7 +1020,7 @@ public class SIPCommander implements ISIPCommander { |
| 1023 | 1020 | } |
| 1024 | 1021 | recordInfoXml.append("</Query>\r\n"); |
| 1025 | 1022 | |
| 1026 | - | |
| 1023 | + | |
| 1027 | 1024 | |
| 1028 | 1025 | Request request = headerProvider.createMessageRequest(device, recordInfoXml.toString(), |
| 1029 | 1026 | SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| ... | ... | @@ -1074,7 +1071,7 @@ public class SIPCommander implements ISIPCommander { |
| 1074 | 1071 | } |
| 1075 | 1072 | cmdXml.append("</Query>\r\n"); |
| 1076 | 1073 | |
| 1077 | - | |
| 1074 | + | |
| 1078 | 1075 | |
| 1079 | 1076 | Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 1080 | 1077 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent); |
| ... | ... | @@ -1104,7 +1101,7 @@ public class SIPCommander implements ISIPCommander { |
| 1104 | 1101 | cmdXml.append("<ConfigType>" + configType + "</ConfigType>\r\n"); |
| 1105 | 1102 | cmdXml.append("</Query>\r\n"); |
| 1106 | 1103 | |
| 1107 | - | |
| 1104 | + | |
| 1108 | 1105 | |
| 1109 | 1106 | Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 1110 | 1107 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent); |
| ... | ... | @@ -1131,7 +1128,7 @@ public class SIPCommander implements ISIPCommander { |
| 1131 | 1128 | } |
| 1132 | 1129 | cmdXml.append("</Query>\r\n"); |
| 1133 | 1130 | |
| 1134 | - | |
| 1131 | + | |
| 1135 | 1132 | |
| 1136 | 1133 | Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 1137 | 1134 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent); |
| ... | ... | @@ -1155,7 +1152,7 @@ public class SIPCommander implements ISIPCommander { |
| 1155 | 1152 | mobilePostitionXml.append("<Interval>60</Interval>\r\n"); |
| 1156 | 1153 | mobilePostitionXml.append("</Query>\r\n"); |
| 1157 | 1154 | |
| 1158 | - | |
| 1155 | + | |
| 1159 | 1156 | |
| 1160 | 1157 | Request request = headerProvider.createMessageRequest(device, mobilePostitionXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 1161 | 1158 | |
| ... | ... | @@ -1240,7 +1237,7 @@ public class SIPCommander implements ISIPCommander { |
| 1240 | 1237 | } |
| 1241 | 1238 | cmdXml.append("</Query>\r\n"); |
| 1242 | 1239 | |
| 1243 | - | |
| 1240 | + | |
| 1244 | 1241 | |
| 1245 | 1242 | Request request = headerProvider.createSubscribeRequest(device, cmdXml.toString(), null, expires, "presence",sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 1246 | 1243 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request); |
| ... | ... | @@ -1290,14 +1287,14 @@ public class SIPCommander implements ISIPCommander { |
| 1290 | 1287 | } |
| 1291 | 1288 | dragXml.append(cmdString); |
| 1292 | 1289 | dragXml.append("</Control>\r\n"); |
| 1293 | - | |
| 1290 | + | |
| 1294 | 1291 | Request request = headerProvider.createMessageRequest(device, dragXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 1295 | 1292 | logger.debug("拉框信令: " + request.toString()); |
| 1296 | 1293 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()),request); |
| 1297 | 1294 | } |
| 1298 | 1295 | |
| 1299 | 1296 | |
| 1300 | - | |
| 1297 | + | |
| 1301 | 1298 | |
| 1302 | 1299 | |
| 1303 | 1300 | /** |
| ... | ... | @@ -1401,7 +1398,7 @@ public class SIPCommander implements ISIPCommander { |
| 1401 | 1398 | deviceStatusXml.append("</info>\r\n"); |
| 1402 | 1399 | deviceStatusXml.append("</Notify>\r\n"); |
| 1403 | 1400 | |
| 1404 | - | |
| 1401 | + | |
| 1405 | 1402 | Request request = headerProvider.createMessageRequest(device, deviceStatusXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); |
| 1406 | 1403 | sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()),request); |
| 1407 | 1404 | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| ... | ... | @@ -258,8 +258,7 @@ public class PlayServiceImpl implements IPlayService { |
| 258 | 258 | return; |
| 259 | 259 | } |
| 260 | 260 | try { |
| 261 | - cmder.playStreamCmd(mediaServerItem, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> | |
| 262 | - { | |
| 261 | + cmder.playStreamCmd(mediaServerItem, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> { | |
| 263 | 262 | logger.info("收到订阅消息: " + response.toJSONString()); |
| 264 | 263 | dynamicTask.stop(timeOutTaskKey); |
| 265 | 264 | |
| ... | ... | @@ -274,8 +273,7 @@ public class PlayServiceImpl implements IPlayService { |
| 274 | 273 | logger.info("[请求截图]: " + fileName); |
| 275 | 274 | zlmresTfulUtils.getSnap(mediaServerItemInuse, streamUrl, 15, 1, path, fileName); |
| 276 | 275 | |
| 277 | - }, (event) -> | |
| 278 | - { | |
| 276 | + }, (event) -> { | |
| 279 | 277 | ResponseEvent responseEvent = (ResponseEvent) event.event; |
| 280 | 278 | String contentString = new String(responseEvent.getResponse().getRawContent()); |
| 281 | 279 | // 获取ssrc |
| ... | ... | @@ -324,8 +322,7 @@ public class PlayServiceImpl implements IPlayService { |
| 324 | 322 | |
| 325 | 323 | } |
| 326 | 324 | } |
| 327 | - }, (event) -> | |
| 328 | - { | |
| 325 | + }, (event) -> { | |
| 329 | 326 | dynamicTask.stop(timeOutTaskKey); |
| 330 | 327 | mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream()); |
| 331 | 328 | // 释放ssrc |
| ... | ... | @@ -516,8 +513,7 @@ public class PlayServiceImpl implements IPlayService { |
| 516 | 513 | |
| 517 | 514 | try { |
| 518 | 515 | cmder.playbackStreamCmd(mediaServerItem, ssrcInfo, device, channelId, startTime, endTime, infoCallBack, |
| 519 | - hookEvent, eventResult -> | |
| 520 | - { | |
| 516 | + hookEvent, eventResult -> { | |
| 521 | 517 | if (eventResult.type == SipSubscribe.EventResultType.response) { |
| 522 | 518 | ResponseEvent responseEvent = (ResponseEvent) eventResult.event; |
| 523 | 519 | String contentString = new String(responseEvent.getResponse().getRawContent()); |
| ... | ... | @@ -586,7 +582,6 @@ public class PlayServiceImpl implements IPlayService { |
| 586 | 582 | if (device == null) { |
| 587 | 583 | return; |
| 588 | 584 | } |
| 589 | - //获取录像下载的服务,配置文件中的record-assist-port不为0 | |
| 590 | 585 | MediaServerItem newMediaServerItem = getNewMediaServerItemHasAssist(device); |
| 591 | 586 | if (newMediaServerItem == null) { |
| 592 | 587 | PlayBackResult<StreamInfo> downloadResult = new PlayBackResult<>(); | ... | ... |