public interface FromHeader extends AddressParametersHeader
The From header field indicates the logical identity of the initiator of the request, possibly the user's address-of-record. Like the To header field, it contains a URI and optionally a display name. 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:[email protected]), 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 (see Section 22 for more on authentication).
The From field MUST contain a new "tag" parameter, chosen by the UAC. See Section 19.3 for details on choosing a tag.
For further information on the From header field, see Section 20.20. Examples:
From: "Bob" <sips:[email protected]>tag=a48s From: sip:[email protected];tag=887s From: Anonymous <sip:[email protected]>;tag=hyh8
Modifier and Type | Interface and Description |
---|---|
static class |
FromHeader.Builder |
Modifier and Type | Field and Description |
---|---|
static Buffer |
COMPACT_NAME |
static Buffer |
NAME |
CANNOT_CAST_HEADER_OF_TYPE, UNABLE_TO_PARSE_OUT_THE_HEADER_NAME_DUE_TO_UNDERLYING_IO_EXCEPTION
Modifier and Type | Method and Description |
---|---|
static AddressParametersHeader.Builder<FromHeader> |
builder() |
FromHeader |
clone() |
AddressParametersHeader.Builder<FromHeader> |
copy()
Everything within the pkts.io SIP module are immutable so if you actually want
to change anything you have to create a copy, which will return a specific Builder
for that header.
|
static FromHeader |
frame(Buffer buffer)
Frame the value as a
FromHeader . |
static FromHeader |
frame(String buffer)
Frame the value as a
FromHeader . |
static Buffer |
generateTag()
Generate a new tag that can be used as a tag parameter for the
FromHeader . |
Buffer |
getTag()
Get the tag parameter.
|
default boolean |
isFromHeader() |
default FromHeader |
toFromHeader() |
static AddressParametersHeader.Builder<FromHeader> |
withAddress(Address address) |
static AddressParametersHeader.Builder<FromHeader> |
withHost(Buffer host) |
static AddressParametersHeader.Builder<FromHeader> |
withHost(String host) |
isAddressParametersHeader, toAddressParametersHeader, with
getAddress
getParameter, getParameter, setParameter, setParameter
create, ensure, getBufferSize, getBytes, getName, getNameStr, getValue, is, is, isCallIdHeader, isContactHeader, isContentLengthHeader, isContentTypeHeader, isCSeqHeader, isExpiresHeader, isMaxForwardsHeader, isRecordRouteHeader, isRouteHeader, isSubjectHeader, isSystemHeader, isToHeader, isViaHeader, toCallIdHeader, toContactHeader, toContentLengthHeader, toContentTypeHeader, toCSeqHeader, toExpiresHeader, toMaxForwardsHeader, toRecordRouteHeader, toRouteHeader, toToHeader, toViaHeader, verify
Buffer getTag() throws SipParseException
SipParseException
- in case anything goes wrong while extracting tag.FromHeader clone()
default boolean isFromHeader()
isFromHeader
in interface SipHeader
default FromHeader toFromHeader()
toFromHeader
in interface SipHeader
static FromHeader frame(Buffer buffer) throws SipParseException
FromHeader
.frame
in interface AddressParametersHeader
frame
in interface SipHeader
buffer
- SipParseException
- in case anything goes wrong while parsing.static FromHeader frame(String buffer) throws SipParseException
FromHeader
.frame
in interface SipHeader
buffer
- SipParseException
- in case anything goes wrong while parsing.static Buffer generateTag()
FromHeader
. A
tag-parameter only has to be unique within the same Call-ID space so therefore it doesn't
have to be cryptographically strong etc.static AddressParametersHeader.Builder<FromHeader> builder()
static AddressParametersHeader.Builder<FromHeader> withHost(Buffer host) throws SipParseException
SipParseException
static AddressParametersHeader.Builder<FromHeader> withHost(String host) throws SipParseException
SipParseException
static AddressParametersHeader.Builder<FromHeader> withAddress(Address address) throws SipParseException
SipParseException
AddressParametersHeader.Builder<FromHeader> copy()
SipHeader
copy
in interface AddressParametersHeader
copy
in interface SipHeader
Copyright © 2020. All Rights Reserved.