48#define PICKUPMARK "PICKUPMARK"
125static const char app[] =
"Pickup";
126static const char app2[] =
"PickupChan";
142 if (
args->chan == target) {
163 if (
args->chan == target) {
188 if (strchr(channame,
'-')) {
195 pickup_args.
len = strlen(channame);
196 pickup_args.
name = channame;
202 pickup_args.
len = strlen(channame) + 1;
204 strcpy(chkchan, channame);
205 strcat(chkchan,
"-");
206 pickup_args.
name = chkchan;
214 pickup_args.
name = channame;
272 const char *mark =
data;
275 if (chan == target) {
381 pickup_args.
name = part;
382 pickup_args.
len = strlen(part);
389 pickup_args.
name = part;
static int pickup_by_part(struct ast_channel *chan, const char *part)
static int find_by_name(void *obj, void *arg, void *data, int flags)
static int pickup_by_exten(struct ast_channel *chan, const char *exten, const char *context)
static int pickupchan_exec(struct ast_channel *chan, const char *data)
static const struct ast_app_option pickupchan_opts[128]
static int pickup_by_mark(struct ast_channel *chan, const char *mark)
static int pickup_by_channel(struct ast_channel *chan, const char *name)
Attempt to pick up named channel.
static int pickup_exec(struct ast_channel *chan, const char *data)
static struct ast_channel * find_by_part(struct ast_channel *chan, const char *part)
static int pickup_by_group(struct ast_channel *chan)
static int load_module(void)
static int find_by_mark(void *obj, void *arg, void *data, int flags)
static int unload_module(void)
static int find_by_uniqueid(void *obj, void *arg, void *data, int flags)
static struct ast_channel * find_by_channel(struct ast_channel *chan, const char *channame)
Helper Function to walk through ALL channels checking NAME and STATE.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_strdupa(s)
duplicate a string in memory from the stack
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
struct ast_channel * ast_channel_callback(ao2_callback_data_fn *cb_fn, void *arg, void *data, int ao2_flags)
Call a function with every active channel.
struct ast_channel_iterator * ast_channel_iterator_destroy(struct ast_channel_iterator *i)
Destroy a channel iterator.
#define ast_channel_lock(chan)
struct ast_channel * ast_channel_iterator_next(struct ast_channel_iterator *i)
Get the next channel for a channel iterator.
const char * ast_channel_uniqueid(const struct ast_channel *chan)
const char * ast_channel_context(const struct ast_channel *chan)
struct ast_channel_iterator * ast_channel_iterator_by_exten_new(const char *exten, const char *context)
Create a new channel iterator based on extension.
#define ast_channel_unref(c)
Decrease channel reference count.
#define ast_channel_unlock(chan)
Generic File Format Support. Should be included by clients of the file handling routines....
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
char * strsep(char **str, const char *delims)
Asterisk locking-related definitions:
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Core PBX routines and definitions.
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 ast_can_pickup(struct ast_channel *chan)
Test if a channel can be picked up.
int ast_do_pickup(struct ast_channel *chan, struct ast_channel *target)
Pickup a call target.
struct ast_channel * ast_pickup_find_by_group(struct ast_channel *chan)
Find a pickup channel target by group.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Main Channel structure associated with a channel.
char exten[AST_MAX_EXTENSION]
Structure used to handle boolean flags.
struct ast_channel * chan
#define ast_test_flag(p, flag)