Event
public class Event : LinphoneObject
Object representing an event state, which is subcribed or published.
See
See also: Core.publish()See
See also: Core.subscribe()-
Declaration
Swift
public static func getSwiftObject(cObject: OpaquePointer) -> Event -
Declaration
Swift
public var getCobject: OpaquePointer? { get } -
Declaration
Swift
public func addDelegate(delegate: EventDelegate) -
Declaration
Swift
public func removeDelegate(delegate: EventDelegate) -
Get the current LinphoneEventCbs object associated with a LinphoneEvent.
Declaration
Swift
public var currentDelegate: EventDelegate? { get }Return Value
The current LinphoneEventCbs object associated with the LinphoneEvent.
-
Get the name of the event as specified in the event package RFC.
Declaration
Swift
public var name: String { get }Return Value
the event name.
-
Get publish state. If the event object was not created by a publish mechanism,
Noneis returned.Declaration
Swift
public var publishState: PublishState { get }Return Value
the current
PublishState -
Get the “contact” address of the subscription.
Declaration
Swift
public var remoteContact: Address? { get }Return Value
The “contact” address of the subscription
-
Get subscription direction. If the object wasn’t created by a subscription mechanism,
InvalidDiris returned.Declaration
Swift
public var subscriptionDir: SubscriptionDir { get }Return Value
the
SubscriptionDir -
Get subscription state. If the event object was not created by a subscription mechanism,
Noneis returned.Declaration
Swift
public var subscriptionState: SubscriptionState { get }Return Value
the current
SubscriptionState -
Set a user (application) pointer.
Declaration
Swift
public var userData: UnsafeMutableRawPointer? { get set }Return Value
the user_data pointer or nil.
-
Accept an incoming subcription.
Declaration
Swift
public func acceptSubscription() throwsReturn Value
0 if successful, error code otherwise
-
Add a custom header to an outgoing susbscription or publish.
Declaration
Swift
public func addCustomHeader(name: String, value: String?)Parameters
nameheader’s name
valuethe header’s value.
-
Deny an incoming subscription with given reason.
Declaration
Swift
public func denySubscription(reason: Reason) throwsReturn Value
0 if successful, error code otherwise
-
Obtain the value of a given header for an incoming subscription.
Declaration
Swift
public func getCustomHeader(name: String) -> StringParameters
nameheader’s name
Return Value
the header’s value or nil if such header doesn’t exist.
-
Send a notification.
Declaration
Swift
public func notify(body: Content?) throwsParameters
bodyan optional body containing the actual notification data.
Return Value
0 if successful, -1 otherwise.
-
Prevent an event from refreshing its publish. This is useful to let registrations to expire naturally (or) when the application wants to keep control on when refreshes are sent. The refreshing operations can be resumed with ProxyConfig.refreshRegister().
Declaration
Swift
public func pausePublish() -
Refresh an outgoing publish keeping the same body.
Declaration
Swift
public func refreshPublish() throwsReturn Value
0 if successful, -1 otherwise.
-
Refresh an outgoing subscription keeping the same body.
Declaration
Swift
public func refreshSubscribe() throwsReturn Value
0 if successful, -1 otherwise.
-
Remove custom header to an outgoing susbscription or publish.
Declaration
Swift
public func removeCustomHeader(name: String)Parameters
nameheader’s name
-
Send a publish created by Core.createPublish().
Declaration
Swift
public func sendPublish(body: Content) throwsParameters
bodythe new data to be published
Return Value
0 if successful, -1 otherwise.
-
Send a subscription previously created by Core.createSubscribe().
Declaration
Swift
public func sendSubscribe(body: Content?) throwsParameters
bodyoptional content to attach with the subscription.
Return Value
0 if successful, -1 otherwise.
-
Terminate an incoming or outgoing subscription that was previously acccepted, or a previous publication. The
Eventshall not be used anymore after this operation.Declaration
Swift
public func terminate() -
Update (refresh) a publish.
Declaration
Swift
public func updatePublish(body: Content) throwsParameters
bodythe new data to be published
Return Value
0 if successful, error code otherwise
-
Update (refresh) an outgoing subscription, changing the body.
Declaration
Swift
public func updateSubscribe(body: Content?) throwsParameters
bodyan optional body to include in the subscription update, may be nil.
Return Value
0 if successful, error code otherwise
Event Class Reference