186 char *predial_callee =
NULL;
190 char *chantech, *chandata;
192 int continue_in_dialplan = 0;
193 int outgoing_status = 0;
195 static const char default_exten[] =
"s";
221 if(sscanf(
args.timeout,
"%u", &timeout) != 1) {
228 chantech =
strsep(&chandata,
"/");
254 if (strcasecmp(
args.type,
"exten") && strcasecmp(
args.type,
"app")) {
288 while ((vartext =
ast_strsep(&text,
'^', 0))) {
290 char *varname, *varvalue;
291 if (!(varname =
ast_strsep(&vartext,
'=', 0))) {
295 if (!(varvalue =
ast_strsep(&vartext,
'=', 0))) {
303 ast_debug(1,
"Appending variable '%s' with value '%s'", varname, varvalue);
308 if (!strcasecmp(
args.type,
"exten")) {
314 if (
args.argc == 5) {
316 if (sscanf(
args.arg3,
"%30d", &priority) != 1) {
320 }
else if (
args.argc == 3) {
322 exten = default_exten;
325 ast_debug(1,
"Originating call to '%s/%s' and connecting them to extension %s,%s,%d\n",
326 chantech, chandata,
args.arg1, exten, priority);
329 timeout * 1000,
args.arg1, exten, priority, &outgoing_status,
336 ast_debug(1,
"Originating call to '%s/%s' and connecting them to %s(%s)\n",
340 timeout * 1000,
args.arg1,
args.arg2, &outgoing_status,
352 if (res && outgoing_status) {
357 continue_in_dialplan = 1;
363 switch (outgoing_status) {
393 return continue_in_dialplan ? 0 : -1;
static int load_module(void)
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
char * str
Subscriber phone number (Malloced)
#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...
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
struct ast_party_name name
Subscriber name.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Structure for variables, used for configurations and for channel variables.
int ast_pbx_outgoing_exten_predial(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, const char *predial_callee)
char * str
Subscriber name (Malloced)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
static int originate_exec(struct ast_channel *chan, const char *data)
Structure used to handle a large number of boolean flags == used only in app_dial?
int ast_unregister_application(const char *app)
Unregister an application.
static const char app_originate[]
static char cid_num[AST_MAX_EXTENSION]
#define ast_strlen_zero(foo)
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
struct ast_party_id id
Caller party ID.
#define ast_debug(level,...)
Log a DEBUG message.
void ast_replace_subargument_delimiter(char *s)
Replace '^' in a string with ','.
General Asterisk PBX channel definitions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
char * ast_strsep(char **s, const char sep, uint32_t flags)
Act like strsep but ignore separators inside quotes.
#define ast_variable_new(name, value, filename)
Core PBX routines and definitions.
int ast_app_parse_options64(const struct ast_app_option *options, struct ast_flags64 *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
#define AST_APP_OPTION_ARG(option, flagno, argno)
Declares an application option that accepts an argument.
static const struct ast_app_option originate_exec_options[128]
static int unload_module(void)
static void parse(struct mgcp_request *req)
Module has failed to load, may be in an inconsistent state.
static char cid_name[AST_MAX_EXTENSION]
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...
char * strsep(char **str, const char *delims)
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
int ast_app_exec_sub(struct ast_channel *autoservice_chan, struct ast_channel *sub_chan, const char *sub_args, int ignore_hangup)
Run a subroutine on a channel, placing an optional second channel into autoservice.
int ast_pbx_outgoing_app_predial(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, const char *predial_callee)
union ast_frame::@263 data
#define AST_APP_OPTION(option, flagno)
Declares an application option that does not accept an argument.
#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_variable_list_append(head, new_var)
#define AST_APP_ARG(name)
Define an application argument.
struct ast_party_number number
Subscriber phone number.
#define ast_test_flag64(p, flag)