Package org.zoolu.tools

Examples of org.zoolu.tools.Parser


   /** Removes specified parameter (if present) */
   public void removeParameter(String name) { 
     int index = url.indexOf(';');
       if (index < 0) return;
       Parser par = new Parser(url,index);
       while (par.hasMore()) { 
         int begin_param = par.getPos();
         par.skipChar();
         if (par.getWord(SipParser.param_separators).equals(name)) { 
           String top = url.substring(0,begin_param);
           par.goToSkippingQuoted(';');
           String bottom = "";
           if (par.hasMore()) bottom = url.substring(par.getPos());
           url = top.concat(bottom);
           return;
         }
         par.goTo(';');
      }
   }
View Full Code Here


   }

   /** Gets list of tokens (as Vector of Strings). */
   public Vector getElements()
   {  Vector elements=new Vector();
      Parser par=new Parser(value);
      char[] delim={ ',' };
      while (par.hasMore())
      {  String elem=par.getWord(delim).trim();
         if (elem!=null && elem.length()>0) elements.addElement(elem);
         par.skipChar();
      }
      return elements;
   }
View Full Code Here

      if (audio_app!=null || video_app!=null)
      {  printLog("DEBUG: media application is already running",LogLevel.HIGH);
         return;
      }
      SessionDescriptor local_sdp=new SessionDescriptor(call.getLocalSessionDescriptor());
      String local_media_address=(new Parser(local_sdp.getConnection().toString())).skipString().skipString().getString();
      int local_audio_port=0;
      int local_video_port=0;
      // parse local sdp
      for (Enumeration e=local_sdp.getMediaDescriptors().elements(); e.hasMoreElements(); )
      {  MediaField media=((MediaDescriptor)e.nextElement()).getMedia();
         if (media.getMedia().equals("audio"))
            local_audio_port=media.getPort();
         if (media.getMedia().equals("video"))
            local_video_port=media.getPort();
      }
      // parse remote sdp
      SessionDescriptor remote_sdp=new SessionDescriptor(call.getRemoteSessionDescriptor());
      String remote_media_address=(new Parser(remote_sdp.getConnection().toString())).skipString().skipString().getString();
      int remote_audio_port=0;             
      int remote_video_port=0;             
      for (Enumeration e=remote_sdp.getMediaDescriptors().elements(); e.hasMoreElements(); )
      {  MediaField media=((MediaDescriptor)e.nextElement()).getMedia();
         if (media.getMedia().equals("audio"))
View Full Code Here

TOP

Related Classes of org.zoolu.tools.Parser

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.