648540858
2021-05-06 fd296d1a6acccbe9f3a72623719bf7101725f4e9
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java
@@ -11,7 +11,7 @@
import javax.sip.message.Request;
import javax.sip.message.Response;
import com.genersoft.iot.vmp.conf.MediaServerConfig;
import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig;
import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
@@ -93,6 +93,11 @@
            GbStream gbStream = storager.queryStreamInParentPlatform(requesterId, channelId);
            // 不是通道可能是直播流
            if (channel != null || gbStream != null ) {
               if (channel.getStatus() == 0) {
                  logger.info("通道离线,返回400");
                  responseAck(evt, Response.BAD_REQUEST, "channel [" + channel.getChannelId() + "] offline");
                  return;
               }
               responseAck(evt, Response.CALL_IS_BEING_FORWARDED); // 通道存在,发181,呼叫转接中
            }else {
               logger.info("通道不存在,返回404");
@@ -182,7 +187,7 @@
                  sendRtpItem.setStatus(1);
                  redisCatchStorage.updateSendRTPSever(sendRtpItem);
                  // TODO 添加对tcp的支持
                  MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
                  ZLMServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
                  StringBuffer content = new StringBuffer(200);
                  content.append("v=0\r\n");
                  content.append("o="+"00000"+" 0 0 IN IP4 "+mediaInfo.getWanIp()+"\r\n");
@@ -241,7 +246,7 @@
                  sendRtpItem.setStatus(1);
                  redisCatchStorage.updateSendRTPSever(sendRtpItem);
                  // TODO 添加对tcp的支持
                  MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
                  ZLMServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
                  StringBuffer content = new StringBuffer(200);
                  content.append("v=0\r\n");
                  content.append("o="+"00000"+" 0 0 IN IP4 "+mediaInfo.getWanIp()+"\r\n");
@@ -367,6 +372,12 @@
      getServerTransaction(evt).sendResponse(response);
   }
   private void responseAck(RequestEvent evt, int statusCode, String msg) throws SipException, InvalidArgumentException, ParseException {
      Response response = getMessageFactory().createResponse(statusCode, evt.getRequest());
      response.setReasonPhrase(msg);
      getServerTransaction(evt).sendResponse(response);
   }
   /**
    * 回复带sdp的200
    * @param evt