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

External IVR application interface. More...

#include "asterisk.h"
#include <signal.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/linkedlists.h"
#include "asterisk/app.h"
#include "asterisk/utils.h"
#include "asterisk/tcptls.h"
#include "asterisk/astobj2.h"

Go to the source code of this file.

Data Structures

struct  ivr_localuser::finishlist
 
struct  gen_state
 
struct  ivr_localuser
 
struct  ivr_localuser::playlist
 
struct  playlist_entry
 

Macros

#define ast_chan_log(level, channel, format, ...)   ast_log(level, "%s: " format, ast_channel_name(channel) , ## __VA_ARGS__)
 
#define EIVR_CMD_ANS   'T' /* answer channel */
 
#define EIVR_CMD_APND   'A' /* append to prompt queue */
 
#define EIVR_CMD_DTMF   'D' /* send DTMF */
 
#define EIVR_CMD_EXIT   'E' /* exit */
 
#define EIVR_CMD_GET   'G' /* get channel varable(s) */
 
#define EIVR_CMD_HGUP   'H' /* hangup */
 
#define EIVR_CMD_IRPT   'I' /* interrupt */
 
#define EIVR_CMD_LOG   'L' /* log message */
 
#define EIVR_CMD_OPT   'O' /* option */
 
#define EIVR_CMD_PARM   'P' /* return supplied params */
 
#define EIVR_CMD_SQUE   'S' /* (re)set prompt queue */
 
#define EIVR_CMD_SVAR   'V' /* set channel varable(s) */
 
#define EIVR_CMD_XIT   'X' /* exit **depricated** */
 
#define EXTERNALIVR_PORT   2949
 

Enumerations

enum  options_flags { noanswer = (1 << 0), ignore_hangup = (1 << 1), run_dead = (1 << 2) }
 

Functions

static int app_exec (struct ast_channel *chan, const char *data)
 
static void ast_eivr_getvariable (struct ast_channel *chan, char *data, char *outbuf, int outbuflen)
 
static void ast_eivr_senddtmf (struct ast_channel *chan, char *vdata)
 
static void ast_eivr_setvariable (struct ast_channel *chan, char *data)
 
 AST_MODULE_INFO_STANDARD_EXTENDED (ASTERISK_GPL_KEY,"External IVR Interface Application")
 
static int eivr_comm (struct ast_channel *chan, struct ivr_localuser *u, struct ast_iostream *eivr_events, struct ast_iostream *eivr_commands, struct ast_iostream *eivr_errors, const struct ast_str *args, const struct ast_flags flags)
 
static void * gen_alloc (struct ast_channel *chan, void *params)
 
static void gen_closestream (struct gen_state *state)
 
static int gen_generate (struct ast_channel *chan, void *data, int len, int samples)
 
static int gen_nextfile (struct gen_state *state)
 
static struct ast_framegen_readframe (struct gen_state *state)
 
static void gen_release (struct ast_channel *chan, void *data)
 
static int load_module (void)
 
static struct playlist_entrymake_entry (const char *filename)
 
static void send_eivr_event (struct ast_iostream *stream, const char event, const char *data, const struct ast_channel *chan)
 
static int unload_module (void)
 

Variables

static const char app [] = "ExternalIVR"
 
static const struct ast_app_option app_opts [128] = { [ 'n' ] = { .flag = noanswer }, [ 'i' ] = { .flag = ignore_hangup }, [ 'd' ] = { .flag = run_dead }, }
 
static struct ast_generator gen
 

Detailed Description

External IVR application interface.

Author
Kevin P. Fleming kpfle.nosp@m.ming.nosp@m.@digi.nosp@m.um.c.nosp@m.om
Note
Portions taken from the file-based music-on-hold work created by Anthony Minessale II in res_musiconhold.c

Definition in file app_externalivr.c.