Address
public class Address : LinphoneObject
Object that represents a SIP address.
The Address
is an opaque object to represents SIP addresses, ie the content
of SIP’s ‘from’ and ‘to’ headers. 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’. The Address
has methods to extract and
manipulate all parts of the address. When some part of the address (for example
the username) is empty, the accessor methods return nil.
-
Returns the display name.
Declaration
Swift
public var displayName: String { get }
-
Undocumented
Declaration
Swift
public func setDisplayname(newValue: String) throws
-
Returns the domain name.
Declaration
Swift
public var domain: String { get }
-
Undocumented
Declaration
Swift
public func setDomain(newValue: String) throws
-
returns true if address is a routable sip address
Declaration
Swift
public var isSip: Bool { get }
-
Get the value of the method parameter.
Declaration
Swift
public var methodParam: String { get set }
-
Get the password encoded in the address. It is used for basic authentication (not recommended).
Declaration
Swift
public var password: String { get set }
Return Value
the password, if any, nil otherwise.
-
Get port number as an integer value, 0 if not present.
Declaration
Swift
public var port: Int { get }
-
Undocumented
Declaration
Swift
public func setPort(newValue: Int) throws
-
Returns the address scheme, normally “sip”.
Declaration
Swift
public var scheme: String { get }
-
Returns true if address refers to a secure location (sips)
Declaration
Swift
public var secure: Bool { get set }
-
Get the transport.
Declaration
Swift
public var transport: TransportType { get }
-
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
-
Returns the username.
Declaration
Swift
public var username: String { get }
-
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
-
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
-
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?
-
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
objectReturn 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
-
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
-
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
-
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
objectReturn Value
Boolean value telling if the
Address
objects are equal.