OpenSIPS / opensips

OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-level technical solution (performance, security and quality) to be used in professional SIP server platforms.
https://opensips.org
Other
1.28k stars 581 forks source link

OpenSIPS not preserving database data types #1108

Open ionutrazvanionita opened 7 years ago

ionutrazvanionita commented 7 years ago

When fetching data from database OpenSIPS does not preserve the format. As an example the query select utc_date() will return in mysql a date in the following format 2017-04-24 whereas in OpenSIPS the query

avp_db_query("select utc_date()", "$avp(utc)");
xlog("uTC: $avp(utc)\n")

will print the date in the following format uTC: 1492981200

liviuchircu commented 7 years ago

As a workaround, you can do avp_db_query("SELECT CAST(utc_date() AS CHAR)"...) for now.

ionutrazvanionita commented 7 years ago

And also users can do avp_db_query("select DATE_FORMAT(UTC_TIMESTAMP(),'%Y%m%d')", "$avp(utc)"); for formatted date in utc format