Asterisk - The Open Source Telephony Project
18.5.0
|
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/monitor.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) |
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 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 ouput 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) |
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) |
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_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 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 | 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 | 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_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_caller_abandon_type,.to_ami=queue_caller_abandon_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_member_status_type,.to_ami=queue_member_status_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_removed_type,.to_ami=queue_member_removed_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_ringinuse_type,.to_ami=queue_member_ringinuse_to_ami,) | |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (queue_agent_called_type,.to_ami=queue_agent_called_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_complete_type,.to_ami=queue_agent_complete_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,) | |
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 *macro, 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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_DEVSTATE_CONSUMER, .optional_modules = "res_monitor", } |
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_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 | 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 }, [ '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 char * | realtime_ringinuse_field |
name of the ringinuse field in the realtime database More... | |
static int | realtime_rules |
queuesrules.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 Added Priority jumping code for adding and removing queue members by Jonathan Stanton el@b etel. nlaster isk@ doilo okli keica re.c om
Fixed to work with CVS as of 2004-02-25 and released as 1.07a by Matthew Enger m.eng er@x i.com .au
Definition in file app_queue.c.
#define ANNOUNCEHOLDTIME_ALWAYS 1 |
Definition at line 1636 of file app_queue.c.
Referenced by queue_set_param().
#define ANNOUNCEHOLDTIME_ONCE 2 |
Definition at line 1637 of file app_queue.c.
Referenced by queue_set_param(), and say_position().
#define ANNOUNCEPOSITION_LIMIT 4 |
We not announce position more than <limit>
Definition at line 1654 of file app_queue.c.
Referenced by queue_set_param(), and say_position().
#define ANNOUNCEPOSITION_MORE_THAN 3 |
We say "Currently there are more than <limit>"
Definition at line 1653 of file app_queue.c.
Referenced by queue_set_param(), and say_position().
#define ANNOUNCEPOSITION_NO 2 |
We don't announce position
Definition at line 1652 of file app_queue.c.
Referenced by queue_set_param().
#define ANNOUNCEPOSITION_YES 1 |
We announce position
Definition at line 1651 of file app_queue.c.
Referenced by init_queue(), queue_set_param(), and say_position().
#define AST_MAX_WATCHERS 256 |
Definition at line 4923 of file app_queue.c.
Referenced by wait_for_answer().
#define DEFAULT_MIN_ANNOUNCE_FREQUENCY 15 |
The minimum number of seconds between position announcements.
Definition at line 1437 of file app_queue.c.
Referenced by init_queue().
#define DEFAULT_RETRY 5 |
Definition at line 1429 of file app_queue.c.
Referenced by init_queue(), and queue_set_param().
#define DEFAULT_TIMEOUT 15 |
Definition at line 1430 of file app_queue.c.
Referenced by init_queue(), and queue_set_param().
#define MAX_CALL_ATTEMPT_BUCKETS 353 |
Definition at line 2376 of file app_queue.c.
Referenced by load_module().
#define MAX_PERIODIC_ANNOUNCEMENTS 10 |
The maximum periodic announcements we can have
Definition at line 1432 of file app_queue.c.
Referenced by destroy_queue(), init_queue(), and queue_set_param().
#define MAX_QUEUE_BUCKETS 53 |
Definition at line 1439 of file app_queue.c.
Referenced by load_module().
#define QUEUE_EVENT_VARIABLES 3 |
Definition at line 1638 of file app_queue.c.
#define QUEUE_PAUSED_DEVSTATE AST_DEVICE_INUSE |
Definition at line 3350 of file app_queue.c.
Referenced by member_add_to_queue(), rt_handle_member_record(), and set_queue_member_pause().
#define queue_ref | ( | q | ) | ao2_bump(q) |
Definition at line 1918 of file app_queue.c.
Referenced by insert_entry(), and queue_stasis_data_alloc().
#define queue_t_ref | ( | q, | |
tag | |||
) | ao2_t_bump(q, tag) |
Definition at line 1920 of file app_queue.c.
Referenced by leave_queue(), and try_calling().
#define queue_t_unref | ( | q, | |
tag | |||
) | ({ ao2_t_cleanup(q, tag); NULL; }) |
Definition at line 1921 of file app_queue.c.
Referenced by __queues_show(), add_to_queue(), alloc_queue(), clear_stats(), compare_weight(), complete_queue(), complete_queue_remove_member(), device_state_cb(), end_bridge_callback(), extension_state_cb(), find_load_queue_rt_friendly(), find_member_by_queuename_and_interface(), find_queue_by_name_rt(), get_member_penalty(), join_queue(), leave_queue(), manager_queues_status(), manager_queues_summary(), queue_function_exists(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuegetchannel(), queue_function_queuememberlist(), queue_function_queuewaitingcount(), queue_function_var(), qupd_exec(), reload_queue_members(), reload_single_queue(), remove_from_queue(), set_member_paused(), and update_queue().
#define QUEUE_UNKNOWN_PAUSED_DEVSTATE AST_DEVICE_NOT_INUSE |
Definition at line 3352 of file app_queue.c.
Referenced by member_remove_from_queue().
#define QUEUE_UNPAUSED_DEVSTATE AST_DEVICE_NOT_INUSE |
Definition at line 3351 of file app_queue.c.
Referenced by member_add_to_queue(), rt_handle_member_record(), and set_queue_member_pause().
#define queue_unref | ( | q | ) | ({ ao2_cleanup(q); NULL; }) |
Definition at line 1919 of file app_queue.c.
Referenced by __queues_show(), queue_exec(), queue_stasis_data_destructor(), and set_member_value().
#define queues_t_link | ( | c, | |
q, | |||
tag | |||
) | ao2_t_link(c, q, tag) |
Definition at line 1922 of file app_queue.c.
Referenced by find_queue_by_name_rt(), and reload_single_queue().
#define queues_t_unlink | ( | c, | |
q, | |||
tag | |||
) | ao2_t_unlink(c, q, tag) |
Definition at line 1923 of file app_queue.c.
Referenced by find_queue_by_name_rt(), and leave_queue().
#define RECHECK 1 |
Recheck every second to see we we're at the top yet
Definition at line 1431 of file app_queue.c.
Referenced by wait_our_turn().
#define RES_EXISTS (-1) |
Entry already exists
Definition at line 1442 of file app_queue.c.
Referenced by add_to_queue(), aqm_exec(), handle_queue_add_member(), handle_queue_remove_member(), manager_add_queue_member(), manager_remove_queue_member(), remove_from_queue(), and rqm_exec().
#define RES_NOSUCHQUEUE (-3) |
No such queue
Definition at line 1444 of file app_queue.c.
Referenced by add_to_queue(), aqm_exec(), change_priority_caller_on_queue(), handle_queue_add_member(), handle_queue_change_priority_caller(), handle_queue_remove_member(), manager_add_queue_member(), manager_change_priority_caller_on_queue(), manager_remove_queue_member(), remove_from_queue(), and rqm_exec().
#define RES_NOT_CALLER (-5) |
Caller not found
Definition at line 1446 of file app_queue.c.
Referenced by change_priority_caller_on_queue(), handle_queue_change_priority_caller(), and manager_change_priority_caller_on_queue().
#define RES_NOT_DYNAMIC (-4) |
Member is not dynamic
Definition at line 1445 of file app_queue.c.
Referenced by handle_queue_add_member(), handle_queue_remove_member(), manager_remove_queue_member(), remove_from_queue(), and rqm_exec().
#define RES_OKAY 0 |
Action completed
Definition at line 1441 of file app_queue.c.
Referenced by add_to_queue(), aqm_exec(), change_priority_caller_on_queue(), handle_queue_add_member(), handle_queue_change_priority_caller(), handle_queue_remove_member(), manager_add_queue_member(), manager_change_priority_caller_on_queue(), manager_remove_queue_member(), remove_from_queue(), and rqm_exec().
#define RES_OUTOFMEMORY (-2) |
Out of memory
Definition at line 1443 of file app_queue.c.
Referenced by add_to_queue(), aqm_exec(), handle_queue_add_member(), handle_queue_remove_member(), manager_add_queue_member(), manager_remove_queue_member(), and reload_queue_members().
anonymous enum |
Definition at line 1325 of file app_queue.c.
anonymous enum |
Enumerator | |
---|---|
OPT_ARG_CALLEE_GO_ON | |
OPT_ARG_PREDIAL_CALLEE | |
OPT_ARG_PREDIAL_CALLER | |
OPT_ARG_ARRAY_SIZE |
Definition at line 1349 of file app_queue.c.
anonymous enum |
Definition at line 1381 of file app_queue.c.
anonymous enum |
Enumerator | |
---|---|
QUEUE_AUTOPAUSE_OFF | |
QUEUE_AUTOPAUSE_ON | |
QUEUE_AUTOPAUSE_ALL |
Definition at line 1392 of file app_queue.c.
Enumerator | |
---|---|
CALLER | |
AGENT | |
TRANSFER |
Definition at line 5857 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 1619 of file app_queue.c.
enum member_properties |
Enumerator | |
---|---|
MEMBER_PENALTY | |
MEMBER_RINGINUSE |
Definition at line 1630 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 1398 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 |
Definition at line 1495 of file app_queue.c.
Enumerator | |
---|---|
TIMEOUT_PRIORITY_APP | |
TIMEOUT_PRIORITY_CONF |
Definition at line 1520 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 9758 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(), LOG_WARNING, call_queue::name, NULL, out, print_queue(), queue_t_unref, queue_unref, call_queue::realtime, and SENTINEL.
Referenced by queue_show().
|
static |
Definition at line 11505 of file app_queue.c.
|
static |
Definition at line 11505 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 7377 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(), interface_exists(), is_member_available(), member_add_to_queue(), call_queue::name, NULL, queue_member_blob_create(), queue_publish_member_blob(), queue_t_unref, member::reason_paused, RES_EXISTS, RES_NOSUCHQUEUE, RES_OKAY, RES_OUTOFMEMORY, and call_queue::ringinuse.
Referenced by aqm_exec(), handle_queue_add_member(), manager_add_queue_member(), and reload_queue_members().
|
static |
Definition at line 3534 of file app_queue.c.
References ao2_t_alloc, ast_string_field_init, ast_string_field_set, destroy_queue(), strategy::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 | |||
) |
Referenced by print_queue().
|
static |
AddQueueMember application.
Definition at line 8025 of file app_queue.c.
References add_to_queue(), args, AST_APP_ARG, 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, member::interface, LOG_ERROR, LOG_NOTICE, LOG_WARNING, member::membername, NULL, options, parse(), pbx_builtin_setvar_helper(), member::penalty, 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 11505 of file app_queue.c.
|
static |
Definition at line 1813 of file app_queue.c.
References ARRAY_LEN, ast_strlen_zero, ast_true(), autopause::autopause, autopausesmodes, strategy::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 5779 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, callattempt::metric, 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, and call_queue::wrapped.
Referenced by try_calling().
|
static |
Definition at line 4228 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 4388 of file app_queue.c.
References ao2_find, ao2_link, ao2_lock, ao2_ref, ao2_unlock, ast_debug, compare_weight(), get_queue_member_status(), get_wrapuptime(), callattempt::interface, member::lastcall, member::lastqueue, callattempt::member, member_status_available(), member::membername, call_queue::name, NULL, OBJ_NOLOCK, OBJ_SEARCH_OBJECT, queue_ent::parent, member::paused, pending_members_remove(), member::ringinuse, member::status, 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 7430 of file app_queue.c.
References ao2_lock, ao2_unlock, ast_channel_name(), ast_debug, queue_ent::chan, find_load_queue_rt_friendly(), call_queue::head, queue_ent::next, queue_ent::prio, 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 2863 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 |
void |
Definition at line 9597 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, and queue_t_unref.
Referenced by reload_handler().
|
static |
Definition at line 4323 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, 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 9929 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, 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 10426 of file app_queue.c.
References ast_malloc, ast_strdup, complete_queue(), and NULL.
Referenced by handle_queue_add_member().
|
static |
Definition at line 10799 of file app_queue.c.
References ast_strdup, complete_queue(), and NULL.
Referenced by handle_queue_pause_member().
|
static |
Definition at line 10639 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, and tmp().
Referenced by handle_queue_remove_member().
|
static |
Definition at line 10994 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 10873 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 9966 of file app_queue.c.
References complete_queue(), and NULL.
Referenced by queue_show().
|
static |
Definition at line 2730 of file app_queue.c.
Referenced by member_hash_fn().
|
static |
Copy rule from global list into specified queue.
Definition at line 8140 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 2686 of file app_queue.c.
References ao2_alloc, ast_copy_string(), ast_extension_state_add(), ast_log, ast_strdupa, ast_strlen_zero, context, destroy_queue_member_cb(), exten, extension_state_cb(), get_queue_member_status(), member::interface, member::lastpause, LOG_WARNING, 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 3519 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 2676 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 2503 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, 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 4358 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 ouput to manager or cli with proper terminator
Definition at line 9644 of file app_queue.c.
References ast_cli(), and astman_append().
Referenced by __queues_show(), and print_queue().
|
static |
Dump all members in a specific queue to the database.
Definition at line 7269 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, 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 6575 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 6568 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 6617 of file app_queue.c.
References input(), and pbx_substitute_variables_helper().
Referenced by setup_mixmonitor().
|
static |
Definition at line 2627 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, ast_state_cb_info::exten_state, extensionstate2devicestate(), call_queue::found, call_queue::members, queue_t_unref, ast_state_cb_info::reason, 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 2590 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 4614 of file app_queue.c.
References callattempt::metric, NULL, and callattempt::q_next.
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 3702 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, call_queue::realtime, SENTINEL, update_realtime_members(), 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(), queue_function_exists(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_function_var(), qupd_exec(), reload_queue_members(), and set_member_value().
|
static |
Definition at line 11484 of file app_queue.c.
References ao2_find, ao2_lock, ao2_unlock, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_DEVSTATE_CONSUMER, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, find_load_queue_rt_friendly(), load_module(), call_queue::members, NULL, OBJ_KEY, queue_t_unref, reload(), and unload_module().
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 3558 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_WARNING, member_remove_from_queue(), member::membername, call_queue::members, ast_variable::name, call_queue::name, ast_variable::next, NULL, OBJ_POINTER, queue_set_param(), QUEUE_STRATEGY_RINGALL, queue_t_unref, 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 3503 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 8618 of file app_queue.c.
References ast_log, ast_strlen_zero, interface_exists(), LOG_ERROR, call_queue::name, and NULL.
Referenced by queue_function_mem_read().
|
static |
Definition at line 7740 of file app_queue.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_log, find_load_queue_rt_friendly(), 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 2284 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_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 join_queue(), queue_exec(), and wait_our_turn().
|
static |
Return the current state of a member.
Definition at line 2671 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 1856 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. |
topic | The topic for this event. |
msg | The stasis message for the attended transfer event. |
Definition at line 6206 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. |
topic | The topic for this event. |
msg | The stasis message for the blind transfer event |
Definition at line 6146 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, context, ast_blind_transfer_message::context, queue_stasis_data::dying, exten, 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 6112 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_channel_snapshot_base::uniqueid, and ast_bridge_snapshot::uniqueid.
Referenced by setup_stasis_subs().
|
static |
Definition at line 6398 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, ast_channel_snapshot_base::name, call_queue::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 6281 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 6333 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 6455 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 10561 of file app_queue.c.
References add_to_queue(), ast_cli_args::argc, ast_cli_args::argv, 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(), ast_cli_args::fd, ast_cli_args::line, ast_cli_args::n, NULL, ast_cli_args::pos, RES_EXISTS, RES_NOSUCHQUEUE, RES_NOT_DYNAMIC, RES_OKAY, RES_OUTOFMEMORY, ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Definition at line 10750 of file app_queue.c.
References ast_cli_args::argc, ast_cli_args::argv, ast_cli(), ast_log, change_priority_caller_on_queue(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, LOG_ERROR, NULL, priority, RES_NOSUCHQUEUE, RES_NOT_CALLER, RES_OKAY, and ast_cli_entry::usage.
|
static |
Definition at line 10818 of file app_queue.c.
References ast_cli_args::argc, ast_cli_args::argv, ast_cli(), ast_strlen_zero, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue_pause_member(), ast_cli_args::fd, ast_cli_args::line, ast_cli_args::n, NULL, ast_cli_args::pos, RESULT_SUCCESS, set_member_paused(), and ast_cli_entry::usage.
|
static |
Definition at line 11090 of file app_queue.c.
References ast_cli_args::argc, ast_cli_args::argv, AST_FLAGS_ALL, ast_set_flag, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue(), ast_cli_args::line, ast_cli_args::n, NULL, ast_cli_args::pos, QUEUE_RELOAD_MEMBER, QUEUE_RELOAD_PARAMETERS, QUEUE_RELOAD_RULES, reload_handler(), ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Definition at line 10687 of file app_queue.c.
References ao2_ref, ast_cli_args::argc, ast_cli_args::argv, 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(), ast_cli_args::fd, find_member_by_queuename_and_interface(), ast_cli_args::line, member::membername, ast_cli_args::n, NULL, ast_cli_args::pos, remove_from_queue(), RES_EXISTS, RES_NOSUCHQUEUE, RES_NOT_DYNAMIC, RES_OKAY, RES_OUTOFMEMORY, ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Definition at line 11051 of file app_queue.c.
References ast_cli_args::argc, ast_cli_args::argv, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue(), ast_cli_args::line, ast_cli_args::n, NULL, ast_cli_args::pos, QUEUE_RESET_STATS, reload_handler(), ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Definition at line 11016 of file app_queue.c.
References ast_cli_args::argc, ast_cli_args::argv, 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(), ast_cli_args::fd, ast_cli_args::line, penalty_rule::list, penalty_rule::max_relative, penalty_rule::max_value, penalty_rule::min_relative, penalty_rule::min_value, ast_cli_args::n, rule_list::name, NULL, ast_cli_args::pos, penalty_rule::raise_relative, penalty_rule::raise_value, rule_list::rules, penalty_rule::time, ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Definition at line 10953 of file app_queue.c.
References ast_cli_args::argc, ast_cli_args::argv, ast_cli(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, complete_queue_set_member_value(), ast_cli_args::fd, ast_cli_args::line, MEMBER_PENALTY, ast_cli_args::n, NULL, ast_cli_args::pos, RESULT_FAILURE, RESULT_SUCCESS, set_member_value(), ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Definition at line 10896 of file app_queue.c.
References ast_cli_args::argc, ast_cli_args::argv, 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(), ast_cli_args::fd, ast_cli_args::line, MEMBER_RINGINUSE, ast_cli_args::n, NULL, ast_cli_args::pos, RESULT_FAILURE, RESULT_SUCCESS, set_member_value(), ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Hang up a list of outgoing calls.
Definition at line 4250 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(), callattempt::chan, queue_ent::chan, callattempt::interface, callattempt::member, pending_members_remove(), callattempt::q_next, and member::status.
Referenced by try_calling().
|
static |
Initialize Queue default values.
Definition at line 2769 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::autopausedelay, context, call_queue::dead, DEFAULT_MIN_ANNOUNCE_FREQUENCY, DEFAULT_RETRY, DEFAULT_TIMEOUT, call_queue::found, call_queue::joinempty, call_queue::leavewhenempty, penalty_rule::list, 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::montype, montype_default, call_queue::name, NULL, call_queue::numperiodicannounce, call_queue::penaltymemberslimit, call_queue::periodicannouncefrequency, QUEUE_AUTOPAUSE_OFF, QUEUE_STRATEGY_LINEAR, QUEUE_STRATEGY_RRORDERED, call_queue::randomperiodicannounce, 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 1952 of file app_queue.c.
References call_queue::head, queue_ent::next, queue_ent::pos, and queue_ref.
Referenced by join_queue().
|
static |
Change queue penalty by adding rule.
Check rule for errors with time or fomatting, 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 2895 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, 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, and penalty_rule::time.
Referenced by reload_queue_rules().
|
static |
Definition at line 1787 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 7242 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().
|
static |
Definition at line 2468 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 5487 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 3832 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 9360 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 9516 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 4151 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, 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_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 11324 of file app_queue.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, 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(), device_state_cb(), 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_topic, MAX_CALL_ATTEMPT_BUCKETS, MAX_QUEUE_BUCKETS, NULL, pending_members_cmp(), pending_members_hash(), pqm_exec(), ql_exec(), queue_agent_cb(), queue_cmp_cb(), queue_exec(), queue_hash_cb(), qupd_exec(), reload_handler(), reload_queue_members(), 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(), unload_module(), and upqm_exec().
Referenced by find_member_by_queuename_and_interface().
|
static |
Load queue rules from realtime.
Check rule for errors with time or fomatting, 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 2999 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 6065 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, ast_channel_snapshot_base::name, call_queue::name, NULL, queue_stasis_data::queue, RAII_VAR, and queue_stasis_data::starttime.
Referenced by handle_attended_transfer().
|
static |
Definition at line 10222 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(), NULL, RES_EXISTS, RES_NOSUCHQUEUE, RES_OKAY, and RES_OUTOFMEMORY.
Referenced by load_module().
|
static |
Definition at line 10517 of file app_queue.c.
References ast_strlen_zero, 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 10333 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 10358 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 10491 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 10457 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 10379 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, reload_handler(), and S_OR.
Referenced by load_module().
|
static |
Definition at line 10411 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 9990 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 10104 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_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, call_queue::maxlen, member::membername, call_queue::members, ast_party_id::name, call_queue::name, queue_ent::next, ast_party_id::number, member::paused, member::penalty, queue_ent::prio, queue_t_unref, 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 10026 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_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, member_status_available(), call_queue::members, call_queue::name, queue_ent::next, member::paused, queue_t_unref, RESULT_SUCCESS, queue_ent::start, member::status, and call_queue::talktime.
Referenced by load_module().
|
static |
Definition at line 10286 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(), 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 9351 of file app_queue.c.
References member::delme, member::dynamic, and member::realtime.
Referenced by reload_single_queue().
|
static |
Definition at line 9506 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 3360 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 2756 of file app_queue.c.
References CMP_MATCH, CMP_STOP, member::interface, and OBJ_KEY.
Referenced by init_queue().
|
static |
Definition at line 2740 of file app_queue.c.
References compress_char(), member::interface, and OBJ_KEY.
Referenced by init_queue().
|
static |
Definition at line 3376 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 4374 of file app_queue.c.
References AST_DEVICE_NOT_INUSE, and AST_DEVICE_UNKNOWN.
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 couting the number of available members |
Definition at line 4290 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 3101 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, and strsep().
Referenced by queue_set_param().
|
static |
Definition at line 2398 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 2378 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 2426 of file app_queue.c.
References ao2_find, ast_debug, member::membername, OBJ_NODATA, OBJ_POINTER, and OBJ_UNLINK.
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 3916 of file app_queue.c.
References ast_channel_language(), AST_DIGIT_ANY, ast_fileexists(), ast_stopstream(), ast_streamfile(), ast_strlen_zero, ast_waitstream(), and NULL.
Referenced by say_periodic_announcement(), say_position(), and try_calling().
|
static |
PauseQueueMember application.
Definition at line 7882 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, parse(), 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 9654 of file app_queue.c.
References ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, AO2_STRING_FIELD_SORT_FN(), 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, call_queue::maxlen, member::membername, call_queue::members, strategy::name, 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 4238 of file app_queue.c.
References ast_channel_publish_dial(), callattempt::chan, NULL, and callattempt::q_next.
Referenced by ring_entry(), and wait_for_answer().
|
static |
Definition at line 7457 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 8106 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, LOG_WARNING, member::membername, and parse().
Referenced by load_module().
|
static |
Definition at line 2125 of file app_queue.c.
References queue_multi_channel_to_ami().
Referenced by queue_agent_ringnoanswer_to_ami().
|
static |
Definition at line 5895 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 2135 of file app_queue.c.
References queue_multi_channel_to_ami().
Referenced by queue_agent_ringnoanswer_to_ami().
|
static |
Definition at line 2130 of file app_queue.c.
References queue_multi_channel_to_ami().
Referenced by queue_agent_ringnoanswer_to_ami().
|
static |
Definition at line 2140 of file app_queue.c.
References queue_multi_channel_to_ami().
Referenced by queue_agent_ringnoanswer_to_ami().
|
static |
Definition at line 2145 of file app_queue.c.
References queue_agent_called_to_ami(), queue_agent_complete_to_ami(), queue_agent_connect_to_ami(), queue_agent_dump_to_ami(), queue_multi_channel_to_ami(), STASIS_MESSAGE_TYPE_DEFN_LOCAL(), and to_ami().
|
static |
Definition at line 6261 of file app_queue.c.
References ao2_cleanup, and stasis_subscription_final_message().
Referenced by setup_stasis_subs().
|
static |
Definition at line 2005 of file app_queue.c.
References queue_caller_join_to_ami(), queue_caller_leave_to_ami(), queue_channel_to_ami(), STASIS_MESSAGE_TYPE_DEFN_LOCAL(), and to_ami().
|
static |
Definition at line 1995 of file app_queue.c.
References queue_channel_to_ami().
Referenced by queue_caller_abandon_to_ami().
|
static |
Definition at line 2000 of file app_queue.c.
References queue_channel_to_ami().
Referenced by queue_caller_abandon_to_ami().
|
static |
Definition at line 6489 of file app_queue.c.
References ao2_cleanup, and stasis_subscription_final_message().
Referenced by setup_stasis_subs().
|
static |
Definition at line 1976 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, and stasis_message_data().
Referenced by queue_caller_abandon_to_ami(), queue_caller_join_to_ami(), and queue_caller_leave_to_ami().
|
static |
Definition at line 1843 of file app_queue.c.
References CMP_MATCH, CMP_STOP, and call_queue::name.
Referenced by load_module().
|
static |
Definition at line 1887 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 8183 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_debug, AST_DECLARE_APP_ARGS, ast_indicate(), AST_LIST_FIRST, ast_log, ast_max_forwards_get(), ast_moh_start(), ast_moh_stop(), 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, 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_PREDIAL_CALLEE, OPT_ARG_PREDIAL_CALLER, OPT_GO_ON, OPT_PREDIAL_CALLEE, OPT_PREDIAL_CALLER, OPT_RING_WHEN_RINGING, OPT_RINGING, options, queue_ent::parent, parse(), pbx_builtin_getvar_helper(), pbx_builtin_setvar_helper(), call_queue::periodicannouncefrequency, 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_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(), and wait_our_turn().
Referenced by load_module().
|
static |
Check if a given queue exists.
Definition at line 8599 of file app_queue.c.
References ast_log, ast_strlen_zero, find_load_queue_rt_friendly(), 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 8641 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, find_load_queue_rt_friendly(), get_interface_helper(), get_wrapuptime(), member::lastcall, 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 8743 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(), and set_member_value().
|
static |
Dialplan function QUEUE_MEMBER_PENALTY() Gets the members penalty.
Definition at line 9011 of file app_queue.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strlen_zero, get_member_penalty(), and LOG_ERROR.
|
static |
Dialplan function QUEUE_MEMBER_PENALTY() Sets the members penalty.
Definition at line 9043 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, and set_member_value().
|
static |
Get the total number of members in a specific queue (Deprecated)
number | of members |
-1 | on error |
Definition at line 8806 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, call_queue::count, find_load_queue_rt_friendly(), 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 8847 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(), queue_ent::chan, call_queue::count, call_queue::head, LOG_ERROR, LOG_WARNING, call_queue::name, queue_ent::next, OBJ_POINTER, parse(), queue_ent::pos, queue_t_unref, SENTINEL, and var.
|
static |
Dialplan function QUEUE_MEMBER_LIST() Get list of members in a specific queue.
Definition at line 8963 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, find_load_queue_rt_friendly(), member::interface, 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 8926 of file app_queue.c.
References ao2_lock, ao2_t_find, ao2_unlock, ast_load_realtime(), ast_log, ast_strlen_zero, ast_variables_destroy(), call_queue::count, LOG_ERROR, LOG_WARNING, call_queue::name, NULL, OBJ_POINTER, queue_t_unref, SENTINEL, and var.
|
static |
create interface var with all queue details.
0 | on success |
-1 | on error |
Definition at line 8555 of file app_queue.c.
References ao2_lock, ao2_unlock, ast_log, ast_strlen_zero, call_queue::callsabandoned, call_queue::callscompleted, call_queue::callscompletedinsl, call_queue::count, find_load_queue_rt_friendly(), call_queue::holdtime, int2strat(), 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 1836 of file app_queue.c.
References ast_str_case_hash(), and call_queue::name.
Referenced by load_module().
|
static |
Definition at line 2040 of file app_queue.c.
References queue_member_to_ami().
Referenced by queue_member_ringinuse_to_ami().
|
static |
Definition at line 2258 of file app_queue.c.
References ast_json_pack(), member::calls, member::dynamic, member::interface, member::lastcall, member::lastpause, 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 1869 of file app_queue.c.
References member::queuepos.
Referenced by queue_delme_members_decrement_followers(), and queue_member_follower_removal().
|
static |
Definition at line 1905 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 2050 of file app_queue.c.
References queue_member_to_ami().
Referenced by queue_member_ringinuse_to_ami().
|
static |
Definition at line 2055 of file app_queue.c.
References queue_member_to_ami().
Referenced by queue_member_ringinuse_to_ami().
|
static |
Definition at line 2045 of file app_queue.c.
References queue_member_to_ami().
Referenced by queue_member_ringinuse_to_ami().
|
static |
Definition at line 2060 of file app_queue.c.
References queue_member_added_to_ami(), queue_member_pause_to_ami(), queue_member_penalty_to_ami(), queue_member_removed_to_ami(), queue_member_status_to_ami(), queue_member_to_ami(), STASIS_MESSAGE_TYPE_DEFN_LOCAL(), and to_ami().
|
static |
Definition at line 2035 of file app_queue.c.
References queue_member_to_ami().
Referenced by queue_member_ringinuse_to_ami().
|
static |
Definition at line 2020 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, and stasis_message_data().
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 2084 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, and stasis_message_data().
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 2234 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(), and stasis_publish().
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 2201 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(), and RAII_VAR.
Referenced by ring_entry(), rna(), and try_calling().
|
static |
Definition at line 2166 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(), and stasis_publish().
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 9201 of file app_queue.c.
Referenced by reload_queues().
|
static |
Reset the global queue rules parameters even if there is no "general" section of queuerules.conf
Definition at line 9122 of file app_queue.c.
Referenced by reload_queue_rules().
|
static |
Set the global queue rules parameters as defined in the "general" section of queuerules.conf
Definition at line 9128 of file app_queue.c.
References ast_true(), ast_variable_retrieve(), and NULL.
Referenced by reload_queue_rules().
|
static |
Set the global queue parameters as defined in the "general" section of queues.conf
Definition at line 9212 of file app_queue.c.
References ast_true(), ast_variable_retrieve(), and NULL.
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 3144 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, context, DEFAULT_RETRY, DEFAULT_TIMEOUT, call_queue::joinempty, call_queue::leavewhenempty, LOG_WARNING, MAX_PERIODIC_ANNOUNCEMENTS, call_queue::maxlen, call_queue::memberdelay, call_queue::minannouncefrequency, call_queue::monfmt, call_queue::montype, call_queue::name, call_queue::numperiodicannounce, parse_empty_options(), call_queue::penaltymemberslimit, call_queue::periodicannouncefrequency, 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(), strategy::strategy, 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 9974 of file app_queue.c.
References __queues_show(), ast_cli_args::argc, ast_cli_args::argv, CLI_GENERATE, CLI_INIT, ast_cli_entry::command, complete_queue_show(), ast_cli_args::fd, ast_cli_args::line, ast_cli_args::n, NULL, ast_cli_args::pos, ast_cli_entry::usage, and ast_cli_args::word.
|
static |
Definition at line 6026 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 5994 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 11157 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, parse(), queue_t_unref, status, and call_queue::talktime.
Referenced by load_module().
|
static |
Definition at line 4128 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 4808 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 11473 of file app_queue.c.
References AST_FLAGS_ALL, ast_unload_realtime(), NULL, QUEUE_RESET_STATS, and reload_handler().
Referenced by find_member_by_queuename_and_interface().
|
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 9627 of file app_queue.c.
References ast_test_flag, clear_stats(), QUEUE_RELOAD_MEMBER, QUEUE_RELOAD_PARAMETERS, QUEUE_RELOAD_RULES, QUEUE_RESET_STATS, 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 7771 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, ast_db_entry::key, LOG_ERROR, LOG_NOTICE, LOG_WARNING, member::membername, call_queue::name, ast_db_entry::next, NULL, OBJ_POINTER, member::paused, member::penalty, queue_t_unref, 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 9142 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, ast_variable::name, rule_list::name, ast_variable::next, NULL, queue_rules_reset_global_params(), queue_rules_set_global_params(), realtime_rules, 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 9540 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(), 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 9244 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(), create_queue_member(), member::interface, LOG_ERROR, LOG_WARNING, member_add_to_queue(), call_queue::members, call_queue::name, NULL, OBJ_POINTER, parse(), member::paused, member::penalty, member::queuepos, member::ringinuse, call_queue::ringinuse, 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 |
void |
Definition at line 9383 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(), ast_variable::lineno, LOG_WARNING, mark_member_dead(), call_queue::members, ast_variable::name, call_queue::name, ast_variable::next, 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_t_link, reload_single_member(), member::ringinuse, call_queue::ringinuse, strat2int(), call_queue::strategy, ast_variable::value, 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 7324 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, num_available_members(), OBJ_POINTER, queue_member_blob_create(), queue_publish_member_blob(), queue_t_unref, 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 6011 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 |
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 4478 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_macroexten(), 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, callattempt::chan, queue_ent::chan, callattempt::dial_callerid_absent, do_hang(), ast_party_caller::id, ast_party_connected_line::id, callattempt::interface, queue_ent::linpos, callattempt::member, member::membername, call_queue::name, NULL, ast_party_id::number, ast_party_dialed::number, callattempt::orig_chan_name, queue_ent::parent, pbx_builtin_getvar_helper(), pending_members_remove(), queue_ent::predial_callee, publish_dial_end_event(), queue_publish_multi_channel_blob(), RAII_VAR, call_queue::rrpos, S_OR, status, callattempt::stillgoing, ast_party_dialed::str, 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 4639 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 4839 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, 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 7954 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_NOTICE, LOG_WARNING, member::membername, NULL, parse(), 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 3392 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_WARNING, member_add_to_queue(), member::membername, call_queue::members, call_queue::name, NULL, member::paused, member::penalty, QUEUE_PAUSED_DEVSTATE, QUEUE_UNPAUSED_DEVSTATE, member::realtime, 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 4747 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, call_queue::sound_periodicannounce, and valid_exit().
Referenced by queue_exec(), and wait_our_turn().
|
static |
Definition at line 3980 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, 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 5864 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 7528 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_lock, ao2_ref, ao2_t_iterator_next, ao2_unlock, ast_queue_log(), ast_strlen_zero, interface_exists(), member::membername, call_queue::name, queue_t_unref, 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 7584 of file app_queue.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_queue_log(), 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 7635 of file app_queue.c.
References ao2_lock, ao2_ref, ao2_unlock, interface_exists(), and set_queue_member_ringinuse().
Referenced by set_member_value_help_members().
|
static |
Definition at line 7674 of file app_queue.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_t_iterator_next, ast_category_browse(), ast_check_realtime(), ast_load_realtime_multientry(), ast_log, ast_strlen_zero, ast_variable_retrieve(), find_load_queue_rt_friendly(), LOG_ERROR, LOG_WARNING, MEMBER_PENALTY, strategy::name, NULL, queue_unref, RESULT_FAILURE, RESULT_SUCCESS, SENTINEL, and set_member_value_help_members().
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 7651 of file app_queue.c.
References ast_log, LOG_ERROR, MEMBER_PENALTY, MEMBER_RINGINUSE, set_member_penalty_help_members(), and set_member_ringinuse_help_members().
Referenced by set_member_value().
|
static |
Definition at line 7483 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, 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_UNPAUSED_DEVSTATE, member::realtime, member::reason_paused, S_OR, and update_realtime_member_field().
Referenced by set_member_paused().
|
static |
Definition at line 7622 of file app_queue.c.
References ast_queue_log(), member::interface, call_queue::name, queue_member_blob_create(), queue_publish_member_blob(), member::realtime, member::ringinuse, and update_realtime_member_field().
Referenced by set_member_ringinuse_help_members().
|
static |
sets the QUEUESTATUS channel variable
Definition at line 1775 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 1926 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 6648 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 6600 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, context, OPT_ARG_CALLEE_GO_ON, OPT_CALLEE_GO_ON, and priority.
Referenced by try_calling().
|
static |
Definition at line 6514 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::channel_router, handle_attended_transfer(), handle_blind_transfer(), handle_bridge_enter(), handle_hangup(), handle_local_optimization_begin(), handle_local_optimization_end(), handle_masquerade(), NULL, queue_bridge_cb(), queue_channel_cb(), queue_stasis_data_alloc(), 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_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_caller_abandon_type | , |
. | to_ami = queue_caller_abandon_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_member_status_type | , |
. | to_ami = queue_member_status_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_removed_type | , |
. | to_ami = queue_member_removed_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_ringinuse_type | , |
. | to_ami = queue_member_ringinuse_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | queue_agent_called_type | , |
. | to_ami = queue_agent_called_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_complete_type | , |
. | to_ami = queue_agent_complete_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 |
||
) |
|
static |
Search for best metric and add to Linear queue.
Definition at line 4723 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 4699 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 1800 of file app_queue.c.
References ARRAY_LEN, strategy::name, strategies, and strategy::strategy.
Referenced by find_queue_by_name_rt(), queue_set_param(), and reload_single_queue().
|
static |
Definition at line 6722 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_macro(), 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_monitor_setjoinfiles(), ast_monitor_start(), AST_OPTION_TONE_VERIFY, ast_party_connected_line_copy(), ast_queue_log(), ast_random(), ast_safe_sleep(), ast_say_number(), ast_set_flag, ast_str_buffer(), ast_str_create, ast_str_set(), ast_strdupa, ast_strlen_zero, ast_test_flag, callattempt::block_connected_update, calc_metric(), callattempt_free(), member::callcompletedinsl, member::calls, queue_ent::cancel_answered_elsewhere, callattempt::chan, queue_ent::chan, queue_end_bridge::chan, callattempt::connected, digit, member::dynamic, ast_bridge_config::end_bridge_callback, end_bridge_callback(), ast_bridge_config::end_bridge_callback_data, ast_bridge_config::end_bridge_callback_data_fixup, end_bridge_callback_data_fixup(), queue_ent::expire, ast_bridge_config::features_callee, ast_bridge_config::features_caller, queue_ent::handled, hangupcalls(), callattempt::interface, member::interface, member::lastcall, leave_queue(), LOG_ERROR, LOG_NOTICE, LOG_WARNING, callattempt::member, call_queue::memberdelay, call_queue::membergosub, call_queue::membermacro, member::membername, call_queue::members, call_queue::monfmt, call_queue::montype, 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, callattempt::q_next, 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(), 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, callattempt::stillgoing, store_next_lin(), store_next_rr(), call_queue::strategy, call_queue::timeout, TIMEOUT_PRIORITY_APP, call_queue::timeoutpriority, tmp(), type, ast_channel_tech::type, wait_for_answer(), X_REC_IN, and X_REC_OUT.
Referenced by queue_exec().
|
static |
Definition at line 11250 of file app_queue.c.
References ao2_cleanup, ARRAY_LEN, ast_cli_unregister_multiple(), ast_custom_function_unregister(), ast_manager_unregister(), ast_unload_realtime(), ast_unregister_application(), NULL, stasis_forward_cancel(), stasis_message_router_unsubscribe_and_join(), STASIS_MESSAGE_TYPE_CLEANUP, and stasis_unsubscribe_and_join().
Referenced by find_member_by_queuename_and_interface(), and load_module().
|
static |
Definition at line 4906 of file app_queue.c.
References ast_channel_caller(), ast_channel_connected_line_macro(), 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 5536 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
Always | 0 |
Definition at line 5707 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, member::starttime, and call_queue::talktime.
Referenced by handle_attended_transfer(), handle_blind_transfer(), handle_hangup(), and update_status().
|
static |
Definition at line 3757 of file app_queue.c.
References ast_strlen_zero, ast_update_realtime(), member::rt_uniqueid, and SENTINEL.
Referenced by remove_from_queue(), set_member_penalty_help_members(), set_queue_member_pause(), and set_queue_member_ringinuse().
|
static |
Definition at line 3773 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, 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 2437 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 7918 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, parse(), 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 3945 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 7229 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 4937 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_macro(), 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_macroexten(), AST_CHANNEL_NAME, ast_channel_name(), ast_channel_nativeformats(), ast_channel_publish_dial(), ast_channel_publish_dial_forward(), ast_channel_redirecting(), ast_channel_redirecting_macro(), 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, ast_frame::data, ast_frame::datalen, callattempt::dial_callerid_absent, 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(), S_OR, 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 5626 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_ent::raise_penalty, RECHECK, record_abandoned(), say_periodic_announcement(), say_position(), queue_ent::start, status, penalty_rule::time, update_qe_rule(), and valid_exit().
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 |
Definition at line 9870 of file app_queue.c.
Referenced by complete_queue().
|
static |
Definition at line 11505 of file app_queue.c.
|
static |
Definition at line 11247 of file app_queue.c.
|
static |
Definition at line 1448 of file app_queue.c.
|
static |
Definition at line 1450 of file app_queue.c.
|
static |
Definition at line 1454 of file app_queue.c.
|
static |
Definition at line 1458 of file app_queue.c.
|
static |
Definition at line 1460 of file app_queue.c.
|
static |
Definition at line 1452 of file app_queue.c.
|
static |
Definition at line 1456 of file app_queue.c.
|
static |
Definition at line 11505 of file app_queue.c.
|
static |
queues.conf [general] option
Definition at line 1472 of file app_queue.c.
Referenced by init_queue().
|
static |
Referenced by autopause2int().
|
static |
Definition at line 11234 of file app_queue.c.
|
static |
Subscription to device state change messages.
Definition at line 1484 of file app_queue.c.
enum queue_result id |
Definition at line 1507 of file app_queue.c.
Referenced by OrderedDict::__repr__(), _sip_show_peers(), _skinny_show_devices(), _skinny_show_lines(), add_action_to_menu_entry(), aMYSQL_clear(), aMYSQL_disconnect(), 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_jb_create_framehook(), ast_rtp_instance_extmap_get_id(), cache_find(), contact_alloc(), extension_state_add_destroy(), frame_drop_helper(), frame_trace_helper(), generate_content_id_hdr(), handle_local_optimization_begin(), handle_local_optimization_end(), handle_registrations(), idemodulator(), mbox(), mwi_mailbox_get(), pidf_generate_body_content(), pidf_validate_tuple(), process_extmap_attributes(), queue_connected_line_update(), session_end_if_disconnected(), session_inv_on_tsx_state_changed(), set_asterisk_int(), set_rtp_rtcp_schedid(), sorcery_realtime_create(), sorcery_realtime_retrieve_fields(), sorcery_realtime_retrieve_multiple(), try_merge_optimize_out(), and try_swap_optimize_out().
|
static |
queues.conf [general] option
Definition at line 1490 of file app_queue.c.
|
static |
queues.conf [general] option
Definition at line 1475 of file app_queue.c.
Referenced by init_queue().
|
static |
queues.conf [general] option
Definition at line 1487 of file app_queue.c.
|
static |
Definition at line 2375 of file app_queue.c.
|
static |
Persistent Members astdb family.
Definition at line 1463 of file app_queue.c.
Definition at line 1379 of file app_queue.c.
Referenced by queue_exec().
|
static |
queues.conf [general] option
Definition at line 1466 of file app_queue.c.
const { ... } queue_results[] |
Referenced by set_queue_result().
|
static |
Definition at line 9079 of file app_queue.c.
|
static |
Definition at line 9100 of file app_queue.c.
|
static |
Definition at line 9095 of file app_queue.c.
|
static |
Definition at line 9089 of file app_queue.c.
|
static |
Definition at line 9110 of file app_queue.c.
|
static |
Definition at line 9115 of file app_queue.c.
|
static |
Definition at line 1766 of file app_queue.c.
|
static |
Definition at line 9084 of file app_queue.c.
|
static |
Definition at line 9105 of file app_queue.c.
|
static |
name of the ringinuse field in the realtime database
Definition at line 1493 of file app_queue.c.
|
static |
queuesrules.conf [general] option
Definition at line 1481 of file app_queue.c.
Referenced by reload_queue_rules().
|
static |
|
static |
queues.conf [general] option
Definition at line 1478 of file app_queue.c.
|
static |
Referenced by int2strat(), and strat2int().
char* text |
Definition at line 1508 of file app_queue.c.
Referenced by _sip_show_peer(), add_required_respheader(), asterisk_publication_send_refresh(), asterisk_publisher_devstate_cb(), asterisk_publisher_mwistate_cb(), build_reply_digest(), chan_pjsip_pvt_dtor(), check_auth(), check_content_type_in_dialog(), dahdi_chan_conf_default(), fake_ami(), fake_json(), festival_exec(), generate_notify_body(), handle_cli_check_permissions(), handle_response(), handle_response_cmgr(), handle_response_info(), handle_response_message(), iconv_read(), jb_debug_output(), jingle_action_session_terminate(), jingle_send_session_info(), jingle_send_session_terminate(), keypad_cfg_read(), method_match(), originate_exec(), parse_sip_options(), process_sdp(), reqprep(), rfc3326_use_reason_header(), sendtext_safe(), set_queue_result(), show_main_page(), and xmldoc_get_syntax_config_object().
|
static |
Definition at line 11248 of file app_queue.c.
|
static |
Records that one or more queues use weight.
Definition at line 1469 of file app_queue.c.