Class SipUtils
java.lang.Object
io.github.lunasaw.sip.common.utils.SipUtils
- Author:
- luna
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
generateGB28181Code
(int centerCode, int industryCode, int typeCode, int serialNumber) static String
static String
getCallId
(gov.nist.javax.sip.message.SIPRequest request) static String
getCallId
(javax.sip.RequestEvent requestEvent) static <T> T
static RemoteAddressInfo
getRemoteAddressFromRequest
(gov.nist.javax.sip.message.SIPRequest request) static RemoteAddressInfo
getRemoteAddressFromRequest
(gov.nist.javax.sip.message.SIPRequest request, boolean sipUseSourceIpAsRemoteAddress) 从请求中获取设备ip地址和端口号static SipTransaction
getSipTransaction
(gov.nist.javax.sip.message.SIPRequest request) static SipTransaction
getSipTransaction
(gov.nist.javax.sip.message.SIPResponse response) static String
getSubjectId
(javax.sip.message.Request request) 从subject读取channelIdstatic String
getUser
(javax.sip.message.Request request) static String
getUserIdFromFromHeader
(javax.sip.message.Request request) static String
getUserIdFromFromHeader
(javax.sip.message.Response response) static String
getUserIdFromHeader
(javax.sip.header.HeaderAddress headerAddress) static String
getUserIdFromToHeader
(javax.sip.message.Request request) static String
getUserIdFromToHeader
(javax.sip.message.Response response) static String
parseRequest
(javax.sip.RequestEvent event, String charset) static <T> T
parseRequest
(javax.sip.RequestEvent event, String charset, Class<T> clazz) static <T> T
parseResponse
(javax.sip.ResponseEvent evt, Class<T> tClass) static <T> T
parseResponse
(javax.sip.ResponseEvent evt, String charset, Class<T> clazz) static SdpSessionDescription
-
Constructor Details
-
SipUtils
public SipUtils()
-
-
Method Details
-
getUserIdFromToHeader
-
getUserIdFromFromHeader
-
getUserIdFromToHeader
-
getUserIdFromFromHeader
-
getUser
-
getSipTransaction
-
getSipTransaction
-
getUserIdFromHeader
-
getCallId
-
getCallId
-
getRemoteAddressFromRequest
public static RemoteAddressInfo getRemoteAddressFromRequest(gov.nist.javax.sip.message.SIPRequest request) -
getSubjectId
从subject读取channelId -
getRemoteAddressFromRequest
public static RemoteAddressInfo getRemoteAddressFromRequest(gov.nist.javax.sip.message.SIPRequest request, boolean sipUseSourceIpAsRemoteAddress) 从请求中获取设备ip地址和端口号- Parameters:
request
- 请求sipUseSourceIpAsRemoteAddress
- false 从via中获取地址, true 直接获取远程地址- Returns:
- 地址信息
-
generateGB28181Code
public static String generateGB28181Code(int centerCode, int industryCode, int typeCode, int serialNumber) -
genSsrc
-
parseSdp
-
parseRequest
-
parseRequest
-
getObj
-
parseResponse
-
parseResponse
-