mpf_dtmf_detector.h File Reference

DTMF detector. More...

#include "apr.h"
#include "apr_pools.h"
#include "apt.h"
#include "mpf_frame.h"
#include "mpf_stream.h"

Go to the source code of this file.

Typedefs

typedef struct mpf_dtmf_detector_t mpf_dtmf_detector_t

Enumerations

enum  mpf_dtmf_detector_band_e { MPF_DTMF_DETECTOR_INBAND = 0x1, MPF_DTMF_DETECTOR_OUTBAND = 0x2, MPF_DTMF_DETECTOR_BOTH = MPF_DTMF_DETECTOR_INBAND | MPF_DTMF_DETECTOR_OUTBAND }

Functions

struct mpf_dtmf_detector_tmpf_dtmf_detector_create_ex (const struct mpf_audio_stream_t *stream, enum mpf_dtmf_detector_band_e band, struct apr_pool_t *pool)
char mpf_dtmf_detector_digit_get (struct mpf_dtmf_detector_t *detector)
apr_size_t mpf_dtmf_detector_digits_lost (const struct mpf_dtmf_detector_t *detector)
void mpf_dtmf_detector_reset (struct mpf_dtmf_detector_t *detector)
void mpf_dtmf_detector_get_frame (struct mpf_dtmf_detector_t *detector, const struct mpf_frame_t *frame)
void mpf_dtmf_detector_destroy (struct mpf_dtmf_detector_t *detector)

Detailed Description

DTMF detector.

Detector of DTMF tones sent both out-of-band (RFC4733) and in-band (audio).


Typedef Documentation

Opaque MPF DTMF detector structure definition


Enumeration Type Documentation

DTMF detector band

Enumerator:
MPF_DTMF_DETECTOR_INBAND 

Detect tones in-band

MPF_DTMF_DETECTOR_OUTBAND 

Detect named events out-of-band

MPF_DTMF_DETECTOR_BOTH 

Detect both in-band and out-of-band digits


Function Documentation

struct mpf_dtmf_detector_t* mpf_dtmf_detector_create_ex ( const struct mpf_audio_stream_t stream,
enum mpf_dtmf_detector_band_e  band,
struct apr_pool_t *  pool 
) [read]

Create MPF DTMF detector (advanced).

Parameters:
stream A stream to get digits from.
band One of:

  • MPF_DTMF_DETECTOR_INBAND: detect audible tones only
  • MPF_DTMF_DETECTOR_OUTBAND: detect out-of-band named-events only
  • MPF_DTMF_DETECTOR_BOTH: detect digits in both bands if supported by stream. When out-of-band digit arrives, in-band detection is turned off.
pool Memory pool to allocate DTMF detector from.
Returns:
The object or NULL on error.
See also:
mpf_dtmf_detector_create
void mpf_dtmf_detector_destroy ( struct mpf_dtmf_detector_t detector  ) 

Free all resources associated with the detector.

Parameters:
detector The detector.
char mpf_dtmf_detector_digit_get ( struct mpf_dtmf_detector_t detector  ) 

Get DTMF digit from buffer of digits detected so far and remove it.

Parameters:
detector The detector.
Returns:
DTMF character [0-9*A-D] or NUL if the buffer is empty.
apr_size_t mpf_dtmf_detector_digits_lost ( const struct mpf_dtmf_detector_t detector  ) 

Retrieve how many digits was lost due to full buffer.

Parameters:
detector The detector.
Returns:
Number of lost digits.
void mpf_dtmf_detector_get_frame ( struct mpf_dtmf_detector_t detector,
const struct mpf_frame_t frame 
)

Detect DTMF digits in the frame.

Parameters:
detector The detector.
frame Frame object passed in stream_write().
void mpf_dtmf_detector_reset ( struct mpf_dtmf_detector_t detector  ) 

Empty the buffer and reset detection states.

Parameters:
detector The detector.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 25 Mar 2013 for UniMRCP by  doxygen 1.6.1