forked from nic-at/siptapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WaveTsp.h
154 lines (124 loc) · 3.66 KB
/
WaveTsp.h
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
/*
Name: asttapi.cpp
License: Under the GNU General Public License Version 2 or later (the "GPL")
(c) Nick Knight
(c) Klaus Darilion (IPCom GmbH, www.ipcom.at)
Description:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Asttapi.
*
* The Initial Developer of the Original Code is
* Nick Knight.
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Klaus Darilion (IPCom GmbH, www.ipcom.at)
*
* ***** END LICENSE BLOCK ***** */
// WaveTsp.h
#ifndef WAVETSP_H
#define WAVETSP_H
#include <eXosip2/eXosip.h>
#define DIM(rg) (sizeof(rg)/sizeof(*rg))
// since eXosip 4.0 the context must be specified
// defined in SipStack.cpp
extern eXosip_t *ctx;
//if not defined, Alert-Info will be set for Polycom
#define AUTOANSWER_ASTRA
//kd: constants for the number of lines and number of phones
#ifdef MULTILINE
#define SIPTAPI_NUMLINES 40
#else
#define SIPTAPI_NUMLINES 1
#endif
#define SIPTAPI_NUMPHONES 1
#define SIPTAPI_VERSION_SHORT "v0.3.23"
#ifdef MULTILINE
#ifdef _DEBUG
#define SIPTAPI_VERSION_W L"v0.3.23 Multiline Debug"
#define SIPTAPI_VERSION "v0.3.23 Multiline Debug"
#else
#define SIPTAPI_VERSION_W L"v0.3.23 Multiline Release"
#define SIPTAPI_VERSION "v0.3.23 Multiline Release"
#endif
#else
#ifdef _DEBUG
#define SIPTAPI_VERSION_W L"v0.3.23 Singleline Debug"
#define SIPTAPI_VERSION "v0.3.23 Singleline Debug"
#else
#define SIPTAPI_VERSION_W L"v0.3.23 Singleline Release"
#define SIPTAPI_VERSION "v0.3.23 Singleline Release"
#endif
#endif
// Data sent back and forth between UI and TSP during a dial operation
class CtspCall;
struct TSPUIDATA
{
CtspCall* pCall; // Call operation is happening on
DWORD dwRequestID; // Asynch. operation ID
LONG tr; // Asynch, operation result
DWORD nCallState; // New call state
};
//#define DEBUGTSP
#if defined(_DEBUG) && defined(DEBUGTSP)
enum ParamType
{
ptDword,
ptString,
};
enum ParamDirection
{
dirIn,
dirOut,
};
struct FUNC_PARAM
{
const char* pszVal;
DWORD dwVal;
ParamType pt;
ParamDirection dir;
};
struct FUNC_INFO
{
const char* pszFuncName;
DWORD dwNumParams;
FUNC_PARAM* rgParams;
LONG lResult;
};
void Prolog(FUNC_INFO* pInfo);
LONG Epilog(FUNC_INFO* pInfo, LONG lResult);
#define BEGIN_PARAM_TABLE(fname) \
const char* __pszFname = fname; \
FUNC_PARAM __params[] = {
#define DWORD_IN_ENTRY(p) { #p, (DWORD)p, ptDword, dirIn },
#define DWORD_OUT_ENTRY(p) { #p, (DWORD)p, ptDword, dirOut },
#define STRING_IN_ENTRY(p) { #p, (DWORD)p, ptString, dirIn },
#define STRING_OUT_ENTRY(p) { #p, (DWORD)p, ptString, dirOut },
#define END_PARAM_TABLE() \
}; FUNC_INFO __info = { __pszFname, DIM(__params), __params }; \
Prolog(&__info);
#define EPILOG(r) Epilog(&__info, r)
#define TSPTRACE TspTrace
#define TSPSIPTRACE TspSipTrace
void TspTrace(LPCTSTR pszFormat, ...);
void TspSipTrace(LPCSTR pszFormat, osip_message_t *msg);
#else // !_DEBUG
#define EPILOG(r) r
#define BEGIN_PARAM_TABLE(fname)
#define DWORD_IN_ENTRY(p)
#define DWORD_OUT_ENTRY(p)
#define STRING_IN_ENTRY(p)
#define STRING_OUT_ENTRY(p)
#define END_PARAM_TABLE()
#define TSPTRACE TspTrace
#define TSPSIPTRACE TspSipTrace
inline void TspTrace(LPCTSTR pszFormat, ...) {};
inline void TspSipTrace(LPCSTR pszFormat, osip_message_t *msg) {};
#endif // _DEBUG
#endif // WAVETSP_H