[asterisk-commits] qwell: trunk r82800 - in /trunk: apps/app_queue.c configs/queues.conf.sample

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 18 11:16:37 CDT 2007


Author: qwell
Date: Tue Sep 18 11:16:36 2007
New Revision: 82800

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82800
Log:
(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.

Modified:
    trunk/apps/app_queue.c
    trunk/configs/queues.conf.sample

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=82800&r1=82799&r2=82800
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Tue Sep 18 11:16:36 2007
@@ -253,6 +253,9 @@
 
 /*! \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,
@@ -2995,6 +2998,8 @@
 		}
 		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 @@
 			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) {

Modified: trunk/configs/queues.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/queues.conf.sample?view=diff&rev=82800&r1=82799&r2=82800
==============================================================================
--- trunk/configs/queues.conf.sample (original)
+++ trunk/configs/queues.conf.sample Tue Sep 18 11:16:36 2007
@@ -46,6 +46,14 @@
 ;    compatibility. 
 ;
 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:




More information about the asterisk-commits mailing list