From ccc4ae282a536b84b426f8f271a9501e464d6d83 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 7 Jun 2019 21:32:00 +0400 Subject: [PATCH] FS-11880: [Core,mod_pgsql] Remove native PostgreSQL support from the core, add mod_pgsql database module. --- Freeswitch.2017.sln | 17 + Makefile.am | 2 - build/modules.conf.in | 1 + build/modules.conf.most | 1 + .../pre_load_modules.conf.xml | 6 + conf/rayo/autoload_configs/switch.conf.xml | 20 + .../pre_load_modules.conf.xml | 6 + conf/testing/autoload_configs/switch.conf.xml | 20 + .../pre_load_modules.conf.xml | 6 + conf/vanilla/autoload_configs/switch.conf.xml | 20 + configure.ac | 121 +- debian/bootstrap.sh | 5 + debian/control-modules | 7 + debian/rules | 3 +- freeswitch.spec | 37 +- src/include/switch.h | 1 - src/include/switch_core.h | 20 +- src/include/switch_module_interfaces.h | 2 +- src/include/switch_pgsql.h | 173 --- src/include/switch_types.h | 2 - .../mod_directory/mod_directory.c | 2 +- src/mod/applications/mod_fifo/mod_fifo.c | 2 +- src/mod/databases/mod_pgsql/Makefile.am | 18 + .../mod_pgsql/mod_pgsql.2017.vcxproj | 150 +++ .../databases/mod_pgsql/mod_pgsql.c} | 1127 +++++++++-------- .../event_handlers/mod_cdr_pg_csv/Makefile.am | 4 +- .../languages/mod_managed/freeswitch_wrap.cxx | 630 +++++++-- .../examples/winFailToBan/winFailToBan.csproj | 2 +- src/mod/languages/mod_managed/managed/swig.cs | 681 +++++++--- src/switch_core_sqldb.c | 205 +-- w32/Library/FreeSwitchCore.2017.vcxproj | 3 - w32/Setup/Setup.2017.wixproj | 8 + 32 files changed, 2077 insertions(+), 1225 deletions(-) create mode 100644 conf/rayo/autoload_configs/pre_load_modules.conf.xml create mode 100644 conf/testing/autoload_configs/pre_load_modules.conf.xml create mode 100644 conf/vanilla/autoload_configs/pre_load_modules.conf.xml delete mode 100644 src/include/switch_pgsql.h create mode 100644 src/mod/databases/mod_pgsql/Makefile.am create mode 100644 src/mod/databases/mod_pgsql/mod_pgsql.2017.vcxproj rename src/{switch_pgsql.c => mod/databases/mod_pgsql/mod_pgsql.c} (55%) diff --git a/Freeswitch.2017.sln b/Freeswitch.2017.sln index d6b9e27875..d649654ac5 100644 --- a/Freeswitch.2017.sln +++ b/Freeswitch.2017.sln @@ -580,6 +580,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ffmpeg", "libs\win32\ffmpeg EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Setup.CA.DownloadOpenH264", "w32\Setup\CustomActions\Setup.CA.DownloadOpenH264\Setup.CA.DownloadOpenH264.csproj", "{EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Databases", "Databases", "{31C2761D-20E0-4BF8-98B9-E32F0D8DD6E1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_pgsql", "src\mod\databases\mod_pgsql\mod_pgsql.2017.vcxproj", "{1BA65811-5453-46F6-8190-9ECEEFEB7DF2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2659,6 +2663,18 @@ Global {EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Release|Win32.Build.0 = Release|x86 {EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Release|x64.ActiveCfg = Release|x86 {EBFDCFCA-8095-4ECC-98BE-B494BCB4E042}.Release|x64.Build.0 = Release|x86 + {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.All|Win32.ActiveCfg = Release|Win32 + {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.All|Win32.Build.0 = Release|Win32 + {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.All|x64.ActiveCfg = Release|x64 + {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.All|x64.Build.0 = Release|x64 + {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.Debug|Win32.ActiveCfg = Debug|Win32 + {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.Debug|Win32.Build.0 = Debug|Win32 + {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.Debug|x64.ActiveCfg = Debug|x64 + {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.Debug|x64.Build.0 = Debug|x64 + {1BA65811-5453-46F6-8190-9ECEEFEB7DF2}.Release|Win32.ActiveCfg = Release|Win32 + {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2869,6 +2885,7 @@ Global {EBD0B6B4-C5CA-46B0-BBC7-DBA71DF05D31} = {4F227C26-768F-46A3-8684-1D08A46FB374} {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} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {09840DE7-9208-45AA-9667-1A71EE93BD1E} diff --git a/Makefile.am b/Makefile.am index fb81a6f175..510448655e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -326,7 +326,6 @@ library_include_HEADERS = \ libs/libteletone/src/libteletone.h \ src/include/switch_limit.h \ src/include/switch_odbc.h \ - src/include/switch_pgsql.h \ src/include/switch_hashtable.h \ src/include/switch_image.h @@ -390,7 +389,6 @@ libfreeswitch_la_SOURCES = \ src/switch_config.c \ src/switch_time.c \ src/switch_odbc.c \ - src/switch_pgsql.c \ src/switch_limit.c \ src/g711.c \ src/switch_pcm.c \ diff --git a/build/modules.conf.in b/build/modules.conf.in index 98f4b7d7fc..6b26354d8f 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_pgsql dialplans/mod_dialplan_asterisk #dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml diff --git a/build/modules.conf.most b/build/modules.conf.most index a4946004d2..c142b1a3d7 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_pgsql dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml diff --git a/conf/rayo/autoload_configs/pre_load_modules.conf.xml b/conf/rayo/autoload_configs/pre_load_modules.conf.xml new file mode 100644 index 0000000000..659bf7b8d4 --- /dev/null +++ b/conf/rayo/autoload_configs/pre_load_modules.conf.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/conf/rayo/autoload_configs/switch.conf.xml b/conf/rayo/autoload_configs/switch.conf.xml index e618069ab2..7b26088a55 100644 --- a/conf/rayo/autoload_configs/switch.conf.xml +++ b/conf/rayo/autoload_configs/switch.conf.xml @@ -147,7 +147,27 @@ + + + + + diff --git a/conf/testing/autoload_configs/switch.conf.xml b/conf/testing/autoload_configs/switch.conf.xml index 8e66e7159f..36158810df 100644 --- a/conf/testing/autoload_configs/switch.conf.xml +++ b/conf/testing/autoload_configs/switch.conf.xml @@ -152,7 +152,27 @@ + + + + + diff --git a/conf/vanilla/autoload_configs/switch.conf.xml b/conf/vanilla/autoload_configs/switch.conf.xml index ababe548ac..679862cc68 100644 --- a/conf/vanilla/autoload_configs/switch.conf.xml +++ b/conf/vanilla/autoload_configs/switch.conf.xml @@ -161,7 +161,27 @@ --> + +