diff options
Diffstat (limited to 'include/dtmf_scheduler.h')
-rw-r--r-- | include/dtmf_scheduler.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/dtmf_scheduler.h b/include/dtmf_scheduler.h new file mode 100644 index 0000000..22a4e55 --- /dev/null +++ b/include/dtmf_scheduler.h @@ -0,0 +1,25 @@ +#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 */ +void dtmf_state_get_pending(struct dtmf_state *state, char *tones); + +/* call when the playout is done */ +void dtmf_state_played(struct dtmf_state *state); + +#endif |