648540858
2022-11-21 6b03568c5dd128a3d71c02fb1a3a76a4344a4920
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java
@@ -4,10 +4,10 @@
import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException;
import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
@@ -22,15 +22,12 @@
import com.genersoft.iot.vmp.service.redisMsg.RedisGbPlayMsgListener;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import gov.nist.javax.sip.message.SIPRequest;
import gov.nist.javax.sip.stack.SIPDialog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.sip.*;
import javax.sip.InvalidArgumentException;
import javax.sip.RequestEvent;
import javax.sip.SipException;
@@ -38,7 +35,6 @@
import javax.sip.header.CallIdHeader;
import javax.sip.header.FromHeader;
import javax.sip.header.HeaderAddress;
import java.text.ParseException;
import javax.sip.header.ToHeader;
import java.text.ParseException;
import java.util.HashMap;
@@ -122,7 +118,8 @@
      }
      String is_Udp = sendRtpItem.isTcp() ? "0" : "1";
      MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
      logger.info("收到ACK,rtp/{}开始向上级推流, 目标={}:{},SSRC={}", sendRtpItem.getStreamId(), sendRtpItem.getIp(), sendRtpItem.getPort(), sendRtpItem.getSsrc());
      logger.info("收到ACK,rtp/{}开始向上级推流, 目标={}:{},SSRC={}, RTCP={}", sendRtpItem.getStreamId(),
            sendRtpItem.getIp(), sendRtpItem.getPort(), sendRtpItem.getSsrc(), sendRtpItem.isRtcp());
      Map<String, Object> param = new HashMap<>(12);
      param.put("vhost","__defaultVhost__");
      param.put("app",sendRtpItem.getApp());
@@ -132,9 +129,9 @@
      param.put("pt", sendRtpItem.getPt());
      param.put("use_ps", sendRtpItem.isUsePs() ? "1" : "0");
      param.put("only_audio", sendRtpItem.isOnlyAudio() ? "1" : "0");
      if (!sendRtpItem.isTcp() && parentPlatform != null && parentPlatform.isRtcp()) {
      if (!sendRtpItem.isTcp()) {
         // 开启rtcp保活
         param.put("udp_rtcp_timeout", "1");
         param.put("udp_rtcp_timeout", sendRtpItem.isRtcp()? "1":"0");
      }
      JSONObject jsonObject;
@@ -145,6 +142,9 @@
         param.put("dst_url", sendRtpItem.getIp());
         param.put("dst_port", sendRtpItem.getPort());
         jsonObject = zlmrtpServerFactory.startSendRtpStream(mediaInfo, param);
         System.out.println(JSON.toJSONString(param));
         System.out.println();
         System.out.println(jsonObject);
      }
         if (jsonObject == null) {