|
reSIProcate
SIP stack, Dialog Usage Manager and related libraries
|
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar. More...
#include <Uri.hxx>
Public Types | |
| typedef std::bitset< Uri::uriEncodingTableSize > | EncodingTable |
Public Types inherited from resip::ParserCategory | |
| enum | { UnknownParserCategory = -1 } |
| enum | CommaHandlingMode { NoCommaTokenizing = 0 , CommasAllowedOutputMulti = 1 , CommasAllowedOutputCommas = 3 } |
| typedef std::set< ParameterTypes::Type > | ParameterTypeSet |
Public Member Functions | |
| RESIP_HeapCount (Uri) | |
| Uri (PoolBase *pool=0) | |
| Uri (const HeaderFieldValue &hfv, Headers::Type type, PoolBase *pool=0) | |
| Uri (const Uri &orig, PoolBase *pool=0) | |
| Uri (const Data &data) | |
| ~Uri () | |
| Data & | host () |
| const Data & | host () const |
| Data & | user () |
| const Data & | user () const |
| Data & | userParameters () |
| const Data & | userParameters () const |
| Data & | opaque () |
| const Data & | opaque () const |
| Data & | path () |
| const Data & | path () const |
| Data | getAor () const |
| Data | getAorNoPort () const |
| Data | getAorNoReally () const |
| Data | getAOR (bool addPort) const |
| Uri | getAorAsUri (TransportType transportTypeToRemoveDefaultPort=UNKNOWN_TRANSPORT) const |
| bool | userIsTelephoneSubscriber () const |
| Returns true if the user appears to fit the BNF for the 'telephone-subscriber' element in the RFC 3261 (and by extension, RFC 3966) grammar. | |
| Token | getUserAsTelephoneSubscriber () const |
| Returns the user-part as a 'telephone-subscriber' grammar element (in other words, this parses the user-part into a dial string and parameters, with the dial-string accessible with Token::value(), and the parameters accessible with the various Token::param() and Token::exists() interfaces). | |
| void | setUserAsTelephoneSubscriber (const Token &telephoneSubscriber) |
| Sets the user-part of this URI using the dial-string and parameters stored in telephoneSubscriber. | |
| Data & | scheme () |
| const Data & | scheme () const |
| int & | port () |
| int | port () const |
| Data & | password () |
| const Data & | password () const |
| Data & | netNs () |
| const Data & | netNs () const |
| Data | toString () const |
| bool | isEnumSearchable () const |
| Returns true if the uri can be converted into a string that can be used as an enum lookup. | |
| std::vector< Data > | getEnumLookups (const std::vector< Data > &suffixes) const |
| Return a vector of domains to do a NAPTR lookup for enum. | |
| bool | hasEmbedded () const |
| SipMessage & | embedded () |
| const SipMessage & | embedded () const |
| void | removeEmbedded () |
| virtual void | parse (ParseBuffer &pb) |
| virtual ParserCategory * | clone () const |
| virtual ParserCategory * | clone (void *location) const |
| virtual ParserCategory * | clone (PoolBase *pool) const |
| virtual EncodeStream & | encodeParsed (EncodeStream &str) const |
| void | parseEmbeddedHeaders (ParseBuffer &pb) |
| EncodeStream & | encodeEmbeddedHeaders (EncodeStream &str) const |
| Uri & | operator= (const Uri &rhs) |
| bool | operator== (const Uri &other) const |
| bool | operator!= (const Uri &other) const |
| bool | operator< (const Uri &other) const |
| bool | aorEqual (const Uri &rhs) const |
| void | setIsBetweenAngleQuotes (bool value) |
| void | setIsBareAddrSpec (bool value) |
| Tells the parser this URI is being parsed as a bare (unbracketed) addr-spec inside a header value (e.g. | |
| bool | isUserRelevant () const |
| Checks if this URI's scheme has sip:/sips:/tel: user-part semantics, i.e. | |
| virtual Parameter * | createParam (ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool) |
| bool | exists (const Param< Uri > ¶mType) const |
| void | remove (const Param< Uri > ¶mType) |
| defineParam (ob,"ob", ExistsParameter,"RFC 5626") | |
| defineParam (gr, "gr", ExistsOrDataParameter, "RFC 5627") | |
| defineParam (comp, "comp", DataParameter, "RFC 3486") | |
| defineParam (duration, "duration", UInt32Parameter, "RFC 4240") | |
| defineParam (lr, "lr", ExistsParameter, "RFC 3261") | |
| defineParam (maddr, "maddr", DataParameter, "RFC 3261") | |
| defineParam (method, "method", DataParameter, "RFC 3261") | |
| defineParam (transport, "transport", DataParameter, "RFC 3261") | |
| defineParam (ttl, "ttl", UInt32Parameter, "RFC 3261") | |
| defineParam (user, "user", DataParameter, "RFC 3261, 4967") | |
| defineParam (extension, "ext", DataParameter, "RFC 3966") | |
| defineParam (sigcompId, "sigcomp-id", QuotedDataParameter, "RFC 5049") | |
| defineParam (rinstance, "rinstance", DataParameter, "proprietary (resip)") | |
| defineParam (addTransport, "addTransport", ExistsParameter, "RESIP INTERNAL") | |
| defineParam (wsSrcIp, "ws-src-ip", DataParameter, "RESIP INTERNAL (WebSocket)") | |
| defineParam (wsSrcPort, "ws-src-port", UInt32Parameter, "RESIP INTERNAL (WebSocket)") | |
| bool | exists (const ParamBase ¶mType) const |
| Checks for the existence of a natively supported parameter. | |
| bool | exists (const ExtensionParameter ¶m) const |
| Checks for the existence of a non-natively-supported parameter. | |
| void | remove (const ParamBase ¶mType) |
| Removes a natively supported parameter, if the parameter is present. | |
| void | remove (const ExtensionParameter ¶m) |
| Removes a non-natively-supported parameter, if the parameter is present. | |
| const Data & | param (const ExtensionParameter ¶m) const |
| Const accessor for non-natively-supported parameter types. | |
| Data & | param (const ExtensionParameter ¶m) |
| Accessor for non-natively-supported parameter types. | |
Public Member Functions inherited from resip::ParserCategory | |
| ParserCategory (const HeaderFieldValue &headerFieldValue, Headers::Type type, PoolBase *pool=0) | |
| ParserCategory (const char *buf, int length, Headers::Type type, PoolBase *pool=0) | |
| ParserCategory (const ParserCategory &rhs, PoolBase *pool=0) | |
| ParserCategory & | operator= (const ParserCategory &rhs) |
| virtual | ~ParserCategory () |
| bool | exists (const ParamBase ¶mType) const |
| Checks for the existence of a natively supported parameter. | |
| void | remove (const ParamBase ¶mType) |
| Removes a natively supported parameter, if the parameter is present. | |
| const Data & | param (const ExtensionParameter ¶m) const |
| Const accessor for non-natively-supported parameter types. | |
| Data & | param (const ExtensionParameter ¶m) |
| Accessor for non-natively-supported parameter types. | |
| void | remove (const ExtensionParameter ¶m) |
| Removes a non-natively-supported parameter, if the parameter is present. | |
| bool | exists (const ExtensionParameter ¶m) const |
| Checks for the existence of a non-natively-supported parameter. | |
| void | removeParametersExcept (const ParameterTypeSet &set=EmptyParameterTypeSet) |
| Removes all known parameters except those that are specified in set. | |
| void | clearUnknownParameters () |
| void | parseParameters (ParseBuffer &pb) |
| EncodeStream & | encodeParameters (EncodeStream &str) const |
| Encodes parameters as they should appear on the wire. | |
| Data | commutativeParameterHash () const |
| Parameter * | getParameterByEnum (ParameterTypes::Type type) const |
| void | removeParameterByEnum (ParameterTypes::Type type) |
| void | setParameter (const Parameter *parameter) |
| int | numKnownParams () const |
| Returns the number of known (natively supported) parameters. | |
| int | numUnknownParams () const |
| Returns the number of unknown parameters. | |
Public Member Functions inherited from resip::LazyParser | |
| LazyParser (const HeaderFieldValue &headerFieldValue) | |
| LazyParser (const char *buf, int length) | |
| LazyParser (const HeaderFieldValue &headerFieldValue, HeaderFieldValue::CopyPaddingEnum e) | |
| LazyParser (const LazyParser &rhs) | |
| LazyParser (const LazyParser &rhs, HeaderFieldValue::CopyPaddingEnum e) | |
| LazyParser & | operator= (const LazyParser &rhs) |
| virtual | ~LazyParser () |
| EncodeStream & | encode (EncodeStream &str) const |
| Encodes this element to a stream, in the fashion it should be represented on the wire. | |
| bool | isParsed () const |
| Returns true iff a parse has been attempted. | |
| HeaderFieldValue & | getHeaderField () |
| void | checkParsed () const |
| void | checkParsed () |
| void | doParse () const |
| void | markDirty () const |
| bool | isWellFormed () const |
| Returns true iff this element was parsed successfully, according to the implementation of parse(). | |
Static Public Member Functions | |
| static Uri | fromTel (const Uri &, const Uri &hostUri) |
| static void | setUriUserEncoding (unsigned char c, bool encode) |
| Modifies the default URI encoding character sets. | |
| static void | setUriPasswordEncoding (unsigned char c, bool encode) |
| static void | setUriUrnEncoding (unsigned char c, bool encode) |
| static bool | compareUriParametersEqual (Parameter *param1, Parameter *param2) |
| Compares two known URI parameters for equality. | |
| static bool | compareUriParametersLessThan (Parameter *param1, Parameter *param2) |
| Compares two URI parameters to determine if the first is less than the second. | |
| static bool | isSignificantUriParameter (const ParameterTypes::Type type) noexcept |
| Checks if the URI-parameter appearing in only one URI must not be ignored when comparing the URIs. | |
| static EncodingTable & | getUserEncodingTable () |
| static EncodingTable & | getPasswordEncodingTable () |
| static EncodingTable & | getUrnEncodingTable () |
| Encoding table for the NID:NSS (plus optional rq-components/fragment) of a urn: URI (RFC 8141: namestring = "urn" ":" NID ":" NSS). | |
| static EncodingTable & | getLocalNumberTable () |
| static EncodingTable & | getGlobalNumberTable () |
Static Public Attributes | |
| static const size_t | uriEncodingTableSize = 256 |
Static Public Attributes inherited from resip::ParserCategory | |
| static const ParameterTypeSet | EmptyParameterTypeSet |
Protected Member Functions | |
| void | getAorInternal (bool dropScheme, bool addPort, Data &aor) const |
Protected Member Functions inherited from resip::ParserCategory | |
| ParserCategory (PoolBase *pool=0) | |
| bool | addParameter (Parameter *param) |
| bool | addParameter (UnknownParameter *unknownParam) |
| Parameter * | getParameterByData (const Data &data) const |
| void | removeParameterByData (const Data &data) |
| PoolBase * | getPool () |
| void | freeParameter (Parameter *p) |
| virtual const Data & | errorContext () const |
Protected Member Functions inherited from resip::LazyParser | |
| LazyParser () | |
| void | clear () |
Protected Attributes | |
| Data | mScheme |
| Data | mHost |
| Data | mUser |
| Data | mUserParameters |
| int | mPort |
| Data | mPassword |
| Data | mNetNs |
| Net namespace name scoping host and port. | |
| Data | mPath |
| bool | mHostCanonicalized |
| Data | mCanonicalHost |
| cache for IPv6 host comparison | |
| bool | mIsBetweenAngleQuotes |
| bool | mIsBareAddrSpec |
Protected Attributes inherited from resip::ParserCategory | |
| ParameterList | mParameters |
| ParameterList | mUnknownParameters |
| PoolBase * | mPool |
| Headers::Type | mHeaderType |
Additional Inherited Members | |
Protected Types inherited from resip::ParserCategory | |
| typedef std::vector< Parameter *, StlPoolAllocator< Parameter *, PoolBase > > | ParameterList |
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Also can be made to represent other URI types (like tel URIs)
| typedef std::bitset<Uri::uriEncodingTableSize> resip::Uri::EncodingTable |
| Uri::Uri | ( | const HeaderFieldValue & | hfv, |
| Headers::Type | type, | ||
| PoolBase * | pool = 0 |
||
| ) |
|
virtual |
Implements resip::ParserCategory.
|
virtual |
Implements resip::ParserCategory.
|
virtual |
Implements resip::ParserCategory.
|
virtual |
Reimplemented from resip::ParserCategory.
| resip::Uri::defineParam | ( | addTransport | , |
| "addTransport" | , | ||
| ExistsParameter | , | ||
| "RESIP INTERNAL" | |||
| ) |
| resip::Uri::defineParam | ( | comp | , |
| "comp" | , | ||
| DataParameter | , | ||
| "RFC 3486" | |||
| ) |
| resip::Uri::defineParam | ( | duration | , |
| "duration" | , | ||
| UInt32Parameter | , | ||
| "RFC 4240" | |||
| ) |
| resip::Uri::defineParam | ( | extension | , |
| "ext" | , | ||
| DataParameter | , | ||
| "RFC 3966" | |||
| ) |
| resip::Uri::defineParam | ( | gr | , |
| "gr" | , | ||
| ExistsOrDataParameter | , | ||
| "RFC 5627" | |||
| ) |
| resip::Uri::defineParam | ( | lr | , |
| "lr" | , | ||
| ExistsParameter | , | ||
| "RFC 3261" | |||
| ) |
| resip::Uri::defineParam | ( | maddr | , |
| "maddr" | , | ||
| DataParameter | , | ||
| "RFC 3261" | |||
| ) |
| resip::Uri::defineParam | ( | method | , |
| "method" | , | ||
| DataParameter | , | ||
| "RFC 3261" | |||
| ) |
| resip::Uri::defineParam | ( | ob | , |
| "ob" | , | ||
| ExistsParameter | , | ||
| "RFC 5626" | |||
| ) |
| resip::Uri::defineParam | ( | rinstance | , |
| "rinstance" | , | ||
| DataParameter | , | ||
| "proprietary (resip)" | |||
| ) |
| resip::Uri::defineParam | ( | sigcompId | , |
| "sigcomp-id" | , | ||
| QuotedDataParameter | , | ||
| "RFC 5049" | |||
| ) |
| resip::Uri::defineParam | ( | transport | , |
| "transport" | , | ||
| DataParameter | , | ||
| "RFC 3261" | |||
| ) |
| resip::Uri::defineParam | ( | ttl | , |
| "ttl" | , | ||
| UInt32Parameter | , | ||
| "RFC 3261" | |||
| ) |
| resip::Uri::defineParam | ( | user | , |
| "user" | , | ||
| DataParameter | , | ||
| "RFC | 3261, | ||
| 4967" | |||
| ) |
| resip::Uri::defineParam | ( | wsSrcIp | , |
| "ws-src-ip" | , | ||
| DataParameter | , | ||
| "RESIP INTERNAL (WebSocket)" | |||
| ) |
| resip::Uri::defineParam | ( | wsSrcPort | , |
| "ws-src-port" | , | ||
| UInt32Parameter | , | ||
| "RESIP INTERNAL (WebSocket)" | |||
| ) |
| SipMessage & Uri::embedded | ( | ) |
| const SipMessage & Uri::embedded | ( | ) | const |
| EncodeStream & Uri::encodeEmbeddedHeaders | ( | EncodeStream & | str | ) | const |
|
virtual |
Implements resip::LazyParser.
| bool ParserCategory::exists | ( | const ExtensionParameter & | param | ) | const |
Checks for the existence of a non-natively-supported parameter.
| param | The runtime constructed accessor token. |
Definition at line 187 of file ParserCategory.cxx.
|
inline |
Checks for the existence of a natively supported parameter.
| paramType | The accessor token for the parameter. |
Definition at line 145 of file ParserCategory.hxx.
| Uri Uri::getAorAsUri | ( | TransportType | transportTypeToRemoveDefaultPort = UNKNOWN_TRANSPORT | ) | const |
|
protected |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Encoding table for the NID:NSS (plus optional rq-components/fragment) of a urn: URI (RFC 8141: namestring = "urn" ":" NID ":" NSS).
| Token Uri::getUserAsTelephoneSubscriber | ( | ) | const |
Returns the user-part as a 'telephone-subscriber' grammar element (in other words, this parses the user-part into a dial string and parameters, with the dial-string accessible with Token::value(), and the parameters accessible with the various Token::param() and Token::exists() interfaces).
For example, suppose the following is in the Request-URI:
sip:5555551234;phone-context=+86@example.com;user=dialstring
The user-part of this SIP URI is "5555551234;phone-context=+86", and it fits the BNF for the 'telephone-subscriber' grammar element. To access the 'phone-context' parameter, do something like the following:
|
inlinestatic |
| bool Uri::isEnumSearchable | ( | ) | const |
|
staticnoexcept |
| bool Uri::isUserRelevant | ( | ) | const |
Checks if this URI's scheme has sip:/sips:/tel: user-part semantics, i.e.
whether its user() can be safely copied into another URI (e.g. a Contact, which is always sip:/sips:) that assumes that syntax.
true for sip:, sips: and tel:; false for any other scheme (e.g. urn:, whose user-part ABNF is incompatible). | Data & ParserCategory::param | ( | const ExtensionParameter & | param | ) |
Accessor for non-natively-supported parameter types.
Will create the parameter if it does not exist.
| param | The runtime constructed parameter accessor. |
Definition at line 173 of file ParserCategory.cxx.
| const Data & ParserCategory::param | ( | const ExtensionParameter & | param | ) | const |
Const accessor for non-natively-supported parameter types.
| ParserCategory::Exception | if this parameter doesn't exist. |
| param | The runtime constructed parameter accessor. |
Definition at line 165 of file ParserCategory.cxx.
|
virtual |
Implements resip::LazyParser.
| void Uri::parseEmbeddedHeaders | ( | ParseBuffer & | pb | ) |
| void ParserCategory::remove | ( | const ExtensionParameter & | param | ) |
Removes a non-natively-supported parameter, if the parameter is present.
| param | The accessor token for the parameter. |
Definition at line 180 of file ParserCategory.cxx.
| void ParserCategory::remove | ( | const ParamBase & | paramType | ) |
Removes a natively supported parameter, if the parameter is present.
| paramType | The accessor token for the parameter. |
Definition at line 156 of file ParserCategory.cxx.
| resip::Uri::RESIP_HeapCount | ( | Uri | ) |
|
inline |
Tells the parser this URI is being parsed as a bare (unbracketed) addr-spec inside a header value (e.g.
a To/From without "<...>"), where NameAddr-style header parameters (";tag=...", etc.) may follow directly with no separator of their own. Needed so schemes like urn: (whose NSS may legitimately contain ';'/'?'/',', RFC 8141) know to stop at those characters here – unlike every other context (Request-URI, a standalone Uri built directly from a string, or between angle brackets), where the same characters are legal NSS content and nothing ambiguous can follow. Set by NameAddr::parse() only; false everywhere else by default.
|
inline |
|
static |
|
static |
|
static |
| void Uri::setUserAsTelephoneSubscriber | ( | const Token & | telephoneSubscriber | ) |
| bool Uri::userIsTelephoneSubscriber | ( | ) | const |
Returns true if the user appears to fit the BNF for the 'telephone-subscriber' element in the RFC 3261 (and by extension, RFC 3966) grammar.
This is important because 'telephone-subscriber' can have parameters, which you could then access easily through the getUserAsTelephoneSubscriber() and setUserAsTelephoneSubscriber() calls.
|
mutableprotected |
|
protected |