This repository has been archived on 2022-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
2012-11-29 20:41:01 +00:00
|
|
|
#ifndef DTMF_SCHEDULER_H
|
|
|
|
#define DTMF_SCHEDULER_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The state/queue for DTMF signalling.
|
|
|
|
*/
|
|
|
|
struct dtmf_state {
|
|
|
|
int size; /* <! The last tone to play */
|
|
|
|
char tones[24]; /* <! Pending tones */
|
|
|
|
int playing; /* <! Playing a tone right now? */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* initialize */
|
|
|
|
void dtmf_state_init(struct dtmf_state *state);
|
|
|
|
|
|
|
|
/* add a tone to the list */
|
|
|
|
int dtmf_state_add(struct dtmf_state *state, char tone);
|
|
|
|
|
|
|
|
/* tones that should be played, playing will be set to 1 */
|
2013-05-21 15:16:24 +00:00
|
|
|
unsigned int dtmf_state_get_pending(struct dtmf_state *state, char *tones);
|
2012-11-29 20:41:01 +00:00
|
|
|
|
|
|
|
/* call when the playout is done */
|
|
|
|
void dtmf_state_played(struct dtmf_state *state);
|
|
|
|
|
2013-05-21 15:14:12 +00:00
|
|
|
unsigned int dtmf_tones_queued(struct dtmf_state *state);
|
|
|
|
|
2012-11-29 20:41:01 +00:00
|
|
|
#endif
|