diff options
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index e2f575d04..2cc5e1ba2 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -12909,7 +12909,13 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st /* Non-dynamic. Make sure we become that way if we're not */ AST_SCHED_DEL(sched, peer->expire); ast_clear_flag64(peer, IAX_DYNAMIC); - peer->addr.ss.ss_family = AST_AF_UNSPEC; + if (peer->dnsmgr) { + // Make sure we refresh dnsmgr if we're using it + ast_dnsmgr_refresh(peer->dnsmgr); + } else { + // Or just invalidate the address + peer->addr.ss.ss_family = AST_AF_UNSPEC; + } if (ast_dnsmgr_lookup(v->value, &peer->addr, &peer->dnsmgr, srvlookup ? "_iax._udp" : NULL)) { return peer_unref(peer); } |