Commit 863381c3 authored by smorlat's avatar smorlat
Browse files

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