From 4a2812aaf58593aefb07a6698c9675a9cc22b64c Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 12 Jun 2019 12:05:42 +0400 Subject: [PATCH] FS-11727: [mod_mariadb] Add MariaDB (MySQL) support --- Freeswitch.2017.sln | 15 + build/modules.conf.in | 1 + build/modules.conf.most | 1 + .../pre_load_modules.conf.xml | 1 + conf/rayo/autoload_configs/switch.conf.xml | 1 + .../pre_load_modules.conf.xml | 1 + conf/testing/autoload_configs/switch.conf.xml | 1 + .../pre_load_modules.conf.xml | 1 + conf/vanilla/autoload_configs/switch.conf.xml | 1 + configure.ac | 6 + debian/bootstrap.sh | 2 + debian/control-modules | 5 + freeswitch.spec | 17 +- libs/.gitignore | 3 +- src/mod/databases/mod_mariadb/Makefile.am | 18 + src/mod/databases/mod_mariadb/mariadb_dsn.cpp | 161 +++ src/mod/databases/mod_mariadb/mariadb_dsn.hpp | 57 + .../mod_mariadb/mod_mariadb.2017.vcxproj | 153 +++ src/mod/databases/mod_mariadb/mod_mariadb.c | 1048 +++++++++++++++++ src/switch_core_sqldb.c | 2 +- w32/Setup/Setup.2017.wixproj | 8 + w32/mariadb-connector-c-version.props | 19 + w32/mariadb-connector-c.props | 80 ++ 23 files changed, 1598 insertions(+), 4 deletions(-) create mode 100644 src/mod/databases/mod_mariadb/Makefile.am create mode 100644 src/mod/databases/mod_mariadb/mariadb_dsn.cpp create mode 100644 src/mod/databases/mod_mariadb/mariadb_dsn.hpp create mode 100644 src/mod/databases/mod_mariadb/mod_mariadb.2017.vcxproj create mode 100644 src/mod/databases/mod_mariadb/mod_mariadb.c create mode 100644 w32/mariadb-connector-c-version.props create mode 100644 w32/mariadb-connector-c.props diff --git a/Freeswitch.2017.sln b/Freeswitch.2017.sln index d649654ac5..537439a95d 100644 --- a/Freeswitch.2017.sln +++ b/Freeswitch.2017.sln @@ -584,6 +584,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Databases", "Databases", "{ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_pgsql", "src\mod\databases\mod_pgsql\mod_pgsql.2017.vcxproj", "{1BA65811-5453-46F6-8190-9ECEEFEB7DF2}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_mariadb", "src\mod\databases\mod_mariadb\mod_mariadb.2017.vcxproj", "{0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2675,6 +2677,18 @@ Global {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.Release|Win32.Build.0 = Release|Win32 {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.Release|x64.ActiveCfg = Release|x64 {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.Release|x64.Build.0 = Release|x64 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.All|Win32.ActiveCfg = Release|Win32 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.All|Win32.Build.0 = Release|Win32 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.All|x64.ActiveCfg = Release|x64 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.All|x64.Build.0 = Release|x64 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Debug|Win32.ActiveCfg = Debug|Win32 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Debug|Win32.Build.0 = Debug|Win32 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Debug|x64.ActiveCfg = Debug|x64 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Debug|x64.Build.0 = Debug|x64 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Release|Win32.ActiveCfg = Release|Win32 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Release|Win32.Build.0 = Release|Win32 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Release|x64.ActiveCfg = Release|x64 + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2886,6 +2900,7 @@ Global {B19AE6FC-BFFF-428D-B483-3BBEAECCC618} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {BC1FD72E-1CD5-4525-A7F5-17C5740BFDED} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {1BA65811-5453-46F6-8190-9ECEEFEB7DF2} = {31C2761D-20E0-4BF8-98B9-E32F0D8DD6E1} + {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC} = {31C2761D-20E0-4BF8-98B9-E32F0D8DD6E1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {09840DE7-9208-45AA-9667-1A71EE93BD1E} diff --git a/build/modules.conf.in b/build/modules.conf.in index 6b26354d8f..8f2c2a6d24 100644 --- a/build/modules.conf.in +++ b/build/modules.conf.in @@ -79,6 +79,7 @@ codecs/mod_opus #codecs/mod_silk #codecs/mod_siren #codecs/mod_theora +#databases/mod_mariadb databases/mod_pgsql dialplans/mod_dialplan_asterisk #dialplans/mod_dialplan_directory diff --git a/build/modules.conf.most b/build/modules.conf.most index c142b1a3d7..6f976dca38 100644 --- a/build/modules.conf.most +++ b/build/modules.conf.most @@ -76,6 +76,7 @@ codecs/mod_sangoma_codec codecs/mod_silk codecs/mod_siren codecs/mod_theora +#databases/mod_mariadb databases/mod_pgsql dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory diff --git a/conf/rayo/autoload_configs/pre_load_modules.conf.xml b/conf/rayo/autoload_configs/pre_load_modules.conf.xml index 659bf7b8d4..620a6c1cd9 100644 --- a/conf/rayo/autoload_configs/pre_load_modules.conf.xml +++ b/conf/rayo/autoload_configs/pre_load_modules.conf.xml @@ -1,6 +1,7 @@ + diff --git a/conf/rayo/autoload_configs/switch.conf.xml b/conf/rayo/autoload_configs/switch.conf.xml index 7b26088a55..d23d832224 100644 --- a/conf/rayo/autoload_configs/switch.conf.xml +++ b/conf/rayo/autoload_configs/switch.conf.xml @@ -168,6 +168,7 @@ --> + + diff --git a/conf/testing/autoload_configs/switch.conf.xml b/conf/testing/autoload_configs/switch.conf.xml index 36158810df..69783e62c5 100644 --- a/conf/testing/autoload_configs/switch.conf.xml +++ b/conf/testing/autoload_configs/switch.conf.xml @@ -173,6 +173,7 @@ --> + + diff --git a/conf/vanilla/autoload_configs/switch.conf.xml b/conf/vanilla/autoload_configs/switch.conf.xml index 679862cc68..5b3930e796 100644 --- a/conf/vanilla/autoload_configs/switch.conf.xml +++ b/conf/vanilla/autoload_configs/switch.conf.xml @@ -182,6 +182,7 @@ --> + + + + + + + + + + + + + + + + + + + + + + $(mariadb-connector-clibDir)\include;%(AdditionalIncludeDirectories) + + + $(mariadb-connector-clibDir)\binaries\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + libmariadb.lib;Secur32.lib;%(AdditionalDependencies) + + +