This file is indexed.

/usr/include/sipxtapi/cp/CpCall.h is in libsipxtapi-dev 3.3.0~test17-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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
//
// 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 _CpCall_h_
#define _CpCall_h_

// SYSTEM INCLUDES
//#include <...>

// APPLICATION INCLUDES
#include <os/OsServerTask.h>
#include <os/OsRWMutex.h>
#include "os/OsUtil.h"
#include "os/OsLockingList.h"
#include <os/OsMsgDispatcher.h>
#include <sdp/SdpCodec.h>
#include <ptapi/PtEvent.h>
#include <ptapi/PtConnection.h>
#include <ptapi/PtTerminalConnection.h>
#include <cp/CallManager.h>
#include "tao/TaoObjectMap.h"
#include <mi/MiNotification.h>

// DEFINES
#define MINIMUM_DTMF_LENGTH 50
#define MINIMUM_DTMF_SILENCE 50

// MACROS
// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STRUCTS
struct DtmfEvent {
    int     event;
    int interdigitSecs;
    int timeoutSecs;
    int ignoreKeyUp;
    UtlBoolean enabled;
};

// TYPEDEFS
// FORWARD DECLARATIONS
class CpCallManager;
class CpMediaInterface;

//:Class short description which may consist of multiple lines (note the ':')
// Class detailed description which may extend to multiple lines
class CpCall : public OsServerTask
{
    /* //////////////////////////// PUBLIC //////////////////////////////////// */
public:

    enum eventType
    {
        CONNECTION_STATE = 0,
        TERMINAL_CONNECTION_STATE,
        CALL_STATE
    };

    enum metaEventState
    {
        METAEVENT_START = 0,
        METAEVENT_INPROGRESS,
        METAEVENT_END
    };

    enum callTypes
    {
        CP_NORMAL_CALL,

        // There are three types of parties involved with a transfer:
        // Transfer Controller -
        // Transferee -
        // Transfer Target -
        // There are two calls involved with a transfer:
        // Original call - between the transfer controller and transferee(s)
        // Target Call - between all parties, the transfer controller and
        //     transfer target connect on this call first.  If this is
        //     consultative the transfer controller does not drop out
        //     immediately
        CP_TRANSFER_CONTROLLER_ORIGINAL_CALL,
        CP_TRANSFER_CONTROLLER_TARGET_CALL,
        CP_TRANSFEREE_ORIGINAL_CALL,
        CP_TRANSFEREE_TARGET_CALL,
        //CP_TRANSFER_TARGET_ORIGINAL_CALL,  // do not know if this is needed
        CP_TRANSFER_TARGET_TARGET_CALL
    };

    // The following enumeration defines the degree of willingness
    // that a call has for handling a message.  It is not always
    // a binary decision, so this allows a weighting as to the amount
    // of willingness.
    enum handleWillingness
    {
        // Does not match by any means
        CP_WILL_NOT_HANDLE = 0,

        // Will handle if a better match is not found
        // (i.e. check all the remaining calls first).
        CP_MAY_HANDLE,

        // Is a definite match no need to search any further
        CP_DEFINITELY_WILL_HANDLE
    };
    /* ============================ CREATORS ================================== */

    CpCall(CpCallManager* manager = NULL,
        CpMediaInterface* callMediaInterface = NULL,
        int callIndex = -1,
        const char* callId = NULL,
        int holdType = CallManager::NEAR_END_HOLD);
    //:Default constructor

    virtual
        ~CpCall();
    //:Destructor

    /* ============================ MANIPULATORS ============================== */

    void setDropState(UtlBoolean state);

    void postMetaEvent(int state, int remoteIsCallee = -1);  // remoteIsCallee = -1 means not set

    void postTaoListenerMessage(int responseCode,
        UtlString responseText,
        int eventId,
        int type,
        int cause = PtEvent::CAUSE_NORMAL,
        int remoteIsCallee = 1,
        UtlString remoteAddress = "",
        int isRemote = 0,
        UtlString targetCallId = OsUtil::NULL_OS_STRING);

    void setCallState(int responseCode, UtlString responseText, int state, int cause = PtEvent::CAUSE_NORMAL);

    virtual void inFocus(int talking = 1);
    virtual void outOfFocus();

    virtual void sendFlowgraphMessage(OsMsg& flowgraphMessage);

    //virtual void hold();
    //virtual void offHold();
    virtual void localHold();
    virtual void hangUp(UtlString callId, int metaEventId);
    //virtual void blindTransfer() = 0;
    //virtual void conferenceAddParty() = 0;

    virtual void getLocalAddress(char* address, int len);

    virtual void getLocalTerminalId(char* terminal, int len);

    virtual void getCallId(UtlString& callId);
    //: Gets the main call Id for this call
    // Note: a call may have many callIds (i.e. one for each connection)
    virtual void setCallId(const char* callId);
    //: Sets the main call Id for this call

    void setLocalConnectionState(int newState);
    //: Sets the local connection state for this call

    int getLocalConnectionState() { return mLocalConnectionState; };
    //: Sets the local connection state for this call

    /* ============================ ACCESSORS ================================= */
    static int getCallTrackingListCount();
    //returns the number of call tasks currently outstanding.

    int getCallIndex();

    int getCallState();

    virtual void printCall();

    // This should go away
    void enableDtmf();

    static void getStateString(int state, UtlString* stateLabel);

    // Meta Event Utilities
    // For the meta events, the first callId (index=0) is the new
    // call, the subsequent callIds (index = 1 through numCalls)
    // are the old calls
    virtual void startMetaEvent(int metaEventId, int metaEventType,
        int numCalls, const char* metaEventCallIds[], int remoteIsCallee = -1); // remoteIsCallee = -1 means not set

    virtual void setMetaEvent(int metaEventId, int metaEventType,
        int numCalls, const char* metaEventCallIds[]);

    void getMetaEvent(int& metaEventId, int& metaEventType,
        int& numCalls, const UtlString* metaEventCallIds[]) const;

    virtual void stopMetaEvent(int remoteIsCallee = -1); // remoteIsCallee = -1 means not set

    void setCallType(int callType);
    int getCallType() const;

    void setTargetCallId(const char* targetCallId);
    void getTargetCallId(UtlString& targetCallId) const;
    void setOriginalCallId(const char* targetCallId);
    void getOriginalCallId(UtlString& targetCallId) const;

    int getLocalConnectionState(int state);

    /* ============================ INQUIRY =================================== */

    virtual UtlBoolean hasCallId(const char* callId) = 0;

    virtual enum handleWillingness willHandleMessage(const OsMsg& eventMessage) = 0;

    virtual UtlBoolean isQueued();

    virtual UtlBoolean isCallIdSet();

    virtual UtlBoolean isLocalHeld();

    virtual UtlBoolean canDisconnectConnection(Connection* pConnection) = 0;

    virtual UtlBoolean isInFocus() const { return mCallInFocus ;} ;

    /* //////////////////////////// PROTECTED ///////////////////////////////// */
protected:
    virtual UtlBoolean handleMessage(OsMsg& eventMessage);
    virtual UtlBoolean handleCallMessage(OsMsg& eventMessage) = 0;
    virtual UtlBoolean handleMiNotificationMessage(MiNotification& notification) = 0 ;
    virtual void onHook() = 0;

    virtual UtlBoolean getConnectionState(const char* remoteAddress, int& state) = 0;

    virtual UtlBoolean getTermConnectionState(const char* address,
        const char* terminal,
        int& state) = 0;

    void addHistoryEvent(const char* messageLogString);
    void addHistoryEvent(const int msgSubType,
        const CpMultiStringMessage* multiStringMessage);

    CpCallManager* mpManager;
    UtlString mCallId;
    volatile UtlBoolean mCallInFocus;
    UtlBoolean mRemoteDtmf;
    UtlBoolean mDtmfEnabled;
    OsRWMutex mCallIdMutex;
    CpMediaInterface*   mpMediaInterface;
    int mCallIndex;
    int mCallState;
    int mHoldType;
    int mLocalConnectionState;
    int mLocalTermConnectionState;
    UtlBoolean mLocalHeld;

    OsMsgDispatcher mMediaMsgDispatcher;

    UtlBoolean mDropping;
    int mMetaEventId;
    int mMetaEventType;
    int mNumMetaEventCalls;
    UtlString* mpMetaEventCallIds;

    int mMessageEventCount;
    UtlString mCallHistory[CP_CALL_HISTORY_LENGTH];

    /* //////////////////////////// PRIVATE /////////////////////////////////// */
private:

    static OsLockingList *spCallTrackingList;
    //: maintains a list of the Call-nnn names


    static OsStatus addToCallTrackingList(UtlString &rCallTaskName);
    //: function used to add call names to the tracking list

    static OsStatus removeFromCallTrackingList(UtlString &rCallTaskName);
    //: function used to remove call names from the tracking list

    int mCallType;
    UtlString mOriginalCallId;
    UtlString mTargetCallId;

    CpCall& operator=(const CpCall& rhs);
    //:Assignment operator (disabled)
    CpCall(const CpCall& rCpCall);
    //:Copy constructor (disabled)

    int tcStateFromEventId(int eventId);
};

/* ============================ INLINE METHODS ============================ */

#endif  // _CpCall_h_