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 static func getSwiftObject(cObject: OpaquePointer) -> Event
  • Undocumented

    Declaration

    Swift

    public var getCobject: OpaquePointer? { get }
  • Object representing an event state, which is subcribed or published.

    See

    See also: Core.publish()

    See

    See also: Core.subscribe()

    Declaration

    Swift

    public func addDelegate(delegate: EventDelegate)
  • Object representing an event state, which is subcribed or published.

    See

    See also: Core.publish()

    See

    See also: Core.subscribe()

    Declaration

    Swift

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

    Declaration

    Swift

    public var core: Core? { get }

    Return Value

    the Core object associated.

  • 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 full details about an error occured.

    Declaration

    Swift

    public var errorInfo: ErrorInfo? { get }

    Return Value

    a ErrorInfo object.

  • Get the “from” address of the subscription.

    Declaration

    Swift

    public var from: Address? { get }

    Return Value

    the from Address.

  • 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, None is returned.

    Declaration

    Swift

    public var publishState: PublishState { get }

    Return Value

    the current PublishState

  • Return reason code (in case of error state reached).

    Declaration

    Swift

    public var reason: Reason { get }

    Return Value

    a Reason enum

  • 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 }

    Return Value

    the resource Address.

  • Get subscription direction. If the object wasn’t created by a subscription mechanism, InvalidDir is 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, None is returned.

    Declaration

    Swift

    public var subscriptionState: SubscriptionState { get }

    Return Value

    the current SubscriptionState

  • to

    Get the “to” address of the subscription.

    Declaration

    Swift

    public var to: Address? { get }

    Return Value

    the “to” Address.

  • Retrieve user 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() throws

    Return 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

    name

    header’s name

    value

    the header’s value.

  • Deny an incoming subscription with given reason.

    Declaration

    Swift

    public func denySubscription(reason: Reason) throws

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

    Return Value

    0 if successful, -1 otherwise.

  • 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.

    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

    Return Value

    0 if successful, error code otherwise

  • 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.

    Return Value

    0 if successful, error code otherwise