| | |
| | | */ |
| | | private SipTransactionInfo sipTransactionInfo; |
| | | |
| | | private MediaServerItem mediaServerItem; |
| | | |
| | | |
| | | public String getDeviceId() { |
| | | return deviceId; |
| | |
| | | |
| | | public SipTransactionInfo getSipTransactionInfo() { |
| | | return sipTransactionInfo; |
| | | } |
| | | |
| | | public MediaServerItem getMediaServerItem() { |
| | | return mediaServerItem; |
| | | } |
| | | |
| | | public void setMediaServerItem(MediaServerItem mediaServerItem) { |
| | | this.mediaServerItem = mediaServerItem; |
| | | } |
| | | |
| | | public String getApp() { |
| | |
| | | logger.info("设备{}请求语音流,地址:{}:{},ssrc:{}, {}", requesterId, addressStr, port, ssrc, |
| | | mediaTransmissionTCP ? (tcpActive? "TCP主动":"TCP被动") : "UDP"); |
| | | |
| | | MediaServerItem mediaServerItem = audioBroadcastCatch.getMediaServerItem(); |
| | | MediaServerItem mediaServerItem = broadcastCatch.getMediaServerItem(); |
| | | if (mediaServerItem == null) { |
| | | logger.warn("未找到语音喊话使用的zlm"); |
| | | try { |
| | | responseAck(request, Response.BUSY_HERE); |
| | | } catch (SipException | InvalidArgumentException | ParseException e) { |
| | | logger.error("[命令发送失败] invite 未找到可用的zlm: {}", e.getMessage()); |
| | | playService.stopAudioBroadcast(device.getDeviceId(), audioBroadcastCatch.getChannelId()); |
| | | playService.stopAudioBroadcast(device.getDeviceId(), broadcastCatch.getChannelId()); |
| | | } |
| | | return; |
| | | } |
| | | String addressStr = sdp.getConnection().getAddress(); |
| | | logger.info("设备{}请求语音流, 收流地址:{}:{},ssrc:{}, {}, 对讲方式:{}", requesterId, addressStr, port, ssrc, |
| | | mediaTransmissionTCP ? (tcpActive? "TCP主动":"TCP被动") : "UDP", sdp.getSessionName().getValue()); |
| | | |
| | | MediaServerItem mediaServerItem = broadcastCatch.getMediaServerItem(); |
| | | SendRtpItem sendRtpItem = zlmrtpServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, |
| | | device.getDeviceId(), broadcastCatch.getChannelId(), |
| | | mediaTransmissionTCP, false); |
| | |
| | | sendRtpItem.setPlatformId(requesterId); |
| | | sendRtpItem.setStatus(1); |
| | | sendRtpItem.setApp(broadcastCatch.getApp()); |
| | | sendRtpItem.setStreamId(broadcastCatch.getStream()); |
| | | sendRtpItem.setStream(broadcastCatch.getStream()); |
| | | sendRtpItem.setPt(8); |
| | | sendRtpItem.setUsePs(false); |
| | | sendRtpItem.setRtcp(false); |
| | |
| | | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| | | import com.genersoft.iot.vmp.vmanager.bean.AudioBroadcastResult; |
| | | import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.AudioBroadcastEvent; |
| | | import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.AudioEvent; |
| | | import gov.nist.javax.sip.message.SIPResponse; |
| | | |
| | | import javax.sip.InvalidArgumentException; |
| | |
| | | void startSendRtpStreamHand(SendRtpItem sendRtpItem, ParentPlatform parentPlatform, |
| | | JSONObject jsonObject, Map<String, Object> param, CallIdHeader callIdHeader); |
| | | |
| | | void talkCmd(Device device, String channelId, MediaServerItem mediaServerItem, String stream, AudioEvent event); |
| | | void talkCmd(Device device, String channelId, MediaServerItem mediaServerItem, String stream, AudioBroadcastEvent event); |
| | | |
| | | void stopTalk(Device device, String channelId, Boolean streamIsReady); |
| | | } |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.genersoft.iot.vmp.vmanager.bean.StreamContent; |
| | | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| | | import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.AudioEvent; |
| | | import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.AudioBroadcastEvent; |
| | | import gov.nist.javax.sip.message.SIPResponse; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | |
| | | private void talk(MediaServerItem mediaServerItem, Device device, String channelId, String stream, |
| | | ZlmHttpHookSubscribe.Event hookEvent, SipSubscribe.Event errorEvent, |
| | | Runnable timeoutCallback, AudioEvent audioEvent) { |
| | | Runnable timeoutCallback, AudioBroadcastEvent audioEvent) { |
| | | |
| | | String playSsrc = mediaServerItem.getSsrcConfig().getPlaySsrc(); |
| | | if (playSsrc == null) { |
| | |
| | | SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(device.getDeviceId(), channelId, null, null); |
| | | if (sendRtpItem != null && sendRtpItem.isOnlyAudio()) { |
| | | // 查询流是否存在,不存在则认为是异常状态 |
| | | Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStreamId()); |
| | | Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream()); |
| | | if (streamReady) { |
| | | logger.warn("语音广播已经开启: {}", channelId); |
| | | event.call("语音广播已经开启"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void talkCmd(Device device, String channelId, MediaServerItem mediaServerItem, String stream, AudioEvent event) { |
| | | public void talkCmd(Device device, String channelId, MediaServerItem mediaServerItem, String stream, AudioBroadcastEvent event) { |
| | | if (device == null || channelId == null) { |
| | | return; |
| | | } |
File was renamed from src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/bean/AudioEvent.java |
| | |
| | | /** |
| | | * @author lin |
| | | */ |
| | | public interface AudioEvent { |
| | | public interface AudioBroadcastEvent { |
| | | void call(String msg); |
| | | } |