52#define MAX_AUTOMONS 1500
91 int i, x = 0, ms = 50;
109 mons[x++] = as->
chan;
111 ast_log(
LOG_WARNING,
"Exceeded maximum number of automatic monitoring events. Fix autoservice.c\n");
144 defer_frame = &hangup_frame;
153 for (i = 0; i < x; i++) {
156 if (mons[i] != chan) {
169 if (ents[i]->video_update) {
179 if (dup_f != defer_frame) {
207 ast_debug(1,
"Thread is a user interface, not putting channel %s into autoservice\n",
275 ast_debug(1,
"Thread is a user interface, not removing channel %s from autoservice\n",
291 if (as->
chan == chan) {
315 ast_debug(1,
"ast_autoservice_stop is called within the autoservice thread, channel %s\n",
382 pthread_kill(th, SIGURG);
383 pthread_join(th,
NULL);
Prototypes for public functions only of internal interest,.
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
#define ast_calloc(num, len)
A wrapper for calloc()
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
static int as_chan_list_state
static void * autoservice_run(void *ign)
static ast_cond_t as_cond
int ast_autoservice_start(struct ast_channel *chan)
Automatically service a channel for us...
void ast_autoservice_init(void)
static volatile int asexit
static void autoservice_shutdown(void)
static pthread_t asthread
int ast_autoservice_ignore(struct ast_channel *chan, enum ast_frame_type ftype)
Ignore certain frame types.
void ast_autoservice_chan_hangup_peer(struct ast_channel *chan, struct ast_channel *peer)
Put chan into autoservice while hanging up peer.
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
struct ast_channel * ast_waitfor_n(struct ast_channel **chan, int n, int *ms)
Waits for input on a group of channels Wait for input on an array of channels for a given # of millis...
#define ast_channel_lock(chan)
int ast_queue_frame_head(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to the head of a channel's frame queue.
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
ast_callid ast_channel_callid(const struct ast_channel *chan)
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
int ast_is_deferrable_frame(const struct ast_frame *frame)
Should we keep this frame for later?
#define ast_channel_unlock(chan)
Generic File Format Support. Should be included by clients of the file handling routines....
Asterisk internal frame definitions.
#define ast_frisolate(fr)
Makes a frame independent of any static storage.
#define ast_frdup(fr)
Copies a frame.
ast_frame_type
Frame types.
int ast_callid_threadassoc_change(ast_callid callid)
Sets what is stored in the thread storage to the given callid if it does not match what is already th...
#define ast_debug(level,...)
Log a DEBUG message.
A set of macros to manage forward-linked lists.
#define AST_LIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a list of specified type, statically initialized.
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
#define AST_LIST_LOCK(head)
Locks a list.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_LIST_UNLOCK(head)
Attempts to unlock a list.
Asterisk locking-related definitions:
#define ast_cond_wait(cond, mutex)
#define AST_PTHREADT_NULL
#define ast_cond_init(cond, attr)
pthread_cond_t ast_cond_t
#define ast_cond_signal(cond)
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
Core PBX routines and definitions.
Scheduler Routines (derived from cheops)
unsigned int ignore_frame_types
struct ast_channel * chan
unsigned int orig_end_dtmf_flag
unsigned int video_update
struct asent::@305 deferred_frames
Main Channel structure associated with a channel.
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
enum ast_frame_type frametype
Support for translation of data formats. translate.c.
#define ast_test_flag(p, flag)
int ast_thread_is_user_interface(void)
Indicates whether the current thread is a user interface.
#define ast_pthread_create_background(a, b, c, d)
#define ast_clear_flag(p, flag)
#define ast_set_flag(p, flag)