Address

public class Address : LinphoneObject

Object that represents a parsed SIP address. A SIP address is made of display name, username, domain name, port, and various uri headers (such as tags). It looks like ‘Alice sip:alice@example.net’. You can create an address using Factory.createAddress() or Core.interpretUrl() and both will return a nil object if it doesn’t match the grammar defined by the standard. This object is used in almost every other major objects to identity people (including yourself) & servers. The Address has methods to extract and manipulate all parts of the address.

  • Undocumented

    Declaration

    Swift

    public static func getSwiftObject(cObject: OpaquePointer) -> Address
  • Undocumented

    Declaration

    Swift

    public var getCobject: OpaquePointer? { get }
  • Sets the display name.

    Declaration

    Swift

    public var displayName: String { get }

    Parameters

    displayName

    the display name to set.
    Returns the display name.

    Return Value

    the display name if any, nil otherwise.

  • Undocumented

    Declaration

    Swift

    public func setDisplayname(newValue: String) throws
  • Sets the domain.

    Declaration

    Swift

    public var domain: String { get }

    Parameters

    domain

    the domain to set.
    Returns the domain name.

    Return Value

    the domain name if any, nil otherwise.

  • Undocumented

    Declaration

    Swift

    public func setDomain(newValue: String) throws
  • returns whether the address is a routable SIP address or not

    Declaration

    Swift

    public var isSip: Bool { get }

    Return Value

    true if it is a routable SIP address, false otherwise

  • Returns if address is valid.

    Declaration

    Swift

    public var isValid: Bool { get }

    Return Value

    the scheme if any, nil otherwise.

  • Set the value of the method parameter.

    Declaration

    Swift

    public var methodParam: String { get set }

    Parameters

    methodParam

    the value to set to the method parameter.
    Get the value of the method parameter.

    Return Value

    the value of the parameter or nil.

  • Set the password encoded in the address. It is used for basic authentication (not recommended).

    Declaration

    Swift

    public var password: String { get set }

    Parameters

    password

    the password to set.
    Get the password encoded in the address. It is used for basic authentication (not recommended).

    Return Value

    the password if any, nil otherwise.

  • Sets the port number.

    Declaration

    Swift

    public var port: Int { get }

    Parameters

    port

    the port to set in the address Get port number as an integer value, 0 if not present.

    Return Value

    the port set in the address or 0 if not present.

  • Undocumented

    Declaration

    Swift

    public func setPort(newValue: Int) throws
  • Returns the address scheme, normally “sip”.

    Declaration

    Swift

    public var scheme: String { get }

    Return Value

    the scheme if any, nil otherwise.

  • Make the address refer to a secure location (sips scheme)

    Declaration

    Swift

    public var secure: Bool { get set }

    Parameters

    enabled

    true if address is requested to be secure. Returns whether the address refers to a secure location (sips) or not.

    Return Value

    true if address refers to a secure location, false otherwise

  • Set a transport.

    Declaration

    Swift

    public var transport: TransportType { get }

    Parameters

    transport

    a TransportType Get the transport.

    Return Value

    a TransportType, default value if not set is UDP.

  • Undocumented

    Declaration

    Swift

    public func setTransport(newValue: TransportType) throws
  • Set the value of the parameters of the URI of the address.

    Declaration

    Swift

    public var uriParams: String { get set }

    Parameters

    params

    The parameters string

  • Sets the username.

    Declaration

    Swift

    public var username: String { get }

    Parameters

    username

    the username to set.
    Returns the username.

    Return Value

    the username name if any, nil otherwise.

  • Undocumented

    Declaration

    Swift

    public func setUsername(newValue: String) throws
  • Returns the address as a string. The returned char * must be freed by the application. Use ms_free().

    Declaration

    Swift

    public func asString() -> String

    Return Value

    a string representation of the address.

  • Returns the SIP uri only as a string, that is display name is removed. The returned char * must be freed by the application. Use ms_free().

    Declaration

    Swift

    public func asStringUriOnly() -> String

    Return Value

    a string representation of the address.

  • Removes address’s tags and uri headers so that it is displayable to the user.

    Declaration

    Swift

    public func clean()
  • Clones a Address object.

    Declaration

    Swift

    public func clone() -> Address?

    Return Value

    a new Address object.

  • Compare two Address taking the tags and headers into account.

    See

    See also: weakEqual()

    Declaration

    Swift

    public func equal(address2: Address) -> Bool

    Parameters

    address2

    Address object.

    Return Value

    Boolean value telling if the Address objects are equal.

  • Get the header encoded in the address.

    Declaration

    Swift

    public func getHeader(headerName: String) -> String

    Parameters

    headerName

    the header name.

    Return Value

    the header value or nil if it doesn’t exists.

  • Get the value of a parameter of the address.

    Declaration

    Swift

    public func getParam(paramName: String) -> String

    Parameters

    paramName

    The name of the parameter.

    Return Value

    The value of the parameter or nil if it doesn’t exists.

  • Get the value of a parameter of the URI of the address.

    Declaration

    Swift

    public func getUriParam(uriParamName: String) -> String

    Parameters

    uriParamName

    The name of the parameter.

    Return Value

    The value of the parameter or nil if it doesn’t exists.

  • Tell whether a parameter is present in the address.

    Declaration

    Swift

    public func hasParam(paramName: String) -> Bool

    Parameters

    paramName

    The name of the parameter.

    Return Value

    A boolean value telling whether the parameter is present in the address

  • Tell whether a parameter is present in the URI of the address.

    Declaration

    Swift

    public func hasUriParam(uriParamName: String) -> Bool

    Parameters

    uriParamName

    The name of the parameter.

    Return Value

    A boolean value telling whether the parameter is present in the URI of the address

  • Removes the value of a parameter of the URI of the address.

    Declaration

    Swift

    public func removeUriParam(uriParamName: String)

    Parameters

    uriParamName

    The name of the parameter.

  • Set a header into the address. Headers appear in the URI with ‘?’, such as sip:test@linphone.org?SomeHeader=SomeValue.

    Declaration

    Swift

    public func setHeader(headerName: String, headerValue: String?)

    Parameters

    headerName

    the header name.

    headerValue

    the header value.

  • Set the value of a parameter of the address.

    Declaration

    Swift

    public func setParam(paramName: String, paramValue: String?)

    Parameters

    paramName

    The name of the parameter.

    paramValue

    The new value of the parameter.

  • Set the value of a parameter of the URI of the address.

    Declaration

    Swift

    public func setUriParam(uriParamName: String, uriParamValue: String?)

    Parameters

    uriParamName

    The name of the parameter.

    uriParamValue

    The new value of the parameter.

  • Compare two Address ignoring tags and headers, basically just domain, username, and port.

    See

    See also: equal()

    Declaration

    Swift

    public func weakEqual(address2: Address) -> Bool

    Parameters

    address2

    Address object.

    Return Value

    Boolean value telling if the Address objects are equal.