From 19b54bad8ceeaddd666b04017fdb94f399d98d42 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Wed, 5 Mar 2014 16:45:09 +0100 Subject: [PATCH] Better bis --- Classes/LinphoneUI/UICallButton.m | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Classes/LinphoneUI/UICallButton.m b/Classes/LinphoneUI/UICallButton.m index 907c7f600..000e67f00 100644 --- a/Classes/LinphoneUI/UICallButton.m +++ b/Classes/LinphoneUI/UICallButton.m @@ -75,8 +75,25 @@ while( logs ){ LinphoneCallLog* log = logs->data; if( linphone_call_log_get_dir(log) == LinphoneCallOutgoing ){ + LinphoneProxyConfig* def_proxy = NULL; LinphoneAddress* to = linphone_call_log_get_to(log); - char *bis_address = linphone_address_as_string_uri_only(to); + const char* domain = linphone_address_get_domain(to); + char* bis_address = NULL; + + linphone_core_get_default_proxy([LinphoneManager getLc], &def_proxy); + + // if the 'to' address is on the default proxy, only present the username + if( def_proxy ){ + const char* def_domain = linphone_proxy_config_get_domain(def_proxy); + if( def_domain && domain && !strcmp(domain, def_domain) ){ + bis_address = ms_strdup(linphone_address_get_username(to)); + } + } + + if( bis_address == NULL ) { + bis_address = linphone_address_as_string_uri_only(to); + } + [addressField setText:[NSString stringWithUTF8String:bis_address]]; ms_free(bis_address); // return after filling the address, let the user confirm the call by pressing again