3cx journaling MySQL

Status
Not open for further replies.

Martin N.

Premier Customer
Joined
Jun 24, 2021
Messages
62
Reaction score
6
Hello guys,

we are still running version 18 SP 9, and obvously want to upgrade to 20. We are kinda very dependent on 3CX and all integrations, features etc. so because of that I ve set testing envioronment (free one) to see how especially journaling will be working, as we do have other important services dependent on it.

I ve set exactly the same setup for journaling (using default MySql template) but from uknown reason its still not feeding data into the database, once I am trying to test, it returns nothing back (logs etc)

Running MySql 5.7

Here is my the lookup by number sql statement:

Code:
SELECT 1 contactid, 'Ignore' firstname, 'Ignore' lastname, '' as email,'[Number]' as phonebusiness, '[Number]' as phonemobile, '[Number]' as faxbusiness

Call journaling statement:

Code:
INSERT INTO 3cx_journaling (CallType, Number, Agent, Duration, CallStartTimeLocal, CallEndTimeLocal, CallStartTimeUTC, CallEndTimeUTC) VALUES ('[CallType]','[Number]','[Agent]','[Duration]','[[CallStartTimeLocal].ToString("yyyy-MM-dd HH:mm:ss")]','[[CallEndTimeLocal].ToString("yyyy-MM-dd HH:mm:ss")]','[[CallStartTimeUTC].ToString("yyyy-MM-ddTHH:mm:ssZ")]','[[CallEndTimeUTC].ToString("yyyy-MM-ddTHH:mm:ssZ")]')

As I stated before this setup works correctly on ver 18, however not working on testing ver 20.

Maybe anyone know how to adjust select and insert query?
 
Does it mean I would need to rename columns as following on my database and run statements as stated in the link?

1721990513727.png
 
So like this for example?

Code:
INSERT INTO 3cx_journaling (CallType, Number, Agent, Duration, CallStartTimeLocal, CallEndTimeLocal, CallStartTimeUTC, CallEndTimeUTC) VALUES ('@CallType','@Number','@Agent','@Duration','[@CallStartTimeLocal.ToString("yyyy-MM-dd HH:mm:ss")]','[@CallEndTimeLocal.ToString("yyyy-MM-dd HH:mm:ss")]','[@CallStartTimeUTC.ToString("yyyy-MM-ddTHH:mm:ssZ")]','[@CallEndTimeUTC.ToString("yyyy-MM-ddTHH:mm:ssZ")]')
 
So like this for example?

Code:
INSERT INTO 3cx_journaling (CallType, Number, Agent, Duration, CallStartTimeLocal, CallEndTimeLocal, CallStartTimeUTC, CallEndTimeUTC) VALUES ('@CallType','@Number','@Agent','@Duration','[@CallStartTimeLocal.ToString("yyyy-MM-dd HH:mm:ss")]','[@CallEndTimeLocal.ToString("yyyy-MM-dd HH:mm:ss")]','[@CallStartTimeUTC.ToString("yyyy-MM-ddTHH:mm:ssZ")]','[@CallEndTimeUTC.ToString("yyyy-MM-ddTHH:mm:ssZ")]')
Just read the page. It explains how to use the @Variables for each database engine, as well as give example for the date formatting.
 
For date times, this will not work:
[@CallStartTimeLocal.ToString("yyyy-MM-dd HH:mm:ss")]

You will need to use the conversion functions of your database. 3CX will send a timestamp parameter.
 
  • Like
Reactions: Evolute IT
Status
Not open for further replies.