My source code:
HPHONEAPP hPhoneApp = 1;
DWORD dwNumDevs = 1;
HLINEAPP hLineApp = 1;
USES_CONVERSION;
LONG nRes = lineInitialize( &hLineApp, 0, &PhoneCallBackFunc, "TAPI SoftPhoneX", &dwNumDevs );
DWORD dwAPIVersion = 0x00000000;
int nDevice = 0;
for( DWORD i=0; i<dwNumDevs; i++ )
{
LINEEXTENSIONID ExtensionID;
nRes = lineNegotiateAPIVersion( hLineApp, nDevice, 0x00000000, 0x00020002, &dwAPIVersion, &ExtensionID );
DWORD dwLineExVersion = 0;
nRes = lineNegotiateExtVersion( hLineApp, nDevice, dwAPIVersion, 0x0000000, 0xFFFFFFFF, &dwLineExVersion );
LINEDEVCAPS *lpDevCaps = (LINEDEVCAPS *)malloc(sizeof(LINEDEVCAPS)+1000);
memset(lpDevCaps, 0, sizeof(LINEDEVCAPS)+1000);
lpDevCaps->dwTotalSize = sizeof(LINEDEVCAPS)+1000;
bool bDone = FALSE;
do
{
nRes = lineGetDevCaps(hLineApp, i, dwAPIVersion, 0, lpDevCaps);
if(lpDevCaps->dwNeededSize > lpDevCaps->dwTotalSize)
lpDevCaps = (LINEDEVCAPS *)realloc(lpDevCaps, lpDevCaps->dwNeededSize);
else bDone = TRUE;
}
while (!bDone);
if(!strcmp((char*)((DWORD)lpDevCaps+(DWORD)lpDevCaps->dwLineNameOffset), "DEFINITY/Line"))
{
nDevice=i;
break;
}
}
nRes = lineOpen( hLineApp, nDevice, &g_hLine, dwAPIVersion, 0, NULL, LINECALLPRIVILEGE_OWNER, LINEMEDIAMODE_INTERACTIVEVOICE, 0 );
nRes = phoneInitialize( &hPhoneApp, 0, &PhoneCallBackFunc, "TAPI SoftPhoneX", &dwNumDevs );
nDevice = 0;
DWORD dwPhoneAPIVersion = 0;
PHONEEXTENSIONID PhoneExtensionID;
nRes = phoneNegotiateAPIVersion( hPhoneApp, nDevice, 0x00000000, 0xFFFFFFFF, &dwPhoneAPIVersion, &PhoneExtensionID );
DWORD dwPhoneExtVersion = 0;
phoneNegotiateExtVersion( hPhoneApp, nDevice, dwPhoneAPIVersion, 0x00000000, 0xFFFFFFFF, &dwPhoneExtVersion );
nRes = phoneOpen( hPhoneApp, 0, &g_hPhone, dwAPIVersion, 0, NULL, PHONEPRIVILEGE_OWNER );
nRes = lineDevSpecificFeature( g_hLine, 0x9000008d, 0, 0 );
Compiled success, but LINE_REPLY message return LINEERR_OPERATIONUNAVAIL = 0x80000049.
Please, help me ! What wrong ?
HPHONEAPP hPhoneApp = 1;
DWORD dwNumDevs = 1;
HLINEAPP hLineApp = 1;
USES_CONVERSION;
LONG nRes = lineInitialize( &hLineApp, 0, &PhoneCallBackFunc, "TAPI SoftPhoneX", &dwNumDevs );
DWORD dwAPIVersion = 0x00000000;
int nDevice = 0;
for( DWORD i=0; i<dwNumDevs; i++ )
{
LINEEXTENSIONID ExtensionID;
nRes = lineNegotiateAPIVersion( hLineApp, nDevice, 0x00000000, 0x00020002, &dwAPIVersion, &ExtensionID );
DWORD dwLineExVersion = 0;
nRes = lineNegotiateExtVersion( hLineApp, nDevice, dwAPIVersion, 0x0000000, 0xFFFFFFFF, &dwLineExVersion );
LINEDEVCAPS *lpDevCaps = (LINEDEVCAPS *)malloc(sizeof(LINEDEVCAPS)+1000);
memset(lpDevCaps, 0, sizeof(LINEDEVCAPS)+1000);
lpDevCaps->dwTotalSize = sizeof(LINEDEVCAPS)+1000;
bool bDone = FALSE;
do
{
nRes = lineGetDevCaps(hLineApp, i, dwAPIVersion, 0, lpDevCaps);
if(lpDevCaps->dwNeededSize > lpDevCaps->dwTotalSize)
lpDevCaps = (LINEDEVCAPS *)realloc(lpDevCaps, lpDevCaps->dwNeededSize);
else bDone = TRUE;
}
while (!bDone);
if(!strcmp((char*)((DWORD)lpDevCaps+(DWORD)lpDevCaps->dwLineNameOffset), "DEFINITY/Line"))
{
nDevice=i;
break;
}
}
nRes = lineOpen( hLineApp, nDevice, &g_hLine, dwAPIVersion, 0, NULL, LINECALLPRIVILEGE_OWNER, LINEMEDIAMODE_INTERACTIVEVOICE, 0 );
nRes = phoneInitialize( &hPhoneApp, 0, &PhoneCallBackFunc, "TAPI SoftPhoneX", &dwNumDevs );
nDevice = 0;
DWORD dwPhoneAPIVersion = 0;
PHONEEXTENSIONID PhoneExtensionID;
nRes = phoneNegotiateAPIVersion( hPhoneApp, nDevice, 0x00000000, 0xFFFFFFFF, &dwPhoneAPIVersion, &PhoneExtensionID );
DWORD dwPhoneExtVersion = 0;
phoneNegotiateExtVersion( hPhoneApp, nDevice, dwPhoneAPIVersion, 0x00000000, 0xFFFFFFFF, &dwPhoneExtVersion );
nRes = phoneOpen( hPhoneApp, 0, &g_hPhone, dwAPIVersion, 0, NULL, PHONEPRIVILEGE_OWNER );
nRes = lineDevSpecificFeature( g_hLine, 0x9000008d, 0, 0 );
Compiled success, but LINE_REPLY message return LINEERR_OPERATIONUNAVAIL = 0x80000049.
Please, help me ! What wrong ?