[Asterisk-Dev] [Bounty] IPv6 support in Asterisk

Kevin P. Fleming kpfleming at digium.com
Sat Jun 4 21:05:52 MST 2005


David Woodhouse wrote:

(re-opening an old thread)

> All address lookups for _all_ network connections should be done
> according to RFC3484. There's a bunch of rules which determine the order
> in which candidate addresses should be prioritised, and the results of
> getaddrinfo() will be sorted accordingly. Any recent libc ought to get
> this right.
> 
> Unfortunately, Asterisk isn't actually using getaddrinfo(); it's still
> using the old functions which can only return a single result.

The "DNS manager" I added to CVS HEAD back in March is the plan for this 
sort of thing; I want to make it able to hide most (or all) of this 
complexity from the DNS-using modules, in addition to providing 
asynchronous lookups and background refreshes.

I've got a plan in my head for how to handle the IPV4 stuff, selection 
of SRV records and such, but I've not yet thought seriously about adding 
IPV6 support to it.

Let's get some ideas posted here on what the API to the DNS manager 
should be for all this stuff; essentially, I want a DNS-using module to 
be able to instantiate a "manager" for any given DNS domain (which might 
be a hostname, the name of a SRV record, or anything else), and give 
that manager a pointer to the place where the selected (and current) IP 
address should be stored. The manager will also have the ability to 
place a callback (or wake up a thread, or something else) to let the 
module know that there is a new address available, which may have 
happened due to DNS record changes or anything else.

What I haven't yet figured out is how the DNS-using module is going to 
be able to tell the manager to select a lower-preference entry, when the 
higher-preference one is not working (the server is not responding, 
etc.) If we can figure out a method for that, we can then start properly 
supporting SRV records in chan_sip, with automatic fallback to 
lower-preference records when appropriate (and fallforward to higher 
preference ones when they become available).

Let's start by trying to document all the different types of lookups 
that an Asterisk module may need... obviously there are simple A record 
lookups and ENUM lookups, but there are also SRV lookups (with fallback 
to A lookups) which are more complicated.



More information about the asterisk-dev mailing list