JSIP API v1.2
November 2006

javax.sip.header
Interface FromHeader

All Superinterfaces:
java.lang.Cloneable, Header, HeaderAddress, Parameters, java.io.Serializable

public interface FromHeader
extends HeaderAddress, Parameters, Header

The From header field indicates the logical identity of the initiator of the request, possibly the user's address-of-record. This may be different from the initiator of the dialog. Requests sent by the callee to the caller use the callee's address in the From header field.

Like the To header field, it contains a URI and optionally a display name, encapsulated in a Address. It is used by SIP elements to determine which processing rules to apply to a request (for example, automatic call rejection). As such, it is very important that the From URI not contain IP addresses or the FQDN of the host on which the UA is running, since these are not logical names.

The From header field allows for a display name. A UAC SHOULD use the display name "Anonymous", along with a syntactically correct, but otherwise meaningless URI (like sip:thisis@anonymous.invalid), if the identity of the client is to remain hidden.

Usually, the value that populates the From header field in requests generated by a particular UA is pre-provisioned by the user or by the administrators of the user's local domain. If a particular UA is used by multiple users, it might have switchable profiles that include a URI corresponding to the identity of the profiled user. Recipients of requests can authenticate the originator of a request in order to ascertain that they are who their From header field claims they are.

Two From header fields are equivalent if their URIs match, and their parameters match. Extension parameters in one header field, not present in the other are ignored for the purposes of comparison. This means that the display name and presence or absence of angle brackets do not affect matching.

For Example:
From: "Bob" sips:bob@biloxi.com ;tag=a48s
From: sip:+12125551212@phone2net.com;tag=887s
From: Anonymous sip:c8oqz84zk7z@privacy.org;tag=hyh8

Author:
BEA Systems, NIST

Field Summary
static java.lang.String NAME
          Name of FromHeader
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this FromHeader for equality with another.
 java.lang.String getTag()
          Gets the tag of FromHeader.
 void setTag(java.lang.String tag)
          Sets the tag parameter of the FromHeader.
 
Methods inherited from interface javax.sip.header.HeaderAddress
getAddress, setAddress
 
Methods inherited from interface javax.sip.header.Parameters
getParameter, getParameterNames, removeParameter, setParameter
 
Methods inherited from interface javax.sip.header.Header
clone, getName, hashCode, toString
 

Field Detail

NAME

static final java.lang.String NAME
Name of FromHeader

See Also:
Constant Field Values
Method Detail

setTag

void setTag(java.lang.String tag)
            throws java.text.ParseException
Sets the tag parameter of the FromHeader. The tag in the From field of a request identifies the peer of the dialog. When a UA sends a request outside of a dialog, it contains a From tag only, providing "half" of the dialog Identifier.

The From Header MUST contain a new "tag" parameter, chosen by the UAC applicaton. Once the initial From "tag" is assigned it should not be manipulated by the application. That is on the client side for outbound requests the application is responsible for Tag assigmennment, after dialog establishment the stack will take care of Tag assignment.

Parameters:
tag - - the new tag of the FromHeader
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the Tag value.

getTag

java.lang.String getTag()
Gets the tag of FromHeader. The Tag parameter identified the Peer of the dialogue and must always be present.

Returns:
the tag parameter of the FromHeader.

equals

boolean equals(java.lang.Object obj)
Compare this FromHeader for equality with another. This method overrides the equals method in javax.sip.Header. This method specifies object equality as outlined by RFC3261. Two From header fields are equivalent if their URIs match, and their parameters match. Extension parameters in one header field, not present in the other are ignored for the purposes of comparison. This means that the display name and presence or absence of angle brackets do not affect matching. When comparing header fields, field names are always case-insensitive. Unless otherwise stated in the definition of a particular header field, field values, parameter names, and parameter values are case-insensitive. Tokens are always case-insensitive. Unless specified otherwise, values expressed as quoted strings are case-sensitive.

Specified by:
equals in interface Header
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this FromHeader with.
Returns:
true if obj is an instance of this class representing the same FromHeader as this, false otherwise.
Since:
v1.2

JSIP API v1.2
November 2006

If you have any comments, please mail them to JAIN-SIP-INTEREST@java.sun.com after subscribing at http://archives.java.sun.com
Copyright - 2006 BEA Systems and Sun Microsystems