sipxtacklib  Version 3.3
TapiMgr.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 #ifndef _TapiMgr_h
12 #define _TapiMgr_h
13 
14 // SYSTEM INCLUDES
15 // APPLICATION INCLUDES
16 #include "tapi/sipXtapiEvents.h"
17 #include "tapi/sipXtapiInternal.h"
18 
19 // DEFINES
20 // MACROS
21 // EXTERNAL FUNCTIONS
22 // EXTERNAL VARIABLES
23 // CONSTANTS
24 // STRUCTS
25 // TYPEDEFS
26 // FORWARD DECLARATIONS
27 
36 class TapiMgr
37 {
38 /* //////////////////////////// PUBLIC //////////////////////////////////// */
39 public:
43  virtual ~TapiMgr();
44 
48  static TapiMgr& getInstance();
49 
50 
55 
56 
61 
66 
71 
72 
76  void fireCallEvent(const void* pSrc,
77  const char* szCallId,
78  SipSession* pSession,
79  const char* szRemoteAddress,
82  void* pEventData,
83  const char* remoteAssertedIdentity = NULL);
84 
88  void fireMediaEvent(const void* pSrc,
89  const char* szCallId,
90  const char* szRemoteAddress,
91  SIPX_MEDIA_EVENT event,
92  SIPX_MEDIA_CAUSE cause,
93  SIPX_MEDIA_TYPE type,
94  void* pEventData) ;
95 
100  void fireLineEvent(const void* pSrc,
101  const char* szLineIdentifier,
102  SIPX_LINESTATE_EVENT event,
103  SIPX_LINESTATE_CAUSE cause,
104  const char *bodyBytes= NULL );
105 
109  bool fireEvent(const void* pSrc,
110  const SIPX_EVENT_CATEGORY event,
111  void* pInfo);
112 
113 
114 /* ============================ MANIPULATORS ============================== */
115 /* ============================ ACCESSORS ================================= */
116 /* ============================ INQUIRY =================================== */
117 
118 /* //////////////////////////// PROTECTED ///////////////////////////////// */
119 protected:
120 
121 /* //////////////////////////// PRIVATE /////////////////////////////////// */
122 private:
123 /* ============================ CREATORS ================================== */
127  TapiMgr();
128 
132  TapiMgr(const TapiMgr& src);
133 
134 
138  static TapiMgr sTapiMgr;
139 
143  sipxEventCallbackFn sipxEventCallbackPtr;
144 
148  sipxMediaCallbackFn sipxMediaCallbackPtr ;
149 
153  sipxCallEventCallbackFn sipxCallEventCallbackPtr;
154 
158  sipxLineEventCallbackFn sipxLineEventCallbackPtr;
159 
160 };
161 
162 #endif /* ifndef _TapiMgr_h_ */
void(* sipxMediaCallbackFn)(const void *pSrc, const char *szCallId, const char *szRemoteAddress, SIPX_MEDIA_EVENT event, SIPX_MEDIA_CAUSE cause, SIPX_MEDIA_TYPE type, void *pEventData)
Definition: sipXtapiInternal.h:394
Definition: SipSession.h:33
SIPX_CALLSTATE_CAUSE
Callstate cause events identify the reason for a Callstate event or provide more detail.
Definition: sipXtapiEvents.h:244
void fireLineEvent(const void *pSrc, const char *szLineIdentifier, SIPX_LINESTATE_EVENT event, SIPX_LINESTATE_CAUSE cause, const char *bodyBytes=NULL)
This method calls the Line event callback using the function pointer.
Definition: TapiMgr.cpp:119
sipXtapi event declarations
SIPX_CALLSTATE_EVENT
Major call state events identify significant changes in the state of a call.
Definition: sipXtapiEvents.h:163
SIPX_EVENT_CATEGORY
Enum with all of the possible event types.
Definition: sipXtapiEvents.h:54
static TapiMgr & getInstance()
Accessor for the single class instance.
Definition: TapiMgr.cpp:34
void(* sipxCallEventCallbackFn)(const void *pSrc, const char *szCallId, SipSession *pSession, const char *szRemoteAddress, SIPX_CALLSTATE_EVENT event, SIPX_CALLSTATE_CAUSE cause, void *pEventData, const char *assertedIdentity)
Definition: sipXtapiInternal.h:385
SIPX_MEDIA_EVENT
Enumeration of possible media events.
Definition: sipXtapiEvents.h:490
void fireMediaEvent(const void *pSrc, const char *szCallId, const char *szRemoteAddress, SIPX_MEDIA_EVENT event, SIPX_MEDIA_CAUSE cause, SIPX_MEDIA_TYPE type, void *pEventData)
This method calls the media event callback using the function pointer.
Definition: TapiMgr.cpp:102
SIPX_LINESTATE_CAUSE
Enumeration of possible linestate Event causes.
Definition: sipXtapiEvents.h:369
SIPX_MEDIA_TYPE
Enumeration of possible media event types.
Definition: sipXtapiEvents.h:660
void(* sipxLineEventCallbackFn)(const void *pSrc, const char *szLineIdentifier, SIPX_LINESTATE_EVENT event, SIPX_LINESTATE_CAUSE cause, const char *bodyBytes)
Definition: sipXtapiInternal.h:402
void setTapiCallCallback(sipxCallEventCallbackFn fp)
Sets the callback function pointer for Call Events (to be fired to the sipXtapi layer) ...
Definition: TapiMgr.cpp:40
void setTapiLineCallback(sipxLineEventCallbackFn fp)
Sets the callback function pointer for Line Events (to be fired to the sipXtapi layer) ...
Definition: TapiMgr.cpp:51
SIPX_LINESTATE_EVENT
Enumeration of possible linestate Events.
Definition: sipXtapiEvents.h:330
bool(* sipxEventCallbackFn)(const void *pSrc, SIPX_EVENT_CATEGORY category, void *pInfo)
Definition: sipXtapiInternal.h:409
virtual ~TapiMgr()
TapiMgr destructor.
Definition: TapiMgr.cpp:29
bool fireEvent(const void *pSrc, const SIPX_EVENT_CATEGORY event, void *pInfo)
This method calls the new "unified callback" procedure in sipXtapi.
Definition: TapiMgr.cpp:135
void setTapiMediaCallback(sipxMediaCallbackFn fp)
Sets the callback function pointer for all media Events (to be fired to the sipXtapi layer) ...
Definition: TapiMgr.cpp:45
void fireCallEvent(const void *pSrc, const char *szCallId, SipSession *pSession, const char *szRemoteAddress, SIPX_CALLSTATE_EVENT event, SIPX_CALLSTATE_CAUSE cause, void *pEventData, const char *remoteAssertedIdentity=NULL)
This method calls the Call event callback using the function pointer.
Definition: TapiMgr.cpp:61
void setTapiCallback(sipxEventCallbackFn fp)
Sets the callback function pointer for all Events (to be fired to the sipXtapi layer) ...
Definition: TapiMgr.cpp:56
The TapiMgr singleton class allows callback funtion-pointers for tapi to be set, indicating the funct...
Definition: TapiMgr.h:36
SIPX_MEDIA_CAUSE
Enumeration of possible media event causes.
Definition: sipXtapiEvents.h:638

sipXtackLib home page