lineCallbackFunc not returning message..... [modified]
-
hello guys...everything seems to be fine here but when I call at my landline number it does't show me the number. TapiInitialize()
void WINAPI TapiInitialize() {
LPLINEDEVCAPS lineDevCaps = NULL; lineDevCaps = (LPLINEDEVCAPS)LocalAlloc(LPTR, 4096); //create the event first.. EventReply = CreateEvent(NULL,FALSE,FALSE,NULL); //clear the structure before the usage memset(&LineInitializeExParams,0,sizeof(LINEINITIALIZEEXPARAMS)); //populate the options LineInitializeExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS); LineInitializeExParams.dwOptions = LINEINITIALIZEEXOPTION\_USEEVENT; //call the LineInitializeEx function result = lineInitializeEx(&lineApp,NULL,(LINECALLBACK)&lineCallbackFunc,NULL,&numDevs,&tapiVersion,&LineInitializeExParams); if (result!=0) printf("TAPI could't be Initialized"); else printf("\\n\\nTAPI Initialized.."); num = numDevs; printf("\\nNumber of lines available to this app: %d",(LPWSTR)num); result = lineNegotiateAPIVersion(lineApp,0,API\_EARLY\_VERSION,API\_CURRENT\_VERSION,&tapiVersion,0); result = lineGetDevCaps(lineApp,0,tapiVersion,0,lineDevCaps); //opening a line result = lineOpen(lineApp,0,&hLine,tapiVersion,0,0,LINECALLPRIVILEGE\_MONITOR,LINEMEDIAMODE\_DATAMODEM,NULL); if(result!=0) printf("\\nLINE could't be Opened..."); else printf("\\nLINE Opened...");
TapiShutDown()
void WINAPI TapiShutdown() {
result = lineShutdown(lineApp);
if (result==0)
printf("Line closed successfuly");
else
printf("something went wrong");
}and lineCallbackFunc().
VOID FAR PASCAL lineCallbackFunc(DWORD hDevice,DWORD dwMsg, DWORD Param1, DWORD Param2, DWORD Param3) {
if (dwMsg == LINE_REQUEST)
printf("incomg line...");
}In the main(), I just call these functions.
int _tmain(int argc, _TCHAR* argv[])
{
TapiInitialize();
Sleep(180000);
printf("\n\nPress any key to close line....");
getche();
TapiShutdown();
return 0;
}Where am I doing something wrong??:confused:
modified on Tuesday, September 21, 2010 1:21 PM
-
hello guys...everything seems to be fine here but when I call at my landline number it does't show me the number. TapiInitialize()
void WINAPI TapiInitialize() {
LPLINEDEVCAPS lineDevCaps = NULL; lineDevCaps = (LPLINEDEVCAPS)LocalAlloc(LPTR, 4096); //create the event first.. EventReply = CreateEvent(NULL,FALSE,FALSE,NULL); //clear the structure before the usage memset(&LineInitializeExParams,0,sizeof(LINEINITIALIZEEXPARAMS)); //populate the options LineInitializeExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS); LineInitializeExParams.dwOptions = LINEINITIALIZEEXOPTION\_USEEVENT; //call the LineInitializeEx function result = lineInitializeEx(&lineApp,NULL,(LINECALLBACK)&lineCallbackFunc,NULL,&numDevs,&tapiVersion,&LineInitializeExParams); if (result!=0) printf("TAPI could't be Initialized"); else printf("\\n\\nTAPI Initialized.."); num = numDevs; printf("\\nNumber of lines available to this app: %d",(LPWSTR)num); result = lineNegotiateAPIVersion(lineApp,0,API\_EARLY\_VERSION,API\_CURRENT\_VERSION,&tapiVersion,0); result = lineGetDevCaps(lineApp,0,tapiVersion,0,lineDevCaps); //opening a line result = lineOpen(lineApp,0,&hLine,tapiVersion,0,0,LINECALLPRIVILEGE\_MONITOR,LINEMEDIAMODE\_DATAMODEM,NULL); if(result!=0) printf("\\nLINE could't be Opened..."); else printf("\\nLINE Opened...");
TapiShutDown()
void WINAPI TapiShutdown() {
result = lineShutdown(lineApp);
if (result==0)
printf("Line closed successfuly");
else
printf("something went wrong");
}and lineCallbackFunc().
VOID FAR PASCAL lineCallbackFunc(DWORD hDevice,DWORD dwMsg, DWORD Param1, DWORD Param2, DWORD Param3) {
if (dwMsg == LINE_REQUEST)
printf("incomg line...");
}In the main(), I just call these functions.
int _tmain(int argc, _TCHAR* argv[])
{
TapiInitialize();
Sleep(180000);
printf("\n\nPress any key to close line....");
getche();
TapiShutdown();
return 0;
}Where am I doing something wrong??:confused:
modified on Tuesday, September 21, 2010 1:21 PM
You can look at these : [^] http://tapifaq.pennypacker.org/tapifaq3.html[^] Answering machine(TAPI 2.1)[^] Though the answer doesn't address your issue directly .. they might give u a proper direction. -Kushagra
-
hello guys...everything seems to be fine here but when I call at my landline number it does't show me the number. TapiInitialize()
void WINAPI TapiInitialize() {
LPLINEDEVCAPS lineDevCaps = NULL; lineDevCaps = (LPLINEDEVCAPS)LocalAlloc(LPTR, 4096); //create the event first.. EventReply = CreateEvent(NULL,FALSE,FALSE,NULL); //clear the structure before the usage memset(&LineInitializeExParams,0,sizeof(LINEINITIALIZEEXPARAMS)); //populate the options LineInitializeExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS); LineInitializeExParams.dwOptions = LINEINITIALIZEEXOPTION\_USEEVENT; //call the LineInitializeEx function result = lineInitializeEx(&lineApp,NULL,(LINECALLBACK)&lineCallbackFunc,NULL,&numDevs,&tapiVersion,&LineInitializeExParams); if (result!=0) printf("TAPI could't be Initialized"); else printf("\\n\\nTAPI Initialized.."); num = numDevs; printf("\\nNumber of lines available to this app: %d",(LPWSTR)num); result = lineNegotiateAPIVersion(lineApp,0,API\_EARLY\_VERSION,API\_CURRENT\_VERSION,&tapiVersion,0); result = lineGetDevCaps(lineApp,0,tapiVersion,0,lineDevCaps); //opening a line result = lineOpen(lineApp,0,&hLine,tapiVersion,0,0,LINECALLPRIVILEGE\_MONITOR,LINEMEDIAMODE\_DATAMODEM,NULL); if(result!=0) printf("\\nLINE could't be Opened..."); else printf("\\nLINE Opened...");
TapiShutDown()
void WINAPI TapiShutdown() {
result = lineShutdown(lineApp);
if (result==0)
printf("Line closed successfuly");
else
printf("something went wrong");
}and lineCallbackFunc().
VOID FAR PASCAL lineCallbackFunc(DWORD hDevice,DWORD dwMsg, DWORD Param1, DWORD Param2, DWORD Param3) {
if (dwMsg == LINE_REQUEST)
printf("incomg line...");
}In the main(), I just call these functions.
int _tmain(int argc, _TCHAR* argv[])
{
TapiInitialize();
Sleep(180000);
printf("\n\nPress any key to close line....");
getche();
TapiShutdown();
return 0;
}Where am I doing something wrong??:confused:
modified on Tuesday, September 21, 2010 1:21 PM
-
hello guys...everything seems to be fine here but when I call at my landline number it does't show me the number. TapiInitialize()
void WINAPI TapiInitialize() {
LPLINEDEVCAPS lineDevCaps = NULL; lineDevCaps = (LPLINEDEVCAPS)LocalAlloc(LPTR, 4096); //create the event first.. EventReply = CreateEvent(NULL,FALSE,FALSE,NULL); //clear the structure before the usage memset(&LineInitializeExParams,0,sizeof(LINEINITIALIZEEXPARAMS)); //populate the options LineInitializeExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS); LineInitializeExParams.dwOptions = LINEINITIALIZEEXOPTION\_USEEVENT; //call the LineInitializeEx function result = lineInitializeEx(&lineApp,NULL,(LINECALLBACK)&lineCallbackFunc,NULL,&numDevs,&tapiVersion,&LineInitializeExParams); if (result!=0) printf("TAPI could't be Initialized"); else printf("\\n\\nTAPI Initialized.."); num = numDevs; printf("\\nNumber of lines available to this app: %d",(LPWSTR)num); result = lineNegotiateAPIVersion(lineApp,0,API\_EARLY\_VERSION,API\_CURRENT\_VERSION,&tapiVersion,0); result = lineGetDevCaps(lineApp,0,tapiVersion,0,lineDevCaps); //opening a line result = lineOpen(lineApp,0,&hLine,tapiVersion,0,0,LINECALLPRIVILEGE\_MONITOR,LINEMEDIAMODE\_DATAMODEM,NULL); if(result!=0) printf("\\nLINE could't be Opened..."); else printf("\\nLINE Opened...");
TapiShutDown()
void WINAPI TapiShutdown() {
result = lineShutdown(lineApp);
if (result==0)
printf("Line closed successfuly");
else
printf("something went wrong");
}and lineCallbackFunc().
VOID FAR PASCAL lineCallbackFunc(DWORD hDevice,DWORD dwMsg, DWORD Param1, DWORD Param2, DWORD Param3) {
if (dwMsg == LINE_REQUEST)
printf("incomg line...");
}In the main(), I just call these functions.
int _tmain(int argc, _TCHAR* argv[])
{
TapiInitialize();
Sleep(180000);
printf("\n\nPress any key to close line....");
getche();
TapiShutdown();
return 0;
}Where am I doing something wrong??:confused:
modified on Tuesday, September 21, 2010 1:21 PM
Do any of the
printf()
statements work?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
You need to open a TAPI-device before you can receive any events - use lineOpen. Most likely you will wan't to preceede that with lineNegotiateAPIVersion and lineGetDevCaps.
thanx...that really was the problem though it is still not solved but im working.