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 char exten[AST_MAX_EXTENSION]
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.
#define ast_debug(level,...)
Log a DEBUG message.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
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 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...
#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)