Skip to content

Instantly share code, notes, and snippets.

@garronej
Created November 3, 2017 03:21
Show Gist options
  • Save garronej/dce9ca27f8d658511b807d2e9fd99717 to your computer and use it in GitHub Desktop.
Save garronej/dce9ca27f8d658511b807d2e9fd99717 to your computer and use it in GitHub Desktop.
From 13f1c2f80e373f95979757b4436dc600ccb8f151 Mon Sep 17 00:00:00 2001
From: joseph <[email protected]>
Date: Sat, 28 Oct 2017 21:35:31 +0200
Subject: [PATCH] fix ice server DNS resolve
---
coreapi/nat_policy.c | 3 +++
coreapi/proxy.c | 1 +
2 files changed, 4 insertions(+)
diff --git a/coreapi/nat_policy.c b/coreapi/nat_policy.c
index dcd0b2d75..7513664e1 100644
--- a/coreapi/nat_policy.c
+++ b/coreapi/nat_policy.c
@@ -261,6 +261,8 @@ const struct addrinfo * linphone_nat_policy_get_stun_server_addrinfo(LinphoneNat
ms_usleep(50000);
wait_ms += 50;
}
+ }else{
+ linphone_nat_policy_resolve_stun_server(policy);
}
return policy->stun_addrinfo;
}
@@ -312,6 +314,7 @@ LinphoneNatPolicy * linphone_core_create_nat_policy_from_config(LinphoneCore *lc
policy = linphone_config_create_nat_policy_from_section(config, section);
policy->lc = lc;
finished = TRUE;
+ linphone_nat_policy_resolve_stun_server(policy);
}
} else finished = TRUE;
belle_sip_free(section);
diff --git a/coreapi/proxy.c b/coreapi/proxy.c
index 756ad7d76..c694a4243 100644
--- a/coreapi/proxy.c
+++ b/coreapi/proxy.c
@@ -137,6 +137,7 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *cf
} else {
ms_error("Cannot create default nat policy with ref [%s] for proxy config [%p]",nat_policy_ref,cfg);
}
+ linphone_nat_policy_resolve_stun_server(policy);
}
}
--
2.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment