Asterisk - The Open Source Telephony Project
21.4.1
|
Automatic channel service routines. More...
#include "asterisk.h"
#include <sys/time.h>
#include <signal.h>
#include "asterisk/_private.h"
#include "asterisk/pbx.h"
#include "asterisk/frame.h"
#include "asterisk/sched.h"
#include "asterisk/channel.h"
#include "asterisk/file.h"
#include "asterisk/translate.h"
#include "asterisk/manager.h"
#include "asterisk/chanvars.h"
#include "asterisk/linkedlists.h"
#include "asterisk/indications.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
Go to the source code of this file.
Data Structures | |
struct | asent |
struct | aslist |
Macros | |
#define | MAX_AUTOMONS 1500 |
Functions | |
void | ast_autoservice_chan_hangup_peer (struct ast_channel *chan, struct ast_channel *peer) |
Put chan into autoservice while hanging up peer. More... | |
int | ast_autoservice_ignore (struct ast_channel *chan, enum ast_frame_type ftype) |
Ignore certain frame types. More... | |
void | ast_autoservice_init (void) |
int | ast_autoservice_start (struct ast_channel *chan) |
Automatically service a channel for us... More... | |
int | ast_autoservice_stop (struct ast_channel *chan) |
Stop servicing a channel for us... More... | |
static void * | autoservice_run (void *ign) |
static void | autoservice_shutdown (void) |
Variables | |
static int | as_chan_list_state |
static ast_cond_t | as_cond |
static volatile int | asexit = 0 |
static struct aslist | aslist = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , } |
static pthread_t | asthread = AST_PTHREADT_NULL |
Automatic channel service routines.
Definition in file autoservice.c.
void ast_autoservice_chan_hangup_peer | ( | struct ast_channel * | chan, |
struct ast_channel * | peer | ||
) |
Put chan into autoservice while hanging up peer.
chan | Chan to put into autoservice. |
peer | Chan to run hangup handlers and hangup. |
Definition at line 342 of file autoservice.c.
References ast_autoservice_start(), ast_autoservice_stop(), and ast_hangup().
Referenced by dial_exec_full().
int ast_autoservice_ignore | ( | struct ast_channel * | chan, |
enum ast_frame_type | ftype | ||
) |
Ignore certain frame types.
0 | success |
-1 | channel is not in autoservice |
Definition at line 352 of file autoservice.c.
References AST_LIST_LOCK, AST_LIST_TRAVERSE, and AST_LIST_UNLOCK.
void ast_autoservice_init | ( | void | ) |
Provided by autoservice.c
Definition at line 380 of file autoservice.c.
References ast_register_cleanup().
int ast_autoservice_start | ( | struct ast_channel * | chan | ) |
Automatically service a channel for us...
0 | success |
-1 | failure, or the channel is already being autoserviced |
Definition at line 200 of file autoservice.c.
References ast_calloc, ast_debug, AST_FLAG_END_DTMF_ONLY, AST_LIST_EMPTY, AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_REMOVE, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_thread_is_user_interface(), and asent::use_count.
Referenced by acf_odbc_write(), ast_app_exec_sub(), ast_audiosocket_connect(), ast_autoservice_chan_hangup_peer(), ast_dtmf_stream(), ast_get_enum(), ast_get_srv(), ast_get_txt(), ast_mf_stream(), ast_sf_stream(), begin_dial_prerun(), confbridge_exec(), dial_exec_full(), join_conference_bridge(), lua_autoservice_start(), lua_get_variable_value(), lua_pbx_exec(), lua_set_variable(), lua_set_variable_value(), push_announcer(), and ring_one().
int ast_autoservice_stop | ( | struct ast_channel * | chan | ) |
Stop servicing a channel for us...
chan |
0 | success |
-1 | error, or the channel has been hungup |
Definition at line 266 of file autoservice.c.
References ast_debug, AST_FLAG_END_DTMF_ONLY, AST_LIST_LOCK, AST_LIST_REMOVE_CURRENT, AST_LIST_REMOVE_HEAD, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, ast_queue_frame_head(), ast_thread_is_user_interface(), asent::deferred_frames, ast_frame::frametype, and asent::use_count.
Referenced by acf_odbc_write(), ast_app_exec_sub(), ast_audiosocket_connect(), ast_autoservice_chan_hangup_peer(), ast_dtmf_stream(), ast_get_enum(), ast_get_srv(), ast_get_txt(), ast_hangup(), ast_mf_stream(), ast_sf_stream(), begin_dial_prerun(), confbridge_exec(), dial_exec_full(), hangup_playback(), join_conference_bridge(), lua_autoservice_stop(), lua_get_variable_value(), lua_pbx_exec(), lua_set_variable(), lua_set_variable_value(), and ring_one().