/** Gets host of ViaHeader */ public String getHost() { String sentby = getSentBy(); SipParser par = new SipParser(sentby); par.goTo(':'); if (par.hasMore()) return sentby.substring(0, par.getPos()); else return sentby; }
/** Gets "sent-by" parameter */ public String getSentBy() { SipParser par = new SipParser(value); par.goTo('/').skipChar().goTo('/').skipString().skipWSP(); if (!par.hasMore()) return null; String sentby = value.substring(par.getPos(), par.indexOfSeparator()); return sentby; }
/** Whether there is the specified parameter */ public boolean hasParameter(String name) { SipParser par = new SipParser(url); return ((SipParser) par.goTo(';').skipChar()).hasParameter(name); }
/** * Gets a String Vector of parameter names. * * @return null if no parameter is present */ public Vector getParameters() { SipParser par = new SipParser(url); return ((SipParser) par.goTo(';').skipChar()).getParameters(); }
/** * Gets the value of specified parameter. * * @return null if parameter does not exist. */ public String getParameter(String name) { SipParser par = new SipParser(url); return ((SipParser) par.goTo(';').skipChar()).getParameter(name); }
/** Gets the transport protocol */ public String getProtocol() { SipParser par = new SipParser(value); return par.goTo('/').skipChar().goTo('/').skipChar().skipWSP().getString(); }
/** Gets port of ViaHeader */ public int getPort() { SipParser par = new SipParser(getSentBy()); par.goTo(':'); if (par.hasMore()) return par.skipChar().getInt(); return -1; }