40 #include "asterisk/file.h"
90 static char *
app =
"ParkAndAnnounce";
96 char *dialtech, *tmp[100], buf[13];
111 ast_log(
LOG_WARNING,
"ParkAndAnnounce requires arguments: (announce_template,timeout,dial,[return_context])\n");
119 timeout = atoi(
args.timeout) * 1000;
122 ast_log(
LOG_WARNING,
"PARK: A dial resource must be specified i.e: Console/dsp or DAHDI/g1/5551212\n");
127 ast_verb(3,
"Dial Tech,String: (%s,%s)\n", dialtech,
args.dial);
141 ast_verb(3,
"Warning: Return Context Invalid, call will return to default|s\n");
160 ast_verb(3,
"Call parked in space: %d, timeout: %d, return-context: %s\n",
161 lot, timeout,
args.return_context ?
args.return_context :
"");
165 snprintf(buf,
sizeof(buf),
"%d", lot);
179 ast_verb(4,
"Channel %s was never answered.\n", dchan->
name);
195 for (looptemp = 0; looptemp <
ARRAY_LEN(tmp); looptemp++) {
196 if ((tmp[looptemp] =
strsep(&
args.template,
":")) != NULL)
202 for (i = 0; i < looptemp; i++) {
203 ast_verb(4,
"Announce:%s\n", tmp[i]);
204 if (!strcmp(tmp[i],
"PARKED")) {
int ast_hangup(struct ast_channel *chan)
Hang up a channel.
Information needed to identify an endpoint in a call.
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
char * str
Subscriber phone number (Malloced)
#define AST_MODULE_INFO_STANDARD(keystr, desc)
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
struct ast_party_caller caller
Channel Caller ID information.
char * strsep(char **str, const char *delims)
struct ast_channel * parent_channel
struct ast_party_name name
Subscriber name.
char context[AST_MAX_CONTEXT]
struct ast_channel * __ast_request_and_dial(const char *type, format_t format, const struct ast_channel *requestor, void *data, int timeout, int *reason, const char *cid_num, const char *cid_name, struct outgoing_helper *oh)
Request a channel of a given type, with data as optional information used by the low level module and...
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
void ast_party_id_copy(struct ast_party_id *dest, const struct ast_party_id *src)
Copy the source party id information to the destination party id.
char * str
Subscriber name (Malloced)
int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang)
says digits
void ast_party_id_free(struct ast_party_id *doomed)
Destroy the party id contents.
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_verb(level,...)
struct ast_variable * vars
int ast_masq_park_call(struct ast_channel *park_me, struct ast_channel *parker, int timeout, int *extout)
Park a call via a masqueraded channel.
struct ast_party_id id
Caller party ID.
General Asterisk PBX channel definitions.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
Core PBX routines and definitions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
enum ast_channel_state _state
const ast_string_field name
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...
#define ast_channel_unlock(chan)
static int load_module(void)
void ast_party_id_init(struct ast_party_id *init)
Initialize the given party id structure.
#define ast_clear_flag(p, flag)
#define AST_FORMAT_SLINEAR
static int parkandannounce_exec(struct ast_channel *chan, const char *data)
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define AST_APP_ARG(name)
Define an application argument.
unsigned char valid
TRUE if the name information is valid/present.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Call Parking and Pickup API Includes code and algorithms from the Zapata library. ...
Say numbers and dates (maybe words one day too)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
unsigned char valid
TRUE if the number information is valid/present.
const ast_string_field language
static int unload_module(void)
char exten[AST_MAX_EXTENSION]
int ast_stopstream(struct ast_channel *c)
Stops a stream.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
struct ast_variable * ast_variable_new(const char *name, const char *value, const char *filename)
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
struct ast_party_number number
Subscriber phone number.