Class SipExceptionHandler

java.lang.Object
io.github.lunasaw.sip.common.exception.SipExceptionHandler

@Component public class SipExceptionHandler extends Object
SIP异常处理器 提供统一的异常处理和错误响应生成
Author:
luna
  • Constructor Details

    • SipExceptionHandler

      public SipExceptionHandler()
  • Method Details

    • handleException

      public void handleException(SipException exception, javax.sip.RequestEvent requestEvent)
      处理SIP异常并生成相应的响应
      Parameters:
      exception - 异常信息
      requestEvent - 原始请求事件,如果为null则只记录日志
    • handleException

      public void handleException(Exception exception, javax.sip.RequestEvent requestEvent, String context)
      处理一般异常
      Parameters:
      exception - 异常信息
      requestEvent - 原始请求事件
      context - 上下文信息
    • createProcessorException

      public static SipProcessorException createProcessorException(String processorName, String sipMethod, String message)
      创建SIP处理器异常
      Parameters:
      processorName - 处理器名称
      sipMethod - SIP方法
      message - 异常消息
      Returns:
      SIP处理器异常
    • createProcessorException

      public static SipProcessorException createProcessorException(String processorName, String sipMethod, String message, Throwable cause)
      创建SIP处理器异常
      Parameters:
      processorName - 处理器名称
      sipMethod - SIP方法
      message - 异常消息
      cause - 原因异常
      Returns:
      SIP处理器异常