Michael Collins
2006-Feb-01 01:54 UTC
[Asterisk-Users] SetCDRUserField not working in A@H?
I have A@H 2.1, running * 1.2.1. I am trying to put information into the userfield with SetCDRUserField and AppendCDRUserField. However, the field is never populated in the cdr - I've checked the csv files and the MySQL asteriskcdrdb table. The field is defined in the MySQL table, but is always empty. The csv files that get created don't have a userfield at all, that is, there isn't an empty string (like "" ) but rather there is nothing. Here's a sample: "5017999","5597337550","s","outboundmsg1","5597337550","Zap/1-1","","BackGro und","1-yes-2-no","2006-02-01 00:47:18","2006-02-01 00:47:18","2006-02-01 00:47:23",5,5,"ANSWERED","DOCUMENTATION" My dialplan looks like this: <snip> exten => s,n,SetCDRUserField(${dnum}) exten => s,n,Noop(cdr user field is '${CDR(userfield)') exten => s,n,AppendCDRUserField( ${cdn}) exten => s,n,Noop(cdr user field is '${CDR(userfield)') exten => s,n,AppendCDRUserField( ${dialednum}) exten => s,n,Noop(cdr user field is '${CDR(userfield)') ;exten => s,n,Set(CDR(userfield)=${dnum}|${cdn}|${dialednum}) ;exten => s,n,Noop(cdr user field is '${CDR(userfield)') </snip> I get the Noop lines logged at the CLI: <snip> -- Executing SetCDRUserField("Zap/1-1", "data1") in new stack -- Executing NoOp("Zap/1-1", "cdr user field is data1") in new stack -- Executing AppendCDRUserField("Zap/1-1", " data2") in new stack -- Executing NoOp("Zap/1-1", "cdr user field is data1 data2") in new stack -- Executing AppendCDRUserField("Zap/1-1", " data3") in new stack -- Executing NoOp("Zap/1-1", "cdr user field is data1 data2 data3") in new stack </snip> Unfortunately I don't get a cdr with the userfield populated. Has anyone conquered this challenge before? I saw a few old threads from 2004 but there wasn't a conclusive answer. Thanks! -Michael P.S. - this occurs in all contexts in the dialplan, in or out bound calls. I've experimented with ResetCDR(w) and I still get the same symptoms -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060201/ab4096aa/attachment.htm
On Wednesday 01 February 2006 10:54, Michael Collins wrote:> I have A@H 2.1, running * 1.2.1. I am trying to put information into the > userfield with SetCDRUserField and AppendCDRUserField. However, the field > is never populated in the cdr - I've checked the csv files and the MySQL > asteriskcdrdb table. The field is defined in the MySQL table, but is > always empty. The csv files that get created don't have a userfield at > all, that is, there isn't an empty string (like "" ) but rather there is > nothing. Here's a sample: >The Userfield is not defined by default. You have to set a define during compilation of asterisk - I do not know A@H but look in the files cdr/cdr_csv.c cdr/cdr-sqlite.c for USERFIELD and in /etc/asterisk/cdr_mysql.conf for userfield=1 Paul -- Paul Hewlett - CottonPickinMinds - www.cottonpickinminds.co.za Tel: +27 21 852 8812 Cel: +27 84 420 9282 Fax: +27 86 672 0563 --