Asterisk - The Open Source Telephony Project GIT-master-3dae2cf
|
Call center agent pool. More...
#include "asterisk.h"
#include "asterisk/cli.h"
#include "asterisk/app.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/bridge.h"
#include "asterisk/bridge_internal.h"
#include "asterisk/bridge_basic.h"
#include "asterisk/bridge_after.h"
#include "asterisk/config_options.h"
#include "asterisk/features_config.h"
#include "asterisk/astobj2.h"
#include "asterisk/stringfields.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/causes.h"
Go to the source code of this file.
Data Structures | |
struct | agent_cfg |
struct | agent_complete |
struct | agent_pvt |
Structure representing an agent. More... | |
struct | agents_cfg |
Macros | |
#define | agent_lock(agent) _agent_lock(agent, __FILE__, __PRETTY_FUNCTION__, __LINE__, #agent) |
Lock the agent. More... | |
#define | agent_unlock(agent) _agent_unlock(agent, __FILE__, __PRETTY_FUNCTION__, __LINE__, #agent) |
Unlock the agent. More... | |
#define | AST_MAX_BUF 256 |
#define | CALLER_SAFETY_TIMEOUT_TIME (2 * 60 * 1000) |
#define | FORMAT_HDR "%-8s %-20s %-11s %-30s %s\n" |
#define | FORMAT_ROW "%-8s %-20s %-11s %-30s %s\n" |
#define | LOGIN_WAIT_TIMEOUT_TIME 5 |
Enumerations | |
enum | AGENT_LOGIN_OPT_FLAGS { OPT_SILENT = (1 << 0) } |
enum | agent_override_flags { AGENT_FLAG_ACK_CALL = (1 << 0) , AGENT_FLAG_DTMF_ACCEPT = (1 << 1) , AGENT_FLAG_AUTO_LOGOFF = (1 << 2) , AGENT_FLAG_WRAPUP_TIME = (1 << 3) } |
enum | agent_state { AGENT_STATE_LOGGED_OUT , AGENT_STATE_PROBATION_WAIT , AGENT_STATE_READY_FOR_CALL , AGENT_STATE_CALL_PRESENT , AGENT_STATE_CALL_WAIT_ACK , AGENT_STATE_ON_CALL , AGENT_STATE_CALL_WRAPUP , AGENT_STATE_LOGGING_OUT } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | _agent_lock (struct agent_pvt *agent, const char *file, const char *function, int line, const char *var) |
static void | _agent_unlock (struct agent_pvt *agent, const char *file, const char *function, int line, const char *var) |
static int | action_agent_logoff (struct mansession *s, const struct message *m) |
static int | action_agents (struct mansession *s, const struct message *m) |
static void | agent_after_bridge_cb (struct ast_channel *chan, void *data) |
static void | agent_after_bridge_cb_failed (enum ast_bridge_after_cb_reason reason, void *data) |
static void | agent_alert (struct ast_bridge_channel *bridge_channel, const void *payload, size_t payload_size) |
static struct ast_bridge_channel * | agent_bridge_channel_get_lock (struct agent_pvt *agent) |
static void * | agent_cfg_alloc (const char *name) |
static void | agent_cfg_destructor (void *vdoomed) |
static void * | agent_cfg_find (struct ao2_container *agents, const char *username) |
static int | agent_cfg_sort_cmp (const void *obj_left, const void *obj_right, int flags) |
static void | agent_connect_caller (struct ast_bridge_channel *bridge_channel, struct agent_pvt *agent) |
static void | agent_devstate_changed (const char *agent_id) |
static int | agent_function_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static char * | agent_handle_logoff_cmd (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | agent_handle_show_all (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | agent_handle_show_online (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | agent_handle_show_specific (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static struct ast_channel * | agent_lock_logged (struct agent_pvt *agent) |
static void | agent_login_channel_config (struct agent_pvt *agent, struct ast_channel *chan) |
static int | agent_login_exec (struct ast_channel *chan, const char *data) |
Dialplan AgentLogin application to log in an agent. More... | |
static int | agent_logoff_request (const char *agent_id, int soft) |
static void | agent_logout (struct agent_pvt *agent) |
static int | agent_mark (void *obj, void *arg, int flags) |
static int | agent_pvt_cmp (void *obj, void *arg, int flags) |
static void | agent_pvt_destructor (void *vdoomed) |
static enum ast_device_state | agent_pvt_devstate_get (const char *agent_id) |
static struct agent_pvt * | agent_pvt_new (struct agent_cfg *cfg) |
static int | agent_pvt_sort_cmp (const void *obj_left, const void *obj_right, int flags) |
static int | agent_request_exec (struct ast_channel *chan, const char *data) |
Dialplan AgentRequest application to locate an agent to talk with. More... | |
static void | agent_run (struct agent_pvt *agent, struct ast_channel *logged) |
static void | agent_show_requested (struct ast_cli_args *a, int online_only) |
static int | agent_sweep (void *obj, void *arg, int flags) |
static void * | agents_cfg_alloc (void) |
static void | agents_cfg_destructor (void *vdoomed) |
static void | agents_mark (void) |
static void | agents_post_apply_config (void) |
static void | agents_sweep (void) |
static | AO2_GLOBAL_OBJ_STATIC (agent_holding) |
static | AO2_GLOBAL_OBJ_STATIC (cfg_handle) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | bridge_agent_hold_ack (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
static int | bridge_agent_hold_deferred_create (void) |
static void | bridge_agent_hold_dissolving (struct ast_bridge *self) |
The bridge is being dissolved. More... | |
static int | bridge_agent_hold_heartbeat (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
static struct ast_bridge * | bridge_agent_hold_new (void) |
static void | bridge_agent_hold_pull (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel) |
static int | bridge_agent_hold_push (struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap) |
static void | bridge_init_agent_hold (void) |
static void | caller_abort_agent (struct agent_pvt *agent) |
static int | caller_joined_bridge (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
static int | caller_safety_timeout (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
static void | clear_agent_status (struct ast_bridge_channel *bridge_channel, const void *payload, size_t payload_size) |
static char * | complete_agent (const char *word, int state) |
static char * | complete_agent_logoff (const char *word, int state) |
static int | complete_agent_logoff_search (void *obj, void *arg, void *data, int flags) |
static int | complete_agent_search (void *obj, void *arg, void *data, int flags) |
CONFIG_INFO_STANDARD (cfg_info, cfg_handle, agents_cfg_alloc,.files=ACO_FILES(&agents_conf),.post_apply_config=agents_post_apply_config,) | |
static void | destroy_config (void) |
static int | load_config (void) |
static int | load_module (void) |
static int | reload (void) |
static void | send_agent_login (struct ast_channel *chan, const char *agent) |
static void | send_agent_logoff (struct ast_channel *chan, const char *agent, long logintime) |
static int | send_alert_to_agent (struct ast_bridge_channel *bridge_channel, const char *agent_id) |
static int | send_colp_to_agent (struct ast_bridge_channel *bridge_channel, struct ast_party_connected_line *connected) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Call center agent pool applications" , .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 = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_DEVSTATE_PROVIDER, } |
static struct ast_custom_function | agent_function |
static ast_mutex_t | agent_holding_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static const struct ast_app_option | agent_login_opts [128] = { [ 's' ] = { .flag = OPT_SILENT }, } |
static struct aco_type | agent_type |
static struct aco_type * | agent_types [] = ACO_TYPES(&agent_type) |
static struct ao2_container * | agents |
static struct aco_file | agents_conf |
static const char | app_agent_login [] = "AgentLogin" |
static const char | app_agent_request [] = "AgentRequest" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_bridge_methods | bridge_agent_hold_v_table |
static struct ast_cli_entry | cli_agents [] |
static struct aco_type | general_type |
#define agent_lock | ( | agent | ) | _agent_lock(agent, __FILE__, __PRETTY_FUNCTION__, __LINE__, #agent) |
#define agent_unlock | ( | agent | ) | _agent_unlock(agent, __FILE__, __PRETTY_FUNCTION__, __LINE__, #agent) |
#define AST_MAX_BUF 256 |
Definition at line 342 of file app_agent_pool.c.
#define CALLER_SAFETY_TIMEOUT_TIME (2 * 60 * 1000) |
Maximum wait time (in ms) for the custom_beep file to play announcing the caller.
Definition at line 345 of file app_agent_pool.c.
#define FORMAT_HDR "%-8s %-20s %-11s %-30s %s\n" |
#define FORMAT_ROW "%-8s %-20s %-11s %-30s %s\n" |
#define LOGIN_WAIT_TIMEOUT_TIME 5 |
Number of seconds to wait for local channel optimizations to complete.
Definition at line 348 of file app_agent_pool.c.
Enumerator | |
---|---|
OPT_SILENT |
Definition at line 2074 of file app_agent_pool.c.
enum agent_override_flags |
Agent config option override flags.
Enumerator | |
---|---|
AGENT_FLAG_ACK_CALL | |
AGENT_FLAG_DTMF_ACCEPT | |
AGENT_FLAG_AUTO_LOGOFF | |
AGENT_FLAG_WRAPUP_TIME |
Definition at line 586 of file app_agent_pool.c.
enum agent_state |
Definition at line 566 of file app_agent_pool.c.
|
static |
Definition at line 2694 of file app_agent_pool.c.
|
static |
Definition at line 2694 of file app_agent_pool.c.
|
inlinestatic |
Definition at line 657 of file app_agent_pool.c.
References __ao2_lock(), AO2_LOCK_REQ_MUTEX, make_ari_stubs::file, and var.
|
inlinestatic |
Definition at line 668 of file app_agent_pool.c.
References __ao2_unlock(), make_ari_stubs::file, and var.
|
static |
Definition at line 2583 of file app_agent_pool.c.
References agent_logoff_request(), ast_strlen_zero(), ast_true(), astman_get_header(), astman_send_ack(), and astman_send_error().
Referenced by load_module().
|
static |
Definition at line 2505 of file app_agent_pool.c.
References agent_lock, agent_lock_logged(), agent_unlock, agents, ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_channel_snapshot_create(), ast_channel_unlock, ast_channel_unref, ast_free, ast_manager_build_channel_state_string(), AST_MAX_BUF, ast_str_alloca, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_strlen_zero(), astman_append(), astman_get_header(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), agent_pvt::call_start, agent_pvt::cfg, agent_cfg::full_name, agent_pvt::login_start, out, pbx_builtin_getvar_helper(), RAII_VAR, and agent_pvt::username.
Referenced by load_module().
|
static |
Definition at line 1598 of file app_agent_pool.c.
References agent_run(), agents, ao2_find, ao2_ref, ast_channel_name(), ast_debug, and agent_pvt::username.
Referenced by bridge_agent_hold_push().
|
static |
Definition at line 1613 of file app_agent_pool.c.
References agent_lock, agent_logout(), agents, ao2_find, ao2_ref, ast_bridge_after_cb_reason_string(), ast_channel_name(), ast_log, ast_channel::data, LOG_WARNING, and agent_pvt::username.
Referenced by bridge_agent_hold_push().
|
static |
Definition at line 1718 of file app_agent_pool.c.
References agent_cfg::ack_call, agent_pvt::ack_time, agent_connect_caller(), AGENT_FLAG_ACK_CALL, AGENT_FLAG_DTMF_ACCEPT, agent_lock, AGENT_STATE_CALL_PRESENT, AGENT_STATE_CALL_WAIT_ACK, agent_unlock, agents, ao2_find, ao2_ref, ast_bridge_channel_clear_roles(), ast_bridge_channel_establish_roles(), ast_bridge_channel_feature_digit(), ast_bridge_channel_lock_bridge(), ast_bridge_unlock, ast_channel_set_bridge_role_option(), ast_debug, AST_DIGIT_ANY, ast_stopstream(), ast_strdupa, ast_stream_and_wait(), ast_strlen_zero(), ast_test_flag, ast_tvnow(), agent_cfg::beep_sound, ast_bridge_channel::bridge, agent_pvt::cfg, ast_bridge_channel::chan, digit, agent_cfg::dtmf_accept, NULL, OBJ_KEY, agent_pvt::override_ack_call, agent_pvt::override_dtmf_accept, agent_pvt::state, and agent_pvt::username.
Referenced by send_alert_to_agent().
|
static |
Definition at line 1640 of file app_agent_pool.c.
References agent_lock, agent_unlock, ao2_ref, ast_bridge_channel_lock, ast_bridge_channel_unlock, ast_channel_get_bridge_channel(), ast_channel_lock, ast_channel_ref, ast_channel_unlock, ast_channel_unref, bc, agent_pvt::logged, and NULL.
Referenced by agent_request_exec(), caller_abort_agent(), and caller_joined_bridge().
|
static |
Definition at line 440 of file app_agent_pool.c.
References agent_cfg_destructor(), AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ast_string_field_init, ast_string_field_set, name, NULL, and agent_cfg::username.
|
static |
Definition at line 433 of file app_agent_pool.c.
References ast_string_field_free_memory.
Referenced by agent_cfg_alloc().
|
static |
Definition at line 454 of file app_agent_pool.c.
References agents, ao2_find, OBJ_KEY, and agent_cfg::username.
|
static |
Definition at line 411 of file app_agent_pool.c.
References OBJ_KEY, OBJ_PARTIAL_KEY, OBJ_POINTER, and agent_cfg::username.
Referenced by agents_cfg_alloc().
|
static |
Definition at line 1022 of file app_agent_pool.c.
References AGENT_STATE_ON_CALL, agent_unlock, ao2_t_ref, AST_BRIDGE_BUILTIN_AUTOMIXMON, ast_bridge_channel_leave_bridge(), ast_bridge_channel_write_callback(), ast_bridge_channel_write_control_data(), ast_bridge_destroy(), ast_bridge_features_do(), ast_bridge_move(), AST_CAUSE_NORMAL_CLEARING, AST_CONTROL_ANSWER, AUTO_MONITOR_START, ast_bridge_channel::bridge, BRIDGE_CHANNEL_STATE_END, agent_pvt::call_start, agent_pvt::caller_bridge, agent_pvt::cfg, ast_bridge_channel::chan, clear_agent_status(), NULL, options, agent_cfg::record_agent_calls, and agent_pvt::state.
Referenced by agent_alert(), and bridge_agent_hold_ack().
|
static |
Definition at line 748 of file app_agent_pool.c.
References AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, and ast_devstate_changed().
Referenced by agent_logout(), agent_pvt_destructor(), agent_request_exec(), agents_post_apply_config(), bridge_agent_hold_heartbeat(), and bridge_agent_hold_push().
|
static |
Definition at line 2162 of file app_agent_pool.c.
References agent_lock, agent_lock_logged(), agent_unlock, agents, ao2_find, ao2_ref, args, AST_APP_ARG, ast_channel_name(), ast_channel_unlock, ast_channel_unref, ast_copy_string(), AST_DECLARE_APP_ARGS, ast_log, AST_NONSTANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), buf, agent_pvt::cfg, ast_channel::data, agent_cfg::full_name, item, len(), LOG_WARNING, agent_pvt::logged, agent_cfg::moh, OBJ_KEY, and status.
|
static |
Definition at line 2463 of file app_agent_pool.c.
References a, agent_logoff_request(), ast_cli(), ast_strdup, ast_strlen_zero(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_agent_logoff(), NULL, and ast_cli_entry::usage.
|
static |
Definition at line 2382 of file app_agent_pool.c.
References a, agent_show_requested(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 2360 of file app_agent_pool.c.
References a, agent_show_requested(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 2404 of file app_agent_pool.c.
References a, agent_lock, agent_lock_logged(), agent_unlock, agents, ao2_find, ao2_ref, ast_channel_name(), ast_channel_unlock, ast_channel_unref, ast_cli(), AST_CLI_YESNO, ast_devstate_str(), ast_str_alloca, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_strlen_zero(), agent_cfg::beep_sound, agent_pvt::call_start, agent_pvt::cfg, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_agent(), agent_pvt::devstate, agent_cfg::full_name, agent_pvt::login_start, agent_cfg::moh, NULL, OBJ_KEY, out, pbx_builtin_getvar_helper(), agent_cfg::record_agent_calls, ast_cli_entry::usage, and agent_pvt::username.
|
static |
Definition at line 684 of file app_agent_pool.c.
References agent_lock, agent_unlock, ast_channel_lock, ast_channel_ref, ast_channel_unlock, ast_channel_unref, agent_pvt::logged, and NULL.
Referenced by action_agents(), agent_function_read(), agent_handle_show_specific(), agent_logoff_request(), and agent_show_requested().
|
static |
Definition at line 2018 of file app_agent_pool.c.
References AGENT_FLAG_ACK_CALL, AGENT_FLAG_AUTO_LOGOFF, AGENT_FLAG_DTMF_ACCEPT, AGENT_FLAG_WRAPUP_TIME, agent_lock, agent_unlock, ast_channel_connected(), ast_channel_lock, ast_channel_unlock, ast_copy_flags, AST_FLAGS_ALL, ast_party_connected_line_copy(), ast_party_connected_line_free(), ast_party_connected_line_init(), ast_set_flag, ast_strdupa, ast_string_field_set, ast_strlen_zero(), ast_true(), connected, NULL, agent_pvt::override_ack_call, agent_pvt::override_auto_logoff, agent_pvt::override_wrapup_time, pbx_builtin_getvar_helper(), var, and agent_pvt::waiting_colp.
Referenced by agent_login_exec().
|
static |
Dialplan AgentLogin application to log in an agent.
chan | Channel attempting to login as an agent. |
data | Application parameters |
0 | To continue in dialplan. |
-1 | To hangup. |
Definition at line 2090 of file app_agent_pool.c.
References agent_lock, agent_login_channel_config(), agent_login_opts, agent_run(), agent_unlock, agents, ao2_cleanup, ao2_find, args, ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_channel_lock, ast_channel_readformat(), ast_channel_ref, ast_channel_unlock, ast_channel_writeformat(), AST_DECLARE_APP_ARGS, AST_DIGIT_NONE, ast_format_get_name(), ast_log, AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_strdupa, ast_stream_and_wait(), ast_strlen_zero(), ast_test_flag, ast_tvnow(), ast_verb, bridge_agent_hold_deferred_create(), LOG_WARNING, NULL, OBJ_KEY, OPT_SILENT, options, pbx_builtin_setvar_helper(), RAII_VAR, and send_agent_login().
Referenced by load_module().
|
static |
Definition at line 967 of file app_agent_pool.c.
References agent_lock, agent_lock_logged(), agent_unlock, agents, ao2_cleanup, ao2_find, ast_channel_unlock, ast_channel_unref, ast_softhangup(), AST_SOFTHANGUP_EXPLICIT, OBJ_KEY, and RAII_VAR.
Referenced by action_agent_logoff(), and agent_handle_logoff_cmd().
|
static |
Definition at line 1463 of file app_agent_pool.c.
References agent_devstate_changed(), AGENT_STATE_LOGGED_OUT, agent_unlock, ast_bridge_destroy(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, ast_clear_flag, AST_DEVICE_UNAVAILABLE, AST_FLAGS_ALL, ast_verb, agent_pvt::caller_bridge, agent_pvt::devstate, agent_pvt::logged, agent_pvt::login_start, NULL, send_agent_logoff(), agent_pvt::state, and agent_pvt::username.
Referenced by agent_after_bridge_cb_failed(), and agent_run().
|
static |
Definition at line 866 of file app_agent_pool.c.
References agent_lock, agent_unlock, and agent_pvt::the_mark.
Referenced by agents_mark().
|
static |
Definition at line 844 of file app_agent_pool.c.
References CMP_MATCH, agent_pvt::flags, agent_pvt::logged, OBJ_KEY, OBJ_PARTIAL_KEY, and OBJ_POINTER.
Referenced by load_module().
|
static |
Definition at line 753 of file app_agent_pool.c.
References agent_devstate_changed(), ao2_cleanup, ast_bridge_destroy(), ast_channel_unref, ast_debug, ast_party_connected_line_free(), ast_string_field_free_memory, ast_strlen_zero(), agent_pvt::caller_bridge, agent_pvt::cfg, agent_pvt::logged, NULL, agent_pvt::username, and agent_pvt::waiting_colp.
Referenced by agent_pvt_new().
|
static |
Definition at line 726 of file app_agent_pool.c.
References agent_lock, agent_unlock, agents, ao2_find, ao2_ref, AST_DEVICE_INVALID, agent_pvt::devstate, and OBJ_KEY.
Referenced by load_module().
Definition at line 776 of file app_agent_pool.c.
References agent_pvt_destructor(), ao2_alloc, ao2_ref, AST_DEVICE_UNAVAILABLE, ast_party_connected_line_init(), ast_string_field_init, ast_string_field_set, agent_pvt::cfg, agent_pvt::devstate, NULL, agent_cfg::username, agent_pvt::username, and agent_pvt::waiting_colp.
Referenced by agents_post_apply_config().
|
static |
Definition at line 812 of file app_agent_pool.c.
References agent_pvt::flags, OBJ_KEY, OBJ_PARTIAL_KEY, OBJ_POINTER, and agent_pvt::username.
Referenced by load_module().
|
static |
Dialplan AgentRequest application to locate an agent to talk with.
chan | Channel wanting to talk with an agent. |
data | Application parameters |
0 | To continue in dialplan. |
-1 | To hangup. |
Definition at line 1869 of file app_agent_pool.c.
References __ao2_cleanup(), agent_bridge_channel_get_lock(), agent_devstate_changed(), agent_lock, AGENT_STATE_CALL_PRESENT, AGENT_STATE_LOGGED_OUT, AGENT_STATE_LOGGING_OUT, AGENT_STATE_READY_FOR_CALL, agent_unlock, agents, ao2_cleanup, ao2_find, ao2_ref, args, AST_APP_ARG, ast_bridge_basic_new(), ast_bridge_channel_unlock, ast_bridge_destroy(), ast_bridge_features_cleanup(), ast_bridge_features_init(), AST_BRIDGE_HOOK_REMOVE_ON_PULL, ast_bridge_interval_hook(), ast_bridge_join(), ast_bridge_join_hook(), AST_BRIDGE_JOIN_PASS_REFERENCE, ast_channel_caller(), ast_channel_flags(), ast_channel_lock, ast_channel_name(), ast_channel_softhangup_internal_flag(), ast_channel_unlock, ast_check_hangup(), ast_connected_line_copy_from_caller(), AST_DECLARE_APP_ARGS, AST_DEVICE_INUSE, AST_FLAG_ZOMBIE, ast_log, ast_party_connected_line_free(), ast_party_connected_line_init(), AST_SOFTHANGUP_ASYNCGOTO, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ast_test_flag, ast_verb, bridge_agent_hold_deferred_create(), caller_abort_agent(), caller_joined_bridge(), caller_safety_timeout(), CALLER_SAFETY_TIMEOUT_TIME, connected, LOG_WARNING, NULL, OBJ_KEY, pbx_builtin_getvar_helper(), pbx_builtin_setvar_helper(), RAII_VAR, and send_colp_to_agent().
Referenced by load_module().
|
static |
Definition at line 1500 of file app_agent_pool.c.
References agent_lock, agent_logout(), AGENT_STATE_LOGGING_OUT, agent_unlock, agents_cfg::agents, ao2_find, ao2_global_obj_ref, ao2_ref, ast_bridge_destroy(), ast_bridge_features_cleanup(), ast_bridge_features_init(), ast_bridge_join(), AST_BRIDGE_JOIN_PASS_REFERENCE, AST_CAUSE_NORMAL_CLEARING, ast_channel_hangupcause_set(), ast_channel_name(), ast_channel_update_connected_line(), ast_check_hangup_locked(), ast_debug, ast_tvnow(), agent_pvt::caller_bridge, agent_pvt::cfg, cfg_handle, agent_pvt::dead, agent_pvt::deferred_logoff, agent_pvt::last_disconnect, agent_pvt::logged, NULL, OBJ_KEY, agent_pvt::state, agent_pvt::username, and agent_pvt::waiting_colp.
Referenced by agent_after_bridge_cb(), and agent_login_exec().
|
static |
Definition at line 2305 of file app_agent_pool.c.
References a, agent_lock, agent_lock_logged(), agent_unlock, agents, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_channel_name(), ast_channel_unlock, ast_channel_unref, ast_cli(), ast_devstate_str(), ast_str_alloca, ast_str_buffer(), ast_str_set(), ast_strlen_zero(), agent_pvt::cfg, agent_pvt::devstate, FORMAT_HDR, FORMAT_ROW, agent_cfg::full_name, out, pbx_builtin_getvar_helper(), and agent_pvt::username.
Referenced by agent_handle_show_all(), and agent_handle_show_online().
|
static |
Definition at line 881 of file app_agent_pool.c.
References agent_lock, agent_unlock, CMP_MATCH, agent_pvt::dead, and agent_pvt::the_mark.
Referenced by agents_sweep().
|
static |
Definition at line 512 of file app_agent_pool.c.
References agent_cfg_sort_cmp(), agents_cfg::agents, agents_cfg_destructor(), AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT, ao2_container_alloc_rbtree, ao2_ref, and NULL.
|
static |
Definition at line 492 of file app_agent_pool.c.
References agents_cfg::agents, ao2_cleanup, and NULL.
Referenced by agents_cfg_alloc().
|
static |
Definition at line 876 of file app_agent_pool.c.
References agent_mark(), agents, ao2_callback, and NULL.
Referenced by agents_post_apply_config().
|
static |
Definition at line 927 of file app_agent_pool.c.
References agent_devstate_changed(), agent_lock, agent_pvt_new(), agent_unlock, agents, agents_mark(), agents_sweep(), ao2_cleanup, ao2_find, ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_link, ao2_ref, ast_assert, ast_debug, cfg_handle, NULL, OBJ_KEY, RAII_VAR, and agent_cfg::username.
|
static |
Definition at line 897 of file app_agent_pool.c.
References agent_lock, agent_sweep(), agent_unlock, agents, ao2_callback, ao2_iterator_destroy(), ao2_iterator_next, ao2_ref, ast_channel_name(), ast_channel_ref, ast_channel_unref, ast_log, ast_softhangup(), AST_SOFTHANGUP_EXPLICIT, LOG_NOTICE, agent_pvt::logged, NULL, OBJ_MULTIPLE, OBJ_UNLINK, and agent_pvt::username.
Referenced by agents_post_apply_config().
|
static |
Agent holding bridge instance holder.
|
static |
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 2694 of file app_agent_pool.c.
|
static |
Definition at line 1073 of file app_agent_pool.c.
References agent_connect_caller(), agent_lock, AGENT_STATE_CALL_WAIT_ACK, agent_unlock, ast_debug, agent_pvt::state, and agent_pvt::username.
Referenced by bridge_agent_hold_push().
|
static |
Definition at line 1403 of file app_agent_pool.c.
References agent_holding_lock, ao2_cleanup, ao2_global_obj_ref, ao2_global_obj_replace_unref, ast_log, ast_mutex_lock, ast_mutex_unlock, bridge_agent_hold_new(), LOG_ERROR, and RAII_VAR.
Referenced by agent_login_exec(), and agent_request_exec().
|
static |
The bridge is being dissolved.
self | Bridge to operate upon. |
The bridge is being dissolved. Remove any external references to the bridge so it can be destroyed.
Definition at line 1372 of file app_agent_pool.c.
References ao2_global_obj_release, ast_bridge_base_v_table, and ast_bridge_methods::dissolving.
Referenced by bridge_init_agent_hold().
|
static |
Definition at line 1091 of file app_agent_pool.c.
References agent_pvt::ack_time, agent_devstate_changed(), AGENT_FLAG_AUTO_LOGOFF, AGENT_FLAG_WRAPUP_TIME, agent_lock, AGENT_STATE_CALL_WAIT_ACK, AGENT_STATE_CALL_WRAPUP, AGENT_STATE_LOGGING_OUT, AGENT_STATE_PROBATION_WAIT, AGENT_STATE_READY_FOR_CALL, agent_unlock, ast_bridge_channel_leave_bridge(), AST_CAUSE_NORMAL_CLEARING, ast_debug, AST_DEVICE_NOT_INUSE, ast_test_flag, ast_tvdiff_ms(), ast_tvnow(), agent_cfg::auto_logoff, BRIDGE_CHANNEL_STATE_END, agent_pvt::cfg, agent_pvt::deferred_logoff, agent_pvt::devstate, agent_pvt::last_disconnect, LOGIN_WAIT_TIMEOUT_TIME, NULL, agent_pvt::override_auto_logoff, agent_pvt::override_wrapup_time, agent_pvt::probation_start, agent_pvt::state, agent_pvt::username, and agent_cfg::wrapup_time.
Referenced by bridge_agent_hold_push().
|
static |
Definition at line 1380 of file app_agent_pool.c.
References AST_BRIDGE_CAPABILITY_HOLDING, AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM, AST_BRIDGE_FLAG_MERGE_INHIBIT_TO, AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM, AST_BRIDGE_FLAG_TRANSFER_PROHIBITED, bridge_agent_hold_v_table, bridge_alloc(), bridge_base_init(), bridge_register(), and NULL.
Referenced by bridge_agent_hold_deferred_create().
|
static |
Definition at line 1355 of file app_agent_pool.c.
References ast_bridge_base_v_table, ast_channel_remove_bridge_role(), ast_channel::bridge_channel, ast_bridge_channel::chan, and ast_bridge_methods::pull.
Referenced by bridge_init_agent_hold().
|
static |
Need to determine if there are any local channels that can optimize and wait until they actually do before leaving the AGENT_STATE_PROBATION_WAIT state. For now, the blind timer of LOGIN_WAIT_TIMEOUT_TIME will do.
Definition at line 1184 of file app_agent_pool.c.
References __ao2_cleanup(), agent_after_bridge_cb(), agent_after_bridge_cb_failed(), agent_devstate_changed(), AGENT_FLAG_ACK_CALL, AGENT_FLAG_DTMF_ACCEPT, AGENT_FLAG_WRAPUP_TIME, agent_lock, AGENT_STATE_CALL_PRESENT, AGENT_STATE_CALL_WAIT_ACK, AGENT_STATE_CALL_WRAPUP, AGENT_STATE_LOGGED_OUT, AGENT_STATE_ON_CALL, AGENT_STATE_PROBATION_WAIT, AGENT_STATE_READY_FOR_CALL, agent_unlock, agents, ao2_cleanup, ao2_find, ao2_ref, ast_assert, ast_bridge_base_v_table, ast_bridge_channel_leave_bridge(), ast_bridge_dtmf_hook(), AST_BRIDGE_HOOK_REMOVE_ON_PULL, ast_bridge_interval_hook(), ast_bridge_set_after_callback(), AST_CAUSE_NORMAL_CLEARING, ast_channel_add_bridge_role(), ast_channel_ref, ast_channel_remove_bridge_role(), ast_channel_set_bridge_role_option(), ast_channel_unref, ast_copy_string(), ast_debug, AST_DEVICE_NOT_INUSE, AST_FEATURE_MAX_LEN, ast_strdupa, ast_strlen_zero(), ast_test_flag, bridge_agent_hold_ack(), bridge_agent_hold_heartbeat(), ast_channel::bridge_channel, BRIDGE_CHANNEL_STATE_END, ast_bridge_channel::chan, ast_bridge_channel::features, NULL, ast_bridge_methods::push, and RAII_VAR.
Referenced by bridge_init_agent_hold().
|
static |
Definition at line 1393 of file app_agent_pool.c.
References ast_bridge_base_v_table, bridge_agent_hold_dissolving(), bridge_agent_hold_pull(), bridge_agent_hold_push(), bridge_agent_hold_v_table, ast_bridge_methods::dissolving, ast_bridge_methods::name, ast_bridge_methods::pull, and ast_bridge_methods::push.
Referenced by load_module().
|
static |
Definition at line 1676 of file app_agent_pool.c.
References agent_bridge_channel_get_lock(), agent_lock, agent_unlock, ast_bridge_channel_leave_bridge_nolock(), ast_bridge_channel_unlock, ast_bridge_destroy(), AST_CAUSE_NORMAL_CLEARING, ast_debug, BRIDGE_CHANNEL_STATE_END, agent_pvt::caller_bridge, NULL, and agent_pvt::username.
Referenced by agent_request_exec(), caller_joined_bridge(), and caller_safety_timeout().
|
static |
Definition at line 1827 of file app_agent_pool.c.
References agent_bridge_channel_get_lock(), ao2_ref, ast_bridge_channel_leave_bridge(), ast_bridge_channel_unlock, AST_CONTROL_RINGING, ast_indicate(), ast_verb, BRIDGE_CHANNEL_STATE_END, caller_abort_agent(), ast_bridge_channel::chan, pbx_builtin_setvar_helper(), send_alert_to_agent(), and agent_pvt::username.
Referenced by agent_request_exec().
|
static |
Definition at line 1702 of file app_agent_pool.c.
References AGENT_STATE_CALL_PRESENT, ast_bridge_channel_leave_bridge(), ast_log, BRIDGE_CHANNEL_STATE_END, caller_abort_agent(), ast_bridge_channel::chan, LOG_WARNING, pbx_builtin_setvar_helper(), agent_pvt::state, and agent_pvt::username.
Referenced by agent_request_exec().
|
static |
Definition at line 1007 of file app_agent_pool.c.
References ast_channel::bridge_channel, ast_bridge_channel::chan, NULL, and pbx_builtin_setvar_helper().
Referenced by agent_connect_caller().
|
static |
Definition at line 2255 of file app_agent_pool.c.
References agents, ao2_callback_data, ao2_ref, ast_strdup, ast_strlen_zero(), complete_agent_search(), NULL, OBJ_PARTIAL_KEY, agent_complete::state, state, and agent_pvt::username.
Referenced by agent_handle_show_specific().
|
static |
Definition at line 2287 of file app_agent_pool.c.
References agents, ao2_callback_data, ao2_ref, ast_strdup, ast_strlen_zero(), complete_agent_logoff_search(), NULL, OBJ_PARTIAL_KEY, agent_complete::state, state, and agent_pvt::username.
Referenced by agent_handle_logoff_cmd().
|
static |
Definition at line 2273 of file app_agent_pool.c.
References CMP_MATCH, agent_pvt::logged, agent_complete::state, and agent_complete::which.
Referenced by complete_agent_logoff().
|
static |
Definition at line 2245 of file app_agent_pool.c.
References CMP_MATCH, agent_complete::state, and agent_complete::which.
Referenced by complete_agent().
CONFIG_INFO_STANDARD | ( | cfg_info | , |
cfg_handle | , | ||
agents_cfg_alloc | , | ||
. | files = ACO_FILES(&agents_conf) , |
||
. | post_apply_config = agents_post_apply_config |
||
) |
|
static |
Definition at line 537 of file app_agent_pool.c.
References aco_info_destroy(), ao2_global_obj_release, and cfg_handle.
Referenced by unload_module().
|
static |
Definition at line 543 of file app_agent_pool.c.
References ACO_EXACT, aco_info_init(), aco_option_register, aco_process_config(), ACO_PROCESS_ERROR, agent_types, FLDSET, NULL, OPT_BOOL_T, OPT_STRINGFIELD_T, OPT_UINT_T, and STRFLDSET.
Referenced by load_module().
|
static |
Definition at line 2634 of file app_agent_pool.c.
References action_agent_logoff(), action_agents(), agent_function, agent_login_exec(), agent_pvt_cmp(), agent_pvt_devstate_get(), agent_pvt_sort_cmp(), agent_request_exec(), agents, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE, ao2_container_alloc_rbtree, app_agent_login, app_agent_request, ARRAY_LEN, ast_cli_register_multiple, ast_custom_function_register, ast_devstate_prov_add(), ast_log, ast_manager_register_xml, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_register_application_xml, bridge_init_agent_hold(), cli_agents, EVENT_FLAG_AGENT, load_config(), LOG_ERROR, and unload_module().
|
static |
Definition at line 2679 of file app_agent_pool.c.
References aco_process_config(), and ACO_PROCESS_ERROR.
|
static |
Definition at line 1423 of file app_agent_pool.c.
References ast_assert, ast_channel_agent_login_type(), ast_channel_publish_blob(), ast_json_pack(), ast_json_unref(), NULL, and RAII_VAR.
Referenced by agent_login_exec().
|
static |
Definition at line 1438 of file app_agent_pool.c.
References ast_assert, ast_channel_agent_logoff_type(), ast_channel_publish_blob(), ast_json_pack(), ast_json_unref(), NULL, and RAII_VAR.
Referenced by agent_logout().
|
static |
Definition at line 1792 of file app_agent_pool.c.
References agent_alert(), AST_BRIDGE_CHANNEL_CB_OPTION_MEDIA, and ast_bridge_channel_queue_callback().
Referenced by caller_joined_bridge().
|
static |
Definition at line 1798 of file app_agent_pool.c.
References ast_bridge_channel_queue_control_data(), ast_connected_line_build_data(), AST_CONTROL_CONNECTED_LINE, connected, and update().
Referenced by agent_request_exec().
|
static |
Definition at line 2602 of file app_agent_pool.c.
References agent_function, agents, ao2_cleanup, ao2_global_obj_replace, app_agent_login, app_agent_request, ARRAY_LEN, ast_bridge_destroy(), ast_cli_unregister_multiple(), ast_custom_function_unregister(), ast_devstate_prov_del(), ast_manager_unregister(), ast_unregister_application(), cli_agents, destroy_config(), and NULL.
Referenced by load_module().
|
static |
Definition at line 2694 of file app_agent_pool.c.
|
static |
Definition at line 2233 of file app_agent_pool.c.
Referenced by load_module(), and unload_module().
|
static |
Agent holding bridge deferred creation lock.
Definition at line 995 of file app_agent_pool.c.
Referenced by bridge_agent_hold_deferred_create().
|
static |
Definition at line 2079 of file app_agent_pool.c.
Referenced by agent_login_exec().
|
static |
Definition at line 465 of file app_agent_pool.c.
Referenced by ast_channel_get_cc_agent_type().
|
static |
Definition at line 475 of file app_agent_pool.c.
Referenced by load_config().
|
static |
Container of defined agents.
Definition at line 649 of file app_agent_pool.c.
Referenced by action_agents(), agent_after_bridge_cb(), agent_after_bridge_cb_failed(), agent_alert(), agent_cfg_find(), agent_function_read(), agent_handle_show_specific(), agent_login_exec(), agent_logoff_request(), agent_pvt_devstate_get(), agent_request_exec(), agent_show_requested(), agents_mark(), agents_post_apply_config(), agents_sweep(), bridge_agent_hold_push(), complete_agent(), complete_agent_logoff(), load_module(), and unload_module().
|
static |
Definition at line 485 of file app_agent_pool.c.
|
static |
Definition at line 350 of file app_agent_pool.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 351 of file app_agent_pool.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 2694 of file app_agent_pool.c.
|
static |
Definition at line 1378 of file app_agent_pool.c.
Referenced by bridge_agent_hold_new(), and bridge_init_agent_hold().
|
static |
Definition at line 2498 of file app_agent_pool.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 478 of file app_agent_pool.c.