Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ReadDTMF Class Reference

Call Module for waiting for DTMF signals. More...

#include <readDTMF.h>

Inheritance diagram for ReadDTMF:

CallModule CallInterface List of all members.

Public Member Functions

 ReadDTMF (Connection *conn, int timeout, int min_digits, int max_digits)
 Constructor. Create Object and read the current digit count from Connection.
void mainLoop () throw (CapiWrongState)
 mainLoop: Waits until the given conditions (see constructor) have been fulfilled
void gotDTMF ()
 finish if max_digits is reached, otherwise restart timeout when DTMF signal is received

Private Attributes

int digit_count
 save the current number of digits in receive buffer
int min_digits
 save min_digits parameter
int max_digits
 save max_digits parameter

Detailed Description

Call Module for waiting for DTMF signals.

This module allows the user to specify how much DTMF digits he wants to read and how long to wait for them. It doesn't do the actual read, just waits for the given conditions to be fulfilled.

To use it, create an object and call mainLoop(). After mainLoop() finished, call Connection::getDTMF() to read the received signals.

Author:
Gernot Hillier


Constructor & Destructor Documentation

ReadDTMF::ReadDTMF Connection conn,
int  timeout,
int  min_digits,
int  max_digits
 

Constructor. Create Object and read the current digit count from Connection.

Parameters:
conn reference to Connection object
timeout timeout in seconds after which reading is terminated (only terminates when min_digits are reached!), restarts after each digit
min_digits minimum number of digits which must be read in ANY case without respect to timout. Only set to value >0 if you're sure the user will input a digit.
max_digits maximum number of digits to read, we abort immediately if this number is reached (0=infinite, only timeout counts)


Member Function Documentation

void ReadDTMF::gotDTMF  )  [virtual]
 

finish if max_digits is reached, otherwise restart timeout when DTMF signal is received

Reimplemented from CallModule.

void ReadDTMF::mainLoop  )  throw (CapiWrongState) [virtual]
 

mainLoop: Waits until the given conditions (see constructor) have been fulfilled

The module will finish if one of these conditions are true:

  • max_digits is fulfilled
  • timeout was reached AND min_digits is fulfilled

Exceptions:
CapiWrongState Thrown if disconnection is recognized

Reimplemented from CallModule.


Member Data Documentation

int ReadDTMF::digit_count [private]
 

save the current number of digits in receive buffer

int ReadDTMF::max_digits [private]
 

save max_digits parameter

int ReadDTMF::min_digits [private]
 

save min_digits parameter


The documentation for this class was generated from the following files:
Generated on Sun Nov 28 14:37:45 2004 for CapiSuite by doxygen 1.3.8