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
抽象的基础SIP请求策略类
提供通用的请求发送逻辑,子类只需要实现具体的请求构建逻辑
- Author:
- lin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract javax.sip.message.Request
buildRequest
(FromDevice fromDevice, ToDevice toDevice, String content, String callId) 构建基础请求protected javax.sip.message.Request
buildRequestWithSubject
(FromDevice fromDevice, ToDevice toDevice, String content, String subject, String callId) 构建带主题的请求protected javax.sip.message.Request
buildRequestWithSubscribe
(FromDevice fromDevice, ToDevice toDevice, String content, SubscribeInfo subscribeInfo, String callId) 构建带订阅信息的请求sendRequest
(FromDevice fromDevice, ToDevice toDevice, String content, Event errorEvent, Event okEvent) 发送请求sendRequest
(FromDevice fromDevice, ToDevice toDevice, String content, String callId, Event errorEvent, Event okEvent) 发送请求sendRequestWithSubject
(FromDevice fromDevice, ToDevice toDevice, String content, String subject, String callId, Event errorEvent, Event okEvent) 发送带主题的请求sendRequestWithSubscribe
(FromDevice fromDevice, ToDevice toDevice, String content, SubscribeInfo subscribeInfo, String callId, Event errorEvent, Event okEvent) 发送带订阅信息的请求
-
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 interfaceSipRequestStrategy
- 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 interfaceSipRequestStrategy
- Parameters:
fromDevice
- 发送方设备toDevice
- 接收方设备content
- 请求内容callId
- 呼叫IDerrorEvent
- 错误事件处理器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 interfaceSipRequestStrategy
- Parameters:
fromDevice
- 发送方设备toDevice
- 接收方设备content
- 请求内容subscribeInfo
- 订阅信息callId
- 呼叫IDerrorEvent
- 错误事件处理器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 interfaceSipRequestStrategy
- Parameters:
fromDevice
- 发送方设备toDevice
- 接收方设备content
- 请求内容subject
- 主题callId
- 呼叫IDerrorEvent
- 错误事件处理器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:
- 构建的请求
-