summaryrefslogtreecommitdiff
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorAshley Sanders <asanders@digium.com>2015-07-07 15:03:34 -0500
committerAshley Sanders <asanders@digium.com>2015-07-07 21:31:49 -0500
commit3cdfd39af7c632403bff34fdbf2c4945cd02bb79 (patch)
tree524730d0dcaf6057306c4b8c1976f020cecacce1 /main/asterisk.c
parentc12ace3ab31bd61606252f5a3721ce720d2ad209 (diff)
DNS: Create a system-level DNS resolver
Prior to this patch, the DNS core present in master had no default system-level resolver implementation. Therefore, it was not possible for the DNS core to perform resolutions unless the libunbound library was installed and the res_resolver_unbound module was loaded. This patch introduces a system-level DNS resolver implementation that will register itself with the lowest consideration priority available (to ensure that it is to be used only as a last resort). The resolver relies on low-level DNS search functions to perform a rudimentary DNS search based on a provided query and then supplies the search results to the DNS core. ASTERISK-25146 #close Reported By: Joshua Colp Change-Id: I3b36ea17b889a98df4f8d80d50bb7ee175afa077
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 53bceadfd..0478f6c5d 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -4511,6 +4511,11 @@ int main(int argc, char *argv[])
exit(1);
}
+ if (ast_dns_system_resolver_init()) { /* Initialize the default DNS resolver */
+ printf("Failed: ast_dns_system_resolver_init\n%s", term_quit());
+ exit(1);
+ }
+
if ((moduleresult = load_modules(1))) { /* Load modules, pre-load only */
printf("Failed: load_modules\n%s", term_quit());
exit(moduleresult == -2 ? 2 : 1);