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.
-
Declaration
Swift
public static func getSwiftObject(cObject: OpaquePointer) -> Address -
Declaration
Swift
public var getCobject: OpaquePointer? { get } -
Sets the display name.
Declaration
Swift
public var displayName: String { get }Return Value
the display name if any, nil otherwise.
-
Declaration
Swift
public func setDisplayname(newValue: String) throws -
Sets the domain.
Declaration
Swift
public var domain: String { get }Return Value
the domain name if any, nil otherwise.
-
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 }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 }Return Value
the password if any, nil otherwise.
-
Sets the port number.
Declaration
Swift
public var port: Int { get }Return Value
the port set in the address or 0 if not present.
-
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 }Return Value
true if address refers to a secure location, false otherwise
-
Set a transport.
Declaration
Swift
public var transport: TransportType { get }Return Value
a
TransportType, default value if not set is UDP. -
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
paramsThe parameters string
-
Sets the username.
Declaration
Swift
public var username: String { get }Return Value
the username name if any, nil otherwise.
-
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() -> StringReturn 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() -> StringReturn 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
Addressobject.Declaration
Swift
public func clone() -> Address?Return Value
a new
Addressobject. -
Compare two
Addresstaking the tags and headers into account.See
See also: weakEqual()Declaration
Swift
public func equal(address2: Address) -> BoolParameters
address2Addressobject.Return Value
Boolean value telling if the
Addressobjects are equal. -
Get the header encoded in the address.
Declaration
Swift
public func getHeader(headerName: String) -> StringParameters
headerNamethe 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) -> StringParameters
paramNameThe 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) -> StringParameters
uriParamNameThe 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) -> BoolParameters
paramNameThe 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) -> BoolParameters
uriParamNameThe 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
uriParamNameThe 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
headerNamethe header name.
headerValuethe header value.
-
Set the value of a parameter of the address.
Declaration
Swift
public func setParam(paramName: String, paramValue: String?)Parameters
paramNameThe name of the parameter.
paramValueThe 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
uriParamNameThe name of the parameter.
uriParamValueThe new value of the parameter.
-
Compare two
Addressignoring tags and headers, basically just domain, username, and port.See
See also: equal()Declaration
Swift
public func weakEqual(address2: Address) -> BoolParameters
address2Addressobject.Return Value
Boolean value telling if the
Addressobjects are equal.
Address Class Reference