/** * Match with a template. You can use this if you want to match incoming messages with a pattern * and do something when you find a match. This is useful for building filters/pattern matching * responders etc. * * @param matchObj object to match ourselves with (null matches wildcard) */ public boolean match(Object matchObj) { if (matchObj == null) return true; else if (!matchObj.getClass().equals(this.getClass())) return false; else if (matchObj == this) return true; SIPRequest that = (SIPRequest) matchObj; RequestLine rline = that.requestLine; if (this.requestLine == null && rline != null) return false; else if (this.requestLine == rline) return super.match(matchObj); return requestLine.match(that.requestLine) && super.match(matchObj); }