3 Copyright (C) 2009 Simon MORLAT (simon.morlat@linphone.org)
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #include "linphonecore.h"
25 * @addtogroup linphone_address
30 * Constructs a LinphoneAddress object by parsing the user supplied address,
33 LinphoneAddress * linphone_address_new(const char *addr){
34 return sal_address_new(addr);
38 * Clones a LinphoneAddress object.
40 LinphoneAddress * linphone_address_clone(const LinphoneAddress *addr){
41 return sal_address_clone(addr);
45 * Returns the address scheme, normally "sip".
47 const char *linphone_address_get_scheme(const LinphoneAddress *u){
48 return sal_address_get_scheme(u);
52 * Returns the display name.
54 const char *linphone_address_get_display_name(const LinphoneAddress* u){
55 return sal_address_get_display_name(u);
59 * Returns the username.
61 const char *linphone_address_get_username(const LinphoneAddress *u){
62 return sal_address_get_username(u);
66 * Returns the domain name.
68 const char *linphone_address_get_domain(const LinphoneAddress *u){
69 return sal_address_get_domain(u);
73 * Sets the display name.
75 void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name){
76 sal_address_set_display_name(u,display_name);
82 void linphone_address_set_username(LinphoneAddress *uri, const char *username){
83 sal_address_set_username(uri,username);
89 void linphone_address_set_domain(LinphoneAddress *uri, const char *host){
90 sal_address_set_domain(uri,host);
94 * Sets the port number.
96 void linphone_address_set_port(LinphoneAddress *uri, const char *port){
97 sal_address_set_port(uri,port);
101 * Sets the port number.
103 void linphone_address_set_port_int(LinphoneAddress *uri, int port){
104 sal_address_set_port_int(uri,port);
108 * Removes address's tags and uri headers so that it is displayable to the user.
110 void linphone_address_clean(LinphoneAddress *uri){
111 sal_address_clean(uri);
115 * Returns the address as a string.
116 * The returned char * must be freed by the application. Use ms_free().
118 char *linphone_address_as_string(const LinphoneAddress *u){
119 return sal_address_as_string(u);
123 * Returns the SIP uri only as a string, that is display name is removed.
124 * The returned char * must be freed by the application. Use ms_free().
126 char *linphone_address_as_string_uri_only(const LinphoneAddress *u){
127 return sal_address_as_string_uri_only(u);
131 * Destroys a LinphoneAddress object.
133 void linphone_address_destroy(LinphoneAddress *u){
134 sal_address_destroy(u);