commit
cf8320e749
|
@ -37,7 +37,7 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
|
|
||||||
private final String method = "MESSAGE";
|
private final String method = "MESSAGE";
|
||||||
|
|
||||||
private static Map<String, IMessageHandler> messageHandlerMap = new ConcurrentHashMap<>();
|
private static final Map<String, IMessageHandler> messageHandlerMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SIPProcessorObserver sipProcessorObserver;
|
private SIPProcessorObserver sipProcessorObserver;
|
||||||
|
@ -100,9 +100,9 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
deviceNotFoundEvent.setCallId(callIdHeader.getCallId());
|
deviceNotFoundEvent.setCallId(callIdHeader.getCallId());
|
||||||
SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult(deviceNotFoundEvent);
|
SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult(deviceNotFoundEvent);
|
||||||
sipSubscribe.getErrorSubscribe(callIdHeader.getCallId()).response(eventResult);
|
sipSubscribe.getErrorSubscribe(callIdHeader.getCallId()).response(eventResult);
|
||||||
};
|
}
|
||||||
}else {
|
}else {
|
||||||
Element rootElement = null;
|
Element rootElement;
|
||||||
try {
|
try {
|
||||||
rootElement = getRootElement(evt);
|
rootElement = getRootElement(evt);
|
||||||
if (rootElement == null) {
|
if (rootElement == null) {
|
||||||
|
@ -110,11 +110,6 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
responseAck(request, Response.BAD_REQUEST, "content is null");
|
responseAck(request, Response.BAD_REQUEST, "content is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (DocumentException e) {
|
|
||||||
logger.warn("解析XML消息内容异常", e);
|
|
||||||
// 不存在则回复404
|
|
||||||
responseAck(request, Response.BAD_REQUEST, e.getMessage());
|
|
||||||
}
|
|
||||||
String name = rootElement.getName();
|
String name = rootElement.getName();
|
||||||
IMessageHandler messageHandler = messageHandlerMap.get(name);
|
IMessageHandler messageHandler = messageHandlerMap.get(name);
|
||||||
if (messageHandler != null) {
|
if (messageHandler != null) {
|
||||||
|
@ -128,6 +123,11 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
// 不存在则回复415
|
// 不存在则回复415
|
||||||
responseAck(request, Response.UNSUPPORTED_MEDIA_TYPE, "Unsupported message type, must Control/Notify/Query/Response");
|
responseAck(request, Response.UNSUPPORTED_MEDIA_TYPE, "Unsupported message type, must Control/Notify/Query/Response");
|
||||||
}
|
}
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
logger.warn("解析XML消息内容异常", e);
|
||||||
|
// 不存在则回复404
|
||||||
|
responseAck(request, Response.BAD_REQUEST, e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (SipException e) {
|
} catch (SipException e) {
|
||||||
logger.warn("SIP 回复错误", e);
|
logger.warn("SIP 回复错误", e);
|
||||||
|
|
Loading…
Reference in New Issue