UDP Transport rules in RFC 3261 specify the following:
Otherwise (for unreliable unicast transports), if the top Via has a "received" parameter, the response MUST be sent to the address in the "received" parameter, using the port indicated in the "sent-by" value, or using port 5060 if none is specified explicitly.
However, in practice it appears that this library is attempting to use the rules for TCP for UDP as well, which allow re-using the connection, and therefore sending the response back to the sending address:port if it's still open rather than using the received parameter in the header.
It should be sending the UDP response using this address: request.headers.via[0].params.received and a port of request.headers.via[0].params['sent-by'] if present, or 5060 if not present.
UDP Transport rules in RFC 3261 specify the following:
However, in practice it appears that this library is attempting to use the rules for TCP for UDP as well, which allow re-using the connection, and therefore sending the response back to the sending
address:port
if it's still open rather than using thereceived
parameter in the header.It should be sending the UDP response using this address:
request.headers.via[0].params.received
and a port ofrequest.headers.via[0].params['sent-by']
if present, or5060
if not present.