Intel 05-1832-002 IP Phone User Manual


 
492 Voice API for Windows Operating Systems Library Reference — November 2003
DV_TPT — termination parameter table
!
!!
! Example
This section provides an example of how to use DX_PMOFF and DX_PMON.
The DX_PMOFF and DX_PMON termination conditions must be used in tandem. The
DX_PMON termination condition must directly follow the DX_PMOFF termination condition.
Each condition is specified in a DV_TPT structure. A combination of both DV_TPT structures is
used to form a single termination condition.
In the first block of the example code below, tp_termno is set to DX_PMOFF. The tp_length holds
the number of patterns before termination. tp_flags holds the minimum time for silence off while
tp_data holds the maximum time for silence off. In the next DV_TPT structure, tp_termno is
DX_PMON, and the tp_length field holds the flag bit mask. Only the “units” bit is valid; all other
bits must be 0. The tp_flags field holds the minimum time for silence on, while tp_data holds the
maximum time for silence on.
#include <srllib.h>
#include <dxxxlib.h>
DV_TPT tpt[2];
/*
* detect a pattern which repeats 4 times of approximately 2 seconds
* off 2 seconds on.
*/
tpt[0].
tp_type
= IO_CONT; /* next entry is contiguous */
tpt[0].
tp_termno
= DX_PMOFF; /* specify pattern match off */
tpt[0].
tp_length
= 4; /* terminate if pattern repeats 4 times */
tpt[0].
tp_flags
= 175; /* minimum silence off is 1.75 seconds
* (10 msec units) */
tpt[0].
tp_data
= 225; /* maximum silence off is 2.25 seconds
* (10 msec units) */
tpt[1].
tp_type
= IO_EOT; /* This is the last in the chain */
tpt[1].
tp_termno
= DX_PMON; /* specify pattern match on */
tpt[1].
tp_length
= TF_10MS; /* use 10 msec timer units */
tpt[1].
tp_flags
= 175; /* minimum silence on is 1.75 seconds
* (10 msec units) */
tpt[1].
tp_data
= 225; /* maximum silence on is 2.25 seconds
* (10 msec units) */
/* issue the function */