修复消息发送失败导致后续次通道无法点播的bug
parent
d6262acf6a
commit
5c3c3e6a4c
|
@ -76,7 +76,9 @@ public class SipSubscribe {
|
||||||
// 会话已结束
|
// 会话已结束
|
||||||
dialogTerminated,
|
dialogTerminated,
|
||||||
// 设备未找到
|
// 设备未找到
|
||||||
deviceNotFoundEvent
|
deviceNotFoundEvent,
|
||||||
|
// 设备未找到
|
||||||
|
cmdSendFailEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class EventResult<EventObject>{
|
public static class EventResult<EventObject>{
|
||||||
|
@ -86,6 +88,9 @@ public class SipSubscribe {
|
||||||
public String callId;
|
public String callId;
|
||||||
public EventObject event;
|
public EventObject event;
|
||||||
|
|
||||||
|
public EventResult() {
|
||||||
|
}
|
||||||
|
|
||||||
public EventResult(EventObject event) {
|
public EventResult(EventObject event) {
|
||||||
this.event = event;
|
this.event = event;
|
||||||
if (event instanceof ResponseEvent) {
|
if (event instanceof ResponseEvent) {
|
||||||
|
|
|
@ -46,8 +46,7 @@ public class SIPSender {
|
||||||
transmitRequest(ip, message, errorEvent, null);
|
transmitRequest(ip, message, errorEvent, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void transmitRequest(String ip, Message message, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws SipException, ParseException {
|
public void transmitRequest(String ip, Message message, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws SipException {
|
||||||
try {
|
|
||||||
ViaHeader viaHeader = (ViaHeader)message.getHeader(ViaHeader.NAME);
|
ViaHeader viaHeader = (ViaHeader)message.getHeader(ViaHeader.NAME);
|
||||||
String transport = "UDP";
|
String transport = "UDP";
|
||||||
if (viaHeader == null) {
|
if (viaHeader == null) {
|
||||||
|
@ -104,9 +103,6 @@ public class SIPSender {
|
||||||
sipProvider.sendResponse((Response)message);
|
sipProvider.sendResponse((Response)message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
// logger.info("[SEND]:SUCCESS:{}", message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CallIdHeader getNewCallIdHeader(String ip, String transport){
|
public CallIdHeader getNewCallIdHeader(String ip, String transport){
|
||||||
|
|
|
@ -142,8 +142,8 @@ public class SipUtils {
|
||||||
remotePort = request.getTopmostViaHeader().getRPort();
|
remotePort = request.getTopmostViaHeader().getRPort();
|
||||||
// 解析本地地址替代
|
// 解析本地地址替代
|
||||||
if (ObjectUtils.isEmpty(remoteAddress) || remotePort == -1) {
|
if (ObjectUtils.isEmpty(remoteAddress) || remotePort == -1) {
|
||||||
remoteAddress = request.getTopmostViaHeader().getHost();
|
remoteAddress = request.getRemoteAddress().getHostAddress();
|
||||||
remotePort = request.getTopmostViaHeader().getPort();
|
remotePort = request.getRemotePort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -398,7 +398,9 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc());
|
mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc());
|
||||||
|
|
||||||
streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream());
|
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 = "命令发送失败";
|
eventResult.msg = "命令发送失败";
|
||||||
errorEvent.response(eventResult);
|
errorEvent.response(eventResult);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue