res_pjsip: Add external PJSIP resolver implementation using core DNS API.

This change adds the following:

1. A query set implementation. This is an API that allows queries to be executed in parallel and once all have completed a callback is invoked.
2. Unit tests for the query set implementation.
3. An external PJSIP resolver which uses the DNS core API to do NAPTR, SRV, AAAA, and A lookups.

For the resolver it will do NAPTR, SRV, and AAAA/A lookups in parallel. If NAPTR or SRV
are available it will then do more queries. And so on. Preference is NAPTR > SRV > AAAA/A,
with IPv6 preferred over IPv4. For transport it will prefer TLS > TCP > UDP if no explicit
transport has been provided. Configured transports on the system are taken into account to
eliminate resolved addresses which have no hope of completing.

ASTERISK-24947 #close
Reported by: Joshua Colp

Change-Id: I56cb03ce4f9d3d600776f36928e0b3e379b5d71e
This commit is contained in:
Joshua Colp
2015-04-13 10:47:01 -03:00
parent 60d1911482
commit a3cec44a0a
13 changed files with 1479 additions and 55 deletions

View File

@@ -3480,8 +3480,6 @@ static int load_module(void)
return AST_MODULE_LOAD_DECLINE;
}
ast_sip_initialize_dns();
pjsip_tsx_layer_init_module(ast_pjsip_endpoint);
pjsip_ua_init_module(ast_pjsip_endpoint, NULL);
@@ -3514,6 +3512,9 @@ static int load_module(void)
return AST_MODULE_LOAD_DECLINE;
}
ast_sip_initialize_resolver();
ast_sip_initialize_dns();
if (ast_sip_initialize_distributor()) {
ast_log(LOG_ERROR, "Failed to register distributor module. Aborting load\n");
ast_res_pjsip_destroy_configuration();