Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
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.
#define MAX_AUTOMONS 1500 |
Definition at line 52 of 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 349 of file autoservice.c.
References ast_autoservice_start(), ast_autoservice_stop(), and ast_hangup().
Referenced by app_exec(), bridge_failed_peer_goto(), dial_exec_full(), and try_calling().
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 359 of file autoservice.c.
References AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, asent::chan, asent::ignore_frame_types, and asent::list.
void ast_autoservice_init | ( | void | ) |
Provided by autoservice.c
Definition at line 387 of file autoservice.c.
References as_cond, ast_cond_init, ast_register_cleanup(), autoservice_shutdown(), and NULL.
Referenced by asterisk_daemon().
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 as_cond, ast_calloc, ast_channel_flags(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_cond_signal, ast_debug, AST_FLAG_END_DTMF_ONLY, ast_free, AST_LIST_EMPTY, AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_REMOVE, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_log, ast_pthread_create_background, AST_PTHREADT_NULL, ast_set_flag, ast_test_flag, ast_thread_is_user_interface(), asthread, autoservice_run(), asent::chan, asent::list, LOG_WARNING, NULL, asent::orig_end_dtmf_flag, and asent::use_count.
Referenced by acf_curl_helper(), acf_jabberreceive_read(), acf_odbc_read(), acf_odbc_write(), action_toggle_mute_participants(), app_exec(), 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(), conf_play(), confbridge_exec(), dial_exec_full(), exec(), findmeexec(), function_realtime_read(), function_realtime_readdestroy(), function_realtime_store(), function_realtime_write(), join_conference_bridge(), lock_read(), lua_autoservice_start(), lua_get_variable_value(), lua_pbx_exec(), lua_set_variable(), lua_set_variable_value(), mf_stream(), originate_exec(), pbx_find_extension(), playback_common(), post_join_play_begin(), push_announcer(), realtimefield_read(), reload_exec(), ring_one(), sf_stream(), shell_helper(), smdi_msg_retrieve_read(), srv_datastore_setup(), system_exec_helper(), try_calling(), and trylock_read().
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 as_chan_list_state, ast_channel_flags(), ast_channel_lock, ast_channel_name(), ast_channel_softhangup_internal_flag(), ast_channel_unlock, ast_clear_flag, ast_debug, AST_FLAG_END_DTMF_ONLY, ast_free, ast_frfree, 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_PTHREADT_NULL, ast_queue_frame_head(), ast_thread_is_user_interface(), asthread, asent::chan, asent::deferred_frames, ast_frame::frametype, asent::ignore_frame_types, NULL, asent::orig_end_dtmf_flag, and asent::use_count.
Referenced by acf_curl_helper(), acf_jabberreceive_read(), acf_odbc_read(), acf_odbc_write(), action_toggle_mute_participants(), app_exec(), array(), 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(), conf_play(), confbridge_exec(), dial_exec_full(), exec(), findmeexec(), function_realtime_read(), function_realtime_readdestroy(), function_realtime_store(), function_realtime_write(), hangup_playback(), join_conference_bridge(), lock_read(), lua_autoservice_stop(), lua_get_variable_value(), lua_pbx_exec(), lua_set_variable(), lua_set_variable_value(), mf_stream(), originate_exec(), pbx_find_extension(), playback_common(), post_join_play_begin(), realtimefield_read(), reload_exec(), ring_one(), sf_stream(), shell_helper(), smdi_msg_retrieve_read(), srv_datastore_setup(), system_exec_helper(), try_calling(), and trylock_read().
|
static |
Definition at line 78 of file autoservice.c.
References as_chan_list_state, as_cond, asexit, ast_callid_threadassoc_change(), ast_channel_callid(), ast_check_hangup(), ast_cond_wait, AST_CONTROL_HANGUP, AST_CONTROL_VIDUPDATE, AST_FRAME_CONTROL, ast_frdup, ast_frfree, ast_frisolate, ast_is_deferrable_frame(), AST_LIST_EMPTY, AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_log, AST_PTHREADT_NULL, ast_read(), ast_waitfor_n(), asthread, ast_channel::callid, asent::chan, ast_frame::frametype, ast_frame_subclass::integer, aslist::lock, LOG_WARNING, MAX_AUTOMONS, NULL, ast_frame::subclass, and asent::video_update.
Referenced by ast_autoservice_start().
|
static |
Definition at line 376 of file autoservice.c.
References as_cond, asexit, ast_cond_signal, AST_PTHREADT_NULL, asthread, and NULL.
Referenced by ast_autoservice_init().
|
static |
Definition at line 76 of file autoservice.c.
Referenced by ast_autoservice_stop(), and autoservice_run().
|
static |
Definition at line 71 of file autoservice.c.
Referenced by ast_autoservice_init(), ast_autoservice_start(), autoservice_run(), and autoservice_shutdown().
|
static |
Definition at line 74 of file autoservice.c.
Referenced by autoservice_run(), and autoservice_shutdown().
|
static |
|
static |
Definition at line 73 of file autoservice.c.
Referenced by ast_autoservice_start(), ast_autoservice_stop(), autoservice_run(), and autoservice_shutdown().