mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
optionally log uniqueid as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -56,8 +56,11 @@ static int mysql_log(struct ast_cdr *cdr)
|
||||
|
||||
|
||||
ast_log(LOG_DEBUG,"cdr_mysql: inserting a CDR record.\n");
|
||||
#ifdef MYSQL_LOGUNIQUEID
|
||||
sprintf(sqlcmd,"INSERT INTO cdr (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,%i,%i,'%s','%s')",timestr,cdr->clid,cdr->src, cdr->dst, cdr->dcontext,cdr->channel, cdr->dstchannel, cdr->lastapp, cdr->lastdata,cdr->duration,cdr->billsec,cdr->disposition,cdr->amaflags, cdr->accountcode, cdr->uniqueid);
|
||||
#else
|
||||
sprintf(sqlcmd,"INSERT INTO cdr (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,%i,%i,'%s')",timestr,cdr->clid,cdr->src, cdr->dst, cdr->dcontext,cdr->channel, cdr->dstchannel, cdr->lastapp, cdr->lastdata,cdr->duration,cdr->billsec,cdr->disposition,cdr->amaflags, cdr->accountcode);
|
||||
|
||||
#endif
|
||||
ast_log(LOG_DEBUG,"cdr_mysql: SQL command as follows: %s\n",sqlcmd);
|
||||
|
||||
if (mysql_real_query(mysql,sqlcmd,strlen(sqlcmd)))
|
||||
|
@@ -22,7 +22,8 @@ CREATE TABLE cdr (
|
||||
billsec int(11) NOT NULL default '0',
|
||||
disposition int(11) NOT NULL default '0',
|
||||
amaflags int(11) NOT NULL default '0',
|
||||
accountcode varchar(45) NOT NULL default ''
|
||||
accountcode varchar(45) NOT NULL default '',
|
||||
uniqueid varchar(45) NOT NULL default ''
|
||||
);
|
||||
|
||||
The calls will automatically be logged as long as the module is loaded.
|
||||
|
Reference in New Issue
Block a user