Commit 71db9280 authored by smorlat's avatar smorlat
Browse files

abstract address and uris directly in liblinphone api.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@769 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent d82234aa
......@@ -1249,12 +1249,13 @@ linphonec_proxy_use(LinphoneCore *lc, int index)
static void
linphonec_friend_display(LinphoneFriend *fr)
{
char *name = linphone_friend_get_name(fr);
char *addr = linphone_friend_get_addr(fr);
//char *url = linphone_friend_get_url(fr);
linphonec_out("name: %s\n", name);
linphonec_out("address: %s\n", addr);
LinphoneUri *uri=linphone_uri_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("address: %s\n", str);
}
static int
......@@ -1272,8 +1273,9 @@ linphonec_friend_list(LinphoneCore *lc, char *pat)
for(n=0; friend!=NULL; friend=ms_list_next(friend), ++n )
{
if ( pat ) {
char *name = linphone_friend_get_name(friend->data);
if ( ! strstr(name, pat) ) continue;
const char *name = linphone_uri_get_display_name(
linphone_friend_get_uri((LinphoneFriend*)friend->data));
if (name && ! strstr(name, pat) ) continue;
}
linphonec_out("****** Friend %i *******\n",n);
linphonec_friend_display((LinphoneFriend*)friend->data);
......@@ -1293,8 +1295,11 @@ linphonec_friend_call(LinphoneCore *lc, unsigned int num)
{
if ( n == num )
{
addr = linphone_friend_get_addr(friend->data);
return lpc_cmd_call(lc, addr);
int ret;
addr = linphone_uri_as_string(linphone_friend_get_uri((LinphoneFriend*)friend->data));
ret=lpc_cmd_call(lc, addr);
ms_free(addr);
return ret;
}
}
linphonec_out("No such friend %u\n", num);
......
......@@ -27,13 +27,12 @@
#include <eXosip2/eXosip.h>
LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const char *to){
char *real_url=NULL;
osip_from_t *parsed_url=NULL;
LinphoneUri *parsed_url=NULL;
char *route;
if (linphone_core_interpret_url(lc,to,&real_url,&parsed_url,&route)){
if (linphone_core_interpret_url(lc,to,&parsed_url,&route)){
LinphoneChatRoom *cr=ms_new0(LinphoneChatRoom,1);
cr->lc=lc;
cr->peer=real_url;
cr->peer=linphone_uri_as_string(parsed_url);
cr->peer_url=parsed_url;
cr->route=route;
lc->chatrooms=ms_list_append(lc->chatrooms,(void *)cr);
......@@ -46,7 +45,7 @@
void linphone_chat_room_destroy(LinphoneChatRoom *cr){
LinphoneCore *lc=cr->lc;
lc->chatrooms=ms_list_remove(lc->chatrooms,(void *) cr);
osip_from_free(cr->peer_url);
linphone_uri_destroy(cr->peer_url);
ms_free(cr->peer);
ms_free(cr->route);
}
......@@ -60,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, osip_from_t *from){
if (cr->peer_url->url->username && from->url->username &&
strcmp(cr->peer_url->url->username,from->url->username)==0) return TRUE;
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;
return FALSE;
}
......@@ -74,9 +73,10 @@ void linphone_core_text_received(LinphoneCore *lc, eXosip_event_t *ev){
MSList *elem;
const char *msg;
LinphoneChatRoom *cr=NULL;
char *cleanfrom;
char *from;
osip_from_t *from_url=ev->request->from;
osip_body_t *body=NULL;
LinphoneUri *uri;
osip_message_get_body(ev->request,0,&body);
if (body==NULL){
......@@ -84,20 +84,25 @@ void linphone_core_text_received(LinphoneCore *lc, eXosip_event_t *ev){
return;
}
msg=body->body;
from_2char_without_params(from_url,&cleanfrom);
osip_from_to_str(from_url,&from);
uri=linphone_uri_new(from);
osip_free(from);
linphone_uri_clean(uri);
for(elem=lc->chatrooms;elem!=NULL;elem=ms_list_next(elem)){
cr=(LinphoneChatRoom*)elem->data;
if (linphone_chat_room_matches(cr,from_url)){
if (linphone_chat_room_matches(cr,uri)){
break;
}
cr=NULL;
}
from=linphone_uri_as_string(uri);
if (cr==NULL){
/* create a new chat room */
cr=linphone_core_create_chat_room(lc,cleanfrom);
cr=linphone_core_create_chat_room(lc,from);
}
linphone_chat_room_text_received(cr,lc,cleanfrom,msg);
osip_free(cleanfrom);
linphone_uri_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,from,to,ev);
lc->call=linphone_call_new_incoming(lc,linphone_uri_new(from),linphone_uri_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){
osip_from_t *fa=((LinphoneFriend*)a)->url;
osip_from_t *fb=((LinphoneFriend*)b)->url;
char *ua,*ub;
ua=fa->url->username;
ub=fb->url->username;
LinphoneUri *fa=((LinphoneFriend*)a)->uri;
LinphoneUri *fb=((LinphoneFriend*)b)->uri;
const char *ua,*ub;
ua=linphone_uri_get_username(fa);
ub=linphone_uri_get_username(fb);
if (ua!=NULL && ub!=NULL) {
//printf("Comparing usernames %s,%s\n",ua,ub);
return strcasecmp(ua,ub);
}
else {
/* compare hosts*/
ua=fa->url->host;
ub=fb->url->host;
ua=linphone_uri_get_domain(fa);
ub=linphone_uri_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 *find_friend(MSList *fl, const osip_from_t *friend, LinphoneFriend **lf){
MSList *linphone_find_friend(MSList *fl, const LinphoneUri *friend, LinphoneFriend **lf){
MSList *res=NULL;
LinphoneFriend dummy;
if (lf!=NULL) *lf=NULL;
dummy.url=(osip_from_t*)friend;
dummy.uri=(LinphoneUri*)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;
osip_from_to_str(fr->url,&friend);
friend=linphone_uri_as_string(fr->uri);
if (fr->proxy!=NULL){
route=fr->proxy->reg_route;
from=fr->proxy->reg_identity;
......@@ -150,7 +150,7 @@ void __linphone_friend_do_subscribe(LinphoneFriend *fr){
eXosip_subscribe_build_initial_request(&msg,friend,from,route,"presence",600);
eXosip_subscribe_send_initial_request(msg);
eXosip_unlock();
osip_free(friend);
ms_free(friend);
}
......@@ -176,63 +176,56 @@ LinphoneFriend *linphone_friend_new_with_addr(const char *addr){
}
void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char **result){
int err;
osip_from_t *fr=NULL;
osip_from_init(&fr);
err=osip_from_parse(fr,uri);
if (err<0){
LinphoneUri *fr=NULL;
*result=NULL;
fr=linphone_uri_new(uri);
if (fr==NULL){
char *tmp=NULL;
if (strchr(uri,'@')!=NULL){
LinphoneUri *u;
/*try adding sip:*/
tmp=ms_strdup_printf("sip:%s",uri);
u=linphone_uri_new(tmp);
if (u!=NULL){
*result=tmp;
}
}else if (lc->default_proxy!=NULL){
/*try adding domain part from default current proxy*/
osip_from_t *id=NULL;
osip_from_init(&id);
if (osip_from_parse(id,linphone_core_get_identity(lc))==0){
if (id->url->port!=NULL && strlen(id->url->port)>0)
tmp=ms_strdup_printf("sip:%s@%s:%s",uri,id->url->host,id->url->port);
else tmp=ms_strdup_printf("sip:%s@%s",uri,id->url->host);
LinphoneUri * id=linphone_uri_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);
}
osip_from_free(id);
}
if (osip_from_parse(fr,tmp)==0){
if (*result){
/*looks good */
ms_message("%s interpreted as %s",uri,tmp);
*result=tmp;
}else *result=NULL;
}else *result=ms_strdup(uri);
osip_from_free(fr);
ms_message("%s interpreted as %s",uri,*result);
}else{
ms_warning("Fail to interpret friend uri %s",uri);
}
}else *result=linphone_uri_as_string(fr);
linphone_uri_destroy(fr);
}
int linphone_friend_set_sip_addr(LinphoneFriend *lf, const char *addr){
int err;
osip_from_t *fr=NULL;
osip_from_init(&fr);
err=osip_from_parse(fr,addr);
if (err<0) {
LinphoneUri *fr=linphone_uri_new(addr);
if (fr==NULL) {
ms_warning("Invalid friend sip uri: %s",addr);
osip_from_free(fr);
return -1;
}
if (lf->url!=NULL) osip_from_free(lf->url);
lf->url=fr;
if (lf->uri!=NULL) linphone_uri_destroy(lf->uri);
lf->uri=fr;
return 0;
}
int linphone_friend_set_name(LinphoneFriend *lf, const char *name){
osip_from_t *fr=lf->url;
LinphoneUri *fr=lf->uri;
if (fr==NULL){
ms_error("linphone_friend_set_sip_addr() must be called before linphone_friend_set_name().");
return -1;
}
if (fr->displayname!=NULL){
osip_free(fr->displayname);
fr->displayname=NULL;
}
if (name && name[0]!='\0'){
fr->displayname=osip_strdup(name);
}
linphone_uri_set_display_name(fr,name);
return 0;
}
......@@ -560,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->url!=NULL) osip_from_free(lf->url);
if (lf->uri!=NULL) linphone_uri_destroy(lf->uri);
if (lf->info!=NULL) buddy_info_free(lf->info);
ms_free(lf);
}
......@@ -571,29 +564,10 @@ void linphone_friend_check_for_removed_proxy(LinphoneFriend *lf, LinphoneProxyCo
}
}
char *linphone_friend_get_addr(LinphoneFriend *lf){
char *ret,*tmp;
if (lf->url==NULL) return NULL;
osip_uri_to_str(lf->url->url,&tmp);
ret=ms_strdup(tmp);
osip_free(tmp);
return ret;
const LinphoneUri *linphone_friend_get_uri(const LinphoneFriend *lf){
return lf->uri;
}
char *linphone_friend_get_name(LinphoneFriend *lf){
if (lf->url==NULL) return NULL;
if (lf->url->displayname==NULL) return NULL;
return ms_strdup(lf->url->displayname);
}
char * linphone_friend_get_url(LinphoneFriend *lf){
char *tmp,*ret;
if (lf->url==NULL) return NULL;
osip_from_to_str(lf->url,&tmp);
ret=ms_strdup(tmp);
ms_free(tmp);
return ret;
}
bool_t linphone_friend_get_send_subscribe(const LinphoneFriend *lf){
return lf->subscribe;
......@@ -612,7 +586,7 @@ BuddyInfo * linphone_friend_get_info(const LinphoneFriend *lf){
}
void linphone_friend_apply(LinphoneFriend *fr, LinphoneCore *lc){
if (fr->url==NULL) {
if (fr->uri==NULL) {
ms_warning("No sip url defined.");
return;
}
......@@ -657,7 +631,7 @@ void linphone_friend_done(LinphoneFriend *fr){
void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf)
{
ms_return_if_fail(lf->lc==NULL);
ms_return_if_fail(lf->url!=NULL);
ms_return_if_fail(lf->uri!=NULL);
lc->friends=ms_list_append(lc->friends,lf);
linphone_friend_apply(lf,lc);
return ;
......@@ -679,22 +653,26 @@ static bool_t username_match(const char *u1, const char *u2){
}
LinphoneFriend *linphone_core_get_friend_by_uri(const LinphoneCore *lc, const char *uri){
osip_from_t *from;
osip_from_init(&from);
LinphoneUri *puri=linphone_uri_new(uri);
const MSList *elem;
if (osip_from_parse(from,uri)!=0){
osip_from_free(from);
const char *username=linphone_uri_get_username(puri);
const char *domain=linphone_uri_get_domain(puri);
LinphoneFriend *lf=NULL;
if (puri==NULL){
return NULL;
}
for(elem=lc->friends;elem!=NULL;elem=ms_list_next(elem)){
LinphoneFriend *lf=(LinphoneFriend*)elem->data;
const char *it_username=lf->url->url->username;
const char *it_host=lf->url->url->host;
if (strcasecmp(from->url->host,it_host)==0 && username_match(from->url->username,it_username)){
return lf;
lf=(LinphoneFriend*)elem->data;
const char *it_username=linphone_uri_get_username(lf->uri);
const char *it_host=linphone_uri_get_domain(lf->uri);;
if (strcasecmp(domain,it_host)==0 && username_match(username,it_username)){
break;
}
lf=NULL;
}
return NULL;
linphone_uri_destroy(puri);
return lf;
}
#define key_compare(key, word) strncasecmp((key),(word),strlen(key))
......@@ -781,8 +759,8 @@ void linphone_friend_write_to_config_file(LpConfig *config, LinphoneFriend *lf,
lp_config_clean_section(config,key);
return;
}
if (lf->url!=NULL){
osip_from_to_str(lf->url,&tmp);
if (lf->uri!=NULL){
tmp=linphone_uri_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, char *from, char *to){
static void linphone_call_init_common(LinphoneCall *call, LinphoneUri *from, LinphoneUri *to){
call->state=LCStateInit;
call->start_time=time(NULL);
call->media_start_time=0;
......@@ -102,32 +102,28 @@ static void discover_mtu(LinphoneCore *lc, const char *remote){
}
}
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, const osip_from_t *from, const osip_to_t *to)
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneUri *from, LinphoneUri *to)
{
LinphoneCall *call=ms_new0(LinphoneCall,1);
char *fromstr=NULL,*tostr=NULL;
call->dir=LinphoneCallOutgoing;
call->cid=-1;
call->did=-1;
call->tid=-1;
call->core=lc;
linphone_core_get_local_ip(lc,to->url->host,call->localip);
osip_from_to_str(from,&fromstr);
osip_to_to_str(to,&tostr);
linphone_call_init_common(call,fromstr,tostr);
linphone_core_get_local_ip(lc,linphone_uri_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,
from->url->username,NULL);
linphone_uri_get_username (from),NULL);
sdp_context_set_user_pointer(call->sdpctx,(void*)call);
discover_mtu(lc,to->url->host);
discover_mtu(lc,linphone_uri_get_domain (to));
return call;
}
LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, const char *from, const char *to, eXosip_event_t *ev){
LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneUri *from, LinphoneUri *to, eXosip_event_t *ev){
LinphoneCall *call=ms_new0(LinphoneCall,1);
osip_from_t *me= linphone_core_get_primary_contact_parsed(lc);
osip_from_t *from_url=NULL;
LinphoneUri *me=linphone_core_get_primary_contact_parsed(lc);
osip_header_t *h=NULL;
call->dir=LinphoneCallIncoming;
......@@ -135,17 +131,17 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, const char *from, co
call->did=ev->did;
call->tid=ev->tid;
call->core=lc;
osip_from_init(&from_url);
osip_from_parse(from_url, from);
linphone_core_get_local_ip(lc,from_url->url->host,call->localip);
linphone_call_init_common(call, osip_strdup(from), osip_strdup(to));
linphone_uri_clean(from);
linphone_core_get_local_ip(lc,linphone_uri_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,
me->url->username,NULL);
linphone_uri_get_username (me),NULL);
sdp_context_set_user_pointer(call->sdpctx,(void*)call);
discover_mtu(lc,from_url->url->host);
osip_from_free(me);
osip_from_free(from_url);
discover_mtu(lc,linphone_uri_get_domain(from));
linphone_uri_destroy(me);
osip_message_header_get_byname(ev->request,"Session-expires",0,&h);
if (h) call->supports_session_timers=TRUE;
return call;
......@@ -166,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, char *from, char *to){
LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, LinphoneUri *from, LinphoneUri *to){
LinphoneCallLog *cl=ms_new0(LinphoneCallLog,1);
struct tm loctime;
cl->dir=call->dir;
......@@ -218,6 +214,9 @@ 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);
switch(cl->status){
case LinphoneCallAborted:
status=_("aborted");
......@@ -231,14 +230,17 @@ char * linphone_call_log_to_str(LinphoneCallLog *cl){
default:
status="unknown";
}
return ortp_strdup_printf(_("%s at %s\nFrom: %s\nTo: %s\nStatus: %s\nDuration: %i mn %i sec\n"),
tmp=ortp_strdup_printf(_("%s at %s\nFrom: %s\nTo: %s\nStatus: %s\nDuration: %i mn %i sec\n"),
(cl->dir==LinphoneCallIncoming) ? _("Incoming call") : _("Outgoing call"),
cl->start_date,
cl->from,
cl->to,
from,
to,
status,
cl->duration/60,
cl->duration%60);
ms_free(from);
ms_free(to);
return tmp;
}
void linphone_call_log_destroy(LinphoneCallLog *cl){
......@@ -254,7 +256,7 @@ int linphone_core_get_current_call_duration(const LinphoneCore *lc){
return time(NULL)-call->media_start_time;
}
const char *linphone_core_get_remote_uri(LinphoneCore *lc){
const LinphoneUri *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;
......@@ -857,16 +859,8 @@ bool_t linphone_core_get_guess_hostname(LinphoneCore *lc){
return lc->sip_conf.guess_hostname;
}
osip_from_t *linphone_core_get_primary_contact_parsed(LinphoneCore *lc){
int err;
osip_from_t *contact;
osip_from_init(&contact);
err=osip_from_parse(contact,linphone_core_get_primary_contact(lc));
if (err<0) {
osip_from_free(contact);
return NULL;
}
return contact;
LinphoneUri *linphone_core_get_primary_contact_parsed(LinphoneCore *lc){
return linphone_uri_new(linphone_core_get_primary_contact(lc));
}
int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs)
......@@ -1091,20 +1085,18 @@ static void linphone_core_grab_buddy_infos(LinphoneCore *lc, LinphoneProxyConfig
for(elem=linphone_core_get_friend_list(lc);elem!=NULL;elem=elem->next){
LinphoneFriend *lf=(LinphoneFriend*)elem->data;
if (lf->info==NULL){
char *url=linphone_friend_get_url(lf);
if (linphone_core_lookup_known_proxy(lc,url)==cfg){
if (lf->url->url->username!=NULL && lf->url->url->username[0]!='\0'){
if (linphone_core_lookup_known_proxy(lc,lf->uri)==cfg){
if (linphone_uri_get_username(lf->uri)!=NULL){
BuddyLookupRequest *req;
char tmp[255];
snprintf(tmp,sizeof(tmp),"sip:%s@%s",lf->url->url->username,lf->url->url->host);
char *tmp=linphone_uri_as_string_without_display_name(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);
sip_setup_context_buddy_lookup_submit(ctx,req);
lc->bl_reqs=ms_list_append(lc->bl_reqs,req);
ms_free(tmp);
}
}
ms_free(url);
}
}
}
......@@ -1210,16 +1202,6 @@ bool_t linphone_core_is_in_main_thread(LinphoneCore *lc){
return TRUE;
}
static osip_to_t *osip_to_create(const char *to){
osip_to_t *ret;
osip_to_init(&ret);
if (osip_to_parse(ret,to)<0){
osip_to_free(ret);
return NULL;
}
return ret;
}
static char *guess_route_if_any(LinphoneCore *lc, osip_to_t *parsed_url){
const MSList *elem=linphone_core_get_proxy_config_list(lc);
for(;elem!=NULL;elem=elem->next){
......@@ -1247,14 +1229,13 @@ 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, char **real_url, osip_to_t **real_parsed_url, char **route){
bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, LinphoneUri **real_parsed_url, char **route){
enum_lookup_res_t *enumres=NULL;
osip_to_t *parsed_url=NULL;
char *enum_domain=NULL;
LinphoneProxyConfig *proxy;
char *tmpurl;
const char *tmproute;
if (real_url!=NULL) *real_url=NULL;
if (real_parsed_url!=NULL) *real_parsed_url=NULL;
*route=NULL;
tmproute=linphone_core_get_route(lc);
......@@ -1268,8 +1249,7 @@ bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **rea
}
ms_free(enum_domain);
tmpurl=enumres->sip_address[0];
if (real_url!=NULL) *real_url=ms_strdup(tmpurl);
if (real_parsed_url!=NULL) *real_parsed_url=osip_to_create(tmpurl);
if (real_parsed_url!=NULL) *real_parsed_url=linphone_uri_new(tmpurl);
enum_lookup_res_free(enumres);
if (tmproute) *route=ms_strdup(tmproute);
return TRUE;
......@@ -1280,22 +1260,14 @@ bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **rea