Package gov.nist.javax.sip.parser

Examples of gov.nist.javax.sip.parser.HeaderParser


     */

    public void addHeader(String sipHeader) {
        String hdrString = sipHeader.trim() + "\n";
        try {
            HeaderParser parser = ParserFactory.createParser(sipHeader);
            SIPHeader sh = parser.parse();
            this.attachHeader(sh, false);
        } catch (ParseException ex) {
            this.unrecognizedHeaders.add(hdrString);
        }
    }
View Full Code Here


    protected void testParser(Class parserClass, String[] headers) {
        try {
            for (int i = 0; i < headers.length; i++) {
                System.out.print(headers[i]);
                HeaderParser hp = createParser(parserClass, headers[i]);
                SIPHeader hdr = (SIPHeader) hp.parse();

                hp = createParser(parserClass, ((SIPHeader) hdr.clone()).encode().trim() + "\n");
                System.out.println("Encoded header = " + hdr.encode());
                assertEquals(hdr, hp.parse());

            }
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
            fail(getClass().getName());
View Full Code Here

        // Issue 315 : (https://jain-sip.dev.java.net/issues/show_bug.cgi?id=315)
        // header.getParameter() doesn't return quoted value
        try {
            String parameters = "Contact: <sip:127.0.0.1:5056>;+sip.instance=\"<urn:uuid:some-xxxx>\"";
            HeaderParser hp = createParser(ContactParser.class, parameters);
            SIPHeader hdr = (SIPHeader) hp.parse();
            assertEquals("\"<urn:uuid:some-xxxx>\"", ((ParametersExt)((ContactList)hdr).getFirst()).getParameter("+sip.instance", false));
        } catch (ParseException ex) {
            fail(this.getClass().getName());
        }
    }
View Full Code Here

     */

    public void addHeader(String sipHeader) {
        String hdrString = sipHeader.trim() + "\n";
        try {
            HeaderParser parser = ParserFactory.createParser(sipHeader);
            SIPHeader sh = parser.parse();
            this.attachHeader(sh, false);
        } catch (ParseException ex) {
            this.getUnrecognizedHeadersList().add(hdrString);
        }
    }
View Full Code Here

   */

  public void addHeader(String sipHeader) {
    String hdrString = sipHeader.trim() + "\n";
    try {
      HeaderParser parser = ParserFactory.createParser(sipHeader);
      SIPHeader sh = parser.parse();
      this.attachHeader(sh, false);
    } catch (ParseException ex) {
      this.unrecognizedHeaders.add(hdrString);
    }
  }
View Full Code Here

    protected void testParser(Class parserClass, String[] headers) {
        try {
            for (int i = 0; i < headers.length; i++) {
                System.out.print(headers[i]);
                HeaderParser hp = createParser(parserClass, headers[i]);
                SIPHeader hdr = (SIPHeader) hp.parse();

                hp = createParser(parserClass, ((SIPHeader) hdr.clone()).encode().trim() + "\n");
                System.out.println("Encoded header = " + hdr.encode());
                assertEquals(hdr, hp.parse());

            }
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
            fail(getClass().getName());
View Full Code Here

   */

  public void addHeader(String sipHeader) {
    String hdrString = sipHeader.trim() + "\n";
    try {
      HeaderParser parser = ParserFactory.createParser(sipHeader);
      SIPHeader sh = parser.parse();
      this.attachHeader(sh, false);
    } catch (ParseException ex) {
      this.unrecognizedHeaders.add(hdrString);
    }
  }
View Full Code Here

     */

    public void addHeader(String sipHeader) {
        String hdrString = sipHeader.trim() + "\n";
        try {
            HeaderParser parser = ParserFactory.createParser(sipHeader);
            SIPHeader sh = parser.parse();
            this.attachHeader(sh, false);
        } catch (ParseException ex) {
            this.unrecognizedHeaders.add(hdrString);
        }
    }
View Full Code Here

  protected void testParser(Class parserClass, String[] headers) {
    try {
      for (int i = 0; i < headers.length; i++) {
        System.out.print(headers[i]);
        HeaderParser hp = createParser(parserClass, headers[i]);
        SIPHeader hdr = (SIPHeader) hp.parse();
       
        hp = createParser(parserClass, ((SIPHeader)hdr.clone()).encode().trim()+"\n");
        System.out.println(hdr.encode());
        assertEquals(hdr, hp.parse());

      }
    } catch (java.text.ParseException ex) {
      ex.printStackTrace();
      fail(getClass().getName());
View Full Code Here

     */

    public void addHeader(String sipHeader) {
        String hdrString = sipHeader.trim() + "\n";
        try {
            HeaderParser parser = ParserFactory.createParser(sipHeader);
            SIPHeader sh = parser.parse();
            this.attachHeader(sh, false);
        } catch (ParseException ex) {
            this.getUnrecognizedHeadersList().add(hdrString);
        }
    }
View Full Code Here

TOP

Related Classes of gov.nist.javax.sip.parser.HeaderParser

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.