reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
CallId.hxx
Go to the documentation of this file.
1#if !defined(RESIP_CALLID_HXX)
2#define RESIP_CALLID_HXX
3
4#include <iosfwd>
5#include "rutil/Data.hxx"
8
9namespace resip
10{
11
12
17class CallID : public ParserCategory
18{
19 public:
21
22 CallID();
23 CallID(const HeaderFieldValue& hfv,
24 Headers::Type type,
25 PoolBase* pool=0);
26 CallID(const CallID& orig,
27 PoolBase* pool=0);
28 CallID& operator=(const CallID&);
29 bool operator==(const CallID&) const;
30
31 Data& value();
32 const Data& value() const;
33
34 virtual void parse(ParseBuffer& pb);
35 virtual ParserCategory* clone() const;
36 virtual ParserCategory* clone(void* location) const;
37 virtual ParserCategory* clone(PoolBase* pool) const;
38 virtual EncodeStream& encodeParsed(EncodeStream& str) const;
39
40 // Inform the compiler that overloads of these may be found in
41 // ParserCategory, too.
45
47 ParseBuffer& pb,
48 const std::bitset<256>& terminators,
49 PoolBase* pool);
50 bool exists(const Param<CallID>& paramType) const;
51 void remove(const Param<CallID>& paramType);
52
53#define defineParam(_enum, _name, _type, _RFC_ref_ignored) \
54 const _enum##_Param::DType& param(const _enum##_Param& paramType) const; \
55 _enum##_Param::DType& param(const _enum##_Param& paramType); \
56 friend class _enum##_Param
57
58defineParam(fromTag, "from-tag", DataParameter, "RFC 3891 (not in IANA, apparently)");
59defineParam(toTag, "to-tag", DataParameter, "RFC 3891 (not in IANA, apparently)");
60defineParam(earlyOnly, "early-only", ExistsParameter, "RFC 3891 (not in IANA, apparently)");
61
62#undef defineParam
63
64 private:
65 Data mValue;
66
68};
70typedef CallID CallId; // code convention compatible
71
72}
73
74#endif
75
76/* ====================================================================
77 * The Vovida Software License, Version 1.0
78 *
79 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
80 *
81 * Redistribution and use in source and binary forms, with or without
82 * modification, are permitted provided that the following conditions
83 * are met:
84 *
85 * 1. Redistributions of source code must retain the above copyright
86 * notice, this list of conditions and the following disclaimer.
87 *
88 * 2. Redistributions in binary form must reproduce the above copyright
89 * notice, this list of conditions and the following disclaimer in
90 * the documentation and/or other materials provided with the
91 * distribution.
92 *
93 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
94 * and "Vovida Open Communication Application Library (VOCAL)" must
95 * not be used to endorse or promote products derived from this
96 * software without prior written permission. For written
97 * permission, please contact vocal@vovida.org.
98 *
99 * 4. Products derived from this software may not be called "VOCAL", nor
100 * may "VOCAL" appear in their name, without prior written
101 * permission of Vovida Networks, Inc.
102 *
103 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
104 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
105 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
106 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
107 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
108 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
109 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
110 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
111 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
112 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
113 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
114 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
115 * DAMAGE.
116 *
117 * ====================================================================
118 *
119 * This software consists of voluntary contributions made by Vovida
120 * Networks, Inc. and many individuals on behalf of Vovida Networks,
121 * Inc. For more information on Vovida Networks, Inc., please see
122 * <http://www.vovida.org/>.
123 *
124 */
Represents the "callid" element in the SIP grammar.
Definition CallId.hxx:18
void remove(const Param< CallID > &paramType)
Definition CallId.cxx:129
bool operator==(const CallID &) const
Definition CallId.cxx:51
bool exists(const Param< CallID > &paramType) const
Definition CallId.cxx:121
CallID & operator=(const CallID &)
Definition CallId.cxx:40
virtual void parse(ParseBuffer &pb)
Definition CallId.cxx:89
Data & value()
Definition CallId.cxx:75
virtual EncodeStream & encodeParsed(EncodeStream &str) const
Definition CallId.cxx:101
defineParam(toTag, "to-tag", DataParameter, "RFC 3891 (not in IANA, apparently)")
virtual ParserCategory * clone() const
Definition CallId.cxx:57
defineParam(fromTag, "from-tag", DataParameter, "RFC 3891 (not in IANA, apparently)")
defineParam(earlyOnly, "early-only", ExistsParameter, "RFC 3891 (not in IANA, apparently)")
static constexpr CommaHandlingMode commaHandling
Definition CallId.hxx:20
virtual Parameter * createParam(ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
Definition CallId.cxx:111
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,...
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,...
dcm! – add UnusedChecking(_enum) below;
ParserContainer< CallID > CallIDs
Definition CallId.hxx:69
CallID CallId
Definition CallId.hxx:70
#define EncodeStream