/usr/include/resip/stack/MessageWaitingContents.hxx is in libresiprocate-1.9-dev 1.9.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | #if !defined(RESIP_MESSAGEWAITINGCONTENTS_HXX)
#define RESIP_MESSAGEWAITINGCONTENTS_HXX
#include <map>
#include "resip/stack/Contents.hxx"
#include "rutil/Data.hxx"
namespace resip
{
const char* skipSipLWS(ParseBuffer& pb);
/** @brief An enumeration of MessageWaiting header types for use with resip::MessageWaitingContents.
Also see resip::mw_account to access the special Message-Account header for MessageWaiting.
**/
typedef enum {mw_voice=0, mw_fax, mw_pager, mw_multimedia, mw_text, mw_none, MW_MAX} HeaderType;
/**
@ingroup sip_payload
@brief SIP body type for holding MWI contents (MIME content-type application/simple-message-summary).
See resip/stack/test/testMessageWaiting.cxx for usage examples.
*/
class MessageWaitingContents : public Contents
{
public:
MessageWaitingContents();
MessageWaitingContents(const HeaderFieldValue& hfv, const Mime& contentType);
MessageWaitingContents(const Data& data, const Mime& contentType);
MessageWaitingContents(const MessageWaitingContents& rhs);
virtual ~MessageWaitingContents();
MessageWaitingContents& operator=(const MessageWaitingContents& rhs);
/** @brief duplicate an MessageWaitingContents object
@return pointer to a new MessageWaitingContents object
**/
virtual Contents* clone() const;
static const Mime& getStaticType() ;
virtual EncodeStream& encodeParsed(EncodeStream& str) const;
virtual void parse(ParseBuffer& pb);
class Header;
/** @brief Get the header correspoding to ht
@param ht HeaderType used to lookup MessageWaiting header
@return Header corresponding to ht
**/
Header& header(HeaderType ht);
const Header& header(HeaderType ht) const;
/** @brief Check if HeaderType is present
@param ht HeaderType used to lookup MessageWaiting header
@return bool true if HeaderType exists
**/
bool exists(HeaderType ht) const;
/** @brief Remove the header correspoding to ht
@param ht HeaderType used to remove from MessageWaiting header
**/
void remove(HeaderType ht);
/** @brief makes accessing the MessageAccount Uri
operate like accessing the other MessageWaiting headers.
However, the user of these calls has to treat them differently
since the two header calls return different classes.
@todo This is an awkward attempt to make accessing the MessageAccount Uri
operate like accessing the other MessageWaiting headers even though
the user of these calls has to treat them differently to being with
since the two header calls return different classes. ugh. .mjf.
**/
class AccountHeader {};
/** @brief Get the Uri for Message-Account line
@param ht AccountHeader used to lookup MessageWaiting header - not really used computationally
@return Uri for Message-Account line
**/
const Uri& header(const AccountHeader& ht) const;
Uri& header(const AccountHeader& ht);
/** @brief Check if Message-Account line is present
@note This call only indicates the actual existence of the Message-Account
line in the MessageWaiting doc if header(mw_account) hasn't been called.
After that call the exists(mw_account) call will return true (since a
Uri now exists) whether or not the Uri was built based on the
MessageWaiting doc.
@param ht AccountHeader used to lookup MessageWaiting header - not really used computationally
@return bool true if HeaderType exists
**/
bool exists(const AccountHeader& ht) const;
/** @brief Remove the Uri for Message-Account line
@param ht AccountHeader used to lookup MessageWaiting header - not really used computationally
**/
void remove(const AccountHeader& ht);
/** @brief Get the value correspoding to optional message header hn in the MessageWaiting doc.
Used to access optional message headers in the MessageWaiting doc
@param hn HeaderType used to lookup the optional MessageWaiting header
@return Data corresponding to hn
**/
const Data& header(const Data& hn) const;
Data& header(const Data& hn);
/** @brief Check if optional message header hn is present
@param hn HeaderType used to lookup the optional MessageWaiting header
@return bool true if optional message header exists
**/
bool exists(const Data& hn) const;
/** @brief Remove the optional message header corresponding to hn
@param hn HeaderType used to lookup the optional MessageWaiting header
**/
void remove(const Data& hn);
/** @brief Check to see if there are messages
@return bool true if there are messages
**/
bool& hasMessages() { checkParsed(); return mHasMessages; }
/** @brief Provides an interface for reading and modifying MessageWaiting bodies.
**/
class Header
{
public:
/** @brief Header constructor.
Create a Header using new count and old message counts.
@param numNew new message count
@param numOld old message count
**/
Header(unsigned int numNew,
unsigned int numOld);
/** @brief Header constructor with urgent counts.
Create a Header using new/old/urgent new/urgent old message counts.
@param numNew new message count
@param numOld old message count
@param numUrgentNew new urgent message count
@param numUrgentOld old urgent message count
**/
Header(unsigned int numNew,
unsigned int numOld,
unsigned int numUrgentNew,
unsigned int numUrgentOld);
/** @brief Return new message count
@return int new message count
**/
const unsigned int& newCount() const {return mNew;}
/** @brief Return new message count
@return int new message count
**/
unsigned int& newCount() {return mNew;}
/** @brief Return old message count
@return int new message count
**/
const unsigned int& oldCount() const {return mOld;}
/** @brief Return old message count
@return int new message count
**/
unsigned int& oldCount() {return mOld;}
/** @brief Return bool indicating that there are urgent messages
@note Currently this is only set during construction. Modification of the new and old urgent counts does not update this field.
@return bool true if there are urgent messages
**/
const bool& urgent() const {return mHasUrgent;}
/** @brief Return bool indicating that there are urgent messages
@note Currently this is only set during construction. Modification of the new and old urgent counts does not update this field.
@return bool true if there are urgent messages
**/
bool& urgent() {return mHasUrgent;}
/** @brief Return new urgent message count
@return int new message count
**/
const unsigned int& urgentNewCount() const {return mUrgentNew;}
/** @brief Return new urgent message count
@return int new message count
**/
unsigned int& urgentNewCount() {return mUrgentNew;}
/** @brief Return new message count
@return int new message count
**/
const unsigned int& urgentOldCount() const {return mUrgentOld;}
/** @brief Return new message count
@return int new message count
**/
unsigned int& urgentOldCount() {return mUrgentOld;}
private:
unsigned int mNew;
unsigned int mOld;
bool mHasUrgent;
unsigned int mUrgentNew;
unsigned int mUrgentOld;
friend class MessageWaitingContents;
};
static bool init();
private:
void clear();
bool mHasMessages;
Uri* mAccountUri;
Header* mHeaders[MW_MAX];
std::map<Data, Data> mExtensions;
};
/** @brief Used to access the Message-Account header in MessageWaiting docs.
**/
extern MessageWaitingContents::AccountHeader mw_account;
static bool invokeMessageWaitingContentsInit = MessageWaitingContents::init();
}
#endif
/* ====================================================================
* The Vovida Software License, Version 1.0
*
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
* and "Vovida Open Communication Application Library (VOCAL)" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact vocal@vovida.org.
*
* 4. Products derived from this software may not be called "VOCAL", nor
* may "VOCAL" appear in their name, without prior written
* permission of Vovida Networks, Inc.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* ====================================================================
*
* This software consists of voluntary contributions made by Vovida
* Networks, Inc. and many individuals on behalf of Vovida Networks,
* Inc. For more information on Vovida Networks, Inc., please see
* <http://www.vovida.org/>.
*
*/
|