mpf_dtmf_generator.h File Reference
DTMF generator.
More...
#include "apr_pools.h"
#include "apt.h"
#include "mpf_frame.h"
#include "mpf_stream.h"
Go to the source code of this file.
Detailed Description
DTMF generator.
Generator used to send DTMF tones. Capable to send digits either in-band as audible tones or out-of-band according to RFC4733.
Typedef Documentation
Opaque MPF DTMF generator structure definition
Enumeration Type Documentation
DTMF generator band
- Enumerator:
MPF_DTMF_GENERATOR_INBAND |
Generate tones in-band
|
MPF_DTMF_GENERATOR_OUTBAND |
Generate named events out-of-band
|
MPF_DTMF_GENERATOR_BOTH |
Generate both tones and named events
|
Function Documentation
Create MPF DTMF generator (advanced).
- Parameters:
-
| stream | A stream to transport digits via. |
| band | MPF_DTMF_GENERATOR_INBAND or MPF_DTMF_GENERATOR_OUTBAND |
| tone_ms | Tone duration in milliseconds. |
| silence_ms | Inter-digit silence in milliseconds. |
| pool | Memory pool to allocate DTMF generator from. |
- Returns:
- The object or NULL on error.
- See also:
- mpf_dtmf_generator_create
Free all resources associated with the generator.
- Parameters:
-
Add DTMF digits to the queue.
- Parameters:
-
| generator | The generator. |
| digits | DTMF character sequence [0-9*A-D]. |
- Returns:
- TRUE if ok, FALSE if there are too many digits.
Put frame into the stream.
- Parameters:
-
| generator | The generator. |
| frame | Frame object passed in stream_read(). |
- Returns:
- TRUE if frame with tone (both in-band and out-of-band) was generated, FALSE otherwise. In contrast to mpf_dtmf_generator_sending, returns FALSE even if generating inter-digit silence. In other words returns TRUE iff the frame object was filled with data. This method MUST be called for each frame for proper timing.
Empty the queue and immediately stop generating.
- Parameters:
-
Check state of the generator.
- Parameters:
-
- Returns:
- TRUE if generating a digit or there are digits waiting in queue. FALSE if the queue is empty or generating silence after the last digit.