43 #include "asterisk/file.h"
106 char *chantech, *chandata;
108 int outgoing_status = 0;
109 static const unsigned int timeout = 30;
110 static const char default_exten[] =
"s";
129 chantech =
strsep(&chandata,
"/");
136 if (!strcasecmp(
args.type,
"exten")) {
140 if (
args.argc == 5) {
142 if (sscanf(
args.arg3,
"%30d", &priority) != 1) {
146 }
else if (
args.argc == 3) {
148 exten = default_exten;
151 ast_debug(1,
"Originating call to '%s/%s' and connecting them to extension %s,%s,%d\n",
152 chantech, chandata,
args.arg1, exten, priority);
155 timeout * 1000,
args.arg1, exten, priority, &outgoing_status, 0, NULL,
156 NULL, NULL, NULL, NULL);
157 }
else if (!strcasecmp(
args.type,
"app")) {
158 ast_debug(1,
"Originating call to '%s/%s' and connecting them to %s(%s)\n",
162 timeout * 1000,
args.arg1,
args.arg2, &outgoing_status, 0, NULL,
163 NULL, NULL, NULL, NULL);
176 switch (outgoing_status) {
static int load_module(void)
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
int ast_autoservice_start(struct ast_channel *chan)
Automatically service a channel for us...
char * strsep(char **str, const char *delims)
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
static int originate_exec(struct ast_channel *chan, const char *data)
int ast_unregister_application(const char *app)
Unregister an application.
static const char app_originate[]
#define ast_debug(level,...)
Log a DEBUG message.
General Asterisk PBX channel definitions.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Core PBX routines and definitions.
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
#define ast_strdupa(s)
duplicate a string in memory from the stack
int ast_pbx_outgoing_exten(const char *type, format_t format, void *data, int timeout, const char *context, const char *exten, int priority, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel)
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...
static int unload_module(void)
static void parse(struct mgcp_request *req)
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...
#define AST_FORMAT_SLINEAR
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
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.
int ast_pbx_outgoing_app(const char *type, format_t format, void *data, int timeout, const char *app, const char *appdata, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
union ast_frame::@172 data
#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.