Affects Version/s: None
Fix Version/s: 2.0-pfd
The "Returns" part of the Javadoc for getRemoteAddr, getRemotePort is confusing since it asserts that the result will be null for local messages which is in conflict with the description of the method immediately above. In the case of getRemoteAddr 15.7 of the spec states
MUST return address of the remote SIP interface if the request was received from an external entity but if the request was internally routed (from one application to the next on the same container) then it MUST return the address of the container's SIP interface
So the value null must NOT be used for an internally routed message.
A similar problem exists for getRemotePort.
The only scenario in which an incoming message should have a null value for the remoteAddr (or -1 for remotePort) is a container generated error response. In this case the message has not been "sent" and so it seems reasonable that information about the local and remote address/port and the transport would be null values (or -1 for the port). In fact this may be the only way for the application to distinguish a container generated response from those received from an app or externally. It would be helpful if the Javadoc page explicitly mentioned this scenario.