40 #include "asterisk/file.h"
51 #define PICKUPMARK "PICKUPMARK"
119 static const char app[] =
"Pickup";
120 static const char app2[] =
"PickupChan";
151 if (strchr(channame,
'-')) {
153 pickup_args.
len = strlen(channame);
154 pickup_args.
name = channame;
160 pickup_args.
len = strlen(channame) + 1;
162 strcpy(chkchan, channame);
163 strcat(chkchan,
"-");
164 pickup_args.
name = chkchan;
179 if (chan != target) {
224 const char *mark =
data;
300 if ((context = strchr(exten,
'@')))
324 const char *part =
data;
325 int len = strlen(part);
328 if (len <= strlen(target->
name) && !strncmp(target->
name, part, len)
358 int partial_pickup = 0;
379 if (!strncasecmp(chan->
name, pickup, strlen(pickup))) {
382 if (partial_pickup) {
#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.
char * strsep(char **str, const char *delims)
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
static int find_by_part(void *obj, void *arg, void *data, int flags)
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_channel_unref(c)
Decrease channel reference count.
static int pickup_by_channel(struct ast_channel *chan, char *pickup)
Attempt to pick up named channel, does not use context.
char context[AST_MAX_CONTEXT]
static int pickup_by_mark(struct ast_channel *chan, const char *mark)
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
static int pickup_by_exten(struct ast_channel *chan, const char *exten, const char *context)
static int find_channel_by_group(void *obj, void *arg, void *data, int flags)
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.
static int find_by_mark(void *obj, void *arg, void *data, int flags)
General Asterisk PBX channel definitions.
static int load_module(void)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
static int pickup_exec(struct ast_channel *chan, const char *data)
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.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
static int pickup_by_name_cb(void *obj, void *arg, void *data, int flags)
static int pickupchan_exec(struct ast_channel *chan, const char *data)
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int pickup_by_part(struct ast_channel *chan, const char *part)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
struct ast_channel_iterator * ast_channel_iterator_by_exten_new(const char *exten, const char *context)
Create a new channel iterator based on extension.
const ast_string_field name
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
int ast_do_pickup(struct ast_channel *chan, struct ast_channel *target)
Pickup a call target.
static struct ast_channel * my_ast_get_channel_by_name_locked(const char *channame)
Helper Function to walk through ALL channels checking NAME and STATE.
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.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define AST_APP_ARG(name)
Define an application argument.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static char context[AST_MAX_CONTEXT]
Call Parking and Pickup API Includes code and algorithms from the Zapata library. ...
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static int unload_module(void)
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
int ast_can_pickup(struct ast_channel *chan)
Test if a channel can be picked up.