SIP trunk registration failure caused by querying wrong DNS record (A record instead of SRV record)

Status
Not open for further replies.

Jon

Customer
Joined
Dec 7, 2016
Messages
5
Reaction score
1
Hello,

Yesterday I upgraded from 3CX 15.5 to 16.0.5.619.

After the 3CX service started up, it was repeatedly failing to register with our SIP provider. Note that our SIP provider address is entered as a FQDN and we're using Google (8.8.8.8 and 8.8.4.4) as our DNS servers.

I did a packet capture and found that it was trying to contact the IP address of the A Record of our SIP provider -- not the SRV record. This was the problem.

The workaround was to remove the FQDN and instead manually enter the IP address of one of our provider's SIP servers. After pressing OK, it registered the trunk instantly.

What I think happened was, unfortunately, "by design," as explained in the 3CX documentation here:

DNS resolution
Before being able to communicate with a VoIP provider the PBX must resolve the IP of the server it has to speak with. The PBX will send SIP traffic to the specified “Registrar/Proxy” found in the VoIP provider’s configuration. If this is an FQDN (as opposed to an IP) the PBX will need to resolve it. It will first try to resolve the FQDN as an SRV record, and then (on failure) as an “A” record. “A” records are normal DNS records and these will be resolved normally. ...

It sounds like the first attempt to resolve the SRV record failed (just a routine random glitch in the matrix), so it fell back to requesting the A record, which succeeded.

This is undesirable behavior for obvious reasons -- if the first DNS query for an SRV record fails (for whatever reason -- say a packet gets dropped randomly), I want it to try again, or try the secondary DNS server. I do not want it to query the A record!

Therefore, I am requesting this feature: the user should be able to select the DNS record type that 3CX should query: SRV only, A only, or both SRV and A. It should not try SRV the and then automatically "fail over" to A record.

Note that this problem appears to be related to this one from several months ago:
https://www.3cx.com/community/threa...lving-since-updating-to-16-5-yesterday.72721/

Thank you.
 
This looks to be before the 'Auto Discovery' check box post so I assume you not longer consider this a bug.
 
Thanks for the quick reply.

Yes, your answer to my other thread solves this problem.

The answer is that Auto Discover does more than just automatically detect which port to use. It also enables or disables DNS lookup of SRV records, which perfectly explains why, when I initially had Auto Discover disabled (thinking I didn't need it because I knew which port to use), the trunk registration was failing!

From your link:
In the “General” tab next to the Registrar and Outbound Proxy fields there is the option “Auto Discovery”. When this option is disabled, the port must be manually specified. In this configuration 3CX will not attempt to look for NAPTR or SRV entries, it will only check for A or AAAA records.

Follow up action: I request that the documentation page "NAT, STUN Configuration for VoIP Providers with your PBX" be updated to reflect the correct behavior. As quoted in my original post, it says that 3CX first tries to search for SRV records, then fails over to A records. That is no longer true in version 16 because it only searches for SRV records if Auto Discovery is enabled.
 
Last edited:
  • Like
Reactions: Jeremy Bero
Status
Not open for further replies.

Forum statistics

Threads
111,955
Messages
589,925
Members
164,854
Latest member
uvitas