FS-11880: [Core,mod_pgsql] Remove native PostgreSQL support from the core, add mod_pgsql database module.

This commit is contained in:
Andrey Volk 2019-06-07 21:32:00 +04:00
parent 3588cd5c51
commit ccc4ae282a
32 changed files with 2077 additions and 1225 deletions

View File

@ -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}

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,6 @@
<configuration name="pre_load_modules.conf" description="Modules">
<modules>
<!-- Databases -->
<load module="mod_pgsql"/>
</modules>
</configuration>

View File

@ -147,7 +147,27 @@
<param name="rtp-enable-zrtp" value="true"/>
<!--
Native PostgreSQL support was removed from the FreeSWITCH Core!
=================================
NOTICE: You MUST enable mod_pgsql
=================================
According to https://www.postgresql.org/docs/9.6/libpq-connect.html#LIBPQ-CONNSTRING
There are two accepted formats for connection strings supported by the libpq library:
* For plain keyword = value strings use pgsql://
pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE' application_name='freeswitch'
* For RFC 3986 URIs use postgresql:// or postgres://
postgresql://
postgresql://localhost
postgresql://localhost:5433
postgresql://localhost/mydb
postgresql://user@localhost
postgresql://user:secret@localhost
postgresql://other@localhost/otherdb?connect_timeout=10&application_name=myapp
postgresql:///mydb?host=localhost&port=5433
-->
<!-- <param name="core-db-dsn" value="pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE' application_name='freeswitch'" /> -->
<!-- <param name="core-db-dsn" value="postgresql://freeswitch:@127.0.0.1/freeswitch?options=-c%20client_min_messages%3DNOTICE&application_name=freeswitch" /> -->
<!-- <param name="core-db-dsn" value="dsn:username:password" /> -->
<!--
Allow to specify the sqlite db at a different location (In this example, move it to ramdrive for

View File

@ -0,0 +1,6 @@
<configuration name="pre_load_modules.conf" description="Modules">
<modules>
<!-- Databases -->
<load module="mod_pgsql"/>
</modules>
</configuration>

View File

@ -152,7 +152,27 @@
<param name="rtp-enable-zrtp" value="true"/>
<!--
Native PostgreSQL support was removed from the FreeSWITCH Core!
=================================
NOTICE: You MUST enable mod_pgsql
=================================
According to https://www.postgresql.org/docs/9.6/libpq-connect.html#LIBPQ-CONNSTRING
There are two accepted formats for connection strings supported by the libpq library:
* For plain keyword = value strings use pgsql://
pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE'
* For RFC 3986 URIs use postgresql:// or postgres://
postgresql://
postgresql://localhost
postgresql://localhost:5433
postgresql://localhost/mydb
postgresql://user@localhost
postgresql://user:secret@localhost
postgresql://other@localhost/otherdb?connect_timeout=10&application_name=myapp
postgresql:///mydb?host=localhost&port=5433
-->
<!-- <param name="core-db-dsn" value="pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE'" /> -->
<!-- <param name="core-db-dsn" value="postgresql://freeswitch:@127.0.0.1/freeswitch?options=-c%20client_min_messages%3DNOTICE" /> -->
<!-- <param name="core-db-dsn" value="dsn:username:password" /> -->
<!--
Allow to specify the sqlite db at a different location (In this example, move it to ramdrive for

View File

@ -0,0 +1,6 @@
<configuration name="pre_load_modules.conf" description="Modules">
<modules>
<!-- Databases -->
<load module="mod_pgsql"/>
</modules>
</configuration>

View File

@ -161,7 +161,27 @@
-->
<!-- <param name="rtp-retain-crypto-keys" value="true"/> -->
<!--
Native PostgreSQL support was removed from the FreeSWITCH Core!
=================================
NOTICE: You MUST enable mod_pgsql
=================================
According to https://www.postgresql.org/docs/9.6/libpq-connect.html#LIBPQ-CONNSTRING
There are two accepted formats for connection strings supported by the libpq library:
* For plain keyword = value strings use pgsql://
pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE'
* For RFC 3986 URIs use postgresql:// or postgres://
postgresql://
postgresql://localhost
postgresql://localhost:5433
postgresql://localhost/mydb
postgresql://user@localhost
postgresql://user:secret@localhost
postgresql://other@localhost/otherdb?connect_timeout=10&application_name=myapp
postgresql:///mydb?host=localhost&port=5433
-->
<!-- <param name="core-db-dsn" value="pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE'" /> -->
<!-- <param name="core-db-dsn" value="postgresql://freeswitch:@127.0.0.1/freeswitch?options=-c%20client_min_messages%3DNOTICE" /> -->
<!-- <param name="core-db-dsn" value="dsn:username:password" /> -->
<!--
Allow to specify the sqlite db at a different location (In this example, move it to ramdrive for

View File

@ -643,72 +643,9 @@ CHECK_LIBUUID
SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS"
SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS"
AC_ARG_ENABLE(core-pgsql-support,
[AS_HELP_STRING([--enable-core-pgsql-support], [Compile with PGSQL Support])],,[enable_core_pgsql_support="no"])
AC_ARG_ENABLE(core-pgsql-pkgconfig,
[AS_HELP_STRING([--disable-core-pgsql-pkgconfig], [Use pg_config to get PGQSL build options])],[enable_core_pgsql_pkgconfig="$enableval"],[enable_core_pgsql_pkgconfig="yes"])
if test x"$enable_core_pgsql_support" = x"yes" ; then
AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
if test "$PKG_CONFIG" = "no" \
|| test x"$enable_core_pgsql_pkgconfig" = x"no" \
|| ! pkg-config libpq; then
if test "$PG_CONFIG" != "no"; then
AC_MSG_CHECKING([for PostgreSQL libraries via pg_config])
POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
POSTGRESQL_LIBDIR="-L`$PG_CONFIG --libdir`"
POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
POSTGRESQL_VERSION=`$PG_CONFIG --version | awk '{ print $NF }'`
POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $1 }'`
POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $2 }'`
POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'`
else
AC_MSG_ERROR([no usable pkg-config or pg_config; please install libpq devel package or equivalent])
fi
else
AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config])
POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`"
POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`"
POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`"
POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`"
POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
test -n "$POSTGRESQL_PATCH_VERSION" || POSTGRESQL_PATCH_VERSION=0
fi
save_LIBS="$LIBS"
LIBS="$POSTGRESQL_LIBDIR $LIBS"
AC_MSG_RESULT([$POSTGRESQL_LIBDIR])
AC_DEFINE([SWITCH_HAVE_PGSQL], [1], [Define to 1 if PostgreSQL libraries are available])
AM_CONDITIONAL([HAVE_PGSQL],[true])
AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against])
AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
AC_CHECK_LIB([pq], [PQgetvalue],, AC_MSG_ERROR([no usable libpq; please install PostgreSQL devel package or equivalent]))
AC_MSG_RESULT([yes])
SWITCH_AM_CXXFLAGS="$POSTGRESQL_CFLAGS $SWITCH_AM_CXXFLAGS"
SWITCH_AM_LDFLAGS="$POSTGRESQL_LDFLAGS $SWITCH_AM_LDFLAGS"
LIBS="$save_LIBS"
else
AM_CONDITIONAL([HAVE_PGSQL],[false])
fi
AC_ARG_ENABLE(deprecated-core-db-events,
[AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"])
if test x"$enable_deprecated_core_db_events" = x"yes" ; then
AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events])
fi
ESL_LDFLAGS=
PLATFORM_CORE_LDFLAGS=
PLATFORM_CORE_LIBS=
path_remove () {
echo "$1" | tr ':' '\n' | grep -Fxv "$2" | tr '\n' ':' | sed 's/:$//'
}
@ -722,6 +659,63 @@ path_push_unique () {
fi
}
AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
case $host in
*-darwin*)
path_push_unique PKG_CONFIG_PATH /usr/local/opt/libpq/lib/pkgconfig
;;
esac
if test "$PKG_CONFIG" = "no" \
|| test x"$enable_core_pgsql_pkgconfig" = x"no" \
|| ! pkg-config libpq; then
if test "$PG_CONFIG" != "no"; then
AC_MSG_CHECKING([for PostgreSQL libraries via pg_config])
POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
POSTGRESQL_LIBDIR="-L`$PG_CONFIG --libdir`"
POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
POSTGRESQL_VERSION=`$PG_CONFIG --version | awk '{ print $NF }'`
POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $1 }'`
POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $2 }'`
POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'`
fi
else
AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config])
POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`"
POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`"
POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`"
POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`"
POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
test -n "$POSTGRESQL_PATCH_VERSION" || POSTGRESQL_PATCH_VERSION=0
fi
AC_MSG_RESULT([$POSTGRESQL_LIBDIR])
AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against])
AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
have_libpq=no
AC_CHECK_LIB([pq], [PQgetvalue], [have_libpq="yes"])
AM_CONDITIONAL([HAVE_PGSQL],[test "${have_libpq}" = "yes"])
AC_SUBST([POSTGRESQL_CFLAGS], [$POSTGRESQL_CFLAGS])
AC_SUBST([POSTGRESQL_LDFLAGS], [$POSTGRESQL_LDFLAGS])
AC_SUBST([POSTGRESQL_LIBDIR], [$POSTGRESQL_LIBDIR])
AC_ARG_ENABLE(deprecated-core-db-events,
[AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"])
if test x"$enable_deprecated_core_db_events" = x"yes" ; then
AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events])
fi
ESL_LDFLAGS=
PLATFORM_CORE_LDFLAGS=
PLATFORM_CORE_LIBS=
# tweak platform specific flags
case "$host" in
*darwin*)
@ -1930,6 +1924,7 @@ AC_CONFIG_FILES([Makefile
src/mod/codecs/mod_siren/Makefile
src/mod/codecs/mod_skel_codec/Makefile
src/mod/codecs/mod_theora/Makefile
src/mod/databases/mod_pgsql/Makefile
src/mod/dialplans/mod_dialplan_asterisk/Makefile
src/mod/dialplans/mod_dialplan_directory/Makefile
src/mod/dialplans/mod_dialplan_xml/Makefile

5
debian/bootstrap.sh vendored
View File

@ -418,6 +418,7 @@ Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
freeswitch-mod-dptools (= \${binary:Version}),
freeswitch-mod-fifo (= \${binary:Version}),
freeswitch-mod-hash (= \${binary:Version}),
freeswitch-mod-pgsql (= \${binary:Version}),
freeswitch-mod-spandsp (= \${binary:Version}),
freeswitch-mod-voicemail (= \${binary:Version}),
freeswitch-mod-dialplan-xml (= \${binary:Version}),
@ -468,6 +469,7 @@ Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
freeswitch-mod-expr (= \${binary:Version}),
freeswitch-mod-fifo (= \${binary:Version}),
freeswitch-mod-hash (= \${binary:Version}),
freeswitch-mod-pgsql (= \${binary:Version}),
freeswitch-mod-voicemail (= \${binary:Version}),
freeswitch-mod-esf (= \${binary:Version}),
freeswitch-mod-fsv (= \${binary:Version}),
@ -534,6 +536,7 @@ Recommends:
freeswitch-mod-lcr (= \${binary:Version}),
freeswitch-mod-nibblebill (= \${binary:Version}),
freeswitch-mod-oreka (= \${binary:Version}),
freeswitch-mod-pgsql (= \${binary:Version}),
freeswitch-mod-redis (= \${binary:Version}),
freeswitch-mod-rss (= \${binary:Version}),
freeswitch-mod-sms (= \${binary:Version}),
@ -620,6 +623,7 @@ Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
freeswitch-mod-memcache (= \${binary:Version}),
freeswitch-mod-nibblebill (= \${binary:Version}),
freeswitch-mod-oreka (= \${binary:Version}),
freeswitch-mod-pgsql (= \${binary:Version}),
freeswitch-mod-png (= \${binary:Version}),
freeswitch-mod-redis (= \${binary:Version}),
freeswitch-mod-rss (= \${binary:Version}),
@ -859,6 +863,7 @@ Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
freeswitch-mod-memcache-dbg (= \${binary:Version}),
freeswitch-mod-nibblebill-dbg (= \${binary:Version}),
freeswitch-mod-oreka-dbg (= \${binary:Version}),
freeswitch-mod-pgsql-dbg (= \${binary:Version}),
freeswitch-mod-png-dbg (= \${binary:Version}),
freeswitch-mod-redis-dbg (= \${binary:Version}),
freeswitch-mod-rss-dbg (= \${binary:Version}),

View File

@ -391,6 +391,13 @@ Module: codecs/mod_yuv
Description: Adds mod_yuv
Adds mod_yuv.
## mod/databases
Module: databases/mod_pgsql
Description: Adds mod_pgsql
Adds mod_pgsql.
Build-Depends: libpq-dev
## mod/dialplans
Module: dialplans/mod_dialplan_asterisk

3
debian/rules vendored
View File

@ -74,8 +74,7 @@ override_dh_auto_clean:
--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr --localstatedir=/var --sysconfdir=/etc \
--with-gnu-ld --with-python --with-erlang --with-openssl \
--enable-core-odbc-support --enable-zrtp \
--enable-core-pgsql-support
--enable-core-odbc-support --enable-zrtp
touch $@
override_dh_auto_configure: .stamp-configure

View File

@ -3,7 +3,7 @@
# spec file for package freeswitch
#
# includes module(s): freeswitch-devel freeswitch-codec-passthru-amr freeswitch-codec-passthru-amrwb freeswitch-codec-passthru-g729
# freeswitch-codec-passthru-g7231 freeswitch-lua freeswitch-perl freeswitch-python freeswitch-v8 freeswitch-signalwire
# freeswitch-codec-passthru-g7231 freeswitch-lua freeswitch-pgsql freeswitch-perl freeswitch-python freeswitch-v8 freeswitch-signalwire
# freeswitch-lan-de freeswitch-lang-en freeswitch-lang-fr freeswitch-lang-hu freeswitch-lang-ru freeswitch-freetdm
# and others
#
@ -838,6 +838,20 @@ Requires: %{name} = %{version}-%{release}
%description codec-theora
Theora Video Codec support for FreeSWITCH open source telephony platform.
######################################################################################################################
# FreeSWITCH Database Modules
######################################################################################################################
%package database-pgsql
Summary: PostgreSQL native support for FreeSWITCH
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Requires: postgresql-libs
BuildRequires: postgresql-devel
%description database-pgsql
PostgreSQL native support for FreeSWITCH.
######################################################################################################################
# FreeSWITCH Directory Modules
######################################################################################################################
@ -1419,6 +1433,7 @@ Requires: freeswitch-codec-passthru-g729
Requires: freeswitch-codec-h26x
Requires: freeswitch-codec-ilbc
Requires: freeswitch-codec-siren
Requires: freeswitch-database-pgsql
Requires: freeswitch-format-local-stream
Requires: freeswitch-format-native-file
Requires: freeswitch-format-portaudio-stream
@ -1514,6 +1529,13 @@ CODECS_MODULES="codecs/mod_amr codecs/mod_amrwb codecs/mod_bv codecs/mod_codec2
CODECS_MODULES+="codecs/mod_sangoma_codec"
%endif
######################################################################################################################
#
# Database Modules
#
######################################################################################################################
DATABASES_MODULES="databases/mod_pgsql"
######################################################################################################################
#
# Dialplan Modules
@ -1616,7 +1638,7 @@ XML_INT_MODULES="xml_int/mod_xml_cdr xml_int/mod_xml_curl xml_int/mod_xml_rpc"
# Create one environment variable out of all the module defs
#
######################################################################################################################
MYMODULES="$APPLICATIONS_MODULES $CODECS_MODULES $DIALPLANS_MODULES $DIRECTORIES_MODULES \
MYMODULES="$APPLICATIONS_MODULES $CODECS_MODULES $DATABASES_MODULES $DIALPLANS_MODULES $DIRECTORIES_MODULES \
$ENDPOINTS_MODULES $ASR_TTS_MODULES $EVENT_HANDLERS_MODULES $FORMATS_MODULES $LANGUAGES_MODULES $LOGGERS_MODULES \
$SAY_MODULES $TIMERS_MODULES $XML_INT_MODULES"
@ -1669,7 +1691,6 @@ autoreconf --force --install
--with-dbdir=%{DBDIR} \
--with-htdocsdir=%{HTDOCSDIR} \
--with-soundsdir=%{SOUNDSDIR} \
--enable-core-pgsql-support \
--enable-core-odbc-support \
--enable-core-libedit-support \
--with-grammardir=%{GRAMMARDIR} \
@ -1987,6 +2008,7 @@ fi
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/pocketsphinx.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/portaudio.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/post_load_modules.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/pre_load_modules.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/presence_map.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/redis.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/rss.conf.xml
@ -2262,6 +2284,15 @@ fi
%files codec-theora
%{MODINSTDIR}/mod_theora.so*
######################################################################################################################
#
# FreeSWITCH Database Modules
#
######################################################################################################################
%files database-pgsql
%{MODINSTDIR}/mod_pgsql.so*
######################################################################################################################
#
# FreeSWITCH Directory Modules

View File

@ -138,7 +138,6 @@
#include "switch_config.h"
#include "switch_nat.h"
#include "switch_odbc.h"
#include "switch_pgsql.h"
#include "switch_json.h"
#include "switch_limit.h"
#include "switch_core_media.h"

View File

@ -2479,14 +2479,12 @@ typedef enum {
typedef enum {
SCDB_TYPE_CORE_DB,
SCDB_TYPE_ODBC,
SCDB_TYPE_PGSQL,
SCDB_TYPE_DATABASE_INTERFACE
} switch_cache_db_handle_type_t;
typedef union {
switch_core_db_t *core_db_dbh;
switch_odbc_handle_t *odbc_dbh;
switch_pgsql_handle_t *pgsql_dbh;
switch_database_interface_handle_t *database_interface_dbh;
} switch_cache_db_native_handle_t;
@ -2501,11 +2499,8 @@ typedef struct {
} switch_cache_db_odbc_options_t;
typedef struct {
char *dsn;
} switch_cache_db_pgsql_options_t;
typedef struct {
char *dsn;
const char *original_dsn;
char *connection_string;
char prefix[16];
switch_database_interface_t *database_interface;
switch_bool_t make_module_no_unloadable;
@ -2514,7 +2509,6 @@ typedef struct {
typedef union {
switch_cache_db_core_db_options_t core_db_options;
switch_cache_db_odbc_options_t odbc_options;
switch_cache_db_pgsql_options_t pgsql_options;
switch_cache_db_database_interface_options_t database_interface_options;
} switch_cache_db_connection_options_t;
@ -2531,11 +2525,6 @@ static inline const char *switch_cache_db_type_name(switch_cache_db_handle_type_
type_str = "DATABASE_INTERFACE";
}
break;
case SCDB_TYPE_PGSQL:
{
type_str = "PGSQL";
}
break;
case SCDB_TYPE_ODBC:
{
type_str = "ODBC";
@ -2674,6 +2663,11 @@ SWITCH_DECLARE(void) switch_cache_db_database_interface_flush_handles(switch_dat
*/
SWITCH_DECLARE(switch_status_t) switch_core_check_core_db_dsn(void);
/*!
\brief Returns error if no suitable database interface found for a dsn.
*/
SWITCH_DECLARE(switch_status_t) switch_database_available(char* dsn);
SWITCH_DECLARE(void) switch_core_set_signal_handlers(void);
SWITCH_DECLARE(uint32_t) switch_core_debug_level(void);
SWITCH_DECLARE(int32_t) switch_core_sps(void);

View File

@ -621,7 +621,7 @@ struct switch_database_interface {
const char *interface_name;
/*! flags indicating database specifics, see switch_database_flag_t */
uint32_t flags;
switch_status_t(*handle_new)(char *dsn, switch_database_interface_handle_t **dih);
switch_status_t(*handle_new)(switch_cache_db_database_interface_options_t database_interface_options, switch_database_interface_handle_t **dih);
switch_status_t(*handle_destroy)(switch_database_interface_handle_t **dih);
switch_status_t(*flush)(switch_database_interface_handle_t *dih);
switch_status_t(*exec_detailed)(const char *file, const char *func, int line,

View File

@ -1,173 +0,0 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2014, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Anthony Minessale II <anthm@freeswitch.org>
* Eliot Gable <egable@gmail.com>
*
* switch_pgsql.h -- PGSQL Driver
*
*/
#ifndef SWITCH_PGSQL_H
#define SWITCH_PGSQL_H
#include <switch.h>
#define DEFAULT_PGSQL_RETRIES 120
SWITCH_BEGIN_EXTERN_C
struct switch_pgsql_handle;
struct switch_pgsql_result;
typedef enum {
SWITCH_PGSQL_STATE_INIT,
SWITCH_PGSQL_STATE_DOWN,
SWITCH_PGSQL_STATE_CONNECTED,
SWITCH_PGSQL_STATE_ERROR
} switch_pgsql_state_t;
typedef enum {
SWITCH_PGSQL_SUCCESS = 0,
SWITCH_PGSQL_FAIL = -1
} switch_pgsql_status_t;
/*!
\brief Create a new handle for the PGSQL connection.
\param dsn The DSN of the database to connect to. See documentation for PQconnectdb() at
http://www.postgresql.org/docs/9.0/static/libpq-connect.html. The DSN *MUST* be
prefixed with 'pgsql;' to use the switch_cache_db* functionality. However, the DSN
passed to this function directly *MUST NOT* be prefixed with 'pgsql;'.
\return Returns a pointer to a newly allocated switch_pgsql_handle_t type or NULL on failure.
*/
SWITCH_DECLARE(switch_pgsql_handle_t *) switch_pgsql_handle_new(const char *dsn);
/*!
\brief Sets the number of retries if the PGSQL connection fails.
\param handle A fully allocated switch_pgsql_handle_t returned from a call to switch_pgsql_handle_new().
\param num_retries How many times to retry connecting to the database if this connection fails.
*/
SWITCH_DECLARE(void) switch_pgsql_set_num_retries(switch_pgsql_handle_t *handle, int num_retries);
/*!
\brief Disconnects a PGSQL connection from the database.
\param handle The PGSQL database handle to disconnect.
\return Returns SWITCH_PGSQL_SUCCESS or SWITCH_PGSQL_FAIL.
*/
SWITCH_DECLARE(switch_pgsql_status_t ) switch_pgsql_handle_disconnect(switch_pgsql_handle_t *handle);
#if 0
) /* Emacs formatting issue */
#endif
/*!
\brief Connect to the database specified by the DSN passed to the switch_pgsql_handle_new() call which
initialized this handle.
\param The database handle to connect to the database.
\return Returns SWITCH_PGSQL_SUCCESS or SWITCH_PGSQL_FAIL.
*/
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_connect(switch_pgsql_handle_t *handle);
/*!
*/
SWITCH_DECLARE(void) switch_pgsql_handle_destroy(switch_pgsql_handle_t **handlep);
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_send_query(switch_pgsql_handle_t *handle, const char* sql);
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_cancel_real(const char *file, const char *func, int line, switch_pgsql_handle_t *handle);
#define switch_pgsql_cancel(handle) switch_pgsql_cancel_real(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, handle)
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_next_result_timed(switch_pgsql_handle_t *handle, switch_pgsql_result_t **result_out, int seconds);
#define switch_pgsql_next_result(h, r) switch_pgsql_next_result_timed(h, r, 10000)
SWITCH_DECLARE(void) switch_pgsql_free_result(switch_pgsql_result_t **result);
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_finish_results_real(const char* file, const char *func, int line, switch_pgsql_handle_t *handle);
#define switch_pgsql_finish_results(handle) switch_pgsql_finish_results_real(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, handle)
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_exec_base_detailed(const char *file, const char *func, int line,
switch_pgsql_handle_t *handle, const char *sql, char **err);
#define switch_pgsql_handle_exec_base(handle, sql, err) switch_pgsql_handle_exec_base_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, handle, sql, err)
SWITCH_DECLARE(switch_pgsql_state_t) switch_pgsql_handle_get_state(switch_pgsql_handle_t *handle);
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_exec_detailed(const char *file, const char *func, int line,
switch_pgsql_handle_t *handle, const char *sql, char **err);
#define switch_pgsql_handle_exec(handle, sql, err) switch_pgsql_handle_exec_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, handle, sql, err)
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_exec_string_detailed(const char *file, const char *func, int line,
switch_pgsql_handle_t *handle, const char *sql, char *resbuf, size_t len, char **err);
#define switch_pgsql_handle_exec_string(handle, sql, resbuf, len, err) switch_pgsql_handle_exec_string_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, handle, sql, resbuf, len, err)
SWITCH_DECLARE(switch_bool_t) switch_pgsql_available(void);
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_SQLSetAutoCommitAttr(switch_pgsql_handle_t *handle, switch_bool_t on);
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_SQLEndTran(switch_pgsql_handle_t *handle, switch_bool_t commit);
/*!
\brief Execute the sql query and issue a callback for each row returned
\param file the file from which this function is called
\param func the function from which this function is called
\param line the line from which this function is called
\param handle the PGSQL handle
\param sql the sql string to execute
\param callback the callback function to execute
\param pdata the state data passed on each callback invocation
\return SWITCH_STATUS_SUCCESS if the operation was successful
\note none
*/
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_callback_exec_detailed(const char *file, const char *func, int line, switch_pgsql_handle_t *handle,
const char *sql, switch_core_db_callback_func_t callback, void *pdata,
char **err);
/*!
\brief Execute the sql query and issue a callback for each row returned
\param handle the PGSQL handle
\param sql the sql string to execute
\param callback the callback function to execute
\param pdata the state data passed on each callback invocation
\return SWITCH_STATUS_SUCCESS if the operation was successful
\note none
*/
#define switch_pgsql_handle_callback_exec(handle, sql, callback, pdata, err) \
switch_pgsql_handle_callback_exec_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, \
handle, sql, callback, pdata, err)
SWITCH_DECLARE(char *) switch_pgsql_handle_get_error(switch_pgsql_handle_t *handle);
SWITCH_DECLARE(int) switch_pgsql_handle_affected_rows(switch_pgsql_handle_t *handle);
SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_flush(switch_pgsql_handle_t *handle);
SWITCH_END_EXTERN_C
#endif
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
*/

View File

@ -2315,8 +2315,6 @@ typedef struct switch_buffer switch_buffer_t;
typedef union switch_codec_settings switch_codec_settings_t;
typedef struct switch_codec_fmtp switch_codec_fmtp_t;
typedef struct switch_odbc_handle switch_odbc_handle_t;
typedef struct switch_pgsql_handle switch_pgsql_handle_t;
typedef struct switch_pgsql_result switch_pgsql_result_t;
typedef struct switch_database_interface_handle switch_database_interface_handle_t;
typedef struct switch_io_routines switch_io_routines_t;

View File

@ -468,7 +468,7 @@ static switch_status_t load_config(switch_bool_t reload)
char *val = (char *) switch_xml_attr_soft(param, "value");
if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
if (switch_odbc_available() || switch_pgsql_available()) {
if (switch_database_available(val)) {
switch_set_string(globals.odbc_dsn, val);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");

View File

@ -4392,7 +4392,7 @@ static switch_status_t read_config_file(switch_xml_t *xml, switch_xml_t *cfg) {
if (!strcasecmp(var, "outbound-strategy") && !zstr(val)) {
globals.default_strategy = parse_strategy(val);
} else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
if (switch_odbc_available() || switch_pgsql_available()) {
if (switch_database_available(val)) {
switch_set_string(globals.odbc_dsn, val);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");

View File

@ -0,0 +1,18 @@
include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_pgsql
if HAVE_PGSQL
mod_LTLIBRARIES = mod_pgsql.la
mod_pgsql_la_SOURCES = mod_pgsql.c
mod_pgsql_la_CFLAGS = $(AM_CFLAGS) $(POSTGRESQL_CFLAGS)
mod_pgsql_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_pgsql_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(POSTGRESQL_LDFLAGS)
else
install: error
all: error
error:
$(error You must install libpq-dev to build mod_pgsql)
endif

View File

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>mod_pgsql</ProjectName>
<RootNamespace>mod_pgsql</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{1BA65811-5453-46F6-8190-9ECEEFEB7DF2}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="..\..\..\..\w32\libpq.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_debug.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\w32\module_debug.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="mod_pgsql.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\w32\Library\FreeSwitchCore.2017.vcxproj">
<Project>{202d7a4e-760d-4d0e-afa1-d7459ced30ff}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,9 @@ if HAVE_PGSQL
mod_LTLIBRARIES = mod_cdr_pg_csv.la
mod_cdr_pg_csv_la_SOURCES = mod_cdr_pg_csv.c
mod_cdr_pg_csv_la_CFLAGS = $(AM_CFLAGS) $(SWITCH_AM_CXXFLAGS)
mod_cdr_pg_csv_la_CFLAGS = $(AM_CFLAGS) $(SWITCH_AM_CXXFLAGS) $(POSTGRESQL_CFLAGS)
mod_cdr_pg_csv_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_cdr_pg_csv_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lpq $(SWITCH_AM_LDFLAGS)
mod_cdr_pg_csv_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lpq $(SWITCH_AM_LDFLAGS) $(POSTGRESQL_LDFLAGS)
else
install: error

View File

@ -16978,28 +16978,6 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_native_ha
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_native_handle_t_pgsql_dbh_set___(void * jarg1, void * jarg2) {
switch_cache_db_native_handle_t *arg1 = (switch_cache_db_native_handle_t *) 0 ;
switch_pgsql_handle_t *arg2 = (switch_pgsql_handle_t *) 0 ;
arg1 = (switch_cache_db_native_handle_t *)jarg1;
arg2 = (switch_pgsql_handle_t *)jarg2;
if (arg1) (arg1)->pgsql_dbh = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_native_handle_t_pgsql_dbh_get___(void * jarg1) {
void * jresult ;
switch_cache_db_native_handle_t *arg1 = (switch_cache_db_native_handle_t *) 0 ;
switch_pgsql_handle_t *result = 0 ;
arg1 = (switch_cache_db_native_handle_t *)jarg1;
result = (switch_pgsql_handle_t *) ((arg1)->pgsql_dbh);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_native_handle_t_database_interface_dbh_set___(void * jarg1, void * jarg2) {
switch_cache_db_native_handle_t *arg1 = (switch_cache_db_native_handle_t *) 0 ;
switch_database_interface_handle_t *arg2 = (switch_database_interface_handle_t *) 0 ;
@ -17196,79 +17174,60 @@ SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_delete_switch_cache_db_odbc
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_pgsql_options_t_dsn_set___(void * jarg1, char * jarg2) {
switch_cache_db_pgsql_options_t *arg1 = (switch_cache_db_pgsql_options_t *) 0 ;
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_original_dsn_set___(void * jarg1, char * jarg2) {
switch_cache_db_database_interface_options_t *arg1 = (switch_cache_db_database_interface_options_t *) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (switch_cache_db_pgsql_options_t *)jarg1;
arg1 = (switch_cache_db_database_interface_options_t *)jarg1;
arg2 = (char *)jarg2;
{
delete [] arg1->dsn;
if (arg2) {
arg1->dsn = (char *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->dsn, (const char *)arg2);
arg1->original_dsn = (char const *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->original_dsn, (const char *)arg2);
} else {
arg1->dsn = 0;
arg1->original_dsn = 0;
}
}
}
SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_pgsql_options_t_dsn_get___(void * jarg1) {
SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_original_dsn_get___(void * jarg1) {
char * jresult ;
switch_cache_db_pgsql_options_t *arg1 = (switch_cache_db_pgsql_options_t *) 0 ;
switch_cache_db_database_interface_options_t *arg1 = (switch_cache_db_database_interface_options_t *) 0 ;
char *result = 0 ;
arg1 = (switch_cache_db_pgsql_options_t *)jarg1;
result = (char *) ((arg1)->dsn);
arg1 = (switch_cache_db_database_interface_options_t *)jarg1;
result = (char *) ((arg1)->original_dsn);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_new_switch_cache_db_pgsql_options_t___() {
void * jresult ;
switch_cache_db_pgsql_options_t *result = 0 ;
result = (switch_cache_db_pgsql_options_t *)new switch_cache_db_pgsql_options_t();
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_delete_switch_cache_db_pgsql_options_t___(void * jarg1) {
switch_cache_db_pgsql_options_t *arg1 = (switch_cache_db_pgsql_options_t *) 0 ;
arg1 = (switch_cache_db_pgsql_options_t *)jarg1;
delete arg1;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_dsn_set___(void * jarg1, char * jarg2) {
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_connection_string_set___(void * jarg1, char * jarg2) {
switch_cache_db_database_interface_options_t *arg1 = (switch_cache_db_database_interface_options_t *) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (switch_cache_db_database_interface_options_t *)jarg1;
arg2 = (char *)jarg2;
{
delete [] arg1->dsn;
delete [] arg1->connection_string;
if (arg2) {
arg1->dsn = (char *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->dsn, (const char *)arg2);
arg1->connection_string = (char *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->connection_string, (const char *)arg2);
} else {
arg1->dsn = 0;
arg1->connection_string = 0;
}
}
}
SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_dsn_get___(void * jarg1) {
SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_connection_string_get___(void * jarg1) {
char * jresult ;
switch_cache_db_database_interface_options_t *arg1 = (switch_cache_db_database_interface_options_t *) 0 ;
char *result = 0 ;
arg1 = (switch_cache_db_database_interface_options_t *)jarg1;
result = (char *) ((arg1)->dsn);
result = (char *) ((arg1)->connection_string);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
@ -17409,28 +17368,6 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_connectio
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_connection_options_t_pgsql_options_set___(void * jarg1, void * jarg2) {
switch_cache_db_connection_options_t *arg1 = (switch_cache_db_connection_options_t *) 0 ;
switch_cache_db_pgsql_options_t *arg2 = (switch_cache_db_pgsql_options_t *) 0 ;
arg1 = (switch_cache_db_connection_options_t *)jarg1;
arg2 = (switch_cache_db_pgsql_options_t *)jarg2;
if (arg1) (arg1)->pgsql_options = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_connection_options_t_pgsql_options_get___(void * jarg1) {
void * jresult ;
switch_cache_db_connection_options_t *arg1 = (switch_cache_db_connection_options_t *) 0 ;
switch_cache_db_pgsql_options_t *result = 0 ;
arg1 = (switch_cache_db_connection_options_t *)jarg1;
result = (switch_cache_db_pgsql_options_t *)& ((arg1)->pgsql_options);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_connection_options_t_database_interface_options_set___(void * jarg1, void * jarg2) {
switch_cache_db_connection_options_t *arg1 = (switch_cache_db_connection_options_t *) 0 ;
switch_cache_db_database_interface_options_t *arg2 = (switch_cache_db_database_interface_options_t *) 0 ;
@ -17817,6 +17754,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_check_core_db_ds
}
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_database_available___(char * jarg1) {
int jresult ;
char *arg1 = (char *) 0 ;
switch_status_t result;
arg1 = (char *)jarg1;
result = (switch_status_t)switch_database_available(arg1);
jresult = (int)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_set_signal_handlers___() {
switch_core_set_signal_handlers();
}
@ -31979,10 +31928,10 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_database_in
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_database_interface_handle_new_set___(void * jarg1, void * jarg2) {
switch_database_interface *arg1 = (switch_database_interface *) 0 ;
switch_status_t (*arg2)(char *,switch_database_interface_handle_t **) = (switch_status_t (*)(char *,switch_database_interface_handle_t **)) 0 ;
switch_status_t (*arg2)(switch_cache_db_database_interface_options_t,switch_database_interface_handle_t **) = (switch_status_t (*)(switch_cache_db_database_interface_options_t,switch_database_interface_handle_t **)) 0 ;
arg1 = (switch_database_interface *)jarg1;
arg2 = (switch_status_t (*)(char *,switch_database_interface_handle_t **))jarg2;
arg2 = (switch_status_t (*)(switch_cache_db_database_interface_options_t,switch_database_interface_handle_t **))jarg2;
if (arg1) (arg1)->handle_new = arg2;
}
@ -31990,10 +31939,10 @@ SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_database_interface_h
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_database_interface_handle_new_get___(void * jarg1) {
void * jresult ;
switch_database_interface *arg1 = (switch_database_interface *) 0 ;
switch_status_t (*result)(char *,switch_database_interface_handle_t **) = 0 ;
switch_status_t (*result)(switch_cache_db_database_interface_options_t,switch_database_interface_handle_t **) = 0 ;
arg1 = (switch_database_interface *)jarg1;
result = (switch_status_t (*)(char *,switch_database_interface_handle_t **)) ((arg1)->handle_new);
result = (switch_status_t (*)(switch_cache_db_database_interface_options_t,switch_database_interface_handle_t **)) ((arg1)->handle_new);
jresult = (void *)result;
return jresult;
}
@ -39404,31 +39353,53 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_event_channel_broadca
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_event_channel_unbind___(char * jarg1, void * jarg2) {
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_event_channel_deliver___(char * jarg1, void * jarg2, char * jarg3, unsigned long jarg4) {
int jresult ;
char *arg1 = (char *) 0 ;
cJSON **arg2 = (cJSON **) 0 ;
char *arg3 = (char *) 0 ;
switch_event_channel_id_t arg4 ;
switch_status_t result;
arg1 = (char *)jarg1;
arg2 = (cJSON **)jarg2;
arg3 = (char *)jarg3;
arg4 = (switch_event_channel_id_t)jarg4;
result = (switch_status_t)switch_event_channel_deliver((char const *)arg1,arg2,(char const *)arg3,arg4);
jresult = (int)result;
return jresult;
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_event_channel_unbind___(char * jarg1, void * jarg2, void * jarg3) {
unsigned long jresult ;
char *arg1 = (char *) 0 ;
switch_event_channel_func_t arg2 = (switch_event_channel_func_t) 0 ;
void *arg3 = (void *) 0 ;
uint32_t result;
arg1 = (char *)jarg1;
arg2 = (switch_event_channel_func_t)jarg2;
result = (uint32_t)switch_event_channel_unbind((char const *)arg1,arg2);
arg3 = (void *)jarg3;
result = (uint32_t)switch_event_channel_unbind((char const *)arg1,arg2,arg3);
jresult = (unsigned long)result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_event_channel_bind___(char * jarg1, void * jarg2, void * jarg3) {
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_event_channel_bind___(char * jarg1, void * jarg2, void * jarg3, void * jarg4) {
int jresult ;
char *arg1 = (char *) 0 ;
switch_event_channel_func_t arg2 = (switch_event_channel_func_t) 0 ;
switch_event_channel_id_t *arg3 = (switch_event_channel_id_t *) 0 ;
void *arg4 = (void *) 0 ;
switch_status_t result;
arg1 = (char *)jarg1;
arg2 = (switch_event_channel_func_t)jarg2;
arg3 = (switch_event_channel_id_t *)jarg3;
result = (switch_status_t)switch_event_channel_bind((char const *)arg1,arg2,arg3);
arg4 = (void *)jarg4;
result = (switch_status_t)switch_event_channel_bind((char const *)arg1,arg2,arg3,arg4);
jresult = (int)result;
return jresult;
}
@ -43260,6 +43231,34 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_create___
}
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_create_json_obj___(void * jarg1, void * jarg2) {
int jresult ;
switch_dial_handle_t **arg1 = (switch_dial_handle_t **) 0 ;
cJSON *arg2 = (cJSON *) 0 ;
switch_status_t result;
arg1 = (switch_dial_handle_t **)jarg1;
arg2 = (cJSON *)jarg2;
result = (switch_status_t)switch_dial_handle_create_json_obj(arg1,arg2);
jresult = (int)result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_create_json___(void * jarg1, char * jarg2) {
int jresult ;
switch_dial_handle_t **arg1 = (switch_dial_handle_t **) 0 ;
char *arg2 = (char *) 0 ;
switch_status_t result;
arg1 = (switch_dial_handle_t **)jarg1;
arg2 = (char *)jarg2;
result = (switch_status_t)switch_dial_handle_create_json(arg1,(char const *)arg2);
jresult = (int)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_destroy___(void * jarg1) {
switch_dial_handle_t **arg1 = (switch_dial_handle_t **) 0 ;
@ -43268,6 +43267,34 @@ SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_destroy_
}
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_serialize_json_obj___(void * jarg1, void * jarg2) {
int jresult ;
switch_dial_handle_t *arg1 = (switch_dial_handle_t *) 0 ;
cJSON **arg2 = (cJSON **) 0 ;
switch_status_t result;
arg1 = (switch_dial_handle_t *)jarg1;
arg2 = (cJSON **)jarg2;
result = (switch_status_t)switch_dial_handle_serialize_json_obj(arg1,arg2);
jresult = (int)result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_serialize_json___(void * jarg1, void * jarg2) {
int jresult ;
switch_dial_handle_t *arg1 = (switch_dial_handle_t *) 0 ;
char **arg2 = (char **) 0 ;
switch_status_t result;
arg1 = (switch_dial_handle_t *)jarg1;
arg2 = (char **)jarg2;
result = (switch_status_t)switch_dial_handle_serialize_json(arg1,arg2);
jresult = (int)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_add_leg_list___(void * jarg1, void * jarg2) {
switch_dial_handle_t *arg1 = (switch_dial_handle_t *) 0 ;
switch_dial_leg_list_t **arg2 = (switch_dial_leg_list_t **) 0 ;
@ -45864,6 +45891,433 @@ SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_delete_switch_log_node_t___
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_item_t_name_set___(void * jarg1, char * jarg2) {
switch_log_json_format_item_t *arg1 = (switch_log_json_format_item_t *) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (switch_log_json_format_item_t *)jarg1;
arg2 = (char *)jarg2;
{
if (arg2) {
arg1->name = (char const *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->name, (const char *)arg2);
} else {
arg1->name = 0;
}
}
}
SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_item_t_name_get___(void * jarg1) {
char * jresult ;
switch_log_json_format_item_t *arg1 = (switch_log_json_format_item_t *) 0 ;
char *result = 0 ;
arg1 = (switch_log_json_format_item_t *)jarg1;
result = (char *) ((arg1)->name);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_item_t_value_set___(void * jarg1, char * jarg2) {
switch_log_json_format_item_t *arg1 = (switch_log_json_format_item_t *) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (switch_log_json_format_item_t *)jarg1;
arg2 = (char *)jarg2;
{
if (arg2) {
arg1->value = (char const *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->value, (const char *)arg2);
} else {
arg1->value = 0;
}
}
}
SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_item_t_value_get___(void * jarg1) {
char * jresult ;
switch_log_json_format_item_t *arg1 = (switch_log_json_format_item_t *) 0 ;
char *result = 0 ;
arg1 = (switch_log_json_format_item_t *)jarg1;
result = (char *) ((arg1)->value);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_new_switch_log_json_format_item_t___() {
void * jresult ;
switch_log_json_format_item_t *result = 0 ;
result = (switch_log_json_format_item_t *)new switch_log_json_format_item_t();
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_delete_switch_log_json_format_item_t___(void * jarg1) {
switch_log_json_format_item_t *arg1 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_item_t *)jarg1;
delete arg1;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_version_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->version = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_version_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->version);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_host_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->host = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_host_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->host);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_timestamp_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->timestamp = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_timestamp_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->timestamp);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_level_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->level = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_level_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->level);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_ident_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->ident = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_ident_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->ident);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_pid_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->pid = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_pid_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->pid);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_uuid_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->uuid = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_uuid_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->uuid);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_file_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->file = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_file_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->file);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_line_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->line = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_line_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->line);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_function_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->function = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_function_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->function);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_full_message_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->full_message = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_full_message_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->full_message);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_short_message_set___(void * jarg1, void * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *arg2 = (switch_log_json_format_item_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (switch_log_json_format_item_t *)jarg2;
if (arg1) (arg1)->short_message = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_short_message_get___(void * jarg1) {
void * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
switch_log_json_format_item_t *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (switch_log_json_format_item_t *)& ((arg1)->short_message);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_custom_field_prefix_set___(void * jarg1, char * jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (char *)jarg2;
{
if (arg2) {
arg1->custom_field_prefix = (char const *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->custom_field_prefix, (const char *)arg2);
} else {
arg1->custom_field_prefix = 0;
}
}
}
SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_custom_field_prefix_get___(void * jarg1) {
char * jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
char *result = 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
result = (char *) ((arg1)->custom_field_prefix);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_timestamp_divisor_set___(void * jarg1, double jarg2) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
double arg2 ;
arg1 = (switch_log_json_format_t *)jarg1;
arg2 = (double)jarg2;
if (arg1) (arg1)->timestamp_divisor = arg2;
}
SWIGEXPORT double SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_json_format_t_timestamp_divisor_get___(void * jarg1) {
double jresult ;
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
double result;
arg1 = (switch_log_json_format_t *)jarg1;
result = (double) ((arg1)->timestamp_divisor);
jresult = result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_new_switch_log_json_format_t___() {
void * jresult ;
switch_log_json_format_t *result = 0 ;
result = (switch_log_json_format_t *)new switch_log_json_format_t();
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_delete_switch_log_json_format_t___(void * jarg1) {
switch_log_json_format_t *arg1 = (switch_log_json_format_t *) 0 ;
arg1 = (switch_log_json_format_t *)jarg1;
delete arg1;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_node_to_json___(void * jarg1, int jarg2, void * jarg3, void * jarg4) {
void * jresult ;
switch_log_node_t *arg1 = (switch_log_node_t *) 0 ;
int arg2 ;
switch_log_json_format_t *arg3 = (switch_log_json_format_t *) 0 ;
switch_event_t *arg4 = (switch_event_t *) 0 ;
cJSON *result = 0 ;
arg1 = (switch_log_node_t *)jarg1;
arg2 = (int)jarg2;
arg3 = (switch_log_json_format_t *)jarg3;
arg4 = (switch_event_t *)jarg4;
result = (cJSON *)switch_log_node_to_json((switch_log_node_t const *)arg1,arg2,arg3,arg4);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_log_init___(void * jarg1, int jarg2) {
int jresult ;
switch_memory_pool_t *arg1 = (switch_memory_pool_t *) 0 ;

View File

@ -51,7 +51,7 @@
<ItemGroup>
<ProjectReference Include="..\..\FreeSWITCH.Managed.2017.csproj">
<Project>{834e2b2f-5483-4b80-8fe3-fe48ff76e5c0}</Project>
<Name>FreeSWITCH.Managed.2015</Name>
<Name>FreeSWITCH.Managed.2017</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@ -1083,35 +1083,6 @@ public class SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_s
namespace FreeSWITCH.Native {
public class SWIGTYPE_p_f_p_char_p_p_switch_database_interface_handle__switch_status_t {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
internal SWIGTYPE_p_f_p_char_p_p_switch_database_interface_handle__switch_status_t(global::System.IntPtr cPtr, bool futureUse) {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
protected SWIGTYPE_p_f_p_char_p_p_switch_database_interface_handle__switch_status_t() {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_f_p_char_p_p_switch_database_interface_handle__switch_status_t obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
}
}
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.10
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace FreeSWITCH.Native {
public class SWIGTYPE_p_f_p_p_switch_database_interface_handle__switch_status_t {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
@ -1199,18 +1170,18 @@ public class SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__swit
namespace FreeSWITCH.Native {
public class SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void {
public class SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_p_void__void {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
internal SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void(global::System.IntPtr cPtr, bool futureUse) {
internal SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_p_void__void(global::System.IntPtr cPtr, bool futureUse) {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
protected SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void() {
protected SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_p_void__void() {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void obj) {
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_p_void__void obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
}
@ -4041,6 +4012,35 @@ public class SWIGTYPE_p_f_p_void_p_switch_event__int {
namespace FreeSWITCH.Native {
public class SWIGTYPE_p_f_switch_cache_db_database_interface_options_t_p_p_switch_database_interface_handle__switch_status_t {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
internal SWIGTYPE_p_f_switch_cache_db_database_interface_options_t_p_p_switch_database_interface_handle__switch_status_t(global::System.IntPtr cPtr, bool futureUse) {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
protected SWIGTYPE_p_f_switch_cache_db_database_interface_options_t_p_p_switch_database_interface_handle__switch_status_t() {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_f_switch_cache_db_database_interface_options_t_p_p_switch_database_interface_handle__switch_status_t obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
}
}
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.10
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace FreeSWITCH.Native {
public class SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
@ -6767,35 +6767,6 @@ public class SWIGTYPE_p_switch_odbc_handle {
namespace FreeSWITCH.Native {
public class SWIGTYPE_p_switch_pgsql_handle {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
internal SWIGTYPE_p_switch_pgsql_handle(global::System.IntPtr cPtr, bool futureUse) {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
protected SWIGTYPE_p_switch_pgsql_handle() {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_switch_pgsql_handle obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
}
}
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.10
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace FreeSWITCH.Native {
public class SWIGTYPE_p_switch_pollfd_t {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
@ -9961,6 +9932,11 @@ else
return ret;
}
public static switch_status_t switch_database_available(string dsn) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_database_available(dsn);
return ret;
}
public static void switch_core_set_signal_handlers() {
freeswitchPINVOKE.switch_core_set_signal_handlers();
}
@ -12536,13 +12512,18 @@ else
return ret;
}
public static uint switch_event_channel_unbind(string event_channel, SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void func) {
uint ret = freeswitchPINVOKE.switch_event_channel_unbind(event_channel, SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void.getCPtr(func));
public static switch_status_t switch_event_channel_deliver(string event_channel, SWIGTYPE_p_p_cJSON json, string key, uint id) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_channel_deliver(event_channel, SWIGTYPE_p_p_cJSON.getCPtr(json), key, id);
return ret;
}
public static switch_status_t switch_event_channel_bind(string event_channel, SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void func, SWIGTYPE_p_unsigned_long id) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_channel_bind(event_channel, SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void.getCPtr(func), SWIGTYPE_p_unsigned_long.getCPtr(id));
public static uint switch_event_channel_unbind(string event_channel, SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_p_void__void func, SWIGTYPE_p_void user_data) {
uint ret = freeswitchPINVOKE.switch_event_channel_unbind(event_channel, SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_p_void__void.getCPtr(func), SWIGTYPE_p_void.getCPtr(user_data));
return ret;
}
public static switch_status_t switch_event_channel_bind(string event_channel, SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_p_void__void func, SWIGTYPE_p_unsigned_long id, SWIGTYPE_p_void user_data) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_channel_bind(event_channel, SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_p_void__void.getCPtr(func), SWIGTYPE_p_unsigned_long.getCPtr(id), SWIGTYPE_p_void.getCPtr(user_data));
return ret;
}
@ -13526,10 +13507,30 @@ else
return ret;
}
public static switch_status_t switch_dial_handle_create_json_obj(SWIGTYPE_p_p_switch_dial_handle_s handle, SWIGTYPE_p_cJSON json) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_dial_handle_create_json_obj(SWIGTYPE_p_p_switch_dial_handle_s.getCPtr(handle), SWIGTYPE_p_cJSON.getCPtr(json));
return ret;
}
public static switch_status_t switch_dial_handle_create_json(SWIGTYPE_p_p_switch_dial_handle_s handle, string handle_string) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_dial_handle_create_json(SWIGTYPE_p_p_switch_dial_handle_s.getCPtr(handle), handle_string);
return ret;
}
public static void switch_dial_handle_destroy(SWIGTYPE_p_p_switch_dial_handle_s handle) {
freeswitchPINVOKE.switch_dial_handle_destroy(SWIGTYPE_p_p_switch_dial_handle_s.getCPtr(handle));
}
public static switch_status_t switch_dial_handle_serialize_json_obj(SWIGTYPE_p_switch_dial_handle_s handle, SWIGTYPE_p_p_cJSON json) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_dial_handle_serialize_json_obj(SWIGTYPE_p_switch_dial_handle_s.getCPtr(handle), SWIGTYPE_p_p_cJSON.getCPtr(json));
return ret;
}
public static switch_status_t switch_dial_handle_serialize_json(SWIGTYPE_p_switch_dial_handle_s handle, ref string str) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_dial_handle_serialize_json(SWIGTYPE_p_switch_dial_handle_s.getCPtr(handle), ref str);
return ret;
}
public static void switch_dial_handle_add_leg_list(SWIGTYPE_p_switch_dial_handle_s handle, SWIGTYPE_p_p_switch_dial_leg_list_s leg_listP) {
freeswitchPINVOKE.switch_dial_handle_add_leg_list(SWIGTYPE_p_switch_dial_handle_s.getCPtr(handle), SWIGTYPE_p_p_switch_dial_leg_list_s.getCPtr(leg_listP));
}
@ -14021,6 +14022,12 @@ else
freeswitchPINVOKE.switch_rtp_video_loss(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session));
}
public static SWIGTYPE_p_cJSON switch_log_node_to_json(switch_log_node_t node, int log_level, switch_log_json_format_t json_format, switch_event chan_vars) {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_node_to_json(switch_log_node_t.getCPtr(node), log_level, switch_log_json_format_t.getCPtr(json_format), switch_event.getCPtr(chan_vars));
SWIGTYPE_p_cJSON ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_cJSON(cPtr, false);
return ret;
}
public static switch_status_t switch_log_init(SWIGTYPE_p_apr_pool_t pool, switch_bool_t colorize) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_log_init(SWIGTYPE_p_apr_pool_t.getCPtr(pool), (int)colorize);
return ret;
@ -19290,12 +19297,6 @@ class freeswitchPINVOKE {
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_native_handle_t_odbc_dbh_get___")]
public static extern global::System.IntPtr switch_cache_db_native_handle_t_odbc_dbh_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_native_handle_t_pgsql_dbh_set___")]
public static extern void switch_cache_db_native_handle_t_pgsql_dbh_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_native_handle_t_pgsql_dbh_get___")]
public static extern global::System.IntPtr switch_cache_db_native_handle_t_pgsql_dbh_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_native_handle_t_database_interface_dbh_set___")]
public static extern void switch_cache_db_native_handle_t_database_interface_dbh_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
@ -19344,23 +19345,17 @@ class freeswitchPINVOKE {
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_delete_switch_cache_db_odbc_options_t___")]
public static extern void delete_switch_cache_db_odbc_options_t(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_pgsql_options_t_dsn_set___")]
public static extern void switch_cache_db_pgsql_options_t_dsn_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_original_dsn_set___")]
public static extern void switch_cache_db_database_interface_options_t_original_dsn_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_pgsql_options_t_dsn_get___")]
public static extern string switch_cache_db_pgsql_options_t_dsn_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_original_dsn_get___")]
public static extern string switch_cache_db_database_interface_options_t_original_dsn_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_new_switch_cache_db_pgsql_options_t___")]
public static extern global::System.IntPtr new_switch_cache_db_pgsql_options_t();
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_connection_string_set___")]
public static extern void switch_cache_db_database_interface_options_t_connection_string_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_delete_switch_cache_db_pgsql_options_t___")]
public static extern void delete_switch_cache_db_pgsql_options_t(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_dsn_set___")]
public static extern void switch_cache_db_database_interface_options_t_dsn_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_dsn_get___")]
public static extern string switch_cache_db_database_interface_options_t_dsn_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_connection_string_get___")]
public static extern string switch_cache_db_database_interface_options_t_connection_string_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_database_interface_options_t_prefix_set___")]
public static extern void switch_cache_db_database_interface_options_t_prefix_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
@ -19398,12 +19393,6 @@ class freeswitchPINVOKE {
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_connection_options_t_odbc_options_get___")]
public static extern global::System.IntPtr switch_cache_db_connection_options_t_odbc_options_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_connection_options_t_pgsql_options_set___")]
public static extern void switch_cache_db_connection_options_t_pgsql_options_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_connection_options_t_pgsql_options_get___")]
public static extern global::System.IntPtr switch_cache_db_connection_options_t_pgsql_options_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_connection_options_t_database_interface_options_set___")]
public static extern void switch_cache_db_connection_options_t_database_interface_options_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
@ -19482,6 +19471,9 @@ class freeswitchPINVOKE {
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_check_core_db_dsn___")]
public static extern int switch_core_check_core_db_dsn();
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_database_available___")]
public static extern int switch_database_available(string jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_set_signal_handlers___")]
public static extern void switch_core_set_signal_handlers();
@ -24747,11 +24739,14 @@ class freeswitchPINVOKE {
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_event_channel_broadcast___")]
public static extern int switch_event_channel_broadcast(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, string jarg3, uint jarg4);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_event_channel_deliver___")]
public static extern int switch_event_channel_deliver(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, string jarg3, uint jarg4);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_event_channel_unbind___")]
public static extern uint switch_event_channel_unbind(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
public static extern uint switch_event_channel_unbind(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_event_channel_bind___")]
public static extern int switch_event_channel_bind(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
public static extern int switch_event_channel_bind(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_NO_EVENT_CHANNEL_ID_get___")]
public static extern int NO_EVENT_CHANNEL_ID_get();
@ -25527,9 +25522,21 @@ class freeswitchPINVOKE {
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_handle_create___")]
public static extern int switch_dial_handle_create(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_handle_create_json_obj___")]
public static extern int switch_dial_handle_create_json_obj(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_handle_create_json___")]
public static extern int switch_dial_handle_create_json(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_handle_destroy___")]
public static extern void switch_dial_handle_destroy(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_handle_serialize_json_obj___")]
public static extern int switch_dial_handle_serialize_json_obj(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_handle_serialize_json___")]
public static extern int switch_dial_handle_serialize_json(global::System.Runtime.InteropServices.HandleRef jarg1, ref string jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_handle_add_leg_list___")]
public static extern void switch_dial_handle_add_leg_list(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
@ -26130,6 +26137,117 @@ class freeswitchPINVOKE {
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_delete_switch_log_node_t___")]
public static extern void delete_switch_log_node_t(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_item_t_name_set___")]
public static extern void switch_log_json_format_item_t_name_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_item_t_name_get___")]
public static extern string switch_log_json_format_item_t_name_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_item_t_value_set___")]
public static extern void switch_log_json_format_item_t_value_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_item_t_value_get___")]
public static extern string switch_log_json_format_item_t_value_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_new_switch_log_json_format_item_t___")]
public static extern global::System.IntPtr new_switch_log_json_format_item_t();
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_delete_switch_log_json_format_item_t___")]
public static extern void delete_switch_log_json_format_item_t(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_version_set___")]
public static extern void switch_log_json_format_t_version_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_version_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_version_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_host_set___")]
public static extern void switch_log_json_format_t_host_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_host_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_host_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_timestamp_set___")]
public static extern void switch_log_json_format_t_timestamp_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_timestamp_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_timestamp_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_level_set___")]
public static extern void switch_log_json_format_t_level_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_level_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_level_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_ident_set___")]
public static extern void switch_log_json_format_t_ident_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_ident_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_ident_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_pid_set___")]
public static extern void switch_log_json_format_t_pid_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_pid_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_pid_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_uuid_set___")]
public static extern void switch_log_json_format_t_uuid_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_uuid_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_uuid_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_file_set___")]
public static extern void switch_log_json_format_t_file_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_file_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_file_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_line_set___")]
public static extern void switch_log_json_format_t_line_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_line_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_line_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_function_set___")]
public static extern void switch_log_json_format_t_function_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_function_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_function_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_full_message_set___")]
public static extern void switch_log_json_format_t_full_message_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_full_message_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_full_message_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_short_message_set___")]
public static extern void switch_log_json_format_t_short_message_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_short_message_get___")]
public static extern global::System.IntPtr switch_log_json_format_t_short_message_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_custom_field_prefix_set___")]
public static extern void switch_log_json_format_t_custom_field_prefix_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_custom_field_prefix_get___")]
public static extern string switch_log_json_format_t_custom_field_prefix_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_timestamp_divisor_set___")]
public static extern void switch_log_json_format_t_timestamp_divisor_set(global::System.Runtime.InteropServices.HandleRef jarg1, double jarg2);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_json_format_t_timestamp_divisor_get___")]
public static extern double switch_log_json_format_t_timestamp_divisor_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_new_switch_log_json_format_t___")]
public static extern global::System.IntPtr new_switch_log_json_format_t();
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_delete_switch_log_json_format_t___")]
public static extern void delete_switch_log_json_format_t(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_node_to_json___")]
public static extern global::System.IntPtr switch_log_node_to_json(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4);
[global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_log_init___")]
public static extern int switch_log_init(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
@ -29938,17 +30056,6 @@ public class switch_cache_db_connection_options_t : global::System.IDisposable {
}
}
public switch_cache_db_pgsql_options_t pgsql_options {
set {
freeswitchPINVOKE.switch_cache_db_connection_options_t_pgsql_options_set(swigCPtr, switch_cache_db_pgsql_options_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_connection_options_t_pgsql_options_get(swigCPtr);
switch_cache_db_pgsql_options_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_cache_db_pgsql_options_t(cPtr, false);
return ret;
}
}
public switch_cache_db_database_interface_options_t database_interface_options {
set {
freeswitchPINVOKE.switch_cache_db_connection_options_t_database_interface_options_set(swigCPtr, switch_cache_db_database_interface_options_t.getCPtr(value));
@ -30066,12 +30173,22 @@ public class switch_cache_db_database_interface_options_t : global::System.IDisp
}
}
public string dsn {
public string original_dsn {
set {
freeswitchPINVOKE.switch_cache_db_database_interface_options_t_dsn_set(swigCPtr, value);
freeswitchPINVOKE.switch_cache_db_database_interface_options_t_original_dsn_set(swigCPtr, value);
}
get {
string ret = freeswitchPINVOKE.switch_cache_db_database_interface_options_t_dsn_get(swigCPtr);
string ret = freeswitchPINVOKE.switch_cache_db_database_interface_options_t_original_dsn_get(swigCPtr);
return ret;
}
}
public string connection_string {
set {
freeswitchPINVOKE.switch_cache_db_database_interface_options_t_connection_string_set(swigCPtr, value);
}
get {
string ret = freeswitchPINVOKE.switch_cache_db_database_interface_options_t_connection_string_get(swigCPtr);
return ret;
}
}
@ -30128,7 +30245,6 @@ namespace FreeSWITCH.Native {
public enum switch_cache_db_handle_type_t {
SCDB_TYPE_CORE_DB,
SCDB_TYPE_ODBC,
SCDB_TYPE_PGSQL,
SCDB_TYPE_DATABASE_INTERFACE
}
@ -30197,17 +30313,6 @@ public class switch_cache_db_native_handle_t : global::System.IDisposable {
}
}
public SWIGTYPE_p_switch_pgsql_handle pgsql_dbh {
set {
freeswitchPINVOKE.switch_cache_db_native_handle_t_pgsql_dbh_set(swigCPtr, SWIGTYPE_p_switch_pgsql_handle.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_native_handle_t_pgsql_dbh_get(swigCPtr);
SWIGTYPE_p_switch_pgsql_handle ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_switch_pgsql_handle(cPtr, false);
return ret;
}
}
public switch_database_interface_handle database_interface_dbh {
set {
freeswitchPINVOKE.switch_cache_db_native_handle_t_database_interface_dbh_set(swigCPtr, switch_database_interface_handle.getCPtr(value));
@ -30315,64 +30420,6 @@ public class switch_cache_db_odbc_options_t : global::System.IDisposable {
namespace FreeSWITCH.Native {
public class switch_cache_db_pgsql_options_t : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
internal switch_cache_db_pgsql_options_t(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(switch_cache_db_pgsql_options_t obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~switch_cache_db_pgsql_options_t() {
Dispose();
}
public virtual void Dispose() {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
freeswitchPINVOKE.delete_switch_cache_db_pgsql_options_t(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
global::System.GC.SuppressFinalize(this);
}
}
public string dsn {
set {
freeswitchPINVOKE.switch_cache_db_pgsql_options_t_dsn_set(swigCPtr, value);
}
get {
string ret = freeswitchPINVOKE.switch_cache_db_pgsql_options_t_dsn_get(swigCPtr);
return ret;
}
}
public switch_cache_db_pgsql_options_t() : this(freeswitchPINVOKE.new_switch_cache_db_pgsql_options_t(), true) {
}
}
}
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.10
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace FreeSWITCH.Native {
public enum switch_call_cause_t {
SWITCH_CAUSE_NONE = 0,
SWITCH_CAUSE_UNALLOCATED_NUMBER = 1,
@ -34036,13 +34083,13 @@ public class switch_database_interface : global::System.IDisposable {
}
}
public SWIGTYPE_p_f_p_char_p_p_switch_database_interface_handle__switch_status_t handle_new {
public SWIGTYPE_p_f_switch_cache_db_database_interface_options_t_p_p_switch_database_interface_handle__switch_status_t handle_new {
set {
freeswitchPINVOKE.switch_database_interface_handle_new_set(swigCPtr, SWIGTYPE_p_f_p_char_p_p_switch_database_interface_handle__switch_status_t.getCPtr(value));
freeswitchPINVOKE.switch_database_interface_handle_new_set(swigCPtr, SWIGTYPE_p_f_switch_cache_db_database_interface_options_t_p_p_switch_database_interface_handle__switch_status_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_database_interface_handle_new_get(swigCPtr);
SWIGTYPE_p_f_p_char_p_p_switch_database_interface_handle__switch_status_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_char_p_p_switch_database_interface_handle__switch_status_t(cPtr, false);
SWIGTYPE_p_f_switch_cache_db_database_interface_options_t_p_p_switch_database_interface_handle__switch_status_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_switch_cache_db_database_interface_options_t_p_p_switch_database_interface_handle__switch_status_t(cPtr, false);
return ret;
}
}
@ -35832,7 +35879,9 @@ namespace FreeSWITCH.Native {
ED_DTMF = (1 << 2),
ED_COPY_DISPLAY = (1 << 3),
ED_BRIDGE_READ = (1 << 4),
ED_BRIDGE_WRITE = (1 << 5)
ED_BRIDGE_WRITE = (1 << 5),
ED_TAP_READ = (1 << 6),
ED_TAP_WRITE = (1 << 7)
}
}
@ -40816,6 +40865,274 @@ public enum switch_loadable_module_type_t {
namespace FreeSWITCH.Native {
public class switch_log_json_format_item_t : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
internal switch_log_json_format_item_t(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(switch_log_json_format_item_t obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~switch_log_json_format_item_t() {
Dispose();
}
public virtual void Dispose() {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
freeswitchPINVOKE.delete_switch_log_json_format_item_t(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
global::System.GC.SuppressFinalize(this);
}
}
public string name {
set {
freeswitchPINVOKE.switch_log_json_format_item_t_name_set(swigCPtr, value);
}
get {
string ret = freeswitchPINVOKE.switch_log_json_format_item_t_name_get(swigCPtr);
return ret;
}
}
public string value {
set {
freeswitchPINVOKE.switch_log_json_format_item_t_value_set(swigCPtr, value);
}
get {
string ret = freeswitchPINVOKE.switch_log_json_format_item_t_value_get(swigCPtr);
return ret;
}
}
public switch_log_json_format_item_t() : this(freeswitchPINVOKE.new_switch_log_json_format_item_t(), true) {
}
}
}
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.10
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace FreeSWITCH.Native {
public class switch_log_json_format_t : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
internal switch_log_json_format_t(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(switch_log_json_format_t obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~switch_log_json_format_t() {
Dispose();
}
public virtual void Dispose() {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
freeswitchPINVOKE.delete_switch_log_json_format_t(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
global::System.GC.SuppressFinalize(this);
}
}
public switch_log_json_format_item_t version {
set {
freeswitchPINVOKE.switch_log_json_format_t_version_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_version_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t host {
set {
freeswitchPINVOKE.switch_log_json_format_t_host_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_host_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t timestamp {
set {
freeswitchPINVOKE.switch_log_json_format_t_timestamp_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_timestamp_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t level {
set {
freeswitchPINVOKE.switch_log_json_format_t_level_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_level_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t ident {
set {
freeswitchPINVOKE.switch_log_json_format_t_ident_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_ident_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t pid {
set {
freeswitchPINVOKE.switch_log_json_format_t_pid_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_pid_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t uuid {
set {
freeswitchPINVOKE.switch_log_json_format_t_uuid_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_uuid_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t file {
set {
freeswitchPINVOKE.switch_log_json_format_t_file_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_file_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t line {
set {
freeswitchPINVOKE.switch_log_json_format_t_line_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_line_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t function {
set {
freeswitchPINVOKE.switch_log_json_format_t_function_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_function_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t full_message {
set {
freeswitchPINVOKE.switch_log_json_format_t_full_message_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_full_message_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public switch_log_json_format_item_t short_message {
set {
freeswitchPINVOKE.switch_log_json_format_t_short_message_set(swigCPtr, switch_log_json_format_item_t.getCPtr(value));
}
get {
global::System.IntPtr cPtr = freeswitchPINVOKE.switch_log_json_format_t_short_message_get(swigCPtr);
switch_log_json_format_item_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_log_json_format_item_t(cPtr, false);
return ret;
}
}
public string custom_field_prefix {
set {
freeswitchPINVOKE.switch_log_json_format_t_custom_field_prefix_set(swigCPtr, value);
}
get {
string ret = freeswitchPINVOKE.switch_log_json_format_t_custom_field_prefix_get(swigCPtr);
return ret;
}
}
public double timestamp_divisor {
set {
freeswitchPINVOKE.switch_log_json_format_t_timestamp_divisor_set(swigCPtr, value);
}
get {
double ret = freeswitchPINVOKE.switch_log_json_format_t_timestamp_divisor_get(swigCPtr);
return ret;
}
}
public switch_log_json_format_t() : this(freeswitchPINVOKE.new_switch_log_json_format_t(), true) {
}
}
}
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.10
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace FreeSWITCH.Native {
public enum switch_log_level_t {
SWITCH_LOG_DEBUG10 = 110,
SWITCH_LOG_DEBUG9 = 109,

View File

@ -188,7 +188,7 @@ static switch_cache_db_handle_t *get_handle(const char *db_str, const char *user
if (!r) {
for (dbh_ptr = sql_manager.handle_pool; dbh_ptr; dbh_ptr = dbh_ptr->next) {
if (dbh_ptr->hash == hash && ((dbh_ptr->type != SCDB_TYPE_PGSQL && dbh_ptr->type != SCDB_TYPE_DATABASE_INTERFACE) || !dbh_ptr->use_count) && !switch_test_flag(dbh_ptr, CDF_PRUNE) &&
if (dbh_ptr->hash == hash && (dbh_ptr->type != SCDB_TYPE_DATABASE_INTERFACE || !dbh_ptr->use_count) && !switch_test_flag(dbh_ptr, CDF_PRUNE) &&
switch_mutex_trylock(dbh_ptr->mutex) == SWITCH_STATUS_SUCCESS) {
r = dbh_ptr;
break;
@ -273,11 +273,6 @@ static void sql_close(time_t prune)
database_interface->handle_destroy(&dbh->native_handle.database_interface_dbh);
}
break;
case SCDB_TYPE_PGSQL:
{
switch_pgsql_handle_destroy(&dbh->native_handle.pgsql_dbh);
}
break;
case SCDB_TYPE_ODBC:
{
switch_odbc_handle_destroy(&dbh->native_handle.odbc_dbh);
@ -344,11 +339,6 @@ SWITCH_DECLARE(void) switch_cache_db_release_db_handle(switch_cache_db_handle_t
database_interface->flush((*dbh)->native_handle.database_interface_dbh);
}
break;
case SCDB_TYPE_PGSQL:
{
switch_pgsql_flush((*dbh)->native_handle.pgsql_dbh);
}
break;
default:
break;
}
@ -380,19 +370,20 @@ SWITCH_DECLARE(void) switch_cache_db_dismiss_db_handle(switch_cache_db_handle_t
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
SWITCH_DECLARE(switch_status_t) switch_core_check_core_db_dsn(void)
SWITCH_DECLARE(switch_status_t) switch_database_available(char* dsn)
{
switch_status_t status = SWITCH_STATUS_FALSE;
switch_database_interface_t *database_interface;
if (!runtime.odbc_dsn) {
if (!dsn) {
status = SWITCH_STATUS_SUCCESS;
} else {
}
else {
char *colon_slashes = NULL;
if (NULL != (colon_slashes = strstr(runtime.odbc_dsn, "://")))
if (NULL != (colon_slashes = strstr(dsn, "://")))
{
char prefix[16] = "";
strncpy(prefix, runtime.odbc_dsn, MIN(colon_slashes - runtime.odbc_dsn, 15));
strncpy(prefix, dsn, MIN(colon_slashes - dsn, 15));
if (!strncasecmp(prefix, "odbc", 4)) {
if (switch_odbc_available()) status = SWITCH_STATUS_SUCCESS;
@ -400,15 +391,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_check_core_db_dsn(void)
else if (!strncasecmp(prefix, "sqlite", 6)) {
status = SWITCH_STATUS_SUCCESS;
}
else if (!strncasecmp(prefix, "pgsql", 5)) {
if (switch_pgsql_available()) status = SWITCH_STATUS_SUCCESS;
}
else if ((database_interface = switch_loadable_module_get_database_interface(prefix, NULL))) {
status = SWITCH_STATUS_SUCCESS;
UNPROTECT_INTERFACE(database_interface);
}
}
else if (strchr(runtime.odbc_dsn + 2, ':')) {
else if (strchr(dsn + 2, ':')) {
status = SWITCH_STATUS_SUCCESS;
}
}
@ -416,6 +404,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_check_core_db_dsn(void)
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_check_core_db_dsn(void)
{
return switch_database_available(runtime.odbc_dsn);
}
SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle_dsn(switch_cache_db_handle_t **dbh, const char *dsn,
const char *file, const char *func, int line)
{
@ -443,19 +436,16 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle_dsn_ex(switch_cac
type = SCDB_TYPE_DATABASE_INTERFACE;
connection_options.database_interface_options.make_module_no_unloadable = make_module_no_unloadable;
connection_options.database_interface_options.database_interface = database_interface;
connection_options.database_interface_options.dsn = colon_slashes + 3;
connection_options.database_interface_options.original_dsn = dsn;
connection_options.database_interface_options.connection_string = colon_slashes + 3;
strcpy(connection_options.database_interface_options.prefix, prefix);
UNPROTECT_INTERFACE(database_interface);
}
}
if (!connection_options.database_interface_options.dsn)
{
if (!strncasecmp(dsn, "pgsql://", 8)) {
type = SCDB_TYPE_PGSQL;
connection_options.pgsql_options.dsn = (char *)(dsn + 8);
}
else if (!strncasecmp(dsn, "sqlite://", 9)) {
if (!connection_options.database_interface_options.connection_string)
{
if (!strncasecmp(dsn, "sqlite://", 9)) {
type = SCDB_TYPE_CORE_DB;
connection_options.core_db_options.db_path = (char *)(dsn + 9);
}
@ -532,20 +522,12 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
switch (type) {
case SCDB_TYPE_DATABASE_INTERFACE:
{
db_name = connection_options->database_interface_options.dsn;
db_name = connection_options->database_interface_options.connection_string;
odbc_user = NULL;
odbc_pass = NULL;
db_type = "database_interface";
}
break;
case SCDB_TYPE_PGSQL:
{
db_name = connection_options->pgsql_options.dsn;
odbc_user = NULL;
odbc_pass = NULL;
db_type = "pgsql";
}
break;
case SCDB_TYPE_ODBC:
{
db_name = connection_options->odbc_options.dsn;
@ -587,7 +569,6 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
} else {
switch_core_db_t *db = NULL;
switch_odbc_handle_t *odbc_dbh = NULL;
switch_pgsql_handle_t *pgsql_dbh = NULL;
switch_database_interface_handle_t *database_interface_dbh = NULL;
switch (type) {
@ -595,8 +576,8 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
{
switch_database_interface_t *database_interface = connection_options->database_interface_options.database_interface;
if (SWITCH_STATUS_SUCCESS != database_interface->handle_new(connection_options->database_interface_options.dsn, &database_interface_dbh)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure! Can't create new handle! Can't connect to DSN %s\n", connection_options->database_interface_options.dsn);
if (SWITCH_STATUS_SUCCESS != database_interface->handle_new(connection_options->database_interface_options, &database_interface_dbh)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure! Can't create new handle! Can't connect to DSN %s\n", connection_options->database_interface_options.original_dsn);
goto end;
}
@ -612,20 +593,6 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
}
}
break;
case SCDB_TYPE_PGSQL:
{
if (!switch_pgsql_available()) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure! PGSQL NOT AVAILABLE! Can't connect to DSN %s\n", connection_options->pgsql_options.dsn);
goto end;
}
if ((pgsql_dbh = switch_pgsql_handle_new(connection_options->pgsql_options.dsn))) {
if (switch_pgsql_handle_connect(pgsql_dbh) != SWITCH_PGSQL_SUCCESS) {
switch_pgsql_handle_destroy(&pgsql_dbh);
}
}
}
break;
case SCDB_TYPE_ODBC:
{
if (!switch_odbc_available()) {
@ -651,7 +618,7 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
goto end;
}
if (!db && !odbc_dbh && !pgsql_dbh && !database_interface_dbh) {
if (!db && !odbc_dbh && !database_interface_dbh) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure to connect to %s %s!\n", switch_cache_db_type_name(type), db_name);
goto end;
}
@ -667,8 +634,6 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
new_dbh->native_handle.core_db_dbh = db;
} else if (odbc_dbh) {
new_dbh->native_handle.odbc_dbh = odbc_dbh;
} else {
new_dbh->native_handle.pgsql_dbh = pgsql_dbh;
}
add_handle(new_dbh, db_str, db_callsite_str, thread_str);
@ -708,12 +673,6 @@ static switch_status_t switch_cache_db_execute_sql_real(switch_cache_db_handle_t
status = database_interface_handle_exec(database_interface, dbh->native_handle.database_interface_dbh, sql, &errmsg);
}
break;
case SCDB_TYPE_PGSQL:
{
type = "PGSQL";
status = switch_pgsql_handle_exec(dbh->native_handle.pgsql_dbh, sql, &errmsg);
}
break;
case SCDB_TYPE_ODBC:
{
type = "ODBC";
@ -861,11 +820,6 @@ SWITCH_DECLARE(int) switch_cache_db_affected_rows(switch_cache_db_handle_t *dbh)
database_interface->affected_rows(dbh->native_handle.database_interface_dbh, &affected_rows);
}
break;
case SCDB_TYPE_PGSQL:
{
return switch_pgsql_handle_affected_rows(dbh->native_handle.pgsql_dbh);
}
break;
}
return 0;
}
@ -889,11 +843,6 @@ SWITCH_DECLARE(int) switch_cache_db_load_extension(switch_cache_db_handle_t *dbh
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "load extension not supported by type DATABASE_INTERFACE!\n");
}
break;
case SCDB_TYPE_PGSQL:
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "load extension not supported by type PGSQL!\n");
}
break;
}
return 0;
}
@ -957,11 +906,6 @@ SWITCH_DECLARE(char *) switch_cache_db_execute_sql2str(switch_cache_db_handle_t
status = database_interface->exec_string(dbh->native_handle.database_interface_dbh, sql, str, len, err);
}
break;
case SCDB_TYPE_PGSQL:
{
status = switch_pgsql_handle_exec_string(dbh->native_handle.pgsql_dbh, sql, str, len, err);
}
break;
}
end:
@ -1073,17 +1017,6 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans_full(sw
}
}
break;
case SCDB_TYPE_PGSQL:
{
switch_pgsql_status_t result;
if ((result = switch_pgsql_SQLSetAutoCommitAttr(dbh->native_handle.pgsql_dbh, 0)) != SWITCH_PGSQL_SUCCESS) {
char tmp[100];
switch_snprintfv(tmp, sizeof(tmp), "%q-%i", "Unable to Set AutoCommit Off", result);
errmsg = strdup(tmp);
}
}
break;
}
if (errmsg) {
@ -1119,13 +1052,6 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans_full(sw
}
}
break;
case SCDB_TYPE_PGSQL:
{
switch_pgsql_SQLEndTran(dbh->native_handle.pgsql_dbh, 1);
switch_pgsql_SQLSetAutoCommitAttr(dbh->native_handle.pgsql_dbh, 1);
switch_pgsql_finish_results(dbh->native_handle.pgsql_dbh);
}
break;
}
goto again;
@ -1205,13 +1131,6 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans_full(sw
}
}
break;
case SCDB_TYPE_PGSQL:
{
switch_pgsql_SQLEndTran(dbh->native_handle.pgsql_dbh, 1);
switch_pgsql_SQLSetAutoCommitAttr(dbh->native_handle.pgsql_dbh, 1);
switch_pgsql_finish_results(dbh->native_handle.pgsql_dbh);
}
break;
}
if (!zstr(post_trans_execute)) {
@ -1277,11 +1196,6 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_event_callback(switc
}
}
break;
case SCDB_TYPE_PGSQL:
{
status = switch_pgsql_handle_callback_exec(dbh->native_handle.pgsql_dbh, sql, helper_callback, &h, err);
}
break;
case SCDB_TYPE_ODBC:
{
status = switch_odbc_handle_callback_exec(dbh->native_handle.odbc_dbh, sql, helper_callback, &h, err);
@ -1347,14 +1261,6 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_event_callback_err(s
}
}
break;
case SCDB_TYPE_PGSQL:
{
status = switch_pgsql_handle_callback_exec(dbh->native_handle.pgsql_dbh, sql, helper_callback, &h, err);
if (err && *err) {
(*err_callback)(pdata, (const char*)*err);
}
}
break;
case SCDB_TYPE_ODBC:
{
status = switch_odbc_handle_callback_exec(dbh->native_handle.odbc_dbh, sql, helper_callback, &h, err);
@ -1418,11 +1324,6 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_callback(switch_cach
}
}
break;
case SCDB_TYPE_PGSQL:
{
status = switch_pgsql_handle_callback_exec(dbh->native_handle.pgsql_dbh, sql, callback, pdata, err);
}
break;
case SCDB_TYPE_ODBC:
{
status = switch_odbc_handle_callback_exec(dbh->native_handle.odbc_dbh, sql, callback, pdata, err);
@ -1483,14 +1384,6 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_callback_err(switch_
}
}
break;
case SCDB_TYPE_PGSQL:
{
status = switch_pgsql_handle_callback_exec(dbh->native_handle.pgsql_dbh, sql, callback, pdata, err);
if (err && *err) {
(*err_callback)(pdata, (const char*)*err);
}
}
break;
case SCDB_TYPE_ODBC:
{
status = switch_odbc_handle_callback_exec(dbh->native_handle.odbc_dbh, sql, callback, pdata, err);
@ -1615,16 +1508,6 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive_ex(switch_cache_db_h
}
}
break;
case SCDB_TYPE_PGSQL:
{
if (switch_pgsql_handle_exec(dbh->native_handle.pgsql_dbh, test_sql, NULL) != SWITCH_PGSQL_SUCCESS) {
if (drop_sql) {
switch_pgsql_handle_exec(dbh->native_handle.pgsql_dbh, drop_sql, NULL);
}
r = switch_pgsql_handle_exec(dbh->native_handle.pgsql_dbh, reactive_sql, NULL) == SWITCH_PGSQL_SUCCESS;
}
}
break;
case SCDB_TYPE_ODBC:
{
if (switch_odbc_handle_exec(dbh->native_handle.odbc_dbh, test_sql, NULL, NULL) != SWITCH_ODBC_SUCCESS) {
@ -2249,17 +2132,6 @@ static uint32_t do_trans(switch_sql_queue_manager_t *qm)
}
}
break;
case SCDB_TYPE_PGSQL:
{
switch_pgsql_status_t result;
if ((result = switch_pgsql_SQLSetAutoCommitAttr(qm->event_db->native_handle.pgsql_dbh, 0)) != SWITCH_PGSQL_SUCCESS) {
char tmp[100];
switch_snprintfv(tmp, sizeof(tmp), "%q-%i", "Unable to Set AutoCommit Off", result);
errmsg = strdup(tmp);
}
}
break;
}
if (errmsg) {
@ -2336,13 +2208,6 @@ static uint32_t do_trans(switch_sql_queue_manager_t *qm)
}
}
break;
case SCDB_TYPE_PGSQL:
{
switch_pgsql_SQLEndTran(qm->event_db->native_handle.pgsql_dbh, 1);
switch_pgsql_SQLSetAutoCommitAttr(qm->event_db->native_handle.pgsql_dbh, 1);
switch_pgsql_finish_results(qm->event_db->native_handle.pgsql_dbh);
}
break;
}
@ -2394,8 +2259,6 @@ static void *SWITCH_THREAD_FUNC switch_user_sql_thread(switch_thread_t *thread,
switch (qm->event_db->type) {
case SCDB_TYPE_DATABASE_INTERFACE:
break;
case SCDB_TYPE_PGSQL:
break;
case SCDB_TYPE_ODBC:
break;
case SCDB_TYPE_CORE_DB:
@ -3755,7 +3618,6 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
switch (sql_manager.dbh->type) {
case SCDB_TYPE_DATABASE_INTERFACE:
case SCDB_TYPE_PGSQL:
case SCDB_TYPE_ODBC:
if (switch_test_flag((&runtime), SCF_CLEAR_SQL)) {
char sql[512] = "";
@ -3806,7 +3668,6 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
switch (sql_manager.dbh->type) {
case SCDB_TYPE_DATABASE_INTERFACE:
case SCDB_TYPE_PGSQL:
case SCDB_TYPE_ODBC:
{
char *err;
@ -3859,17 +3720,6 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
}
}
break;
case SCDB_TYPE_PGSQL:
{
switch_pgsql_status_t result;
if ((result = switch_pgsql_SQLSetAutoCommitAttr(sql_manager.dbh->native_handle.pgsql_dbh, 0)) != SWITCH_PGSQL_SUCCESS) {
char tmp[100];
switch_snprintfv(tmp, sizeof(tmp), "%q-%i", "Unable to Set AutoCommit Off", result);
err = strdup(tmp);
}
}
break;
}
switch_cache_db_execute_sql(sql_manager.dbh, "delete from channels where hostname=''", &err);
@ -3904,17 +3754,6 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
}
}
break;
case SCDB_TYPE_PGSQL:
{
if (switch_pgsql_SQLEndTran(sql_manager.dbh->native_handle.pgsql_dbh, 1) != SWITCH_PGSQL_SUCCESS ||
switch_pgsql_SQLSetAutoCommitAttr(sql_manager.dbh->native_handle.pgsql_dbh, 1) != SWITCH_PGSQL_SUCCESS ||
switch_pgsql_finish_results(sql_manager.dbh->native_handle.pgsql_dbh) != SWITCH_PGSQL_SUCCESS) {
char tmp[100];
switch_snprintfv(tmp, sizeof(tmp), "%q-%i", "Unable to commit transaction.", result);
err = strdup(tmp);
}
}
break;
}
}

View File

@ -48,7 +48,6 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(SolutionDir)\w32\switch_version.props" Condition=" '$(switch_versionPropsImported)' == '' " />
<Import Project="$(SolutionDir)\w32\libpq.props" Condition=" '$(libpqPropsImported)' == '' " />
<Import Project="$(SolutionDir)\w32\openssl.props" Condition=" '$(OpensslPropsImported)' == '' " />
<Import Project="$(SolutionDir)\w32\curl.props" Condition=" '$(CurlPropsImported)' == '' " />
<Import Project="$(SolutionDir)\w32\pcre.props" Condition=" '$(pcrePropsImported)' == '' " />
@ -399,7 +398,6 @@ if not exist "$(OutDir)fonts" xcopy "$(SolutionDir)fonts\*.*" "$(OutDir)fonts\"
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4389;4127;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="..\..\src\switch_odbc.c" />
<ClCompile Include="..\..\src\switch_pgsql.c" />
<ClCompile Include="..\..\src\switch_pcm.c" />
<ClCompile Include="..\..\src\switch_speex.c" />
<ClCompile Include="..\..\src\switch_profile.c" />
@ -737,7 +735,6 @@ if not exist "$(OutDir)fonts" xcopy "$(SolutionDir)fonts\*.*" "$(OutDir)fonts\"
<ClInclude Include="..\..\src\include\switch_module_interfaces.h" />
<ClInclude Include="..\..\src\include\switch_mprintf.h" />
<ClInclude Include="..\..\src\include\switch_odbc.h" />
<ClInclude Include="..\..\src\include\switch_pgsql.h" />
<ClInclude Include="..\..\src\include\switch_platform.h" />
<ClInclude Include="..\..\src\include\switch_regex.h" />
<ClInclude Include="..\..\src\include\switch_resample.h" />

View File

@ -477,6 +477,14 @@
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\..\src\mod\databases\mod_pgsql\mod_pgsql.2017.vcxproj">
<Name>mod_pgsql</Name>
<Project>{1ba65811-5453-46f6-8190-9eceefeb7df2}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\..\src\mod\dialplans\mod_dialplan_asterisk\mod_dialplan_asterisk.2017.vcxproj">
<Name>mod_dialplan_asterisk</Name>
<Project>{e7bc026c-7cc5-45a3-bc7c-3b88eef01f24}</Project>