Class SipUtils

java.lang.Object
io.github.lunasaw.sip.common.utils.SipUtils

public class SipUtils extends Object
Author:
luna
  • Constructor Details

    • SipUtils

      public SipUtils()
  • Method Details

    • getUserIdFromToHeader

      public static String getUserIdFromToHeader(javax.sip.message.Response response)
    • getUserIdFromFromHeader

      public static String getUserIdFromFromHeader(javax.sip.message.Response response)
    • getUserIdFromToHeader

      public static String getUserIdFromToHeader(javax.sip.message.Request request)
    • getUserIdFromFromHeader

      public static String getUserIdFromFromHeader(javax.sip.message.Request request)
    • getUser

      public static String getUser(javax.sip.message.Request request)
    • getSipTransaction

      public static SipTransaction getSipTransaction(gov.nist.javax.sip.message.SIPResponse response)
    • getSipTransaction

      public static SipTransaction getSipTransaction(gov.nist.javax.sip.message.SIPRequest request)
    • getUserIdFromHeader

      public static String getUserIdFromHeader(javax.sip.header.HeaderAddress headerAddress)
    • getCallId

      public static String getCallId(javax.sip.RequestEvent requestEvent)
    • getCallId

      public static String getCallId(gov.nist.javax.sip.message.SIPRequest request)
    • getRemoteAddressFromRequest

      public static RemoteAddressInfo getRemoteAddressFromRequest(gov.nist.javax.sip.message.SIPRequest request)
    • getSubjectId

      public static String getSubjectId(javax.sip.message.Request request)
      从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

      public static String genSsrc(String userId)
    • parseSdp

      public static SdpSessionDescription parseSdp(String sdpStr)
    • parseRequest

      public static <T> T parseRequest(javax.sip.RequestEvent event, String charset, Class<T> clazz)
    • parseRequest

      public static String parseRequest(javax.sip.RequestEvent event, String charset)
    • getObj

      public static <T> T getObj(String charset, Class<T> clazz, byte[] rawContent)
    • parseResponse

      public static <T> T parseResponse(javax.sip.ResponseEvent evt, Class<T> tClass)
    • parseResponse

      public static <T> T parseResponse(javax.sip.ResponseEvent evt, String charset, Class<T> clazz)