Interface ErrorInfo


public interface ErrorInfo
Object representing full details about a signaling error or status.

All ErrorInfo object returned by the liblinphone API are readonly and
transcients. For safety they must be used immediately after obtaining them. Any
other function call to the liblinphone may change their content or invalidate
the pointer.
  • Method Details

    • getPhrase

      @Nullable String getPhrase()
      Get textual phrase from the error info.

      This is the text that is provided by the peer in the protocol (SIP).
      Returns:
      The error phrase
    • setPhrase

      void setPhrase(@Nullable String phrase)
      Assign phrase to a ErrorInfo object.

      Parameters:
      phrase - the phrase explaining the error
    • getProtocol

      @Nullable String getProtocol()
      Get protocol from the error info.

      Returns:
      The protocol.
    • setProtocol

      void setProtocol(@Nullable String protocol)
      Assign protocol name to a ErrorInfo object.

      Parameters:
      protocol - the protocol name
    • getProtocolCode

      int getProtocolCode()
      Get the status code from the low level protocol (ex a SIP status code).

      Returns:
      The status code
    • setProtocolCode

      void setProtocolCode(int code)
      Assign protocol code to a ErrorInfo object.

      Parameters:
      code - the protocol code
    • getReason

      Reason getReason()
      Get reason code from the error info.

      Returns:
      A Reason object
    • setReason

      void setReason(Reason reason)
      Assign reason Reason to a ErrorInfo object.

      Parameters:
      reason - reason from Reason enum
    • getRetryAfter

      int getRetryAfter()
      Get Retry-After delay second from the error info.

      Returns:
      The Retry-After delay second
    • setRetryAfter

      void setRetryAfter(int retryAfter)
      Assign retry-after value to a ErrorInfo object.

      Parameters:
      retryAfter - the retry-after value
    • getSubErrorInfo

      @Nullable ErrorInfo getSubErrorInfo()
      Get pointer to chained ErrorInfo set in sub_ei.

      It corresponds to a Reason header in a received SIP response.
      Returns:
      ErrorInfo pointer defined in the ei object.
    • setSubErrorInfo

      void setSubErrorInfo(@Nullable ErrorInfo appendedErrorInfo)
      Set the sub_ei in ErrorInfo to another ErrorInfo.

      Used when a reason header is to be added in a SIP response. The first level
      ErrorInfo defines the SIP response code and phrase, the second (sub)
      #LinphoneErroInfo defining the content of the Reason header.
      Parameters:
      appendedErrorInfo - ErrorInfo to append
    • getWarnings

      @Nullable String getWarnings()
      Provides additional information regarding the failure.

      With SIP protocol, the content of "Warning" headers are returned.
      Returns:
      More details about the failure.
    • setWarnings

      void setWarnings(@Nullable String warnings)
      Assign warnings to a ErrorInfo object.

      Parameters:
      warnings - the warnings
    • set

      void set(@Nullable String protocol, Reason reason, int code, @Nullable String status, @Nullable String warning)
      Assign information to a ErrorInfo object.

      Parameters:
      protocol - protocol name
      reason - reason from Reason enum
      code - protocol code
      status - description of the reason
      warning - warning message
    • setUserData

      void setUserData(Object data)
      Sets the object to store in this object user's data
      Parameters:
      data - the object to store
    • getUserData

      Object getUserData()
      Gets the object stored in this object user's data
      Returns:
      the object store if any, null otherwise
    • getNativePointer

      long getNativePointer()
      Gets the native pointer used by this class to make native method calls.
      Returns:
      the nativer pointer, as long
    • toString

      String toString()
      Overrides:
      toString in class Object