56static char *
app =
"WaitForRing";
68 if (!data || (sscanf(data,
"%30lg", &s) != 1)) {
82 timeout_ms = s * 1000.0;
96 ast_verb(3,
"Got a ring but still waiting for timeout\n");
115 ast_verb(3,
"Got a ring after the timeout\n");
static int waitforring_exec(struct ast_channel *chan, const char *data)
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Waits until first ring after time")
static int load_module(void)
static int unload_module(void)
Asterisk main include file. File version handling, generic pbx functions.
General Asterisk PBX channel definitions.
struct ast_silence_generator * ast_channel_start_silence_generator(struct ast_channel *chan)
Starts a silence generator on the given channel.
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
void ast_channel_stop_silence_generator(struct ast_channel *chan, struct ast_silence_generator *state)
Stops a previously-started silence generator on the given channel.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
Generic File Format Support. Should be included by clients of the file handling routines....
#define ast_verb(level,...)
Asterisk locking-related definitions:
Asterisk module definitions.
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define ast_opt_transmit_silence
Core PBX routines and definitions.
Main Channel structure associated with a channel.
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
enum ast_frame_type frametype
int ast_remaining_ms(struct timeval start, int max_ms)
Calculate remaining milliseconds given a starting timestamp and upper bound.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().