Friend
public class Friend : LinphoneObject
This object is used to store a SIP address.
Friend is mainly used to implement an adressbook feature, and are used as
data for the MagicSearch object. If your proxy supports it, you can also use
it to subscribe to presence information.
The objects are stored in a FriendList which are in turn stored inside the
Core. They can be stored inside a database if the path to it is configured,
otherwise they will be lost after the Core is destroyed.
Thanks to the vCard plugin, you can also store more information like phone
numbers, organization, etc…
-
Undocumented
Declaration
Swift
public static func getSwiftObject(cObject: OpaquePointer) -> Friend -
Undocumented
Declaration
Swift
public var getCobject: OpaquePointer? { get } -
Undocumented
Declaration
Swift
public func setAddress(newValue: Address) throws -
Returns the capabilities associated to this friend.
Declaration
Swift
public var capabilities: Int { get }Return Value
an int representing the capabilities of the friend
-
Get the consolidated presence of a friend.
Declaration
Swift
public var consolidatedPresence: ConsolidatedPresence { get }Return Value
The
ConsolidatedPresenceof the friend -
get current subscription policy for this
FriendDeclaration
Swift
public var incSubscribePolicy: SubscribePolicy { get }Return Value
the
SubscribePolicyenum -
Undocumented
Declaration
Swift
public func setIncsubscribepolicy(newValue: SubscribePolicy) throws -
Tells whether we already received presence information for a friend.
Declaration
Swift
public var isPresenceReceived: Bool { get }Return Value
true if presence information has been received for the friend, false otherwise.
-
Get the display name for this friend.
Declaration
Swift
public var name: String { get }Return Value
The display name of this friend.
-
Undocumented
Declaration
Swift
public func setName(newValue: String) throws -
Returns a list of phone numbers for this friend.
Declaration
Swift
public var phoneNumbers: [String] { get }Return Value
A list of phone numbers as string.
-
Get the presence model of a friend.
Declaration
Swift
public var presenceModel: PresenceModel? { get set }Return Value
A
PresenceModelobject, or nil if the friend do not have presence information (in which case he is considered offline). -
Get the reference key of a friend.
Declaration
Swift
public var refKey: String { get set }Return Value
The reference key of the friend.
-
get subscription flag value
Declaration
Swift
public var subscribesEnabled: Bool { get }Return Value
returns true is subscription is activated for this friend
-
Undocumented
Declaration
Swift
public func setSubscribesenabled(newValue: Bool) throws -
Get subscription state of a friend.
Declaration
Swift
public var subscriptionState: SubscriptionState { get }Return Value
the
SubscriptionStateenum -
Retrieve user data associated with friend.
Declaration
Swift
public var userData: UnsafeMutableRawPointer? { get set }Return Value
the user data pointer.
-
Adds a phone number in this friend.
Declaration
Swift
public func addPhoneNumber(phoneNumber: String)Parameters
phoneNumbernumber to add
-
Creates a vCard object associated to this friend if there isn’t one yet and if the full name is available, either by the parameter or the one in the friend’s SIP URI.
Declaration
Swift
public func createVcard(name: String?) throws -> BoolParameters
nameThe full name of the friend or nil to use the one from the friend’s SIP URI
Return Value
true if the vCard has been created, false if it wasn’t possible (for exemple if name and the friend’s SIP URI are null or if the friend’s SIP URI doesn’t have a display name), or if there is already one vcard
-
Commits modification made to the friend configuration.
Declaration
Swift
public func done() -
Starts editing a friend configuration. Because friend configuration must be consistent, applications MUST call edit() before doing any attempts to modify friend configuration (such as setAddress() or setIncSubscribePolicy()). Once the modifications are done, then the application must call done() to commit the changes.
Declaration
Swift
public func edit() -
Returns the version of a friend’s capbility.
Declaration
Swift
public func getCapabilityVersion(capability: FriendCapability) -> FloatParameters
capabilityFriendCapabilityobjectReturn Value
the version of a friend’s capbility.
-
Get the presence model for a specific SIP URI or phone number of a friend.
Declaration
Swift
public func getPresenceModelForUriOrTel(uriOrTel: String) -> PresenceModel?Parameters
uriOrTelThe SIP URI or phone number for which to get the presence model
Return Value
A
PresenceModelobject, or nil if the friend do not have presence information for this SIP URI or phone number. -
Returns whether or not a friend has a capbility.
Declaration
Swift
public func hasCapability(capability: FriendCapability) -> BoolParameters
capabilityFriendCapabilityobjectReturn Value
whether or not a friend has a capbility
-
Returns whether or not a friend has a capbility with a given version.
Declaration
Swift
public func hasCapabilityWithVersion(capability: FriendCapability, version: Float) -> BoolParameters
capabilityFriendCapabilityobjectversionthe version to test
Return Value
whether or not a friend has a capbility with a given version or -1.0 if friend has not capability.
-
Returns whether or not a friend has a capbility with a given version or more.
Declaration
Swift
public func hasCapabilityWithVersionOrMore(capability: FriendCapability, version: Float) -> BoolParameters
capabilityFriendCapabilityobjectversionthe version to test
Return Value
whether or not a friend has a capbility with a given version or more.
-
Returns whether a friend contains the given phone number.
Declaration
Swift
public func hasPhoneNumber(phoneNumber: String) -> BoolParameters
phoneNumberthe phone number to search for
Return Value
true if found, false otherwise
-
Check that the given friend is in a friend list.
Declaration
Swift
public func inList() -> BoolReturn Value
true if the friend is in a friend list, false otherwise.
-
Removes a friend from it’s friend list and from the rc if exists.
Declaration
Swift
public func remove() -
Removes a phone number in this friend.
Declaration
Swift
public func removePhoneNumber(phoneNumber: String)Parameters
phoneNumbernumber to remove
-
Saves a friend either in database if configured, otherwise in linphonerc.
Declaration
Swift
public func save(core: Core)Parameters
corethe linphone core
-
Set the presence model for a specific SIP URI or phone number of a friend.
Declaration
Swift
public func setPresenceModelForUriOrTel(uriOrTel: String, presence: PresenceModel?)Parameters
uriOrTelThe SIP URI or phone number for which to set the presence model
presenceThe
PresenceModelobject to set
Friend Class Reference