Voice API Programming Guide — June 2005 171
Global Dial Pulse Detection
Global DPD must be implemented on a call-by-call basis. Global DPD uses the dx_setdigtyp( )
function to enable DPD. See the Voice API Library Reference for information on all functions and
data structures described in this chapter.
For any digit detected, you can determine the digit type such as DTMF or DPD by using the
DV_DIGIT data structure in the application. When a dx_getdig() or dx_getdigEx( ) function call
is performed, the digits are collected from the firmware and transferred to the user’s digit buffer.
The digits are stored as an array inside the DV_DIGIT structure.
You then use a pointer to the structure that contains a digit buffer. For an example, see
Section 14.10, “Global DPD Example Code”, on page 173. This method allows you to determine
very quickly whether a pulse or DTMF telephone is being used.
14.4 Global DPD Programming ConsiderationsThe global DPD algorithm will accurately detect digits in the supported regions without requesting
a special training digit from the caller or requiring any other restrictions on the application.
However, observe the following considerations when designing the application:
•Talk-off rejection (the ability of the algorithm to distinguish between dial pulses and the
human voice) will improve after the first digit is detected.
•Digit detection will be slightly more accurate (about 2%) after detecting a digit of 5 or greater.
It is not necessary to dial a special training digit to do this. The application may simply restrict
the first menu to digits 5, 6, 7, 8, 9, and 0, and the training will be complete. Subsequent menus
may be unrestricted.
•In general, detection accuracy is greater for higher digits than for lower. While detection
accuracy is very high, it may be further improved by restricting menu selections, whenever
convenient, to digits greater than 3.
14.5 Retrieving Digits from the Digit BufferTo get the digits from the digit buffer, use the following synchronous programming model:
1. Define a data structure of type DV_DIGIT (the DV_DIGIT structure is defined by including
the dxxxlib.h header file).
2. Enable DPD on the desired channels using the dx_setdigtyp( ) function.
3. For each new connection, use dx_setdigtyp( ) with the D_DPDZ mask, which initializes the
DPD algorithm. After collecting the first DPD digit string, the mask can be set to D_DPD for
the remainder of that connection. Each subsequent invocation of dx_setdigtyp() must use the
D_DPD mask.
4. Execute the dx_getdig( ) function to collect and transfer the digits to the user’s digit buffer.
The digits are stored in the dg_value field of the DV_DIGIT structure. The corresponding digit
types (dial pulse, DTMF, and so on) are stored in the dg_type field of the DV_DIGIT structure.
For more information, see the DV_DIGIT structure in the Voice API Library Reference.