sipgo
sipgo copied to clipboard
DNS Resolution Error in case of WSS based SIP Transaction
Hello,
I am working on a system where my SIP Server is on AWS. in my setup, I have "A Record" mapping of "ims.xxxx.in" as the domain-name to "65.2.x.x" IP address.
On most networks, I can use my SIP Server from my client via forwarding the packet to "ims.xxxx.in" and using the WSS as the transport.
However, there are few networks, where this server is not accessible as the SIP request to server timeouts. Upon further investigation, what I found is as following:
-
If we do
net.LookupIP("ims.xxxx.in")
on a problem network and print the results then, we receive the following:IP address: 64:ff9b::4102:xxxx IP address: 65.2.x.x
-
Looking at sipgo transport-related code, I can see that the function "resolveAddrIP()" used for DNS lookup, returns the 1st IP address found for the given host.
-
In my scenario, since the 1st IP address is of type IPv6 (actually IPv4 represented in IPv6 Format), and it is not directly mapped to the given host, I think all the SIP transactions are timing out.
Is there a way to solve this issue? like can we do some kind of cascading type IP address pickup here? Or can we put some kind of restrictions for looking for IPv4 addresses only?
Any suggestion will be helpful.
Thanks