Round robin DNS breaking incoming calls

I am attempting to set up incoming calls via Callcentric, and I appear to be having the problem described here and here.

TL;DR version is that callcentric.com has multiple A records, so Asterisk registers with different servers over time. This seems to cause Asterisk to return a 401 UNAUTHORIZED to INVITES, possibly because the peer IP is not getting updated when the registration IP changes.

  1. Is there a way to verify that this is, in fact, the problem. sip show peers will show me peer IP addresses, but I haven’t been able to find a way to get sip show registry to show IP addresses.

  2. Assuming that this is the problem, what can I do about it?

(I am running Asterisk 1.8.32 on CentOS 6.)

You need to define peers for all of the A addresses. There isn’t an automated way of doing this, so you will need to hand code them.

I could do that, but what happens when Callcentric adds/removes/changes a proxy? This doesn’t really seem practical over the long term.

Fundamentally that is how chan_sip works unless you allow anonymous calls and send everything unrecognized to a specific context and route there.