/** 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;
 }
 public NameAddress(String naddr) {
   SipParser par = new SipParser(naddr);
   NameAddress na = par.getNameAddress();
   // DEBUG
   // if (na==null)
   // { System.out.println("DEBUG: NameAddress:
   // par:\r\n"+par.getWholeString());
   // System.exit(0);
   // }
   name = na.name;
   url = na.url;
 }
Exemple #4
0
 /** Whether there is the specified parameter */
 public boolean hasParameter(String name) {
   SipParser par = new SipParser(url);
   return ((SipParser) par.goTo(';').skipChar()).hasParameter(name);
 }
Exemple #5
0
 /**
  * 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();
 }
Exemple #6
0
 /**
  * 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;
 }