Beispiel #1
0
			<xi:include xpointer="xpointer(/docs/application[@name='Macro']/description/warning[2])" />
		</description>
		<see-also>
			<ref type="application">Background</ref>
			<ref type="function">TIMEOUT</ref>
		</see-also>
	</application>
 ***/

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

AST_APP_OPTIONS(background_opts, {
	AST_APP_OPTION('s', BACKGROUND_SKIP),
	AST_APP_OPTION('n', BACKGROUND_NOANSWER),
	AST_APP_OPTION('m', BACKGROUND_MATCHEXTEN),
	AST_APP_OPTION('p', BACKGROUND_PLAYBACK),
});

#define WAITEXTEN_MOH		(1 << 0)
#define WAITEXTEN_DIALTONE	(1 << 1)

AST_APP_OPTIONS(waitexten_opts, {
	AST_APP_OPTION_ARG('m', WAITEXTEN_MOH, 0),
	AST_APP_OPTION_ARG('d', WAITEXTEN_DIALTONE, 0),
});

int pbx_builtin_raise_exception(struct ast_channel *chan, const char *reason)
{
Beispiel #2
0
			</enumlist>
			<para>Example: exten => 1,1,Set(CDR(userfield)=test)</para>
		</description>
	</function>
 ***/

enum cdr_option_flags {
	OPT_RECURSIVE = (1 << 0),
	OPT_UNPARSED = (1 << 1),
	OPT_LAST = (1 << 2),
	OPT_SKIPLOCKED = (1 << 3),
	OPT_FLOAT = (1 << 4),
};

AST_APP_OPTIONS(cdr_func_options, {
	AST_APP_OPTION('f', OPT_FLOAT),
	AST_APP_OPTION('l', OPT_LAST),
	AST_APP_OPTION('r', OPT_RECURSIVE),
	AST_APP_OPTION('s', OPT_SKIPLOCKED),
	AST_APP_OPTION('u', OPT_UNPARSED),
});

static int cdr_read(struct ast_channel *chan, const char *cmd, char *parse,
		    char *buf, size_t len)
{
	char *ret;
	struct ast_flags flags = { 0 };
	struct ast_cdr *cdr = chan ? chan->cdr : NULL;
	AST_DECLARE_APP_ARGS(args,
			     AST_APP_ARG(variable);
			     AST_APP_ARG(options);
	OPT_ENDCDR =            (1 << 3),
	OPT_NORESET =           (1 << 4),
	OPT_KEEPVARS =          (1 << 5),
	OPT_VARSET =            (1 << 6),
	OPT_ANSLOCK =           (1 << 7),
	OPT_DONTOUCH =          (1 << 8),
};

enum {
	OPT_ARG_VARSET = 0,
	/* note: this entry _MUST_ be the last one in the enum */
	OPT_ARG_ARRAY_SIZE,
};

AST_APP_OPTIONS(forkcdr_exec_options, {
	AST_APP_OPTION('a', OPT_SETANS),
	AST_APP_OPTION('A', OPT_ANSLOCK),
	AST_APP_OPTION('d', OPT_SETDISP),
	AST_APP_OPTION('D', OPT_RESETDEST),
	AST_APP_OPTION('e', OPT_ENDCDR),
	AST_APP_OPTION('R', OPT_NORESET),
	AST_APP_OPTION_ARG('s', OPT_VARSET, OPT_ARG_VARSET),
	AST_APP_OPTION('T', OPT_DONTOUCH),
	AST_APP_OPTION('v', OPT_KEEPVARS),
});

static void ast_cdr_fork(struct ast_channel *chan, struct ast_flags optflags, char *set) 
{
	struct ast_cdr *cdr;
	struct ast_cdr *newcdr;
	struct ast_flags flags = { AST_CDR_FLAG_KEEP_VARS };
	target = find_by_part(chan, part);
	if (target) {
		res = ast_do_pickup(chan, target);
		ast_channel_unlock(target);
		target = ast_channel_unref(target);
	}

	return res;
}

enum OPT_PICKUPCHAN_FLAGS {
	OPT_PICKUPCHAN_PARTIAL =   (1 << 0),	/* Channel name is a partial name. */
};

AST_APP_OPTIONS(pickupchan_opts, BEGIN_OPTIONS
	AST_APP_OPTION('p', OPT_PICKUPCHAN_PARTIAL),
END_OPTIONS);

/* application entry point for PickupChan() */
static int pickupchan_exec(struct ast_channel *chan, const char *data)
{
	char *pickup = NULL;
	char *parse = ast_strdupa(data);
	AST_DECLARE_APP_ARGS(args,
		AST_APP_ARG(channel);
		AST_APP_ARG(options);
		AST_APP_ARG(other);	/* Any remining unused arguments */
	);
	struct ast_flags opts;

	AST_STANDARD_APP_ARGS(args, parse);
Beispiel #5
0
struct directory_item {
	char exten[AST_MAX_EXTENSION + 1];
	char name[AST_MAX_EXTENSION + 1];
	char context[AST_MAX_CONTEXT + 1];
	char key[50]; /* Text to order items. Either lastname+firstname or firstname+lastname */

	AST_LIST_ENTRY(directory_item) entry;
};

AST_APP_OPTIONS(directory_app_options, {
	AST_APP_OPTION_ARG('f', OPT_LISTBYFIRSTNAME, OPT_ARG_FIRSTNAME),
	AST_APP_OPTION_ARG('l', OPT_LISTBYLASTNAME, OPT_ARG_LASTNAME),
	AST_APP_OPTION_ARG('b', OPT_LISTBYEITHER, OPT_ARG_EITHER),
	AST_APP_OPTION_ARG('p', OPT_PAUSE, OPT_ARG_PAUSE),
	AST_APP_OPTION('e', OPT_SAYEXTENSION),
	AST_APP_OPTION('v', OPT_FROMVOICEMAIL),
	AST_APP_OPTION('m', OPT_SELECTFROMMENU),
	AST_APP_OPTION('n', OPT_NOANSWER),
	AST_APP_OPTION('a', OPT_ALIAS),
});

static int compare(const char *text, const char *template)
{
	char digit;

	if (ast_strlen_zero(text)) {
		return -1;
	}

	while (*template) {
Beispiel #6
0
enum {
	MON_FLAG_BRIDGED =  (1 << 0),
	MON_FLAG_MIX =      (1 << 1),
	MON_FLAG_DROP_IN =  (1 << 2),
	MON_FLAG_DROP_OUT = (1 << 3),
	MON_FLAG_BEEP =     (1 << 4),
};

enum {
	OPT_ARG_BEEP_INTERVAL,
	OPT_ARG_ARRAY_SIZE,	/* Always last element of the enum */
};

AST_APP_OPTIONS(monitor_opts, {
	AST_APP_OPTION('b', MON_FLAG_BRIDGED),
	AST_APP_OPTION('m', MON_FLAG_MIX),
	AST_APP_OPTION('i', MON_FLAG_DROP_IN),
	AST_APP_OPTION('o', MON_FLAG_DROP_OUT),
	AST_APP_OPTION_ARG('B', MON_FLAG_BEEP, OPT_ARG_BEEP_INTERVAL),
});

/*!
 * \brief Start monitor
 * \param chan
 * \param data arguments passed fname|options
 * \retval 0 on success.
 * \retval -1 on failure.
*/
static int start_monitor_exec(struct ast_channel *chan, const char *data)
{
Beispiel #7
0
			</variablelist>
		</description>
		<see-also>
			<ref type="application">SendDTMF</ref>
		</see-also>
	</application>
 ***/

enum {
	OPT_SKIP = (1 << 0),
	OPT_INDICATION = (1 << 1),
	OPT_NOANSWER = (1 << 2),
} read_option_flags;

AST_APP_OPTIONS(read_app_options, {
	AST_APP_OPTION('s', OPT_SKIP),
	AST_APP_OPTION('i', OPT_INDICATION),
	AST_APP_OPTION('n', OPT_NOANSWER),
});

static char *app = "Read";

#define ast_next_data(instr,ptr,delim) if((ptr=strchr(instr,delim))) { *(ptr) = '\0' ; ptr++;}

static int read_exec(struct ast_channel *chan, void *data)
{
	int res = 0;
	char tmp[256] = "";
	int maxdigits = 255;
	int tries = 1, to = 0, x = 0;
	double tosec;
Beispiel #8
0
			<para>Causes the Call Data Record engine to fork a new CDR starting
			from the time the application is executed. The forked CDR will be
			linked to the end of the CDRs associated with the channel.</para>
		</description>
		<see-also>
			<ref type="function">CDR</ref>
			<ref type="application">NoCDR</ref>
			<ref type="application">ResetCDR</ref>
		</see-also>
	</application>
 ***/

static char *app = "ForkCDR";

AST_APP_OPTIONS(forkcdr_exec_options, {
	AST_APP_OPTION('a', AST_CDR_FLAG_SET_ANSWER),
	AST_APP_OPTION('e', AST_CDR_FLAG_FINALIZE),
	AST_APP_OPTION('r', AST_CDR_FLAG_RESET),
	AST_APP_OPTION('v', AST_CDR_FLAG_KEEP_VARS),
});

static int forkcdr_exec(struct ast_channel *chan, const char *data)
{
	char *parse;
	struct ast_flags flags = { 0, };
	AST_DECLARE_APP_ARGS(args,
		AST_APP_ARG(options);
	);

	parse = ast_strdupa(data);
Beispiel #9
0
	OPT_CALLEE_PARK = (1 << 9),
	OPT_CALLER_PARK = (1 << 10),
	OPT_CALLEE_KILL = (1 << 11),
	OPT_CALLEE_GO_ON = (1 << 12),
};

enum {
	OPT_ARG_DURATION_LIMIT = 0,
	OPT_ARG_DURATION_STOP,
	OPT_ARG_CALLEE_GO_ON,
	/* note: this entry _MUST_ be the last one in the enum */
	OPT_ARG_ARRAY_SIZE,
};

AST_APP_OPTIONS(bridge_exec_options, BEGIN_OPTIONS
	AST_APP_OPTION('p', BRIDGE_OPT_PLAYTONE),
	AST_APP_OPTION_ARG('F', OPT_CALLEE_GO_ON, OPT_ARG_CALLEE_GO_ON),
	AST_APP_OPTION('h', OPT_CALLEE_HANGUP),
	AST_APP_OPTION('H', OPT_CALLER_HANGUP),
	AST_APP_OPTION('k', OPT_CALLEE_PARK),
	AST_APP_OPTION('K', OPT_CALLER_PARK),
	AST_APP_OPTION_ARG('L', OPT_DURATION_LIMIT, OPT_ARG_DURATION_LIMIT),
	AST_APP_OPTION_ARG('S', OPT_DURATION_STOP, OPT_ARG_DURATION_STOP),
	AST_APP_OPTION('t', OPT_CALLEE_TRANSFER),
	AST_APP_OPTION('T', OPT_CALLER_TRANSFER),
	AST_APP_OPTION('w', OPT_CALLEE_MONITOR),
	AST_APP_OPTION('W', OPT_CALLER_MONITOR),
	AST_APP_OPTION('x', OPT_CALLEE_KILL),
END_OPTIONS );

int ast_bridge_timelimit(struct ast_channel *chan, struct ast_bridge_config *config,
Beispiel #10
0
	OPTION_PRIVATE   = (1 << 6),    /* Private Whisper mode */
	OPTION_READONLY  = (1 << 7),    /* Don't mix the two channels */
	OPTION_EXIT      = (1 << 8),    /* Exit to a valid single digit extension */
	OPTION_ENFORCED  = (1 << 9),    /* Enforced mode */
} chanspy_opt_flags;

enum {
	OPT_ARG_VOLUME = 0,
	OPT_ARG_GROUP,
	OPT_ARG_RECORD,
	OPT_ARG_ENFORCED,
	OPT_ARG_ARRAY_SIZE,
} chanspy_opt_args;

AST_APP_OPTIONS(spy_opts, {
	AST_APP_OPTION('q', OPTION_QUIET),
	AST_APP_OPTION('b', OPTION_BRIDGED),
	AST_APP_OPTION('w', OPTION_WHISPER),
	AST_APP_OPTION('W', OPTION_PRIVATE),
	AST_APP_OPTION_ARG('v', OPTION_VOLUME, OPT_ARG_VOLUME),
	AST_APP_OPTION_ARG('g', OPTION_GROUP, OPT_ARG_GROUP),
	AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
	AST_APP_OPTION_ARG('e', OPTION_ENFORCED, OPT_ARG_ENFORCED),
	AST_APP_OPTION('o', OPTION_READONLY),
	AST_APP_OPTION('X', OPTION_EXIT),
});

static int next_unique_id_to_use = 0;

struct chanspy_translation_helper {
	/* spy data */
enum {
	OPTION_A = (1 << 0),
	OPTION_B = (1 << 1),
	OPTION_C = (1 << 2),
} option_flags;

enum {
	OPTION_ARG_B = 0,
	OPTION_ARG_C = 1,
	/* This *must* be the last value in this enum! */
	OPTION_ARG_ARRAY_SIZE = 2,
} option_args;

AST_APP_OPTIONS(app_opts,{
	AST_APP_OPTION('a', OPTION_A),
	AST_APP_OPTION_ARG('b', OPTION_B, OPTION_ARG_B),
	AST_APP_OPTION_ARG('c', OPTION_C, OPTION_ARG_C),
});

LOCAL_USER_DECL;

static int app_exec(struct ast_channel *chan, void *data)
{
	int res = 0;
	struct ast_flags flags;
	struct localuser *u;
	char *parse, *opts[OPTION_ARG_ARRAY_SIZE];
	AST_DECLARE_APP_ARGS(args,
		AST_APP_ARG(dummy);
		AST_APP_ARG(options);
Beispiel #12
0
"  Places outbound calls to the given technology / resource and dumps\n"
"them into a conference bridge as muted participants.  The original\n"
"caller is dumped into the conference as a speaker and the room is\n"
"destroyed when the original caller leaves.  Valid options are:\n"
"        d - full duplex audio\n"
"        q - quiet, do not play beep to caller\n"
"        r - record the page into a file (see 'r' for app_meetme)\n";

enum {
	PAGE_DUPLEX = (1 << 0),
	PAGE_QUIET = (1 << 1),
	PAGE_RECORD = (1 << 2),
} page_opt_flags;

AST_APP_OPTIONS(page_opts, {
	AST_APP_OPTION('d', PAGE_DUPLEX),
	AST_APP_OPTION('q', PAGE_QUIET),
	AST_APP_OPTION('r', PAGE_RECORD),
});

#define MAX_DIALS 128

static int page_exec(struct ast_channel *chan, void *data)
{
	struct ast_module_user *u;
	char *options, *tech, *resource, *tmp;
	char meetmeopts[88], originator[AST_CHANNEL_NAME];
	struct ast_flags flags = { 0 };
	unsigned int confid = ast_random();
	struct ast_app *app;
	int res = 0, pos = 0, i = 0;
	OPTION_QUIET	 = (1 << 0),	/* Quiet, no announcement */
	OPTION_BRIDGED   = (1 << 1),	/* Only look at bridged calls */
	OPTION_VOLUME    = (1 << 2),	/* Specify initial volume */
	OPTION_GROUP     = (1 << 3),	/* Only look at channels in group */
	OPTION_RECORD    = (1 << 4),	/* Record */
} chanspy_opt_flags;

enum {
	OPT_ARG_VOLUME = 0,
	OPT_ARG_GROUP,
	OPT_ARG_RECORD,
	OPT_ARG_ARRAY_SIZE,
} chanspy_opt_args;

AST_APP_OPTIONS(chanspy_opts, {
	AST_APP_OPTION('q', OPTION_QUIET),
	AST_APP_OPTION('b', OPTION_BRIDGED),
	AST_APP_OPTION_ARG('v', OPTION_VOLUME, OPT_ARG_VOLUME),
	AST_APP_OPTION_ARG('g', OPTION_GROUP, OPT_ARG_GROUP),
	AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
});

STANDARD_LOCAL_USER;
LOCAL_USER_DECL;

struct chanspy_translation_helper {
	/* spy data */
	struct ast_channel_spy spy;
	int fd;
	int volfactor;
};
Beispiel #14
0
	OPTION_VOLUME    = (1 << 2),	/* Specify initial volume */
	OPTION_GROUP     = (1 << 3),	/* Only look at channels in group */
	OPTION_RECORD    = (1 << 4),
	OPTION_WHISPER	 = (1 << 5),
	OPTION_PRIVATE   = (1 << 6),	/* Private Whisper mode */
} chanspy_opt_flags;

enum {
	OPT_ARG_VOLUME = 0,
	OPT_ARG_GROUP,
	OPT_ARG_RECORD,
	OPT_ARG_ARRAY_SIZE,
} chanspy_opt_args;

AST_APP_OPTIONS(spy_opts, {
	AST_APP_OPTION('q', OPTION_QUIET),
	AST_APP_OPTION('b', OPTION_BRIDGED),
	AST_APP_OPTION('w', OPTION_WHISPER),
	AST_APP_OPTION('W', OPTION_PRIVATE),
	AST_APP_OPTION_ARG('v', OPTION_VOLUME, OPT_ARG_VOLUME),
	AST_APP_OPTION_ARG('g', OPTION_GROUP, OPT_ARG_GROUP),
	AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
});

static int next_unique_id_to_use = 0;

struct chanspy_translation_helper {
	/* spy data */
	struct ast_audiohook spy_audiohook;
	struct ast_audiohook whisper_audiohook;
	int fd;
Beispiel #15
0
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/logger.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/cdr.h"

enum {
	OPT_RECURSIVE = (1 << 0),
	OPT_UNPARSED = (1 << 1),
	OPT_LAST = (1 << 2),
} cdr_option_flags;

AST_APP_OPTIONS(cdr_func_options, {
	AST_APP_OPTION('l', OPT_LAST),
	AST_APP_OPTION('r', OPT_RECURSIVE),
	AST_APP_OPTION('u', OPT_UNPARSED),
});

static int cdr_read(struct ast_channel *chan, char *cmd, char *parse,
		    char *buf, size_t len)
{
	char *ret;
	struct ast_flags flags = { 0 };
	struct ast_cdr *cdr = chan ? chan->cdr : NULL;
	AST_DECLARE_APP_ARGS(args,
			     AST_APP_ARG(variable);
			     AST_APP_ARG(options);
	);
Beispiel #16
0
	PAGE_DUPLEX = (1 << 0),
	PAGE_QUIET = (1 << 1),
	PAGE_RECORD = (1 << 2),
	PAGE_SKIP = (1 << 3),
	PAGE_IGNORE_FORWARDS = (1 << 4),
	PAGE_ANNOUNCE = (1 << 5),
	PAGE_NOCALLERANNOUNCE = (1 << 6),
};

enum {
	OPT_ARG_ANNOUNCE = 0,
	OPT_ARG_ARRAY_SIZE = 1,
};

AST_APP_OPTIONS(page_opts, {
	AST_APP_OPTION('d', PAGE_DUPLEX),
	AST_APP_OPTION('q', PAGE_QUIET),
	AST_APP_OPTION('r', PAGE_RECORD),
	AST_APP_OPTION('s', PAGE_SKIP),
	AST_APP_OPTION('i', PAGE_IGNORE_FORWARDS),
	AST_APP_OPTION_ARG('A', PAGE_ANNOUNCE, OPT_ARG_ANNOUNCE),
	AST_APP_OPTION('n', PAGE_NOCALLERANNOUNCE),
});

/* We use this structure as a way to pass this to all dialed channels */
struct page_options {
	char *opts[OPT_ARG_ARRAY_SIZE];
	struct ast_flags flags;
};

static void page_state_callback(struct ast_dial *dial)
enum park_args {
	OPT_ARG_COMEBACK,
	OPT_ARG_TIMEOUT,
	OPT_ARG_ARRAY_SIZE /* Always the last element of the enum */
};

enum park_flags {
	MUXFLAG_RINGING = (1 << 0),
	MUXFLAG_RANDOMIZE = (1 << 1),
	MUXFLAG_NOANNOUNCE = (1 << 2),
	MUXFLAG_COMEBACK_OVERRIDE = (1 << 3),
	MUXFLAG_TIMEOUT_OVERRIDE = (1 << 4),
};

AST_APP_OPTIONS(park_opts, {
	AST_APP_OPTION('r', MUXFLAG_RINGING),
	AST_APP_OPTION('R', MUXFLAG_RANDOMIZE),
	AST_APP_OPTION('s', MUXFLAG_NOANNOUNCE),
	AST_APP_OPTION_ARG('c', MUXFLAG_COMEBACK_OVERRIDE, OPT_ARG_COMEBACK),
	AST_APP_OPTION_ARG('t', MUXFLAG_TIMEOUT_OVERRIDE, OPT_ARG_TIMEOUT),
});

static int apply_option_timeout (int *var, char *timeout_arg)
{
	if (ast_strlen_zero(timeout_arg)) {
		ast_log(LOG_ERROR, "No duration value provided for the timeout ('t') option.\n");
		return -1;
	}

	if (sscanf(timeout_arg, "%d", var) != 1 || *var < 0) {
		ast_log(LOG_ERROR, "Duration value provided for timeout ('t') option must be 0 or greater.\n");
Beispiel #18
0
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/app.h"
#include "asterisk/astdb.h"
#include "asterisk/utils.h"

enum {
	OPT_ACCOUNT = (1 << 0),
	OPT_DATABASE = (1 << 1),
	OPT_MULTIPLE = (1 << 3),
	OPT_REMOVE = (1 << 4),
};

AST_APP_OPTIONS(auth_app_options, {
	AST_APP_OPTION('a', OPT_ACCOUNT),
	AST_APP_OPTION('d', OPT_DATABASE),
	AST_APP_OPTION('m', OPT_MULTIPLE),
	AST_APP_OPTION('r', OPT_REMOVE),
});


static const char app[] = "Authenticate";
/*** DOCUMENTATION
	<application name="Authenticate" language="en_US">
		<synopsis>
			Authenticate a user
		</synopsis>
		<syntax>
			<parameter name="password" required="true">
				<para>Password the user should know</para>
Beispiel #19
0
			<ref type="function">CDR_PROP</ref>
		</see-also>
	</application>
 ***/

static const char nocdr_app[] = "NoCDR";
static const char resetcdr_app[] = "ResetCDR";

enum reset_cdr_options {
	OPT_DISABLE_DISPATCH = (1 << 0),
	OPT_KEEP_VARS = (1 << 1),
	OPT_ENABLE = (1 << 2),
};

AST_APP_OPTIONS(resetcdr_opts, {
	AST_APP_OPTION('v', AST_CDR_FLAG_KEEP_VARS),
	AST_APP_OPTION('e', AST_CDR_FLAG_DISABLE_ALL),
});

STASIS_MESSAGE_TYPE_DEFN_LOCAL(appcdr_message_type);

/*! \internal \brief Payload for the Stasis message sent to manipulate a CDR */
struct app_cdr_message_payload {
	/*! The name of the channel to be manipulated */
	const char *channel_name;
	/*! Disable the CDR for this channel */
	int disable:1;
	/*! Re-enable the CDR for this channel */
	int reenable:1;
	/*! Reset the CDR */
	int reset:1;
	MUXFLAG_COMBINED = (1 << 8),
        MUXFLAG_UID = (1 << 9),
};

enum mixmonitor_args {
	OPT_ARG_READVOLUME = 0,
	OPT_ARG_WRITEVOLUME,
	OPT_ARG_VOLUME,
	OPT_ARG_WRITENAME,
	OPT_ARG_READNAME,
        OPT_ARG_UID,
	OPT_ARG_ARRAY_SIZE,	/* Always last element of the enum */
};

AST_APP_OPTIONS(mixmonitor_opts, {
	AST_APP_OPTION('a', MUXFLAG_APPEND),
	AST_APP_OPTION('b', MUXFLAG_BRIDGED),
	AST_APP_OPTION_ARG('v', MUXFLAG_READVOLUME, OPT_ARG_READVOLUME),
	AST_APP_OPTION_ARG('V', MUXFLAG_WRITEVOLUME, OPT_ARG_WRITEVOLUME),
	AST_APP_OPTION_ARG('W', MUXFLAG_VOLUME, OPT_ARG_VOLUME),
	AST_APP_OPTION_ARG('r', MUXFLAG_READ, OPT_ARG_READNAME),
	AST_APP_OPTION_ARG('t', MUXFLAG_WRITE, OPT_ARG_WRITENAME),
	AST_APP_OPTION_ARG('i', MUXFLAG_UID, OPT_ARG_UID),
});

struct mixmonitor_ds {
	unsigned int destruction_ok;
	ast_cond_t destruction_condition;
	ast_mutex_t lock;

	/* The filestream is held in the datastore so it can be stopped
Beispiel #21
0
static char *app = "Record";

enum {
	OPTION_APPEND = (1 << 0),
	OPTION_NOANSWER = (1 << 1),
	OPTION_QUIET = (1 << 2),
	OPTION_SKIP = (1 << 3),
	OPTION_STAR_TERMINATE = (1 << 4),
	OPTION_IGNORE_TERMINATE = (1 << 5),
	OPTION_KEEP = (1 << 6),
	FLAG_HAS_PERCENT = (1 << 7),
	OPTION_ANY_TERMINATE = (1 << 8),
};

AST_APP_OPTIONS(app_opts,{
	AST_APP_OPTION('a', OPTION_APPEND),
	AST_APP_OPTION('k', OPTION_KEEP),	
	AST_APP_OPTION('n', OPTION_NOANSWER),
	AST_APP_OPTION('q', OPTION_QUIET),
	AST_APP_OPTION('s', OPTION_SKIP),
	AST_APP_OPTION('t', OPTION_STAR_TERMINATE),
	AST_APP_OPTION('y', OPTION_ANY_TERMINATE),
	AST_APP_OPTION('x', OPTION_IGNORE_TERMINATE),
});

static int record_exec(struct ast_channel *chan, const char *data)
{
	int res = 0;
	int count = 0;
	char *ext = NULL, *opts[0];
	char *parse, *dir, *file;
Beispiel #22
0
#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_ANS  'T' /* answer channel */
#define EIVR_CMD_SVAR 'V' /* set channel varable(s) */
#define EIVR_CMD_XIT  'X' /* exit **depricated** */

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

AST_APP_OPTIONS(app_opts, {
	AST_APP_OPTION('n', noanswer),
	AST_APP_OPTION('i', ignore_hangup),
	AST_APP_OPTION('d', run_dead),
});

struct playlist_entry {
	AST_LIST_ENTRY(playlist_entry) list;
	char filename[1];
};

struct ivr_localuser {
	struct ast_channel *chan;
	AST_LIST_HEAD(playlist, playlist_entry) playlist;
	AST_LIST_HEAD(finishlist, playlist_entry) finishlist;
	int abort_current_sound;
	int playing_silence;
		return -1;
	}

	ast_db_put(astdb_family, data, value);

	ast_devstate_changed(state_val, AST_DEVSTATE_CACHABLE, "Custom:%s", data);

	return 0;
}

enum {
	HINT_OPT_NAME = (1 << 0),
};

AST_APP_OPTIONS(hint_options, BEGIN_OPTIONS
	AST_APP_OPTION('n', HINT_OPT_NAME),
END_OPTIONS );

static int hint_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
	char *exten, *context;
	AST_DECLARE_APP_ARGS(args,
		AST_APP_ARG(exten);
		AST_APP_ARG(options);
	);
	struct ast_flags opts = { 0, };
	int res;

	if (ast_strlen_zero(data)) {
		ast_log(LOG_WARNING, "The HINT function requires an extension\n");
		return -1;
Beispiel #24
0
		</description>
		<see-also>
			<ref type="application">SendImage</ref>
			<ref type="application">SendText</ref>
		</see-also>
	</application>
 ***/

static char *app = "SendURL";

enum option_flags {
	OPTION_WAIT = (1 << 0),
};

AST_APP_OPTIONS(app_opts,{
	AST_APP_OPTION('w', OPTION_WAIT),
});

static int sendurl_exec(struct ast_channel *chan, const char *data)
{
	int res = 0;
	char *tmp;
	struct ast_frame *f;
	char *status = "FAILURE";
	char *opts[0];
	struct ast_flags flags = { 0 };
	AST_DECLARE_APP_ARGS(args,
		AST_APP_ARG(url);
		AST_APP_ARG(options);
	);
	
Beispiel #25
0
		<description>
			<para>Hangs up the requested channel.  If there are no channels to 
			hangup, the application will report it.</para>
		</description>
	</application>

 ***/

static char *app = "SoftHangup";

enum {
	OPTION_ALL = (1 << 0),
};

AST_APP_OPTIONS(app_opts,{
	AST_APP_OPTION('a', OPTION_ALL),
});

static int softhangup_exec(struct ast_channel *chan, void *data)
{
	struct ast_channel *c = NULL;
	char *cut, *opts[0];
	char name[AST_CHANNEL_NAME] = "", *parse;
	struct ast_flags flags = {0};
	int lenmatch;
	AST_DECLARE_APP_ARGS(args,
		AST_APP_ARG(channel);
		AST_APP_ARG(options);
	);
	
	if (ast_strlen_zero(data)) {
Beispiel #26
0
static char *app = "SkelGuessNumber";

enum option_flags {
    OPTION_CHEAT    = (1 << 0),
    OPTION_NUMGAMES = (1 << 1),
};

enum option_args {
    OPTION_ARG_NUMGAMES,
    /* This *must* be the last value in this enum! */
    OPTION_ARG_ARRAY_SIZE,
};

AST_APP_OPTIONS(app_opts, {
    AST_APP_OPTION('c', OPTION_CHEAT),
    AST_APP_OPTION_ARG('n', OPTION_NUMGAMES, OPTION_ARG_NUMGAMES),
});

/*! \brief A structure to hold global configuration-related options */
struct skel_global_config {
    AST_DECLARE_STRING_FIELDS(
        AST_STRING_FIELD(prompt); /*!< The comma-separated list of sounds to prompt to enter a number */
        AST_STRING_FIELD(wrong);  /*!< The comma-separated list of sounds to indicate a wrong guess */
        AST_STRING_FIELD(right);  /*!< The comma-separated list of sounds to indicate a right guess */
        AST_STRING_FIELD(high);   /*!< The comma-separated list of sounds to indicate a high guess */
        AST_STRING_FIELD(low);    /*!< The comma-separated list of sounds to indicate a low guess */
        AST_STRING_FIELD(lose);  /*!< The comma-separated list of sounds to indicate a lost game */
    );
    uint32_t num_games;    /*!< The number of games to play before hanging up */
    unsigned char cheat:1; /*!< Whether the computer can cheat or not */
Beispiel #27
0
		</description>
		<see-also>
			<ref type="application">Authenticate</ref>
			<ref type="application">VMAuthenticate</ref>
		</see-also>
	</application>
 ***/
static const char app[] = "DISA";

enum {
	NOANSWER_FLAG = (1 << 0),
	POUND_TO_END_FLAG = (1 << 1),
};

AST_APP_OPTIONS(app_opts, {
	AST_APP_OPTION('n', NOANSWER_FLAG),
	AST_APP_OPTION('p', POUND_TO_END_FLAG),
});

static void play_dialtone(struct ast_channel *chan, char *mailbox)
{
	struct ast_tone_zone_sound *ts = NULL;

	if (ast_app_has_voicemail(mailbox, NULL)) {
		ts = ast_get_indication_tone(chan->zone, "dialrecall");
	} else {
		ts = ast_get_indication_tone(chan->zone, "dial");
	}

	if (ts) {
		ast_playtones_start(chan, 0, ts->data, 0);
Beispiel #28
0
	</function>
 ***/

struct volume_information {
	struct ast_audiohook audiohook;
	int tx_gain;
	int rx_gain;
	unsigned int flags;
};

enum volume_flags {
	VOLUMEFLAG_CHANGE = (1 << 1),
};

AST_APP_OPTIONS(volume_opts, {
	AST_APP_OPTION('p', VOLUMEFLAG_CHANGE),
});

static void destroy_callback(void *data)
{
	struct volume_information *vi = data;

	/* Destroy the audiohook, and destroy ourselves */
	ast_audiohook_lock(&vi->audiohook);
	ast_audiohook_detach(&vi->audiohook);
	ast_audiohook_unlock(&vi->audiohook);
	ast_audiohook_destroy(&vi->audiohook);
	ast_free(vi);

	return;
}
Beispiel #29
0
	OPTION_EXITONHANGUP      = (1 << 18),   /* Hang up when the spied-on channel hangs up. */
};

enum {
	OPT_ARG_VOLUME = 0,
	OPT_ARG_GROUP,
	OPT_ARG_RECORD,
	OPT_ARG_ENFORCED,
	OPT_ARG_NAME,
	OPT_ARG_EXIT,
	OPT_ARG_CYCLE,
	OPT_ARG_ARRAY_SIZE,
};

AST_APP_OPTIONS(spy_opts, {
	AST_APP_OPTION('b', OPTION_BRIDGED),
	AST_APP_OPTION('B', OPTION_BARGE),
	AST_APP_OPTION_ARG('c', OPTION_DTMF_CYCLE, OPT_ARG_CYCLE),
	AST_APP_OPTION('d', OPTION_DTMF_SWITCH_MODES),
	AST_APP_OPTION_ARG('e', OPTION_ENFORCED, OPT_ARG_ENFORCED),
	AST_APP_OPTION('E', OPTION_EXITONHANGUP),
	AST_APP_OPTION_ARG('g', OPTION_GROUP, OPT_ARG_GROUP),
	AST_APP_OPTION_ARG('n', OPTION_NAME, OPT_ARG_NAME),
	AST_APP_OPTION('o', OPTION_READONLY),
	AST_APP_OPTION('q', OPTION_QUIET),
	AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
	AST_APP_OPTION('s', OPTION_NOTECH),
	AST_APP_OPTION('S', OPTION_STOP),
	AST_APP_OPTION_ARG('v', OPTION_VOLUME, OPT_ARG_VOLUME),
	AST_APP_OPTION('w', OPTION_WHISPER),
	AST_APP_OPTION('W', OPTION_PRIVATE),
Beispiel #30
0
			</parameter>
		</syntax>
		<description>
			<para>This function sets a property on a channel's CDR. Properties
			alter the behavior of how the CDR operates for that channel.</para>
		</description>
	</function>
 ***/

enum cdr_option_flags {
	OPT_UNPARSED = (1 << 1),
	OPT_FLOAT = (1 << 2),
};

AST_APP_OPTIONS(cdr_func_options, {
	AST_APP_OPTION('f', OPT_FLOAT),
	AST_APP_OPTION('u', OPT_UNPARSED),
});

struct cdr_func_payload {
	struct ast_channel *chan;
	const char *cmd;
	const char *arguments;
	const char *value;
	void *data;
};

struct cdr_func_data {
	char *buf;
	size_t len;
};