sipsorcery icon indicating copy to clipboard operation
sipsorcery copied to clipboard

SIPRegistrationUserAgent Resolve Issues

Open henlil opened this issue 2 years ago • 1 comments

I think some basic behavior is missing in the SIPRegistrationUserAgent when it comes to SRV lookups.

  1. The outbound proxy must be resolved for each registration attempt (just as registrarHost when no outbound proxy is given). The outbound proxy might be a SRV lookup.
  2. The m_attempts must be passed to the ResolveSIPUriAsync method (ResolveSIPUriDelegateAsync also needs an update). It's needed to select the correct SRV entry when resolving.
  3. The SRV lookup randomization based on priority and weight for each attempt is also missing.

Will there be other issues, for example when resolving from cache later?

How to proceed? A fix would introduce some breaking changes I think?

henlil avatar Apr 01 '22 08:04 henlil

The OutboundProxy can only be set to a SIPEndPoint which requires an IPAddress and not a host name. There are no DNS lookups involved if you set the OutboundProxy.

I suspect what you're after is being able to set the OutboundProxy to a SIP URI, which can then be a host or IP Address. That's definitely a valid case. I've never happended to need it so far hence it's not implemented. If you would like to implement it we'd be happy to accept a PR.

sipsorcery avatar Apr 02 '22 20:04 sipsorcery