56 static char *app =
"WaitForRing";
58 static int waitforring_exec(
struct ast_channel *chan,
const char *data)
68 if (!data || (sscanf(data,
"%30lg", &s) != 1)) {
69 ast_log(LOG_WARNING,
"WaitForRing requires an argument (minimum seconds)\n");
74 ast_log(LOG_WARNING,
"Invalid timeout provided for WaitForRing (%lg)\n", s);
78 if (ast_opt_transmit_silence) {
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");
131 static int unload_module(
void)
136 static int load_module(
void)
141 AST_MODULE_INFO_STANDARD_EXTENDED(
ASTERISK_GPL_KEY,
"Waits until first ring after time");
Main Channel structure associated with a channel.
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().
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.
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.
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
Data structure associated with a single frame of 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.