int memberdelay; /*!< Seconds to delay connecting member to caller */
int autofill; /*!< Ignore the head call status and ring an available agent */
+ int log_restricted_caller_id:1; /*!< Whether log Restricted Caller ID */
+
struct ao2_container *members; /*!< Head of the list of members */
struct queue_ent *head; /*!< Head of the list of callers */
AST_LIST_ENTRY(call_queue) list; /*!< Next call queue */
q->autopauseunavail = 0;
q->timeoutpriority = TIMEOUT_PRIORITY_APP;
q->autopausedelay = 0;
+ q->log_restricted_caller_id = 1;
if (!q->members) {
if (q->strategy == QUEUE_STRATEGY_LINEAR || q->strategy == QUEUE_STRATEGY_RRORDERED) {
/* linear strategy depends on order, so we have to place all members in a list */
} else {
q->timeoutpriority = TIMEOUT_PRIORITY_APP;
}
+ } else if (!strcasecmp(param, "log-restricted-caller-id")) {
+ q->log_restricted_caller_id = ast_true(val);
} else if (failunknown) {
if (linenum >= 0) {
ast_log(LOG_WARNING, "Unknown keyword in queue '%s': %s at line %d of queues.conf\n",
struct ast_flags opts = { 0, };
char *opt_args[OPT_ARG_ARRAY_SIZE];
int max_forwards;
+ int cid_allow;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Queue requires an argument: queuename[,options[,URL[,announceoverride[,timeout[,agi[,gosub[,rule[,position]]]]]]]]\n");
qe.last_periodic_announce_time -= qe.parent->periodicannouncefrequency;
}
+ cid_allow = qe.parent->log_restricted_caller_id || ((ast_party_id_presentation(&ast_channel_caller(chan)->id) & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED);
+
ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "ENTERQUEUE", "%s|%s|%d",
S_OR(args.url, ""),
- S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""),
+ S_COR(cid_allow && ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""),
qe.opos);
/* PREDIAL: Preprocess any callee gosub arguments. */
;
;log_membername_as_agent = no
;
+; log-restricted-caller-id controls whether the Restricted Caller ID will be stored
+; in the queue log.
+; If log-restricted-caller-id=no then the Caller ID will be stripped if the Caller ID
+; is restricted.
+; Default is 'yes', which means the Caller ID is always stored.
+;log-restricted-caller-id = yes
+;
; force_longest_waiting_caller will cause app_queue to make sure callers are offered
; in order (longest waiting first), even for callers across multiple queues.
; Before a call is offered to an agent, an additional check is made to see if the agent
--- /dev/null
+"""add queue_log option log-restricted-caller-id
+
+Revision ID: 2b7c507d7d12
+Revises: bd9c5159c7ea
+Create Date: 2024-06-12 17:00:16.841343
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '2b7c507d7d12'
+down_revision = 'bd9c5159c7ea'
+
+from alembic import op
+import sqlalchemy as sa
+from sqlalchemy.dialects.postgresql import ENUM
+
+AST_BOOL_NAME = 'ast_bool_values'
+AST_BOOL_VALUES = [ '0', '1',
+ 'off', 'on',
+ 'false', 'true',
+ 'no', 'yes' ]
+
+
+def upgrade():
+ # Create the new enum
+ ast_bool_values = ENUM(*AST_BOOL_VALUES, name=AST_BOOL_NAME, create_type=False)
+ if op.get_context().bind.dialect.name == 'postgresql':
+ ast_bool_values.create(op.get_bind(), checkfirst=False)
+
+ op.add_column('queues', sa.Column('log_restricted_caller_id', ast_bool_values))
+
+
+def downgrade():
+ op.drop_column('queues', 'log_restricted_caller_id')