Package javax.servlet.sip

Examples of javax.servlet.sip.SipURI.removeParameter()


    SipURI orig = new SipURIImpl("sip:foo@bar.com;transport=tcp?to=sip:bob%40biloxi.com");
    SipURI readOnly = new ReadOnlySipURI((SipURI) orig.clone());
   
    assertEquals(orig, readOnly);
    try { readOnly.setParameter("foo", "bar"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeParameter("transport"); fail();} catch (IllegalStateException e) {} 
    try { readOnly.setHeader("subject", "toto"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeHeader("to"); fail();} catch (IllegalStateException e) {}
    assertEquals(orig, readOnly);
    assertEquals(readOnly, orig);
    assertEquals(orig.toString(), readOnly.toString());
View Full Code Here


    try { uri.setLrParam(true); fail(); } catch (IllegalStateException e) {}
    try { uri.setMAddrParam("bad"); fail(); } catch (IllegalStateException e) {}
    try { uri.setMethodParam("Bad"); fail(); } catch (IllegalStateException e) {}
    try { uri.setTTLParam(2); fail(); } catch (IllegalStateException e) {}
    try { uri.setParameter("lr", ""); fail(); } catch (IllegalStateException e) {}
    try { uri.removeParameter("Maddr"); fail(); } catch (IllegalStateException e) {}
    uri.setParameter("transport", "UDP");
    assertEquals("UDP", uri.getParameter("transport"));
    assertEquals("Bob <sip:bob@127.0.0.1:5060;transport=UDP>;isfocus", contact.toString());
   
    // Full read-only on committed
View Full Code Here

    contact = request.getAddressHeader("Contact");
    uri = (SipURI) contact.getURI();
    contact.setDisplayName("Bob");
    uri.setHost("nexcom.fr");
    uri.setPort(5062);
    uri.removeParameter("transport");
    uri.setUser("bob");
    assertEquals("Bob <sip:bob@nexcom.fr:5062>", contact.toString());   
  }
 
 
View Full Code Here

  {
    URI target = uri.clone();
    if (target.isSipURI())
    {
      SipURI sipUri = (SipURI) target;
      sipUri.removeParameter("method");
      Iterator<String> it = sipUri.getHeaderNames();
      while (it.hasNext())
      {
        it.remove();
      }
View Full Code Here

     */
    public static String removeParameter(URI uri, String name) {
        if (uri instanceof SipURI) {
            SipURI sipUri = (SipURI) uri;
            String value = sipUri.getParameter(name);
            sipUri.removeParameter(name);

            return value;
        } else {
            TelURLImpl telUrl = (TelURLImpl) uri;
            String value = telUrl.getParameter(name);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.