Account
public class Account : LinphoneObject
Object that represents a Linphone Account.
This object replaces the deprecated ProxyConfig
. Use a AccountParams
object
to configure it.
-
Undocumented
Declaration
Swift
public static func getSwiftObject(cObject: OpaquePointer) -> Account
-
Undocumented
Declaration
Swift
public var getCobject: OpaquePointer? { get }
-
Undocumented
Declaration
Swift
public func addDelegate(delegate: AccountDelegate)
-
Undocumented
Declaration
Swift
public func removeDelegate(delegate: AccountDelegate)
-
Create a new
Account
with a Proxy config backpointer. This is only intended to be used while keeping a backward compatibility with proxy config.Declaration
Swift
public static func newWithConfig(lc: Core?, params: AccountParams, config: ProxyConfig?) -> Account?
Parameters
lc
The
Core
object.params
The
AccountParams
object.config
The
ProxyConfig
object.Return Value
The newly created
Account
object. -
Indicates whether AVPF/SAVPF is being used for calls using this account.
Declaration
Swift
public var avpfEnabled: Bool { get }
Return Value
true if AVPF/SAVPF is enabled, false otherwise.
-
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.
Declaration
Swift
public var contactAddress: Address? { get set }
Parameters
addr
a
Address
to use as contact.
Return the contact address of the account.Return Value
a
Address
correspong to the contact address of the account. -
Gets the current LinphoneAccountCbs. This is meant only to be called from a callback to be able to get the user_data associated with the LinphoneAccountCbs that is calling the callback.
Declaration
Swift
public var currentDelegate: AccountDelegate? { get }
Return Value
The LinphoneAccountCbs that has called the last callback.
-
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
See also: AccountParams.setIdkey() 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 coreDeclaration
Swift
public var dependency: Account? { get set }
Parameters
dependsOn
The
Account
this one shall be depending on.
Get the dependency of aAccount
.Return Value
The account this one is dependent upon, or nil if not marked dependent.
-
Indicates whether AVPF/SAVPF is being used for calls using this account.
- deprecated: 16/12/2021 Use avpfEnabled() instead.
Declaration
Swift
@available(*, deprecated) public var isAvpfEnabled: Bool { get }
Return Value
true if AVPF/SAVPF is enabled, false otherwise.
-
Set the
AccountParams
used by thisAccount
.Declaration
Swift
public var params: AccountParams? { get set }
Parameters
params
The
AccountParams
object.
Get theAccountParams
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().Return Value
The
AccountParams
attached to this account. -
Get the registration state of the given account.
Declaration
Swift
public var state: RegistrationState { get }
Return Value
The
RegistrationState
of the account. -
Get the transport from either service route, route or addr.
- deprecated: 01/03/2021 Use Linphone_account_params_get_transport() instead.
Declaration
Swift
@available(*, deprecated) public var transport: TransportType { get }
Return Value
The transport as a string (I.E udp, tcp, tls, dtls).
-
Return the unread chat message count for a given account.
Declaration
Swift
public var unreadChatMessageCount: Int { get }
Return Value
The unread chat message count.
-
Assign a user pointer to the account.
Declaration
Swift
public var userData: UnsafeMutableRawPointer? { get set }
Parameters
userData
The user data.
Retrieve the user pointer associated with the account.Return Value
The user data.
-
Set one custom parameter to this
Account
.Declaration
Swift
public func addCustomParam(key: String, value: String)
Parameters
key
key of the searched parameter.
value
value of the searched parameter.
-
Instantiate a new account with values from source.
Declaration
Swift
public func clone() -> Account?
Return Value
The newly created
Account
object. -
Obtain the value of a header sent by the server in last answer to REGISTER.
Declaration
Swift
public func getCustomHeader(headerName: String) -> String
Parameters
headerName
The header name for which to fetch corresponding value.
Return Value
The value of the queried header.
-
Get the custom parameter with key to this
Account
.Declaration
Swift
public func getCustomParam(key: String) -> String
Parameters
key
key of the searched parameter.
Return Value
The value of the parameter with key if found or an empty string otherwise
-
Detect if the given input is a phone number or not.
Declaration
Swift
public func isPhoneNumber(username: String) -> Bool
Parameters
username
The string to parse.
Return Value
true if input is a phone number, false otherwise.
-
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.Declaration
Swift
public func normalizePhoneNumber(username: String) -> String
Parameters
username
The string to parse.
Return Value
nil if input is an invalid phone number, normalized phone number from username input otherwise.
-
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.
Declaration
Swift
public func normalizeSipUri(username: String) -> Address?
Parameters
username
The string to parse.
Return Value
nil if invalid input, normalized sip address otherwise.
-
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().
Declaration
Swift
public func pauseRegister()
-
Refresh a proxy registration. This is useful if for example you resuming from suspend, thus IP address may have changed.
Declaration
Swift
public func refreshRegister()
-
Set the value of a custom header sent to the server in REGISTERs request.
Declaration
Swift
public func setCustomHeader(headerName: String, headerValue: String?)
Parameters
headerName
The header name.
headerValue
The header value.