Better bis

This commit is contained in:
Guillaume BIENKOWSKI 2014-03-05 16:45:09 +01:00
parent a63542cd03
commit 19b54bad8c

View file

@ -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