This file is indexed.

/usr/include/sipxtapi/tapi/SipXEventDispatcher.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
//
// Copyright (C) 2006 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2006 Robert J. Andreasen, Jr.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
//////////////////////////////////////////////////////////////////////////////

#ifndef _SIPXEVENTDISPATCHER_H_
#define _SIPXEVENTDISPATCHER_H_

// SYSTEM INCLUDES
// APPLICATION INCLUDES
#include "os/OsServerTask.h"
#include "tapi/sipXtapi.h"
#include "tapi/sipXtapiEvents.h"
#include "utl/UtlHashMap.h"
#include "os/OsRWMutex.h"

// DEFINES
// MACROS
// EXTERNAL FUNCTIONS
// CONSTANTS
// STRUCTS
// TYPEDEFS
typedef struct
{   
    SIPX_INST                   hInst ;
    SIPX_EVENT_CALLBACK_PROC    pCallbackProc ;
    void*                       pUserData ;
} SIPX_EVENT_LISTENER_CONTEXT ;

// MACROS

// FORWARD DECLARATIONS
class OsEventMsg ;

/**
 * The SipXEventDispatcher adds a listener to sipXtapi and then redispatches
 * all of the sipXtapi events on its own callback.  Ideally, this should be 
 * part of sipXtapi -- however, I don't want to change the behavior at this 
 * time.  Also, solutions for the TODOs below are needed.
 *
 * TODO: 
 *
 * - The S/MIME (and TLS?) code expects a return value.  This should be broken
 *   into a new/different callback.  Right now, that functionality is lost
 *   and I believe we will accept all certificates (return true at end of 
 *   SipXEventDispatcher::EventCallBack.
 *
 * - Some synchronization is required on the CALL_DESTROY (perhaps other
 *   final events).  Right now, the call could be removed from sipXtapi's
 *   internal bookkeeping structures before the application has the ability
 *   to handle the event.  I believe we should have some sort of "ACK" to the 
 *   call final events (perhaps after it is dispatched from here) and the
 *   call should not be freed up in sipXtapi until after that ACK.  Today,
 *   the call handle is freed in the fire***Event method in 
 *   sipXtapiEvents.cpp.
 */
class SipXEventDispatcher : public OsServerTask
{
public:
/* ============================ CREATORS ================================== */

    SipXEventDispatcher(SIPX_INST hInst);

    virtual ~SipXEventDispatcher(void);
    
/* ============================ MANIPULATORS ============================== */

    /**
     * Implementation of OsServerTask's pure virtual method
     */
    UtlBoolean handleMessage(OsMsg& rMsg);

    bool addListener(SIPX_EVENT_CALLBACK_PROC  pCallbackProc,
                     void*                     pUserData) ;

    bool removeListener(SIPX_EVENT_CALLBACK_PROC  pCallbackProc,
                        void*                     pUserData) ;

    void removeAllListeners() ;

    void serviceListeners(SIPX_EVENT_CATEGORY category, 
                          void*               pInfo) ;

    void setInstanceHandle(SIPX_INST hNew) ;

protected:
    static bool SIPX_CALLING_CONVENTION EventCallBack(SIPX_EVENT_CATEGORY category, 
                                                      void*               pInfo, 
                                                      void*               pUserData);
        
private:
    SIPX_INST  mhInst ;
    UtlHashMap mListeners ;
    OsRWMutex  mListenerLock;
};

#endif // _SIPXEVENTDISPATCHER_H_