Asterisk - The Open Source Telephony Project
21.4.1
|
Full-featured outgoing call spool support. More...
#include "asterisk.h"
#include <sys/stat.h>
#include <time.h>
#include <utime.h>
#include <dirent.h>
#include <sys/inotify.h>
#include "asterisk/paths.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/logger.h"
#include "asterisk/channel.h"
#include "asterisk/callerid.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/utils.h"
#include "asterisk/options.h"
#include "asterisk/format.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | createlist |
struct | direntry |
struct | dirlist |
struct | openlist |
struct | outgoing |
Macros | |
#define | LINE_BUFFER_SIZE 1024 |
Enumerations | |
enum | { SPOOL_FLAG_ALWAYS_DELETE = (1 << 0), SPOOL_FLAG_ARCHIVE = (1 << 1), SPOOL_FLAG_EARLY_MEDIA = (1 << 2) } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | append_variable (struct outgoing *o, const char *name, const char *value) |
static int | apply_outgoing (struct outgoing *o, FILE *f) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void * | attempt_thread (void *data) |
static void | free_outgoing (struct outgoing *o) |
static void | launch_service (struct outgoing *o) |
static int | load_module (void) |
static struct outgoing * | new_outgoing (const char *fn) |
static void | parse_line (char *line, unsigned int lineno, struct outgoing *o) |
static void | queue_created_files (void) |
static void | queue_file (const char *filename, time_t when) |
static void | queue_file_create (const char *filename) |
static void | queue_file_open (const char *filename) |
static void | queue_file_write (const char *filename) |
static int | remove_from_queue (struct outgoing *o, const char *status) |
Remove a call file from the outgoing queue optionally moving it in the archive dir. More... | |
static void | safe_append (struct outgoing *o, time_t now, char *s) |
static int | scan_service (const char *fn, time_t now) |
static void * | scan_thread (void *unused) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Outgoing Spool Support" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "da6642af068ee5e6490c5b1d2cc1d238" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct createlist | createlist = { .first = NULL, .last = NULL, } |
static struct dirlist | dirlist = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , } |
static struct openlist | openlist = { .first = NULL, .last = NULL, } |
static char | qdir [255] |
static char | qdonedir [255] |
Full-featured outgoing call spool support.
Definition in file pbx_spool.c.
anonymous enum |
Enumerator | |
---|---|
SPOOL_FLAG_ALWAYS_DELETE |
Always delete the call file after a call succeeds or the maximum number of retries is exceeded, even if the modification time of the call file is in the future. |
Definition at line 62 of file pbx_spool.c.
|
static |
Remove a call file from the outgoing queue optionally moving it in the archive dir.
o | the pointer to outgoing struct |
status | the exit status of the call. Can be "Completed", "Failed" or "Expired" |
Definition at line 363 of file pbx_spool.c.
References AST_LIST_LOCK, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, ast_mkdir(), outgoing::fn, outgoing::options, and SPOOL_FLAG_ALWAYS_DELETE.
Referenced by scan_service().
|
static |
Definition at line 482 of file pbx_spool.c.
References ast_debug, outgoing::callingpid, outgoing::dest, outgoing::fn, outgoing::maxretries, remove_from_queue(), outgoing::retries, outgoing::retrytime, and outgoing::tech.