mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Merge "chan_sip: Resolve externhost not to IPv6; instead go for IPv4." into 13
This commit is contained in:
@@ -3839,7 +3839,7 @@ static void ast_sip_ouraddrfor(const struct ast_sockaddr *them, struct ast_socka
|
||||
(!sip_cfg.matchexternaddrlocally || !ast_apply_ha(localaddr, us)) ) {
|
||||
/* if we used externhost, see if it is time to refresh the info */
|
||||
if (externexpire && time(NULL) >= externexpire) {
|
||||
if (ast_sockaddr_resolve_first(&externaddr, externhost, 0)) {
|
||||
if (ast_sockaddr_resolve_first_af(&externaddr, externhost, 0, AST_AF_INET)) {
|
||||
ast_log(LOG_NOTICE, "Warning: Re-lookup of '%s' failed!\n", externhost);
|
||||
}
|
||||
externexpire = time(NULL) + externrefresh;
|
||||
@@ -32476,7 +32476,7 @@ static int reload_config(enum channelreloadreason reason)
|
||||
externexpire = 0;
|
||||
} else if (!strcasecmp(v->name, "externhost")) {
|
||||
ast_copy_string(externhost, v->value, sizeof(externhost));
|
||||
if (ast_sockaddr_resolve_first(&externaddr, externhost, 0)) {
|
||||
if (ast_sockaddr_resolve_first_af(&externaddr, externhost, 0, AST_AF_INET)) {
|
||||
ast_log(LOG_WARNING, "Invalid address for externhost keyword: %s\n", externhost);
|
||||
}
|
||||
externexpire = time(NULL);
|
||||
|
Reference in New Issue
Block a user