aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-18 16:16:36 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-18 16:16:36 +0000
commita6f3537fbb30d12362fc2e5bbea1e95a4efee167 (patch)
tree04debe6523ecfdf2cb9e9c94a21c2c12c0797e17
parentdb3e6c44db884409bad9a7526d597dd7dd445a11 (diff)
(closes issue #10755)
Reported by: snar Patches: app-queue-cdr-trunk.patch uploaded by snar (license 245) queues.conf.patch uploaded by snar (license 245) Add an updatecdr option to queues.conf, so that if a "member name" is specified, the cdr record will be updated with that, rather than the channel. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82800 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_queue.c11
-rw-r--r--configs/queues.conf.sample8
2 files changed, 18 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index ee40bf40c..d6e1ec68d 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -254,6 +254,9 @@ static int montype_default = 0;
/*! \brief Subscription to device state change events */
static struct ast_event_sub *device_state_sub;
+/*! \brief queues.conf [general] option */
+static int update_cdr = 0;
+
enum queue_result {
QUEUE_UNKNOWN = 0,
QUEUE_TIMEOUT = 1,
@@ -2995,6 +2998,8 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
}
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, peer->uniqueid,
(long)(orig - to > 0 ? (orig - to) / 1000 : 0));
+ if (update_cdr && qe->chan->cdr)
+ ast_copy_string(qe->chan->cdr->dstchannel, member->membername, sizeof(qe->chan->cdr->dstchannel));
if (qe->parent->eventwhencalled)
manager_event(EVENT_FLAG_AGENT, "AgentConnect",
"Queue: %s\r\n"
@@ -4101,9 +4106,13 @@ static int reload_queues(int reload)
if ((general_val = ast_variable_retrieve(cfg, "general", "autofill")))
autofill_default = ast_true(general_val);
montype_default = 0;
- if ((general_val = ast_variable_retrieve(cfg, "general", "monitor-type")))
+ if ((general_val = ast_variable_retrieve(cfg, "general", "monitor-type"))) {
if (!strcasecmp(general_val, "mixmonitor"))
montype_default = 1;
+ }
+ update_cdr = 0;
+ if ((general_val = ast_variable_retrieve(cfg, "general", "updatecdr")))
+ update_cdr = ast_true(general_val);
} else { /* Define queue */
/* Look for an existing one */
AST_LIST_TRAVERSE(&queues, q, list) {
diff --git a/configs/queues.conf.sample b/configs/queues.conf.sample
index 4915ee04f..052ca79ba 100644
--- a/configs/queues.conf.sample
+++ b/configs/queues.conf.sample
@@ -47,6 +47,14 @@ autofill = yes
;
monitor-type = MixMonitor
;
+; UpdateCDR behavior.
+; This option is implemented to mimic chan_agents behavior of populating
+; CDR dstchannel field of a call with an agent name, which you can set
+; at the login time with AddQueueMember membername parameter.
+;
+; updatecdr = no
+
+;
; Note that a timeout to fail out of a queue may be passed as part of
; an application call from extensions.conf:
; Queue(queuename|[options]|[optionalurl]|[announceoverride]|[timeout])