/usr/include/sipxtapi/cp/CSeqManager.h is in libsipxtapi-dev 3.3.0~test17-2.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 | //
// Copyright (C) 2004-2006 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
///////////////////////////////////////////////////////////////////////////////
#ifndef _CSeqManager_h_
#define _CSeqManager_h_
// SYSTEM INCLUDES
// APPLICATION INCLUDES
#include "utl/UtlHashMap.h"
#include "utl/UtlRandom.h"
#include "utl/UtlString.h"
#include "os/OsMutex.h"
// DEFINES
#define CSEQ_MANAGER_STATE_CHECKS
#undef CSEQ_MANAGER_STATE_CHECKS
#define CSEQ_ID_INVITE "INVITE"
#define CSEQ_ID_INFO "INFO"
#define CSEQ_ID_NOTIFY "NOTIFY"
#define CSEQ_ID_REFER "REFER"
#define CSEQ_ID_OPTIONS "OPTIONS"
// MACROS
// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STRUCTS
// TYPEDEFS
typedef struct CSEQ_CONTEXT
{
UtlString identifier ;
bool bInTransaction ;
int iCSeq ;
} CSEQ_CONTEXT ;
// FORWARD DECLARATIONS
/**
* CSeqManager manages the CSeq number space for a dialog. It keeps track of
* multiple identifiers to handle overlapping transactions (e.g. send a NOTIFY
* while an INFO transaction is still outstanding).
*/
class CSeqManager
{
/* //////////////////////////// PUBLIC //////////////////////////////////// */
public:
/* ============================ CREATORS ================================== */
/**
* Default constructor
*/
CSeqManager();
/**
* Destructor
*/
virtual ~CSeqManager();
/* ============================ MANIPULATORS ============================== */
/**
* startTransaction notes that a transaction has been started and will
* return FALSE if any other transaction was already started. It is
* assumed that if startTransaction fails (returns false), the developer
* will try to start the transaction again later. This method will
* increase the CSeq number regardless of success.
*/
bool startTransaction(const char* szIdentifier, int& iCSeq) ;
/**
* endTransaction marks the end of a transaction.
*/
bool endTransaction(const char* szIdentifier) ;
/**
* Dump state into specified string
*/
void dumpState(UtlString& state) ;
/* ============================ ACCESSORS ================================= */
/**
* Get the current csequence number
*/
int getCSeqNumber(const char* szIdentifier) ;
/* ============================ INQUIRY =================================== */
/**
* Is the specified identifer in a transaction already?
*/
bool isInTransaction(const char* szIdentifier) ;
/* //////////////////////////// PROTECTED ///////////////////////////////// */
protected:
UtlHashMap mHashMap ;
UtlRandom mRandomGenerator ;
OsMutex mGuard ;
int miCSeq ;
/**
* Gets the context for the specified identifier. If no context is
* available, one is created.
*/
CSEQ_CONTEXT* getContext(const char* szIdentifier) ;
/* //////////////////////////// PRIVATE /////////////////////////////////// */
private:
/** Disabled copy constructor */
CSeqManager(const CSeqManager& rCSeqManager);
/** Disabled assignment operator */
CSeqManager& operator=(const CSeqManager& rhs);
};
/* ============================ INLINE METHODS ============================ */
#endif // _CSeqManager_h_
|