修复消息发送失败导致后续次通道无法点播的bug

pull/829/head
648540858 2023-04-21 14:18:52 +08:00
parent d6262acf6a
commit 5c3c3e6a4c
4 changed files with 12 additions and 9 deletions

View File

@ -76,7 +76,9 @@ public class SipSubscribe {
// 会话已结束
dialogTerminated,
// 设备未找到
deviceNotFoundEvent
deviceNotFoundEvent,
// 设备未找到
cmdSendFailEvent
}
public static class EventResult<EventObject>{
@ -86,6 +88,9 @@ public class SipSubscribe {
public String callId;
public EventObject event;
public EventResult() {
}
public EventResult(EventObject event) {
this.event = event;
if (event instanceof ResponseEvent) {

View File

@ -46,8 +46,7 @@ public class SIPSender {
transmitRequest(ip, message, errorEvent, null);
}
public void transmitRequest(String ip, Message message, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws SipException, ParseException {
try {
public void transmitRequest(String ip, Message message, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws SipException {
ViaHeader viaHeader = (ViaHeader)message.getHeader(ViaHeader.NAME);
String transport = "UDP";
if (viaHeader == null) {
@ -104,9 +103,6 @@ public class SIPSender {
sipProvider.sendResponse((Response)message);
}
}
} finally {
// logger.info("[SEND]:SUCCESS:{}", message);
}
}
public CallIdHeader getNewCallIdHeader(String ip, String transport){

View File

@ -142,8 +142,8 @@ public class SipUtils {
remotePort = request.getTopmostViaHeader().getRPort();
// 解析本地地址替代
if (ObjectUtils.isEmpty(remoteAddress) || remotePort == -1) {
remoteAddress = request.getTopmostViaHeader().getHost();
remotePort = request.getTopmostViaHeader().getPort();
remoteAddress = request.getRemoteAddress().getHostAddress();
remotePort = request.getRemotePort();
}
}

View File

@ -398,7 +398,9 @@ public class PlayServiceImpl implements IPlayService {
mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc());
streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream());
SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult(new CmdSendFailEvent(null));
SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult();
eventResult.type = SipSubscribe.EventResultType.cmdSendFailEvent;
eventResult.statusCode = -1;
eventResult.msg = "命令发送失败";
errorEvent.response(eventResult);
}