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 }
-
Object that represents a Linphone Account. This object replaces the deprecated
ProxyConfig
. Use aAccountParams
object to configure it.Declaration
Swift
public func addDelegate(delegate: AccountDelegate)
-
Object that represents a Linphone Account. This object replaces the deprecated
ProxyConfig
. Use aAccountParams
object to configure it.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. -
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.
-
Get the dependency of a
Account
.Declaration
Swift
public var dependency: Account? { get set }
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.
Declaration
Swift
public var isAvpfEnabled: Bool { get }
Return Value
true if AVPF/SAVPF is enabled, false otherwise.
-
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().Declaration
Swift
public var params: AccountParams? { get set }
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.
-
Retrieve the user pointer associated with the account.
Declaration
Swift
public var userData: UnsafeMutableRawPointer? { get set }
Return Value
The user data.
-
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.
-
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.