<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 03/25/2011 08:19 AM, Tilghman Lesher wrote:
<blockquote cite="mid:201103250219.26585.tilghman@meg.abyt.es"
 type="cite">
  <pre wrap="">On Thursday 24 March 2011 04:50:48 Jonas Kellens wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">On 03/24/2011 10:45 AM, Rizwan Hisham wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">You have to use adaptive cdr for this functionality. In 1.8 the conf
file for adaptive cdr is cdr_adaptive_odbc.conf. The sample conf file
should tell you everything.

If you are using some other cdr engine then you will have to jump into
the code of asterisk to make it log the item you want, which includes
creating an extra variable in the cdr data struction, creating a
function to set/get its value from dialplan, and then changing the sql
command to include the extra variable for insertion into DB.
      </pre>
    </blockquote>
    <pre wrap="">
I thought it was possible in asterisk 1.6.2 to add extra mysql-fields ??
In asterisk 1.4 you just have one 'userfield', but in 1.6.2 it is
possible to add custom fields... I just don't know how.

This is what the wiki
(<a class="moz-txt-link-freetext" href="http://www.voip-info.org/wiki/view/Asterisk+cdr+mysql">http://www.voip-info.org/wiki/view/Asterisk+cdr+mysql</a>) tells :

"/Module now permits arbitrary columns to be created and populated, just
like cdr_adaptive_odbc, simply by adding the column to the table and
defining the corresponding CDR() variable/"

Where is the information on this ?
    </pre>
  </blockquote>
  <pre wrap="">
Same as always, in the configs/ directory of addons 1.6.2.  The sample
configuration file contains common examples of the added functionality.

Also, there's a note on it in UPGRADE.txt, in the root directory of addons
1.6.2.  If you have any further questions, you're welcome to ask this list.
  </pre>
</blockquote>
<font face="Helvetica, Arial, sans-serif"><br>
All I can find is the following :<br>
<br>
; You may also configure the field names used in the CDR table.<br>
;<br>
[columns]<br>
;static "&lt;value&gt;" =&gt; &lt;column&gt;<br>
;alias &lt;cdrvar&gt; =&gt; &lt;column&gt;<br>
alias start =&gt; calldate<br>
alias callerid =&gt; clid<br>
;alias src =&gt; src<br>
;alias dst =&gt; dst<br>
;alias dcontext =&gt; dcontext<br>
;alias channel =&gt; channel<br>
;alias dstchannel =&gt; dstchannel<br>
;alias lastapp =&gt; lastapp<br>
;alias lastdata =&gt; lastdata<br>
;alias duration =&gt; duration<br>
;alias billsec =&gt; billsec<br>
;alias disposition =&gt; disposition<br>
;alias amaflags =&gt; amaflags<br>
;alias accountcode =&gt; accountcode<br>
;alias userfield =&gt; userfield<br>
;alias uniqueid =&gt; uniqueid<br>
<br>
But this is not explained...<br>
<br>
So please can you confirm how I think it should work :<br>
<br>
In my dialplan I have :<br>
<br>
</font><font face="Helvetica, Arial, sans-serif"><i><small>exten =&gt;
600,n,Set(CDR(mycolumn)="myvalue")</small></i><br>
<br>
So I should add the following to cdr_mysql.conf :<br>
<br>
<small><i>[columns]<br>
static "mycolumn" =&gt; mycolumn</i></small><br>
<br>
<br>
And if I want this in my dialplan :<br>
<br>
<small><i>exten =&gt; 600,n,Set(CDR(anothercolumn)="anothervalue")</i></small><br>
<br>
then I first need to add to </font><font
 face="Helvetica, Arial, sans-serif">cdr_mysql.conf</font><font
 face="Helvetica, Arial, sans-serif">&nbsp; :<br>
<br>
</font><small><i><font face="Helvetica, Arial, sans-serif">static "</font><font
 face="Helvetica, Arial, sans-serif">anothercolumn</font><font
 face="Helvetica, Arial, sans-serif">" =&gt; </font><font
 face="Helvetica, Arial, sans-serif">anothercolumn</font></i></small><br>
<font face="Helvetica, Arial, sans-serif"><br>
<br>
<br>
Can you confirm ?<br>
<br>
<br>
Kind regards,<br>
Jonas.</font><br>
</body>
</html>