@Override public SIPMessage parseSIPMessage(byte[] msgBuffer, boolean readBody, boolean strict, ParseExceptionListener parseExceptionListener) throws ParseException { return super.parseSIPMessage(msgBuffer, readBody, strict, parseExceptionListener); }
/** * Create a response from a string * * @param responseString -- * string from which to create the message null string returns an * empty message. * */ public Response createResponse(String responseString) throws java.text.ParseException { if (responseString == null) return new SIPResponse(); StringMsgParser smp = new StringMsgParser(); SIPMessage sipMessage = smp.parseSIPMessage(responseString.getBytes(), true, false, null); if (!(sipMessage instanceof SIPResponse)) throw new ParseException(responseString, 0); return (SIPResponse) sipMessage; }
exHandler = parseExceptionListener; SIPMessage sipMessage = smp.parseSIPMessage(requestString.getBytes(), true, this.strict, exHandler);
public boolean parse() { try { this.msg = new StringMsgParser().parseSIPMessage(payload.getBytes(), true, false, null); } catch (ParseException e) { return false; } if (msg == null) { return false; } try { this.callId = msg.getCallId().getCallId(); this.caller = HeaderAddressUtil.parseUser(msg.getFromHeader()); this.callee = HeaderAddressUtil.parseUser(msg.getToHeader()); if (msg instanceof SIPRequest) { SIPRequest r = (SIPRequest) msg; this.method = r.getMethod(); this.isRequest = true; } else { SIPResponse r = (SIPResponse) msg; this.method = String.valueOf(r.getStatusCode()); this.isRequest = false; } } catch (Exception e) { return false; } return true; }
rxBuffer.compact(); try { SIPMessage m = parser.parseSIPMessage( msg, true, true, this ); this.processMessage( m, rxTime ); rxTime = 0; // reset for next message