Package org.zoolu.sip.provider

Examples of org.zoolu.sip.provider.SipParser


   }

   /** Gets content-length of ContentLengthHeader */
   public String getContentType()
   {  String str;
      int end=(new SipParser(value)).indexOf(';');
      if (end<0) str=value; else str=value.substring(0,end);
      return (new SipParser(str)).getString();
   }
View Full Code Here


   /** Gets the value of specified parameter.
     * @returns the parameter value or null if parameter does not exist or doesn't have a value (i.e. in case of flag parameter). */
   public String getParameter(String name)
   {  int index=indexOfFirstSemi();
      if (index<0) return null;
      return (new SipParser((new Parser(getValue(),index)).skipChar().skipWSP())).getParameter(name);
   }
View Full Code Here

   /** Gets a String Vector of parameter names.
     * @returns a Vector of String */
   public Vector getParameterNames()
   {  int index=indexOfFirstSemi();
      if (index<0) return new Vector();
      return (new SipParser((new Parser(getValue(),index)).skipChar().skipWSP())).getParameters();
   }
View Full Code Here

   /** Whether there is the specified parameter */
   public boolean hasParameter(String name)
   {  int index=indexOfFirstSemi();
      if (index<0) return false;
      return (new SipParser((new Parser(getValue(),index)).skipChar().skipWSP())).hasParameter(name);
   }
View Full Code Here

   super(hd);
   }

   /** Gets content-length of ContentLengthHeader */
   public int getContentLength()
   {  return (new SipParser(value)).getInt();
   }
View Full Code Here

  
   /** Gets value of ExpiresHeader as delta-seconds */
   public int getDeltaSeconds()
   {  int secs=-1;
      if (isDate())
      {  Date date=(new SipParser((new Parser(value)).getStringUnquoted())).getDate();
         secs=(int)((date.getTime()-System.currentTimeMillis())/1000);
         if (secs<0) secs=0;
      }
      else secs=(new SipParser(value)).getInt();

      return secs;
   }
View Full Code Here

   /** Gets value of ExpiresHeader as absolute date */
   public Date getDate()
   {  Date date=null;
      if (isDate())
      {  date=(new SipParser((new Parser(value)).getStringUnquoted())).getDate();
      }
      else
      long secs=getDeltaSeconds();
         if (secs>=0) date=new Date(System.currentTimeMillis()+secs*1000);
      }
View Full Code Here

   /** Costructs a MultipleHeader from a comma-separated header */
   public MultipleHeader(Header hd)
   {  name=hd.getName();
      values=new Vector();
      SipParser par=new SipParser(hd.getValue());
      int comma=par.indexOfCommaHeaderSeparator();
      while (comma>=0)
      {  values.addElement(par.getString(comma-par.getPos()).trim());
         par.skipChar(); //skip comma
         comma=par.indexOfCommaHeaderSeparator();
      }
      values.addElement(par.getRemainingString().trim());
      compact=true;     
   }
View Full Code Here

      compact=mhd.isCommaSeparated();     
   }

   /** Checks if Header <i>hd</i> contains comma-separated multi-header */
   public static boolean isCommaSeparated(Header hd)
   {  SipParser par=new SipParser(hd.getValue());
      return par.indexOfCommaHeaderSeparator()>=0;
   }
View Full Code Here

            //System.out.println("add user: "+user);
            addUser(user);
            continue;
         }
         if (line.startsWith(SipHeaders.Contact))
         {  SipParser par=new SipParser(line);
            name_address=((SipParser)par.skipString()).getNameAddress();
            //System.out.println("DEBUG: "+name_address);
            expire=(new SipParser(par.goTo("expires=").skipN(8).getStringUnquoted())).getDate();
            //System.out.println("DEBUG: "+expire);
            getUserBindingInfo(user).addContact(name_address,expire);
            continue;
        
      }
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.