Class SipSender
java.lang.Object
io.github.lunasaw.sip.common.transmit.SipSender
SIP消息发送器(重构版)
使用策略模式和建造者模式,提供简洁的API接口
- Author:
- lin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
SIP请求建造者 提供流式API来构建和发送SIP请求 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
doAckRequest
(FromDevice fromDevice, ToDevice toDevice) 发送ACK请求static String
doAckRequest
(FromDevice fromDevice, ToDevice toDevice, String callId) static String
doAckRequest
(FromDevice fromDevice, ToDevice toDevice, String content, String callId) static String
doAckRequest
(FromDevice fromDevice, ToDevice toDevice, String content, String callId, Event errorEvent, Event okEvent) static String
doAckRequest
(FromDevice fromDevice, javax.sip.address.SipURI sipURI, javax.sip.message.Response sipResponse) static String
doByeRequest
(FromDevice fromDevice, ToDevice toDevice) 发送BYE请求static String
doInfoRequest
(FromDevice fromDevice, ToDevice toDevice, String content) 发送INFO请求static String
doInfoRequest
(FromDevice fromDevice, ToDevice toDevice, String content, Event errorEvent, Event okEvent) static String
doInviteRequest
(FromDevice fromDevice, ToDevice toDevice, String content, Event errorEvent, Event okEvent) static String
doInviteRequest
(FromDevice fromDevice, ToDevice toDevice, String content, String subject) 发送INVITE请求static String
doMessageRequest
(FromDevice fromDevice, ToDevice toDevice, String content) 发送MESSAGE请求static String
doMessageRequest
(FromDevice fromDevice, ToDevice toDevice, String content, Event errorEvent, Event okEvent) static String
doNotifyRequest
(FromDevice fromDevice, ToDevice toDevice, String content) 发送NOTIFY请求static String
doNotifyRequest
(FromDevice fromDevice, ToDevice toDevice, String content, SubscribeInfo subscribeInfo, Event errorEvent, Event okEvent) static String
doNotifyRequest
(FromDevice fromDevice, ToDevice toDevice, String content, Event errorEvent, Event okEvent) static String
doRegisterRequest
(FromDevice fromDevice, ToDevice toDevice, Integer expires) 发送REGISTER请求static String
doRegisterRequest
(FromDevice fromDevice, ToDevice toDevice, Integer expires, Event event) static String
doRegisterRequest
(FromDevice fromDevice, ToDevice toDevice, Integer expires, String callId, Event errorEvent, Event okEvent) static String
doSubscribeRequest
(FromDevice fromDevice, ToDevice toDevice, String content, SubscribeInfo subscribeInfo) 发送SUBSCRIBE请求static String
doSubscribeRequest
(FromDevice fromDevice, ToDevice toDevice, String content, Event errorEvent, Event okEvent) static javax.sip.ServerTransaction
getServerTransaction
(javax.sip.message.Request request) 获取服务器事务(兼容性方法)static javax.sip.ServerTransaction
getServerTransaction
(javax.sip.message.Request request, String ip) static SipSender.SipRequestBuilder
request
(FromDevice fromDevice, ToDevice toDevice, String method) 创建请求建造者static void
transmitRequest
(String ip, javax.sip.message.Message message) 传输消息(兼容性方法)static void
transmitRequest
(String ip, javax.sip.message.Message message, Event errorEvent) static void
transmitRequest
(String ip, javax.sip.message.Message message, Event errorEvent, Event okEvent) static void
transmitRequestSuccess
(String ip, javax.sip.message.Message message, Event okEvent)
-
Constructor Details
-
SipSender
public SipSender()
-
-
Method Details
-
request
public static SipSender.SipRequestBuilder request(FromDevice fromDevice, ToDevice toDevice, String method) 创建请求建造者- Parameters:
fromDevice
- 发送方设备toDevice
- 接收方设备method
- SIP方法- Returns:
- 请求建造者
-
doSubscribeRequest
public static String doSubscribeRequest(FromDevice fromDevice, ToDevice toDevice, String content, SubscribeInfo subscribeInfo) 发送SUBSCRIBE请求 -
doSubscribeRequest
-
doMessageRequest
发送MESSAGE请求 -
doMessageRequest
-
doNotifyRequest
发送NOTIFY请求 -
doNotifyRequest
public static String doNotifyRequest(FromDevice fromDevice, ToDevice toDevice, String content, SubscribeInfo subscribeInfo, Event errorEvent, Event okEvent) -
doNotifyRequest
-
doInviteRequest
public static String doInviteRequest(FromDevice fromDevice, ToDevice toDevice, String content, String subject) 发送INVITE请求 -
doInviteRequest
-
doInfoRequest
发送INFO请求 -
doInfoRequest
-
doByeRequest
发送BYE请求 -
doAckRequest
发送ACK请求 -
doAckRequest
public static String doAckRequest(FromDevice fromDevice, ToDevice toDevice, String content, String callId) -
doAckRequest
-
doAckRequest
-
doAckRequest
public static String doAckRequest(FromDevice fromDevice, javax.sip.address.SipURI sipURI, javax.sip.message.Response sipResponse) -
doRegisterRequest
发送REGISTER请求 -
doRegisterRequest
public static String doRegisterRequest(FromDevice fromDevice, ToDevice toDevice, Integer expires, Event event) -
doRegisterRequest
-
transmitRequest
传输消息(兼容性方法) -
transmitRequest
-
transmitRequestSuccess
-
transmitRequest
-
getServerTransaction
public static javax.sip.ServerTransaction getServerTransaction(javax.sip.message.Request request) 获取服务器事务(兼容性方法) -
getServerTransaction
public static javax.sip.ServerTransaction getServerTransaction(javax.sip.message.Request request, String ip)
-