Commit fe2b319d authored by DanmeiChen's avatar DanmeiChen Committed by Sylvain Berfini

create phone account with custom domain

parent 7f6bb152
...@@ -96,9 +96,9 @@ static char* _get_identity(const LinphoneAccountCreator *creator) { ...@@ -96,9 +96,9 @@ static char* _get_identity(const LinphoneAccountCreator *creator) {
LinphoneAddress* addr; LinphoneAddress* addr;
addr = linphone_proxy_config_normalize_sip_uri(proxy, creator->username ? creator->username : creator->phone_number); addr = linphone_proxy_config_normalize_sip_uri(proxy, creator->username ? creator->username : creator->phone_number);
if (addr == NULL) { if (addr == NULL || (creator->domain && strcmp(linphone_address_get_domain(addr), creator->domain) != 0)) {
if (creator->username && creator->domain) { if ((creator->username || creator->phone_number) && creator->domain) {
char *url = ms_strdup_printf("sip:%s@%s", creator->username, creator->domain); char *url = ms_strdup_printf("sip:%s@%s", creator->username ? creator->username : creator->phone_number, creator->domain);
addr = linphone_address_new(url); addr = linphone_address_new(url);
ms_free(url); ms_free(url);
if (addr == NULL) { if (addr == NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment