| Flavio Oliveira 2006-01-19, 8:04 am |
| I´m using a little app that uses a call back function to intercept when the
user
inform the dial number (cdial.exe it's running) and press send key.
I can intercept and get the number dialed, no problems
but now I need to get the handle for this line and then I need drop/close
this call.
Somebody have any idea to how I get the handle of this line inside my
callback function to drop this current call using the TAPI functions ?
Callback function used:
// Callback function that is called when the bit indicating a call is being
made changes
void PhoneCallCallingCallback(HREGNOTIFY hNotify, DWORD dwUserData, const
PBYTE pData, const UINT cbData)
{
TCHAR PhoneCallCallingStr[MAX_PATH];
switch(dwUserData)
{
case PhoneStatus:
{
lineClose((HLINE)hNotify);
LONG g_DropCallRequestID = lineDrop((HCALL)hNotify, NULL,0);
}
//StringCchPrintf(PhoneCallCallingStr, MAX_PATH, _T("Called Number is
%s"), (TCHAR*)pData);
break;
case CallerNumber:
{
StringCchPrintf(PhoneCallCallingStr, MAX_PATH, _T("O número discado foi:
%s"), (TCHAR*)pData);
// Se o ponteiro estiver nullo não executa ação com o número encontrado
if(pData != 0)
MessageBox(NULL,PhoneCallCallingStr,TEXT
("Called Number"),0);
}
break;
default:
break;
}
}
|