Asterisk - The Open Source Telephony Project  21.4.1
Data Structures | Macros | Functions | Variables
pbx_builtins.c File Reference

Core PBX builtin routines. More...

#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/pbx.h"
#include "asterisk/causes.h"
#include "asterisk/indications.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/say.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
#include "asterisk/conversions.h"
#include "pbx_private.h"

Go to the source code of this file.

Data Structures

struct  pbx_builtin
 Declaration of builtin applications. More...
 

Macros

#define BACKGROUND_MATCHEXTEN   (1 << 2)
 
#define BACKGROUND_NOANSWER   (1 << 1)
 
#define BACKGROUND_PLAYBACK   (1 << 3)
 
#define BACKGROUND_SKIP   (1 << 0)
 
#define WAITEXTEN_DIALTONE   (1 << 1)
 
#define WAITEXTEN_MOH   (1 << 0)
 

Functions

int indicate_busy (struct ast_channel *chan, const char *data)
 
int indicate_congestion (struct ast_channel *chan, const char *data)
 
int load_pbx_builtins (void)
 
static int pbx_builtin_answer (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_background (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_execiftime (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_goto (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_gotoif (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_gotoiftime (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_hangup (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_incomplete (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_noop (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_proceeding (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_progress (struct ast_channel *chan, const char *data)
 
int pbx_builtin_raise_exception (struct ast_channel *chan, const char *reason)
 
static int pbx_builtin_ringing (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_saycharacters (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_saycharacters_case (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_saydigits (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_saymoney (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_saynumber (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_sayordinal (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_sayphonetic (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_wait (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_waitdigit (struct ast_channel *chan, const char *data)
 
static int pbx_builtin_waitexten (struct ast_channel *chan, const char *data)
 
static int permit_dtmf_interrupt (struct ast_channel *chan)
 Determine if DTMF interruption was requested. More...
 
static void unload_pbx_builtins (void)
 

Variables

static const struct ast_app_option background_opts [128] = { [ 's' ] = { .flag = (1 << 0) }, [ 'n' ] = { .flag = (1 << 1) }, [ 'm' ] = { .flag = (1 << 2) }, [ 'p' ] = { .flag = (1 << 3) }, }
 
struct pbx_builtin builtins []
 
static const struct ast_app_option waitexten_opts [128] = { [ 'm' ] = { .flag = (1 << 0) , .arg_index = 0 + 1 }, [ 'd' ] = { .flag = (1 << 1) , .arg_index = 0 + 1 }, }
 

Detailed Description

Core PBX builtin routines.

Author
George Joseph georg.nosp@m.e.jo.nosp@m.seph@.nosp@m.fair.nosp@m.view5.nosp@m..com

Definition in file pbx_builtins.c.

Function Documentation

int load_pbx_builtins ( void  )

Provided by pbx_builtins.c

Definition at line 1506 of file pbx_builtins.c.

References ast_register_application2(), ast_register_cleanup(), execute(), and ast_channel::name.

1507 {
1508  int x;
1509 
1510  /* Register builtin applications */
1511  for (x = 0; x < ARRAY_LEN(builtins); x++) {
1512  if (ast_register_application2(builtins[x].name, builtins[x].execute, NULL, NULL, NULL)) {
1513  ast_log(LOG_ERROR, "Unable to register builtin application '%s'\n", builtins[x].name);
1514  return -1;
1515  }
1516  }
1517 
1518  ast_register_cleanup(unload_pbx_builtins);
1519 
1520  return 0;
1521 }
static SQLHSTMT execute(struct odbc_obj *obj, void *data, int silent)
Common execution function for SQL queries.
Definition: func_odbc.c:471
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
Definition: clicompat.c:19
int ast_register_application2(const char *app, int(*execute)(struct ast_channel *, const char *), const char *synopsis, const char *description, void *mod)
Register an application.
Definition: pbx_app.c:103
static int permit_dtmf_interrupt ( struct ast_channel chan)
static

Determine if DTMF interruption was requested.

If the SAY_DTMF_INTERRUPT channel variable is truthy, the caller has requested DTMF interruption be enabled.

Parameters
chanthe channel to examine
Return values
-1if DTMF interruption was requested
0if DTMF interruption was not requested

Definition at line 1280 of file pbx_builtins.c.

References ast_true(), and pbx_builtin_getvar_helper().

1281 {
1282  int interrupt;
1283 
1284  ast_channel_lock(chan);
1285  interrupt = ast_true(pbx_builtin_getvar_helper(chan, "SAY_DTMF_INTERRUPT"));
1286  ast_channel_unlock(chan);
1287 
1288  return interrupt;
1289 }
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
Definition: utils.c:2199