Liblinphone
3.12.0
|
SIP address parser API. More...
Typedefs | |
typedef struct SalAddress | LinphoneAddress |
Object that represents a SIP address. More... | |
typedef enum _LinphoneTransportType | LinphoneTransportType |
Enum describing transport type for LinphoneAddress. | |
Enumerations | |
enum | _LinphoneTransportType { LinphoneTransportUdp, LinphoneTransportTcp, LinphoneTransportTls, LinphoneTransportDtls } |
Enum describing transport type for LinphoneAddress. | |
Functions | |
LinphoneAddress * | linphone_address_new (const char *addr) |
Constructs a LinphoneAddress object by parsing the user supplied address, given as a string. | |
LinphoneAddress * | linphone_address_clone (const LinphoneAddress *addr) |
Clones a LinphoneAddress object. | |
LinphoneAddress * | linphone_address_ref (LinphoneAddress *addr) |
Increment reference count of LinphoneAddress object. | |
void | linphone_address_unref (LinphoneAddress *addr) |
Decrement reference count of LinphoneAddress object. More... | |
const char * | linphone_address_get_scheme (const LinphoneAddress *u) |
Returns the address scheme, normally "sip". | |
const char * | linphone_address_get_display_name (const LinphoneAddress *u) |
Returns the display name. | |
const char * | linphone_address_get_username (const LinphoneAddress *u) |
Returns the username. | |
const char * | linphone_address_get_domain (const LinphoneAddress *u) |
Returns the domain name. | |
int | linphone_address_get_port (const LinphoneAddress *u) |
Get port number as an integer value, 0 if not present. | |
LinphoneStatus | linphone_address_set_display_name (LinphoneAddress *u, const char *display_name) |
Sets the display name. | |
LinphoneStatus | linphone_address_set_username (LinphoneAddress *uri, const char *username) |
Sets the username. | |
LinphoneStatus | linphone_address_set_domain (LinphoneAddress *uri, const char *host) |
Sets the domain. | |
LinphoneStatus | linphone_address_set_port (LinphoneAddress *uri, int port) |
Sets the port number. | |
LinphoneStatus | linphone_address_set_transport (LinphoneAddress *uri, LinphoneTransportType type) |
Set a transport. | |
void | linphone_address_clean (LinphoneAddress *uri) |
Removes address's tags and uri headers so that it is displayable to the user. | |
LINPHONE_DEPRECATED bool_t | linphone_address_is_secure (const LinphoneAddress *addr) |
Returns true if address refers to a secure location (sips) More... | |
bool_t | linphone_address_get_secure (const LinphoneAddress *addr) |
Returns true if address refers to a secure location (sips) | |
void | linphone_address_set_secure (LinphoneAddress *addr, bool_t enabled) |
Make the address refer to a secure location (sips scheme) More... | |
bool_t | linphone_address_is_sip (const LinphoneAddress *uri) |
returns true if address is a routable sip address | |
LinphoneTransportType | linphone_address_get_transport (const LinphoneAddress *uri) |
Get the transport. | |
const char * | linphone_address_get_method_param (const LinphoneAddress *addr) |
Get the value of the method parameter. | |
void | linphone_address_set_method_param (LinphoneAddress *addr, const char *method) |
Set the value of the method parameter. | |
char * | linphone_address_as_string (const LinphoneAddress *u) |
Returns the address as a string. More... | |
char * | linphone_address_as_string_uri_only (const LinphoneAddress *u) |
Returns the SIP uri only as a string, that is display name is removed. More... | |
bool_t | linphone_address_weak_equal (const LinphoneAddress *a1, const LinphoneAddress *a2) |
Compare two LinphoneAddress ignoring tags and headers, basically just domain, username, and port. More... | |
bool_t | linphone_address_equal (const LinphoneAddress *a1, const LinphoneAddress *a2) |
Compare two LinphoneAddress taking the tags and headers into account. More... | |
void | linphone_address_set_password (LinphoneAddress *addr, const char *passwd) |
Set the password encoded in the address. More... | |
const char * | linphone_address_get_password (const LinphoneAddress *addr) |
Get the password encoded in the address. More... | |
void | linphone_address_set_header (LinphoneAddress *addr, const char *header_name, const char *header_value) |
Set a header into the address. More... | |
const char * | linphone_address_get_header (const LinphoneAddress *addr, const char *name) |
Get the header encoded in the address. More... | |
bool_t | linphone_address_has_param (const LinphoneAddress *addr, const char *name) |
const char * | linphone_address_get_param (const LinphoneAddress *addr, const char *name) |
void | linphone_address_set_param (LinphoneAddress *addr, const char *name, const char *value) |
void | linphone_address_set_params (LinphoneAddress *addr, const char *params) |
void | linphone_address_set_uri_param (LinphoneAddress *addr, const char *name, const char *value) |
void | linphone_address_set_uri_params (LinphoneAddress *addr, const char *params) |
bool_t | linphone_address_has_uri_param (const LinphoneAddress *addr, const char *name) |
const char * | linphone_address_get_uri_param (const LinphoneAddress *addr, const char *name) |
LINPHONE_DEPRECATED void | linphone_address_destroy (LinphoneAddress *u) |
Destroys a LinphoneAddress object (actually calls linphone_address_unref()). More... | |
LinphoneAddress * | linphone_core_create_address (LinphoneCore *lc, const char *address) |
Create a LinphoneAddress object by parsing the user supplied address, given as a string. More... | |
SIP address parser API.
This api is useful for manipulating SIP addresses ('from' or 'to' headers).
typedef struct SalAddress LinphoneAddress |
Object that represents a SIP address.
The LinphoneAddress 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>'. The LinphoneAddress 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 NULL. @exa mple. net
char* linphone_address_as_string | ( | const LinphoneAddress * | u | ) |
Returns the address as a string.
The returned char * must be freed by the application. Use ms_free().
char* linphone_address_as_string_uri_only | ( | const LinphoneAddress * | u | ) |
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().
LINPHONE_DEPRECATED void linphone_address_destroy | ( | LinphoneAddress * | u | ) |
Destroys a LinphoneAddress object (actually calls linphone_address_unref()).
bool_t linphone_address_equal | ( | const LinphoneAddress * | a1, |
const LinphoneAddress * | a2 | ||
) |
Compare two LinphoneAddress taking the tags and headers into account.
[in] | a1 | LinphoneAddress object |
[in] | a2 | LinphoneAddress object |
const char* linphone_address_get_header | ( | const LinphoneAddress * | addr, |
const char * | name | ||
) |
Get the header encoded in the address.
addr | the address |
const char* linphone_address_get_password | ( | const LinphoneAddress * | addr | ) |
Get the password encoded in the address.
It is used for basic authentication (not recommended).
addr | the address |
LINPHONE_DEPRECATED bool_t linphone_address_is_secure | ( | const LinphoneAddress * | addr | ) |
Returns true if address refers to a secure location (sips)
void linphone_address_set_header | ( | LinphoneAddress * | addr, |
const char * | header_name, | ||
const char * | header_value | ||
) |
Set a header into the address.
Headers appear in the URI with '?', such as <sip:test@?SomeHeader=SomeValue>. linp hone. org
addr | the address |
header_name | the header name |
header_value | the header value |
void linphone_address_set_password | ( | LinphoneAddress * | addr, |
const char * | passwd | ||
) |
Set the password encoded in the address.
It is used for basic authentication (not recommended).
addr | the LinphoneAddress |
passwd | the password to set. |
void linphone_address_set_secure | ( | LinphoneAddress * | addr, |
bool_t | enabled | ||
) |
Make the address refer to a secure location (sips scheme)
[in] | addr | A LinphoneAddress object |
[in] | enabled | TRUE if address is requested to be secure. |
void linphone_address_unref | ( | LinphoneAddress * | addr | ) |
Decrement reference count of LinphoneAddress object.
When dropped to zero, memory is freed.
bool_t linphone_address_weak_equal | ( | const LinphoneAddress * | a1, |
const LinphoneAddress * | a2 | ||
) |
Compare two LinphoneAddress ignoring tags and headers, basically just domain, username, and port.
[in] | a1 | LinphoneAddress object |
[in] | a2 | LinphoneAddress object |
LinphoneAddress* linphone_core_create_address | ( | LinphoneCore * | lc, |
const char * | address | ||
) |
Create a LinphoneAddress object by parsing the user supplied address, given as a string.
[in] | lc | LinphoneCore object |
[in] | address | String containing the user supplied address |