48 #define PICKUPMARK "PICKUPMARK" 125 static const char app[] =
"Pickup";
126 static 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) {
342 exten =
strsep(&parse,
"&");
347 context = strchr(exten,
'@');
381 pickup_args.
name = part;
382 pickup_args.
len = strlen(part);
389 pickup_args.
name = part;
#define ast_channel_lock(chan)
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk locking-related definitions:
struct ast_channel * ast_channel_iterator_next(struct ast_channel_iterator *i)
Get the next channel for a channel iterator.
Asterisk main include file. File version handling, generic pbx functions.
struct ast_channel * chan
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
#define ast_channel_unref(c)
Decrease channel reference count.
#define ast_test_flag(p, flag)
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static int pickup_by_mark(struct ast_channel *chan, const char *mark)
int ast_do_pickup(struct ast_channel *chan, struct ast_channel *target)
Pickup a call target.
static int pickup_by_channel(struct ast_channel *chan, const char *name)
Attempt to pick up named channel.
static int pickup_by_exten(struct ast_channel *chan, const char *exten, const char *context)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_unregister_application(const char *app)
Unregister an application.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
#define ast_strlen_zero(foo)
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
static int find_by_mark(void *obj, void *arg, void *data, int flags)
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.
General Asterisk PBX channel definitions.
static int find_by_name(void *obj, void *arg, void *data, int flags)
static int load_module(void)
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int pickup_exec(struct ast_channel *chan, const char *data)
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.
Core PBX routines and definitions.
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.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
const char * ast_channel_uniqueid(const struct ast_channel *chan)
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
static int pickupchan_exec(struct ast_channel *chan, const char *data)
static int pickup_by_part(struct ast_channel *chan, const char *part)
struct ast_channel * ast_pickup_find_by_group(struct ast_channel *chan)
Find a pickup channel target by group.
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_unlock(chan)
static void parse(struct mgcp_request *req)
int ast_can_pickup(struct ast_channel *chan)
Test if a channel can be picked up.
Structure used to handle boolean flags.
char * strsep(char **str, const char *delims)
const char * ast_channel_name(const struct ast_channel *chan)
static int pickup_by_group(struct ast_channel *chan)
struct ast_channel_iterator * ast_channel_iterator_destroy(struct ast_channel_iterator *i)
Destroy a channel iterator.
const char * ast_channel_context(const struct ast_channel *chan)
static char context[AST_MAX_CONTEXT]
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
#define ASTERISK_GPL_KEY
The text the key() function should return.
static const struct ast_app_option pickupchan_opts[128]
Asterisk module definitions.
static struct ast_channel * find_by_part(struct ast_channel *chan, const char *part)
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
static int unload_module(void)
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.