Commit a57932ad authored by Simon Morlat's avatar Simon Morlat
Browse files

fix lookup_known_proxy() to prefer the default proxy if it can do the job...

fix lookup_known_proxy() to prefer the default proxy if it can do the job (instead of choosing the first matching in the list)
parent 02607711
......@@ -1966,6 +1966,16 @@ void linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call){
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneAddress *uri){
const MSList *elem;
LinphoneProxyConfig *found_cfg=NULL;
LinphoneProxyConfig *default_cfg=lc->default_proxy;
/*always prefer the default proxy if it is matching the destination uri*/
if (default_cfg){
const char *domain=linphone_proxy_config_get_domain(default_cfg);
if (strcmp(domain,linphone_address_get_domain(uri))==0)
return default_cfg;
}
/*otherwise iterate through the other proxy config and return the first matching*/
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);
......
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