I would like to know where call reports are storing in mysql database,
but i am unable fine where records are inserting, i added one new field in cdr table, and i want to change inset statement also. but i unable to fine
anybody can help me, reply soon
siva
You can add custom fields to dialplan and they will be inserted in your cdr table.
Put the code in following manner in your dialplan:
exten=>s,1,Set(CDR(yourfieldname)=siva);
assuming you have ‘yourfieldname’ in your cdr table.
georgy thank you . for you suggestion
i will implement and give you the status
should this work for 1.2 as well ?
I set the field in the Dial plan:
exten=>655,n,Set(CDR(test)=testing)
and added the field ‘test’ to the db table :
CREATE TABLE cdr
(
calldate
datetime NOT NULL default ‘0000-00-00 00:00:00’,
clid
varchar(80) NOT NULL default ‘’,
src
varchar(80) NOT NULL default ‘’,
dst
varchar(80) NOT NULL default ‘’,
dcontext
varchar(80) NOT NULL default ‘’,
channel
varchar(80) NOT NULL default ‘’,
dstchannel
varchar(80) NOT NULL default ‘’,
lastapp
varchar(80) NOT NULL default ‘’,
lastdata
varchar(80) NOT NULL default ‘’,
duration
int(11) NOT NULL default ‘0’,
billsec
int(11) NOT NULL default ‘0’,
disposition
varchar(45) NOT NULL default ‘’,
amaflags
int(11) NOT NULL default ‘0’,
accountcode
varchar(20) NOT NULL default ‘’,
userfield
varchar(255) NOT NULL default ‘’,
uniqueid
varchar(32) NOT NULL default ‘’,
test
varchar(240) default NULL,
KEY calldate
(calldate
),
KEY dst
(dst
),
KEY accountcode
(accountcode
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
but still no joy - I have no problem writing custom stuff to the predefined fields ( accountcode,userfield) but an extra column is what we really need,
can anyone help?
I’ll answer my own question.
Custom cdr fields are not possible until 1.6 ( I checked the c code)
Yes you can’t do that in 1.2 / 1.4. I found out myself as well by opening the cdr.c file.
However what I did is add the custom fields myself in the C file where there are the inserts and recompiled it. works for me.