Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
True call queues with optional send URL on answer. More...
#include "asterisk.h"
#include <sys/time.h>
#include <signal.h>
#include <netinet/in.h>
#include <ctype.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/app.h"
#include "asterisk/linkedlists.h"
#include "asterisk/module.h"
#include "asterisk/translate.h"
#include "asterisk/say.h"
#include "asterisk/features.h"
#include "asterisk/musiconhold.h"
#include "asterisk/cli.h"
#include "asterisk/manager.h"
#include "asterisk/config.h"
#include "asterisk/utils.h"
#include "asterisk/causes.h"
#include "asterisk/astdb.h"
#include "asterisk/devicestate.h"
#include "asterisk/stringfields.h"
#include "asterisk/astobj2.h"
#include "asterisk/strings.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/aoc.h"
#include "asterisk/callerid.h"
#include "asterisk/term.h"
#include "asterisk/dial.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_message_router.h"
#include "asterisk/bridge_after.h"
#include "asterisk/stasis_bridges.h"
#include "asterisk/core_local.h"
#include "asterisk/mixmonitor.h"
#include "asterisk/bridge_basic.h"
#include "asterisk/max_forwards.h"
Go to the source code of this file.
Data Structures | |
struct | autopause |
struct | call_queue |
struct | callattempt |
We define a custom "local user" structure because we use it not only for keeping track of what is in use but also for keeping track of who we're dialing. More... | |
struct | local_optimization |
Structure representing relevant data during a local channel optimization. More... | |
struct | member |
struct | penalty_rule |
struct | queue_end_bridge |
struct | queue_ent |
struct | queue_stasis_data |
User data for stasis subscriptions used for queue calls. More... | |
struct | rule_list |
struct | rule_lists |
struct | strategy |
Functions | |
static char * | __queues_show (struct mansession *s, int fd, int argc, const char *const *argv) |
Show queue(s) status and statistics. More... | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | add_to_queue (const char *queuename, const char *interface, const char *membername, int penalty, int paused, int dump, const char *state_interface, const char *reason_paused, int wrapuptime) |
Add member to queue. More... | |
static struct call_queue * | alloc_queue (const char *queuename) |
AO2_STRING_FIELD_SORT_FN (call_queue, name) | |
static int | aqm_exec (struct ast_channel *chan, const char *data) |
AddQueueMember application. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | autopause2int (const char *autopause) |
static int | calc_metric (struct call_queue *q, struct member *mem, int pos, struct queue_ent *qe, struct callattempt *tmp) |
Calculate the metric of each member in the outgoing callattempts. More... | |
static void | callattempt_free (struct callattempt *doomed) |
static int | can_ring_entry (struct queue_ent *qe, struct callattempt *call) |
static int | change_priority_caller_on_queue (const char *queuename, const char *caller, int priority, int immediate) |
Change priority caller into a queue. More... | |
static void | clear_queue (struct call_queue *q) |
static int | clear_stats (const char *queuename) |
Facilitates resetting statistics for a queue. More... | |
static int | compare_weight (struct call_queue *rq, struct member *member) |
static char * | complete_queue (const char *line, const char *word, int pos, int state, ptrdiff_t word_list_offset) |
Check if a given word is in a space-delimited list. More... | |
static char * | complete_queue_add_member (const char *line, const char *word, int pos, int state) |
static char * | complete_queue_pause_member (const char *line, const char *word, int pos, int state) |
static char * | complete_queue_remove_member (const char *line, const char *word, int pos, int state) |
static char * | complete_queue_rule_show (const char *line, const char *word, int pos, int state) |
static char * | complete_queue_set_member_value (const char *line, const char *word, int pos, int state) |
static char * | complete_queue_show (const char *line, const char *word, int pos, int state) |
static int | compress_char (const char c) |
static int | context_included (const char *parent, const char *child) |
Returns if one context includes another context. More... | |
static void | copy_rules (struct queue_ent *qe, const char *rulename) |
Copy rule from global list into specified queue. More... | |
static struct member * | create_queue_member (const char *interface, const char *membername, int penalty, int paused, const char *state_interface, int ringinuse, int wrapuptime) |
allocate space for new queue member and set fields based on parameters passed More... | |
static void | destroy_queue (void *obj) |
Free queue's member list then its string fields. More... | |
static void | destroy_queue_member_cb (void *obj) |
static void | device_state_cb (void *unused, struct stasis_subscription *sub, struct stasis_message *msg) |
set a member's status based on device state of that member's interface More... | |
static void | do_hang (struct callattempt *o) |
common hangup actions More... | |
static void | do_print (struct mansession *s, int fd, const char *str) |
direct output to manager or cli with proper terminator More... | |
static void | dump_queue_members (struct call_queue *pm_queue) |
Dump all members in a specific queue to the database. More... | |
static void | end_bridge_callback (void *data) |
static void | end_bridge_callback_data_fixup (struct ast_bridge_config *bconfig, struct ast_channel *originator, struct ast_channel *terminator) |
static void | escape_and_substitute (struct ast_channel *chan, const char *input, char *output, size_t size) |
static int | extension_state_cb (const char *context, const char *exten, struct ast_state_cb_info *info, void *data) |
static int | extensionstate2devicestate (int state) |
Helper function which converts from extension state to device state values. More... | |
static struct callattempt * | find_best (struct callattempt *outgoing) |
find the entry with the best metric, or NULL More... | |
static struct call_queue * | find_load_queue_rt_friendly (const char *queuename) |
static struct member * | find_member_by_queuename_and_interface (const char *queuename, const char *interface) |
Find a member by looking up queuename and interface. More... | |
static struct call_queue * | find_queue_by_name_rt (const char *queuename, struct ast_variable *queue_vars, struct ast_config *member_config) |
Reload a single queue via realtime. More... | |
static void | free_members (struct call_queue *q, int all) |
Iterate through queue's member list and delete them. More... | |
static struct member * | get_interface_helper (struct call_queue *q, const char *interface) |
static int | get_member_penalty (char *queuename, char *interface) |
Gets members penalty. More... | |
static int | get_member_status (struct call_queue *q, int max_penalty, int min_penalty, int raise_penalty, enum empty_conditions conditions, int devstate) |
Check if members are available. More... | |
static int | get_queue_member_status (struct member *cur) |
Return the current state of a member. More... | |
static int | get_wrapuptime (struct call_queue *q, struct member *member) |
Return wrapuptime. More... | |
static void | handle_attended_transfer (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
Handle an attended transfer event. More... | |
static void | handle_blind_transfer (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
Handle a blind transfer event. More... | |
static void | handle_bridge_enter (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static void | handle_hangup (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static void | handle_local_optimization_begin (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static void | handle_local_optimization_end (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static void | handle_masquerade (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static char * | handle_queue_add_member (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_queue_change_priority_caller (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_queue_pause_member (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_queue_reload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_queue_remove_member (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_queue_reset (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_queue_rule_show (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_queue_set_member_penalty (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_queue_set_member_ringinuse (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void | hangupcalls (struct queue_ent *qe, struct callattempt *outgoing, struct ast_channel *exception, int cancel_answered_elsewhere) |
Hang up a list of outgoing calls. More... | |
static void | init_queue (struct call_queue *q) |
Initialize Queue default values. More... | |
static void | insert_entry (struct call_queue *q, struct queue_ent *prev, struct queue_ent *new, int *pos) |
Insert the 'new' entry after the 'prev' entry of queue 'q'. More... | |
static int | insert_penaltychange (const char *list_name, const char *content, const int linenum) |
Change queue penalty by adding rule. More... | |
static const char * | int2strat (int strategy) |
static struct member * | interface_exists (struct call_queue *q, const char *interface) |
static int | is_longest_waiting_caller (struct queue_ent *caller, struct member *member) |
static int | is_member_available (struct call_queue *q, struct member *mem) |
static int | is_our_turn (struct queue_ent *qe) |
Check if we should start attempting to call queue members. More... | |
static int | join_queue (char *queuename, struct queue_ent *qe, enum queue_result *reason, int position) |
static int | kill_dead_members (void *obj, void *arg, int flags) |
static int | kill_if_unfound (void *obj, void *arg, int flags) |
static void | leave_queue (struct queue_ent *qe) |
Caller leaving queue. More... | |
static int | load_module (void) |
Load the module. More... | |
static void | load_realtime_queues (const char *queuename) |
static int | load_realtime_rules (void) |
Load queue rules from realtime. More... | |
static void | log_attended_transfer (struct queue_stasis_data *queue_data, struct ast_attended_transfer_message *atxfer_msg) |
static int | manager_add_queue_member (struct mansession *s, const struct message *m) |
static int | manager_change_priority_caller_on_queue (struct mansession *s, const struct message *m) |
static int | manager_pause_queue_member (struct mansession *s, const struct message *m) |
static int | manager_queue_log_custom (struct mansession *s, const struct message *m) |
static int | manager_queue_member_penalty (struct mansession *s, const struct message *m) |
static int | manager_queue_member_ringinuse (struct mansession *s, const struct message *m) |
static int | manager_queue_reload (struct mansession *s, const struct message *m) |
static int | manager_queue_reset (struct mansession *s, const struct message *m) |
static int | manager_queue_rule_show (struct mansession *s, const struct message *m) |
static int | manager_queues_status (struct mansession *s, const struct message *m) |
Queue status info via AMI. More... | |
static int | manager_queues_summary (struct mansession *s, const struct message *m) |
Summary of queue info via the AMI. More... | |
static int | manager_remove_queue_member (struct mansession *s, const struct message *m) |
static int | manager_request_withdraw_caller_from_queue (struct mansession *s, const struct message *m) |
static int | mark_member_dead (void *obj, void *arg, int flags) |
static int | mark_unfound (void *obj, void *arg, int flags) |
static void | member_add_to_queue (struct call_queue *queue, struct member *mem) |
static int | member_cmp_fn (void *obj1, void *obj2, int flags) |
static int | member_hash_fn (const void *obj, const int flags) |
static void | member_remove_from_queue (struct call_queue *queue, struct member *mem) |
static int | member_status_available (int status) |
static int | num_available_members (struct call_queue *q) |
Get the number of members available to accept a call. More... | |
static void | parse_empty_options (const char *value, enum empty_conditions *empty, int joinempty) |
static int | pending_members_cmp (void *obj, void *arg, int flags) |
static int | pending_members_hash (const void *obj, const int flags) |
static void | pending_members_remove (struct member *mem) |
static int | play_file (struct ast_channel *chan, const char *filename) |
static int | pqm_exec (struct ast_channel *chan, const char *data) |
PauseQueueMember application. More... | |
static void | print_queue (struct mansession *s, int fd, struct call_queue *q) |
Print a single queue to AMI or the CLI. More... | |
static void | publish_dial_end_event (struct ast_channel *in, struct callattempt *outgoing, struct ast_channel *exception, const char *status) |
static int | publish_queue_member_pause (struct call_queue *q, struct member *member) |
static int | ql_exec (struct ast_channel *chan, const char *data) |
QueueLog application. More... | |
static struct ast_manager_event_blob * | queue_agent_called_to_ami (struct stasis_message *message) |
static void | queue_agent_cb (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static struct ast_manager_event_blob * | queue_agent_complete_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_agent_connect_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_agent_dump_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_agent_ringnoanswer_to_ami (struct stasis_message *message) |
static void | queue_bridge_cb (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static struct ast_manager_event_blob * | queue_caller_abandon_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_caller_join_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_caller_leave_to_ami (struct stasis_message *message) |
static void | queue_channel_cb (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static struct ast_manager_event_blob * | queue_channel_to_ami (const char *type, struct stasis_message *message) |
static int | queue_cmp_cb (void *obj, void *arg, int flags) |
static int | queue_delme_members_decrement_followers (void *obj, void *arg, int flag) |
static int | queue_exec (struct ast_channel *chan, const char *data) |
The starting point for all queue calls. More... | |
static int | queue_function_exists (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
Check if a given queue exists. More... | |
static int | queue_function_mem_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
Get number either busy / free / ready or total members of a specific queue. More... | |
static int | queue_function_mem_write (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
Dialplan function QUEUE_MEMBER() Sets the members penalty / paused / ringinuse. More... | |
static int | queue_function_memberpenalty_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
Dialplan function QUEUE_MEMBER_PENALTY() Gets the members penalty. More... | |
static int | queue_function_memberpenalty_write (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
Dialplan function QUEUE_MEMBER_PENALTY() Sets the members penalty. More... | |
static int | queue_function_qac_dep (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
Get the total number of members in a specific queue (Deprecated) More... | |
static int | queue_function_queuegetchannel (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
Dialplan function QUEUE_GET_CHANNEL() Get caller channel waiting at specified position in the queue. More... | |
static int | queue_function_queuememberlist (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
Dialplan function QUEUE_MEMBER_LIST() Get list of members in a specific queue. More... | |
static int | queue_function_queuewaitingcount (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
Dialplan function QUEUE_WAITING_COUNT() Get number callers waiting in a specific queue. More... | |
static int | queue_function_var (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
create interface var with all queue details. More... | |
static int | queue_hash_cb (const void *obj, const int flags) |
static struct ast_manager_event_blob * | queue_member_added_to_ami (struct stasis_message *message) |
static struct ast_json * | queue_member_blob_create (struct call_queue *q, struct member *mem) |
static int | queue_member_decrement_followers (void *obj, void *arg, int flag) |
static void | queue_member_follower_removal (struct call_queue *queue, struct member *mem) |
static struct ast_manager_event_blob * | queue_member_pause_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_member_penalty_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_member_removed_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_member_ringinuse_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_member_status_to_ami (struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_member_to_ami (const char *type, struct stasis_message *message) |
static struct ast_manager_event_blob * | queue_multi_channel_to_ami (const char *type, struct stasis_message *message) |
static void | queue_publish_member_blob (struct stasis_message_type *type, struct ast_json *blob) |
static void | queue_publish_multi_channel_blob (struct ast_channel *caller, struct ast_channel *agent, struct stasis_message_type *type, struct ast_json *blob) |
static void | queue_publish_multi_channel_snapshot_blob (struct stasis_topic *topic, struct ast_channel_snapshot *caller_snapshot, struct ast_channel_snapshot *agent_snapshot, struct stasis_message_type *type, struct ast_json *blob) |
static void | queue_reset_global_params (void) |
static void | queue_rules_reset_global_params (void) |
static void | queue_rules_set_global_params (struct ast_config *cfg) |
static void | queue_set_global_params (struct ast_config *cfg) |
static void | queue_set_param (struct call_queue *q, const char *param, const char *val, int linenum, int failunknown) |
Configure a queue parameter. More... | |
static char * | queue_show (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static struct queue_stasis_data * | queue_stasis_data_alloc (struct queue_ent *qe, struct ast_channel *peer, struct member *mem, time_t holdstart, time_t starttime, int callcompletedinsl) |
static void | queue_stasis_data_destructor (void *obj) |
static int | qupd_exec (struct ast_channel *chan, const char *data) |
Update Queue with data of an outgoing call. More... | |
static void | recalc_holdtime (struct queue_ent *qe, int newholdtime) |
static void | record_abandoned (struct queue_ent *qe) |
Record that a caller gave up on waiting in queue. More... | |
static int | reload (void) |
static int | reload_handler (int reload, struct ast_flags *mask, const char *queuename) |
The command center for all reload operations. More... | |
static void | reload_queue_members (void) |
Reload dynamic queue members persisted into the astdb. More... | |
static int | reload_queue_rules (int reload) |
Reload the rules defined in queuerules.conf. More... | |
static int | reload_queues (int reload, struct ast_flags *mask, const char *queuename) |
reload the queues.conf file More... | |
static void | reload_single_member (const char *memberdata, struct call_queue *q) |
reload information pertaining to a single member More... | |
static void | reload_single_queue (struct ast_config *cfg, struct ast_flags *mask, const char *queuename) |
Reload information pertaining to a particular queue. More... | |
static int | remove_from_queue (const char *queuename, const char *interface) |
Remove member from queue. More... | |
static void | remove_stasis_subscriptions (struct queue_stasis_data *queue_data) |
static int | request_withdraw_caller_from_queue (const char *queuename, const char *caller, const char *withdraw_info) |
Request to withdraw a caller from a queue. More... | |
static int | ring_entry (struct queue_ent *qe, struct callattempt *tmp, int *busies) |
Part 2 of ring_one. More... | |
static int | ring_one (struct queue_ent *qe, struct callattempt *outgoing, int *busies) |
Place a call to a queue member. More... | |
static void | rna (int rnatime, struct queue_ent *qe, struct ast_channel *peer, char *interface, char *membername, int autopause) |
RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer. More... | |
static int | rqm_exec (struct ast_channel *chan, const char *data) |
RemoveQueueMember application. More... | |
static void | rt_handle_member_record (struct call_queue *q, char *category, struct ast_config *member_config) |
Find rt member record to update otherwise create one. More... | |
static int | say_periodic_announcement (struct queue_ent *qe, int ringing) |
Playback announcement to queued members if period has elapsed. More... | |
static int | say_position (struct queue_ent *qe, int ringing) |
static void | send_agent_complete (const char *queuename, struct ast_channel_snapshot *caller, struct ast_channel_snapshot *peer, const struct member *member, time_t holdstart, time_t callstart, enum agent_complete_reason rsn) |
Send out AMI message with member call completion status information. More... | |
static int | set_member_paused (const char *queuename, const char *interface, const char *reason, int paused) |
static int | set_member_penalty_help_members (struct call_queue *q, const char *interface, int penalty) |
static int | set_member_ringinuse_help_members (struct call_queue *q, const char *interface, int ringinuse) |
static int | set_member_value (const char *queuename, const char *interface, int property, int value) |
static int | set_member_value_help_members (struct call_queue *q, const char *interface, int property, int value) |
static void | set_queue_member_pause (struct call_queue *q, struct member *mem, const char *reason, int paused) |
static void | set_queue_member_ringinuse (struct call_queue *q, struct member *mem, int ringinuse) |
static void | set_queue_result (struct ast_channel *chan, enum queue_result res) |
sets the QUEUESTATUS channel variable More... | |
static void | set_queue_variables (struct call_queue *q, struct ast_channel *chan) |
Set variables of queue. More... | |
static void | setup_mixmonitor (struct queue_ent *qe, const char *filename) |
static void | setup_peer_after_bridge_goto (struct ast_channel *chan, struct ast_channel *peer, struct ast_flags *opts, char *opt_args[]) |
static int | setup_stasis_subs (struct queue_ent *qe, struct ast_channel *peer, struct member *mem, time_t holdstart, time_t starttime, int callcompletedinsl) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_agent_called_type,.to_ami=queue_agent_called_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_agent_complete_type,.to_ami=queue_agent_complete_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_agent_connect_type,.to_ami=queue_agent_connect_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_agent_dump_type,.to_ami=queue_agent_dump_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_agent_ringnoanswer_type,.to_ami=queue_agent_ringnoanswer_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_caller_abandon_type,.to_ami=queue_caller_abandon_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_caller_join_type,.to_ami=queue_caller_join_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_caller_leave_type,.to_ami=queue_caller_leave_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_member_added_type,.to_ami=queue_member_added_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_member_pause_type,.to_ami=queue_member_pause_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_member_penalty_type,.to_ami=queue_member_penalty_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_member_removed_type,.to_ami=queue_member_removed_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_member_ringinuse_type,.to_ami=queue_member_ringinuse_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_member_status_type,.to_ami=queue_member_status_to_ami,) | |
static int | store_next_lin (struct queue_ent *qe, struct callattempt *outgoing) |
Search for best metric and add to Linear queue. More... | |
static int | store_next_rr (struct queue_ent *qe, struct callattempt *outgoing) |
Search for best metric and add to Round Robbin queue. More... | |
static int | strat2int (const char *strategy) |
static int | try_calling (struct queue_ent *qe, struct ast_flags opts, char **opt_args, char *announceoverride, const char *url, int *tries, int *noption, const char *agi, const char *gosub, int ringing) |
static int | unload_module (void) |
static void | update_connected_line_from_peer (struct ast_channel *chan, struct ast_channel *peer, int is_caller) |
static void | update_qe_rule (struct queue_ent *qe) |
update rules for queues More... | |
static int | update_queue (struct call_queue *q, struct member *member, int callcompletedinsl, time_t starttime) |
update the queue status More... | |
static int | update_realtime_member_field (struct member *mem, const char *queue_name, const char *field, const char *value) |
static void | update_realtime_members (struct call_queue *q) |
static void | update_status (struct call_queue *q, struct member *m, const int status) |
set a member's status based on device state of that member's state_interface. More... | |
static int | upqm_exec (struct ast_channel *chan, const char *data) |
UnpauseQueueMember application. More... | |
static int | valid_exit (struct queue_ent *qe, char digit) |
Check for valid exit from queue via goto. More... | |
static int | wait_a_bit (struct queue_ent *qe) |
static struct callattempt * | wait_for_answer (struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed) |
Wait for a member to answer the call. More... | |
static int | wait_our_turn (struct queue_ent *qe, int ringing, enum queue_result *reason) |
The waiting areas for callers who are not actively calling members. More... | |
static int | word_in_list (const char *list, const char *word) |
Check if a given word is in a space-delimited list. More... | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "True Call Queueing" , .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_CONSUMER, } |
static struct stasis_message_router * | agent_router |
static char * | app = "Queue" |
static char * | app_aqm = "AddQueueMember" |
static char * | app_pqm = "PauseQueueMember" |
static char * | app_ql = "QueueLog" |
static char * | app_qupd = "QueueUpdate" |
static char * | app_rqm = "RemoveQueueMember" |
static char * | app_upqm = "UnpauseQueueMember" |
static const struct ast_app_option | aqm_opts [128] = { [ 'p' ] = { .flag = AQMFLAG_PAUSED }, [ 'r' ] = { .flag = AQMFLAG_REASON , .arg_index = AQM_OPT_ARG_PAUSE_REASON + 1 }, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static int | autofill_default |
queues.conf [general] option More... | |
static const struct autopause | autopausesmodes [] |
static struct ast_cli_entry | cli_queue [] |
static struct stasis_subscription * | device_state_sub |
Subscription to device state change messages. More... | |
static int | force_longest_waiting_caller |
queues.conf [general] option More... | |
static int | log_membername_as_agent |
queues.conf [general] option More... | |
static int | montype_default |
queues.conf [general] option More... | |
static int | negative_penalty_invalid |
queues.conf [general] option More... | |
static struct ao2_container * | pending_members |
static const char *const | pm_family = "Queue/PersistentMembers" |
Persistent Members astdb family. More... | |
static const struct ast_app_option | queue_exec_options [128] = { [ 'b' ] = { .flag = OPT_PREDIAL_CALLEE , .arg_index = OPT_ARG_PREDIAL_CALLEE + 1 }, [ 'B' ] = { .flag = OPT_PREDIAL_CALLER , .arg_index = OPT_ARG_PREDIAL_CALLER + 1 }, [ 'C' ] = { .flag = OPT_MARK_AS_ANSWERED }, [ 'c' ] = { .flag = OPT_GO_ON }, [ 'd' ] = { .flag = OPT_DATA_QUALITY }, [ 'F' ] = { .flag = OPT_CALLEE_GO_ON , .arg_index = OPT_ARG_CALLEE_GO_ON + 1 }, [ 'h' ] = { .flag = OPT_CALLEE_HANGUP }, [ 'H' ] = { .flag = OPT_CALLER_HANGUP }, [ 'i' ] = { .flag = OPT_IGNORE_CALL_FW }, [ 'I' ] = { .flag = OPT_IGNORE_CONNECTEDLINE }, [ 'k' ] = { .flag = OPT_CALLEE_PARK }, [ 'K' ] = { .flag = OPT_CALLER_PARK }, [ 'm' ] = { .flag = OPT_MUSICONHOLD_CLASS , .arg_index = OPT_ARG_MUSICONHOLD_CLASS + 1 }, [ 'n' ] = { .flag = OPT_NO_RETRY }, [ 'r' ] = { .flag = OPT_RINGING }, [ 'R' ] = { .flag = OPT_RING_WHEN_RINGING }, [ 't' ] = { .flag = OPT_CALLEE_TRANSFER }, [ 'T' ] = { .flag = OPT_CALLER_TRANSFER }, [ 'x' ] = { .flag = OPT_CALLEE_AUTOMIXMON }, [ 'X' ] = { .flag = OPT_CALLER_AUTOMIXMON }, [ 'w' ] = { .flag = OPT_CALLEE_AUTOMON }, [ 'W' ] = { .flag = OPT_CALLER_AUTOMON }, } |
static int | queue_persistent_members |
queues.conf [general] option More... | |
struct { | |
enum queue_result id | |
char * text | |
} | queue_results [] |
static struct ast_custom_function | queueexists_function |
static struct ast_custom_function | queuegetchannel_function |
static struct ast_custom_function | queuemembercount_dep |
static struct ast_custom_function | queuemembercount_function |
static struct ast_custom_function | queuememberlist_function |
static struct ast_custom_function | queuememberpenalty_function |
static struct ao2_container * | queues |
static struct ast_custom_function | queuevar_function |
static struct ast_custom_function | queuewaitingcount_function |
static int | realtime_reason_paused |
does realtime backend support reason_paused More... | |
static char * | realtime_ringinuse_field |
name of the ringinuse field in the realtime database More... | |
static int | realtime_rules |
queuerules.conf [general] option More... | |
static struct rule_lists | rule_lists = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , } |
static int | shared_lastcall |
queues.conf [general] option More... | |
static const struct strategy | strategies [] |
static struct stasis_forward * | topic_forwarder |
static int | use_weight |
Records that one or more queues use weight. More... | |
True call queues with optional send URL on answer.
Each dynamic agent in each queue is now stored in the astdb. When asterisk is restarted, each agent will be automatically readded into their recorded queues. This feature can be configured with the 'persistent_members=<1|0>' setting in the '[general]' category in queues.conf. The default is on.
Patch Version 1.07 2003-12-24 01
Added servicelevel statistic by Michiel Betel michi.nosp@m.el@b.nosp@m.etel..nosp@m.nl Added Priority jumping code for adding and removing queue members by Jonathan Stanton aster.nosp@m.isk@.nosp@m.doilo.nosp@m.okli.nosp@m.keica.nosp@m.re.c.nosp@m.om
Fixed to work with CVS as of 2004-02-25 and released as 1.07a by Matthew Enger m.eng.nosp@m.er@x.nosp@m.i.com.nosp@m..au
Definition in file app_queue.c.
#define ANNOUNCEHOLDTIME_ALWAYS 1 |
Definition at line 1800 of file app_queue.c.
#define ANNOUNCEHOLDTIME_ONCE 2 |
Definition at line 1801 of file app_queue.c.
#define ANNOUNCEPOSITION_LIMIT 4 |
We not announce position more than <limit>
Definition at line 1818 of file app_queue.c.
#define ANNOUNCEPOSITION_MORE_THAN 3 |
We say "Currently there are more than <limit>"
Definition at line 1817 of file app_queue.c.
#define ANNOUNCEPOSITION_NO 2 |
We don't announce position
Definition at line 1816 of file app_queue.c.
#define ANNOUNCEPOSITION_YES 1 |
We announce position
Definition at line 1815 of file app_queue.c.
#define AST_MAX_WATCHERS 256 |
Definition at line 5220 of file app_queue.c.
#define DEFAULT_MIN_ANNOUNCE_FREQUENCY 15 |
The minimum number of seconds between position announcements.
Definition at line 1590 of file app_queue.c.
#define DEFAULT_RETRY 5 |
Definition at line 1582 of file app_queue.c.
#define DEFAULT_TIMEOUT 15 |
Definition at line 1583 of file app_queue.c.
#define MAX_CALL_ATTEMPT_BUCKETS 353 |
Definition at line 2543 of file app_queue.c.
#define MAX_PERIODIC_ANNOUNCEMENTS 10 |
The maximum periodic announcements we can have
Definition at line 1585 of file app_queue.c.
#define MAX_QUEUE_BUCKETS 53 |
Definition at line 1592 of file app_queue.c.
#define QUEUE_EVENT_VARIABLES 3 |
Definition at line 1802 of file app_queue.c.
#define QUEUE_PAUSED_DEVSTATE AST_DEVICE_INUSE |
Definition at line 3565 of file app_queue.c.
#define queue_ref | ( | q | ) | ao2_bump(q) |
Definition at line 2084 of file app_queue.c.
#define queue_t_ref | ( | q, | |
tag | |||
) | ao2_t_bump(q, tag) |
Definition at line 2086 of file app_queue.c.
#define queue_t_unref | ( | q, | |
tag | |||
) | ({ ao2_t_cleanup(q, tag); NULL; }) |
Definition at line 2087 of file app_queue.c.
#define QUEUE_UNKNOWN_PAUSED_DEVSTATE AST_DEVICE_NOT_INUSE |
Definition at line 3567 of file app_queue.c.
#define QUEUE_UNPAUSED_DEVSTATE AST_DEVICE_NOT_INUSE |
Definition at line 3566 of file app_queue.c.
#define queue_unref | ( | q | ) | ({ ao2_cleanup(q); NULL; }) |
Definition at line 2085 of file app_queue.c.
#define queues_t_link | ( | c, | |
q, | |||
tag | |||
) | ao2_t_link(c, q, tag) |
Definition at line 2088 of file app_queue.c.
#define queues_t_unlink | ( | c, | |
q, | |||
tag | |||
) | ao2_t_unlink(c, q, tag) |
Definition at line 2089 of file app_queue.c.
#define RECHECK 1 |
Recheck every second to see we we're at the top yet
Definition at line 1584 of file app_queue.c.
#define RES_EXISTS (-1) |
Entry already exists
Definition at line 1595 of file app_queue.c.
#define RES_NOSUCHQUEUE (-3) |
No such queue
Definition at line 1597 of file app_queue.c.
#define RES_NOT_CALLER (-5) |
Caller not found
Definition at line 1599 of file app_queue.c.
#define RES_NOT_DYNAMIC (-4) |
Member is not dynamic
Definition at line 1598 of file app_queue.c.
#define RES_OKAY 0 |
Action completed
Definition at line 1594 of file app_queue.c.
#define RES_OUTOFMEMORY (-2) |
Out of memory
Definition at line 1596 of file app_queue.c.
anonymous enum |
Definition at line 1459 of file app_queue.c.
anonymous enum |
Enumerator | |
---|---|
OPT_ARG_CALLEE_GO_ON | |
OPT_ARG_PREDIAL_CALLEE | |
OPT_ARG_PREDIAL_CALLER | |
OPT_ARG_MUSICONHOLD_CLASS | |
OPT_ARG_ARRAY_SIZE |
Definition at line 1484 of file app_queue.c.
anonymous enum |
Definition at line 1534 of file app_queue.c.
anonymous enum |
Enumerator | |
---|---|
QUEUE_AUTOPAUSE_OFF | |
QUEUE_AUTOPAUSE_ON | |
QUEUE_AUTOPAUSE_ALL |
Definition at line 1545 of file app_queue.c.
Enumerator | |
---|---|
CALLER | |
AGENT | |
TRANSFER |
Definition at line 6151 of file app_queue.c.
enum aqm_args |
Enumerator | |
---|---|
AQM_OPT_ARG_PAUSE_REASON | |
AQM_OPT_ARG_ARRAY_SIZE |
Definition at line 1524 of file app_queue.c.
enum aqm_flags |
Enumerator | |
---|---|
AQMFLAG_PAUSED | |
AQMFLAG_REASON |
Definition at line 1519 of file app_queue.c.
enum empty_conditions |
Enumerator | |
---|---|
QUEUE_EMPTY_PENALTY | |
QUEUE_EMPTY_PAUSED | |
QUEUE_EMPTY_INUSE | |
QUEUE_EMPTY_RINGING | |
QUEUE_EMPTY_UNAVAILABLE | |
QUEUE_EMPTY_INVALID | |
QUEUE_EMPTY_UNKNOWN | |
QUEUE_EMPTY_WRAPUP |
Definition at line 1783 of file app_queue.c.
enum member_properties |
Enumerator | |
---|---|
MEMBER_PENALTY | |
MEMBER_RINGINUSE |
Definition at line 1794 of file app_queue.c.
enum queue_reload_mask |
Enumerator | |
---|---|
QUEUE_RELOAD_PARAMETERS | |
QUEUE_RELOAD_MEMBER | |
QUEUE_RELOAD_RULES | |
QUEUE_RESET_STATS |
Definition at line 1551 of file app_queue.c.
enum queue_result |
Enumerator | |
---|---|
QUEUE_UNKNOWN | |
QUEUE_TIMEOUT | |
QUEUE_JOINEMPTY | |
QUEUE_LEAVEEMPTY | |
QUEUE_JOINUNAVAIL | |
QUEUE_LEAVEUNAVAIL | |
QUEUE_FULL | |
QUEUE_CONTINUE | |
QUEUE_WITHDRAW |
Definition at line 1654 of file app_queue.c.
Enumerator | |
---|---|
TIMEOUT_PRIORITY_APP | |
TIMEOUT_PRIORITY_CONF |
Definition at line 1681 of file app_queue.c.
|
static |
Show queue(s) status and statistics.
List the queues strategy, calls processed, members logged in, other queue statistics such as avg hold time.
Definition at line 10201 of file app_queue.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_rbtree, ao2_container_dup(), ao2_iterator_destroy(), AO2_ITERATOR_DONTLOCK, ao2_iterator_init(), AO2_ITERATOR_UNLINK, ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_category_browse(), ast_check_realtime(), ast_config_destroy(), ast_load_realtime_multientry(), ast_log, ast_str_alloca, ast_str_buffer(), ast_str_set(), ast_strlen_zero(), ast_variable_retrieve(), CLI_SHOWUSAGE, CLI_SUCCESS, do_print(), find_load_queue_rt_friendly(), call_queue::found, LOG_WARNING, call_queue::name, NULL, out, print_queue(), queue_t_unref, queue_unref, queues, call_queue::realtime, and SENTINEL.
Referenced by queue_show().
|
static |
Definition at line 12018 of file app_queue.c.
|
static |
Definition at line 12018 of file app_queue.c.
|
static |
Add member to queue.
RES_NOT_DYNAMIC | when they aren't a RT member |
RES_NOSUCHQUEUE | queue does not exist |
RES_OKAY | added member from queue |
RES_EXISTS | queue exists but no members |
RES_OUT_OF_MEMORY | queue exists but not enough memory to create member |
Definition at line 7622 of file app_queue.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_copy_string(), AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), create_queue_member(), dump_queue_members(), member::dynamic, find_load_queue_rt_friendly(), member::interface, interface_exists(), is_member_available(), member_add_to_queue(), member::membername, call_queue::name, NULL, member::paused, member::penalty, queue_member_blob_create(), queue_publish_member_blob(), queue_t_unref, member::reason_paused, RES_EXISTS, RES_NOSUCHQUEUE, RES_OKAY, RES_OUTOFMEMORY, call_queue::ringinuse, member::state_interface, and member::wrapuptime.
Referenced by aqm_exec(), handle_queue_add_member(), manager_add_queue_member(), and reload_queue_members().
|
static |
Definition at line 3756 of file app_queue.c.
References ao2_t_alloc, ast_string_field_init, ast_string_field_set, destroy_queue(), name, NULL, and queue_t_unref.
Referenced by find_queue_by_name_rt(), and reload_single_queue().
AO2_STRING_FIELD_SORT_FN | ( | call_queue | , |
name | |||
) |
|
static |
AddQueueMember application.
Definition at line 8383 of file app_queue.c.
References add_to_queue(), AQM_OPT_ARG_ARRAY_SIZE, AQM_OPT_ARG_PAUSE_REASON, aqm_opts, AQMFLAG_PAUSED, AQMFLAG_REASON, args, AST_APP_ARG, ast_app_parse_options(), ast_channel_name(), ast_channel_uniqueid(), AST_DECLARE_APP_ARGS, ast_log, ast_queue_log(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strip(), ast_strlen_zero(), ast_test_flag, ast_flags::flags, member::interface, LOG_ERROR, log_membername_as_agent, LOG_NOTICE, LOG_WARNING, member::membername, NULL, options, member::paused, pbx_builtin_setvar_helper(), member::penalty, queue_persistent_members, RES_EXISTS, RES_NOSUCHQUEUE, RES_OKAY, RES_OUTOFMEMORY, member::state_interface, tmp(), and member::wrapuptime.
Referenced by load_module().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 12018 of file app_queue.c.
|
static |
Definition at line 1977 of file app_queue.c.
References ARRAY_LEN, ast_strlen_zero(), ast_true(), autopause::autopause, autopausesmodes, name, QUEUE_AUTOPAUSE_OFF, and QUEUE_AUTOPAUSE_ON.
Referenced by queue_set_param().
|
static |
Calculate the metric of each member in the outgoing callattempts.
A numeric metric is given to each member depending on the ring strategy used by the queue. Members with lower metrics will be called before members with higher metrics
-1 | if penalties are exceeded |
0 | otherwise |
Definition at line 6073 of file app_queue.c.
References ao2_container_count(), ast_debug, ast_log, ast_random(), member::calls, member::lastcall, queue_ent::linpos, queue_ent::linwrapped, LOG_WARNING, queue_ent::max_penalty, call_queue::members, queue_ent::min_penalty, NULL, member::penalty, call_queue::penaltymemberslimit, QUEUE_STRATEGY_FEWESTCALLS, QUEUE_STRATEGY_LEASTRECENT, QUEUE_STRATEGY_LINEAR, QUEUE_STRATEGY_RANDOM, QUEUE_STRATEGY_RINGALL, QUEUE_STRATEGY_RRMEMORY, QUEUE_STRATEGY_RRORDERED, QUEUE_STRATEGY_WRANDOM, member::queuepos, queue_ent::raise_penalty, call_queue::rrpos, call_queue::strategy, tmp(), and call_queue::wrapped.
Referenced by try_calling().
|
static |
Definition at line 4476 of file app_queue.c.
References ao2_ref, ast_free, ast_party_connected_line_free(), callattempt::connected, callattempt::member, and callattempt::orig_chan_name.
Referenced by hangupcalls(), and try_calling().
|
static |
Definition at line 4686 of file app_queue.c.
References ao2_find, ao2_link, ao2_lock, ao2_ref, ao2_unlock, ast_debug, call(), compare_weight(), force_longest_waiting_caller, get_queue_member_status(), get_wrapuptime(), is_longest_waiting_caller(), member::lastcall, member::lastqueue, member_status_available(), member::membername, call_queue::name, NULL, OBJ_NOLOCK, OBJ_SEARCH_OBJECT, queue_ent::parent, member::paused, pending_members, pending_members_remove(), member::ringinuse, member::status, use_weight, and member::wrapuptime.
Referenced by ring_entry().
|
static |
Change priority caller into a queue.
RES_NOSUCHQUEUE | queue does not exist |
RES_OKAY | change priority |
RES_NOT_CALLER | queue exists but no caller |
Definition at line 7675 of file app_queue.c.
References ao2_lock, ao2_unlock, ast_channel_name(), ast_debug, current, find_load_queue_rt_friendly(), call_queue::head, insert_entry(), queue_ent::next, NULL, queue_ent::pos, priority, RES_NOSUCHQUEUE, RES_NOT_CALLER, and RES_OKAY.
Referenced by handle_queue_change_priority_caller(), and manager_change_priority_caller_on_queue().
|
static |
Definition at line 3080 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, member::callcompletedinsl, member::calls, call_queue::callsabandoned, call_queue::callsabandonedinsl, call_queue::callscompleted, call_queue::callscompletedinsl, call_queue::holdtime, member::lastcall, call_queue::members, member::starttime, and call_queue::talktime.
Referenced by clear_stats(), and find_queue_by_name_rt().
|
static |
Facilitates resetting statistics for a queue.
This function actually does not reset any statistics, but rather finds a call_queue struct which corresponds to the passed-in queue name and passes that structure to the clear_queue function. If no queuename is passed in, then all queues will have their statistics reset.
queuename | The name of the queue to reset the statistics for. If this is NULL or zero-length, then this means to reset the statistics for all queues |
0 | always |
Definition at line 10036 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_lock, ao2_t_iterator_next, ao2_unlock, ast_strlen_zero(), clear_queue(), call_queue::name, queue_t_unref, and queues.
Referenced by reload_handler().
|
static |
Definition at line 4571 of file app_queue.c.
References ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_debug, call_queue::count, member::interface, call_queue::members, call_queue::name, num_available_members(), OBJ_POINTER, queue_t_unref, queues, and call_queue::weight.
Referenced by can_ring_entry().
|
static |
Check if a given word is in a space-delimited list.
line | The line as typed not including the current word being completed |
word | The word currently being completed |
pos | The number of completed words in line |
state | The nth desired completion option |
word_list_offset | Offset into the line where the list of queues begins. If non-zero, queues in the list will not be offered for further completion. |
Definition at line 10372 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_t_iterator_next, ast_strdup, call_queue::name, NULL, queue_t_unref, queues, and word_in_list().
Referenced by complete_queue_add_member(), complete_queue_pause_member(), complete_queue_remove_member(), complete_queue_set_member_value(), complete_queue_show(), handle_queue_reload(), and handle_queue_reset().
|
static |
Definition at line 10879 of file app_queue.c.
References ast_malloc, ast_strdup, complete_queue(), and NULL.
Referenced by handle_queue_add_member().
|
static |
Definition at line 11304 of file app_queue.c.
References ast_strdup, complete_queue(), and NULL.
Referenced by handle_queue_pause_member().
|
static |
Definition at line 11139 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_strdup, complete_queue(), member::interface, member::membername, call_queue::members, NULL, queue_t_unref, queues, and tmp().
Referenced by handle_queue_remove_member().
|
static |
Definition at line 11499 of file app_queue.c.
References AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_strdup, rule_list::list, rule_list::name, and NULL.
Referenced by handle_queue_rule_show().
|
static |
Definition at line 11378 of file app_queue.c.
References ast_strdup, complete_queue(), and NULL.
Referenced by handle_queue_set_member_penalty(), and handle_queue_set_member_ringinuse().
|
static |
Definition at line 10409 of file app_queue.c.
References complete_queue(), and NULL.
Referenced by queue_show().
|
static |
Definition at line 2939 of file app_queue.c.
References c.
Referenced by member_hash_fn().
|
static |
Returns if one context includes another context.
parent | Parent context to search for child |
child | Context to check for inclusion in parent |
This function recursively checks if the context child is included in the context parent.
1 | if child is included in parent |
0 | if not |
Definition at line 2806 of file app_queue.c.
References ast_context_find(), ast_get_context_name(), ast_get_include_name(), ast_walk_context_includes(), c, context_included(), and NULL.
Referenced by context_included(), and extension_state_cb().
|
static |
Copy rule from global list into specified queue.
Definition at line 8511 of file app_queue.c.
References ast_calloc, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_log, ast_strlen_zero(), call_queue::defaultrule, penalty_rule::list, rule_list::list, LOG_ERROR, penalty_rule::max_relative, penalty_rule::max_value, penalty_rule::min_relative, penalty_rule::min_value, rule_list::name, queue_ent::parent, queue_ent::qe_rules, penalty_rule::raise_relative, penalty_rule::raise_value, rule_list::rules, penalty_rule::time, and tmp().
Referenced by queue_exec().
|
static |
allocate space for new queue member and set fields based on parameters passed
Definition at line 2894 of file app_queue.c.
References ao2_alloc, ast_copy_string(), ast_extension_state_add(), ast_log, ast_strdupa, ast_strlen_zero(), voicemailpwcheck::context, destroy_queue_member_cb(), extension_state_cb(), get_queue_member_status(), member::interface, member::lastpause, LOG_WARNING, member::logintime, member::membername, NULL, member::paused, member::penalty, member::ringinuse, S_OR, member::state_context, member::state_exten, member::state_id, member::state_interface, member::status, strsep(), tmp(), and member::wrapuptime.
Referenced by add_to_queue(), reload_single_member(), and rt_handle_member_record().
|
static |
Free queue's member list then its string fields.
Definition at line 3741 of file app_queue.c.
References ao2_ref, ast_free, ast_string_field_free_memory, free_members(), MAX_PERIODIC_ANNOUNCEMENTS, call_queue::members, and call_queue::sound_periodicannounce.
Referenced by alloc_queue().
|
static |
Definition at line 2884 of file app_queue.c.
References ast_extension_state_del(), extension_state_cb(), and member::state_id.
Referenced by create_queue_member().
|
static |
set a member's status based on device state of that member's interface
Definition at line 2670 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_copy_string(), ast_debug, AST_DEVICE_INUSE, AST_DEVICE_NOT_INUSE, ast_device_state_message_type(), ast_devstate2str(), AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_device_state_message::device, ast_device_state_message::eid, call_queue::found, is_member_available(), call_queue::members, call_queue::name, queue_t_unref, queues, stasis_message_data(), stasis_message_type(), ast_device_state_message::state, member::state_interface, and update_status().
Referenced by load_module().
|
static |
common hangup actions
Definition at line 4656 of file app_queue.c.
References ast_hangup(), callattempt::chan, callattempt::member, NULL, pending_members_remove(), and callattempt::stillgoing.
Referenced by ring_entry(), and wait_for_answer().
|
static |
direct output to manager or cli with proper terminator
Definition at line 10083 of file app_queue.c.
References ast_cli(), astman_append(), and str.
Referenced by __queues_show(), and print_queue().
|
static |
Dump all members in a specific queue to the database.
Definition at line 7514 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_db_del(), ast_db_put(), ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_strlen(), member::dynamic, member::interface, LOG_WARNING, member::membername, call_queue::members, call_queue::name, member::paused, member::penalty, pm_family, member::reason_paused, member::state_interface, value, and member::wrapuptime.
Referenced by add_to_queue(), remove_from_queue(), and set_queue_member_pause().
|
static |
Definition at line 6863 of file app_queue.c.
References ao2_ref, queue_end_bridge::chan, queue_end_bridge::q, queue_t_unref, and set_queue_variables().
Referenced by try_calling().
|
static |
Definition at line 6856 of file app_queue.c.
References ao2_ref, queue_end_bridge::chan, and ast_bridge_config::end_bridge_callback_data.
Referenced by try_calling().
|
static |
Definition at line 6903 of file app_queue.c.
References input(), and pbx_substitute_variables_helper().
Referenced by setup_mixmonitor().
|
static |
Definition at line 2835 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_debug, ast_devstate2str(), AST_HINT_UPDATE_DEVICE, voicemailpwcheck::context, context_included(), extensionstate2devicestate(), call_queue::found, sip_to_pjsip::info(), call_queue::members, queue_t_unref, queues, member::state_context, member::state_exten, and update_status().
Referenced by create_queue_member(), and destroy_queue_member_cb().
|
static |
Helper function which converts from extension state to device state values.
Definition at line 2757 of file app_queue.c.
References AST_DEVICE_BUSY, AST_DEVICE_INUSE, AST_DEVICE_INVALID, AST_DEVICE_NOT_INUSE, AST_DEVICE_ONHOLD, AST_DEVICE_RINGING, AST_DEVICE_RINGINUSE, AST_DEVICE_UNAVAILABLE, AST_EXTENSION_BUSY, AST_EXTENSION_DEACTIVATED, AST_EXTENSION_INUSE, AST_EXTENSION_NOT_INUSE, AST_EXTENSION_ONHOLD, AST_EXTENSION_REMOVED, AST_EXTENSION_RINGING, AST_EXTENSION_UNAVAILABLE, and state.
Referenced by extension_state_cb(), and get_queue_member_status().
|
static |
find the entry with the best metric, or NULL
Definition at line 4914 of file app_queue.c.
References callattempt::metric, and NULL.
Referenced by ring_one(), store_next_lin(), and store_next_rr().
|
static |
note
This will be two separate database transactions, so we might see queue parameters as they were before another process changed the queue and member list as it was after the change. Thus we might see an empty member list when a queue is deleted. In practise, this is unlikely to cause a problem.
Definition at line 3924 of file app_queue.c.
References ao2_t_find, ast_atomic_fetchadd_int(), ast_config_destroy(), ast_config_new(), ast_debug, ast_load_realtime(), ast_load_realtime_multientry(), ast_variables_destroy(), find_queue_by_name_rt(), NULL, OBJ_POINTER, queue_t_unref, queues, call_queue::realtime, SENTINEL, update_realtime_members(), use_weight, and call_queue::weight.
Referenced by __queues_show(), add_to_queue(), change_priority_caller_on_queue(), find_member_by_queuename_and_interface(), get_member_penalty(), join_queue(), load_realtime_queues(), queue_function_exists(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_function_var(), qupd_exec(), reload_queue_members(), request_withdraw_caller_from_queue(), and set_member_value().
|
static |
Find a member by looking up queuename and interface.
Definition at line 11998 of file app_queue.c.
References ao2_find, ao2_lock, ao2_unlock, find_load_queue_rt_friendly(), call_queue::members, NULL, OBJ_KEY, and queue_t_unref.
Referenced by handle_queue_remove_member(), manager_remove_queue_member(), and rqm_exec().
|
static |
Reload a single queue via realtime.
Check for statically defined queue first, check if deleted RT queue, check for new RT queue, if queue vars are not defined init them with defaults. reload RT queue vars, set RT queue members dead and reload them, return finished queue.
the | queue, |
NULL | if it doesn't exist. |
Definition at line 3780 of file app_queue.c.
References alloc_queue(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_t_find, ao2_unlock, ast_category_browse(), ast_copy_string(), ast_debug, ast_log, ast_queue_log(), ast_strlen_zero(), clear_queue(), member::dead, call_queue::dead, init_queue(), member::interface, log_membername_as_agent, LOG_WARNING, member_remove_from_queue(), member::membername, call_queue::members, call_queue::name, ast_variable::name, ast_variable::next, NULL, OBJ_POINTER, queue_set_param(), QUEUE_STRATEGY_RINGALL, queue_t_unref, queues, queues_t_link, queues_t_unlink, member::realtime, call_queue::realtime, rt_handle_member_record(), strat2int(), call_queue::strategy, tmp(), and ast_variable::value.
Referenced by find_load_queue_rt_friendly().
|
static |
Iterate through queue's member list and delete them.
Definition at line 3725 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, member::dynamic, member_remove_from_queue(), and call_queue::members.
Referenced by destroy_queue().
|
static |
Definition at line 9029 of file app_queue.c.
References ast_log, ast_strlen_zero(), member::interface, interface_exists(), LOG_ERROR, call_queue::name, and NULL.
Referenced by queue_function_mem_read().
|
static |
Gets members penalty.
Definition at line 8098 of file app_queue.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_log, find_load_queue_rt_friendly(), member::interface, interface_exists(), LOG_ERROR, member::penalty, queue_t_unref, and RESULT_FAILURE.
Referenced by queue_function_memberpenalty_read().
|
static |
Check if members are available.
This function checks to see if members are available to be called. If any member is available, the function immediately returns 0. If no members are available, then -1 is returned.
Definition at line 2451 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_debug, AST_DEVICE_INUSE, AST_DEVICE_INVALID, AST_DEVICE_RINGING, AST_DEVICE_UNAVAILABLE, AST_DEVICE_UNKNOWN, get_member_status(), get_wrapuptime(), member::lastcall, member::membername, call_queue::members, NULL, member::paused, member::penalty, QUEUE_EMPTY_INUSE, QUEUE_EMPTY_INVALID, QUEUE_EMPTY_PAUSED, QUEUE_EMPTY_PENALTY, QUEUE_EMPTY_RINGING, QUEUE_EMPTY_UNAVAILABLE, QUEUE_EMPTY_UNKNOWN, QUEUE_EMPTY_WRAPUP, member::state_interface, and member::status.
Referenced by get_member_status(), join_queue(), queue_exec(), and wait_our_turn().
|
static |
Return the current state of a member.
Definition at line 2879 of file app_queue.c.
References ast_extension_state(), ast_strlen_zero(), extensionstate2devicestate(), NULL, member::state_context, member::state_exten, and member::state_interface.
Referenced by can_ring_entry(), create_queue_member(), and kill_dead_members().
|
static |
Return wrapuptime.
This function checks if wrapuptime in member is set and return this value. Otherwise return value the wrapuptime in the queue configuration
Definition at line 2020 of file app_queue.c.
References member::wrapuptime, and call_queue::wrapuptime.
Referenced by can_ring_entry(), get_member_status(), is_member_available(), and queue_function_mem_read().
|
static |
Handle an attended transfer event.
This event is important in order to be able to log the end of the call to the queue log and to stasis.
userdata | Data pertaining to the particular call in the queue. |
sub | The stasis subscription on which the message occurred. |
msg | The stasis message for the attended transfer event. |
Definition at line 6497 of file app_queue.c.
References ao2_cleanup, ao2_lock, ao2_unlock, AST_ATTENDED_TRANSFER_DEST_THREEWAY, AST_BRIDGE_TRANSFER_SUCCESS, ast_channel_snapshot_get_latest(), ast_debug, ast_strlen_zero(), ast_bridge_channel_snapshot_pair::bridge_snapshot, queue_stasis_data::bridge_uniqueid, queue_stasis_data::callcompletedinsl, queue_stasis_data::caller_uniqueid, ast_attended_transfer_message::dest_type, queue_stasis_data::dying, queue_stasis_data::holdstart, log_attended_transfer(), queue_stasis_data::member, queue_stasis_data::member_uniqueid, call_queue::name, NULL, queue_stasis_data::queue, RAII_VAR, remove_stasis_subscriptions(), ast_attended_transfer_message::result, send_agent_complete(), queue_stasis_data::starttime, stasis_message_data(), ast_attended_transfer_message::to_transfer_target, ast_attended_transfer_message::to_transferee, TRANSFER, ast_bridge_snapshot::uniqueid, and update_queue().
Referenced by setup_stasis_subs().
|
static |
Handle a blind transfer event.
This event is important in order to be able to log the end of the call to the queue log and to stasis.
userdata | Data pertaining to the particular call in the queue. |
sub | The stasis subscription on which the message occurred. |
msg | The stasis message for the blind transfer event |
Definition at line 6438 of file app_queue.c.
References ao2_cleanup, ao2_lock, ao2_unlock, AST_BRIDGE_TRANSFER_SUCCESS, ast_channel_snapshot_get_latest(), ast_debug, ast_queue_log(), ast_strlen_zero(), ast_blind_transfer_message::bridge, queue_stasis_data::bridge_uniqueid, queue_stasis_data::callcompletedinsl, queue_stasis_data::caller_pos, queue_stasis_data::caller_uniqueid, voicemailpwcheck::context, ast_blind_transfer_message::context, queue_stasis_data::dying, ast_blind_transfer_message::exten, queue_stasis_data::holdstart, queue_stasis_data::member, queue_stasis_data::member_uniqueid, member::membername, call_queue::name, NULL, queue_stasis_data::queue, RAII_VAR, remove_stasis_subscriptions(), ast_blind_transfer_message::result, send_agent_complete(), queue_stasis_data::starttime, stasis_message_data(), TRANSFER, ast_bridge_snapshot::uniqueid, and update_queue().
Referenced by setup_stasis_subs().
|
static |
Definition at line 6405 of file app_queue.c.
References ast_debug, ast_string_field_set, ast_strlen_zero(), ast_channel_snapshot::base, ast_bridge_blob::bridge, queue_stasis_data::bridge_uniqueid, queue_stasis_data::caller_uniqueid, ast_bridge_blob::channel, queue_stasis_data::dying, lock, ast_channel_snapshot_base::name, SCOPED_AO2LOCK, stasis_message_data(), ast_bridge_snapshot::uniqueid, and ast_channel_snapshot_base::uniqueid.
Referenced by setup_stasis_subs().
|
static |
Definition at line 6686 of file app_queue.c.
References AGENT, ao2_cleanup, ao2_lock, ao2_unlock, ast_channel_get_by_name(), ast_channel_has_role(), ast_channel_snapshot_get_latest(), ast_debug, ast_queue_log(), ast_strlen_zero(), AST_TRANSFERER_ROLE_NAME, ast_channel_snapshot::base, queue_stasis_data::callcompletedinsl, CALLER, queue_stasis_data::caller_pos, queue_stasis_data::caller_uniqueid, queue_stasis_data::dying, queue_stasis_data::holdstart, queue_stasis_data::member, queue_stasis_data::member_uniqueid, member::membername, call_queue::name, ast_channel_snapshot_base::name, NULL, pbx_builtin_getvar_helper(), queue_stasis_data::queue, RAII_VAR, remove_stasis_subscriptions(), send_agent_complete(), ast_channel_blob::snapshot, queue_stasis_data::starttime, stasis_message_data(), ast_channel_snapshot_base::uniqueid, and update_queue().
Referenced by setup_stasis_subs().
|
static |
Definition at line 6571 of file app_queue.c.
References ast_assert, ast_json_integer_get(), ast_json_object_get(), ast_log, ast_multi_channel_blob_get_channel(), ast_multi_channel_blob_get_json(), ast_strdup, ast_channel_snapshot::base, queue_stasis_data::caller_optimize, queue_stasis_data::caller_uniqueid, queue_stasis_data::dying, id, local_optimization::id, local_optimization::in_progress, lock, LOG_ERROR, queue_stasis_data::member_optimize, queue_stasis_data::member_uniqueid, ast_channel_snapshot_base::name, NULL, SCOPED_AO2LOCK, local_optimization::source_chan_uniqueid, stasis_message_data(), and ast_channel_snapshot_base::uniqueid.
Referenced by setup_stasis_subs().
|
static |
Definition at line 6622 of file app_queue.c.
References ast_debug, ast_json_integer_get(), ast_json_object_get(), ast_log, ast_multi_channel_blob_get_channel(), ast_multi_channel_blob_get_json(), ast_string_field_set, ast_channel_snapshot::base, queue_stasis_data::caller_optimize, queue_stasis_data::caller_uniqueid, queue_stasis_data::dying, id, local_optimization::id, local_optimization::in_progress, lock, LOG_WARNING, queue_stasis_data::member_optimize, queue_stasis_data::member_uniqueid, SCOPED_AO2LOCK, local_optimization::source_chan_uniqueid, stasis_message_data(), and ast_channel_snapshot_base::uniqueid.
Referenced by setup_stasis_subs().
|
static |
Definition at line 6743 of file app_queue.c.
References ao2_lock, ao2_unlock, ast_debug, ast_json_object_get(), ast_json_string_get(), ast_string_field_set, ast_channel_snapshot::base, ast_channel_blob::blob, queue_stasis_data::caller_uniqueid, queue_stasis_data::dying, queue_stasis_data::member_uniqueid, ast_channel_blob::snapshot, stasis_message_data(), and ast_channel_snapshot_base::uniqueid.
Referenced by setup_stasis_subs().
|
static |
Definition at line 11054 of file app_queue.c.
References a, add_to_queue(), ast_cli(), ast_queue_log(), ast_strlen_zero(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue_add_member(), log_membername_as_agent, NULL, queue_persistent_members, RES_EXISTS, RES_NOSUCHQUEUE, RES_NOT_DYNAMIC, RES_OKAY, RES_OUTOFMEMORY, and ast_cli_entry::usage.
|
static |
Definition at line 11250 of file app_queue.c.
References a, ast_cli(), ast_log, change_priority_caller_on_queue(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, LOG_ERROR, NULL, priority, RES_NOSUCHQUEUE, RES_NOT_CALLER, RES_OKAY, and ast_cli_entry::usage.
|
static |
Definition at line 11323 of file app_queue.c.
References a, ast_cli(), ast_strlen_zero(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue_pause_member(), NULL, RESULT_SUCCESS, set_member_paused(), and ast_cli_entry::usage.
|
static |
Definition at line 11595 of file app_queue.c.
References a, AST_FLAGS_ALL, ast_set_flag, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue(), NULL, QUEUE_RELOAD_MEMBER, QUEUE_RELOAD_PARAMETERS, QUEUE_RELOAD_RULES, QUEUE_RESET_STATS, reload_handler(), and ast_cli_entry::usage.
|
static |
Definition at line 11187 of file app_queue.c.
References a, ao2_ref, ast_cli(), ast_queue_log(), ast_strlen_zero(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue_remove_member(), find_member_by_queuename_and_interface(), log_membername_as_agent, member::membername, NULL, remove_from_queue(), RES_EXISTS, RES_NOSUCHQUEUE, RES_NOT_DYNAMIC, RES_OKAY, RES_OUTOFMEMORY, and ast_cli_entry::usage.
|
static |
Definition at line 11556 of file app_queue.c.
References a, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue(), NULL, QUEUE_RESET_STATS, reload_handler(), and ast_cli_entry::usage.
|
static |
Definition at line 11521 of file app_queue.c.
References a, ast_cli(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_strlen_zero(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue_rule_show(), penalty_rule::list, penalty_rule::max_relative, penalty_rule::max_value, penalty_rule::min_relative, penalty_rule::min_value, rule_list::name, NULL, penalty_rule::raise_relative, penalty_rule::raise_value, rule_list::rules, penalty_rule::time, and ast_cli_entry::usage.
|
static |
Definition at line 11458 of file app_queue.c.
References a, ast_cli(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue_set_member_value(), MEMBER_PENALTY, NULL, RESULT_FAILURE, RESULT_SUCCESS, set_member_value(), and ast_cli_entry::usage.
|
static |
Definition at line 11401 of file app_queue.c.
References a, ast_cli(), ast_false(), ast_true(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue_set_member_value(), MEMBER_RINGINUSE, NULL, RESULT_FAILURE, RESULT_SUCCESS, set_member_value(), and ast_cli_entry::usage.
|
static |
Hang up a list of outgoing calls.
Definition at line 4498 of file app_queue.c.
References callattempt::aoc_s_rate_list, ast_aoc_destroy_decoded(), AST_CAUSE_ANSWERED_ELSEWHERE, ast_channel_hangupcause_set(), ast_channel_publish_dial(), AST_DEVICE_NOT_INUSE, ast_hangup(), callattempt_free(), queue_ent::chan, and pending_members_remove().
Referenced by try_calling().
|
static |
Initialize Queue default values.
Definition at line 2978 of file app_queue.c.
References call_queue::announce_to_first_user, call_queue::announcefrequency, call_queue::announceholdtime, call_queue::announceposition, call_queue::announceposition_only_up, ANNOUNCEPOSITION_YES, call_queue::announcepositionlimit, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_container_alloc_list, AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_free, AST_LIST_REMOVE_HEAD, ast_str_create, ast_str_set(), ast_string_field_set, call_queue::autofill, autofill_default, call_queue::autopause, call_queue::autopausebusy, call_queue::autopausedelay, call_queue::autopauseunavail, voicemailpwcheck::context, call_queue::dead, DEFAULT_MIN_ANNOUNCE_FREQUENCY, DEFAULT_RETRY, DEFAULT_TIMEOUT, call_queue::found, call_queue::joinempty, call_queue::leavewhenempty, penalty_rule::list, call_queue::log_restricted_caller_id, MAX_PERIODIC_ANNOUNCEMENTS, call_queue::maxlen, member_cmp_fn(), member_hash_fn(), call_queue::memberdelay, call_queue::members, call_queue::minannouncefrequency, call_queue::monfmt, call_queue::name, NULL, call_queue::numperiodicannounce, call_queue::penaltymemberslimit, call_queue::periodicannouncefrequency, call_queue::periodicannouncestartdelay, QUEUE_AUTOPAUSE_OFF, QUEUE_STRATEGY_LINEAR, QUEUE_STRATEGY_RRORDERED, call_queue::randomperiodicannounce, call_queue::relativeperiodicannounce, call_queue::reportholdtime, call_queue::retry, call_queue::ringinuse, call_queue::roundingseconds, call_queue::rules, call_queue::servicelevel, call_queue::setinterfacevar, call_queue::setqueueentryvar, call_queue::setqueuevar, call_queue::sound_periodicannounce, call_queue::strategy, call_queue::timeout, TIMEOUT_PRIORITY_APP, call_queue::timeoutpriority, call_queue::timeoutrestart, call_queue::weight, and call_queue::wrapuptime.
Referenced by find_queue_by_name_rt(), and reload_single_queue().
|
inlinestatic |
Insert the 'new' entry after the 'prev' entry of queue 'q'.
Definition at line 2118 of file app_queue.c.
References call_queue::head, queue_ent::next, queue_ent::pos, and queue_ref.
Referenced by change_priority_caller_on_queue(), and join_queue().
|
static |
Change queue penalty by adding rule.
Check rule for errors with time or formatting, see if rule is relative to rest of queue, iterate list of rules to find correct insertion point, insert and return.
-1 | on failure |
0 | on success |
Definition at line 3112 of file app_queue.c.
References ast_calloc, ast_free, AST_LIST_INSERT_BEFORE_CURRENT, AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_log, ast_strdupa, ast_strlen_zero(), rule_list::list, LOG_WARNING, rule_list::name, NULL, and rule_list::rules.
Referenced by reload_queue_rules().
|
static |
Definition at line 1951 of file app_queue.c.
References ARRAY_LEN, strategy::name, and strategies.
Referenced by manager_queues_status(), print_queue(), queue_function_var(), and set_queue_variables().
|
static |
Definition at line 7487 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, member::interface, call_queue::members, and NULL.
Referenced by add_to_queue(), get_interface_helper(), get_member_penalty(), rna(), set_member_paused(), set_member_penalty_help_members(), and set_member_ringinuse_help_members().
Definition at line 4605 of file app_queue.c.
References ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_lock, ao2_t_iterator_next, ao2_unlock, ast_debug, call_queue::count, call_queue::head, member::interface, call_queue::members, call_queue::name, queue_ent::next, OBJ_POINTER, queue_ent::parent, queue_ent::pending, queue_ent::pos, queue_t_unref, queues, queue_ent::start, and call_queue::weight.
Referenced by can_ring_entry().
|
static |
Definition at line 2635 of file app_queue.c.
References AST_DEVICE_BUSY, AST_DEVICE_INUSE, AST_DEVICE_INVALID, AST_DEVICE_NOT_INUSE, AST_DEVICE_ONHOLD, AST_DEVICE_RINGING, AST_DEVICE_RINGINUSE, AST_DEVICE_UNAVAILABLE, AST_DEVICE_UNKNOWN, available(), get_wrapuptime(), member::lastcall, NULL, member::paused, member::ringinuse, member::status, and member::wrapuptime.
Referenced by add_to_queue(), device_state_cb(), num_available_members(), and set_queue_member_pause().
|
static |
Check if we should start attempting to call queue members.
A simple process, really. Count the number of members who are available to take our call and then see if we are in a position in the queue at which a member could accept our call.
[in] | qe | The caller who wants to know if it is his turn |
0 | It is not our turn |
1 | It is our turn |
Definition at line 5774 of file app_queue.c.
References ao2_lock, ao2_unlock, ast_channel_name(), ast_debug, call_queue::autofill, queue_ent::chan, call_queue::head, queue_ent::next, num_available_members(), queue_ent::parent, queue_ent::pending, queue_ent::pos, and update_realtime_members().
Referenced by queue_exec(), and wait_our_turn().
|
static |
Definition at line 4088 of file app_queue.c.
References queue_ent::announce, call_queue::announce, ao2_lock, ao2_unlock, ast_channel_name(), ast_channel_publish_cached_blob(), ast_copy_string(), ast_debug, AST_DEVICE_RINGING, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_json_pack(), ast_json_unref(), ast_log, queue_ent::chan, queue_ent::context, call_queue::context, call_queue::count, find_load_queue_rt_friendly(), get_member_status(), call_queue::head, insert_entry(), call_queue::joinempty, LOG_NOTICE, queue_ent::max_penalty, call_queue::maxlen, queue_ent::min_penalty, queue_ent::moh, call_queue::moh, call_queue::name, queue_ent::next, NULL, queue_ent::pos, queue_ent::prio, QUEUE_FULL, QUEUE_JOINEMPTY, queue_t_unref, QUEUE_UNKNOWN, RAII_VAR, queue_ent::raise_penalty, and status.
Referenced by queue_exec().
|
static |
Definition at line 9800 of file app_queue.c.
References CMP_MATCH, member::delme, get_queue_member_status(), and member::status.
Referenced by reload_single_queue().
|
static |
Definition at line 9955 of file app_queue.c.
References ast_strlen_zero(), CMP_MATCH, call_queue::dead, call_queue::found, call_queue::name, and call_queue::realtime.
Referenced by reload_queues().
|
static |
Caller leaving queue.
Search the queue to find the leaving client, if found remove from queue create manager event, move others up the queue.
Definition at line 4401 of file app_queue.c.
References ao2_lock, ao2_unlock, ast_channel_name(), ast_channel_publish_cached_blob(), ast_debug, AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_free, ast_json_pack(), ast_json_unref(), AST_LIST_REMOVE_HEAD, ast_load_realtime(), ast_variables_destroy(), queue_ent::chan, call_queue::count, current, call_queue::dead, call_queue::head, penalty_rule::list, call_queue::name, queue_ent::next, NULL, queue_ent::parent, pbx_builtin_setvar_helper(), queue_ent::pos, queue_ent::pr, queue_ent::qe_rules, queue_t_ref, queue_t_unref, queues, queues_t_unlink, RAII_VAR, call_queue::realtime, SENTINEL, and var.
Referenced by queue_exec(), and try_calling().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 11830 of file app_queue.c.
References agent_router, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, app, app_aqm, app_pqm, app_ql, app_qupd, app_rqm, app_upqm, aqm_exec(), ARRAY_LEN, ast_channel_agent_login_type(), ast_channel_agent_logoff_type(), ast_channel_topic_all(), ast_cli_register_multiple, ast_config_destroy(), ast_custom_function_register, ast_device_state_message_type(), ast_device_state_topic_all(), AST_FLAGS_ALL, ast_load_realtime_multientry(), ast_log, ast_manager_get_topic(), ast_manager_register_xml, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_queue_topic_all(), ast_realtime_require_field(), ast_register_application_xml, ast_variable_retrieve(), cli_queue, device_state_cb(), device_state_sub, EVENT_FLAG_AGENT, LOG_NOTICE, manager_add_queue_member(), manager_change_priority_caller_on_queue(), manager_pause_queue_member(), manager_queue_log_custom(), manager_queue_member_penalty(), manager_queue_member_ringinuse(), manager_queue_reload(), manager_queue_reset(), manager_queue_rule_show(), manager_queues_status(), manager_queues_summary(), manager_remove_queue_member(), manager_request_withdraw_caller_from_queue(), manager_topic, MAX_CALL_ATTEMPT_BUCKETS, MAX_QUEUE_BUCKETS, NULL, pending_members, pending_members_cmp(), pending_members_hash(), pqm_exec(), ql_exec(), queue_agent_cb(), queue_cmp_cb(), queue_exec(), queue_hash_cb(), queue_persistent_members, queueexists_function, queuegetchannel_function, queuemembercount_dep, queuemembercount_function, queuememberlist_function, queuememberpenalty_function, queues, queuevar_function, queuewaitingcount_function, qupd_exec(), realtime_reason_paused, realtime_ringinuse_field, reload_handler(), reload_queue_members(), RQ_CHAR, RQ_INTEGER1, RQ_UINTEGER2, rqm_exec(), SENTINEL, stasis_forward_all(), stasis_message_router_add(), stasis_message_router_create, STASIS_MESSAGE_TYPE_INIT, stasis_subscribe, stasis_subscription_accept_message_type(), STASIS_SUBSCRIPTION_FILTER_SELECTIVE, stasis_subscription_set_filter(), topic_forwarder, unload_module(), upqm_exec(), and use_weight.
|
static |
Definition at line 3985 of file app_queue.c.
References ast_category_browse(), ast_check_realtime(), ast_config_destroy(), ast_load_realtime_multientry(), ast_strlen_zero(), ast_variable_retrieve(), find_load_queue_rt_friendly(), name, NULL, queue_unref, and SENTINEL.
Referenced by manager_queues_status(), manager_queues_summary(), and set_member_paused().
|
static |
Load queue rules from realtime.
Check rule for errors with time or formatting, see if rule is relative to rest of queue, iterate list of rules to find correct insertion point, insert and return.
-1 | on failure |
0 | on success |
Definition at line 3216 of file app_queue.c.
References ast_calloc, ast_category_browse(), ast_check_realtime(), ast_config_destroy(), ast_copy_string(), AST_LIST_INSERT_BEFORE_CURRENT, AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_load_realtime_multientry(), ast_log, ast_strlen_zero(), ast_variable_retrieve(), penalty_rule::list, LOG_NOTICE, LOG_WARNING, penalty_rule::max_relative, penalty_rule::max_value, penalty_rule::min_relative, penalty_rule::min_value, rule_list::name, NULL, penalty_rule::raise_relative, penalty_rule::raise_value, rule_list::rules, SENTINEL, and penalty_rule::time.
Referenced by reload_queue_rules().
|
static |
Definition at line 6359 of file app_queue.c.
References ast_attended_transfer_message::app, ast_assert, AST_ATTENDED_TRANSFER_DEST_APP, AST_ATTENDED_TRANSFER_DEST_BRIDGE_MERGE, AST_ATTENDED_TRANSFER_DEST_FAIL, AST_ATTENDED_TRANSFER_DEST_LINK, AST_ATTENDED_TRANSFER_DEST_LOCAL_APP, AST_ATTENDED_TRANSFER_DEST_THREEWAY, ast_free, ast_log, ast_queue_log(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_channel_snapshot::base, ast_attended_transfer_message::bridge, queue_stasis_data::caller_pos, queue_stasis_data::caller_uniqueid, ast_attended_transfer_message::dest, ast_attended_transfer_message::dest_type, queue_stasis_data::holdstart, ast_attended_transfer_message::links, LOG_WARNING, queue_stasis_data::member, member::membername, call_queue::name, ast_channel_snapshot_base::name, NULL, queue_stasis_data::queue, RAII_VAR, and queue_stasis_data::starttime.
Referenced by handle_attended_transfer().
|
static |
Definition at line 10674 of file app_queue.c.
References abs, add_to_queue(), ast_queue_log(), ast_strlen_zero(), ast_true(), astman_get_header(), astman_send_ack(), astman_send_error(), log_membername_as_agent, queue_persistent_members, RES_EXISTS, RES_NOSUCHQUEUE, RES_OKAY, and RES_OUTOFMEMORY.
Referenced by load_module().
|
static |
Definition at line 10970 of file app_queue.c.
References ast_strlen_zero(), ast_true(), astman_get_header(), astman_send_ack(), astman_send_error(), change_priority_caller_on_queue(), priority, RES_NOSUCHQUEUE, RES_NOT_CALLER, and RES_OKAY.
Referenced by load_module().
|
static |
Definition at line 10786 of file app_queue.c.
References abs, ast_strlen_zero(), ast_true(), astman_get_header(), astman_send_ack(), astman_send_error(), and set_member_paused().
Referenced by load_module().
|
static |
Definition at line 10811 of file app_queue.c.
References ast_queue_log(), ast_strlen_zero(), astman_get_header(), astman_send_ack(), astman_send_error(), and S_OR.
Referenced by load_module().
|
static |
Definition at line 10944 of file app_queue.c.
References ast_strlen_zero(), astman_get_header(), astman_send_ack(), astman_send_error(), MEMBER_PENALTY, and set_member_value().
Referenced by load_module().
|
static |
Definition at line 10910 of file app_queue.c.
References ast_false(), ast_strlen_zero(), ast_true(), astman_get_header(), astman_send_ack(), astman_send_error(), MEMBER_RINGINUSE, and set_member_value().
Referenced by load_module().
|
static |
Definition at line 10832 of file app_queue.c.
References AST_FLAGS_ALL, ast_set_flag, astman_get_header(), astman_send_ack(), astman_send_error(), NULL, QUEUE_RELOAD_MEMBER, QUEUE_RELOAD_PARAMETERS, QUEUE_RELOAD_RULES, QUEUE_RESET_STATS, reload_handler(), and S_OR.
Referenced by load_module().
|
static |
Definition at line 10864 of file app_queue.c.
References astman_get_header(), astman_send_ack(), astman_send_error(), NULL, QUEUE_RESET_STATS, and reload_handler().
Referenced by load_module().
|
static |
Definition at line 10433 of file app_queue.c.
References AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_strlen_zero(), astman_append(), astman_get_header(), penalty_rule::list, penalty_rule::max_relative, penalty_rule::max_value, penalty_rule::min_relative, penalty_rule::min_value, rule_list::name, RESULT_SUCCESS, rule_list::rules, and penalty_rule::time.
Referenced by load_module().
|
static |
Queue status info via AMI.
Definition at line 10551 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_channel_caller(), ast_channel_connected(), ast_channel_name(), ast_channel_uniqueid(), ast_check_realtime(), ast_strlen_zero(), astman_append(), astman_get_header(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), member::calls, call_queue::callsabandoned, call_queue::callsabandonedinsl, call_queue::callscompleted, call_queue::callscompletedinsl, queue_ent::chan, call_queue::count, member::dynamic, call_queue::head, call_queue::holdtime, ast_party_caller::id, ast_party_connected_line::id, int2strat(), member::interface, member::lastcall, member::lastpause, load_realtime_queues(), member::logintime, call_queue::maxlen, member::membername, call_queue::members, call_queue::name, ast_party_id::name, queue_ent::next, ast_party_id::number, member::paused, member::penalty, queue_ent::prio, queue_t_unref, queues, member::reason_paused, RESULT_SUCCESS, S_COR, call_queue::servicelevel, queue_ent::start, member::starttime, member::state_interface, member::status, ast_party_name::str, ast_party_number::str, call_queue::strategy, call_queue::talktime, ast_party_name::valid, ast_party_number::valid, call_queue::weight, and member::wrapuptime.
Referenced by load_module().
|
static |
Summary of queue info via the AMI.
Definition at line 10469 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_check_realtime(), AST_DEVICE_INVALID, AST_DEVICE_UNAVAILABLE, ast_strlen_zero(), astman_append(), astman_get_header(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), call_queue::head, call_queue::holdtime, load_realtime_queues(), member_status_available(), call_queue::members, call_queue::name, queue_ent::next, member::paused, queue_t_unref, queues, RESULT_SUCCESS, queue_ent::start, member::status, and call_queue::talktime.
Referenced by load_module().
|
static |
Definition at line 10739 of file app_queue.c.
References ao2_ref, ast_queue_log(), ast_strlen_zero(), astman_get_header(), astman_send_ack(), astman_send_error(), find_member_by_queuename_and_interface(), log_membername_as_agent, member::membername, NULL, remove_from_queue(), RES_EXISTS, RES_NOSUCHQUEUE, RES_NOT_DYNAMIC, RES_OKAY, and RES_OUTOFMEMORY.
Referenced by load_module().
|
static |
Definition at line 11017 of file app_queue.c.
References ast_strlen_zero(), astman_get_header(), astman_send_ack(), astman_send_error(), request_withdraw_caller_from_queue(), RES_EXISTS, RES_NOSUCHQUEUE, RES_NOT_CALLER, and RES_OKAY.
Referenced by load_module().
|
static |
Definition at line 9791 of file app_queue.c.
References member::delme, member::dynamic, and member::realtime.
Referenced by reload_single_queue().
|
static |
Definition at line 9945 of file app_queue.c.
References ast_strlen_zero(), call_queue::found, call_queue::name, and call_queue::realtime.
Referenced by reload_queues().
|
static |
Definition at line 3575 of file app_queue.c.
References ao2_container_count(), ao2_link, ao2_lock, ao2_unlock, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), member::interface, call_queue::members, call_queue::name, member::paused, QUEUE_PAUSED_DEVSTATE, QUEUE_UNPAUSED_DEVSTATE, and member::queuepos.
Referenced by add_to_queue(), reload_single_member(), and rt_handle_member_record().
|
static |
Definition at line 2965 of file app_queue.c.
References CMP_MATCH, CMP_STOP, member::interface, and OBJ_KEY.
Referenced by init_queue().
|
static |
Definition at line 2949 of file app_queue.c.
References compress_char(), member::interface, and OBJ_KEY.
Referenced by init_queue().
|
static |
Definition at line 3591 of file app_queue.c.
References ao2_lock, ao2_unlink, ao2_unlock, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), member::interface, call_queue::members, call_queue::name, pending_members_remove(), queue_member_follower_removal(), and QUEUE_UNKNOWN_PAUSED_DEVSTATE.
Referenced by find_queue_by_name_rt(), free_members(), remove_from_queue(), and update_realtime_members().
|
static |
Definition at line 4672 of file app_queue.c.
References AST_DEVICE_NOT_INUSE, AST_DEVICE_UNKNOWN, and status.
Referenced by can_ring_entry(), and manager_queues_summary().
|
static |
Get the number of members available to accept a call.
[in] | q | The queue for which we are counting the number of available members |
Definition at line 4538 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, call_queue::autofill, is_member_available(), call_queue::members, QUEUE_STRATEGY_RINGALL, and call_queue::strategy.
Referenced by compare_weight(), is_our_turn(), remove_from_queue(), and set_queue_member_pause().
|
static |
Definition at line 3318 of file app_queue.c.
References ast_false(), ast_log, ast_strdupa, ast_true(), LOG_WARNING, NULL, QUEUE_EMPTY_INUSE, QUEUE_EMPTY_INVALID, QUEUE_EMPTY_PAUSED, QUEUE_EMPTY_PENALTY, QUEUE_EMPTY_RINGING, QUEUE_EMPTY_UNAVAILABLE, QUEUE_EMPTY_UNKNOWN, QUEUE_EMPTY_WRAPUP, strsep(), and value.
Referenced by queue_set_param().
|
static |
Definition at line 2565 of file app_queue.c.
References ast_assert, CMP_MATCH, member::interface, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by load_module().
|
static |
Definition at line 2545 of file app_queue.c.
References ast_assert, ast_str_case_hash(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, and OBJ_SEARCH_OBJECT.
Referenced by load_module().
|
static |
Definition at line 2593 of file app_queue.c.
References ao2_find, ast_debug, member::membername, OBJ_NODATA, OBJ_POINTER, OBJ_UNLINK, and pending_members.
Referenced by can_ring_entry(), do_hang(), hangupcalls(), member_remove_from_queue(), ring_entry(), try_calling(), update_queue(), and update_status().
|
static |
Definition at line 4172 of file app_queue.c.
References ast_channel_language(), AST_DIGIT_ANY, ast_fileexists(), ast_stopstream(), ast_streamfile(), ast_strlen_zero(), ast_waitstream(), queue_ent::chan, and NULL.
Referenced by say_periodic_announcement(), say_position(), and try_calling().
|
static |
PauseQueueMember application.
Definition at line 8240 of file app_queue.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), LOG_WARNING, options, pbx_builtin_setvar_helper(), and set_member_paused().
Referenced by load_module().
|
static |
Print a single queue to AMI or the CLI.
Definition at line 10093 of file app_queue.c.
References ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_channel_name(), AST_DEVICE_UNAVAILABLE, AST_DEVICE_UNKNOWN, ast_devstate2str(), ast_str_alloca, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_strlen_zero(), ast_term_color(), ast_term_reset(), member::calls, call_queue::callsabandoned, call_queue::callsabandonedinsl, call_queue::callscompleted, call_queue::callscompletedinsl, queue_ent::chan, COLOR_BLACK, COLOR_BROWN, COLOR_CYAN, COLOR_GREEN, COLOR_MAGENTA, COLOR_RED, call_queue::count, do_print(), member::dynamic, call_queue::head, call_queue::holdtime, int2strat(), member::interface, member::lastcall, member::lastpause, member::logintime, call_queue::maxlen, member::membername, call_queue::members, call_queue::name, queue_ent::next, NULL, out, member::paused, member::penalty, queue_ent::pos, queue_ent::prio, member::realtime, member::reason_paused, member::ringinuse, call_queue::servicelevel, queue_ent::start, member::starttime, member::state_interface, member::status, call_queue::strategy, call_queue::talktime, and call_queue::weight.
Referenced by __queues_show().
|
static |
Definition at line 4486 of file app_queue.c.
References ast_channel_publish_dial(), callattempt::chan, in, NULL, callattempt::q_next, and status.
Referenced by ring_entry(), and wait_for_answer().
|
static |
Definition at line 7790 of file app_queue.c.
References queue_member_blob_create(), and queue_publish_member_blob().
Referenced by set_queue_member_pause().
|
static |
QueueLog application.
Definition at line 8477 of file app_queue.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, ast_queue_log(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), and LOG_WARNING.
Referenced by load_module().
|
static |
Definition at line 2293 of file app_queue.c.
References queue_multi_channel_to_ami().
|
static |
Definition at line 6189 of file app_queue.c.
References ast_channel_agent_login_type(), ast_channel_agent_logoff_type(), ast_json_integer_get(), ast_json_object_get(), ast_json_string_get(), ast_queue_log(), ast_channel_snapshot::base, ast_channel_blob::blob, ast_channel_snapshot_base::name, ast_channel_blob::snapshot, stasis_message_data(), stasis_message_type(), and ast_channel_snapshot_base::uniqueid.
Referenced by load_module().
|
static |
Definition at line 2303 of file app_queue.c.
References queue_multi_channel_to_ami().
|
static |
Definition at line 2298 of file app_queue.c.
References queue_multi_channel_to_ami().
|
static |
Definition at line 2308 of file app_queue.c.
References queue_multi_channel_to_ami().
|
static |
Definition at line 2313 of file app_queue.c.
References queue_multi_channel_to_ami().
|
static |
Definition at line 6552 of file app_queue.c.
References ao2_cleanup, stasis_subscription_final_message(), and sub.
Referenced by setup_stasis_subs().
|
static |
Definition at line 2173 of file app_queue.c.
References queue_channel_to_ami().
|
static |
Definition at line 2163 of file app_queue.c.
References queue_channel_to_ami().
|
static |
Definition at line 2168 of file app_queue.c.
References queue_channel_to_ami().
|
static |
Definition at line 6777 of file app_queue.c.
References ao2_cleanup, stasis_subscription_final_message(), and sub.
Referenced by setup_stasis_subs().
|
static |
Definition at line 2144 of file app_queue.c.
References ast_free, ast_manager_build_channel_state_string(), ast_manager_event_blob_create(), ast_manager_str_from_json_object(), ast_str_buffer(), ast_channel_blob::blob, EVENT_FLAG_AGENT, NULL, RAII_VAR, ast_channel_blob::snapshot, stasis_message_data(), and type.
Referenced by queue_caller_abandon_to_ami(), queue_caller_join_to_ami(), and queue_caller_leave_to_ami().
|
static |
Definition at line 2007 of file app_queue.c.
References CMP_MATCH, CMP_STOP, and call_queue::name.
Referenced by load_module().
|
static |
Definition at line 2053 of file app_queue.c.
References ao2_callback, member::delme, call_queue::members, OBJ_MULTIPLE, OBJ_NODATA, queue_member_decrement_followers(), member::queuepos, and call_queue::rrpos.
Referenced by reload_single_queue().
|
static |
The starting point for all queue calls.
The process involved here is to
Definition at line 8554 of file app_queue.c.
References call_queue::announce_to_first_user, call_queue::announcefrequency, ao2_container_count(), args, AST_APP_ARG, ast_app_exec_sub(), ast_app_parse_options(), ast_assert, ast_channel_caller(), ast_channel_lock, ast_channel_name(), ast_channel_uniqueid(), ast_channel_unlock, AST_CONTROL_RINGING, ast_copy_string(), ast_debug, AST_DECLARE_APP_ARGS, ast_free, ast_indicate(), AST_LIST_FIRST, ast_log, ast_max_forwards_get(), ast_moh_start(), ast_moh_stop(), ast_party_id_presentation(), AST_PRES_ALLOWED, AST_PRES_RESTRICTION, ast_queue_log(), ast_replace_subargument_delimiter(), AST_STANDARD_APP_ARGS, ast_stopstream(), ast_strdupa, ast_strlen_zero(), ast_test_flag, ast_verb, queue_ent::chan, copy_rules(), queue_ent::digits, queue_ent::expire, get_member_status(), queue_ent::handled, is_our_turn(), join_queue(), queue_ent::last_periodic_announce_sound, queue_ent::last_periodic_announce_time, queue_ent::last_pos, queue_ent::last_pos_said, leave_queue(), call_queue::leavewhenempty, call_queue::log_restricted_caller_id, LOG_WARNING, queue_ent::max_penalty, call_queue::members, queue_ent::min_penalty, queue_ent::moh, call_queue::name, NULL, queue_ent::opos, OPT_ARG_ARRAY_SIZE, OPT_ARG_MUSICONHOLD_CLASS, OPT_ARG_PREDIAL_CALLEE, OPT_ARG_PREDIAL_CALLER, OPT_GO_ON, OPT_MUSICONHOLD_CLASS, OPT_PREDIAL_CALLEE, OPT_PREDIAL_CALLER, OPT_RING_WHEN_RINGING, OPT_RINGING, options, queue_ent::parent, pbx_builtin_getvar_helper(), pbx_builtin_setvar_helper(), call_queue::periodicannouncefrequency, call_queue::periodicannouncestartdelay, queue_ent::pos, queue_ent::pr, queue_ent::predial_callee, queue_ent::prio, queue_ent::qe_rules, QUEUE_CONTINUE, queue_exec_options, QUEUE_LEAVEEMPTY, QUEUE_TIMEOUT, QUEUE_UNKNOWN, queue_unref, QUEUE_WITHDRAW, queue_ent::raise_penalty, record_abandoned(), queue_ent::ring_when_ringing, ringing(), S_COR, S_OR, say_periodic_announcement(), say_position(), set_queue_result(), set_queue_variables(), queue_ent::start, status, stop, penalty_rule::time, try_calling(), update_qe_rule(), update_realtime_members(), url, queue_ent::valid_digits, wait_a_bit(), wait_our_turn(), queue_ent::withdraw, and queue_ent::withdraw_info.
Referenced by load_module().
|
static |
Check if a given queue exists.
Definition at line 9010 of file app_queue.c.
References ast_log, ast_strlen_zero(), buf, find_load_queue_rt_friendly(), len(), LOG_ERROR, NULL, and queue_t_unref.
|
static |
Get number either busy / free / ready or total members of a specific queue.
Get or set member properties penalty / paused / ringinuse
number | of members (busy / free / ready / total) or member info (penalty / paused / ringinuse) |
-1 | on error |
Definition at line 9052 of file app_queue.c.
References ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, args, AST_APP_ARG, AST_DECLARE_APP_ARGS, AST_DEVICE_INVALID, AST_DEVICE_NOT_INUSE, AST_DEVICE_UNAVAILABLE, ast_log, AST_STANDARD_APP_ARGS, ast_strlen_zero(), buf, call_queue::count, find_load_queue_rt_friendly(), get_interface_helper(), get_wrapuptime(), member::lastcall, len(), LOG_ERROR, LOG_WARNING, call_queue::members, member::paused, member::penalty, queue_t_unref, member::ringinuse, and member::status.
|
static |
Dialplan function QUEUE_MEMBER() Sets the members penalty / paused / ringinuse.
Definition at line 9154 of file app_queue.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strlen_zero(), LOG_ERROR, MEMBER_PENALTY, MEMBER_RINGINUSE, NULL, set_member_paused(), set_member_value(), and value.
|
static |
Dialplan function QUEUE_MEMBER_PENALTY() Gets the members penalty.
Definition at line 9422 of file app_queue.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strlen_zero(), buf, get_member_penalty(), len(), and LOG_ERROR.
|
static |
Dialplan function QUEUE_MEMBER_PENALTY() Sets the members penalty.
Definition at line 9454 of file app_queue.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strlen_zero(), LOG_ERROR, MEMBER_PENALTY, set_member_value(), and value.
|
static |
Get the total number of members in a specific queue (Deprecated)
number | of members |
-1 | on error |
Definition at line 9217 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, AST_DEVICE_INVALID, AST_DEVICE_UNAVAILABLE, ast_log, ast_strlen_zero(), buf, call_queue::count, find_load_queue_rt_friendly(), len(), LOG_ERROR, LOG_NOTICE, LOG_WARNING, call_queue::members, queue_t_unref, and member::status.
|
static |
Dialplan function QUEUE_GET_CHANNEL() Get caller channel waiting at specified position in the queue.
Definition at line 9258 of file app_queue.c.
References ao2_lock, ao2_t_find, ao2_unlock, args, AST_APP_ARG, ast_channel_name(), ast_copy_string(), AST_DECLARE_APP_ARGS, ast_load_realtime(), ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ast_variables_destroy(), buf, queue_ent::chan, call_queue::count, call_queue::head, len(), LOG_ERROR, LOG_WARNING, call_queue::name, queue_ent::next, OBJ_POINTER, queue_ent::pos, queue_t_unref, queues, SENTINEL, and var.
|
static |
Dialplan function QUEUE_MEMBER_LIST() Get list of members in a specific queue.
Definition at line 9374 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_log, ast_strlen_zero(), buf, find_load_queue_rt_friendly(), member::interface, len(), LOG_ERROR, LOG_WARNING, call_queue::members, and queue_t_unref.
|
static |
Dialplan function QUEUE_WAITING_COUNT() Get number callers waiting in a specific queue.
Definition at line 9337 of file app_queue.c.
References ao2_lock, ao2_t_find, ao2_unlock, ast_load_realtime(), ast_log, ast_strlen_zero(), ast_variables_destroy(), buf, call_queue::count, len(), LOG_ERROR, LOG_WARNING, call_queue::name, NULL, OBJ_POINTER, queue_t_unref, queues, SENTINEL, and var.
|
static |
create interface var with all queue details.
0 | on success |
-1 | on error |
Definition at line 8966 of file app_queue.c.
References ao2_lock, ao2_unlock, ast_log, ast_strlen_zero(), buf, call_queue::callsabandoned, call_queue::callscompleted, call_queue::callscompletedinsl, call_queue::count, find_load_queue_rt_friendly(), call_queue::holdtime, int2strat(), len(), LOG_ERROR, LOG_WARNING, call_queue::maxlen, pbx_builtin_setvar_multiple(), queue_t_unref, call_queue::servicelevel, call_queue::setqueuevar, call_queue::strategy, and call_queue::talktime.
|
static |
Definition at line 2000 of file app_queue.c.
References ast_str_case_hash(), and call_queue::name.
Referenced by load_module().
|
static |
Definition at line 2208 of file app_queue.c.
References queue_member_to_ami().
|
static |
Definition at line 2424 of file app_queue.c.
References ast_json_pack(), member::calls, member::dynamic, member::interface, member::lastcall, member::lastpause, member::logintime, member::membername, call_queue::name, member::paused, member::penalty, member::realtime, member::reason_paused, member::ringinuse, member::starttime, member::state_interface, member::status, and member::wrapuptime.
Referenced by add_to_queue(), publish_queue_member_pause(), remove_from_queue(), set_member_penalty_help_members(), set_queue_member_ringinuse(), and update_status().
|
static |
Definition at line 2034 of file app_queue.c.
References member::queuepos.
Referenced by queue_delme_members_decrement_followers(), and queue_member_follower_removal().
|
static |
Definition at line 2071 of file app_queue.c.
References ao2_callback, call_queue::members, OBJ_MULTIPLE, OBJ_NODATA, queue_member_decrement_followers(), member::queuepos, and call_queue::rrpos.
Referenced by member_remove_from_queue().
|
static |
Definition at line 2218 of file app_queue.c.
References queue_member_to_ami().
|
static |
Definition at line 2223 of file app_queue.c.
References queue_member_to_ami().
|
static |
Definition at line 2213 of file app_queue.c.
References queue_member_to_ami().
|
static |
Definition at line 2228 of file app_queue.c.
References queue_member_to_ami().
|
static |
Definition at line 2203 of file app_queue.c.
References queue_member_to_ami().
|
static |
Definition at line 2188 of file app_queue.c.
References ast_free, ast_manager_event_blob_create(), ast_manager_str_from_json_object(), ast_str_buffer(), EVENT_FLAG_AGENT, ast_json_payload::json, NULL, RAII_VAR, stasis_message_data(), and type.
Referenced by queue_member_added_to_ami(), queue_member_pause_to_ami(), queue_member_penalty_to_ami(), queue_member_removed_to_ami(), queue_member_ringinuse_to_ami(), and queue_member_status_to_ami().
|
static |
Definition at line 2252 of file app_queue.c.
References ast_free, ast_log, ast_manager_build_channel_state_string(), ast_manager_build_channel_state_string_prefix(), ast_manager_event_blob_create(), ast_manager_str_from_json_object(), ast_multi_channel_blob_get_channel(), ast_multi_channel_blob_get_json(), ast_str_buffer(), ast_channel_snapshot::caller, EVENT_FLAG_AGENT, LOG_NOTICE, NULL, RAII_VAR, stasis_message_data(), and type.
Referenced by queue_agent_called_to_ami(), queue_agent_complete_to_ami(), queue_agent_connect_to_ami(), queue_agent_dump_to_ami(), and queue_agent_ringnoanswer_to_ami().
|
static |
Definition at line 2400 of file app_queue.c.
References ao2_cleanup, ast_json_payload_create(), ast_json_unref(), ast_manager_get_topic(), NULL, RAII_VAR, stasis_message_create(), stasis_publish(), and type.
Referenced by add_to_queue(), publish_queue_member_pause(), remove_from_queue(), set_member_penalty_help_members(), set_queue_member_ringinuse(), and update_status().
|
static |
Definition at line 2369 of file app_queue.c.
References ao2_cleanup, ast_channel_lock, ast_channel_snapshot_create(), ast_channel_topic(), ast_channel_unlock, NULL, queue_publish_multi_channel_snapshot_blob(), RAII_VAR, and type.
Referenced by ring_entry(), rna(), and try_calling().
|
static |
Definition at line 2334 of file app_queue.c.
References ao2_cleanup, ast_debug, ast_multi_channel_blob_add_channel(), ast_multi_channel_blob_create(), NULL, RAII_VAR, stasis_message_create(), stasis_publish(), and type.
Referenced by queue_publish_multi_channel_blob(), and send_agent_complete().
|
static |
Always set the global queue defaults, even if there is no "general" section in queues.conf
Definition at line 9612 of file app_queue.c.
References autofill_default, force_longest_waiting_caller, log_membername_as_agent, montype_default, negative_penalty_invalid, queue_persistent_members, and shared_lastcall.
Referenced by reload_queues().
|
static |
Reset the global queue rules parameters even if there is no "general" section of queuerules.conf
Definition at line 9533 of file app_queue.c.
References realtime_rules.
Referenced by reload_queue_rules().
|
static |
Set the global queue rules parameters as defined in the "general" section of queuerules.conf
Definition at line 9539 of file app_queue.c.
References ast_true(), ast_variable_retrieve(), NULL, and realtime_rules.
Referenced by reload_queue_rules().
|
static |
Set the global queue parameters as defined in the "general" section of queues.conf
Definition at line 9624 of file app_queue.c.
References ast_true(), ast_variable_retrieve(), autofill_default, force_longest_waiting_caller, log_membername_as_agent, montype_default, negative_penalty_invalid, NULL, queue_persistent_members, and shared_lastcall.
Referenced by reload_queues().
|
static |
Configure a queue parameter.
The failunknown flag is set for config files (and static realtime) to show errors for unknown parameters. It is cleared for dynamic realtime to allow extra fields in the tables.
Definition at line 3361 of file app_queue.c.
References call_queue::announce_to_first_user, call_queue::announcefrequency, call_queue::announceholdtime, ANNOUNCEHOLDTIME_ALWAYS, ANNOUNCEHOLDTIME_ONCE, call_queue::announceposition, ANNOUNCEPOSITION_LIMIT, ANNOUNCEPOSITION_MORE_THAN, ANNOUNCEPOSITION_NO, call_queue::announceposition_only_up, ANNOUNCEPOSITION_YES, call_queue::announcepositionlimit, ast_copy_string(), ast_debug, ast_log, ast_str_create, ast_str_set(), ast_strdupa, ast_string_field_set, ast_true(), call_queue::autofill, call_queue::autopause, autopause2int(), call_queue::autopausebusy, call_queue::autopausedelay, call_queue::autopauseunavail, buf, voicemailpwcheck::context, DEFAULT_RETRY, DEFAULT_TIMEOUT, call_queue::joinempty, call_queue::leavewhenempty, call_queue::log_restricted_caller_id, LOG_WARNING, MAX_PERIODIC_ANNOUNCEMENTS, call_queue::maxlen, call_queue::memberdelay, call_queue::minannouncefrequency, call_queue::monfmt, call_queue::name, call_queue::numperiodicannounce, parse_empty_options(), call_queue::penaltymemberslimit, call_queue::periodicannouncefrequency, call_queue::periodicannouncestartdelay, QUEUE_STRATEGY_LINEAR, QUEUE_STRATEGY_RINGALL, call_queue::randomperiodicannounce, call_queue::relativeperiodicannounce, call_queue::reportholdtime, call_queue::retry, call_queue::ringinuse, call_queue::roundingseconds, call_queue::servicelevel, call_queue::setinterfacevar, call_queue::setqueueentryvar, call_queue::setqueuevar, call_queue::sound_periodicannounce, strat2int(), call_queue::strategy, strsep(), call_queue::timeout, TIMEOUT_PRIORITY_APP, TIMEOUT_PRIORITY_CONF, call_queue::timeoutpriority, call_queue::timeoutrestart, call_queue::weight, and call_queue::wrapuptime.
Referenced by find_queue_by_name_rt(), and reload_single_queue().
|
static |
Definition at line 10417 of file app_queue.c.
References __queues_show(), a, CLI_GENERATE, CLI_INIT, ast_cli_entry::command, complete_queue_show(), NULL, and ast_cli_entry::usage.
|
static |
Definition at line 6320 of file app_queue.c.
References ao2_alloc, ao2_cleanup, ao2_ref, ast_channel_uniqueid(), ast_string_field_init, ast_string_field_set, queue_stasis_data::callcompletedinsl, queue_stasis_data::caller_pos, queue_stasis_data::caller_uniqueid, queue_ent::chan, queue_stasis_data::holdstart, queue_stasis_data::member, queue_stasis_data::member_uniqueid, NULL, queue_ent::opos, queue_ent::parent, queue_stasis_data::queue, queue_ref, queue_stasis_data_destructor(), and queue_stasis_data::starttime.
Referenced by setup_stasis_subs().
|
static |
Definition at line 6288 of file app_queue.c.
References ao2_cleanup, ast_assert, ast_string_field_free_memory, queue_stasis_data::bridge_router, queue_stasis_data::channel_router, queue_stasis_data::member, NULL, queue_stasis_data::queue, and queue_unref.
Referenced by queue_stasis_data_alloc().
|
static |
Update Queue with data of an outgoing call.
Definition at line 11662 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, ast_queue_log(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), member::calls, call_queue::callsabandoned, call_queue::callscompleted, call_queue::callscompletedinsl, find_load_queue_rt_friendly(), member::lastcall, member::lastqueue, LOG_WARNING, member::membername, call_queue::members, queue_t_unref, status, and call_queue::talktime.
Referenced by load_module().
|
static |
Definition at line 4378 of file app_queue.c.
References ao2_lock, ao2_unlock, call_queue::callsabandoned, call_queue::callscompleted, call_queue::holdtime, and queue_ent::parent.
Referenced by try_calling().
|
static |
Record that a caller gave up on waiting in queue.
Definition at line 5108 of file app_queue.c.
References ao2_lock, ao2_unlock, ast_channel_publish_cached_blob(), ast_json_pack(), ast_json_unref(), call_queue::callsabandoned, call_queue::callsabandonedinsl, queue_ent::chan, call_queue::name, NULL, queue_ent::opos, queue_ent::parent, pbx_builtin_setvar_helper(), queue_ent::pos, RAII_VAR, call_queue::servicelevel, set_queue_variables(), and queue_ent::start.
Referenced by queue_exec(), try_calling(), and wait_our_turn().
|
static |
Definition at line 11986 of file app_queue.c.
References AST_FLAGS_ALL, ast_unload_realtime(), NULL, and reload_handler().
Referenced by reload_handler(), reload_queue_rules(), and reload_queues().
|
static |
The command center for all reload operations.
Whenever any piece of queue information is to be reloaded, this function is called. It interprets the flags set in the mask parameter and acts based on how they are set.
reload | True if we are reloading information, false if we are loading information for the first time. |
mask | A bitmask which tells the handler what actions to take |
queuename | The name of the queue on which we wish to take action |
0 | All reloads were successful |
non-zero | There was a failure |
Definition at line 10066 of file app_queue.c.
References ast_test_flag, clear_stats(), QUEUE_RELOAD_MEMBER, QUEUE_RELOAD_PARAMETERS, QUEUE_RELOAD_RULES, QUEUE_RESET_STATS, reload(), reload_queue_rules(), and reload_queues().
Referenced by handle_queue_reload(), handle_queue_reset(), load_module(), manager_queue_reload(), manager_queue_reset(), and reload().
|
static |
Reload dynamic queue members persisted into the astdb.
Definition at line 8129 of file app_queue.c.
References add_to_queue(), ao2_t_find, ast_db_del(), ast_db_freetree(), ast_db_get_allocated(), ast_db_gettree(), ast_debug, ast_free, ast_log, ast_strlen_zero(), errno, find_load_queue_rt_friendly(), member::interface, entry::key, LOG_ERROR, LOG_NOTICE, LOG_WARNING, member::membername, call_queue::name, NULL, OBJ_POINTER, member::paused, member::penalty, pm_family, queue_t_unref, queues, member::reason_paused, RES_OUTOFMEMORY, member::state_interface, strsep(), and member::wrapuptime.
Referenced by load_module().
|
static |
Reload the rules defined in queuerules.conf.
reload | If 1, then only process queuerules.conf if the file has changed since the last time we inspected it. |
Definition at line 9553 of file app_queue.c.
References ast_calloc, ast_category_browse(), ast_config_destroy(), ast_config_load, ast_copy_string(), ast_free, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_variable_browse(), CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, insert_penaltychange(), ast_variable::lineno, load_realtime_rules(), LOG_ERROR, LOG_NOTICE, LOG_WARNING, rule_list::name, ast_variable::name, ast_variable::next, NULL, queue_rules_reset_global_params(), queue_rules_set_global_params(), realtime_rules, reload(), rule_list::rules, and ast_variable::value.
Referenced by reload_handler().
|
static |
reload the queues.conf file
This function reloads the information in the general section of the queues.conf file and potentially more, depending on the value of mask.
reload | 0 if we are calling this the first time, 1 every other time |
mask | Gives flags telling us what information to actually reload |
queuename | If set to a non-zero string, then only reload information from that particular queue. Otherwise inspect all queues |
-1 | Failure occurred |
0 | All clear! |
Definition at line 9979 of file app_queue.c.
References ao2_callback, ao2_lock, ao2_unlock, ast_category_browse(), ast_config_destroy(), ast_config_load, ast_log, ast_strlen_zero(), ast_test_flag, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, kill_if_unfound(), LOG_ERROR, LOG_NOTICE, mark_unfound(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_NOLOCK, OBJ_UNLINK, QUEUE_RELOAD_PARAMETERS, queue_reset_global_params(), queue_set_global_params(), queues, reload(), and reload_single_queue().
Referenced by reload_handler().
|
static |
reload information pertaining to a single member
This function is called when a member = line is encountered in queues.conf.
memberdata | The part after member = in the config file |
q | The queue to which this member belongs |
Definition at line 9659 of file app_queue.c.
References ao2_find, ao2_link, ao2_lock, ao2_ref, ao2_unlink, ao2_unlock, args, AST_APP_ARG, ast_copy_string(), AST_DECLARE_APP_ARGS, ast_false(), ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strip(), ast_strlen_zero(), ast_true(), member::calls, create_queue_member(), member::interface, member::lastcall, LOG_ERROR, LOG_WARNING, member_add_to_queue(), member::membername, call_queue::members, call_queue::name, NULL, OBJ_POINTER, member::paused, member::penalty, member::queuepos, member::ringinuse, call_queue::ringinuse, member::state_interface, tmp(), and member::wrapuptime.
Referenced by reload_single_queue().
|
static |
Reload information pertaining to a particular queue.
Once we have isolated a queue within reload_queues, we call this. This will either reload information for the queue or if we're just reloading member information, we'll just reload that without touching other settings within the queue
cfg | The configuration which we are reading |
mask | Tells us what information we need to reload |
queuename | The name of the queue we are reloading information from |
Definition at line 9822 of file app_queue.c.
References alloc_queue(), ao2_callback, ao2_iterator_destroy(), AO2_ITERATOR_DONTLOCK, ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_t_find, ao2_unlock, ast_atomic_fetchadd_int(), ast_log, ast_test_flag, ast_variable_browse(), ast_variable_retrieve(), member::dynamic, call_queue::found, init_queue(), kill_dead_members(), LOG_WARNING, mark_member_dead(), call_queue::members, call_queue::name, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_POINTER, OBJ_UNLINK, queue_delme_members_decrement_followers(), QUEUE_RELOAD_MEMBER, QUEUE_RELOAD_PARAMETERS, queue_set_param(), QUEUE_STRATEGY_RINGALL, queue_t_unref, queues, queues_t_link, reload_single_member(), member::ringinuse, call_queue::ringinuse, strat2int(), call_queue::strategy, use_weight, var, and call_queue::weight.
Referenced by reload_queues().
|
static |
Remove member from queue.
RES_NOT_DYNAMIC | when they aren't a RT member |
RES_NOSUCHQUEUE | queue does not exist |
RES_OKAY | removed member from queue |
RES_EXISTS | queue exists but no members |
Definition at line 7569 of file app_queue.c.
References ao2_find, ao2_lock, ao2_ref, ao2_t_find, ao2_unlock, ast_copy_string(), AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_strlen_zero(), dump_queue_members(), member::dynamic, member::interface, member_remove_from_queue(), call_queue::members, call_queue::name, negative_penalty_invalid, num_available_members(), OBJ_POINTER, queue_member_blob_create(), queue_persistent_members, queue_publish_member_blob(), queue_t_unref, queues, member::realtime, RES_EXISTS, RES_NOSUCHQUEUE, RES_NOT_DYNAMIC, RES_OKAY, member::rt_uniqueid, and update_realtime_member_field().
Referenced by handle_queue_remove_member(), manager_remove_queue_member(), and rqm_exec().
|
static |
Definition at line 6305 of file app_queue.c.
References queue_stasis_data::bridge_router, queue_stasis_data::channel_router, queue_stasis_data::dying, lock, NULL, SCOPED_AO2LOCK, and stasis_message_router_unsubscribe().
Referenced by handle_attended_transfer(), handle_blind_transfer(), and handle_hangup().
|
static |
Request to withdraw a caller from a queue.
RES_NOSUCHQUEUE | queue does not exist |
RES_OKAY | withdraw request sent |
RES_NOT_CALLER | queue exists but no caller |
RES_EXISTS | a withdraw request was already sent for this caller (channel) and queue |
Definition at line 7751 of file app_queue.c.
References ao2_lock, ao2_unlock, ast_channel_name(), ast_debug, ast_strdup, queue_ent::chan, find_load_queue_rt_friendly(), call_queue::head, queue_ent::next, queue_unref, RES_EXISTS, RES_NOSUCHQUEUE, RES_NOT_CALLER, RES_OKAY, queue_ent::withdraw, and queue_ent::withdraw_info.
Referenced by manager_request_withdraw_caller_from_queue().
|
static |
Part 2 of ring_one.
Does error checking before attempting to request a channel and call a member. This function is only called from ring_one(). Failure can occur if:
1 | on success to reach a free agent |
0 | on failure to get agent. |
Definition at line 4782 of file app_queue.c.
References ast_party_caller::ani, ast_party_connected_line::ani, ao2_bump, ao2_cleanup, ao2_lock, ao2_unlock, ast_call(), AST_CAUSE_ANSWERED_ELSEWHERE, ast_channel_adsicpe_set(), ast_channel_appl_set(), ast_channel_caller(), ast_channel_connected(), ast_channel_context(), ast_channel_data_set(), ast_channel_datastore_inherit(), ast_channel_dialed(), ast_channel_exten(), ast_channel_exten_set(), ast_channel_hangupcause_set(), ast_channel_inherit_variables(), ast_channel_lock, ast_channel_lock_both, ast_channel_name(), ast_channel_nativeformats(), ast_channel_publish_dial(), ast_channel_redirecting(), ast_channel_req_accountcodes_precious(), AST_CHANNEL_REQUESTOR_BRIDGE_PEER, ast_channel_set_caller_event(), ast_channel_unlock, ast_channel_whentohangup(), ast_connected_line_copy_from_caller(), ast_copy_string(), ast_json_pack(), ast_json_unref(), ast_max_forwards_decrement(), ast_party_caller_set_init(), ast_party_redirecting_copy(), ast_pre_call(), ast_request(), ast_set_callerid(), ast_strdup, ast_strlen_zero(), ast_verb, can_ring_entry(), queue_ent::cancel_answered_elsewhere, queue_ent::chan, do_hang(), ast_party_caller::id, ast_party_connected_line::id, queue_ent::linpos, call_queue::name, NULL, ast_party_id::number, ast_party_dialed::number, queue_ent::parent, pbx_builtin_setvar_helper(), pending_members_remove(), queue_ent::predial_callee, publish_dial_end_event(), queue_publish_multi_channel_blob(), RAII_VAR, call_queue::rrpos, status, ast_party_dialed::str, tmp(), ast_party_dialed::transit_network_select, and ast_party_number::valid.
Referenced by ring_one().
|
static |
Place a call to a queue member.
Once metrics have been calculated for each member, this function is used to place a call to the appropriate member (or members). The low-level channel-handling and error detection is handled in ring_entry
1 | if a member was called successfully |
0 | otherwise |
Definition at line 4939 of file app_queue.c.
References ast_autoservice_start(), ast_autoservice_stop(), ast_debug, callattempt::chan, queue_ent::chan, queue_ent::expire, find_best(), callattempt::interface, callattempt::metric, NULL, queue_ent::parent, queue_ent::predial_callee, callattempt::q_next, QUEUE_STRATEGY_RINGALL, ring_entry(), callattempt::stillgoing, and call_queue::strategy.
Referenced by try_calling(), and wait_for_answer().
|
static |
RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer.
Definition at line 5139 of file app_queue.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_channel_uniqueid(), ast_indicate(), ast_json_pack(), ast_json_unref(), ast_moh_start(), ast_queue_log(), ast_verb, call_queue::autopause, call_queue::autopausedelay, queue_ent::chan, callattempt::interface, member::interface, interface_exists(), member::lastcall, queue_ent::moh, call_queue::name, NULL, queue_ent::parent, QUEUE_AUTOPAUSE_OFF, QUEUE_AUTOPAUSE_ON, queue_publish_multi_channel_blob(), RAII_VAR, queue_ent::ring_when_ringing, and set_member_paused().
Referenced by wait_for_answer().
|
static |
RemoveQueueMember application.
Definition at line 8312 of file app_queue.c.
References ao2_ref, args, AST_APP_ARG, ast_channel_name(), ast_channel_uniqueid(), ast_debug, AST_DECLARE_APP_ARGS, ast_log, ast_queue_log(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), find_member_by_queuename_and_interface(), member::interface, log_membername_as_agent, LOG_NOTICE, LOG_WARNING, member::membername, NULL, pbx_builtin_setvar_helper(), remove_from_queue(), RES_EXISTS, RES_NOSUCHQUEUE, RES_NOT_DYNAMIC, and RES_OKAY.
Referenced by load_module().
|
static |
Find rt member record to update otherwise create one.
Search for member in queue, if found update penalty/paused state, if no member exists create one flag it as a RT member and add to queue member list.
Definition at line 3607 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_copy_string(), AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_false(), ast_log, ast_queue_log(), ast_strlen_zero(), ast_true(), ast_variable_retrieve(), create_queue_member(), member::dead, member::interface, member::lastpause, log_membername_as_agent, LOG_WARNING, member_add_to_queue(), member::membername, call_queue::members, call_queue::name, negative_penalty_invalid, NULL, member::paused, member::penalty, QUEUE_PAUSED_DEVSTATE, QUEUE_UNPAUSED_DEVSTATE, member::realtime, realtime_reason_paused, realtime_ringinuse_field, member::reason_paused, member::ringinuse, call_queue::ringinuse, member::rt_uniqueid, S_OR, member::state_interface, and member::wrapuptime.
Referenced by find_queue_by_name_rt(), and update_realtime_members().
|
static |
Playback announcement to queued members if period has elapsed.
Definition at line 5047 of file app_queue.c.
References AST_CONTROL_RINGING, ast_indicate(), ast_moh_start(), ast_moh_stop(), ast_random(), ast_str_buffer(), ast_str_strlen(), ast_verb, queue_ent::chan, queue_ent::last_periodic_announce_sound, queue_ent::last_periodic_announce_time, queue_ent::moh, NULL, call_queue::numperiodicannounce, queue_ent::parent, call_queue::periodicannouncefrequency, play_file(), call_queue::randomperiodicannounce, call_queue::relativeperiodicannounce, ringing(), call_queue::sound_periodicannounce, and valid_exit().
Referenced by queue_exec(), and wait_our_turn().
|
static |
Definition at line 4236 of file app_queue.c.
References call_queue::announcefrequency, call_queue::announceholdtime, ANNOUNCEHOLDTIME_ONCE, call_queue::announceposition, ANNOUNCEPOSITION_LIMIT, ANNOUNCEPOSITION_MORE_THAN, call_queue::announceposition_only_up, ANNOUNCEPOSITION_YES, call_queue::announcepositionlimit, ast_channel_language(), ast_channel_name(), AST_CONTROL_RINGING, AST_DIGIT_ANY, ast_indicate(), ast_moh_start(), ast_moh_stop(), ast_say_number(), ast_verb, queue_ent::chan, call_queue::holdtime, queue_ent::last_pos, queue_ent::last_pos_said, call_queue::minannouncefrequency, queue_ent::moh, call_queue::name, NULL, queue_ent::parent, play_file(), queue_ent::pos, call_queue::queue_quantity1, call_queue::queue_quantity2, ringing(), call_queue::roundingseconds, call_queue::sound_calls, call_queue::sound_holdtime, call_queue::sound_minute, call_queue::sound_minutes, call_queue::sound_next, call_queue::sound_seconds, call_queue::sound_thanks, call_queue::sound_thereare, queue_ent::start, and valid_exit().
Referenced by queue_exec(), and wait_our_turn().
|
static |
Send out AMI message with member call completion status information.
Definition at line 6158 of file app_queue.c.
References AGENT, ast_json_pack(), ast_json_unref(), ast_queue_topic(), CALLER, member::interface, member::membername, NULL, queue_publish_multi_channel_snapshot_blob(), RAII_VAR, and TRANSFER.
Referenced by handle_attended_transfer(), handle_blind_transfer(), and handle_hangup().
|
static |
Definition at line 7881 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_check_realtime(), ast_queue_log(), ast_strlen_zero(), member::interface, interface_exists(), load_realtime_queues(), member::membername, call_queue::name, member::paused, queue_t_unref, queues, RESULT_FAILURE, RESULT_SUCCESS, S_OR, and set_queue_member_pause().
Referenced by handle_queue_pause_member(), manager_pause_queue_member(), pqm_exec(), queue_function_mem_write(), rna(), and upqm_exec().
|
static |
Definition at line 7941 of file app_queue.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_queue_log(), member::interface, interface_exists(), call_queue::name, member::penalty, queue_member_blob_create(), queue_publish_member_blob(), member::realtime, and update_realtime_member_field().
Referenced by set_member_value_help_members().
|
static |
Definition at line 7990 of file app_queue.c.
References ao2_lock, ao2_ref, ao2_unlock, member::interface, interface_exists(), member::ringinuse, and set_queue_member_ringinuse().
Referenced by set_member_value_help_members().
|
static |
Definition at line 8029 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_t_iterator_next, ast_category_browse(), ast_check_realtime(), ast_config_destroy(), ast_load_realtime_multientry(), ast_log, ast_strlen_zero(), ast_variable_retrieve(), find_load_queue_rt_friendly(), LOG_ERROR, LOG_WARNING, MEMBER_PENALTY, name, negative_penalty_invalid, NULL, queue_unref, queues, RESULT_FAILURE, RESULT_SUCCESS, SENTINEL, set_member_value_help_members(), and value.
Referenced by handle_queue_set_member_penalty(), handle_queue_set_member_ringinuse(), manager_queue_member_penalty(), manager_queue_member_ringinuse(), queue_function_mem_write(), and queue_function_memberpenalty_write().
|
static |
Definition at line 8006 of file app_queue.c.
References ast_log, member::interface, LOG_ERROR, MEMBER_PENALTY, MEMBER_RINGINUSE, set_member_penalty_help_members(), set_member_ringinuse_help_members(), and value.
Referenced by set_member_value().
|
static |
Definition at line 7814 of file app_queue.c.
References ast_copy_string(), ast_debug, AST_DEVICE_INUSE, AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_log, ast_queue_log(), ast_strlen_zero(), ast_update_realtime(), dump_queue_members(), member::interface, is_member_available(), member::lastpause, LOG_WARNING, member::membername, call_queue::name, num_available_members(), member::paused, publish_queue_member_pause(), QUEUE_PAUSED_DEVSTATE, queue_persistent_members, QUEUE_UNPAUSED_DEVSTATE, member::realtime, realtime_reason_paused, member::reason_paused, member::rt_uniqueid, S_OR, and SENTINEL.
Referenced by set_member_paused().
|
static |
Definition at line 7977 of file app_queue.c.
References ast_queue_log(), member::interface, call_queue::name, queue_member_blob_create(), queue_publish_member_blob(), member::realtime, realtime_ringinuse_field, member::ringinuse, and update_realtime_member_field().
Referenced by set_member_ringinuse_help_members().
|
static |
sets the QUEUESTATUS channel variable
Definition at line 1939 of file app_queue.c.
References ARRAY_LEN, pbx_builtin_setvar_helper(), queue_results, and text.
Referenced by queue_exec().
|
static |
Set variables of queue.
Definition at line 2092 of file app_queue.c.
References ao2_lock, ao2_unlock, call_queue::callsabandoned, call_queue::callscompleted, call_queue::callscompletedinsl, call_queue::count, call_queue::holdtime, int2strat(), call_queue::maxlen, call_queue::name, pbx_builtin_setvar_multiple(), call_queue::servicelevel, call_queue::setqueuevar, call_queue::strategy, and call_queue::talktime.
Referenced by end_bridge_callback(), queue_exec(), record_abandoned(), and try_calling().
|
static |
Definition at line 6934 of file app_queue.c.
References ast_channel_lock, ast_channel_uniqueid(), ast_channel_unlock, ast_copy_string(), ast_debug, ast_log, ast_start_mixmonitor(), ast_strdupa, ast_strlen_zero(), queue_ent::chan, escape_and_substitute(), LOG_WARNING, call_queue::monfmt, queue_ent::parent, and pbx_builtin_getvar_helper().
Referenced by try_calling().
|
static |
Definition at line 6886 of file app_queue.c.
References ast_bridge_set_after_go_on(), ast_channel_context(), ast_channel_exten(), ast_channel_lock, ast_channel_priority(), ast_channel_unlock, ast_strdupa, ast_test_flag, voicemailpwcheck::context, OPT_ARG_CALLEE_GO_ON, OPT_CALLEE_GO_ON, and priority.
Referenced by try_calling().
|
static |
Definition at line 6802 of file app_queue.c.
References ao2_ref, ast_attended_transfer_type(), ast_blind_transfer_type(), ast_bridge_topic_all(), ast_channel_entered_bridge_type(), ast_channel_hangup_request_type(), ast_channel_masquerade_type(), ast_channel_topic_all(), ast_local_optimization_begin_type(), ast_local_optimization_end_type(), queue_stasis_data::bridge_router, queue_stasis_data::callcompletedinsl, queue_stasis_data::channel_router, handle_attended_transfer(), handle_blind_transfer(), handle_bridge_enter(), handle_hangup(), handle_local_optimization_begin(), handle_local_optimization_end(), handle_masquerade(), queue_stasis_data::holdstart, NULL, queue_bridge_cb(), queue_channel_cb(), queue_stasis_data_alloc(), queue_stasis_data::starttime, stasis_message_router_add(), stasis_message_router_create_pool, stasis_message_router_set_default(), and stasis_message_router_unsubscribe().
Referenced by try_calling().
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_agent_called_type | , |
. | to_ami = queue_agent_called_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_agent_complete_type | , |
. | to_ami = queue_agent_complete_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_agent_connect_type | , |
. | to_ami = queue_agent_connect_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_agent_dump_type | , |
. | to_ami = queue_agent_dump_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_agent_ringnoanswer_type | , |
. | to_ami = queue_agent_ringnoanswer_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_caller_abandon_type | , |
. | to_ami = queue_caller_abandon_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_caller_join_type | , |
. | to_ami = queue_caller_join_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_caller_leave_type | , |
. | to_ami = queue_caller_leave_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_member_added_type | , |
. | to_ami = queue_member_added_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_member_pause_type | , |
. | to_ami = queue_member_pause_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_member_penalty_type | , |
. | to_ami = queue_member_penalty_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_member_removed_type | , |
. | to_ami = queue_member_removed_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_member_ringinuse_type | , |
. | to_ami = queue_member_ringinuse_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_member_status_type | , |
. | to_ami = queue_member_status_to_ami |
||
) |
|
static |
Search for best metric and add to Linear queue.
Definition at line 5023 of file app_queue.c.
References ast_debug, find_best(), callattempt::interface, queue_ent::linpos, queue_ent::linwrapped, and callattempt::metric.
Referenced by try_calling().
|
static |
Search for best metric and add to Round Robbin queue.
Definition at line 4999 of file app_queue.c.
References ast_debug, find_best(), callattempt::interface, callattempt::metric, queue_ent::parent, call_queue::rrpos, and call_queue::wrapped.
Referenced by try_calling().
|
static |
Definition at line 1964 of file app_queue.c.
References ARRAY_LEN, name, strategies, and strategy::strategy.
Referenced by find_queue_by_name_rt(), queue_set_param(), and reload_single_queue().
|
static |
Definition at line 7007 of file app_queue.c.
References queue_ent::announce, ao2_alloc, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_app_exec_sub(), ast_asprintf, ast_autoservice_chan_hangup_peer(), ast_autoservice_start(), ast_autoservice_stop(), ast_bridge_call_with_flags(), AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM, AST_BRIDGE_FLAG_MERGE_INHIBIT_TO, AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM, ast_calloc, AST_CAUSE_ANSWERED_ELSEWHERE, ast_channel_caller(), ast_channel_connected(), ast_channel_context(), ast_channel_exten(), ast_channel_hangupcause(), ast_channel_language(), ast_channel_lock, ast_channel_make_compatible(), ast_channel_name(), ast_channel_publish_dial(), ast_channel_sendurl(), ast_channel_setoption(), ast_channel_supports_html(), ast_channel_tech(), ast_channel_uniqueid(), ast_channel_unlock, ast_check_hangup(), ast_copy_string(), ast_debug, AST_DIGIT_ANY, ast_exists_extension(), AST_FEATURE_AUTOMIXMON, AST_FEATURE_AUTOMON, AST_FEATURE_DISCONNECT, AST_FEATURE_PARKCALL, AST_FEATURE_REDIRECT, ast_free, ast_hangup_cause_to_dial_status(), ast_indicate(), ast_json_pack(), ast_json_unref(), ast_log, AST_MAX_CONTEXT, AST_MAX_EXTENSION, ast_moh_stop(), AST_OPTION_TONE_VERIFY, ast_party_connected_line_copy(), ast_queue_log(), ast_safe_sleep(), ast_say_number(), ast_set_flag, ast_str_buffer(), ast_str_create, ast_str_set(), ast_strdupa, ast_strlen_zero(), ast_strsep(), AST_STRSEP_STRIP, AST_STRSEP_TRIM, ast_test_flag, calc_metric(), callattempt_free(), member::callcompletedinsl, member::calls, queue_ent::cancel_answered_elsewhere, callattempt::chan, queue_ent::chan, queue_end_bridge::chan, digit, member::dynamic, end_bridge_callback(), ast_bridge_config::end_bridge_callback, ast_bridge_config::end_bridge_callback_data, end_bridge_callback_data_fixup(), ast_bridge_config::end_bridge_callback_data_fixup, queue_ent::expire, ast_bridge_config::features_callee, ast_bridge_config::features_caller, queue_ent::handled, hangupcalls(), member::interface, member::lastcall, leave_queue(), LOG_ERROR, LOG_NOTICE, LOG_WARNING, callattempt::member, call_queue::memberdelay, call_queue::membergosub, member::membername, call_queue::members, call_queue::monfmt, call_queue::name, NULL, queue_ent::opos, OPT_CALLEE_AUTOMIXMON, OPT_CALLEE_AUTOMON, OPT_CALLEE_HANGUP, OPT_CALLEE_PARK, OPT_CALLEE_TRANSFER, OPT_CALLER_AUTOMIXMON, OPT_CALLER_AUTOMON, OPT_CALLER_HANGUP, OPT_CALLER_PARK, OPT_CALLER_TRANSFER, OPT_DATA_QUALITY, OPT_IGNORE_CALL_FW, OPT_IGNORE_CONNECTEDLINE, OPT_MARK_AS_ANSWERED, OPT_NO_RETRY, out, queue_ent::parent, pbx_builtin_getvar_helper(), pbx_builtin_setvar_multiple(), pbx_exec(), pbx_findapp(), member::penalty, queue_ent::pending, pending_members_remove(), play_file(), queue_ent::pos, queue_end_bridge::q, queue_publish_multi_channel_blob(), QUEUE_STRATEGY_LINEAR, QUEUE_STRATEGY_RRMEMORY, QUEUE_STRATEGY_RRORDERED, queue_t_ref, RAII_VAR, member::realtime, recalc_holdtime(), record_abandoned(), call_queue::reportholdtime, ring_one(), ringing(), S_COR, call_queue::servicelevel, set_queue_variables(), call_queue::setinterfacevar, call_queue::setqueueentryvar, setup_mixmonitor(), setup_peer_after_bridge_goto(), setup_stasis_subs(), call_queue::sound_callerannounce, call_queue::sound_minutes, call_queue::sound_reporthold, call_queue::sound_seconds, queue_ent::start, member::starttime, store_next_lin(), store_next_rr(), call_queue::strategy, call_queue::timeout, TIMEOUT_PRIORITY_APP, call_queue::timeoutpriority, tmp(), type, ast_channel_tech::type, url, and wait_for_answer().
Referenced by queue_exec().
|
static |
Definition at line 11755 of file app_queue.c.
References agent_router, ao2_cleanup, app, app_aqm, app_pqm, app_ql, app_qupd, app_rqm, app_upqm, ARRAY_LEN, ast_cli_unregister_multiple(), ast_custom_function_unregister(), ast_manager_unregister(), ast_unload_realtime(), ast_unregister_application(), cli_queue, device_state_sub, NULL, pending_members, queueexists_function, queuegetchannel_function, queuemembercount_dep, queuemembercount_function, queuememberlist_function, queuememberpenalty_function, queues, queuevar_function, queuewaitingcount_function, stasis_forward_cancel(), stasis_message_router_unsubscribe_and_join(), STASIS_MESSAGE_TYPE_CLEANUP, stasis_unsubscribe_and_join(), and topic_forwarder.
Referenced by load_module().
|
static |
Definition at line 5204 of file app_queue.c.
References ast_channel_caller(), ast_channel_connected_line_sub(), ast_channel_lock, ast_channel_unlock, ast_channel_update_connected_line(), ast_connected_line_copy_from_caller(), AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER, ast_party_connected_line_free(), ast_party_connected_line_init(), NULL, and ast_party_connected_line::source.
Referenced by wait_for_answer().
|
static |
update rules for queues
Calculate min/max penalties making sure if relative they stay within bounds. Update queues penalty and set dialplan vars, goto next list entry.
Definition at line 5823 of file app_queue.c.
References ast_channel_name(), ast_debug, AST_LIST_NEXT, queue_ent::chan, queue_ent::max_penalty, penalty_rule::max_relative, penalty_rule::max_value, queue_ent::min_penalty, penalty_rule::min_relative, penalty_rule::min_value, pbx_builtin_setvar_helper(), queue_ent::pr, queue_ent::raise_penalty, penalty_rule::raise_relative, penalty_rule::raise_value, and penalty_rule::time.
Referenced by queue_exec(), and wait_our_turn().
|
static |
update the queue status
0 | always |
Definition at line 6001 of file app_queue.c.
References ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, member::callcompletedinsl, member::calls, call_queue::callscompleted, call_queue::callscompletedinsl, member::lastcall, member::lastqueue, call_queue::members, NULL, OBJ_POINTER, pending_members_remove(), queue_t_unref, queues, shared_lastcall, member::starttime, and call_queue::talktime.
Referenced by handle_attended_transfer(), handle_blind_transfer(), handle_hangup(), and update_status().
|
static |
Definition at line 4013 of file app_queue.c.
References ast_strlen_zero(), ast_update_realtime(), member::rt_uniqueid, SENTINEL, and value.
Referenced by remove_from_queue(), set_member_penalty_help_members(), and set_queue_member_ringinuse().
|
static |
Definition at line 4029 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_category_browse(), ast_config_destroy(), ast_debug, ast_load_realtime_multientry(), ast_queue_log(), ast_strlen_zero(), member::dead, member::interface, log_membername_as_agent, member_remove_from_queue(), member::membername, call_queue::members, call_queue::name, NULL, member::realtime, rt_handle_member_record(), and SENTINEL.
Referenced by find_load_queue_rt_friendly(), is_our_turn(), and queue_exec().
|
static |
set a member's status based on device state of that member's state_interface.
Lock interface list find sc, iterate through each queues queue_member list for member to update state inside queues
Definition at line 2604 of file app_queue.c.
References AST_DEVICE_NOT_INUSE, member::callcompletedinsl, pending_members_remove(), queue_member_blob_create(), queue_publish_member_blob(), member::starttime, status, member::status, and update_queue().
Referenced by device_state_cb(), and extension_state_cb().
|
static |
UnpauseQueueMember application.
Definition at line 8276 of file app_queue.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), LOG_WARNING, options, pbx_builtin_setvar_helper(), and set_member_paused().
Referenced by load_module().
|
static |
Check for valid exit from queue via goto.
0 | if failure |
1 | if successful |
Definition at line 4201 of file app_queue.c.
References ast_canmatch_extension(), ast_channel_caller(), ast_goto_if_exists(), ast_strlen_zero(), queue_ent::chan, queue_ent::context, digit, queue_ent::digits, ast_party_caller::id, NULL, ast_party_id::number, S_COR, ast_party_number::str, ast_party_number::valid, and queue_ent::valid_digits.
Referenced by say_periodic_announcement(), say_position(), wait_a_bit(), wait_for_answer(), and wait_our_turn().
|
static |
Definition at line 7474 of file app_queue.c.
References ast_waitfordigit(), queue_ent::chan, queue_ent::parent, call_queue::retry, and valid_exit().
Referenced by queue_exec().
|
static |
Wait for a member to answer the call.
[in] | qe | the queue_ent corresponding to the caller in the queue |
[in] | outgoing | the list of callattempts. Relevant ones will have their chan and stillgoing parameters non-zero |
[in] | to | the amount of time (in milliseconds) to wait for a response |
[out] | digit | if a user presses a digit to exit the queue, this is the digit the caller pressed |
[in] | prebusies | number of busy members calculated prior to calling wait_for_answer |
[in] | caller_disconnect | if the 'H' option is used when calling Queue(), this is used to detect if the caller pressed * to disconnect the call |
[in] | forwardsallowed | used to detect if we should allow call forwarding, based on the 'i' option to Queue() |
Definition at line 5234 of file app_queue.c.
References callattempt::aoc_s_rate_list, ast_aoc_decode(), ast_aoc_destroy_decoded(), ast_aoc_destroy_encoded(), ast_aoc_encode(), ast_aoc_get_msg_type(), AST_AOC_S, ast_call(), ast_channel_call_forward(), ast_channel_caller(), ast_channel_connected(), ast_channel_connected_line_sub(), ast_channel_context(), ast_channel_datastore_inherit(), ast_channel_dialed(), ast_channel_exten(), ast_channel_hangupcause_set(), ast_channel_inherit_variables(), ast_channel_lock, ast_channel_lock_both, AST_CHANNEL_NAME, ast_channel_name(), ast_channel_nativeformats(), ast_channel_publish_dial(), ast_channel_publish_dial_forward(), ast_channel_redirecting(), ast_channel_redirecting_sub(), ast_channel_req_accountcodes(), AST_CHANNEL_REQUESTOR_BRIDGE_PEER, ast_channel_uniqueid(), ast_channel_unlock, ast_channel_update_connected_line(), ast_channel_update_redirecting(), ast_connected_line_copy_from_caller(), ast_connected_line_parse_data(), AST_CONTROL_ANSWER, AST_CONTROL_AOC, AST_CONTROL_BUSY, AST_CONTROL_CONGESTION, AST_CONTROL_CONNECTED_LINE, AST_CONTROL_HANGUP, AST_CONTROL_OFFHOOK, AST_CONTROL_PVT_CAUSE_CODE, AST_CONTROL_REDIRECTING, AST_CONTROL_RINGING, ast_copy_string(), ast_debug, AST_FRAME_CONTROL, AST_FRAME_DTMF, ast_free, ast_frfree, ast_hangup(), ast_indicate(), ast_indicate_data(), ast_log, ast_max_forwards_decrement(), AST_MAX_WATCHERS, ast_moh_stop(), ast_party_connected_line_copy(), ast_party_connected_line_free(), ast_party_connected_line_set(), ast_party_connected_line_set_init(), ast_party_number_free(), ast_party_number_init(), ast_party_redirecting_copy(), ast_party_redirecting_free(), ast_party_redirecting_init(), ast_queue_log(), ast_read(), ast_remaining_ms(), ast_request(), AST_STATE_UP, ast_strdup, ast_strdupa, ast_strlen_zero(), ast_tvdiff_ms(), ast_tvnow(), ast_verb, ast_waitfor_n(), call_queue::autopausebusy, call_queue::autopauseunavail, callattempt::block_connected_update, callattempt::call_next, callattempt::chan, queue_ent::chan, callattempt::connected, connected, ast_frame::data, ast_frame::datalen, callattempt::dial_callerid_absent, digit, do_hang(), ast_frame::frametype, ast_party_redirecting::from, ast_party_caller::id, in, ast_frame_subclass::integer, callattempt::interface, member::interface, LOG_NOTICE, callattempt::member, member::membername, call_queue::name, NULL, ast_party_id::number, callattempt::orig_chan_name, queue_ent::parent, pbx_builtin_getvar_helper(), pbx_builtin_setvar_helper(), callattempt::pending_connected_update, ast_frame::ptr, publish_dial_end_event(), callattempt::q_next, QUEUE_STRATEGY_RINGALL, ring_one(), queue_ent::ring_when_ringing, rna(), status, callattempt::stillgoing, ast_party_number::str, call_queue::strategy, ast_frame::subclass, ast_channel::tech, call_queue::timeoutrestart, ast_party_dialed::transit_network_select, ast_frame::uint32, update_connected_line_from_peer(), ast_party_number::valid, and valid_exit().
Referenced by try_calling().
|
static |
The waiting areas for callers who are not actively calling members.
This function is one large loop. This function will return if a caller either exits the queue or it becomes that caller's turn to attempt calling queue members. Inside the loop, we service the caller with periodic announcements, holdtime announcements, etc. as configured in queues.conf
0 | if the caller's turn has arrived |
-1 | if the caller should exit the queue. |
Definition at line 5913 of file app_queue.c.
References call_queue::announcefrequency, ast_channel_uniqueid(), ast_queue_log(), ast_waitfordigit(), queue_ent::chan, queue_ent::expire, get_member_status(), queue_ent::handled, is_our_turn(), call_queue::leavewhenempty, queue_ent::max_penalty, queue_ent::min_penalty, call_queue::name, NULL, queue_ent::opos, queue_ent::parent, call_queue::periodicannouncefrequency, queue_ent::pos, queue_ent::pr, QUEUE_LEAVEEMPTY, QUEUE_TIMEOUT, QUEUE_WITHDRAW, queue_ent::raise_penalty, RECHECK, record_abandoned(), ringing(), say_periodic_announcement(), say_position(), queue_ent::start, status, penalty_rule::time, update_qe_rule(), valid_exit(), and queue_ent::withdraw.
Referenced by queue_exec().
|
static |
Check if a given word is in a space-delimited list.
list | Space delimited list of words |
word | The word used to search the list |
1 | if the word is found |
0 | if the word is not found |
Definition at line 10313 of file app_queue.c.
References call_queue::list.
Referenced by complete_queue().
|
static |
Definition at line 12018 of file app_queue.c.
|
static |
Definition at line 11752 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1601 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1603 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1607 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1611 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1613 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1605 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1609 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1532 of file app_queue.c.
Referenced by aqm_exec().
|
static |
Definition at line 12018 of file app_queue.c.
|
static |
queues.conf [general] option
Definition at line 1625 of file app_queue.c.
Referenced by init_queue(), queue_reset_global_params(), and queue_set_global_params().
|
static |
Referenced by autopause2int().
|
static |
Definition at line 11739 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Subscription to device state change messages.
Definition at line 1637 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
queues.conf [general] option
Definition at line 1646 of file app_queue.c.
Referenced by can_ring_entry(), queue_reset_global_params(), and queue_set_global_params().
enum queue_result id |
Definition at line 1667 of file app_queue.c.
Referenced by OrderedDict::__repr__(), add_action_to_menu_entry(), add_diversion_header(), add_eprofile_to_tdata(), aeap_create(), ast_aeap_message_id(), ast_aoc_set_association_id(), ast_aoc_set_billing_id(), ast_bucket_file_json(), ast_bucket_json(), ast_cc_extension_monitor_add_dialstring(), ast_format_cap_append_by_type(), ast_io_change(), ast_jb_create_framehook(), ast_party_id_presentation(), ast_rtp_instance_extmap_get_id(), ast_sched_del_nonrunning(), ast_sip_modify_id_header(), ast_sip_set_id_from_invite(), bridge_sync_init(), cache_find(), clearcbone(), cleardisplay(), clearflag(), cleartimer(), contact_alloc(), create_new_id_hdr(), digitcollect(), digitdirect(), extension_state_add_destroy(), fetch_callerid_num(), frame_drop_helper(), frame_trace_helper(), generate_content_id_hdr(), handle_local_optimization_begin(), handle_local_optimization_end(), handle_registrations(), idemodulator(), load_engine(), mbl_load_adapter(), mbox(), mwi_mailbox_get(), party_id_build_data(), party_id_read(), party_id_write(), pidf_generate_body_content(), process_extmap_attributes(), queue_connected_line_update(), session_end_if_disconnected(), session_inv_on_tsx_state_changed(), set_id_from_from(), set_id_from_hdr(), set_id_from_pai(), set_id_from_rpid(), set_state(), setflag(), should_queue_connected_line_update(), showdisplay(), showkeys(), sip_subscription_to_ami(), sorcery_realtime_create(), sorcery_realtime_retrieve_fields(), sorcery_realtime_retrieve_multiple(), startelm(), starttimer(), state_id_by_topic(), try_merge_optimize_out(), try_swap_optimize_out(), and update_incoming_connected_line().
|
static |
queues.conf [general] option
Definition at line 1643 of file app_queue.c.
Referenced by aqm_exec(), find_queue_by_name_rt(), handle_queue_add_member(), handle_queue_remove_member(), manager_add_queue_member(), manager_remove_queue_member(), queue_reset_global_params(), queue_set_global_params(), rqm_exec(), rt_handle_member_record(), and update_realtime_members().
|
static |
queues.conf [general] option
Definition at line 1628 of file app_queue.c.
Referenced by queue_reset_global_params(), and queue_set_global_params().
|
static |
queues.conf [general] option
Definition at line 1640 of file app_queue.c.
Referenced by queue_reset_global_params(), queue_set_global_params(), remove_from_queue(), rt_handle_member_record(), and set_member_value().
|
static |
Definition at line 2542 of file app_queue.c.
Referenced by can_ring_entry(), load_module(), pending_members_remove(), and unload_module().
|
static |
Persistent Members astdb family.
Definition at line 1616 of file app_queue.c.
Referenced by dump_queue_members(), and reload_queue_members().
Definition at line 1516 of file app_queue.c.
Referenced by queue_exec().
|
static |
queues.conf [general] option
Definition at line 1619 of file app_queue.c.
Referenced by aqm_exec(), handle_queue_add_member(), load_module(), manager_add_queue_member(), queue_reset_global_params(), queue_set_global_params(), remove_from_queue(), and set_queue_member_pause().
const struct { ... } queue_results[] |
Referenced by set_queue_result().
|
static |
Definition at line 9490 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 9511 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 9506 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 9500 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 9521 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 9526 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1930 of file app_queue.c.
Referenced by __queues_show(), clear_stats(), compare_weight(), complete_queue(), complete_queue_remove_member(), device_state_cb(), extension_state_cb(), find_load_queue_rt_friendly(), find_queue_by_name_rt(), is_longest_waiting_caller(), leave_queue(), load_module(), manager_queues_status(), manager_queues_summary(), queue_function_queuegetchannel(), queue_function_queuewaitingcount(), reload_queue_members(), reload_queues(), reload_single_queue(), remove_from_queue(), set_member_paused(), set_member_value(), unload_module(), and update_queue().
|
static |
Definition at line 9495 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 9516 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
does realtime backend support reason_paused
Definition at line 1652 of file app_queue.c.
Referenced by load_module(), rt_handle_member_record(), and set_queue_member_pause().
|
static |
name of the ringinuse field in the realtime database
Definition at line 1649 of file app_queue.c.
Referenced by load_module(), rt_handle_member_record(), and set_queue_member_ringinuse().
|
static |
queuerules.conf [general] option
Definition at line 1634 of file app_queue.c.
Referenced by queue_rules_reset_global_params(), queue_rules_set_global_params(), and reload_queue_rules().
|
static |
|
static |
queues.conf [general] option
Definition at line 1631 of file app_queue.c.
Referenced by queue_reset_global_params(), queue_set_global_params(), and update_queue().
|
static |
Referenced by int2strat(), and strat2int().
char* text |
Definition at line 1668 of file app_queue.c.
Referenced by __ast_cli_generator(), ast_cli_completion_matches(), ast_cli_completion_vector(), ast_cli_generator(), ast_http_auth(), ast_http_create_response(), ast_http_error(), ast_sendtext(), ast_sip_session_add_reason_header(), ast_unreal_sendtext(), ast_xml_free_text(), asterisk_publication_send_refresh(), asterisk_publisher_devstate_cb(), asterisk_publisher_mwistate_cb(), build_regex(), chan_pjsip_sendtext(), check_content_type_in_dialog(), compare(), console_text(), dahdi_sendtext(), 74dc751dfe8e_more_permission_boolean_columns::downgrade(), fake_ami(), fake_json(), festival_exec(), generate_notify_body(), handle_characters(), handle_response_cmgr(), hfp_parse_cmgr(), iax2_sendtext(), iconv_read(), jingle_action_session_terminate(), jingle_send_session_info(), jingle_send_session_terminate(), jingle_sendtext(), originate_exec(), parse_bookmark(), parse_error(), pbcwhere(), send_expansion_text(), send_favorite(), send_text(), send_text_status(), send_texttitle(), sendtext_safe(), set_icon(), set_queue_result(), set_title(), show_main_page(), unistim_sendtext(), xmldoc_get_syntax_config_object(), xmldoc_setpostbr(), xmldoc_string_cleanup(), and xmldoc_string_wrap().
|
static |
Definition at line 11753 of file app_queue.c.
Referenced by load_module(), and unload_module().
|
static |
Records that one or more queues use weight.
Definition at line 1622 of file app_queue.c.
Referenced by can_ring_entry(), find_load_queue_rt_friendly(), load_module(), and reload_single_queue().