Summary:ASTERISK-20539: When the peer for an outbound call is defined by a round-robin DNS, the response to the SIP 407 challenge goes to a different server than the original SIP INVITE (and from which the 407 came)
Reporter:Norman Henderson (nhenderson)Labels:
Date Opened:2012-10-09 09:16:49Date Closed:2012-10-11 16:21:31
Versions: Frequency of
Environment:Asterisk built by pbuilder @ nighthawk on a x86_64 running Linux on 2012-04-24 15:31:40 UTC Linux VM-CEML 2.6.32-43-server #97-Ubuntu SMP Wed Sep 5 16:56:41 UTC 2012 x86_64 GNU/Linux - Ubuntu 10.04.4 LTS - fully updated FreePBX - fully updatedAttachments:( 0) extract
Description:outbound.vitelity.net is a round-robin DNS name with several servers. The SIP trunk is defined as:

See debug file:
Line 1321: Asterisk sends INVITE to the first address it got from the DNS lookup,
Line 1360: the provider responds from the same IP with 407 Proxy Authentication Required
Line 1391ff: Asterisk does a new DNS lookup, gets a different address, and sends the digest credentials there.
The provider says this is non-RFC-compliant (and indeed doesn't make much sense). Their server sends back another 407 from and the cycle repeats a few times before Asterisk gives up.

There is a mystery in that the system used to work (or perhaps the problem was just more intermittent and blamed on a bad 'net connection). I am not aware of changes to my system and the provider says his didn't change either during the time window this went from working (usually at least) to consistently failing.
Comments:By: Norman Henderson (nhenderson) 2012-10-09 09:19:20.565-0500

core set debug 5; sip set debug on
my user, IP, DNS and tel# have been globally altered for security reasons

By: Michael L. Young (elguero) 2012-10-09 22:55:23.980-0500

Can you try to reproduce with a recent version of Asterisk 1.8.x?  1.8.17 is the latest version and in looking through the ChangeLog, I see some bug fixes around this area of the code.  Worth a shot since your bug might already have been fixed.

By: Norman Henderson (nhenderson) 2012-10-10 01:20:39.724-0500

Right - good suggestion. However it highlights "the problem with Linux" - is the latest package for Lucid, Digium doesn't offer a package at all for Precise which is my next planned OS - Ubuntu offers only as recent as for Precise. Building from source throws off the whole system maintenance strategy (plus I'm not that good at it and usually it turns into a mess).

Anyway this is on a VM so I'll see about taking a snapshot and having a whirl at the 1.8.17 source in a bit.

By: Norman Henderson (nhenderson) 2012-10-11 15:00:28.622-0500

After an upgrade to Ubuntu 12.04 and to Asterisk (built from source), this problem appears to be fixed.

There is no audio, but that's a different problem and requires more investigation before being a bug.

It would be good to get a more recent .deb out there... Other than that, from my viewpoint this can be closed. Thanks for the help!

By: Michael L. Young (elguero) 2012-10-11 16:21:31.197-0500

Closing per reporter's request.  This bug has been fixed in the latest version of Asterisk.