Sounds like `datetime` is a column type looking for a formatted timestamp value, not a UNIX epoch value. 

Sent from mobile, with due apologies for brevity and errors.

On Jun 5, 2020, at 3:21 PM, mohsen khashei <mkhashei@gmail.com> wrote:



Hi I want to add a new column to acc table.I created a new column in the acc table of type timestamp and named it ring_time. in every call i put the ring time to a $dlg_var like this:

$dlg_var(ringtime) = $Ts;

then I add a extra column in config like this:

modparam("acc", "log_extra", "src_user=$fU;src_domain=$fd;src_ip=$si;" "dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;ring_time=$dlg_var(ringtime)")
but when I try to test it always i get:

db_mysql [km_dbase.c:122]: db_mysql_submit_query(): driver error on query: Incorrect datetime value: '1591361996' for column `kamailio`.`acc`.`ring_time` at row 1 (1292)
Jun  5 17:29:59 kamailio /usr/sbin/kamailio[22901]: ERROR: {2 102 INVITE 105a0f4a3d99a0a5558355e54b43f4e1@192.168.1.121:5060} <core> [db_query.c:244]: db_do_insert_cmd(): error while submitting query
Jun  5 17:29:59 kamailio /usr/sbin/kamailio[22901]: ERROR: {2 102 INVITE 105a0f4a3d99a0a5558355e54b43f4e1@192.168.1.121:5060} acc [acc.c:477]: acc_db_request(): failed to insert into database

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users