FelixAlcala
23rd January 2007, 11:16 PM
I'd like to write an app that can send DTMF-tones during active voice calls. (Purpose: simplify usage of automated dialogs like "to listen to your messages, press 1. To do X, press 2", and so on)
I’m using lineGenerateDigits for this, but somehow it won’t work. This is my function:
long testSendTones() {
DWORD dwDigitMode = LINEDIGITMODE_DTMF;
DWORD dwDuration = 600;
LPCWSTR tone = TEXT("2"); // I’m not sure if this is correct
if (!g_hCall) {
// Error with the call
return -1;
}
long result = lineGenerateDigits(g_hCall, dwDigitMode, tone, dwDuration);
if (result) {
//error with digit gerneration
} else {
// everything ok
}
return result;
}
The result is that I don’t get an error (i,e. lineGenerateDigits returns 0), but I don’t get a tone either. The event “LINE_GENERATE” (is to get called after the tone is sent) is also triggered. So technically it all looks fine, but it just does not send the tone. I changed the tone duration to 0 and several other values, but it did not work.
Changing the digitmode to LINEDIGITMODE_DTMFEND yields a return value of 0x80000026 (LINEERR_INVALDIGITLIST), and produces no tone either.
Any suggestions? Any advice or idea is greatly appreciated.
I’m using lineGenerateDigits for this, but somehow it won’t work. This is my function:
long testSendTones() {
DWORD dwDigitMode = LINEDIGITMODE_DTMF;
DWORD dwDuration = 600;
LPCWSTR tone = TEXT("2"); // I’m not sure if this is correct
if (!g_hCall) {
// Error with the call
return -1;
}
long result = lineGenerateDigits(g_hCall, dwDigitMode, tone, dwDuration);
if (result) {
//error with digit gerneration
} else {
// everything ok
}
return result;
}
The result is that I don’t get an error (i,e. lineGenerateDigits returns 0), but I don’t get a tone either. The event “LINE_GENERATE” (is to get called after the tone is sent) is also triggered. So technically it all looks fine, but it just does not send the tone. I changed the tone duration to 0 and several other values, but it did not work.
Changing the digitmode to LINEDIGITMODE_DTMFEND yields a return value of 0x80000026 (LINEERR_INVALDIGITLIST), and produces no tone either.
Any suggestions? Any advice or idea is greatly appreciated.