g***@gmx.com
2013-09-18 16:45:31 UTC
Hello,
Can anyone please help me! I am trying to write a Telephony Service Provider (TSP), I can add the TSP through control panel, and dialer.exe recognizes my line and calls most of the functions that I need it to. However it always bugs out on TSPI_lineOpen. I belive that the data I pass should be accepted according to the documentation. Please could someone tell me where I am going wrong.
Many thanks
[code]
LONG TSPIAPI TSPI_lineOpen( DWORD dwDeviceID, HTAPILINE htLine, LPHDRVLINE lphdLine, DWORD dwTSPIVersion, LINEEVENT lpfnEventProc )
{
#ifdef DEV
ofstream newFile;
newFile.open ("C:\\temp\\test.txt", ios::app );
newFile << "- [TSPI_lineOpen] Device id: " << dwDeviceID << " with TSPI version: " << dwTSPIVersion << "\n";
newFile.close();
#endif
if(LPVOID foo = LocalAlloc(LPTR, sizeof(DRVLINE))) // A nasty hack, but it works (sort of)!
{
PDRVLINE pLine = (PDRVLINE)foo;
*lphdLine = (HDRVLINE) pLine;
pLine->htLine = htLine;
pLine->pfnEventProc = lpfnEventProc;
pLine->dwDeviceID = dwDeviceID;
}
else
return LINEERR_NOMEM;
return 0;
}
[/code]
Full project source (if needed) in 7zip format
https://www.dropbox.com/s/jl8ry9br5w6wke5/Cartwright%20TSPI%2010.7z
Can anyone please help me! I am trying to write a Telephony Service Provider (TSP), I can add the TSP through control panel, and dialer.exe recognizes my line and calls most of the functions that I need it to. However it always bugs out on TSPI_lineOpen. I belive that the data I pass should be accepted according to the documentation. Please could someone tell me where I am going wrong.
Many thanks
[code]
LONG TSPIAPI TSPI_lineOpen( DWORD dwDeviceID, HTAPILINE htLine, LPHDRVLINE lphdLine, DWORD dwTSPIVersion, LINEEVENT lpfnEventProc )
{
#ifdef DEV
ofstream newFile;
newFile.open ("C:\\temp\\test.txt", ios::app );
newFile << "- [TSPI_lineOpen] Device id: " << dwDeviceID << " with TSPI version: " << dwTSPIVersion << "\n";
newFile.close();
#endif
if(LPVOID foo = LocalAlloc(LPTR, sizeof(DRVLINE))) // A nasty hack, but it works (sort of)!
{
PDRVLINE pLine = (PDRVLINE)foo;
*lphdLine = (HDRVLINE) pLine;
pLine->htLine = htLine;
pLine->pfnEventProc = lpfnEventProc;
pLine->dwDeviceID = dwDeviceID;
}
else
return LINEERR_NOMEM;
return 0;
}
[/code]
Full project source (if needed) in 7zip format
https://www.dropbox.com/s/jl8ry9br5w6wke5/Cartwright%20TSPI%2010.7z