85 static const char *
const app =
"Transfer";
87 static int transfer_exec(
struct ast_channel *chan,
const char *data)
97 char status_protocol[20];
102 if (ast_strlen_zero((
char *)data)) {
103 ast_log(LOG_WARNING,
"Transfer requires an argument ([Tech/]destination)\n");
105 snprintf(status_protocol,
sizeof(status_protocol),
"%d", protocol);
115 if ((slash = strchr(dest,
'/')) && (len = (slash - dest))) {
121 snprintf(status_protocol,
sizeof(status_protocol),
"%d", protocol);
130 snprintf(status_protocol,
sizeof(status_protocol),
"%d", protocol);
147 snprintf(status_protocol,
sizeof(status_protocol),
"%d", protocol);
148 ast_debug(1,
"ast_transfer channel %s TRANSFERSTATUS=%s, TRANSFERSTATUSPROTOCOL=%s\n",
149 ast_channel_name(chan), status, status_protocol);
156 static int unload_module(
void)
161 static int load_module(
void)
166 AST_MODULE_INFO_STANDARD(
ASTERISK_GPL_KEY,
"Transfers a caller to another extension");
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
int ast_unregister_application(const char *app)
Unregister an application.
General Asterisk PBX channel definitions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_debug(level,...)
Log a DEBUG message.
Structure to describe a channel "technology", ie a channel driver See for examples: ...
Core PBX routines and definitions.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
int ast_transfer_protocol(struct ast_channel *chan, char *dest, int *protocol)
Transfer a channel (if supported) receieve protocol result.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#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...
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.