account_creator.c: fix creation

This commit is contained in:
Gautier Pelloux-Prayer 2016-08-05 15:46:02 +02:00
parent 43a1a994eb
commit 97c8f0d0d8
2 changed files with 9 additions and 3 deletions

View file

@ -438,8 +438,13 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr
linphone_core_set_firewall_policy(creator->core, LinphonePolicyUseIce);
}
info = linphone_auth_info_new(linphone_address_get_username(identity), NULL, creator->password,
creator->password ? NULL : creator->ha1, NULL, linphone_address_get_domain(identity));
info = linphone_auth_info_new(linphone_address_get_username(identity), // username
NULL, //user id
creator->password, // passwd
creator->password ? NULL : creator->ha1, // ha1
!creator->password && creator->ha1 ? linphone_address_get_domain(identity) : NULL, // realm - assumed to be domain
linphone_address_get_domain(identity) // domain
);
linphone_core_add_auth_info(creator->core, info);
linphone_address_destroy(identity);
@ -541,7 +546,7 @@ static LinphoneXmlRpcRequest * _create_account_with_email(LinphoneAccountCreator
LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator) {
LinphoneXmlRpcRequest *request;
char *identity = _get_identity(creator);
if (!identity || !creator->password || (!(request = _create_account_with_phone(creator))
if (!identity || (!(request = _create_account_with_phone(creator))
&& !(request = _create_account_with_email(creator)))) {
if (creator->callbacks->create_account != NULL) {
creator->callbacks->create_account(creator, LinphoneAccountCreatorReqFailed);

View file

@ -635,6 +635,7 @@ LinphoneFriend * linphone_friend_list_find_friend_by_address(const LinphoneFrien
bctbx_list_t *phone_numbers = linphone_friend_get_phone_numbers(lf);
iterator = phone_numbers;
ms_free(uri);
if (!phone_number) return NULL;
while (iterator && (result == NULL)) {
const char *number = (const char *)bctbx_list_get_data(iterator);
if (strcmp(number, phone_number) == 0) result = lf;