示例#1
0
 /** 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;
 }
示例#2
0
 /** 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;
 }
示例#3
0
 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;
 }
示例#4
0
文件: SipURL.java 项目: jptien/ims-v1
 /** Whether there is the specified parameter */
 public boolean hasParameter(String name) {
   SipParser par = new SipParser(url);
   return ((SipParser) par.goTo(';').skipChar()).hasParameter(name);
 }
示例#5
0
文件: SipURL.java 项目: jptien/ims-v1
 /**
  * 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();
 }
示例#6
0
文件: SipURL.java 项目: jptien/ims-v1
 /**
  * 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);
 }
示例#7
0
 /** Gets the transport protocol */
 public String getProtocol() {
   SipParser par = new SipParser(value);
   return par.goTo('/').skipChar().goTo('/').skipChar().skipWSP().getString();
 }
示例#8
0
 /** Gets port of ViaHeader */
 public int getPort() {
   SipParser par = new SipParser(getSentBy());
   par.goTo(':');
   if (par.hasMore()) return par.skipChar().getInt();
   return -1;
 }