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()

  • Undocumented

    Declaration

    Swift

    public func getDelegate() -> EventDelegate?
  • Undocumented

    Declaration

    Swift

    public func addDelegate(delegate: EventDelegate)
  • Undocumented

    Declaration

    Swift

    public func removeDelegate(delegate: EventDelegate)
  • Returns back pointer to the Core that created this Event.

    Declaration

    Swift

    public var core: Core? { get }
  • Get the current LinphoneEventCbs object associated with a LinphoneEvent.

    Declaration

    Swift

    public var currentCallbacks: EventDelegate? { get }

    Return Value

    The current LinphoneEventCbs object associated with the LinphoneEvent.

  • Get full details about an error occured.

    Declaration

    Swift

    public var errorInfo: ErrorInfo? { get }
  • Get the “from” address of the subscription.

    Declaration

    Swift

    public var from: Address? { get }
  • Get the name of the event as specified in the event package RFC.

    Declaration

    Swift

    public var name: String { get }
  • Get publish state. If the event object was not created by a publish mechanism, LinphonePublishNone is returned.

    Declaration

    Swift

    public var publishState: PublishState { get }
  • Return reason code (in case of error state reached).

    Declaration

    Swift

    public var reason: Reason { get }
  • Get the “contact” address of the subscription.

    Declaration

    Swift

    public var remoteContact: Address? { get }

    Return Value

    The “contact” address of the subscription

  • Get the resource address of the subscription or publish.

    Declaration

    Swift

    public var resource: Address? { get }
  • Get subscription direction. If the object wasn’t created by a subscription mechanism, LinphoneSubscriptionInvalidDir is returned.

    Declaration

    Swift

    public var subscriptionDir: SubscriptionDir { get }
  • Get subscription state. If the event object was not created by a subscription mechanism, LinphoneSubscriptionNone is returned.

    Declaration

    Swift

    public var subscriptionState: SubscriptionState { get }
  • to

    Get the “to” address of the subscription.

    Declaration

    Swift

    public var to: Address? { get }
  • Accept an incoming subcription.

    Declaration

    Swift

    public func acceptSubscription() throws
  • Add a custom header to an outgoing susbscription or publish.

    Declaration

    Swift

    public func addCustomHeader(name: String, value: String)

    Parameters

    name

    header’s name

    value

    the header’s value.

  • Deny an incoming subscription with given reason.

    Declaration

    Swift

    public func denySubscription(reason: Reason) throws
  • Obtain the value of a given header for an incoming subscription.

    Declaration

    Swift

    public func getCustomHeader(name: String) -> String

    Parameters

    name

    header’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) throws

    Parameters

    body

    an 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() throws

    Return Value

    0 if successful, -1 otherwise.

  • Refresh an outgoing subscription keeping the same body.

    Declaration

    Swift

    public func refreshSubscribe() throws

    Return Value

    0 if successful, -1 otherwise.

  • Remove custom header to an outgoing susbscription or publish.

    Declaration

    Swift

    public func removeCustomHeader(name: String)

    Parameters

    name

    header’s name

  • Send a publish created by Core.createPublish().

    Declaration

    Swift

    public func sendPublish(body: Content) throws

    Parameters

    body

    the new data to be published

  • Send a subscription previously created by Core.createSubscribe().

    Declaration

    Swift

    public func sendSubscribe(body: Content) throws

    Parameters

    body

    optional 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 Event shall not be used anymore after this operation, unless the application explicitely took a reference on the object with linphone_event_ref.

    Declaration

    Swift

    public func terminate()
  • Update (refresh) a publish.

    Declaration

    Swift

    public func updatePublish(body: Content) throws

    Parameters

    body

    the new data to be published

  • Update (refresh) an outgoing subscription, changing the body.

    Declaration

    Swift

    public func updateSubscribe(body: Content?) throws

    Parameters

    body

    an optional body to include in the subscription update, may be nil.