Interface Account


public interface Account
Object that represents a Linphone Account.

This object replaces the deprecated ProxyConfig. Use a AccountParams
object to configure it.
  • Method Details

    • isAvpfEnabled

      boolean isAvpfEnabled()
      Indicates whether AVPF/SAVPF is being used for calls using this account.

      Returns:
      true if AVPF/SAVPF is enabled, false otherwise.
    • getCallLogs

      @NonNull CallLog[] getCallLogs()
      Returns the list of call logs for a given account.

      This list must be freed after use.
      Returns:
      The list of call logs .
    • getChatRooms

      @NonNull ChatRoom[] getChatRooms()
      Returns the list of chat rooms for a given account.

      Returns:
      The list of chat rooms .
    • getConferenceInformationList

      @NonNull ConferenceInfo[] getConferenceInformationList()
      Returns the list of conference information for a given account.

      This list must be freed after use.
      Returns:
      The list of call logs .
    • getContactAddress

      @Nullable Address getContactAddress()
      Return the contact address of the account.

      Returns:
      a Address correspong to the contact address of the account.
    • setContactAddress

      void setContactAddress(@Nullable Address addr)
      Set the contact address for the account.

      A client application should not use this function, as the Contact address is
      provided by the registrar in the 200 Ok. This function is mainly intended for
      server applications.
      Parameters:
      addr - a Address to use as contact.
    • getCore

      @NonNull Core getCore()
      Get the Core object to which is associated the Account.

      Returns:
      The Core object to which is associated the Account.
    • getDependency

      @Nullable Account getDependency()
      Get the dependency of a Account.

      Returns:
      The account this one is dependent upon, or null if not marked
      dependent.
    • setDependency

      void setDependency(@Nullable Account dependsOn)
      Mark this account as being dependent on the given one.

      The dependency must refer to an account previously added to the core and which
      idkey property is defined.
      see: AccountParams.setIdkey(java.lang.String)
      The account marked as dependent will wait for successful registration on its
      dependency before triggering its own.
      Once registered, both accounts will share the same contact address (the
      'dependency' one).
      This mecanism must be enabled before the account is added to the core
      Parameters:
      dependsOn - The Account this one shall be depending on.
    • getError

      Reason getError()
      Get the reason why registration failed when the account state is
      LinphoneRegistrationFailed.

      Returns:
      The Reason why registration failed for this account.
    • getErrorInfo

      @NonNull ErrorInfo getErrorInfo()
      Get detailed information why registration failed when the account state is
      LinphoneRegistrationFailed.

      Returns:
      The ErrorInfo explaining why registration failed for this
      account.
    • getMissedCallsCount

      int getMissedCallsCount()
      Returns the missed calls count for a given account.

      Returns:
      The missed calls count.
    • getParams

      @NonNull AccountParams getParams()
      Get the AccountParams as read-only object.

      To make changes, clone the returned object using AccountParams.clone()
      method, make your changes on it and apply them using with setParams(org.linphone.core.AccountParams).
      Returns:
      The AccountParams attached to this account.
    • setParams

      int setParams(@NonNull AccountParams params)
      Set the AccountParams used by this Account.

      Parameters:
      params - The AccountParams object.
    • getState

      RegistrationState getState()
      Get the registration state of the given account.

      Returns:
      The RegistrationState of the account.
    • getTransport

      @Deprecated TransportType getTransport()
      Deprecated.
      01/03/2021 Use Linphone_account_params_get_transport() instead.
      Get the transport from either service route, route or addr.

      Returns:
      The transport as a string (I.E udp, tcp, tls, dtls).
    • getUnreadChatMessageCount

      int getUnreadChatMessageCount()
      Returns the unread chat message count for a given account.

      Returns:
      The unread chat message count.
    • addCustomParam

      void addCustomParam(@NonNull String key, @NonNull String value)
      Set one custom parameter to this Account.

      Parameters:
      key - key of the searched parameter.
      value - value of the searched parameter.
    • clearCallLogs

      void clearCallLogs()
      Deletes all the call logs related to this account from the database.

    • clone

      @NonNull Account clone()
      Instantiate a new account with values from source.

      Returns:
      The newly created Account object.
    • findAuthInfo

      @Nullable AuthInfo findAuthInfo()
      Find authentication info matching account, if any, similarly to
      linphone_core_find_auth_info.

      Returns:
      a AuthInfo matching account criteria if possible, null if
      nothing can be found.
    • getCallLogsForAddress

      @NonNull CallLog[] getCallLogsForAddress(@NonNull Address remoteAddress)
      Returns the list of call logs for a given account.

      This list must be freed after use.
      Parameters:
      remoteAddress - the Address object to filter call logs.
      Returns:
      The list of filtered call logs .
    • getCustomHeader

      @Nullable String getCustomHeader(@NonNull String headerName)
      Obtain the value of a header sent by the server in last answer to REGISTER.

      Parameters:
      headerName - The header name for which to fetch corresponding value.
      Returns:
      The value of the queried header.
    • getCustomParam

      @NonNull String getCustomParam(@NonNull String key)
      Get the custom parameter with key to this Account.

      Parameters:
      key - key of the searched parameter.
      Returns:
      The value of the parameter with key if found or an empty string
      otherwise.
    • isPhoneNumber

      boolean isPhoneNumber(@NonNull String username)
      Detect if the given input is a phone number or not.

      Parameters:
      username - The string to parse.
      Returns:
      true if input is a phone number, false otherwise.
    • normalizePhoneNumber

      @Nullable String normalizePhoneNumber(@NonNull String username)
      Normalize a human readable phone number into a basic string.

      888-444-222 becomes 888444222 or +33888444222 depending on the Account
      object. This function will always generate a normalized username if input is a
      phone number.
      Parameters:
      username - The string to parse.
      Returns:
      null if input is an invalid phone number, normalized phone number from
      username input otherwise.
    • normalizeSipUri

      @Nullable Address normalizeSipUri(@NonNull String username)
      Normalize a human readable sip uri into a fully qualified LinphoneAddress.

      A sip address should look like DisplayName <sip:username@domain:port> .
      Basically this function performs the following tasks
      The result is a syntactically correct SIP address.
      Parameters:
      username - The string to parse.
      Returns:
      null if invalid input, normalized sip address otherwise.
    • pauseRegister

      void pauseRegister()
      Prevent an account from refreshing its registration.

      This is useful to let registrations to expire naturally (or) when the
      application wants to keep control on when refreshes are sent. However,
      linphone_core_set_network_reachable(lc,true) will always request the accounts
      to refresh their registrations. The refreshing operations can be resumed with
      refreshRegister().
    • refreshRegister

      void refreshRegister()
      Refresh a proxy registration.

      This is useful if for example you resuming from suspend, thus IP address may
      have changed.
    • resetMissedCallsCount

      void resetMissedCallsCount()
      Re-sets the number of missed calls for this account to 0.

    • setCustomHeader

      void setCustomHeader(@NonNull String headerName, @Nullable String headerValue)
      Set the value of a custom header sent to the server in REGISTERs request.

      Parameters:
      headerName - The header name.
      headerValue - The header value.
    • newWithConfig

      @NonNull Account newWithConfig(@Nullable Core lc, @NonNull AccountParams params, @Nullable ProxyConfig config)
      Create a new Account with a Proxy config backpointer.

      This is only intended to be used while keeping a backward compatibility with
      proxy config.
      Parameters:
      lc - The Core object.
      params - The AccountParams object.
      config - The ProxyConfig object.
      Returns:
      The newly created Account object.
    • addListener

      void addListener(AccountListener listener)
    • removeListener

      void removeListener(AccountListener listener)
    • 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