Commit 724963324aaa63feca2c6aed13785dc8485bc02c
1 parent
8cf5b65e
修复上级点播时如果推流信息中mediaServerID错误的情况
Showing
5 changed files
with
14 additions
and
16 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
| @@ -64,7 +64,7 @@ public class SipLayer implements CommandLineRunner { | @@ -64,7 +64,7 @@ public class SipLayer implements CommandLineRunner { | ||
| 64 | try { | 64 | try { |
| 65 | sipStack = (SipStackImpl)SipFactory.getInstance().createSipStack(DefaultProperties.getProperties(monitorIp, userSetting.getSipLog())); | 65 | sipStack = (SipStackImpl)SipFactory.getInstance().createSipStack(DefaultProperties.getProperties(monitorIp, userSetting.getSipLog())); |
| 66 | } catch (PeerUnavailableException e) { | 66 | } catch (PeerUnavailableException e) { |
| 67 | - logger.error("[Sip Server] SIP服务启动失败, 监听地址{}失败,请检查ip是否正确", monitorIp); | 67 | + logger.error("[SIP SERVER] SIP服务启动失败, 监听地址{}失败,请检查ip是否正确", monitorIp); |
| 68 | return; | 68 | return; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| @@ -76,12 +76,12 @@ public class SipLayer implements CommandLineRunner { | @@ -76,12 +76,12 @@ public class SipLayer implements CommandLineRunner { | ||
| 76 | tcpSipProvider.addSipListener(sipProcessorObserver); | 76 | tcpSipProvider.addSipListener(sipProcessorObserver); |
| 77 | tcpSipProviderMap.put(monitorIp, tcpSipProvider); | 77 | tcpSipProviderMap.put(monitorIp, tcpSipProvider); |
| 78 | 78 | ||
| 79 | - logger.info("[Sip Server] tcp://{}:{} 启动成功", monitorIp, port); | 79 | + logger.info("[SIP SERVER] tcp://{}:{} 启动成功", monitorIp, port); |
| 80 | } catch (TransportNotSupportedException | 80 | } catch (TransportNotSupportedException |
| 81 | | TooManyListenersException | 81 | | TooManyListenersException |
| 82 | | ObjectInUseException | 82 | | ObjectInUseException |
| 83 | | InvalidArgumentException e) { | 83 | | InvalidArgumentException e) { |
| 84 | - logger.error("[Sip Server] tcp://{}:{} SIP服务启动失败,请检查端口是否被占用或者ip是否正确" | 84 | + logger.error("[SIP SERVER] tcp://{}:{} SIP服务启动失败,请检查端口是否被占用或者ip是否正确" |
| 85 | , monitorIp, port); | 85 | , monitorIp, port); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| @@ -93,12 +93,12 @@ public class SipLayer implements CommandLineRunner { | @@ -93,12 +93,12 @@ public class SipLayer implements CommandLineRunner { | ||
| 93 | 93 | ||
| 94 | udpSipProviderMap.put(monitorIp, udpSipProvider); | 94 | udpSipProviderMap.put(monitorIp, udpSipProvider); |
| 95 | 95 | ||
| 96 | - logger.info("[Sip Server] udp://{}:{} 启动成功", monitorIp, port); | 96 | + logger.info("[SIP SERVER] udp://{}:{} 启动成功", monitorIp, port); |
| 97 | } catch (TransportNotSupportedException | 97 | } catch (TransportNotSupportedException |
| 98 | | TooManyListenersException | 98 | | TooManyListenersException |
| 99 | | ObjectInUseException | 99 | | ObjectInUseException |
| 100 | | InvalidArgumentException e) { | 100 | | InvalidArgumentException e) { |
| 101 | - logger.error("[Sip Server] udp://{}:{} SIP服务启动失败,请检查端口是否被占用或者ip是否正确" | 101 | + logger.error("[SIP SERVER] udp://{}:{} SIP服务启动失败,请检查端口是否被占用或者ip是否正确" |
| 102 | , monitorIp, port); | 102 | , monitorIp, port); |
| 103 | } | 103 | } |
| 104 | } | 104 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| @@ -214,6 +214,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -214,6 +214,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 214 | continue; | 214 | continue; |
| 215 | }else { | 215 | }else { |
| 216 | if (channel.getChannelId().length() != 20) { | 216 | if (channel.getChannelId().length() != 20) { |
| 217 | + logger.warn("[编号长度异常] {} 长度错误,请使用20位长度的国标编号,当前长度:{}", channel.getChannelId(), channel.getChannelId().length()); | ||
| 218 | + catalogXml.append("</Item>\r\n"); | ||
| 217 | continue; | 219 | continue; |
| 218 | } | 220 | } |
| 219 | switch (Integer.parseInt(channel.getChannelId().substring(10, 13))){ | 221 | switch (Integer.parseInt(channel.getChannelId().substring(10, 13))){ |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| @@ -183,16 +183,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | @@ -183,16 +183,11 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | ||
| 183 | return; | 183 | return; |
| 184 | } else { | 184 | } else { |
| 185 | streamPushItem = streamPushService.getPush(gbStream.getApp(), gbStream.getStream()); | 185 | streamPushItem = streamPushService.getPush(gbStream.getApp(), gbStream.getStream()); |
| 186 | - if (streamPushItem == null || streamPushItem.getServerId().equals(userSetting.getServerId())) { | ||
| 187 | - logger.info("[ app={}, stream={} ]找不到zlm {},返回410", gbStream.getApp(), gbStream.getStream(), mediaServerId); | ||
| 188 | - try { | ||
| 189 | - responseAck(request, Response.GONE); | ||
| 190 | - } catch (SipException | InvalidArgumentException | ParseException e) { | ||
| 191 | - logger.error("[命令发送失败] invite GONE: {}", e.getMessage()); | ||
| 192 | - } | ||
| 193 | - return; | ||
| 194 | - }else { | ||
| 195 | - // TODO 可能漏回复消息 | 186 | + if (streamPushItem != null) { |
| 187 | + mediaServerItem = mediaServerService.getOne(streamPushItem.getMediaServerId()); | ||
| 188 | + } | ||
| 189 | + if (mediaServerItem == null) { | ||
| 190 | + mediaServerItem = mediaServerService.getDefaultMediaServer(); | ||
| 196 | } | 191 | } |
| 197 | } | 192 | } |
| 198 | } else { | 193 | } else { |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
| @@ -533,7 +533,7 @@ public class ZLMHttpHookListener { | @@ -533,7 +533,7 @@ public class ZLMHttpHookListener { | ||
| 533 | } | 533 | } |
| 534 | return ret; | 534 | return ret; |
| 535 | } | 535 | } |
| 536 | - // 推流具有主动性,暂时不做处理 | 536 | + // TODO 推流具有主动性,暂时不做处理 |
| 537 | // StreamPushItem streamPushItem = streamPushService.getPush(app, streamId); | 537 | // StreamPushItem streamPushItem = streamPushService.getPush(app, streamId); |
| 538 | // if (streamPushItem != null) { | 538 | // if (streamPushItem != null) { |
| 539 | // // TODO 发送停止 | 539 | // // TODO 发送停止 |
src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java
| @@ -101,6 +101,7 @@ public class PlatformServiceImpl implements IPlatformService { | @@ -101,6 +101,7 @@ public class PlatformServiceImpl implements IPlatformService { | ||
| 101 | // 行政区划默认去编号的前6位 | 101 | // 行政区划默认去编号的前6位 |
| 102 | parentPlatform.setAdministrativeDivision(parentPlatform.getServerGBId().substring(0,6)); | 102 | parentPlatform.setAdministrativeDivision(parentPlatform.getServerGBId().substring(0,6)); |
| 103 | } | 103 | } |
| 104 | + parentPlatform.setTreeType("CivilCode"); | ||
| 104 | parentPlatform.setCatalogId(parentPlatform.getDeviceGBId()); | 105 | parentPlatform.setCatalogId(parentPlatform.getDeviceGBId()); |
| 105 | int result = platformMapper.addParentPlatform(parentPlatform); | 106 | int result = platformMapper.addParentPlatform(parentPlatform); |
| 106 | // 添加缓存 | 107 | // 添加缓存 |