This function can be used to send DTMF tones.
DWORD NetworkTransmitDTMF(
LPCWSTR pwszDTMF
);
Parameters
pwszDTMF
[in] Pointer to a null-terminated character buffer that contains the digits to be generated. Valid digits are zero (0) through 9, '*', '#', 'A', 'B', 'C', and 'D'.
In addition, ',' (comma) is also a valid character.
A comma injects an extra delay between the signaling of the previous and next digits it separates.
The duration of this pause is configuration defined, and the line's device capabilities indicate what this duration is.
Multiple commas can be used to inject longer pauses. Invalid digits are ignored during the generation, rather than being reported as errors.
'!' (exclamation) is a valid character. This character causes a hookflash operation, as described for dialable addresses.
Return values
Zero indicates success. A negative error number indicates that an error occurred. For additional error information, enable the library debug mode.
Remarks
In contrast to the NetworkDialNumber function, which dials digits in a network-dependent fashion,
NetworkTransmitDTMF guarantees to produce the digits as inband tones over the voice channel using DTMF or hookswitch dial pulses when using pulse.
The NetworkTransmitDTMF function is generally not suitable for making calls or dialing. It is intended for end-to-end signaling over an established call.
Sample
// Application entry point
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// Load the TAPI Library
if (LoadDynTapiDll(TEXT("\\DynTapiDll.dll")) != ERROR_SUCCESS) {
MessageBox(0, TEXT("Cannot load DynTapiDll.dll . Try to reinstall this sample."), TEXT(""), MB_ICONERROR);
return 0;
}
DebugMode(1);
// Init the Library network component
if (NetworkInit(hInstance) != ERROR_SUCCESS) {
UnloadDynTapiDll();
MessageBox(0, TEXT("Error using the network, does this device have a phone module?"), TEXT(""), MB_ICONERROR);
return 0;
}
// Set callback for events
SetNetworkEventCallback((tpfnCallback)PhoneCallback);
// Try dialing a number
if (NetworkDialNumber(TEXT("555111222"))!=ERROR_SUCCESS) MessageBox(0,TEXT("Can't dial number"), TEXT(""),MB_ICONERROR);
else {
Sleep(10000); //wait for the call to connect
NetworkTransmitDTMF(TEXT("123"));
}
...
NetworkDeinit();
UnloadDynTapiDll();
...
Requirements
OS Versions: Windows CE 1.0 and later.
Header: dyntapi.h.
Dll Library: dyntapidll.dll.