Do not use linphone_core_get_identity() when creating a LinphoneAddress to prevent a random port to appear.

This commit is contained in:
Ghislain MARY 2013-03-29 15:29:27 +01:00
parent 453f5bf5c4
commit 151efc7d71
3 changed files with 4 additions and 5 deletions

View file

@ -354,7 +354,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
//possible valid config detected
proxyCfg = linphone_core_create_proxy_config(lc);
char normalizedUserName[256];
LinphoneAddress* linphoneAddress = linphone_address_new(linphone_core_get_identity(lc));
LinphoneAddress* linphoneAddress = linphone_address_new("sip:user@domain.com");
linphone_proxy_config_normalize_number(proxyCfg, [username cStringUsingEncoding:[NSString defaultCStringEncoding]], normalizedUserName, sizeof(normalizedUserName));
linphone_address_set_username(linphoneAddress, normalizedUserName);
linphone_address_set_domain(linphoneAddress, [domain cStringUsingEncoding:[NSString defaultCStringEncoding]]);

View file

@ -1287,7 +1287,7 @@ static void audioRouteChangeListenerCallback (
[error release];
} else {
char normalizedUserName[256];
LinphoneAddress* linphoneAddress = linphone_address_new(linphone_core_get_identity(theLinphoneCore));
LinphoneAddress* linphoneAddress = linphone_address_new("sip:user@domain.com");
linphone_proxy_config_normalize_number(proxyCfg,[address cStringUsingEncoding:[NSString defaultCStringEncoding]],normalizedUserName,sizeof(normalizedUserName));
linphone_address_set_username(linphoneAddress, normalizedUserName);
if(displayName!=nil) {

View file

@ -384,13 +384,12 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)addProxyConfig:(NSString*)username password:(NSString*)password domain:(NSString*)domain server:(NSString*)server {
LinphoneCore *lc = [LinphoneManager getLc];
[self clearProxyConfig];
if(server == nil) {
server = domain;
}
char normalizedUserName[256];
LinphoneAddress* linphoneAddress = linphone_address_new(linphone_core_get_identity(lc));
LinphoneAddress* linphoneAddress = linphone_address_new("sip:user@domain.com");
linphone_proxy_config_normalize_number(NULL, [username cStringUsingEncoding:[NSString defaultCStringEncoding]], normalizedUserName, sizeof(normalizedUserName));
linphone_address_set_username(linphoneAddress, normalizedUserName);
linphone_address_set_domain(linphoneAddress, [domain UTF8String]);
@ -416,7 +415,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (NSString*)identityFromUsername:(NSString*)username {
char normalizedUserName[256];
LinphoneAddress* linphoneAddress = linphone_address_new(linphone_core_get_identity([LinphoneManager getLc]));
LinphoneAddress* linphoneAddress = linphone_address_new("sip:user@domain.com");
linphone_proxy_config_normalize_number(NULL, [username cStringUsingEncoding:[NSString defaultCStringEncoding]], normalizedUserName, sizeof(normalizedUserName));
linphone_address_set_username(linphoneAddress, normalizedUserName);
linphone_address_set_domain(linphoneAddress, [[[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"] UTF8String]);