添加语音对讲接口

2.7.1-多对一语音对讲
648540858 2024-06-14 16:48:58 +08:00
parent e83e880991
commit 0382d300b6
2 changed files with 10 additions and 10 deletions

View File

@ -1141,15 +1141,15 @@ public class PlayServiceImpl implements IPlayService {
AudioBroadcastCatch audioBroadcastCatch = new AudioBroadcastCatch(device.getDeviceId(), channelId, mediaServerItem, app, stream, event, AudioBroadcastCatchStatus.Ready, isFromPlatform);
audioBroadcastManager.update(audioBroadcastCatch);
// 等待invite消息 超时则结束
String key = VideoManagerConstants.BROADCAST_WAITE_INVITE + device.getDeviceId();
if (!SipUtils.isFrontEnd(device.getDeviceId())) {
key += audioBroadcastCatch.getChannelId();
}
dynamicTask.startDelay(key, ()->{
logger.info("[语音广播]等待invite消息超时{}/{}", device.getDeviceId(), channelId);
event.call(-1,"等待invite消息超时");
stopAudioBroadcast(device.getDeviceId(), channelId);
}, 10*1000);
// String key = VideoManagerConstants.BROADCAST_WAITE_INVITE + device.getDeviceId();
// if (!SipUtils.isFrontEnd(device.getDeviceId())) {
// key += audioBroadcastCatch.getChannelId();
// }
// dynamicTask.startDelay(key, ()->{
// logger.info("[语音广播]等待invite消息超时{}/{}", device.getDeviceId(), channelId);
// event.call(-1,"等待invite消息超时");
// stopAudioBroadcast(device.getDeviceId(), channelId);
// }, 10*1000);
}, eventResultForError -> {
// 发送失败
logger.error("语音广播发送失败: {}:{}", channelId, eventResultForError.msg);

View File

@ -281,7 +281,7 @@ public class PlayController {
playService.stopAudioBroadcast();
});
try {
playService.audioBroadcastCmd(device, channelId, mediaServerItem, app, stream, 60, false, (code, msg) -> {
playService.audioBroadcastCmd(device, channel, mediaServerItem, app, stream, 60, false, (code, msg) -> {
WVPResult<Void> wvpResult = new WVPResult<>();
wvpResult.setCode(code);
wvpResult.setMsg(msg);