On Sun, 2008-10-19 at 21:14 +0300, Kevin P. Fleming wrote: > > Never mind... I was mistaken. The srv_callback() function puts the > records returned by the DNS lookup into priority order (lowest numbers > first),
Yes, I can see that function and while I have not audited it detail, it
looks as though it was at least intended to sort by priority.
> So, in both Asterisk 1.4 and 1.6, the SRV record lookups
> should choose the lowest-priority, highest-weight entry returned by the
> DNS lookup.
So it seems. I wonder why I have evidence that it is not actually
working. Asterisk even told me:
-- ast_get_srv: SRV lookup for '_sip._udp.tollfree.sip-happens.com.' mapped
to host ares.sip-happens.com, port 5070
And while unfortunately those SRV records don't exist any more (because
I complained to the sip-happens.com guys about their ares server not
working and they just removed the ares record rather than having it at a
lower priority) so we can't test it again, I am positive when I manually
inspected the SRV records sometimes.sip-happens.com had a lower priority
(the first of the two numbers in the RR right?) than
ares.sip-happens.com.
It might be worthwhile writing a small unit test for ast_get_srv that
just calls it 100 times on a set of dns records that should replicate
the problem and see how many times it's correct vs. not correct. Except
for having to cobble up an "ast_channel *" it might not be that terribly
difficult. On second thought (or having tried at least) maybe not.
Just trying to pull main/srv.o into a unit test unravels a whole nest of
dependencies.
> There still isn't any failover, but we are least choosing
> the correct single record from the list in DNS.
Right, which would be the minimum requirement in my mind. Anything less
and one shouldn't even implement it.
b.
signature.asc
Description: This is a digitally signed message part
_______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
