[Asterisk-bugs] [Asterisk 0009573]: updatecdr in agents.conf is not working

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Jul 6 08:57:57 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=9573 
====================================================================== 
Reported By:                nyt
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   9573
Category:                   Core/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.4.2  
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 61708 
Disclaimer on File?:        No 
Request Review:              
====================================================================== 
Date Submitted:             04-21-2007 05:50 CDT
Last Modified:              07-06-2007 08:57 CDT
====================================================================== 
Summary:                    updatecdr in agents.conf is not working
Description: 
Apparently there were changes made to the way cdr functions (I noticed the
changes took affect when I upgraded around Dec 12 2006).

with updatecdr enabled, this is how it used to look:
(3XXX are SIP IDs, 4XXX are agent IDs.  My test agent is 4198)

4198         (test agent) available at '3198 at queue' (musiconhold is
'default')


""Agent Name Edited"
<4129>","4129","EDITEDNUMBER","internal-real","SIP/3046-68c3","Zap/1-1"
,"Dial","Zap/g1/EDITEDNUMBER||WT","2006-04-08 21:28:38","2006-04-08
21:29:07","2006-04-08 2
1:29:15","37","8","ANSWERED","DOCUMENTATION","","1144556918.7509",""

Now, with updatecdr enabled still (it changes the callerid name from what
sip specifies, to the agent name now, but nothing else)

""test agent"
<3198>","3198","4116","internal-real","SIP/3198-082bfdb8","","VoiceMail","4116|u","2007-04-21
03:24:51","2007-04-21 03:24:51","2007-04-21
03:24:52","1","1","ANSWERED","DOCUMENTATION","","1177151091.17",""

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
has duplicate       0010011 CDR channel column doesn't change to Ag...
====================================================================== 

---------------------------------------------------------------------- 
 nyt - 07-06-07 08:57  
---------------------------------------------------------------------- 
I have applied your patch to rev 73586.  It does not appear to work.

Here is the output from my cdr log, none of the information has been
updated (from 3198 -> 4198, and the src channel is sip instead of agent)

""test agent"
<3198>","3198","715162488400","internal-real","SIP/3198-082a1750","Zap/1-1","Dial","Zap/g1/15162488400||WT","2007-07-06
07:10:16","2007-07-06 07:10:32","2007-07-06
07:10:34","18","2","ANSWERED","DOCUMENTATION","","1183731016.243","4198"

4198         (test agent) available at '3198 at queue' (musiconhold is
'default')


fmtpbx:~/asterisk/asterisk-1.4-svn# svn diff main/cdr.c
Index: main/cdr.c
===================================================================
--- main/cdr.c  (revision 73586)
+++ main/cdr.c  (working copy)
@@ -616,12 +616,16 @@
                ast_copy_string(to->dcontext, from->dcontext,
sizeof(to->dcontext));
                from->dcontext[0] = 0; /* theft */
        }
-       if (ast_strlen_zero(to->dstchannel) &&
!ast_strlen_zero(from->dstchannel)) {
+       if (strncasecmp(from->dstchannel,"Agent/",6) == 0) {
                ast_copy_string(to->dstchannel, from->dstchannel,
sizeof(to->dstchannel));
+       } else if (ast_strlen_zero(to->dstchannel) &&
!ast_strlen_zero(from->dstchannel)) {
+               ast_copy_string(to->dstchannel, from->dstchannel,
sizeof(to->dstchannel));
                from->dstchannel[0] = 0; /* theft */
        }
-       if (ast_strlen_zero(to->channel) &&
!ast_strlen_zero(from->channel)) {
+       if (strncasecmp(from->channel,"Agent/",6) == 0) {
                ast_copy_string(to->channel, from->channel,
sizeof(to->channel));
+       } else if (ast_strlen_zero(to->channel) &&
!ast_strlen_zero(from->channel)) {
+               ast_copy_string(to->channel, from->channel,
sizeof(to->channel));
                from->channel[0] = 0; /* theft */
        }
        if (ast_strlen_zero(to->src) && !ast_strlen_zero(from->src)) { 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-06-07 08:57  nyt            Note Added: 0066582                          
======================================================================




More information about the Asterisk-bugs mailing list