From 3ba718de5f92fa2d3d5bb034e28229f92796a675 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 19 Feb 2018 18:05:04 +0100 Subject: [PATCH] Allow account creator to configure proxy config if no default value was loaded but set by API --- coreapi/account_creator.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index f114c51cd..5dcbd0c6b 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -91,7 +91,18 @@ static char* _get_identity(const LinphoneAccountCreator *creator) { LinphoneAddress* addr; addr = linphone_proxy_config_normalize_sip_uri(proxy, creator->username ? creator->username : creator->phone_number); - if (addr == NULL) goto end; + if (addr == NULL) { + if (creator->username && creator->domain) { + char *url = ms_strdup_printf("sip:%s@%s", creator->username, creator->domain); + addr = linphone_address_new(url); + ms_free(url); + if (addr == NULL) { + goto end; + } + } else { + goto end; + } + } identity = linphone_address_as_string(addr); linphone_address_unref(addr);