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
This commit is contained in:
smorlat 2009-11-26 11:11:30 +00:00
parent 9364a66893
commit 863381c3aa
15 changed files with 196 additions and 196 deletions

View file

@ -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;

View file

@ -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);
}

View file

@ -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){

View file

@ -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;
}

View file

@ -73,7 +73,7 @@ int lc_callback_obj_invoke(LCCallbackObj *obj, LinphoneCore *lc){
return 0;
}
static void linphone_call_init_common(LinphoneCall *call, LinphoneUri *from, LinphoneUri *to){
static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from, LinphoneAddress *to){
call->state=LCStateInit;
call->start_time=time(NULL);
call->media_start_time=0;
@ -102,7 +102,7 @@ static void discover_mtu(LinphoneCore *lc, const char *remote){
}
}
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneUri *from, LinphoneUri *to)
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to)
{
LinphoneCall *call=ms_new0(LinphoneCall,1);
call->dir=LinphoneCallOutgoing;
@ -110,20 +110,20 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneUri
call->did=-1;
call->tid=-1;
call->core=lc;
linphone_core_get_local_ip(lc,linphone_uri_get_domain(to),call->localip);
linphone_core_get_local_ip(lc,linphone_address_get_domain(to),call->localip);
linphone_call_init_common(call,from,to);
call->sdpctx=sdp_handler_create_context(&linphone_sdphandler,
call->audio_params.natd_port>0 ? call->audio_params.natd_addr : call->localip,
linphone_uri_get_username (from),NULL);
linphone_address_get_username (from),NULL);
sdp_context_set_user_pointer(call->sdpctx,(void*)call);
discover_mtu(lc,linphone_uri_get_domain (to));
discover_mtu(lc,linphone_address_get_domain (to));
return call;
}
LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneUri *from, LinphoneUri *to, eXosip_event_t *ev){
LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, eXosip_event_t *ev){
LinphoneCall *call=ms_new0(LinphoneCall,1);
LinphoneUri *me=linphone_core_get_primary_contact_parsed(lc);
LinphoneAddress *me=linphone_core_get_primary_contact_parsed(lc);
osip_header_t *h=NULL;
call->dir=LinphoneCallIncoming;
@ -132,16 +132,16 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneUri *from, L
call->tid=ev->tid;
call->core=lc;
linphone_uri_clean(from);
linphone_address_clean(from);
linphone_core_get_local_ip(lc,linphone_uri_get_domain(from),call->localip);
linphone_core_get_local_ip(lc,linphone_address_get_domain(from),call->localip);
linphone_call_init_common(call, from, to);
call->sdpctx=sdp_handler_create_context(&linphone_sdphandler,
call->audio_params.natd_port>0 ? call->audio_params.natd_addr : call->localip,
linphone_uri_get_username (me),NULL);
linphone_address_get_username (me),NULL);
sdp_context_set_user_pointer(call->sdpctx,(void*)call);
discover_mtu(lc,linphone_uri_get_domain(from));
linphone_uri_destroy(me);
discover_mtu(lc,linphone_address_get_domain(from));
linphone_address_destroy(me);
osip_message_header_get_byname(ev->request,"Session-expires",0,&h);
if (h) call->supports_session_timers=TRUE;
return call;
@ -162,7 +162,7 @@ static size_t my_strftime(char *s, size_t max, const char *fmt, const struct t
return strftime(s, max, fmt, tm);
}
LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, LinphoneUri *from, LinphoneUri *to){
LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, LinphoneAddress *from, LinphoneAddress *to){
LinphoneCallLog *cl=ms_new0(LinphoneCallLog,1);
struct tm loctime;
cl->dir=call->dir;
@ -215,8 +215,8 @@ void linphone_call_log_completed(LinphoneCallLog *calllog, LinphoneCall *call){
char * linphone_call_log_to_str(LinphoneCallLog *cl){
char *status;
char *tmp;
char *from=linphone_uri_as_string (cl->from);
char *to=linphone_uri_as_string (cl->to);
char *from=linphone_address_as_string (cl->from);
char *to=linphone_address_as_string (cl->to);
switch(cl->status){
case LinphoneCallAborted:
status=_("aborted");
@ -256,7 +256,7 @@ int linphone_core_get_current_call_duration(const LinphoneCore *lc){
return time(NULL)-call->media_start_time;
}
const LinphoneUri *linphone_core_get_remote_uri(LinphoneCore *lc){
const LinphoneAddress *linphone_core_get_remote_uri(LinphoneCore *lc){
LinphoneCall *call=lc->call;
if (call==NULL) return 0;
return call->dir==LinphoneCallIncoming ? call->log->from : call->log->to;
@ -859,8 +859,8 @@ bool_t linphone_core_get_guess_hostname(LinphoneCore *lc){
return lc->sip_conf.guess_hostname;
}
LinphoneUri *linphone_core_get_primary_contact_parsed(LinphoneCore *lc){
return linphone_uri_new(linphone_core_get_primary_contact(lc));
LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc){
return linphone_address_new(linphone_core_get_primary_contact(lc));
}
int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs)
@ -1086,9 +1086,9 @@ static void linphone_core_grab_buddy_infos(LinphoneCore *lc, LinphoneProxyConfig
LinphoneFriend *lf=(LinphoneFriend*)elem->data;
if (lf->info==NULL){
if (linphone_core_lookup_known_proxy(lc,lf->uri)==cfg){
if (linphone_uri_get_username(lf->uri)!=NULL){
if (linphone_address_get_username(lf->uri)!=NULL){
BuddyLookupRequest *req;
char *tmp=linphone_uri_as_string_without_display_name(lf->uri);
char *tmp=linphone_address_as_string_uri_only(lf->uri);
req=sip_setup_context_create_buddy_lookup_request(ctx);
buddy_lookup_request_set_key(req,tmp);
buddy_lookup_request_set_max_results(req,1);
@ -1229,7 +1229,7 @@ static char *guess_route_if_any(LinphoneCore *lc, osip_to_t *parsed_url){
return NULL;
}
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){
enum_lookup_res_t *enumres=NULL;
osip_to_t *parsed_url=NULL;
char *enum_domain=NULL;
@ -1249,7 +1249,7 @@ bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, LinphoneUr
}
ms_free(enum_domain);
tmpurl=enumres->sip_address[0];
if (real_parsed_url!=NULL) *real_parsed_url=linphone_uri_new(tmpurl);
if (real_parsed_url!=NULL) *real_parsed_url=linphone_address_new(tmpurl);
enum_lookup_res_free(enumres);
if (tmproute) *route=ms_strdup(tmproute);
return TRUE;
@ -1260,13 +1260,13 @@ bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, LinphoneUr
proxy=lc->default_proxy;
if (proxy!=NULL){
/* append the proxy domain suffix */
LinphoneUri *uri;
LinphoneAddress *uri;
const char *identity=linphone_proxy_config_get_identity(proxy);
uri=linphone_uri_new(identity);
uri=linphone_address_new(identity);
if (uri==NULL){
return FALSE;
}
linphone_uri_set_username(uri,url);
linphone_address_set_username(uri,url);
if (real_parsed_url!=NULL) *real_parsed_url=uri;
#if 0
/*if the prompted uri was auto-suffixed with proxy domain,
@ -1292,10 +1292,10 @@ bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, LinphoneUr
return TRUE;
}
}
parsed_url=linphone_uri_new(url);
parsed_url=linphone_address_new(url);
if (parsed_url!=NULL){
if (real_parsed_url!=NULL) *real_parsed_url=parsed_url;
else linphone_uri_destroy(parsed_url);
else linphone_address_destroy(parsed_url);
if (tmproute) *route=ms_strdup(tmproute);
else *route=guess_route_if_any(lc,*real_parsed_url);
return TRUE;
@ -1336,13 +1336,13 @@ void linphone_set_sdp(osip_message_t *sip, const char *sdpmesg){
osip_message_set_content_length(sip,clen);
}
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneUri *uri){
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneAddress *uri){
const MSList *elem;
LinphoneProxyConfig *found_cfg=NULL;
for (elem=linphone_core_get_proxy_config_list(lc);elem!=NULL;elem=elem->next){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
const char *domain=linphone_proxy_config_get_domain(cfg);
if (domain!=NULL && strcmp(domain,linphone_uri_get_domain(uri))==0){
if (domain!=NULL && strcmp(domain,linphone_address_get_domain(uri))==0){
found_cfg=cfg;
break;
}
@ -1393,8 +1393,8 @@ int linphone_core_invite(LinphoneCore *lc, const char *url)
osip_message_t *invite=NULL;
sdp_context_t *ctx=NULL;
LinphoneProxyConfig *proxy=NULL;
LinphoneUri *parsed_url2=NULL;
LinphoneUri *real_parsed_url=NULL;
LinphoneAddress *parsed_url2=NULL;
LinphoneAddress *real_parsed_url=NULL;
char *real_url=NULL;
LinphoneProxyConfig *dest_proxy=NULL;
@ -1410,7 +1410,7 @@ int linphone_core_invite(LinphoneCore *lc, const char *url)
gstate_new_state(lc, GSTATE_CALL_ERROR, NULL);
return -1;
}
real_url=linphone_uri_as_string(real_parsed_url);
real_url=linphone_address_as_string(real_parsed_url);
dest_proxy=linphone_core_lookup_known_proxy(lc,real_parsed_url);
if (proxy!=dest_proxy && dest_proxy!=NULL) {
@ -1438,7 +1438,7 @@ int linphone_core_invite(LinphoneCore *lc, const char *url)
}
/* make sdp message */
parsed_url2=linphone_uri_new(from);
parsed_url2=linphone_address_new(from);
lc->call=linphone_call_new_outgoing(lc,parsed_url2,real_parsed_url);
/*try to be best-effort in giving real local or routable contact address,
@ -1479,7 +1479,7 @@ int linphone_core_invite(LinphoneCore *lc, const char *url)
int linphone_core_refer(LinphoneCore *lc, const char *url)
{
char *real_url=NULL;
LinphoneUri *real_parsed_url=NULL;
LinphoneAddress *real_parsed_url=NULL;
LinphoneCall *call;
osip_message_t *msg=NULL;
char *route;
@ -1494,7 +1494,7 @@ int linphone_core_refer(LinphoneCore *lc, const char *url)
return -1;
}
lc->call=NULL;
real_url=linphone_uri_as_string (real_parsed_url);
real_url=linphone_address_as_string (real_parsed_url);
eXosip_call_build_refer(call->did, real_url, &msg);
ms_free(real_url);
eXosip_lock();
@ -1690,14 +1690,14 @@ static void post_configure_audio_streams(LinphoneCore *lc){
}
void linphone_core_start_media_streams(LinphoneCore *lc, LinphoneCall *call){
LinphoneUri *me=linphone_core_get_primary_contact_parsed(lc);
LinphoneAddress *me=linphone_core_get_primary_contact_parsed(lc);
const char *tool="linphone-" LINPHONE_VERSION;
/* adjust rtp jitter compensation. It must be at least the latency of the sound card */
int jitt_comp=MAX(lc->sound_conf.latency,lc->rtp_conf.audio_jitt_comp);
if (call->media_start_time==0) call->media_start_time=time(NULL);
char *cname=ortp_strdup_printf("%s@%s",linphone_uri_get_username(me),linphone_uri_get_domain(me));
char *cname=ortp_strdup_printf("%s@%s",linphone_address_get_username(me),linphone_address_get_domain(me));
{
StreamParams *audio_params=&call->audio_params;
if (!lc->use_files){
@ -1776,7 +1776,7 @@ void linphone_core_start_media_streams(LinphoneCore *lc, LinphoneCall *call){
goto end;
end:
ms_free(cname);
linphone_uri_destroy(me);
linphone_address_destroy(me);
lc->call->state=LCStateAVRunning;
}
@ -2777,7 +2777,7 @@ void linphone_core_destroy(LinphoneCore *lc){
ms_free(lc);
}
LinphoneUri * linphone_uri_new(const char *uri){
LinphoneAddress * linphone_address_new(const char *uri){
osip_from_t *from;
osip_from_init(&from);
if (osip_from_parse(from,uri)!=0){
@ -2787,7 +2787,7 @@ LinphoneUri * linphone_uri_new(const char *uri){
return from;
}
LinphoneUri * linphone_uri_clone(const LinphoneUri *uri){
LinphoneAddress * linphone_address_clone(const LinphoneAddress *uri){
osip_from_t *ret=NULL;
osip_from_clone(uri,&ret);
return ret;
@ -2795,23 +2795,23 @@ LinphoneUri * linphone_uri_clone(const LinphoneUri *uri){
#define null_if_empty(s) (((s)!=NULL && (s)[0]!='\0') ? (s) : NULL )
const char *linphone_uri_get_scheme(const LinphoneUri *u){
const char *linphone_address_get_scheme(const LinphoneAddress *u){
return null_if_empty(u->url->scheme);
}
const char *linphone_uri_get_display_name(const LinphoneUri* u){
const char *linphone_address_get_display_name(const LinphoneAddress* u){
return null_if_empty(u->displayname);
}
const char *linphone_uri_get_username(const LinphoneUri *u){
const char *linphone_address_get_username(const LinphoneAddress *u){
return null_if_empty(u->url->username);
}
const char *linphone_uri_get_domain(const LinphoneUri *u){
const char *linphone_address_get_domain(const LinphoneAddress *u){
return null_if_empty(u->url->host);
}
void linphone_uri_set_display_name(LinphoneUri *u, const char *display_name){
void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name){
if (u->displayname!=NULL){
osip_free(u->displayname);
u->displayname=NULL;
@ -2820,7 +2820,7 @@ void linphone_uri_set_display_name(LinphoneUri *u, const char *display_name){
u->displayname=osip_strdup(display_name);
}
void linphone_uri_set_username(LinphoneUri *uri, const char *username){
void linphone_address_set_username(LinphoneAddress *uri, const char *username){
if (uri->url->username!=NULL){
osip_free(uri->url->username);
uri->url->username=NULL;
@ -2829,7 +2829,7 @@ void linphone_uri_set_username(LinphoneUri *uri, const char *username){
uri->url->username=osip_strdup(username);
}
void linphone_uri_set_domain(LinphoneUri *uri, const char *host){
void linphone_address_set_domain(LinphoneAddress *uri, const char *host){
if (uri->url->host!=NULL){
osip_free(uri->url->host);
uri->url->host=NULL;
@ -2838,7 +2838,7 @@ void linphone_uri_set_domain(LinphoneUri *uri, const char *host){
uri->url->host=osip_strdup(host);
}
void linphone_uri_set_port(LinphoneUri *uri, const char *port){
void linphone_address_set_port(LinphoneAddress *uri, const char *port){
if (uri->url->port!=NULL){
osip_free(uri->url->port);
uri->url->port=NULL;
@ -2847,22 +2847,22 @@ void linphone_uri_set_port(LinphoneUri *uri, const char *port){
uri->url->port=osip_strdup(port);
}
void linphone_uri_set_port_int(LinphoneUri *uri, int port){
void linphone_address_set_port_int(LinphoneAddress *uri, int port){
char tmp[12];
if (port==5060){
/*this is the default, special case to leave the port field blank*/
linphone_uri_set_port(uri,NULL);
linphone_address_set_port(uri,NULL);
return;
}
snprintf(tmp,sizeof(tmp),"%i",port);
linphone_uri_set_port(uri,tmp);
linphone_address_set_port(uri,tmp);
}
void linphone_uri_clean(LinphoneUri *uri){
void linphone_address_clean(LinphoneAddress *uri){
osip_generic_param_freelist(&uri->gen_params);
}
char *linphone_uri_as_string(const LinphoneUri *u){
char *linphone_address_as_string(const LinphoneAddress *u){
char *tmp,*ret;
osip_from_to_str(u,&tmp);
ret=ms_strdup(tmp);
@ -2870,7 +2870,7 @@ char *linphone_uri_as_string(const LinphoneUri *u){
return ret;
}
char *linphone_uri_as_string_without_display_name(const LinphoneUri *u){
char *linphone_address_as_string_uri_only(const LinphoneAddress *u){
char *tmp=NULL,*ret;
osip_uri_to_str(u->url,&tmp);
ret=ms_strdup(tmp);
@ -2878,6 +2878,6 @@ char *linphone_uri_as_string_without_display_name(const LinphoneUri *u){
return ret;
}
void linphone_uri_destroy(LinphoneUri *u){
void linphone_address_destroy(LinphoneAddress *u){
osip_from_free(u);
}

View file

@ -147,24 +147,24 @@ typedef struct autoreplier_config
struct osip_from;
typedef struct osip_from LinphoneUri;
typedef struct osip_from LinphoneAddress;
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);
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);

View file

@ -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;

View file

@ -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 */

View file

@ -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;
}

View file

@ -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;

View file

@ -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);
}

View file

@ -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);

View file

@ -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();

View file

@ -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());
char *display_name;
if (linphone_uri_get_display_name(uri)!=NULL)
display_name=ms_strdup(linphone_uri_get_display_name(uri));
if (linphone_address_get_display_name(uri)!=NULL)
display_name=ms_strdup(linphone_address_get_display_name(uri));
else{
display_name=linphone_uri_as_string(uri);
display_name=linphone_address_as_string(uri);
}
snprintf(video_title,sizeof(video_title),_("Call with %s"),display_name);
ms_free(display_name);

View file

@ -71,19 +71,19 @@ void linphone_gtk_update_my_contact(GtkWidget *w){
const char *username=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"username")));
const char *displayname=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"displayname")));
int port=linphone_core_get_sip_port(linphone_gtk_get_core());
LinphoneUri *parsed=linphone_core_get_primary_contact_parsed(linphone_gtk_get_core());
LinphoneAddress *parsed=linphone_core_get_primary_contact_parsed(linphone_gtk_get_core());
char *contact;
g_return_if_fail(parsed!=NULL);
if (username[0]=='\0') return;
linphone_uri_set_display_name(parsed,displayname);
linphone_uri_set_username(parsed,username);
linphone_uri_set_port_int(parsed,port);
contact=linphone_uri_as_string(parsed);
linphone_address_set_display_name(parsed,displayname);
linphone_address_set_username(parsed,username);
linphone_address_set_port_int(parsed,port);
contact=linphone_address_as_string(parsed);
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"sip_address")),contact);
linphone_core_set_primary_contact(linphone_gtk_get_core(),contact);
ms_free(contact);
linphone_uri_destroy(parsed);
linphone_address_destroy(parsed);
linphone_gtk_load_identities();
}
@ -705,7 +705,7 @@ void linphone_gtk_show_parameters(void){
LinphoneCore *lc=linphone_gtk_get_core();
const char **sound_devices=linphone_core_get_sound_devices(lc);
const char *tmp;
LinphoneUri *contact;
LinphoneAddress *contact;
LinphoneFirewallPolicy pol;
GtkWidget *codec_list=linphone_gtk_get_widget(pb,"codec_list");
int mtu;
@ -764,12 +764,12 @@ void linphone_gtk_show_parameters(void){
/* SIP CONFIG */
contact=linphone_core_get_primary_contact_parsed(lc);
if (contact){
if (linphone_uri_get_display_name(contact))
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"displayname")),linphone_uri_get_display_name(contact));
if (linphone_uri_get_username(contact))
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"username")),linphone_uri_get_username(contact));
if (linphone_address_get_display_name(contact))
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"displayname")),linphone_address_get_display_name(contact));
if (linphone_address_get_username(contact))
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"username")),linphone_address_get_username(contact));
}
linphone_uri_destroy(contact);
linphone_address_destroy(contact);
linphone_gtk_show_sip_accounts(pb);
/* CODECS CONFIG */
linphone_gtk_init_codec_list(GTK_TREE_VIEW(codec_list));