jain-sip
jain-sip copied to clipboard
SIPMessage hashCode implementation just takes CallID
This is fundametally wrong, and can potentially create incorrect logic, and make collections containing SIPMessage to perform poor. This needs to be addressed ASAP.
Proposal on new impl is to consider (CallId + topmostVia.branchId + req/res). Probably better to implement diff hashCode on req and res level
Implementing using firstLine + callid + topvia.branch
Specified by spec https://jsip.ci.cloudbees.com/job/jsip/javadoc/javax/sip/message/Message.html#equals(java.lang.Object)
Request/Response line, From, To, CallID, MaxForwards, CSeq and Via headers
TCK collisions with SPEC requirements at https://github.com/RestComm/jain-sip/blob/master/src/test/tck/factory/MessageFactoryTest.java#L76
Setting an extension header follows with an assertion checking Reqs are different. Since no mandatory header was changed, the Reqs are equal in terms of JAIN SIP Spec, but TCK assumed deep equality.