<div dir="ltr">Dear All,
<br><br>I am
 working  on Kamailio (4.0.1) server with GUI package Siremis (4.0) of it. I
 was successful in get through Calls and SMS features in our VoIP phones
 using this kamailio sever. But i am encountering some issues related to CDR data generation into mysql database.<br><br>I have activated WITH_ACCDB in kamailio cfg file.
<br>Siremis is configured to kamailio DB properly as i am getting 
accounting list in the siremis GUI well,  but only the CDR data is not 
getting reflecting in GUI.
<br><br>But this CDR data is successfully logging into syslog (see the 
paragraph below), but my requirement is to get the CDR data to be 
reflect in my GUI.
<br><br>Here below is the CDR data that logged into syslog:
<br><br>Aug  3 17:36:25 kamailio /usr/local/sbin/kamailio[12391]: INFO: 
acc [acc.c:275]: acc_log_request(): ACC: transaction answered: 
timestamp=1375531585;method=INVITE;from_tag=170287292812;to_tag=373699520912;call_id=<a href="mailto:6595ee13-bfec-15a7-ae-4b-00210705d550@192.168.2.99">6595ee13-bfec-15a7-ae-4b-00210705d550@192.168.2.99</a>;code=200;reason=OK;src=;dst=
<br>Aug  3 17:36:25 kamailio /usr/local/sbin/kamailio[12393]: INFO: acc 
[acc.c:275]: acc_log_request(): ACC: request acknowledged: 
timestamp=1375531585;method=ACK;from_tag=170287292812;to_tag=373699520912;call_id=<a href="mailto:6595ee13-bfec-15a7-ae-4b-00210705d550@192.168.2.99">6595ee13-bfec-15a7-ae-4b-00210705d550@192.168.2.99</a>;code=200;reason=OK;src=;dst=
<br>Aug  3 17:36:29 kamailio /usr/local/sbin/kamailio[12391]: INFO: acc 
[acc_cdr.c:192]: write_cdr(): st=1375531585.654; et=1375531588.863; 
duration=3.209; src_user=102; src_domain=192.168.2.41; 
src_ip=192.168.2.99; dst_ouser=101; dst_user=101; 
dst_domain=192.168.2.77
<br><br>And my kamailio.cfg script relating to CDR's is like this:
<br><br>/* enhanced DB accounting */
<br>#!ifdef WITH_ACCDB
<br>modparam("acc", "db_flag", FLT_ACCDB)  /* FLT_ACCDB is 2 */
<br>modparam("acc", "db_missed_flag", FLT_ACCMISSED) /* FLT_ACCMISSED is 3 */
<br>modparam("acc", "db_url", mysql://kamailio:kamailiorw@kamailio/kamailio)
<br>#modparam("acc", 
"db_extra","src_user=$fU;src_domain=$fd;src_ip=$si;""dst_ouser=$tU;dst_user=
   $rU;dst_domain=$rd;""duration=$DLG_lifetime")
<br>#modparam("acc", "db_extra","${cdr_extra}")
<br>modparam("acc", "db_extra","src_user=$fU;src_domain=$fd;src_ip=$si;""dst_ouser=$tU;dst_user=   $rU;dst_domain=$rd")
<br>modparam("acc", "db_table_acc", "acc")
<br>#modparam("acc", "db_table_acc", "acc_$time(year)_$time(mon)")
<br>modparam("acc", "db_table_missed_calls", "missed_calls")
<br>modparam("acc", "acc_method_column", "method")
<br>modparam("acc", "acc_from_tag_column", "from_tag")
<br>modparam("acc", "acc_to_tag_column", "to_tag")
<br>modparam("acc", "acc_callid_column", "callid")
<br>modparam("acc", "acc_sip_code_column", "sip_code")
<br>modparam("acc", "acc_sip_reason_column", "sip_reason")
<br>modparam("acc", "acc_time_column", "time")
<br>modparam("acc", "db_insert_mode", 0)
<br>#!endif
<br><br># -------- for siremis CDRs -----------
<br>modparam("acc", "cdr_enable", 1)
<br>modparam("acc", "cdr_start_on_confirmed", 1)
<br>modparam("acc", "cdr_facility", "LOG_DAEMON")
<br>#modparam("acc", "cdr_extra", "c1=$dlg_var(caller);c2=$dlg_var(callee)")
<br>modparam("acc", "cdr_extra", "src_user=$fU;src_domain=$fd;src_ip=$si;""dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")       
<br>modparam("acc", "cdr_start_id", "st")
<br>modparam("acc", "cdr_end_id", "et")
<br>modparam("acc", "cdr_duration_id", "duration")
<br>.
<br>modparam("rtimer", "timer", "name=cdr;interval=300;mode=1;")
<br>modparam("rtimer", "exec", "timer=cdr;route=2")
<br>modparam("sqlops", "sqlcon", "ca=>mysql://kamailio:kamailiorw@localhost/kamailio")
<br>modparam("sqlops", "sqlres", "ra") 
<br>.
<br>.
<br># Populate CDRs Table of Siremis
<br>route[2] {
<br>        sql_query("ca","call kamailio_cdrs()","ra");
<br>}
<br><br>Can u guess where i am wrong ? how can i solve this issue ?
<br><br>And for your notice, in acc module document it is said like this:
<br> 'Note that CDR generation does not involve any kind of database 
storage (yet). In order to persist the CDRs into a database you will 
have to set up an exterior process (i.e., a script living outside of 
Kamailio) and implement the storage task yourself'. 
<br>What does it mean ? of course 'cdrs' table in kamailio database is empty.
<br><br>Any help will greatly appreciate.<br><br>Regards,
<br>Nandini.
</div>