Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
   * Conditions Of Use
   *
   * This software was developed by employees of the National Institute of
   * Standards and Technology (NIST), an agency of the Federal Government.
   * Pursuant to title 15 Untied States Code Section 105, works of NIST
   * employees are not subject to copyright protection in the United States
   * and are considered to be in the public domain.  As a result, a formal
   * license is not needed to use the software.
  *
  * This software is provided by NIST as a service and is expressly
  * provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
  * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
  * AND DATA ACCURACY.  NIST does not warrant or make any representations
  * regarding the use of the software or the results thereof, including but
  * not limited to the correctness, accuracy, reliability or usefulness of
  * the software.
  *
  * Permission to use this software is contingent upon your acceptance
  * of the terms of this agreement
  *
  * .
  *
  */
Product of NIST/ITL Advanced Networking Technologies Division (ANTD). * /
  
  package gov.nist.javax.sip.address;
  
  /*
   *Bug fix contributions
   *Daniel J. Martinez Manzano <dani@dif.um.es>
   *Stefan Marx.
   *pmusgrave@newheights.com (Additions for gruu and outbound drafts)
   *Jeroen van Bemmel ( additions for SCTP transport )
   */
  import gov.nist.core.*;
  import java.util.*;
  
Implementation of the SipURI interface.

Author(s):
M. Ranganathan
Version:
1.2 $Revision: 1.23 $ $Date: 2010/01/20 10:12:03 $
  
  public class SipUri extends GenericURI implements javax.sip.address.SipURI , SipURIExt{
  
   
      private static final long serialVersionUID = 7749781076218987044L;

    
Authority for the uri.
  
  
      protected Authority authority;

    
uriParms list
  
      protected NameValueList uriParms;

    
qheaders list
  
      protected NameValueList qheaders;

    
telephoneSubscriber field
  
      protected TelephoneNumber telephoneSubscriber;
  
      public SipUri() {
          this. = ;
          this. = new NameValueList();
          this. = new NameValueList();
          this..setSeparator("&");
      }

    
Constructor given the scheme. The scheme must be either Sip or Sips
  
      public void setScheme(String scheme) {
          if (scheme.compareToIgnoreCase() != 0
              && scheme.compareToIgnoreCase() != 0)
              throw new IllegalArgumentException("bad scheme " + scheme);
          this. = scheme.toLowerCase();
      }

    
Get the scheme.
  
     public String getScheme() {
         return ;
     }

    
clear all URI Parameters.

Since:
v1.0
 
     public void clearUriParms() {
          = new NameValueList();
     }
    
Clear the password from the user part if it exists.
 
     public void clearPassword() {
         if (this. != null) {
             UserInfo userInfo = .getUserInfo();
             if (userInfo != null)
                 userInfo.clearPassword();
         }
     }

    
Get the authority.
 
     public Authority getAuthority() {
         return this.;
     }

    
Clear all Qheaders.
 
     public void clearQheaders() {
          = new NameValueList();
     }

    
Compare two URIs and return true if they are equal.

Parameters:
that the object to compare to.
Returns:
true if the object is equal to this object. JvB: Updated to define equality in terms of API methods, according to the rules in RFC3261 section 19.1.4 Jean Deruelle: Updated to define equality of API methods, according to the rules in RFC3261 section 19.1.4 convert potential ie : %HEX HEX encoding parts of the URI before comparing them transport param added in comparison header equality enforced in comparison
 
     @SuppressWarnings("unchecked")
     @Override
     public boolean equals(Object that) {
 
         // Shortcut for same object
         if (that==thisreturn true;
 
         if (that instanceof SipURI) {
             final SipURI a = this;
             final SipURI b = (SipURIthat;
 
             // A SIP and SIPS URI are never equivalent
             if ( a.isSecure() ^ b.isSecure() ) return false;
 
             // For two URIs to be equal, the user, password, host, and port
             // components must match; comparison of userinfo is case-sensitive
             if (a.getUser()==null ^ b.getUser()==nullreturn false;
             if (a.getUserPassword()==null ^ b.getUserPassword()==nullreturn false;
 
             if (a.getUser()!=null && !UriDecoder.decode(a.getUser()).equals(UriDecoder.decode(b.getUser()))) return false;
             if (a.getUserPassword()!=null && !UriDecoder.decode(a.getUserPassword()).equals(UriDecoder.decode(b.getUserPassword()))) return false;
             if (a.getHost() == null ^ b.getHost() == nullreturn false;
             if (a.getHost() != null && !a.getHost().equalsIgnoreCase(b.getHost())) return false;
             if (a.getPort() != b.getPort()) return false;
 
             // URI parameters
             for (Iterator i = a.getParameterNames(); i.hasNext();) {
                 String pname = (Stringi.next();
 
                 String p1 = a.getParameter(pname);
                 String p2 = b.getParameter(pname);
 
                 // those present in both must match (case-insensitive)
                 if (p1!=null && p2!=null && !UriDecoder.decode(p1).equalsIgnoreCase(UriDecoder.decode(p2))) return false;
             }
 
             // transport, user, ttl or method must match when present in either
             if (a.getTransportParam()==null ^ b.getTransportParam()==nullreturn false;
             if (a.getUserParam()==null ^ b.getUserParam()==nullreturn false;
             if (a.getTTLParam()==-1 ^ b.getTTLParam()==-1) return false;
             if (a.getMethodParam()==null ^ b.getMethodParam()==nullreturn false;
             if (a.getMAddrParam()==null ^ b.getMAddrParam()==nullreturn false;
 
             // Headers: must match according to their definition.
             if(a.getHeaderNames().hasNext() && !b.getHeaderNames().hasNext()) return false;
             if(!a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) return false;
 
             if(a.getHeaderNames().hasNext() && b.getHeaderNames().hasNext()) {
                 HeaderFactory headerFactory = null;
                 try {
                     headerFactory = SipFactory.getInstance().createHeaderFactory();
                 } catch (PeerUnavailableException e) {
                     Debug.logError("Cannot get the header factory to parse the header of the sip uris to compare"e);
                     return false;
                 }
                 for (Iterator i = a.getHeaderNames(); i.hasNext();) {
                     String hname = (Stringi.next();
 
                     String h1 = a.getHeader(hname);
                     String h2 = b.getHeader(hname);
 
                     if(h1 == null && h2 != nullreturn false;
                     if(h2 == null && h1 != nullreturn false;
                     // The following check should not be needed but we add it for findbugs.
                     if(h1 == null && h2 == nullcontinue
                     try {
                         Header header1 = headerFactory.createHeader(hname, UriDecoder.decode(h1));
                         Header header2 = headerFactory.createHeader(hname, UriDecoder.decode(h2));
                         // those present in both must match according to the equals method of the corresponding header
                         if (!header1.equals(header2)) return false;
                     } catch (ParseException e) {
                         Debug.logError("Cannot parse one of the header of the sip uris to compare " + a + " " + be);
                         return false;
                     }
                 }
             }
 
             // Finally, we can conclude that they are indeed equal
             return true;
         }
         return false;
     }

    
Construct a URL from the parsed structure.

Returns:
String
 
     public String encode() {
         return encode(new StringBuffer()).toString();
     }
 
     public StringBuffer encode(StringBuffer buffer) {
         buffer.append().append();
         if ( != null)
             .encode(buffer);
         if (!.isEmpty()) {
             buffer.append();
             .encode(buffer);
         }
         if (!.isEmpty()) {
             buffer.append();
             .encode(buffer);
         }
         return buffer;
     }

    
Return a string representation.

Returns:
the String representation of this URI.
 
     public String toString() {
         return this.encode();
     }

    
getUser@host

Returns:
user@host portion of the uri (null if none exists). Peter Musgrave - handle null user
 
     public String getUserAtHost() {
         String user = "";
         if (.getUserInfo() != null)
             user = .getUserInfo().getUser();
 
         String host = .getHost().encode();
         StringBuffer s = null;
         if (user.equals("")) {
             s = new StringBuffer();
         } else {
             s = new StringBuffer(user).append();
         }
         return s.append(host).toString();
     }

    
getUser@host

Returns:
user@host portion of the uri (null if none exists).
 
     public String getUserAtHostPort() {
         String user = "";
         if (.getUserInfo() != null)
             user = .getUserInfo().getUser();
 
         String host = .getHost().encode();
         int port = .getPort();
         // If port not set assign the default.
         StringBuffer s = null;
         if (user.equals("")) {
             s = new StringBuffer();
         } else {
             s = new StringBuffer(user).append();
         }
         if (port != -1) {
             return s.append(host).append().append(port).toString();
         } else
             return s.append(host).toString();
 
     }

    
get the parameter (do a name lookup) and return null if none exists.

Parameters:
parmname Name of the parameter to get.
Returns:
Parameter of the given name (null if none exists).
 
     public Object getParm(String parmname) {
         Object obj = .getValue(parmname);
         return obj;
     }

    
Get the method parameter.

Returns:
Method parameter.
 
     public String getMethod() {
         return (StringgetParm();
     }

    
Accessor for URI parameters

Returns:
A name-value list containing the parameters.
 
     public NameValueList getParameters() {
         return ;
     }

    
Remove the URI parameters.
 
     public void removeParameters() {
         this. = new NameValueList();
     }

    
Accessor forSIPObjects

Returns:
Get the query headers (that appear after the ? in the URL)
 
     public NameValueList getQheaders() {
         return ;
     }

    
Get the urse parameter.

Returns:
User parameter (user= phone or user=ip).
 
     public String getUserType() {
         return (String.getValue();
     }

    
Get the password of the user.

Returns:
User password when it embedded as part of the uri ( a very bad idea).
 
     public String getUserPassword() {
         if ( == null)
             return null;
         return .getPassword();
     }

    
Set the user password.

Parameters:
password - password to set.
 
     public void setUserPassword(String password) {
         if (this. == null)
             this. = new Authority();
         .setPassword(password);
     }

    
Returns the stucture corresponding to the telephone number provided that the user is a telephone subscriber.

Returns:
TelephoneNumber part of the url (only makes sense when user = phone is specified)
 
         if ( == null) {
 
              = new TelephoneNumber();
         }
         return ;
     }

    
Get the host and port of the server.

Returns:
get the host:port part of the url parsed into a structure.
 
     public HostPort getHostPort() {
 
         if ( == null || .getHost() == null )
             return null;
         else {
             return .getHostPort();
         }
     }

    
Get the port from the authority field.

Returns:
the port from the authority field.
 
     public int getPort() {
         HostPort hp = this.getHostPort();
         if (hp == null)
             return -1;
         return hp.getPort();
     }

    
Get the host protion of the URI.

Returns:
the host portion of the url.
 
     public String getHost() {
         if (  == nullreturn null;
         else if (.getHost() == null ) return null;
         else return .getHost().encode();
     }

    
returns true if the user is a telephone subscriber. If the host is an Internet telephony gateway, a telephone-subscriber field MAY be used instead of a user field. The telephone-subscriber field uses the notation of RFC 2806 [19]. Any characters of the un-escaped "telephone-subscriber" that are not either in the set "unreserved" or "user-unreserved" MUST be escaped. The set of characters not reserved in the RFC 2806 description of telephone-subscriber contains a number of characters in various syntax elements that need to be escaped when used in SIP URLs, for example quotation marks (%22), hash (%23), colon (%3a), at-sign (%40) and the "unwise" characters, i.e., punctuation of %5b and above. The telephone number is a special case of a user name and cannot be distinguished by a BNF. Thus, a URL parameter, user, is added to distinguish telephone numbers from user names. The user parameter value "phone" indicates that the user part contains a telephone number. Even without this parameter, recipients of SIP URLs MAY interpret the pre-@ part as a telephone number if local restrictions on the

Returns:
true if the user is a telephone subscriber.
 
     public boolean isUserTelephoneSubscriber() {
         String usrtype = (String.getValue();
         if (usrtype == null)
             return false;
         return usrtype.equalsIgnoreCase();
     }

    
remove the ttl value from the parameter list if it exists.
 
     public void removeTTL() {
         if ( != null)
             .delete();
     }

    
Remove the maddr param if it exists.
 
     public void removeMAddr() {
         if ( != null)
             .delete();
     }

    
Delete the transport string.
 
     public void removeTransport() {
         if ( != null)
             .delete();
     }

    
Remove a header given its name (provided it exists).

Parameters:
name name of the header to remove.
 
     public void removeHeader(String name) {
         if ( != null)
             .delete(name);
     }

    
Remove all headers.
 
     public void removeHeaders() {
          = new NameValueList();
     }

    
Set the user type.
 
     public void removeUserType() {
         if ( != null)
             .delete();
     }

    
remove the port setting.
 
     public void removePort() {
         .removePort();
     }

    
remove the Method.
 
     public void removeMethod() {
         if ( != null)
             .delete();
     }

    
Sets the user of SipURI. The identifier of a particular resource at the host being addressed. The user and the user password including the "at" sign make up the user-info.

Parameters:
uname The new String value of the user.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the user value.
 
     public void setUser(String uname) {
         if (this. == null) {
             this. = new Authority();
         }
 
         this..setUser(uname);
     }

    
Remove the user.
 
     public void removeUser() {
         this..removeUserInfo();
     }

    
Set the default parameters for this URI. Do nothing if the parameter is already set to some value. Otherwise set it to the given value.

Parameters:
name Name of the parameter to set.
value value of the parameter to set.
 
     public void setDefaultParm(String nameObject value) {
         if (.getValue(name) == null) {
             NameValue nv = new NameValue(namevalue);
             .set(nv);
         }
     }

    
Set the authority member

Parameters:
authority Authority to set.
 
     public void setAuthority(Authority authority) {
         this. = authority;
     }

    
Set the host for this URI.

Parameters:
h host to set.
 
     public void setHost(Host h) {
         if (this. == null)
             this. = new Authority();
         this..setHost(h);
     }

    
Set the uriParms member

Parameters:
parms URI parameters to set.
 
     public void setUriParms(NameValueList parms) {
          = parms;
     }

    
Set a given URI parameter. Note - parameter must be properly encoded before the function is called.

Parameters:
name Name of the parameter to set.
value value of the parameter to set.
 
     public void setUriParm(String nameObject value) {
         NameValue nv = new NameValue(namevalue);
         .set(nv);
     }

    
Set the qheaders member

Parameters:
parms query headers to set.
 
     public void setQheaders(NameValueList parms) {
          = parms;
     }

    
Set the MADDR parameter .

Parameters:
mAddr Host Name to set
 
     public void setMAddr(String mAddr) {
         NameValue nameValue = .getNameValue();
         Host host = new Host();
         host.setAddress(mAddr);
         if (nameValue != null)
             nameValue.setValueAsObject(host);
         else {
             nameValue = new NameValue(host);
             .set(nameValue);
         }
     }

    
Sets the value of the user parameter. The user URI parameter exists to distinguish telephone numbers from user names that happen to look like telephone numbers. This is equivalent to setParameter("user", user).

Parameters:
usertype New value String value of the method parameter
 
     public void setUserParam(String usertype) {
         .set(usertype);
     }

    
Set the Method

Parameters:
method method parameter
 
     public void setMethod(String method) {
         .set(method);
     }

    
Sets ISDN subaddress of SipURL

Parameters:
isdnSubAddress ISDN subaddress
 
     public void setIsdnSubAddress(String isdnSubAddress) {
         if ( == null)
              = new TelephoneNumber();
         .setIsdnSubaddress(isdnSubAddress);
     }

    
Set the telephone subscriber field.

Parameters:
tel Telephone subscriber field to set.
 
     public void setTelephoneSubscriber(TelephoneNumber tel) {
          = tel;
     }

    
set the port to a given value.

Parameters:
p Port to set.
 
     public void setPort(int p) {
         if ( == null)
              = new Authority();
         .setPort(p);
     }

    
Boolean to check if a parameter of a given name exists.

Parameters:
name Name of the parameter to check on.
Returns:
a boolean indicating whether the parameter exists.
 
     public boolean hasParameter(String name) {
 
         return .getValue(name) != null;
     }

    
Set the query header when provided as a name-value pair.

Parameters:
nameValue qeuery header provided as a name,value pair.
 
     public void setQHeader(NameValue nameValue) {
         this..set(nameValue);
     }

    
Set the parameter as given.

Parameters:
nameValue - parameter to set.
 
     public void setUriParameter(NameValue nameValue) {
         this..set(nameValue);
     }

    
Return true if the transport parameter is defined.

Returns:
true if transport appears as a parameter and false otherwise.
 
     public boolean hasTransport() {
         return hasParameter();
     }

    
Remove a parameter given its name

Parameters:
name -- name of the parameter to remove.
 
     public void removeParameter(String name) {
         .delete(name);
     }

    
Set the hostPort field of the imbedded authority field.

Parameters:
hostPort is the hostPort to set.
 
     public void setHostPort(HostPort hostPort) {
         if (this. == null) {
             this. = new Authority();
         }
         .setHostPort(hostPort);
     }

    
clone this.
 
     public Object clone() {
         SipUri retval = (SipUrisuper.clone();
         if (this. != null)
             retval.authority = (Authoritythis..clone();
         if (this. != null)
             retval.uriParms = (NameValueListthis..clone();
         if (this. != null)
             retval.qheaders = (NameValueListthis..clone();
         if (this. != null)
             retval.telephoneSubscriber = (TelephoneNumberthis..clone();
         return retval;
     }

    
Returns the value of the named header, or null if it is not set. SIP/SIPS URIs may specify headers. As an example, the URI sip:joe@jcp.org?priority=urgent has a header "priority" whose value is "urgent".

Parameters:
name name of header to retrieve
Returns:
the value of specified header
 
     public String getHeader(String name) {
         return this..getValue(name) != null
             ? this..getValue(name).toString()
             : null;
 
     }

    
Returns an Iterator over the names (Strings) of all headers present in this SipURI.

Returns:
an Iterator over all the header names
 
     public Iterator<StringgetHeaderNames() {
         return this..getNames();
 
     }

    
Returns the value of the lr parameter, or null if this is not set. This is equivalent to getParameter("lr").

Returns:
the value of the lr parameter
 
     public String getLrParam() {
         boolean haslr = this.hasParameter();
         return haslr ? "true" : null;
     }

    
Returns the value of the maddr parameter, or null if this is not set. This is equivalent to getParameter("maddr").

Returns:
the value of the maddr parameter
 
     public String getMAddrParam() {
         NameValue maddr = .getNameValue();
         if (maddr == null)
             return null;
         String host = (Stringmaddr.getValueAsObject();
         return host;
     }

    
Returns the value of the method parameter, or null if this is not set. This is equivalent to getParameter("method").

Returns:
the value of the method parameter
 
     public String getMethodParam() {
         return this.getParameter();
     }

    
Returns the value of the named parameter, or null if it is not set. A zero-length String indicates flag parameter.

Parameters:
name name of parameter to retrieve
Returns:
the value of specified parameter
 
     public String getParameter(String name) {
         Object val = .getValue(name);
         if (val == null)
             return null;
         if (val instanceof GenericObject)
             return ((GenericObjectval).encode();
         else
             return val.toString();
     }

    
Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.

Returns:
an Iterator over all the parameter names
 
     public Iterator<StringgetParameterNames() {
         return this..getNames();
     }

    
Returns the value of the "ttl" parameter, or -1 if this is not set. This method is equivalent to getParameter("ttl").

Returns:
the value of the ttl parameter
 
     public int getTTLParam() {
         Integer ttl = (Integer.getValue("ttl");
         if (ttl != null)
             return ttl.intValue();
         else
             return -1;
     }

    
Returns the value of the "transport" parameter, or null if this is not set. This is equivalent to getParameter("transport").

Returns:
the transport paramter of the SipURI
 
     public String getTransportParam() {
         if ( != null) {
             return (String.getValue();
         } else
             return null;
     }

    
Returns the value of the userParam, or null if this is not set.

This is equivalent to getParameter("user").

Returns:
the value of the userParam of the SipURI
 
     public String getUser() {
         return .getUser();
     }

    
Returns true if this SipURI is secure i.e. if this SipURI represents a sips URI. A sip URI returns false.

Returns:
true if this SipURI represents a sips URI, and false if it represents a sip URI.
 
     public boolean isSecure() {
         return this.getScheme().equalsIgnoreCase();
     }

    
This method determines if this is a URI with a scheme of "sip" or "sips".

Returns:
true if the scheme is "sip" or "sips", false otherwise.
 
     public boolean isSipURI() {
         return true;
     }

    
Sets the value of the specified header fields to be included in a request constructed from the URI. If the header already had a value it will be overwritten.

Parameters:
name - a String specifying the header name
value - a String specifying the header value
 
     public void setHeader(String nameString value) {
         NameValue nv = new NameValue(namevalue);
         .set(nv);
 
     }

    
Set the host portion of the SipURI

Parameters:
host host to set.
 
     public void setHost(String hostthrows ParseException {
         Host h = new Host(host);
         this.setHost(h);
     }

    
Sets the value of the lr parameter of this SipURI. The lr parameter, when present, indicates that the element responsible for this resource implements the routing mechanisms specified in RFC 3261. This parameter will be used in the URIs proxies place in the Record-Route header field values, and may appear in the URIs in a pre-existing route set.
 
     public void setLrParam() {
         this..set("lr",null);   // JvB: fixed to not add duplicates
     }

    
Sets the value of the maddr parameter of this SipURI. The maddr parameter indicates the server address to be contacted for this user, overriding any address derived from the host field. This is equivalent to setParameter("maddr", maddr).

Parameters:
maddr New value of the maddr parameter
 
     public void setMAddrParam(String maddrthrows ParseException {
         if (maddr == null)
             throw new NullPointerException("bad maddr");
         setParameter("maddr"maddr);
     }

    
Sets the value of the method parameter. This specifies which SIP method to use in requests directed at this URI. This is equivalent to setParameter("method", method).

Parameters:
method - new value String value of the method parameter
 
     public void setMethodParam(String methodthrows ParseException {
         setParameter("method"method);
     }

    
Sets the value of the specified parameter. If the parameter already had a value it will be overwritten. A zero-length String indicates flag parameter.

Parameters:
name - a String specifying the parameter name
value - a String specifying the parameter value
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the parameter name or value.
 
     public void setParameter(String nameString valuethrows ParseException {
         if (name.equalsIgnoreCase("ttl")) {
             try {
                 Integer.parseInt(value);
             } catch (NumberFormatException ex) {
                 throw new ParseException("bad parameter " + value, 0);
             }
         }
         .set(name,value);
     }

    
Sets the scheme of this URI to sip or sips depending on whether the argument is true or false. The default value is false.

Parameters:
secure - the boolean value indicating if the SipURI is secure.
 
     public void setSecure(boolean secure) {
         if (secure)
             this. = ;
         else
             this. = ;
     }

    
Sets the value of the ttl parameter. The ttl parameter specifies the time-to-live value when packets are sent using UDP multicast. This is equivalent to setParameter("ttl", ttl).

Parameters:
ttl - new value of the ttl parameter
 
     public void setTTLParam(int ttl) {
         if (ttl <= 0)
             throw new IllegalArgumentException("Bad ttl value");
         if ( != null) {
             NameValue nv = new NameValue("ttl", Integer.valueOf(ttl));
             .set(nv);
         }
     }

    
Sets the value of the "transport" parameter. This parameter specifies which transport protocol to use for sending requests and responses to this entity. The following values are defined: "udp", "tcp", "sctp", "tls", but other values may be used also. This method is equivalent to setParameter("transport", transport). Transport parameter constants are defined in the javax.sip.ListeningPoint.

Parameters:
transport - new value for the "transport" parameter
See also:
javax.sip.ListeningPoint
 
     public void setTransportParam(String transportthrows ParseException {
         if (transport == null)
             throw new NullPointerException("null arg");
         if (transport.compareToIgnoreCase("UDP") == 0
             || transport.compareToIgnoreCase("TLS") == 0
             || transport.compareToIgnoreCase("TCP") == 0
            || transport.compareToIgnoreCase("SCTP") == 0) {
            NameValue nv = new NameValue(transport.toLowerCase());
            .set(nv);
        } else
            throw new ParseException("bad transport " + transport, 0);
    }

    
Returns the user part of this SipURI, or null if it is not set.

Returns:
the user part of this SipURI
    public String getUserParam() {
        return getParameter("user");
    }

    
Returns whether the the lr parameter is set. This is equivalent to hasParameter("lr"). This interface has no getLrParam as RFC3261 does not specify any values for the "lr" paramater.

Returns:
true if the "lr" parameter is set, false otherwise.
    public boolean hasLrParam() {
        return .getNameValue("lr") != null;
    }

  
    
Returns whether the gr parameter is set. Not part on the interface since gruu is not part of the base RFC3261.
    public boolean hasGrParam() {
        return .getNameValue() != null;
    }

    
Sets the gr parameter. Not part on the interface since gruu is not part of the base RFC3261.
    public void setGrParam(String value) {
            this..set(value); // JvB: fixed to not add duplicates
    }

    
Sets the gr parameter. Not part on the interface since gruu is not part of the base RFC3261.
    public String getGrParam() {
            return (Stringthis..getValue();   // JvB: fixed to not add duplicates
    }

    
remove the +sip-instance value from the parameter list if it exists.
New to GrepCode? Check out our FAQ X