| | |
| | | String protocol = media.getProtocol(); |
| | | |
| | | // 区分TCP发流还是udp, 当前默认udp |
| | | if ("TCP/RTP/AVP".equals(protocol)) { |
| | | if ("TCP/RTP/AVP".equalsIgnoreCase(protocol)) { |
| | | String setup = mediaDescription.getAttribute("setup"); |
| | | if (setup != null) { |
| | | mediaTransmissionTCP = true; |
| | | if ("active".equals(setup)) { |
| | | if ("active".equalsIgnoreCase(setup)) { |
| | | tcpActive = true; |
| | | // 不支持tcp主动 |
| | | responseAck(evt, Response.NOT_IMPLEMENTED, "tcp active not support"); // 目录不支持点播 |
| | | return; |
| | | } else if ("passive".equals(setup)) { |
| | | } else if ("passive".equalsIgnoreCase(setup)) { |
| | | tcpActive = false; |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | sendRtpItem.setCallId(callIdHeader.getCallId()); |
| | | sendRtpItem.setPlayType("Play".equals(sessionName) ? InviteStreamType.PLAY : InviteStreamType.PLAYBACK); |
| | | sendRtpItem.setPlayType("Play".equalsIgnoreCase(sessionName) ? InviteStreamType.PLAY : InviteStreamType.PLAYBACK); |
| | | |
| | | Long finalStartTime = startTime; |
| | | Long finalStopTime = stopTime; |
| | |
| | | content.append("o=" + channelId + " 0 0 IN IP4 " + mediaServerItemInUSe.getSdpIp() + "\r\n"); |
| | | content.append("s=" + sessionName + "\r\n"); |
| | | content.append("c=IN IP4 " + mediaServerItemInUSe.getSdpIp() + "\r\n"); |
| | | if ("Playback".equals(sessionName)) { |
| | | if ("Playback".equalsIgnoreCase(sessionName)) { |
| | | content.append("t=" + finalStartTime + " " + finalStopTime + "\r\n"); |
| | | } else { |
| | | content.append("t=0 0\r\n"); |
| | |
| | | } |
| | | }); |
| | | sendRtpItem.setApp("rtp"); |
| | | if ("Playback".equals(sessionName)) { |
| | | if ("Playback".equalsIgnoreCase(sessionName)) { |
| | | sendRtpItem.setPlayType(InviteStreamType.PLAYBACK); |
| | | SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, null, true, true); |
| | | sendRtpItem.setStreamId(ssrcInfo.getStream()); |
| | |
| | | responseAck(evt, Response.BAD_REQUEST, "channel [" + gbStream.getGbId() + "] offline"); |
| | | } else if ("push".equals(gbStream.getStreamType())) { |
| | | if (!platform.isStartOfflinePush()) { |
| | | // 平台设置中关闭了拉起离线的推流则直接回复 |
| | | responseAck(evt, Response.TEMPORARILY_UNAVAILABLE, "channel unavailable"); |
| | | return; |
| | | } |
| | |
| | | app, stream, channelId, mediaTransmissionTCP); |
| | | |
| | | if (sendRtpItem == null) { |
| | | logger.warn("服务器端口资源不足"); |
| | | logger.warn("上级点时创建sendRTPItem失败,可能是服务器端口资源不足"); |
| | | try { |
| | | responseAck(evt, Response.BUSY_HERE); |
| | | } catch (SipException e) { |