Csta library is supplied by many vendors to be used in Tsapi applications. In this specific case, library provided from Alcatel will be used, which includes some Alcatel specific extensions. However, building it in a c++ program is a bit difficult. Googling reveals cases of same problem, but there is not an explicit solution given, so here is the way I followed to succeed, in case someone else also has to deal with.
First start with minimum by following documentation
TsapiPremium.pdf of Alcatel. Let’s call
CSTACleanup(). In fact, these functions are somehow called default in Windows and are not obligatory, but they are simple enough to do their demonstration purpose in this context; to obtain a successful build.
Following the suggestions of documentation an initial round would be;
with following directory structure;
Unfortunately, build will be broken;
The problematic part is about declaration of
Here we see that
TSAPI is defined as using the
pascal calling convention with returning a
RetCode_t, which turns to be type
int. What I expect is
__stdcall that is some kind of a standard for Win32 DLLs, therefore I redefine
We have still a few deficiencies;
HWND may be searched through msdn website, where it is suggested to use
WinDef.h. A better alternative is use of
windows.h which also contains some of dependencies that
WinDef.h will require.
Although TsapiPremium document suggests checking
ACSPOSITIVE for return value of
CSTACleanup(), it is not found in definitions. Closest alternative is use of
ACSPOSITIVE_ACK which also defaults to zero.
Final notch will be Level 1 warning about anachronism usage. variable type
TSAPI which resolves to
int __stdcall does not have a meaning and modifier on data which is
__stdcall is ignored. Solution will simply be change of
int. Resulting template will be;