Package org.zoolu.sip.provider

Examples of org.zoolu.sip.provider.SipParser


   }

   /** 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);
   }
View Full Code Here


  
  
   /** 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();
   }
View Full Code Here

       return ((SipParser)par.goTo(';').skipChar()).getParameters();
   }
  
   /** Whether there is the specified parameter */
   public boolean hasParameter(String name) { 
     SipParser par = new SipParser(url);
       return ((SipParser)par.goTo(';').skipChar()).hasParameter(name);
   }
View Full Code Here

   super(hd);
   }

   /** Gets date value of DateHeader */
   public Date getDate()
   {  SipParser par=new SipParser(value);
      return par.getDate();
   }
View Full Code Here

   super(SipHeaders.Via,"SIP/2.0/"+proto.toUpperCase()+" "+host+":"+port+";branch="+branch);
   }*/

   /** Gets the transport protocol */
   public String getProtocol()
   {  SipParser par=new SipParser(value);
      return par.goTo('/').skipChar().goTo('/').skipChar().skipWSP().getString();
   }
View Full Code Here

      return par.goTo('/').skipChar().goTo('/').skipChar().skipWSP().getString();
   }

   /** 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;
   }
View Full Code Here

   }

   /** 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;
   }
View Full Code Here

      return false;
   }
  
   /** Gets port of ViaHeader */
   public int getPort()
   {  SipParser par=new SipParser(getSentBy());
      par.goTo(':');
      if (par.hasMore()) return par.skipChar().getInt();
      return -1;
   }
View Full Code Here


   /** Whether has parameter <i>param_name</i> */
   public boolean hasParameter(String param_name)
   {  char[] name_separators={'='' ', '\t', '\r', '\n'};
      SipParser par=new SipParser(value);
      par.skipString(); // skip the auth_scheme
      par.skipWSPCRLF();
      while (par.hasMore())
      {  String name=par.getWord(name_separators);
         if (name.equals(param_name)) return true;
         par.goToCommaHeaderSeparator().skipChar().skipWSPCRLF();
      }
      return false;
   }
View Full Code Here

 
   /** Returns the parameter <i>param_name</i>, without quotes. */
   public String getParameter(String param_name)
   {  char[] name_separators={'=', ' ', '\t'};
      SipParser par=new SipParser(value);
      par.skipString(); // skip the auth_scheme
      par.skipWSPCRLF();
      while (par.hasMore())
      {  String name=par.getWord(name_separators);
         if (name.equals(param_name))
         {  par.goTo('=').skipChar().skipWSP();
            int comma=par.indexOfCommaHeaderSeparator();
            if (comma>=0)
               par=new SipParser(par.getString(comma-par.getPos()));
            return par.getStringUnquoted();
         }
         else par.goToCommaHeaderSeparator().skipChar().skipWSPCRLF();
      }
      return null;
   }
View Full Code Here

TOP

Related Classes of org.zoolu.sip.provider.SipParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.