Commit da07af08 authored by smorlat's avatar smorlat
Browse files

update buddylookup to use LinphoneAddress

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@792 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 2fe32315
...@@ -195,24 +195,23 @@ static int lookup_buddy(SipSetupContext *ctx, BLReq *req){ ...@@ -195,24 +195,23 @@ static int lookup_buddy(SipSetupContext *ctx, BLReq *req){
const char *url=lp_config_get_string(config,"BuddyLookup","url",NULL); const char *url=lp_config_get_string(config,"BuddyLookup","url",NULL);
LinphoneAuthInfo *aa; LinphoneAuthInfo *aa;
SoupMessage *sm; SoupMessage *sm;
LinphoneAddress *from;
if (url==NULL){ if (url==NULL){
ms_error("No url defined for BuddyLookup in config file, aborting search."); ms_error("No url defined for BuddyLookup in config file, aborting search.");
return -1; return -1;
} }
osip_from_t *from; from=linphone_address_new(identity);
osip_from_init(&from); if (from==NULL){
if (osip_from_parse(from,identity)!=0){
osip_from_free(from);
ms_error("Could not parse identity %s",identity); ms_error("Could not parse identity %s",identity);
return -1; return -1;
} }
aa=linphone_core_find_auth_info(lc,from->url->host,from->url->username); aa=linphone_core_find_auth_info(lc,linphone_address_get_domain(from),linphone_address_get_username(from));
if (aa) ms_message("There is a password: %s",aa->passwd); if (aa) ms_message("There is a password: %s",aa->passwd);
else ms_message("No password for %s on %s",from->url->username,from->url->host); else ms_message("No password for %s on %s",linphone_address_get_username(from),linphone_address_get_domain(from));
sm=build_xmlrpc_request(identity, aa ? aa->passwd : NULL, req->base.key, from->url->host, url, req->base.max_results); sm=build_xmlrpc_request(identity, aa ? aa->passwd : NULL, req->base.key, linphone_address_get_domain(from), url, req->base.max_results);
osip_from_free(from); linphone_address_destroy(from);
req->msg=sm; req->msg=sm;
ortp_thread_create(&req->th,NULL,process_xml_rpc_request,req); ortp_thread_create(&req->th,NULL,process_xml_rpc_request,req);
if (!sm) return -1; if (!sm) return -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment