56 static 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");
Main Channel structure associated with a channel.
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Waits until first ring after time")
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define ast_opt_transmit_silence
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_verb(level,...)
struct ast_frame_subclass subclass
General Asterisk PBX channel definitions.
Core PBX routines and definitions.
struct ast_silence_generator * ast_channel_start_silence_generator(struct ast_channel *chan)
Starts a silence generator on the given channel.
int ast_remaining_ms(struct timeval start, int max_ms)
Calculate remaining milliseconds given a starting timestamp and upper bound.
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.
static int load_module(void)
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
static int unload_module(void)
Data structure associated with a single frame of data.
static int waitforring_exec(struct ast_channel *chan, const char *data)
enum ast_frame_type frametype
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.