Multi-record SRV records

Home » Asterisk Users » Multi-record SRV records
Asterisk Users 7 Comments

Hi List,

Just looking for advise on the current best approach to work around an
issue I am experiencing.

Currently I have a provider with whom I register, their domain has
multiple destinations defined in their SRV record for their domain.
Registrations appear to be working properly, and outbound calls appear
to be working as well. The problem arises when I receive inbound calls,
sometimes the calls are able to come through, and in other instances the
calls arrive but are not pushed through to the correct context because
the source ip address does not match that of the peer definition. I am
currently running 2 pbx’s, one is version and the other is

What are others out there doing that are facing the same issue. As far
as I am aware, the only way I know of to work around this issue is to
have multiple peer definitions for each address in the SRV list. Is this
still the case?


7 thoughts on - Multi-record SRV records

  • Hi,

    Yes, I do have the srv_lookup parameter set to “yes”.

    What appears to be happening is that when the are 2+ definitions in the
    SRV record then asterisk will only use one of those IP addresses for the
    peer definition. So when a call comes in from the other IP address, then
    it does not match the peer. For example:

    [a] SRV domain “” provides 2 addresses for it’s proxies, and
    [b] My host= line for my peer definition is defined as
    “” for peer [example]
    [c] When I start asterisk, or perform a sip reload, the “sip show peers”
    command only has one of or as the address defined
    for this peer.
    [d] When the peer has IP as the peer address then incoming
    calls from provider address fail and are successful.
    [e] When the peer has IP as the peer address then incoming
    calls from provider address fail and are successful.

    Registration and outbound calls are working as expected.

    Are you saying that the above scenario is working for you for incoming

  • Greetings,

    That will depend on my SIP providers, I’m not sure if they swap their
    IP’s indeed,and send calls down my way with alternating IP’s,
    perhaps they’re “smart” enough to only
    send calls down my way with the same IP that was bound with the
    registration request to begin with. (This is a shot in the dark, I might
    be saying nonsense).
    One of my providers, while troubleshooting an issue for inbound calls,
    offered me to use an IP rather then SRV to register –
    because “Asterisk is bad with using SRV’s” , but the issues turned out
    to be diffrent.
    I’m sorry I cannot shed much light on this one without monitoring my
    PBX’s peers at this moment.

    Guy Gold

  • Greetings back 🙂

    This is just it, if I do a SIP trace, on what is happening, the
    registrations are bouncing between the 2 addresses, and the inbound call
    comes in from the last address that my registration was against.

    What appears to be happening though is that my peer definition’s DNS
    address does not get updated with the last address registered against.
    For example:

    [a] register against’s IP
    [b] sip peer [example] has resolved the to be
    [c] call comes in from registered address, this works fine
    [d] i then re/refresh-register against
    [e] sip peer [example] still has the initial resolution of to be
    [f] call comes in via and this fails at my pbx.

    Can you recall what the issue may have been?

    No problem, thanks for the info/pointers thus far.

  • Hi,

    No, I’ve not tried this, however, will those entries be checked if the
    inbound call is not matched against the peer that those settings matched

    I’ll have to research this option a little more.