Package org.linphone.core
Interface Account
public interface Account
Object that represents a Linphone Account.
This object replaces the deprecated
object to configure it.
This object replaces the deprecated
ProxyConfig
. Use a AccountParams
object to configure it.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCustomParam
(String key, String value) Set one custom parameter to thisAccount
.void
addListener
(AccountListener listener) void
Deletes all the call logs related to this account from the database.clone()
Instantiate a new account with values from source.Find authentication info matching account, if any, similarly to
linphone_core_find_auth_info.CallLog[]
Returns the list of call logs for a given account.CallLog[]
getCallLogsForAddress
(Address remoteAddress) Returns the list of call logs for a given account.ChatRoom[]
Returns the list of chat rooms for a given account.Returns the list of conference information for a given account.Return the contact address of the account.getCore()
getCustomHeader
(String headerName) Obtain the value of a header sent by the server in last answer to REGISTER.getCustomParam
(String key) Get the custom parameter with key to thisAccount
.Get the dependency of aAccount
.getError()
Get the reason why registration failed when the account state is
LinphoneRegistrationFailed.Get detailed information why registration failed when the account state is
LinphoneRegistrationFailed.int
Returns the missed calls count for a given account.long
Gets the native pointer used by this class to make native method calls.Get theAccountParams
as read-only object.getState()
Get the registration state of the given account.Deprecated.01/03/2021 Use Linphone_account_params_get_transport() instead.int
Returns the unread chat message count for a given account.Gets the object stored in this object user's databoolean
Indicates whether AVPF/SAVPF is being used for calls using this account.boolean
isPhoneNumber
(String username) Detect if the given input is a phone number or not.newWithConfig
(Core lc, AccountParams params, ProxyConfig config) Create a newAccount
with a Proxy config backpointer.normalizePhoneNumber
(String username) Normalize a human readable phone number into a basic string.normalizeSipUri
(String username) Normalize a human readable sip uri into a fully qualified LinphoneAddress.void
Prevent an account from refreshing its registration.void
Refresh a proxy registration.void
removeListener
(AccountListener listener) void
Re-sets the number of missed calls for this account to 0.void
setContactAddress
(Address addr) Set the contact address for the account.void
setCustomHeader
(String headerName, String headerValue) Set the value of a custom header sent to the server in REGISTERs request.void
setDependency
(Account dependsOn) Mark this account as being dependent on the given one.int
setParams
(AccountParams params) Set theAccountParams
used by thisAccount
.void
setUserData
(Object data) Sets the object to store in this object user's datatoString()
-
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
Returns the list of call logs for a given account.
This list must be freed after use.- Returns:
- The list of call logs .
-
getChatRooms
Returns the list of chat rooms for a given account.
- Returns:
- The list of chat rooms .
-
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
Return the contact address of the account.
- Returns:
- a
Address
correspong to the contact address of the account.
-
setContactAddress
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
- aAddress
to use as contact.
-
getCore
-
getDependency
- Returns:
- The account this one is dependent upon, or null if not marked
dependent.
-
setDependency
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
- TheAccount
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
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
Get theAccountParams
as read-only object.
To make changes, clone the returned object usingAccountParams.clone()
method, make your changes on it and apply them using withsetParams(org.linphone.core.AccountParams)
.- Returns:
- The
AccountParams
attached to this account.
-
setParams
- Parameters:
params
- TheAccountParams
object.
-
getState
RegistrationState getState()Get the registration state of the given account.
- Returns:
- The
RegistrationState
of the account.
-
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
- 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
Instantiate a new account with values from source.
- Returns:
- The newly created
Account
object.
-
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
Returns the list of call logs for a given account.
This list must be freed after use.- Parameters:
remoteAddress
- theAddress
object to filter call logs.- Returns:
- The list of filtered call logs .
-
getCustomHeader
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
- Parameters:
key
- key of the searched parameter.- Returns:
- The value of the parameter with key if found or an empty string
otherwise.
-
isPhoneNumber
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
Normalize a human readable phone number into a basic string.
888-444-222 becomes 888444222 or +33888444222 depending on theAccount
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
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
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 newAccount
with a Proxy config backpointer.
This is only intended to be used while keeping a backward compatibility with
proxy config.- Parameters:
lc
- TheCore
object.params
- TheAccountParams
object.config
- TheProxyConfig
object.- Returns:
- The newly created
Account
object.
-
addListener
-
removeListener
-
setUserData
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()
-