Interface AccountParams


public interface AccountParams
Object that is used to set the different parameters of a Account.

Note that authenticated accounts should have a corresponding AuthInfo
added to the Core to register properly.
  • Method Details

    • getAudioVideoConferenceFactoryAddress

      @Nullable Address getAudioVideoConferenceFactoryAddress()
      Get the audio video conference factory uri.

      Returns:
      The Address of the audio video conference factory.
    • setAudioVideoConferenceFactoryAddress

      void setAudioVideoConferenceFactoryAddress(@Nullable Address address)
      Set the audio video conference factory uri.

      Parameters:
      address - The Address to set.
    • getAvpfMode

      AVPFMode getAvpfMode()
      Get enablement status of RTCP feedback (also known as AVPF profile).

      Returns:
      the enablement mode, which can be AVPFMode.Default (use
      LinphoneCore's mode), AVPFMode.Enabled (avpf is enabled), or AVPFMode.Disabled
      (disabled).
    • setAvpfMode

      void setAvpfMode(AVPFMode mode)
      Enable the use of RTCP feedback (also known as AVPF profile).

      Parameters:
      mode - the enablement mode, which can be AVPFMode.Default (use
      LinphoneCore's mode), AVPFMode.Enabled (avpf is enabled), or AVPFMode.Disabled
      (disabled).
    • getAvpfRrInterval

      int getAvpfRrInterval()
      Get the interval between regular RTCP reports when using AVPF/SAVPF.

      Returns:
      The interval in seconds.
    • setAvpfRrInterval

      void setAvpfRrInterval(int interval)
      Set the interval between regular RTCP reports when using AVPF/SAVPF.

      Parameters:
      interval - The interval in seconds (between 0 and 5 seconds).
    • getConferenceFactoryAddress

      @Nullable Address getConferenceFactoryAddress()
      Get the conference factory uri.

      Returns:
      The Address of the conference factory.
    • setConferenceFactoryAddress

      void setConferenceFactoryAddress(@Nullable Address address)
      Set the conference factory uri.

      Parameters:
      address - The Address to set.
    • getConferenceFactoryUri

      @Nullable String getConferenceFactoryUri()
      Get the conference factory uri.

      Returns:
      The uri of the conference factory.
    • setConferenceFactoryUri

      @Deprecated void setConferenceFactoryUri(@Nullable String uri)
      Deprecated.
      Set the conference factory uri.

      Parameters:
      uri - The uri of the conference factory.
    • getContactParameters

      @Nullable String getContactParameters()
      Returns the contact parameters.

      Returns:
      The previously set contact parameters.
    • setContactParameters

      void setContactParameters(@Nullable String contactParams)
      Set optional contact parameters that will be added to the contact information
      sent in the registration.

      Parameters:
      contactParams - A string contaning the additional parameters in text form,
      like "myparam=something;myparam2=something_else"
      The main use case for this function is provide the proxy additional information
      regarding the user agent, like for example unique identifier or apple push id.
      As an example, the contact address in the SIP register sent will look like
      <sip:joe@15.128.128.93:50421>;apple-push-id=43143-DFE23F-2323-FA2232.
    • getContactUriParameters

      @Nullable String getContactUriParameters()
      Return the contact URI parameters.

      Returns:
      The previously set contact URI parameters.
    • setContactUriParameters

      void setContactUriParameters(@Nullable String contactUriParams)
      Set optional contact parameters that will be added to the contact information
      sent in the registration, inside the URI.

      Parameters:
      contactUriParams - A string containing the additional parameters in text
      form, like "myparam=something;myparam2=something_else"
      The main use case for this function is provide the proxy additional information
      regarding the user agent, like for example unique identifier or apple push id.
      As an example, the contact address in the SIP register sent will look like
      <sip:joe@15.128.128.93:50421;apple-push-id=43143-DFE23F-2323-FA2232>.
    • isCpimInBasicChatRoomEnabled

      boolean isCpimInBasicChatRoomEnabled()
      Indicates whether chat messages sent by this account in a {@link ChatRoom#Backend#Basic}
      chat room will be using CPIM format or not.

      By default SIP SIMPLE format is used for "basic" chat rooms, CPIM is only used
      for {@link ChatRoom#Backend#FlexisipChat} chat rooms. see:
      https://wiki.linphone.org/xwiki/wiki/public/view/Lib/Features/Instant%20Messaging/Reply%20to%20a%20specific%20message/
      Returns:
      true if chat messages will be sent out in CPIM format, false if chat
      messages will be sent out as SIP SIMPLE.
    • setCpimInBasicChatRoomEnabled

      void setCpimInBasicChatRoomEnabled(boolean enable)
      Indicates whether chat messages sent by this account in a {@link ChatRoom#Backend#Basic}
      chat room will be using CPIM format or not.

      Parameters:
      enable - true to send messages in CPIM format, false to keep using the SIP
      SIMPLE format.
    • getCustomContact

      @Nullable Address getCustomContact()
      Get the custom contact address previously used when registering to the SIP
      server.

      Returns:
      a Address
    • setCustomContact

      void setCustomContact(@Nullable Address contact)
      Set a an optional custom contact address to be used when registering to the SIP
      server.

      This is typically used to supply an alternative SIP address to call in case the
      main one is not reachable.
      Parameters:
      contact - a Address the optional alternative contact address.
    • isDialEscapePlusEnabled

      boolean isDialEscapePlusEnabled()
      Return whether or not the + should be replaced by 00.

      Returns:
      Whether liblinphone should replace "+" by "00" in dialed numbers
      (passed to Core.invite(java.lang.String)).
    • setDialEscapePlusEnabled

      void setDialEscapePlusEnabled(boolean enable)
      Set whether liblinphone should replace "+" by international calling prefix in
      dialed numbers (passed to linphone_core_invite).

      Parameters:
      enable - true to replace + by the international prefix, false otherwise.
    • getDomain

      @Nullable String getDomain()
      Get the domain name of the given account params.

      Returns:
      The domain name of the account params.
    • getExpires

      int getExpires()
      Get the account params expires.

      Returns:
      The duration of registration.
    • setExpires

      void setExpires(int expires)
      Sets the registration expiration time in seconds.

      Parameters:
      expires - The expiration time to set.
    • getIdentity

      @Deprecated @Nullable String getIdentity()
      Deprecated.
      01/03/2021 Use getIdentityAddress() instead.
      Get the identity of the account params.

      Returns:
      The SIP identity that belongs to this account params.
    • getIdentityAddress

      @Nullable Address getIdentityAddress()
      Get the identity address of the account params.

      Returns:
      The SIP identity that belongs to this account params.
    • setIdentityAddress

      int setIdentityAddress(@Nullable Address identity)
      Sets the user identity as a SIP address.

      This identity is normally formed with display name, username and domain, such
      as: Alice <sip:alice@example.net> The REGISTER messages will have from and to
      set to this identity.
      Parameters:
      identity - The Address of the identity to set.
      Returns:
      0 if successful, -1 otherwise.
    • getIdkey

      @Nullable String getIdkey()
      Get the idkey property of a AccountParams.

      Returns:
      The idkey string, or null.
    • setIdkey

      void setIdkey(@Nullable String idkey)
      Set the idkey property on the given account params.

      This property can the be referenced by another account params 'depends_on' to
      create a dependency relation between them.
      Parameters:
      idkey - The idkey string to associate to the given AccountParams.

    • getInternationalPrefix

      @Nullable String getInternationalPrefix()
      Get the prefix set for this account params.

      Returns:
      The international prefix.
    • setInternationalPrefix

      void setInternationalPrefix(@Nullable String prefix)
      Set an international prefix to be automatically prepended when inviting a
      number with Core.invite(java.lang.String); This international prefix shall usually be the
      country code of the country where the user is living, without "+".

      Parameters:
      prefix - The prefix to set (withouth the +).
    • isPushNotificationAvailable

      boolean isPushNotificationAvailable()
      Gets whether push notifications are available or not (Android & iOS only).

      Returns:
      true if push notifications are available, false otherwise
    • getLimeServerUrl

      @Nullable String getLimeServerUrl()
      Get the x3dh server url.

      Returns:
      The x3dh server url.
    • setLimeServerUrl

      void setLimeServerUrl(@Nullable String url)
      Set the x3dh server url.

      If empty, this function will disable LIME X3DH from core. Otherwise, or if
      different from the existing value, this will (re-)initialize the LIME X3DH
      engine.
      Parameters:
      url - The x3dh server url.
    • getNatPolicy

      @Nullable NatPolicy getNatPolicy()
      Get The policy that is used to pass through NATs/firewalls when using this
      account params.

      If it is set to null, the default NAT policy from the core will be used
      instead.
      Returns:
      The NatPolicy object in use.
      see: Core.getNatPolicy()
    • setNatPolicy

      void setNatPolicy(@Nullable NatPolicy policy)
      Set the policy to use to pass through NATs/firewalls when using this account
      params.

      If it is set to null, the default NAT policy from the core will be used
      instead.
      Parameters:
      policy - The NatPolicy object.
      see: Core.setNatPolicy(org.linphone.core.NatPolicy)
    • isOutboundProxyEnabled

      boolean isOutboundProxyEnabled()
      Tell if the proxy is used as the only route.

      Returns:
      enable true if enabled, false otherwise.
    • setOutboundProxyEnabled

      void setOutboundProxyEnabled(boolean enable)
      If enabled, the proxy will be used as the only route.

      Parameters:
      enable - true to enable, false otherwise.
    • getPictureUri

      @Nullable String getPictureUri()
      Gets the account picture URI if set, null otherwise.

      Returns:
      The account picture URI.
    • setPictureUri

      void setPictureUri(@Nullable String uri)
      Sets an URI for the account picture.

      Parameters:
      uri - The account picture URI.
    • getPrivacy

      int getPrivacy()
      Get default privacy policy for all calls routed through this proxy.

      Returns:
      Privacy mode as LinphonePrivacyMask
    • setPrivacy

      void setPrivacy(int privacy)
      Set default privacy policy for all calls routed through this proxy.

      Parameters:
      privacy - Privacy to configure privacy
    • isPublishEnabled

      boolean isPublishEnabled()
      Tell if the PUBLISH is enabled.

      Returns:
      true if PUBLISH request is enabled for this proxy.
    • setPublishEnabled

      void setPublishEnabled(boolean enable)
      Indicates either or not, PUBLISH must be issued for this AccountParams.

      Parameters:
      enable - If true, publish will be engaged.
    • getPublishExpires

      int getPublishExpires()
      Get the publish expiration time in second.

      Default value is the registration expiration value.
      Returns:
      The expire time in seconds.
    • setPublishExpires

      void setPublishExpires(int expires)
      Set the publish expiration time in second.

      Parameters:
      expires - The expire time in seconds.
    • getPushNotificationAllowed

      boolean getPushNotificationAllowed()
      Indicates whether to add to the contact parameters the push notification
      information.

      For IOS, it indicates for VOIP push notification.
      Returns:
      true if push notification informations should be added, false
      otherwise.
    • setPushNotificationAllowed

      void setPushNotificationAllowed(boolean allow)
      Indicates whether to add to the contact parameters the push notification
      information.

      For IOS, it indicates for VOIP push notification.
      Parameters:
      allow - true to allow push notification information, false otherwise.
    • getPushNotificationConfig

      @NonNull PushNotificationConfig getPushNotificationConfig()
      Returns the push notification configuration.

      Returns:
      The PushNotificationConfig object.
    • setPushNotificationConfig

      void setPushNotificationConfig(@NonNull PushNotificationConfig config)
      Sets the push notification configuration.

      Parameters:
      config - The PushNotificationConfig object.
    • getQualityReportingCollector

      @Nullable String getQualityReportingCollector()
      Get the route of the collector end-point when using quality reporting.

      This SIP address should be used on server-side to process packets directly
      before discarding packets. Collector address should be a non existing account
      and will not receive any messages. If null, reports will be send to the proxy
      domain.
      Returns:
      The SIP address of the collector end-point.
    • setQualityReportingCollector

      void setQualityReportingCollector(@Nullable String collector)
      Set the route of the collector end-point when using quality reporting.

      This SIP address should be used on server-side to process packets directly
      before discarding packets. Collector address should be a non existing account
      and will not receive any messages. If null, reports will be send to the proxy
      domain.
      Parameters:
      collector - route of the collector end-point, if null PUBLISH will be sent
      to the proxy domain.
    • isQualityReportingEnabled

      boolean isQualityReportingEnabled()
      Indicates whether quality statistics during call should be stored and sent to a
      collector according to RFC 6035.

      Returns:
      true if quality repotring is enabled, false otherwise.
    • setQualityReportingEnabled

      void setQualityReportingEnabled(boolean enable)
      Indicates whether quality statistics during call should be stored and sent to a
      collector according to RFC 6035.

      Parameters:
      enable - true to store quality statistics and send them to the collector,
      false to disable it.
    • getQualityReportingInterval

      int getQualityReportingInterval()
      Get the interval between interval reports when using quality reporting.

      Returns:
      The interval in seconds, 0 means interval reports are disabled.
    • setQualityReportingInterval

      void setQualityReportingInterval(int interval)
      Set the interval between 2 interval reports sending when using quality
      reporting.

      If call exceed interval size, an interval report will be sent to the collector.
      On call termination, a session report will be sent for the remaining period.
      Value must be 0 (disabled) or positive.
      Parameters:
      interval - The interval in seconds, 0 means interval reports are disabled.
    • getRealm

      @Nullable String getRealm()
      Get the realm of the given account params.

      Returns:
      The realm of the account params.
    • setRealm

      void setRealm(@Nullable String realm)
      Set the realm of the given account params.

      Parameters:
      realm - New realm value.
    • getRefKey

      @Nullable String getRefKey()
      Get the persistent reference key associated to the account params.

      The reference key can be for example an id to an external database. It is
      stored in the config file, thus can survive to process exits/restarts.
      Returns:
      The reference key string that has been associated to the account
      params, or null if none has been associated.
    • setRefKey

      void setRefKey(@Nullable String refkey)
      Associate a persistent reference key to the account params.

      The reference key can be for example an id to an external database. It is
      stored in the config file, thus can survive to process exits/restarts.
      Parameters:
      refkey - The reference key string to associate to the account params.
    • isRegisterEnabled

      boolean isRegisterEnabled()
      Returns whether the account params is enabled or not.

      Returns:
      true if registration to the proxy is enabled.
    • setRegisterEnabled

      void setRegisterEnabled(boolean enable)
      Indicates either or not, REGISTRATION must be issued for this AccountParams
      .

      Parameters:
      enable - If true, registration will be engaged.
    • getRemotePushNotificationAllowed

      boolean getRemotePushNotificationAllowed()
      Indicates whether to add to the contact parameters the push notification
      information.

      Returns:
      true if remote push notification informations should be added, false
      otherwise.
    • setRemotePushNotificationAllowed

      void setRemotePushNotificationAllowed(boolean allow)
      Indicates whether to add to the contact parameters the push notification
      information.

      Parameters:
      allow - true to allow remote push notification information, false
      otherwise.
    • getRoutesAddresses

      @NonNull Address[] getRoutesAddresses()
      Gets the list of the routes set for this account params.

      warning: If linphone_account_params_is_outbound_proxy_enabled is true then it
      will only return the proxy address.
      Returns:
      The list of routes.
    • setRoutesAddresses

      int setRoutesAddresses(@Nullable Address[] routes)
      Sets a list of SIP route.

      When a route is set, all outgoing calls will go to the route's destination if
      this account is the default one (see Core.setDefaultAccount(org.linphone.core.Account)).
      warning: This function cannot be used if
      linphone_account_params_is_outbound_proxy_enabled is true.
      Parameters:
      routes - A list of routes.
      Returns:
      -1 if routes are invalid, 0 otherwise.
    • isRtpBundleAssumptionEnabled

      boolean isRtpBundleAssumptionEnabled()
      Returns whether RTP bundle mode is assumed.

      See https://datatracker.ietf.org/doc/html/rfc8843 for more information.
      Returns:
      a boolean indicating when rtp bundle support is assumed.
    • setRtpBundleAssumptionEnabled

      void setRtpBundleAssumptionEnabled(boolean value)
      Indicates whether support of rtp bundle is assumed.

      See #enableRtpBundle for background information about rtp bundle.
      Assumption that RTP bundling support allows interesting optimizations, such as
      not gathering RTCP candidates, and not gathering candidates for video stream
      when making an outgoing call. This setting is meaningful only if rtp bundle is
      enabled. See https://datatracker.ietf.org/doc/html/rfc8843 for more information
      about the feature.
      Parameters:
      value - a boolean to indicate whether RTP bundle support can be assumed.
    • isRtpBundleEnabled

      boolean isRtpBundleEnabled()
      Returns whether RTP bundle mode (also known as Media Multiplexing) is enabled.

      See https://datatracker.ietf.org/doc/html/rfc8843 for more information.
      Returns:
      a boolean indicating the enablement of rtp bundle mode.
    • setRtpBundleEnabled

      void setRtpBundleEnabled(boolean value)
      Enables or disables RTP bundle mode (Media Multiplexing).

      See https://datatracker.ietf.org/doc/html/rfc8843 for more information about
      the feature. When enabled, liblinphone will try to negociate the use of a
      single port for all streams when doing an outgoing call. It automatically
      enables rtcp-mux.
      Parameters:
      value - a boolean to indicate whether the feature is to be enabled.
    • getServerAddr

      @Deprecated @Nullable String getServerAddr()
      Deprecated.
      01/03/2021 Use getServerAddress() instead.
      Get the account params proxy address.

      Returns:
      The proxy's SIP address.
    • setServerAddr

      @Deprecated int setServerAddr(@Nullable String serverAddress)
      Deprecated.
      Sets the proxy address.

      Examples of valid sip proxy address are:
      Parameters:
      serverAddress - The proxy address to set.
      Returns:
      0 if successful, -1 otherwise.
    • getServerAddress

      @Nullable Address getServerAddress()
      Get the account params proxy address.

      Returns:
      The proxy's SIP Address.
    • setServerAddress

      int setServerAddress(@Nullable Address serverAddress)
      Sets the proxy address.

      Examples of valid sip proxy address are:
      Parameters:
      serverAddress - The proxy as Address to set.
      Returns:
      0 if successful, -1 otherwise.
    • getTransport

      TransportType getTransport()
      Returns the transport type of the server address.

      Returns:
      The TransportType of the server address.
    • setTransport

      void setTransport(TransportType transport)
      Sets the transport type of the server address.

      Parameters:
      transport - The TransportType to set.
    • getUseInternationalPrefixForCallsAndChats

      boolean getUseInternationalPrefixForCallsAndChats()
      Return whether or not the international prefix will automaticaly be used for
      calls and chats.

      Returns:
      Whether we should use international prefix automatically for calls.
    • setUseInternationalPrefixForCallsAndChats

      void setUseInternationalPrefixForCallsAndChats(boolean enable)
      If enabled, the international prefix will automaticaly be used for calls and
      chats.

      Parameters:
      enable - true to use the international prefix for calls, false otherwise.
    • addCustomParam

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

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

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

      Returns:
      The newly created AccountParams object.
    • getCustomParam

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

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

      @NonNull AccountParams newWithConfig(@NonNull Core lc, int index)
      Create a new AccountParams object from a configuration.

      Parameters:
      lc - The Core object.
      index - The index of the configuration.
      Returns:
      The newly created AccountParams object.
    • 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