public CallIdHeader getCallId() { // jeand : we save the header in a string form and reparse it, help GC // for dialogs updated not too often if (callIdHeader == null && callIdHeaderString != null) { try { this.callIdHeader = (CallIdHeader) new CallIDParser( callIdHeaderString).parse(); } catch (ParseException e) { logger.logError( "error reparsing the call id header", e); } } return this.callIdHeader; }
/** * parse the String message * @return SIPHeader (CallID object) * @throws ParseException if the message does not respect the spec. */ public SIPHeader parse() throws ParseException { if (debug) dbg_enter("parse"); try { this.lexer.match(TokenTypes.CALL_ID); this.lexer.SPorHT(); this.lexer.match(':'); this.lexer.SPorHT(); CallID callID = new CallID(); this.lexer.SPorHT(); String rest = lexer.getRest(); callID.setCallId(rest.trim()); return callID; } finally { if (debug) dbg_leave("parse"); } }