jiang
2022-07-13 fc89b7b517e191fb6c9b66fa86dd05ebab0f54c5
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
@@ -1828,6 +1828,43 @@
         e.printStackTrace();
      }
   }
   @Override
   public void playbackControlCmd(Device device, StreamInfo streamInfo, String content,SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) {
      try {
         Request request = headerProvider.createInfoRequest(device, streamInfo, content);
         if (request == null) {
            return;
         }
         logger.info(request.toString());
         ClientTransaction clientTransaction = null;
         if ("TCP".equals(device.getTransport())) {
            clientTransaction = tcpSipProvider.getNewClientTransaction(request);
         } else if ("UDP".equals(device.getTransport())) {
            clientTransaction = udpSipProvider.getNewClientTransaction(request);
         }
         CallIdHeader callIdHeader = (CallIdHeader)request.getHeader(CallIdHeader.NAME);
         if(errorEvent != null) {
            sipSubscribe.addErrorSubscribe(callIdHeader.getCallId(), (eventResult -> {
               errorEvent.response(eventResult);
               sipSubscribe.removeErrorSubscribe(eventResult.callId);
               sipSubscribe.removeOkSubscribe(eventResult.callId);
            }));
         }
         if(okEvent != null) {
            sipSubscribe.addOkSubscribe(callIdHeader.getCallId(), eventResult -> {
               okEvent.response(eventResult);
               sipSubscribe.removeOkSubscribe(eventResult.callId);
               sipSubscribe.removeErrorSubscribe(eventResult.callId);
            });
         }
         clientTransaction.sendRequest();
      } catch (SipException | ParseException | InvalidArgumentException e) {
         e.printStackTrace();
      }
   }
   @Override
   public boolean sendAlarmMessage(Device device, DeviceAlarm deviceAlarm) {