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 1.6.2.5 and the other is 1.8.5.0.

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?

Thanks

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

    Registration and outbound calls are working as expected.

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

  • 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 example.com’s IP 10.10.0.1
    [b] sip peer [example] has resolved the host=example.com to be 10.10.0.1
    [c] call comes in from registered address 10.10.0.1, this works fine
    [d] i then re/refresh-register against 10.10.0.2
    [e] sip peer [example] still has the initial resolution of
    host=example.com to be 10.10.0.1
    [f] call comes in via 10.10.0.2 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
    with?

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