Class AbstractSipRequestStrategy

java.lang.Object
io.github.lunasaw.sip.common.transmit.strategy.AbstractSipRequestStrategy
All Implemented Interfaces:
SipRequestStrategy
Direct Known Subclasses:
AckRequestStrategy, ByeRequestStrategy, InfoRequestStrategy, InviteRequestStrategy, MessageRequestStrategy, NotifyRequestStrategy, RegisterRequestStrategy, SubscribeRequestStrategy

public abstract class AbstractSipRequestStrategy extends Object implements SipRequestStrategy
抽象的基础SIP请求策略类 提供通用的请求发送逻辑,子类只需要实现具体的请求构建逻辑
Author:
lin
  • Constructor Details

    • AbstractSipRequestStrategy

      public AbstractSipRequestStrategy()
  • Method Details

    • sendRequest

      public String sendRequest(FromDevice fromDevice, ToDevice toDevice, String content, Event errorEvent, Event okEvent)
      Description copied from interface: SipRequestStrategy
      发送请求
      Specified by:
      sendRequest in interface SipRequestStrategy
      Parameters:
      fromDevice - 发送方设备
      toDevice - 接收方设备
      content - 请求内容
      errorEvent - 错误事件处理器
      okEvent - 成功事件处理器
      Returns:
      呼叫ID
    • sendRequest

      public String sendRequest(FromDevice fromDevice, ToDevice toDevice, String content, String callId, Event errorEvent, Event okEvent)
      Description copied from interface: SipRequestStrategy
      发送请求
      Specified by:
      sendRequest in interface SipRequestStrategy
      Parameters:
      fromDevice - 发送方设备
      toDevice - 接收方设备
      content - 请求内容
      callId - 呼叫ID
      errorEvent - 错误事件处理器
      okEvent - 成功事件处理器
      Returns:
      呼叫ID
    • sendRequestWithSubscribe

      public String sendRequestWithSubscribe(FromDevice fromDevice, ToDevice toDevice, String content, SubscribeInfo subscribeInfo, String callId, Event errorEvent, Event okEvent)
      Description copied from interface: SipRequestStrategy
      发送带订阅信息的请求
      Specified by:
      sendRequestWithSubscribe in interface SipRequestStrategy
      Parameters:
      fromDevice - 发送方设备
      toDevice - 接收方设备
      content - 请求内容
      subscribeInfo - 订阅信息
      callId - 呼叫ID
      errorEvent - 错误事件处理器
      okEvent - 成功事件处理器
      Returns:
      呼叫ID
    • sendRequestWithSubject

      public String sendRequestWithSubject(FromDevice fromDevice, ToDevice toDevice, String content, String subject, String callId, Event errorEvent, Event okEvent)
      Description copied from interface: SipRequestStrategy
      发送带主题的请求
      Specified by:
      sendRequestWithSubject in interface SipRequestStrategy
      Parameters:
      fromDevice - 发送方设备
      toDevice - 接收方设备
      content - 请求内容
      subject - 主题
      callId - 呼叫ID
      errorEvent - 错误事件处理器
      okEvent - 成功事件处理器
      Returns:
      呼叫ID
    • buildRequest

      protected abstract javax.sip.message.Request buildRequest(FromDevice fromDevice, ToDevice toDevice, String content, String callId)
      构建基础请求
      Parameters:
      fromDevice - 发送方设备
      toDevice - 接收方设备
      content - 请求内容
      callId - 呼叫ID
      Returns:
      构建的请求
    • buildRequestWithSubject

      protected javax.sip.message.Request buildRequestWithSubject(FromDevice fromDevice, ToDevice toDevice, String content, String subject, String callId)
      构建带主题的请求
      Parameters:
      fromDevice - 发送方设备
      toDevice - 接收方设备
      content - 请求内容
      subject - 主题
      callId - 呼叫ID
      Returns:
      构建的请求
    • buildRequestWithSubscribe

      protected javax.sip.message.Request buildRequestWithSubscribe(FromDevice fromDevice, ToDevice toDevice, String content, SubscribeInfo subscribeInfo, String callId)
      构建带订阅信息的请求
      Parameters:
      fromDevice - 发送方设备
      toDevice - 接收方设备
      content - 请求内容
      subscribeInfo - 订阅信息
      callId - 呼叫ID
      Returns:
      构建的请求