Asterisk - The Open Source Telephony Project GIT-master-f36a736
Functions
beep.h File Reference

Periodic beeps into the audio of a call. More...

#include "asterisk/optional_api.h"
Include dependency graph for beep.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int ast_beep_start (struct ast_channel *chan, unsigned int interval, char *beep_id, size_t len)
 
int ast_beep_stop (struct ast_channel *chan, const char *beep_id)
 

Detailed Description

Periodic beeps into the audio of a call.

Definition in file beep.h.

Function Documentation

◆ ast_beep_start()

int ast_beep_start ( struct ast_channel chan,
unsigned int  interval,
char *  beep_id,
size_t  len 
)

Definition at line 502 of file func_periodic_hook.c.

504{
506
507 snprintf(args, sizeof(args), "%s,%s,%u",
508 context_name, beep_exten, interval);
509
510 if (hook_read(chan, NULL, args, beep_id, len)) {
511 ast_log(LOG_WARNING, "Failed to enable periodic beep.\n");
512 return -1;
513 }
514
515 return 0;
516}
#define ast_log
Definition: astobj2.c:42
#define AST_MAX_CONTEXT
Definition: channel.h:135
#define AST_MAX_EXTENSION
Definition: channel.h:134
static int hook_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static const char context_name[]
static const char beep_exten[]
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
#define LOG_WARNING
#define NULL
Definition: resample.c:96
const char * args

References args, ast_log, AST_MAX_CONTEXT, AST_MAX_EXTENSION, beep_exten, context_name, hook_read(), len(), LOG_WARNING, and NULL.

Referenced by mixmonitor_exec().

◆ ast_beep_stop()

int ast_beep_stop ( struct ast_channel chan,
const char *  beep_id 
)

Definition at line 518 of file func_periodic_hook.c.

519{
520 return hook_write(chan, NULL, (char *) beep_id, "off");
521}
static int hook_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)

References hook_write(), and NULL.

Referenced by stop_mixmonitor_full().