Liblinphone
5.3.0
|
Object that represents a parsed SIP address. More...
#include <address.hh>
Public Types | |
enum | Family { Family::Inet = 0, Family::Inet6 = 1, Family::Unspec = 2 } |
Enum describing Ip family. More... | |
Public Member Functions | |
LINPHONECXX_PUBLIC | Address (void *ptr, bool takeRef=true) |
LINPHONECXX_PUBLIC _LinphoneAddress * | cPtr () |
LINPHONECXX_PUBLIC std::string | getDisplayName () const |
Returns the display name. More... | |
LINPHONECXX_PUBLIC linphone::Status | setDisplayName (const std::string &displayName) |
Sets the display name. More... | |
LINPHONECXX_PUBLIC std::string | getDomain () const |
Returns the domain name. More... | |
LINPHONECXX_PUBLIC linphone::Status | setDomain (const std::string &domain) |
Sets the domain. More... | |
LINPHONECXX_PUBLIC bool | isSip () const |
returns whether the address is a routable SIP address or not More... | |
LINPHONECXX_PUBLIC bool | isValid () const |
Returns if address is valid. More... | |
LINPHONECXX_PUBLIC std::string | getMethodParam () const |
Get the value of the method parameter. More... | |
LINPHONECXX_PUBLIC void | setMethodParam (const std::string &methodParam) |
Set the value of the method parameter. More... | |
LINPHONECXX_PUBLIC std::string | getPassword () const |
Get the password encoded in the address. More... | |
LINPHONECXX_PUBLIC void | setPassword (const std::string &password) |
Set the password encoded in the address. More... | |
LINPHONECXX_PUBLIC int | getPort () const |
Get port number as an integer value, 0 if not present. More... | |
LINPHONECXX_PUBLIC linphone::Status | setPort (int port) |
Sets the port number. More... | |
LINPHONECXX_PUBLIC std::string | getScheme () const |
Returns the address scheme, normally "sip". More... | |
LINPHONECXX_PUBLIC bool | getSecure () const |
Returns whether the address refers to a secure location (sips) or not. More... | |
LINPHONECXX_PUBLIC void | setSecure (bool enabled) |
Make the address refer to a secure location (sips scheme) More... | |
LINPHONECXX_PUBLIC linphone::TransportType | getTransport () const |
Get the transport. More... | |
LINPHONECXX_PUBLIC linphone::Status | setTransport (linphone::TransportType transport) |
Set a transport. More... | |
LINPHONECXX_PUBLIC void | setUriParams (const std::string ¶ms) |
Set the value of the parameters of the URI of the address. More... | |
LINPHONECXX_PUBLIC std::string | getUsername () const |
Returns the username. More... | |
LINPHONECXX_PUBLIC linphone::Status | setUsername (const std::string &username) |
Sets the username. More... | |
LINPHONECXX_PUBLIC std::string | asString () const |
Returns the address as a string. More... | |
LINPHONECXX_PUBLIC std::string | asStringUriOnly () const |
Returns the SIP uri only as a string, that is display name is removed. More... | |
LINPHONECXX_PUBLIC void | clean () |
Removes address's tags and uri headers so that it is displayable to the user. | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Address > | clone () const |
Clones a Address object. More... | |
LINPHONECXX_PUBLIC bool | equal (const std::shared_ptr< const linphone::Address > &address2) const |
Compare two Address taking the tags and headers into account. More... | |
LINPHONECXX_PUBLIC std::string | getHeader (const std::string &headerName) const |
Get the header encoded in the address. More... | |
LINPHONECXX_PUBLIC std::string | getParam (const std::string ¶mName) const |
Get the value of a parameter of the address. More... | |
LINPHONECXX_PUBLIC std::string | getUriParam (const std::string &uriParamName) const |
Get the value of a parameter of the URI of the address. More... | |
LINPHONECXX_PUBLIC bool | hasParam (const std::string ¶mName) const |
Tell whether a parameter is present in the address. More... | |
LINPHONECXX_PUBLIC bool | hasUriParam (const std::string &uriParamName) const |
Tell whether a parameter is present in the URI of the address. More... | |
LINPHONECXX_PUBLIC void | removeUriParam (const std::string &uriParamName) |
Removes the value of a parameter of the URI of the address. More... | |
LINPHONECXX_PUBLIC void | setHeader (const std::string &headerName, const std::string &headerValue) |
Set a header into the address. More... | |
LINPHONECXX_PUBLIC void | setParam (const std::string ¶mName, const std::string ¶mValue) |
Set the value of a parameter of the address. More... | |
LINPHONECXX_PUBLIC void | setUriParam (const std::string &uriParamName, const std::string &uriParamValue) |
Set the value of a parameter of the URI of the address. More... | |
LINPHONECXX_PUBLIC bool | weakEqual (const std::shared_ptr< const linphone::Address > &address2) const |
Compare two Address ignoring tags and headers, basically just domain, username, and port. More... | |
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>'. You can create an address using @exa mple. netFactory::createAddress() or Core::interpretUrl() and both will return a nullptr 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.
|
strong |
LINPHONECXX_PUBLIC std::string linphone::Address::asString | ( | ) | const |
Returns the address as a string.
The returned char * must be freed by the application. Use ms_free().
LINPHONECXX_PUBLIC std::string linphone::Address::asStringUriOnly | ( | ) | const |
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().
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Address> linphone::Address::clone | ( | ) | const |
LINPHONECXX_PUBLIC bool linphone::Address::equal | ( | const std::shared_ptr< const linphone::Address > & | address2 | ) | const |
Compare two Address taking the tags and headers into account.
address2 | Address object. |
LINPHONECXX_PUBLIC std::string linphone::Address::getDisplayName | ( | ) | const |
Returns the display name.
LINPHONECXX_PUBLIC std::string linphone::Address::getDomain | ( | ) | const |
Returns the domain name.
LINPHONECXX_PUBLIC std::string linphone::Address::getHeader | ( | const std::string & | headerName | ) | const |
Get the header encoded in the address.
headerName | the header name. |
LINPHONECXX_PUBLIC std::string linphone::Address::getMethodParam | ( | ) | const |
Get the value of the method parameter.
LINPHONECXX_PUBLIC std::string linphone::Address::getParam | ( | const std::string & | paramName | ) | const |
Get the value of a parameter of the address.
paramName | The name of the parameter. |
LINPHONECXX_PUBLIC std::string linphone::Address::getPassword | ( | ) | const |
Get the password encoded in the address.
It is used for basic authentication (not recommended).
LINPHONECXX_PUBLIC int linphone::Address::getPort | ( | ) | const |
Get port number as an integer value, 0 if not present.
LINPHONECXX_PUBLIC std::string linphone::Address::getScheme | ( | ) | const |
Returns the address scheme, normally "sip".
LINPHONECXX_PUBLIC bool linphone::Address::getSecure | ( | ) | const |
Returns whether the address refers to a secure location (sips) or not.
LINPHONECXX_PUBLIC linphone::TransportType linphone::Address::getTransport | ( | ) | const |
Get the transport.
LINPHONECXX_PUBLIC std::string linphone::Address::getUriParam | ( | const std::string & | uriParamName | ) | const |
Get the value of a parameter of the URI of the address.
uriParamName | The name of the parameter. |
LINPHONECXX_PUBLIC std::string linphone::Address::getUsername | ( | ) | const |
Returns the username.
LINPHONECXX_PUBLIC bool linphone::Address::hasParam | ( | const std::string & | paramName | ) | const |
Tell whether a parameter is present in the address.
paramName | The name of the parameter. |
LINPHONECXX_PUBLIC bool linphone::Address::hasUriParam | ( | const std::string & | uriParamName | ) | const |
Tell whether a parameter is present in the URI of the address.
uriParamName | The name of the parameter. |
LINPHONECXX_PUBLIC bool linphone::Address::isSip | ( | ) | const |
returns whether the address is a routable SIP address or not
LINPHONECXX_PUBLIC bool linphone::Address::isValid | ( | ) | const |
Returns if address is valid.
LINPHONECXX_PUBLIC void linphone::Address::removeUriParam | ( | const std::string & | uriParamName | ) |
Removes the value of a parameter of the URI of the address.
uriParamName | The name of the parameter. |
LINPHONECXX_PUBLIC linphone::Status linphone::Address::setDisplayName | ( | const std::string & | displayName | ) |
Sets the display name.
displayName | the display name to set. |
LINPHONECXX_PUBLIC linphone::Status linphone::Address::setDomain | ( | const std::string & | domain | ) |
Sets the domain.
domain | the domain to set. |
LINPHONECXX_PUBLIC void linphone::Address::setHeader | ( | const std::string & | headerName, |
const std::string & | headerValue | ||
) |
LINPHONECXX_PUBLIC void linphone::Address::setMethodParam | ( | const std::string & | methodParam | ) |
Set the value of the method parameter.
methodParam | the value to set to the method parameter. |
LINPHONECXX_PUBLIC void linphone::Address::setParam | ( | const std::string & | paramName, |
const std::string & | paramValue | ||
) |
Set the value of a parameter of the address.
paramName | The name of the parameter. |
paramValue | The new value of the parameter. |
LINPHONECXX_PUBLIC void linphone::Address::setPassword | ( | const std::string & | password | ) |
Set the password encoded in the address.
It is used for basic authentication (not recommended).
password | the password to set. |
LINPHONECXX_PUBLIC linphone::Status linphone::Address::setPort | ( | int | port | ) |
Sets the port number.
port | the port to set in the address |
LINPHONECXX_PUBLIC void linphone::Address::setSecure | ( | bool | enabled | ) |
Make the address refer to a secure location (sips scheme)
enabled | true if address is requested to be secure. |
LINPHONECXX_PUBLIC linphone::Status linphone::Address::setTransport | ( | linphone::TransportType | transport | ) |
Set a transport.
transport | a TransportType |
LINPHONECXX_PUBLIC void linphone::Address::setUriParam | ( | const std::string & | uriParamName, |
const std::string & | uriParamValue | ||
) |
Set the value of a parameter of the URI of the address.
uriParamName | The name of the parameter. |
uriParamValue | The new value of the parameter. |
LINPHONECXX_PUBLIC void linphone::Address::setUriParams | ( | const std::string & | params | ) |
Set the value of the parameters of the URI of the address.
params | The parameters string |
LINPHONECXX_PUBLIC linphone::Status linphone::Address::setUsername | ( | const std::string & | username | ) |
Sets the username.
username | the username to set. |
LINPHONECXX_PUBLIC bool linphone::Address::weakEqual | ( | const std::shared_ptr< const linphone::Address > & | address2 | ) | const |