<br>
<div><span class="gmail_quote">On 8/2/06, <b class="gmail_sendername">Kevin P. Fleming</b> <<a href="mailto:kpfleming@digium.com">kpfleming@digium.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">----- Carlos Chavez <<a href="mailto:cursor@telecomabmex.com">cursor@telecomabmex.com</a>> wrote:<br>
> The only thing you can really do from the dialplan is to use the<br>> CDR(userfield) function to add custom information, but I do not think<br>> there is a way to put additional fields into the CDR database this
<br>> way.<br><br>The CDR() function allows you to define your own variables in the CDR with any names/values you want. However, none of the existing CDR->database backends will dump these variables out to a database (although they could easily do so).
<br><br>--<br>Kevin P. Fleming<br>Senior Software Engineer<br>Digium, Inc.<br><br></blockquote></div>
<div>Kevin, </div>
<div> </div>
<div>I guess "cdr_addon_mysql.c" would need to be modified to accept the new fields?</div>
<div>I'm not a C# programmer, but it looks like the following is what I need to modify:</div>
<div> </div>
<div>Do you have an example code that I could look at of this?</div>
<div> </div>
<div>#ifdef MYSQL_LOGUNIQUEID<br>sprintf(sqlcmd, "INSERT INTO %s (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES ('%s','%s','%s','%s','%s', '%s','%s','%s','%s',%i,%i,'%s',%i,'%s','%s','%s')", dbtable, timestr, clid, cdr->src, cdr->dst, dcontext, channel, dstchannel, lastapp, lastdata, cdr->duration, cdr->billsec, ast_cdr_disp2str(cdr->disposition), cdr->amaflags, cdr->accountcode, uniqueid, userfielddata);
<br>#else<br>sprintf(sqlcmd, "INSERT INTO %s (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,userfield) VALUES ('%s','%s','%s','%s','%s', '%s','%s','%s','%s',%i,%i,'%s',%i,'%s','%s')", dbtable, timestr, clid, cdr->src, cdr->dst, dcontext,channel, dstchannel, lastapp, lastdata, cdr->duration, cdr->billsec, ast_cdr_disp2str(cdr->disposition), cdr->amaflags, cdr->accountcode, userfielddata);
<br>#endif<br>} else {<br>#ifdef MYSQL_LOGUNIQUEID<br>sprintf(sqlcmd, "INSERT INTO %s (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid) VALUES ('%s','%s','%s','%s','%s', '%s','%s','%s','%s',%i,%i,'%s',%i,'%s','%s')", dbtable, timestr, clid, cdr->src, cdr->dst, dcontext,channel, dstchannel, lastapp, lastdata, cdr->duration, cdr->billsec, ast_cdr_disp2str(cdr->disposition), cdr->amaflags, cdr->accountcode, uniqueid);
<br>#else<br>sprintf(sqlcmd, "INSERT INTO %s (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode) VALUES ('%s','%s','%s','%s','%s', '%s','%s','%s','%s',%i,%i,'%s',%i,'%s')", dbtable, timestr, clid, cdr->src, cdr->dst, dcontext, channel, dstchannel, lastapp, lastdata, cdr->duration, cdr->billsec, ast_cdr_disp2str(cdr->disposition), cdr->amaflags, cdr->accountcode);
<br><br>Thanks,</div>
<div> </div>
<div>bp</div>