Commit 863381c3 authored by smorlat's avatar smorlat

rename LinphoneUri into LinphoneAddress, because the term uri wasn't...

rename LinphoneUri into LinphoneAddress, because the term uri wasn't appropriate to refer a sip from header.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@771 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 9364a668
......@@ -1249,12 +1249,12 @@ linphonec_proxy_use(LinphoneCore *lc, int index)
static void
linphonec_friend_display(LinphoneFriend *fr)
{
LinphoneUri *uri=linphone_uri_clone(linphone_friend_get_uri(fr));
LinphoneAddress *uri=linphone_address_clone(linphone_friend_get_uri(fr));
char *str;
linphonec_out("name: %s\n", linphone_uri_get_display_name(uri));
linphone_uri_set_display_name(uri,NULL);
str=linphone_uri_as_string(uri);
linphonec_out("name: %s\n", linphone_address_get_display_name(uri));
linphone_address_set_display_name(uri,NULL);
str=linphone_address_as_string(uri);
linphonec_out("address: %s\n", str);
}
......@@ -1273,7 +1273,7 @@ linphonec_friend_list(LinphoneCore *lc, char *pat)
for(n=0; friend!=NULL; friend=ms_list_next(friend), ++n )
{
if ( pat ) {
const char *name = linphone_uri_get_display_name(
const char *name = linphone_address_get_display_name(
linphone_friend_get_uri((LinphoneFriend*)friend->data));
if (name && ! strstr(name, pat) ) continue;
}
......@@ -1296,7 +1296,7 @@ linphonec_friend_call(LinphoneCore *lc, unsigned int num)
if ( n == num )
{
int ret;
addr = linphone_uri_as_string(linphone_friend_get_uri((LinphoneFriend*)friend->data));
addr = linphone_address_as_string(linphone_friend_get_uri((LinphoneFriend*)friend->data));
ret=lpc_cmd_call(lc, addr);
ms_free(addr);
return ret;
......
......@@ -27,12 +27,12 @@
#include <eXosip2/eXosip.h>
LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const char *to){
LinphoneUri *parsed_url=NULL;
LinphoneAddress *parsed_url=NULL;
char *route;
if (linphone_core_interpret_url(lc,to,&parsed_url,&route)){
LinphoneChatRoom *cr=ms_new0(LinphoneChatRoom,1);
cr->lc=lc;
cr->peer=linphone_uri_as_string(parsed_url);
cr->peer=linphone_address_as_string(parsed_url);
cr->peer_url=parsed_url;
cr->route=route;
lc->chatrooms=ms_list_append(lc->chatrooms,(void *)cr);
......@@ -45,7 +45,7 @@
void linphone_chat_room_destroy(LinphoneChatRoom *cr){
LinphoneCore *lc=cr->lc;
lc->chatrooms=ms_list_remove(lc->chatrooms,(void *) cr);
linphone_uri_destroy(cr->peer_url);
linphone_address_destroy(cr->peer_url);
ms_free(cr->peer);
ms_free(cr->route);
}
......@@ -59,9 +59,9 @@ void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg){
eXosip_message_send_request(sip);
}
bool_t linphone_chat_room_matches(LinphoneChatRoom *cr, const LinphoneUri *from){
if (linphone_uri_get_username(cr->peer_url) && linphone_uri_get_username(from) &&
strcmp(linphone_uri_get_username(cr->peer_url),linphone_uri_get_username(from))==0) return TRUE;
bool_t linphone_chat_room_matches(LinphoneChatRoom *cr, const LinphoneAddress *from){
if (linphone_address_get_username(cr->peer_url) && linphone_address_get_username(from) &&
strcmp(linphone_address_get_username(cr->peer_url),linphone_address_get_username(from))==0) return TRUE;
return FALSE;
}
......@@ -76,7 +76,7 @@ void linphone_core_text_received(LinphoneCore *lc, eXosip_event_t *ev){
char *from;
osip_from_t *from_url=ev->request->from;
osip_body_t *body=NULL;
LinphoneUri *uri;
LinphoneAddress *uri;
osip_message_get_body(ev->request,0,&body);
if (body==NULL){
......@@ -85,9 +85,9 @@ void linphone_core_text_received(LinphoneCore *lc, eXosip_event_t *ev){
}
msg=body->body;
osip_from_to_str(from_url,&from);
uri=linphone_uri_new(from);
uri=linphone_address_new(from);
osip_free(from);
linphone_uri_clean(uri);
linphone_address_clean(uri);
for(elem=lc->chatrooms;elem!=NULL;elem=ms_list_next(elem)){
cr=(LinphoneChatRoom*)elem->data;
if (linphone_chat_room_matches(cr,uri)){
......@@ -95,12 +95,12 @@ void linphone_core_text_received(LinphoneCore *lc, eXosip_event_t *ev){
}
cr=NULL;
}
from=linphone_uri_as_string(uri);
from=linphone_address_as_string(uri);
if (cr==NULL){
/* create a new chat room */
cr=linphone_core_create_chat_room(lc,from);
}
linphone_uri_destroy(uri);
linphone_address_destroy(uri);
linphone_chat_room_text_received(cr,lc,from,msg);
ms_free(from);
}
......
......@@ -321,7 +321,7 @@ int linphone_inc_new_call(LinphoneCore *lc, eXosip_event_t *ev)
eXosip_unlock();
goto end;
}
lc->call=linphone_call_new_incoming(lc,linphone_uri_new(from),linphone_uri_new(to),ev);
lc->call=linphone_call_new_incoming(lc,linphone_address_new(from),linphone_address_new(to),ev);
sdp=eXosip_get_sdp_info(ev->request);
if (sdp==NULL){
......
......@@ -77,19 +77,19 @@ const char *linphone_online_status_to_string(LinphoneOnlineStatus ss){
}
static int friend_data_compare(const void * a, const void * b, void * data){
LinphoneUri *fa=((LinphoneFriend*)a)->uri;
LinphoneUri *fb=((LinphoneFriend*)b)->uri;
LinphoneAddress *fa=((LinphoneFriend*)a)->uri;
LinphoneAddress *fb=((LinphoneFriend*)b)->uri;
const char *ua,*ub;
ua=linphone_uri_get_username(fa);
ub=linphone_uri_get_username(fb);
ua=linphone_address_get_username(fa);
ub=linphone_address_get_username(fb);
if (ua!=NULL && ub!=NULL) {
//printf("Comparing usernames %s,%s\n",ua,ub);
return strcasecmp(ua,ub);
}
else {
/* compare hosts*/
ua=linphone_uri_get_domain(fa);
ub=linphone_uri_get_domain(fb);
ua=linphone_address_get_domain(fa);
ub=linphone_address_get_domain(fb);
if (ua!=NULL && ub!=NULL){
int ret=strcasecmp(ua,ub);
//printf("Comparing hostnames %s,%s,res=%i\n",ua,ub,ret);
......@@ -104,11 +104,11 @@ static int friend_compare(const void * a, const void * b){
}
MSList *linphone_find_friend(MSList *fl, const LinphoneUri *friend, LinphoneFriend **lf){
MSList *linphone_find_friend(MSList *fl, const LinphoneAddress *friend, LinphoneFriend **lf){
MSList *res=NULL;
LinphoneFriend dummy;
if (lf!=NULL) *lf=NULL;
dummy.uri=(LinphoneUri*)friend;
dummy.uri=(LinphoneAddress*)friend;
res=ms_list_find_custom(fl,friend_compare,&dummy);
if (lf!=NULL && res!=NULL) *lf=(LinphoneFriend*)res->data;
return res;
......@@ -137,7 +137,7 @@ void __linphone_friend_do_subscribe(LinphoneFriend *fr){
const char *route=NULL;
const char *from=NULL;
osip_message_t *msg=NULL;
friend=linphone_uri_as_string(fr->uri);
friend=linphone_address_as_string(fr->uri);
if (fr->proxy!=NULL){
route=fr->proxy->reg_route;
from=fr->proxy->reg_identity;
......@@ -176,26 +176,26 @@ LinphoneFriend *linphone_friend_new_with_addr(const char *addr){
}
void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char **result){
LinphoneUri *fr=NULL;
LinphoneAddress *fr=NULL;
*result=NULL;
fr=linphone_uri_new(uri);
fr=linphone_address_new(uri);
if (fr==NULL){
char *tmp=NULL;
if (strchr(uri,'@')!=NULL){
LinphoneUri *u;
LinphoneAddress *u;
/*try adding sip:*/
tmp=ms_strdup_printf("sip:%s",uri);
u=linphone_uri_new(tmp);
u=linphone_address_new(tmp);
if (u!=NULL){
*result=tmp;
}
}else if (lc->default_proxy!=NULL){
/*try adding domain part from default current proxy*/
LinphoneUri * id=linphone_uri_new(linphone_core_get_identity(lc));
LinphoneAddress * id=linphone_address_new(linphone_core_get_identity(lc));
if (id!=NULL){
linphone_uri_set_username(id,uri);
*result=linphone_uri_as_string(id);
linphone_uri_destroy(id);
linphone_address_set_username(id,uri);
*result=linphone_address_as_string(id);
linphone_address_destroy(id);
}
}
if (*result){
......@@ -204,28 +204,28 @@ void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char
}else{
ms_warning("Fail to interpret friend uri %s",uri);
}
}else *result=linphone_uri_as_string(fr);
linphone_uri_destroy(fr);
}else *result=linphone_address_as_string(fr);
linphone_address_destroy(fr);
}
int linphone_friend_set_sip_addr(LinphoneFriend *lf, const char *addr){
LinphoneUri *fr=linphone_uri_new(addr);
LinphoneAddress *fr=linphone_address_new(addr);
if (fr==NULL) {
ms_warning("Invalid friend sip uri: %s",addr);
return -1;
}
if (lf->uri!=NULL) linphone_uri_destroy(lf->uri);
if (lf->uri!=NULL) linphone_address_destroy(lf->uri);
lf->uri=fr;
return 0;
}
int linphone_friend_set_name(LinphoneFriend *lf, const char *name){
LinphoneUri *fr=lf->uri;
LinphoneAddress *fr=lf->uri;
if (fr==NULL){
ms_error("linphone_friend_set_sip_addr() must be called before linphone_friend_set_name().");
return -1;
}
linphone_uri_set_display_name(fr,name);
linphone_address_set_display_name(fr,name);
return 0;
}
......@@ -553,7 +553,7 @@ static void linphone_friend_unsubscribe(LinphoneFriend *lf){
void linphone_friend_destroy(LinphoneFriend *lf){
linphone_friend_notify(lf,EXOSIP_SUBCRSTATE_TERMINATED,LINPHONE_STATUS_CLOSED);
linphone_friend_unsubscribe(lf);
if (lf->uri!=NULL) linphone_uri_destroy(lf->uri);
if (lf->uri!=NULL) linphone_address_destroy(lf->uri);
if (lf->info!=NULL) buddy_info_free(lf->info);
ms_free(lf);
}
......@@ -564,7 +564,7 @@ void linphone_friend_check_for_removed_proxy(LinphoneFriend *lf, LinphoneProxyCo
}
}
const LinphoneUri *linphone_friend_get_uri(const LinphoneFriend *lf){
const LinphoneAddress *linphone_friend_get_uri(const LinphoneFriend *lf){
return lf->uri;
}
......@@ -653,10 +653,10 @@ static bool_t username_match(const char *u1, const char *u2){
}
LinphoneFriend *linphone_core_get_friend_by_uri(const LinphoneCore *lc, const char *uri){
LinphoneUri *puri=linphone_uri_new(uri);
LinphoneAddress *puri=linphone_address_new(uri);
const MSList *elem;
const char *username=linphone_uri_get_username(puri);
const char *domain=linphone_uri_get_domain(puri);
const char *username=linphone_address_get_username(puri);
const char *domain=linphone_address_get_domain(puri);
LinphoneFriend *lf=NULL;
if (puri==NULL){
......@@ -664,14 +664,14 @@ LinphoneFriend *linphone_core_get_friend_by_uri(const LinphoneCore *lc, const ch
}
for(elem=lc->friends;elem!=NULL;elem=ms_list_next(elem)){
lf=(LinphoneFriend*)elem->data;
const char *it_username=linphone_uri_get_username(lf->uri);
const char *it_host=linphone_uri_get_domain(lf->uri);;
const char *it_username=linphone_address_get_username(lf->uri);
const char *it_host=linphone_address_get_domain(lf->uri);;
if (strcasecmp(domain,it_host)==0 && username_match(username,it_username)){
break;
}
lf=NULL;
}
linphone_uri_destroy(puri);
linphone_address_destroy(puri);
return lf;
}
......@@ -760,7 +760,7 @@ void linphone_friend_write_to_config_file(LpConfig *config, LinphoneFriend *lf,
return;
}
if (lf->uri!=NULL){
tmp=linphone_uri_as_string(lf->uri);
tmp=linphone_address_as_string(lf->uri);
if (tmp==NULL) {
return;
}
......
This diff is collapsed.
......@@ -147,24 +147,24 @@ typedef struct autoreplier_config
struct osip_from;
typedef struct osip_from LinphoneUri;
LinphoneUri * linphone_uri_new(const char *uri);
LinphoneUri * linphone_uri_clone(const LinphoneUri *uri);
const char *linphone_uri_get_scheme(const LinphoneUri *u);
const char *linphone_uri_get_display_name(const LinphoneUri* u);
const char *linphone_uri_get_username(const LinphoneUri *u);
const char *linphone_uri_get_domain(const LinphoneUri *u);
void linphone_uri_set_display_name(LinphoneUri *u, const char *display_name);
void linphone_uri_set_username(LinphoneUri *uri, const char *username);
void linphone_uri_set_domain(LinphoneUri *uri, const char *host);
void linphone_uri_set_port(LinphoneUri *uri, const char *port);
void linphone_uri_set_port_int(LinphoneUri *uri, int port);
typedef struct osip_from LinphoneAddress;
LinphoneAddress * linphone_address_new(const char *uri);
LinphoneAddress * linphone_address_clone(const LinphoneAddress *uri);
const char *linphone_address_get_scheme(const LinphoneAddress *u);
const char *linphone_address_get_display_name(const LinphoneAddress* u);
const char *linphone_address_get_username(const LinphoneAddress *u);
const char *linphone_address_get_domain(const LinphoneAddress *u);
void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name);
void linphone_address_set_username(LinphoneAddress *uri, const char *username);
void linphone_address_set_domain(LinphoneAddress *uri, const char *host);
void linphone_address_set_port(LinphoneAddress *uri, const char *port);
void linphone_address_set_port_int(LinphoneAddress *uri, int port);
/*remove tags, params etc... so that it is displayable to the user*/
void linphone_uri_clean(LinphoneUri *uri);
char *linphone_uri_as_string(const LinphoneUri *u);
char *linphone_uri_as_string_without_display_name(const LinphoneUri *u);
void linphone_uri_destroy(LinphoneUri *u);
void linphone_address_clean(LinphoneAddress *uri);
char *linphone_address_as_string(const LinphoneAddress *u);
char *linphone_address_as_string_uri_only(const LinphoneAddress *u);
void linphone_address_destroy(LinphoneAddress *u);
struct _LinphoneCore;
struct _sdp_context;
......@@ -184,8 +184,8 @@ typedef enum _LinphoneCallStatus {
typedef struct _LinphoneCallLog{
LinphoneCallDir dir;
LinphoneCallStatus status;
LinphoneUri *from;
LinphoneUri *to;
LinphoneAddress *from;
LinphoneAddress *to;
char start_date[128];
int duration;
} LinphoneCallLog;
......@@ -221,7 +221,7 @@ typedef enum _LinphoneOnlineStatus{
const char *linphone_online_status_to_string(LinphoneOnlineStatus ss);
typedef struct _LinphoneFriend{
LinphoneUri *uri;
LinphoneAddress *uri;
int in_did;
int out_did;
int sid;
......@@ -245,7 +245,7 @@ int linphone_friend_set_proxy(LinphoneFriend *fr, struct _LinphoneProxyConfig *c
void linphone_friend_edit(LinphoneFriend *fr);
void linphone_friend_done(LinphoneFriend *fr);
void linphone_friend_destroy(LinphoneFriend *lf);
const LinphoneUri *linphone_friend_get_uri(const LinphoneFriend *lf);
const LinphoneAddress *linphone_friend_get_uri(const LinphoneFriend *lf);
bool_t linphone_friend_get_send_subscribe(const LinphoneFriend *lf);
LinphoneSubscribePolicy linphone_friend_get_inc_subscribe_policy(const LinphoneFriend *lf);
LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf);
......@@ -350,7 +350,7 @@ struct _LinphoneChatRoom{
struct _LinphoneCore *lc;
char *peer;
char *route;
LinphoneUri *peer_url;
LinphoneAddress *peer_url;
void * user_data;
};
typedef struct _LinphoneChatRoom LinphoneChatRoom;
......@@ -574,7 +574,7 @@ bool_t linphone_core_get_guess_hostname(LinphoneCore *lc);
bool_t linphone_core_ipv6_enabled(LinphoneCore *lc);
void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val);
LinphoneUri *linphone_core_get_primary_contact_parsed(LinphoneCore *lc);
LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc);
/*0= no bandwidth limit*/
void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw);
......@@ -763,7 +763,7 @@ void linphone_core_set_record_file(LinphoneCore *lc, const char *file);
gstate_t linphone_core_get_state(const LinphoneCore *lc, gstate_group_t group);
int linphone_core_get_current_call_duration(const LinphoneCore *lc);
const LinphoneUri *linphone_core_get_remote_uri(LinphoneCore *lc);
const LinphoneAddress *linphone_core_get_remote_uri(LinphoneCore *lc);
int linphone_core_get_mtu(const LinphoneCore *lc);
void linphone_core_set_mtu(LinphoneCore *lc, int mtu);
......@@ -805,7 +805,7 @@ void linphone_core_start_media_streams(LinphoneCore *lc, struct _LinphoneCall *c
void linphone_core_stop_media_streams(LinphoneCore *lc);
const char * linphone_core_get_identity(LinphoneCore *lc);
const char * linphone_core_get_route(LinphoneCore *lc);
bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, LinphoneUri **real_parsed_url, char **route);
bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, LinphoneAddress **real_parsed_url, char **route);
void linphone_core_start_waiting(LinphoneCore *lc, const char *purpose);
void linphone_core_update_progress(LinphoneCore *lc, const char *purpose, float progresses);
void linphone_core_stop_waiting(LinphoneCore *lc);
......
......@@ -35,7 +35,7 @@ void linphone_core_add_subscriber(LinphoneCore *lc, const char *subscriber, int
fl->inc_subscribe_pending=TRUE;
lc->subscribers=ms_list_append(lc->subscribers,(void *)fl);
if (lc->vtable.new_unknown_subscriber!=NULL) {
char *subscriber=linphone_uri_as_string(fl->uri);
char *subscriber=linphone_address_as_string(fl->uri);
lc->vtable.new_unknown_subscriber(lc,fl,subscriber);
ms_free(subscriber);
}
......@@ -74,9 +74,9 @@ void linphone_subscription_new(LinphoneCore *lc, eXosip_event_t *ev){
osip_from_t *from=ev->request->from;
char *tmp;
osip_message_t *msg=NULL;
LinphoneUri *uri;
LinphoneAddress *uri;
osip_from_to_str(ev->request->from,&tmp);
uri=linphone_uri_new(tmp);
uri=linphone_address_new(tmp);
ms_message("Receiving new subscription from %s.",tmp);
/* check if we answer to this subscription */
if (linphone_find_friend(lc->friends,uri,&lf)!=NULL){
......@@ -112,7 +112,7 @@ void linphone_notify_recv(LinphoneCore *lc, eXosip_event_t *ev)
const char *img="sip-closed.png";
char *tmp;
LinphoneFriend *lf;
LinphoneUri *friend=NULL;
LinphoneAddress *friend=NULL;
osip_from_t *from=NULL;
osip_body_t *body=NULL;
LinphoneOnlineStatus estatus=LINPHONE_STATUS_UNKNOWN;
......@@ -169,7 +169,7 @@ void linphone_notify_recv(LinphoneCore *lc, eXosip_event_t *ev)
lf=linphone_find_friend_by_sid(lc->friends,ev->sid);
if (lf!=NULL){
friend=lf->uri;
tmp=linphone_uri_as_string(friend);
tmp=linphone_address_as_string(friend);
lf->status=estatus;
lc->vtable.notify_recv(lc,(LinphoneFriend*)lf,tmp,status,img);
ms_free(tmp);
......@@ -188,7 +188,7 @@ void linphone_subscription_answered(LinphoneCore *lc, eXosip_event_t *ev){
osip_from_t *from=ev->response->to;
char *tmp;
osip_from_to_str(from,&tmp);
LinphoneUri *uri=linphone_uri_new(tmp);
LinphoneAddress *uri=linphone_address_new(tmp);
linphone_find_friend(lc->friends,uri,&lf);
if (lf!=NULL){
lf->out_did=ev->did;
......
......@@ -100,13 +100,13 @@ typedef struct _LinphoneCall
bool_t supports_session_timers;
} LinphoneCall;
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneUri *from, LinphoneUri *to);
LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, LinphoneUri *from, LinphoneUri *to, eXosip_event_t *ev);
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to);
LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, eXosip_event_t *ev);
#define linphone_call_set_state(lcall,st) (lcall)->state=(st)
void linphone_call_destroy(struct _LinphoneCall *obj);
/* private: */
LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, LinphoneUri *local, LinphoneUri * remote);
LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, LinphoneAddress *local, LinphoneAddress * remote);
void linphone_call_log_completed(LinphoneCallLog *calllog, LinphoneCall *call);
void linphone_call_log_destroy(LinphoneCallLog *cl);
......@@ -176,7 +176,7 @@ void linphone_call_init_media_params(LinphoneCall *call);
void linphone_set_sdp(osip_message_t *sip, const char *sdp);
MSList *linphone_find_friend(MSList *fl, const LinphoneUri *fri, LinphoneFriend **lf);
MSList *linphone_find_friend(MSList *fl, const LinphoneAddress *fri, LinphoneFriend **lf);
LinphoneFriend *linphone_find_friend_by_nid(MSList *l, int nid);
LinphoneFriend *linphone_find_friend_by_sid(MSList *l, int sid);
......@@ -187,7 +187,7 @@ void linphone_core_run_stun_tests(LinphoneCore *lc, LinphoneCall *call);
void linphone_core_write_friends_config(LinphoneCore* lc);
void linphone_proxy_config_update(LinphoneProxyConfig *cfg);
void linphone_proxy_config_get_contact(LinphoneProxyConfig *cfg, const char **ip, int *port);
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneUri *uri);
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneAddress *uri);
int linphone_core_get_local_ip_for(const char *dest, char *result);
#endif /* _PRIVATE_H */
......@@ -30,13 +30,13 @@ static void sip_login_init_instance(SipSetupContext *ctx){
linphone_proxy_config_enable_register(cfg,FALSE);
}
static void guess_display_name(LinphoneUri *from){
char *dn=(char*)ms_malloc(strlen(linphone_uri_get_username(from))+3);
static void guess_display_name(LinphoneAddress *from){
char *dn=(char*)ms_malloc(strlen(linphone_address_get_username(from))+3);
const char *it;
char *wptr=dn;
bool_t begin=TRUE;
bool_t surname=0;
for(it=linphone_uri_get_username(from);*it!='\0';++it){
for(it=linphone_address_get_username(from);*it!='\0';++it){
if (begin){
*wptr=toupper(*it);
begin=FALSE;
......@@ -48,7 +48,7 @@ static void guess_display_name(LinphoneUri *from){
}else *wptr=*it;
wptr++;
}
linphone_uri_set_display_name(from,dn);
linphone_address_set_display_name(from,dn);
ms_free(dn);
}
......@@ -56,26 +56,26 @@ static int sip_login_do_login(SipSetupContext * ctx, const char *uri, const char
LinphoneProxyConfig *cfg=sip_setup_context_get_proxy_config(ctx);
LinphoneCore *lc=linphone_proxy_config_get_core(cfg);
LinphoneAuthInfo *auth;
LinphoneUri *parsed_uri;
LinphoneAddress *parsed_uri;
char *tmp;
parsed_uri=linphone_uri_new(uri);
parsed_uri=linphone_address_new(uri);
if (parsed_uri==NULL){
return -1;
}
if (linphone_uri_get_display_name(parsed_uri)!=NULL){
if (linphone_address_get_display_name(parsed_uri)!=NULL){
guess_display_name(parsed_uri);
}
tmp=linphone_uri_as_string(parsed_uri);
tmp=linphone_address_as_string(parsed_uri);
linphone_proxy_config_set_identity(cfg,tmp);
if (passwd ) {
auth=linphone_auth_info_new(linphone_uri_get_username(parsed_uri),NULL,passwd,NULL,NULL);
auth=linphone_auth_info_new(linphone_address_get_username(parsed_uri),NULL,passwd,NULL,NULL);
linphone_core_add_auth_info(lc,auth);
}
linphone_proxy_config_enable_register(cfg,TRUE);
linphone_proxy_config_done(cfg);
ms_free(tmp);
linphone_uri_destroy(parsed_uri);
linphone_address_destroy(parsed_uri);
ms_message("SipLogin: done");
return 0;
}
......
......@@ -136,14 +136,14 @@ int sip_setup_context_account_exists(SipSetupContext *ctx, const char *uri){
}
int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, const char *passwd){
LinphoneUri *from=linphone_uri_new(uri);
LinphoneAddress *from=linphone_address_new(uri);
if (from==NULL) {
ms_warning("Fail to parse %s",uri);
return -1;
}
strncpy(ctx->domain,linphone_uri_get_domain(from),sizeof(ctx->domain));
strncpy(ctx->username,linphone_uri_get_username(from),sizeof(ctx->username));
linphone_uri_destroy(from);
strncpy(ctx->domain,linphone_address_get_domain(from),sizeof(ctx->domain));
strncpy(ctx->username,linphone_address_get_username(from),sizeof(ctx->username));
linphone_address_destroy(from);
if (ctx->funcs->login_account)
return ctx->funcs->login_account(ctx,uri,passwd);
return -1;
......
......@@ -104,7 +104,7 @@ static void linphone_gtk_set_selection_to_uri_bar(GtkTreeView *treeview){
if (gtk_tree_selection_get_selected (select, &model, &iter))
{
gtk_tree_model_get (model, &iter,FRIEND_ID , &lf, -1);
friend=linphone_uri_as_string(linphone_friend_get_uri(lf));
friend=linphone_address_as_string(linphone_friend_get_uri(lf));
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"uribar")),friend);
ms_free(friend);
}
......@@ -309,9 +309,9 @@ void linphone_gtk_show_friends(void){
for(itf=linphone_core_get_friend_list(core);itf!=NULL;itf=ms_list_next(itf)){
LinphoneFriend *lf=(LinphoneFriend*)itf->data;
const LinphoneUri *f_uri=linphone_friend_get_uri(lf);
char *uri=linphone_uri_as_string(f_uri);
const char *name=linphone_uri_get_display_name(f_uri);
const LinphoneAddress *f_uri=linphone_friend_get_uri(lf);
char *uri=linphone_address_as_string(f_uri);
const char *name=linphone_address_get_display_name(f_uri);
const char *display=name;
char *escaped=NULL;
if (lookup){
......@@ -376,9 +376,9 @@ void linphone_gtk_show_contact(LinphoneFriend *lf){
GtkWidget *w=linphone_gtk_create_window("contact");
char *uri;
const char *name;
const LinphoneUri *f_uri=linphone_friend_get_uri(lf);
uri=linphone_uri_as_string_without_display_name(f_uri);
name=linphone_uri_get_display_name(f_uri);
const LinphoneAddress *f_uri=linphone_friend_get_uri(lf);
uri=linphone_address_as_string_uri_only(f_uri);
name=linphone_address_get_display_name(f_uri);
if (uri) {
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(w,"sip_address")),uri);
ms_free(uri);
......@@ -419,7 +419,7 @@ void linphone_gtk_chat_selected(GtkWidget *item){
{
char *uri;
gtk_tree_model_get (model, &iter,FRIEND_ID , &lf, -1);
uri=linphone_uri_as_string(linphone_friend_get_uri(lf));
uri=linphone_address_as_string(linphone_friend_get_uri(lf));
linphone_gtk_create_chatroom(uri);
ms_free(uri);
}
......
......@@ -53,7 +53,7 @@ void linphone_gtk_show_idle_view(void){
}
void display_peer_name_in_label(GtkWidget *label, const char *uri){
LinphoneUri *from;
LinphoneAddress *from;
const char *displayname=NULL;
char *id=NULL;
char *uri_label;
......@@ -63,13 +63,13 @@ void display_peer_name_in_label(GtkWidget *label, const char *uri){
return;
}
from=linphone_uri_new(uri);
from=linphone_address_new(uri);
if (from!=NULL){
if (linphone_uri_get_display_name(from))
displayname=linphone_uri_get_display_name(from);
if (linphone_address_get_display_name(from))
displayname=linphone_address_get_display_name(from);
id=linphone_uri_as_string_without_display_name(from);
id=linphone_address_as_string_uri_only(from);
}else id=ms_strdup(uri);
......@@ -81,7 +81,7 @@ void display_peer_name_in_label(GtkWidget *label, const char *uri){
gtk_label_set_markup(GTK_LABEL(label),uri_label);
ms_free(id);
g_free(uri_label);
if (from!=NULL) linphone_uri_destroy(from);
if (from!=NULL) linphone_address_destroy(from);
}
void linphone_gtk_in_call_view_set_calling(const char *uri){
......@@ -113,8 +113,8 @@ void linphone_gtk_in_call_view_set_in_call(){
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
GtkWidget *terminate_button=linphone_gtk_get_widget(main_window,"in_call_terminate");
const LinphoneUri *uri=linphone_core_get_remote_uri(lc);
char *tmp=linphone_uri_as_string(uri);
const LinphoneAddress *uri=linphone_core_get_remote_uri(lc);
char *tmp=linphone_address_as_string(uri);
display_peer_name_in_label(callee,tmp);
ms_free(tmp);
......
......@@ -57,7 +57,7 @@ void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg){
GtkWidget *label=linphone_gtk_get_widget(mw,"login_label");
LinphoneAuthInfo *ai;
gchar *str;
LinphoneUri *from;
LinphoneAddress *from;
LinphoneCore *lc=linphone_gtk_get_core();
int nettype;
......@@ -84,17 +84,17 @@ void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg){
g_object_set_data(G_OBJECT(mw),"login_proxy_config",cfg);
g_free(str);
from=linphone_uri_new(linphone_proxy_config_get_identity(cfg));
from=linphone_address_new(linphone_proxy_config_get_identity(cfg));
ai=linphone_core_find_auth_info(lc,linphone_proxy_config_get_domain(cfg),linphone_uri_get_username(from));
ai=linphone_core_find_auth_info(lc,linphone_proxy_config_get_domain(cfg),linphone_address_get_username(from));
/*display the last entered username, if not '?????'*/
if (linphone_uri_get_username(from)[0]!='?')
if (linphone_address_get_username(from)[0]!='?')
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(mw,"login_username")),
linphone_uri_get_username(from));
linphone_address_get_username(from));
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(mw,"login_password")),
ai!=NULL ? ai->passwd : "");
linphone_uri_destroy(from);
linphone_address_destroy(from);
}
void linphone_gtk_exit_login_frame(void){
......@@ -129,7 +129,7 @@ void linphone_gtk_login_frame_connect_clicked(GtkWidget *button){
char *identity;
gboolean autologin;
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)g_object_get_data(G_OBJECT(mw),"login_proxy_config");
LinphoneUri *from;
LinphoneAddress *from;
SipSetupContext *ssctx=linphone_proxy_config_get_sip_setup_context(cfg);
username=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(mw,"login_username")));
......@@ -141,9 +141,9 @@ void linphone_gtk_login_frame_connect_clicked(GtkWidget *button){
autologin=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(mw,"automatic_login")));
linphone_gtk_set_ui_config_int("automatic_login",autologin);
from=linphone_uri_new(linphone_proxy_config_get_identity(cfg));
linphone_uri_set_username(from,username);
identity=linphone_uri_as_string(from);
from=linphone_address_new(linphone_proxy_config_get_identity(cfg));
linphone_address_set_username(from,username);
identity=linphone_address_as_string(from);
do_login(ssctx,identity,password);
/*we need to refresh the identities since the proxy config may have changed.*/
linphone_gtk_load_identities();
......
......@@ -371,12 +371,12 @@ static void set_video_window_decorations(GdkWindow *w){
if (!linphone_core_in_call(linphone_gtk_get_core())){
snprintf(video_title,sizeof(video_title),"%s video",title);
}else{
const LinphoneUri *uri=linphone_core_get_remote_uri(linphone_gtk_get_core());
const LinphoneAddress *uri=linphone_core_get_remote_uri(linphone_gtk_get_core());