aboutsummaryrefslogtreecommitdiffstats
path: root/include/dtmf_scheduler.h
blob: a90246685419279866007c18003939f53cc39e09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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);

unsigned int dtmf_tones_queued(struct dtmf_state *state);

#endif