Liblinphone
5.3.0
|
Object that represents a Linphone Account. More...
#include <account.hh>
Public Member Functions | |
LINPHONECXX_PUBLIC | Account (void *ptr, bool takeRef=true) |
LINPHONECXX_PUBLIC _LinphoneAccount * | cPtr () |
LINPHONECXX_PUBLIC void | addListener (const std::shared_ptr< AccountListener > &listener) |
Add an application listener to the Account instance. More... | |
LINPHONECXX_PUBLIC void | removeListener (const std::shared_ptr< AccountListener > &listener) |
Remove a previously added listener from the Account instance. More... | |
LINPHONECXX_PUBLIC bool | avpfEnabled () |
Indicates whether AVPF/SAVPF is being used for calls using this account. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::CallLog > > | getCallLogs () const |
Returns the list of call logs for a given account. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::ChatRoom > > | getChatRooms () const |
Returns the list of chat rooms for a given account. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::ConferenceInfo > > | getConferenceInformationList () const |
Returns the list of conference information for a given account. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Address > | getContactAddress () |
Return the contact address of the account. More... | |
LINPHONECXX_PUBLIC void | setContactAddress (const std::shared_ptr< const linphone::Address > &addr) |
Set the contact address for the account. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Core > | getCore () |
Get the Core object to which is associated the Account. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Account > | getDependency () |
Get the dependency of a Account. More... | |
LINPHONECXX_PUBLIC void | setDependency (const std::shared_ptr< linphone::Account > &dependsOn) |
Mark this account as being dependent on the given one. More... | |
LINPHONECXX_PUBLIC linphone::Reason | getError () |
Get the reason why registration failed when the account state is LinphoneRegistrationFailed. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::ErrorInfo > | getErrorInfo () |
Get detailed information why registration failed when the account state is LinphoneRegistrationFailed. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool | isAvpfEnabled () |
Indicates whether AVPF/SAVPF is being used for calls using this account. More... | |
LINPHONECXX_PUBLIC int | getMissedCallsCount () const |
Returns the missed calls count for a given account. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::AccountParams > | getParams () const |
Get the AccountParams as read-only object. More... | |
LINPHONECXX_PUBLIC int | setParams (const std::shared_ptr< linphone::AccountParams > ¶ms) |
Set the AccountParams used by this Account. More... | |
LINPHONECXX_PUBLIC linphone::RegistrationState | getState () |
Get the registration state of the given account. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED linphone::TransportType | getTransport () |
Get the transport from either service route, route or addr. More... | |
LINPHONECXX_PUBLIC int | getUnreadChatMessageCount () const |
Returns the unread chat message count for a given account. More... | |
LINPHONECXX_PUBLIC void | addCustomParam (const std::string &key, const std::string &value) |
Set one custom parameter to this Account. More... | |
LINPHONECXX_PUBLIC void | clearCallLogs () const |
Deletes all the call logs related to this account from the database. | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Account > | clone () const |
Instantiate a new account with values from source. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::AuthInfo > | findAuthInfo () |
Find authentication info matching account, if any, similarly to linphone_core_find_auth_info. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::CallLog > > | getCallLogsForAddress (const std::shared_ptr< const linphone::Address > &remoteAddress) const |
Returns the list of call logs for a given account. More... | |
LINPHONECXX_PUBLIC std::string | getCustomHeader (const std::string &headerName) |
Obtain the value of a header sent by the server in last answer to REGISTER. More... | |
LINPHONECXX_PUBLIC std::string | getCustomParam (const std::string &key) const |
Get the custom parameter with key to this Account. More... | |
LINPHONECXX_PUBLIC bool | isPhoneNumber (const std::string &username) const |
Detect if the given input is a phone number or not. More... | |
LINPHONECXX_PUBLIC std::string | normalizePhoneNumber (const std::string &username) const |
Normalize a human readable phone number into a basic string. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Address > | normalizeSipUri (const std::string &username) |
Normalize a human readable sip uri into a fully qualified LinphoneAddress. More... | |
LINPHONECXX_PUBLIC void | pauseRegister () |
Prevent an account from refreshing its registration. More... | |
LINPHONECXX_PUBLIC void | refreshRegister () |
Refresh a proxy registration. More... | |
LINPHONECXX_PUBLIC void | resetMissedCallsCount () |
Re-sets the number of missed calls for this account to 0. | |
LINPHONECXX_PUBLIC void | setCustomHeader (const std::string &headerName, const std::string &headerValue) |
Set the value of a custom header sent to the server in REGISTERs request. More... | |
Static Public Member Functions | |
static LINPHONECXX_PUBLIC std::shared_ptr< linphone::Account > | newWithConfig (const std::shared_ptr< linphone::Core > &lc, const std::shared_ptr< linphone::AccountParams > ¶ms, const std::shared_ptr< linphone::ProxyConfig > &config) |
Create a new Account with a Proxy config backpointer. More... | |
Object that represents a Linphone Account.
This object replaces the deprecated ProxyConfig. Use a AccountParams object to configure it.
LINPHONECXX_PUBLIC void linphone::Account::addCustomParam | ( | const std::string & | key, |
const std::string & | value | ||
) |
Set one custom parameter to this Account.
key | key of the searched parameter. |
value | value of the searched parameter. |
LINPHONECXX_PUBLIC void linphone::Account::addListener | ( | const std::shared_ptr< AccountListener > & | listener | ) |
Add an application listener to the Account instance.
listener | the application listener |
LINPHONECXX_PUBLIC bool linphone::Account::avpfEnabled | ( | ) |
Indicates whether AVPF/SAVPF is being used for calls using this account.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Account> linphone::Account::clone | ( | ) | const |
Instantiate a new account with values from source.
LINPHONECXX_PUBLIC std::shared_ptr<const linphone::AuthInfo> linphone::Account::findAuthInfo | ( | ) |
Find authentication info matching account, if any, similarly to linphone_core_find_auth_info.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::CallLog> > linphone::Account::getCallLogs | ( | ) | const |
Returns the list of call logs for a given account.
This list must be freed after use.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::CallLog> > linphone::Account::getCallLogsForAddress | ( | const std::shared_ptr< const linphone::Address > & | remoteAddress | ) | const |
Returns the list of call logs for a given account.
This list must be freed after use.
remoteAddress | the Address object to filter call logs. |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::ChatRoom> > linphone::Account::getChatRooms | ( | ) | const |
Returns the list of chat rooms for a given account.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::ConferenceInfo> > linphone::Account::getConferenceInformationList | ( | ) | const |
Returns the list of conference information for a given account.
This list must be freed after use.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Address> linphone::Account::getContactAddress | ( | ) |
Return the contact address of the account.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::Account::getCore | ( | ) |
LINPHONECXX_PUBLIC std::string linphone::Account::getCustomHeader | ( | const std::string & | headerName | ) |
Obtain the value of a header sent by the server in last answer to REGISTER.
headerName | The header name for which to fetch corresponding value. |
LINPHONECXX_PUBLIC std::string linphone::Account::getCustomParam | ( | const std::string & | key | ) | const |
Get the custom parameter with key to this Account.
key | key of the searched parameter. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Account> linphone::Account::getDependency | ( | ) |
Get the dependency of a Account.
LINPHONECXX_PUBLIC linphone::Reason linphone::Account::getError | ( | ) |
Get the reason why registration failed when the account state is LinphoneRegistrationFailed.
LINPHONECXX_PUBLIC std::shared_ptr<const linphone::ErrorInfo> linphone::Account::getErrorInfo | ( | ) |
Get detailed information why registration failed when the account state is LinphoneRegistrationFailed.
LINPHONECXX_PUBLIC int linphone::Account::getMissedCallsCount | ( | ) | const |
Returns the missed calls count for a given account.
LINPHONECXX_PUBLIC std::shared_ptr<const linphone::AccountParams> linphone::Account::getParams | ( | ) | const |
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().
LINPHONECXX_PUBLIC linphone::RegistrationState linphone::Account::getState | ( | ) |
Get the registration state of the given account.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED linphone::TransportType linphone::Account::getTransport | ( | ) |
Get the transport from either service route, route or addr.
LINPHONECXX_PUBLIC int linphone::Account::getUnreadChatMessageCount | ( | ) | const |
Returns the unread chat message count for a given account.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool linphone::Account::isAvpfEnabled | ( | ) |
Indicates whether AVPF/SAVPF is being used for calls using this account.
LINPHONECXX_PUBLIC bool linphone::Account::isPhoneNumber | ( | const std::string & | username | ) | const |
Detect if the given input is a phone number or not.
username | The string to parse. |
|
static |
Create a new Account with a Proxy config backpointer.
This is only intended to be used while keeping a backward compatibility with proxy config.
lc | The Core object. |
params | The AccountParams object. |
config | The ProxyConfig object. |
LINPHONECXX_PUBLIC std::string linphone::Account::normalizePhoneNumber | ( | const std::string & | username | ) | const |
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.
username | The string to parse. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Address> linphone::Account::normalizeSipUri | ( | const std::string & | username | ) |
Normalize a human readable sip uri into a fully qualified LinphoneAddress.
A sip address should look like DisplayName <sip:username:port> . Basically this function performs the following tasks The result is a syntactically correct SIP address.
username | The string to parse. |
LINPHONECXX_PUBLIC void linphone::Account::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().
LINPHONECXX_PUBLIC void linphone::Account::refreshRegister | ( | ) |
Refresh a proxy registration.
This is useful if for example you resuming from suspend, thus IP address may have changed.
LINPHONECXX_PUBLIC void linphone::Account::removeListener | ( | const std::shared_ptr< AccountListener > & | listener | ) |
Remove a previously added listener from the Account instance.
listener | the application listener |
LINPHONECXX_PUBLIC void linphone::Account::setContactAddress | ( | const std::shared_ptr< const linphone::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.
addr | a Address to use as contact. |
LINPHONECXX_PUBLIC void linphone::Account::setCustomHeader | ( | const std::string & | headerName, |
const std::string & | headerValue | ||
) |
Set the value of a custom header sent to the server in REGISTERs request.
headerName | The header name. |
headerValue | The header value. |
LINPHONECXX_PUBLIC void linphone::Account::setDependency | ( | const std::shared_ptr< linphone::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.
dependsOn | The Account this one shall be depending on. |
LINPHONECXX_PUBLIC int linphone::Account::setParams | ( | const std::shared_ptr< linphone::AccountParams > & | params | ) |
Set the AccountParams used by this Account.
params | The AccountParams object. |