53 static char *
orig_app(
int fd,
const char *chan,
const char *
app,
const char *appdata)
65 chantech =
strsep(&chandata,
"/");
67 ast_cli(fd,
"*** No data provided after channel type! ***\n");
91 static char *
orig_exten(
int fd,
const char *chan,
const char *data)
102 chantech =
strsep(&chandata,
"/");
104 ast_cli(fd,
"*** No data provided after channel type! ***\n");
110 exten =
strsep(&context,
"@");
138 static const char *
const choices[] = {
"application",
"extension",
NULL };
142 e->
command =
"channel originate";
144 " There are two ways to use this command. A call can be originated between a\n" 145 "channel and a specific application, or between a channel and an extension in\n" 146 "the dialplan. This is similar to call files or the manager originate action.\n" 147 "Calls originated with this command are given a timeout of 30 seconds.\n\n" 149 "Usage1: channel originate <tech/data> application <appname> [appdata]\n" 150 " This will originate a call between the specified channel tech/data and the\n" 151 "given application. Arguments to the application are optional. If the given\n" 152 "arguments to the application include spaces, all of the arguments to the\n" 153 "application need to be placed in quotation marks.\n\n" 155 "Usage2: channel originate <tech/data> extension [exten@][context]\n" 156 " This will originate a call between the specified channel tech/data and the\n" 157 "given extension. If no context is specified, the 'default' context will be\n" 158 "used. If no extension is given, the 's' extension will be used.\n";
163 }
else if (a->
pos == 4) {
164 if (!strcasecmp(
"application", a->
argv[3])) {
174 if (!strcasecmp(
"application", a->
argv[3])) {
176 }
else if (!strcasecmp(
"extension", a->
argv[3])) {
187 const char *
name, *dest;
193 e->
command =
"channel redirect";
195 "Usage: channel redirect <channel> <[[context,]exten,]priority>\n" 196 " Redirect an active channel to a specified extension.\n";
215 ast_cli(a->
fd,
"Channel '%s' not found\n", name);
224 ast_cli(a->
fd,
"Channel '%s' successfully redirected to %s\n", name, dest);
226 ast_cli(a->
fd,
"Channel '%s' failed to be redirected to %s\n", name, dest);
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
#define AST_CLI_DEFINE(fn, txt,...)
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
#define ast_channel_unref(c)
Decrease channel reference count.
descriptor for a cli entry.
char * ast_complete_applications(const char *line, const char *word, int state)
Command completion for the list of installed applications.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
static int unload_module(void)
static struct ast_cli_entry cli_cliorig[]
static char * orig_app(int fd, const char *chan, const char *app, const char *appdata)
orginate a call from the CLI
void ast_cli(int fd, const char *fmt,...)
int ast_pbx_outgoing_exten(const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *context, const char *exten, int priority, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel, int early_media, const struct ast_assigned_ids *assignedids)
Synchronously or asynchronously make an outbound call and send it to a particular extension...
int args
This gets set in ast_cli_register()
#define ast_strlen_zero(foo)
char * ast_cli_complete(const char *word, const char *const choices[], int pos)
General Asterisk PBX channel definitions.
static char * handle_orig(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
handle for orgination app or exten.
Asterisk internal frame definitions.
#define ao2_ref(o, delta)
#define ast_strdupa(s)
duplicate a string in memory from the stack
static char * orig_exten(int fd, const char *chan, const char *data)
orginate from extension
Core PBX routines and definitions.
static int load_module(void)
int ast_pbx_outgoing_app(const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *app, const char *appdata, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel, const struct ast_assigned_ids *assignedids)
Synchronously or asynchronously make an outbound call and execute an application on the channel...
Module has failed to load, may be in an inconsistent state.
int ast_async_parseable_goto(struct ast_channel *chan, const char *goto_string)
char * strsep(char **str, const char *delims)
Standard Command Line Interface.
static char * handle_redirect(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
char * ast_complete_channels(const char *line, const char *word, int pos, int state, int rpos)
Command completion for the list of active channels.
static char context[AST_MAX_CONTEXT]
#define ASTERISK_GPL_KEY
The text the key() function should return.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
Asterisk module definitions.