<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Sounds like `datetime` is a column type looking for a formatted timestamp value, not a UNIX epoch value. <br><br><div dir="ltr">—<div>Sent from mobile, with due apologies for brevity and errors.</div></div><div dir="ltr"><br><blockquote type="cite">On Jun 5, 2020, at 3:21 PM, mohsen khashei <mkhashei@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div class="gmail-TimelineItem gmail-pt-0 gmail-js-comment-container gmail-js-socket-channel" style="box-sizing:border-box;padding:16px 0px;display:flex;margin-left:16px"><div class="gmail-timeline-comment-group gmail-js-minimizable-comment-group gmail-js-targetable-element gmail-TimelineItem-body gmail-my-0" id="gmail-issue-631573179" style="box-sizing:border-box;margin-top:4px;min-width:0px;max-width:100%;color:rgb(68,77,86);margin-bottom:0px"><div class="gmail-ml-n3 gmail-timeline-comment gmail-unminimized-comment gmail-comment gmail-previewable-edit gmail-js-task-list-container editable-comment gmail-js-comment gmail-timeline-comment--caret gmail-reorderable-task-lists gmail-current-user" style="box-sizing:border-box;color:rgb(36,41,46);border:1px solid rgb(192,211,235);border-radius:3px"><div class="edit-comment-hide" style="box-sizing:border-box"><span style="box-sizing:border-box"><table class="gmail-d-block" style="border-spacing:0px;border-collapse:collapse;display:block"><tbody class="gmail-d-block" style="box-sizing:border-box;display:block"><tr class="gmail-d-block" style="box-sizing:border-box;display:block"><td class="gmail-d-block gmail-comment-body gmail-markdown-body gmail-js-comment-body" style="box-sizing:border-box;padding:15px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px;line-height:1.5;width:669px;overflow:visible;display:block"><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px">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:</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;padding:0.2em 0.4em;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">$dlg_var(ringtime) = $Ts;</code></p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px">then I add a extra column in config like this:</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;padding:0.2em 0.4em;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">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)")</code><br style="box-sizing:border-box">but when I try to test it always i get:</p><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;margin-top:0px;padding:16px;overflow:auto;line-height:1.45;background-color:rgb(246,248,250);border-radius:3px;margin-bottom:0px"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;padding:0px;margin:0px;background:initial;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit">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 <a href="http://105a0f4a3d99a0a5558355e54b43f4e1@192.168.1.121:5060">105a0f4a3d99a0a5558355e54b43f4e1@192.168.1.121:5060</a>} <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 <a href="http://105a0f4a3d99a0a5558355e54b43f4e1@192.168.1.121:5060">105a0f4a3d99a0a5558355e54b43f4e1@192.168.1.121:5060</a>} acc [acc.c:477]: acc_db_request(): failed to insert into database
</code></pre></td></tr></tbody></table></span></div><form class="gmail-js-comment-update" action="https://github.com/kamailio/kamailio/issues/2349" method="post" style="box-sizing:border-box"></form></div></div></div><div class="gmail-js-issue-timeline-container" style="box-sizing:border-box"><div id="gmail-js-timeline-progressive-loader" style="box-sizing:border-box"></div><div class="gmail-js-timeline-item gmail-js-timeline-progressive-focus-container" style="box-sizing:border-box"><div class="gmail-TimelineItem" id="event-3411205940" style="box-sizing:border-box;display:flex;padding:16px 0px;margin-left:16px"><div class="gmail-TimelineItem-badge" style="box-sizing:border-box;display:flex;width:32px;height:32px;margin-right:8px;color:rgb(68,77,86);background-color:rgb(225,228,232);border:2px solid rgb(255,255,255);border-radius:50%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"></div><br class="gmail-Apple-interchange-newline"></div></div></div></div>
<span>_______________________________________________</span><br><span>Kamailio (SER) - Users Mailing List</span><br><span>sr-users@lists.kamailio.org</span><br><span>https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</span><br></div></blockquote></body></html>