reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
NameAddr.hxx
Go to the documentation of this file.
1#if !defined(RESIP_NAME_ADDR_HXX)
2#define RESIP_NAME_ADDR_HXX
3
4#include <iosfwd>
5#include "rutil/Data.hxx"
8#include "resip/stack/Uri.hxx"
9
10namespace resip
11{
12
19{
20 public:
22
23 NameAddr();
24 NameAddr(const HeaderFieldValue& hfv,
25 Headers::Type type,
26 PoolBase* pool=0);
27 explicit NameAddr(const Uri& orig);
28 explicit NameAddr(const Data& unparsed, bool preCacheAor=false);
29
30 NameAddr(const NameAddr& orig,
31 PoolBase* pool=0);
33 bool operator==(const NameAddr& other) const;
34
35 virtual ~NameAddr();
36
37 Uri& uri();
38 const Uri& uri() const;
40 const Data& displayName() const;
41
42 bool isAllContacts() const;
43 void setAllContacts();
44
45 virtual void parse(ParseBuffer& pb);
46 virtual ParserCategory* clone() const;
47 virtual ParserCategory* clone(void* location) const;
48 virtual ParserCategory* clone(PoolBase* pool) const;
49 virtual EncodeStream& encodeParsed(EncodeStream& str) const;
50
51 bool operator<(const NameAddr& other) const;
52
53 // Inform the compiler that overloads of these may be found in
54 // ParserCategory, too.
58
59 virtual Parameter* createParam(ParameterTypes::Type type, ParseBuffer& pb, const std::bitset<256>& terminators, PoolBase* pool);
60 bool exists(const Param<NameAddr>& paramType) const;
61 void remove(const Param<NameAddr>& paramType);
62
63#define defineParam(_enum, _name, _type, _RFC_ref_ignored) \
64 const _enum##_Param::DType& param(const _enum##_Param& paramType) const; \
65 _enum##_Param::DType& param(const _enum##_Param& paramType); \
66 friend class _enum##_Param
67
68 defineParam(data, "data", ExistsParameter, "RFC 3840");
69 defineParam(control, "control", ExistsParameter, "RFC 3840");
70 defineParam(mobility, "mobility", QuotedDataParameter, "RFC 3840"); // mobile|fixed
71 defineParam(description, "description", QuotedDataParameter, "RFC 3840"); // <> quoted
72 defineParam(events, "events", QuotedDataParameter, "RFC 3840"); // list
73 defineParam(priority, "priority", QuotedDataParameter, "RFC 3840"); // non-urgent|normal|urgent|emergency
74 defineParam(methods, "methods", QuotedDataParameter, "RFC 3840"); // list
75 defineParam(schemes, "schemes", QuotedDataParameter, "RFC 3840"); // list
76 defineParam(application, "application", ExistsParameter, "RFC 3840");
77 defineParam(video, "video", ExistsParameter, "RFC 3840");
78 defineParam(language, "language", QuotedDataParameter, "RFC 3840"); // list
79 defineParam(type, "type", QuotedDataParameter, "RFC 3840"); // list
80 defineParam(isFocus, "isfocus", ExistsParameter, "RFC 3840");
81 defineParam(actor, "actor", QuotedDataParameter, "RFC 3840"); // principal|msg-taker|attendant|information
82 defineParam(text, "text", ExistsOrDataParameter, "RFC 3840");
83 defineParam(extensions, "extensions", QuotedDataParameter, "RFC 3840"); //list
84 defineParam(Instance, "+sip.instance", QuotedDataParameter, "RFC 5626"); // <> quoted
85 defineParam(regid, "reg-id", UInt32Parameter, "RFC 5626");
86 defineParam(pubGruu, "pub-gruu", QuotedDataParameter, "RFC 5627");
87 defineParam(tempGruu, "temp-gruu", QuotedDataParameter, "RFC 5627");
88 defineParam(expires, "expires", UInt32Parameter, "RFC 3261");
89 defineParam(q, "q", QValueParameter, "RFC 3261");
90 defineParam(tag, "tag", DataParameter, "RFC 3261");
91 defineParam(index, "index", DataParameter, "RFC 4244");
92 defineParam(rc, "rc", DataParameter, "RFC 4244-bis");
93 defineParam(mp, "mp", DataParameter, "RFC 4244-bis");
94 defineParam(np, "np", DataParameter, "RFC 4244-bis");
95 defineParam(reason, "reason", DataParameter, "RFC 5806");
96 defineParam(counter, "counter", UInt32Parameter, "RFC 5806");
97 defineParam(limit, "limit", UInt32Parameter, "RFC 5806");
98 defineParam(privacy, "privacy", DataParameter, "RFC 5806");
99 defineParam(screen, "screen", DataParameter, "RFC 5806");
100
101#undef defineParam
102
103 protected:
104 bool mustQuoteDisplayName() const;
106
111
112 private:
113
115};
117
118}
119
120#endif
121/* ====================================================================
122 * The Vovida Software License, Version 1.0
123 *
124 * Copyright (c) 2024-2026, SIP Spectrum, Inc. http://www.sipspectrum.com
125 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
126 *
127 * Redistribution and use in source and binary forms, with or without
128 * modification, are permitted provided that the following conditions
129 * are met:
130 *
131 * 1. Redistributions of source code must retain the above copyright
132 * notice, this list of conditions and the following disclaimer.
133 *
134 * 2. Redistributions in binary form must reproduce the above copyright
135 * notice, this list of conditions and the following disclaimer in
136 * the documentation and/or other materials provided with the
137 * distribution.
138 *
139 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
140 * and "Vovida Open Communication Application Library (VOCAL)" must
141 * not be used to endorse or promote products derived from this
142 * software without prior written permission. For written
143 * permission, please contact vocal@vovida.org.
144 *
145 * 4. Products derived from this software may not be called "VOCAL", nor
146 * may "VOCAL" appear in their name, without prior written
147 * permission of Vovida Networks, Inc.
148 *
149 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
150 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
151 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
152 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
153 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
154 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
155 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
156 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
157 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
158 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
159 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
160 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
161 * DAMAGE.
162 *
163 * ====================================================================
164 *
165 * This software consists of voluntary contributions made by Vovida
166 * Networks, Inc. and many individuals on behalf of Vovida Networks,
167 * Inc. For more information on Vovida Networks, Inc., please see
168 * <http://www.vovida.org/>.
169 *
170 */
Generically represents miscellaneous parameter data.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents various parameters that are indicated to be in effect merely by being present,...
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
defineParam(extensions, "extensions", QuotedDataParameter, "RFC 3840")
bool operator<(const NameAddr &other) const
Definition NameAddr.cxx:106
defineParam(pubGruu, "pub-gruu", QuotedDataParameter, "RFC 5627")
defineParam(text, "text", ExistsOrDataParameter, "RFC 3840")
NameAddr & operator=(const NameAddr &)
Definition NameAddr.cxx:83
defineParam(mobility, "mobility", QuotedDataParameter, "RFC 3840")
defineParam(limit, "limit", UInt32Parameter, "RFC 5806")
defineParam(reason, "reason", DataParameter, "RFC 5806")
defineParam(data, "data", ExistsParameter, "RFC 3840")
bool operator==(const NameAddr &other) const
Definition NameAddr.cxx:98
bool mustQuoteDisplayName() const
Definition NameAddr.cxx:341
static constexpr CommaHandlingMode commaHandling
Definition NameAddr.hxx:21
defineParam(language, "language", QuotedDataParameter, "RFC 3840")
defineParam(schemes, "schemes", QuotedDataParameter, "RFC 3840")
void remove(const Param< NameAddr > &paramType)
Definition NameAddr.cxx:485
defineParam(regid, "reg-id", UInt32Parameter, "RFC 5626")
virtual ParserCategory * clone() const
Definition NameAddr.cxx:112
defineParam(priority, "priority", QuotedDataParameter, "RFC 3840")
defineParam(tempGruu, "temp-gruu", QuotedDataParameter, "RFC 5627")
void setAllContacts()
Definition NameAddr.cxx:165
Data & displayName()
Definition NameAddr.cxx:144
virtual ~NameAddr()
Definition NameAddr.cxx:74
defineParam(np, "np", DataParameter, "RFC 4244-bis")
defineParam(video, "video", ExistsParameter, "RFC 3840")
virtual EncodeStream & encodeParsed(EncodeStream &str) const
Definition NameAddr.cxx:291
defineParam(methods, "methods", QuotedDataParameter, "RFC 3840")
defineParam(events, "events", QuotedDataParameter, "RFC 3840")
defineParam(tag, "tag", DataParameter, "RFC 3261")
defineParam(q, "q", QValueParameter, "RFC 3261")
defineParam(actor, "actor", QuotedDataParameter, "RFC 3840")
void adjustDisplayNameIfNeeded()
Definition NameAddr.cxx:439
defineParam(Instance, "+sip.instance", QuotedDataParameter, "RFC 5626")
defineParam(expires, "expires", UInt32Parameter, "RFC 3261")
defineParam(type, "type", QuotedDataParameter, "RFC 3840")
virtual void parse(ParseBuffer &pb)
Definition NameAddr.cxx:171
defineParam(control, "control", ExistsParameter, "RFC 3840")
bool isAllContacts() const
Definition NameAddr.cxx:158
defineParam(counter, "counter", UInt32Parameter, "RFC 5806")
defineParam(index, "index", DataParameter, "RFC 4244")
Data * mUnknownUriParametersBuffer
Definition NameAddr.hxx:110
defineParam(application, "application", ExistsParameter, "RFC 3840")
defineParam(isFocus, "isfocus", ExistsParameter, "RFC 3840")
defineParam(privacy, "privacy", DataParameter, "RFC 5806")
defineParam(description, "description", QuotedDataParameter, "RFC 3840")
defineParam(rc, "rc", DataParameter, "RFC 4244-bis")
defineParam(screen, "screen", DataParameter, "RFC 5806")
bool exists(const Param< NameAddr > &paramType) const
Definition NameAddr.cxx:477
virtual Parameter * createParam(ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
Definition NameAddr.cxx:467
defineParam(mp, "mp", DataParameter, "RFC 4244-bis")
Parameter *(* Factory)(ParameterTypes::Type, ParseBuffer &, const std::bitset< 256 > &terminators, PoolBase *pool)
Provides string-parsing functionality with protection from buffer overflow.
Base class for all SIP grammar elements that can have parameters.
void remove(const ParamBase &paramType)
Removes a natively supported parameter, if the parameter is present.
bool exists(const ParamBase &paramType) const
Checks for the existence of a natively supported parameter.
const Data & param(const ExtensionParameter &param) const
Const accessor for non-natively-supported parameter types.
Container class for ParserCategory, used by SipMessage to represent multi-valued headers (Contact,...
Represents the "q" parameter value of the RFC 3261 grammar.
Generically represents miscellaneous parameter data that is encoded using double quotes.
Generically represents unsigned 32-bit integer values conveyed by SIP parameters.
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
dcm! – add UnusedChecking(_enum) below;
ParserContainer< NameAddr > NameAddrs
Definition Headers.hxx:181
#define EncodeStream