Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37817446
en ru br
Репозитории ALT
S:1.10.10-alt1
5.1: 1.0.4-alt2
www.altlinux.org/Changes

Группа :: Система/Серверы
Пакет: freeswitch

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: freeswitch-1.10.10-alt.patch
Скачать


 .gear/freeswitch.init                              |   87 ++
 .gear/freeswitch.spec                              |  810 +++++++++++++++
 .gear/freeswitch.sysconfig                         |    2 +
 .gear/freeswitch.tmpfiles                          |    1 +
 .gear/fs_cli.conf                                  |   22 +
 .gear/modules.conf                                 |  114 +++
 .gear/rules                                        |    8 +
 .gear/tags/list                                    |    1 +
 Makefile.am                                        |   13 +-
 configure.ac                                       |    2 +-
 freeswitch.spec                                    |    2 +
 libs/esl/fs_cli.c                                  |    2 +-
 libs/sofia-sip/libsofia-sip-ua/tport/ws.c          | 1065 ++++++++++++++++++++
 src/mod/applications/mod_av/Makefile.am            |    2 +-
 src/mod/applications/mod_av/test/test_avformat.c   |    1 -
 .../applications/mod_conference/conference_event.c |    4 +-
 src/mod/asr_tts/mod_flite/Makefile.am              |    2 +-
 src/mod/asr_tts/mod_flite/mod_flite.c              |   61 +-
 src/mod/formats/mod_imagick/mod_imagick.c          |    3 +
 src/mod/languages/mod_perl/Makefile.am             |    7 +-
 src/mod/languages/mod_v8/include/fscurl.hpp        |    2 +-
 src/mod/xml_int/mod_xml_rpc/Makefile.am            |   77 +-
 src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c          |    7 +-
 src/switch_utils.c                                 |    2 +-
 24 files changed, 2184 insertions(+), 113 deletions(-)
diff --git a/.gear/freeswitch.init b/.gear/freeswitch.init
new file mode 100644
index 0000000000..8c1979e568
--- /dev/null
+++ b/.gear/freeswitch.init
@@ -0,0 +1,87 @@
+#! /bin/sh
+#
+# freeswitch	Start/Stop the freeswitch daemon.
+#
+# chkconfig:	345 90 10
+# description:	freeswitch -- an telephony platform
+# processname:	freeswitch
+# config: 	/etc/freeswitch
+# pidfile: 	/var/run/freeswitch/freeswitch.pid
+
+WITHOUT_RC_COMPAT=1
+
+# Source function library.
+. /etc/init.d/functions
+
+SourceIfNotEmpty /etc/sysconfig/freeswitch
+
+PIDFILE=/var/run/freeswitch/freeswitch.pid
+LOCKFILE=/var/lock/subsys/freeswitch
+RETVAL=0
+
+start()
+{
+    start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user _pbx -- freeswitch -u _pbx -nc $FSOPTIONS
+    RETVAL=$?
+    return $RETVAL
+}
+
+stop()
+{
+    stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user _pbx freeswitch
+    RETVAL=$?
+    return $RETVAL
+}
+
+restart()
+{
+    stop
+    start
+}
+
+reload()
+{
+    action "reloading freeswitch configuration:" fs_cli -x reloadxml
+    RETVAL=$?
+    return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+    start)
+    start
+    ;;
+    stop)
+    stop
+    ;;
+    reload)
+    reload
+    ;;
+    restart)
+    restart
+    ;;
+    condstop)
+    if [ -e "$LOCKFILE" ]; then
+	stop
+    fi
+    ;;
+    condrestart)
+    if [ -e "$LOCKFILE" ]; then
+	restart
+    fi
+    ;;
+    condreload)
+    if [ -e "$LOCKFILE" ]; then
+	reload
+    fi
+    ;;
+    status)
+    status --pidfile "$PIDFILE" --expect-user _pbx freeswitch
+    RETVAL=$?
+    ;;
+    *)
+    msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
+    RETVAL=1
+esac
+
+exit $RETVAL
diff --git a/.gear/freeswitch.spec b/.gear/freeswitch.spec
new file mode 100644
index 0000000000..1cdd38e899
--- /dev/null
+++ b/.gear/freeswitch.spec
@@ -0,0 +1,810 @@
+%{?optflags_lto:%global optflags_lto %nil}
+Name: freeswitch
+Version: 1.10.10
+Release: alt1
+Epoch: 1
+ExcludeArch: %arm %ix86
+
+Summary: FreeSWITCH open source telephony platform
+License: MPL-1.1
+Group: System/Servers
+# VCS: https://github.com/signalwire/freeswitch
+Url: http://www.freeswitch.org/
+
+Source: %name-%version.tar
+Patch0: %name-%version-alt.patch
+Source1: %name.init
+Source2: %name.tmpfiles
+Source3: %name.sysconfig
+Source4: modules.conf
+Source5: fs_cli.conf
+
+BuildRequires: gcc-c++ libalsa-devel
+BuildRequires: libgnutls-devel libncurses-devel libssl-devel libunixODBC-devel
+BuildRequires: gdbm-devel db4-devel libldap-devel libcurl-devel libjpeg-devel
+BuildRequires: libspeex-devel libspeexdsp-devel libsqlite3-devel libX11-devel libmp4v2-devel
+BuildRequires: libxmlrpc-devel libyaml-devel libiksemel-devel libedit-devel
+BuildRequires: libsndfile-devel libpcre-devel liblua5-devel
+BuildRequires: libilbc1-devel >= 0.0.2-alt3 libjs-devel flite-devel
+BuildRequires: libtiff-devel libldap-devel libsoundtouch-devel libldns-devel
+BuildRequires: libpcap-devel perl-devel
+BuildRequires: libcelt-devel libmpg123-devel liblame-devel libshout2-devel
+BuildRequires: libspandsp3-devel libsofia-sip-devel >= 1.13.12
+BuildRequires: libnet-snmp-devel libnl-devel libsensors3-devel zlib-devel
+BuildRequires: libuuid-devel postgresql-devel 
+BuildRequires: java-common java-1.8.0-openjdk-devel /proc libavformat-devel libavutil-devel libavresample-devel libswscale-devel
+BuildRequires: libmemcached-devel libopus-devel libbroadvoice-devel libcodec2-devel libImageMagick-devel
+BuildRequires: flite-devel libyuv-devel libfreetype-devel libvpx-devel libg7221-devel libvlc-devel libavcodec-devel libx264-devel
+BuildRequires: libks-devel >= 1.8.2
+
+%ifarch %ix86 x86_64
+BuildRequires: yasm
+%endif
+
+%description
+FreeSWITCH is an open source telephony platform designed to facilitate
+the creation of voice and chat driven products scaling from a soft-phone
+up to a soft-switch.  It can be used as a simple switching engine, a media
+gateway or a media server to host IVR applications using simple scripts
+or XML to control the callflow.
+It supports various communication technologies such as SIP, H.323 and 
+GoogleTalk making it easy to interface with other open source PBX systems
+such as sipX, OpenPBX, Bayonne, YATE or Asterisk.
+
+%package -n lib%name
+Summary: FreeSWITCH shared library
+Group: System/Libraries
+
+%package -n lib%name-devel
+Summary: Development package for FreeSWITCH
+Group: Development/C
+Requires: lib%name = %version-%release
+
+
+%package daemon
+Summary: FreeSWITCH daemon
+Group: System/Servers
+Requires: lib%name = %version-%release
+Requires: freeswitch-sounds-default
+
+
+%package lang-de
+Summary: German language dependand modules and sounds for the FreeSwitch
+Group: System/Servers
+Requires: %name-daemon = %version-%release
+
+%package lang-en
+Summary: English language dependand modules and sounds for the FreeSwitch
+Group: System/Servers
+Requires: %name-daemon = %version-%release
+
+%package lang-es
+Summary: Spanish language dependand modules and sounds for the FreeSwitch
+Group: System/Servers
+Requires: %name-daemon = %version-%release
+
+%package lang-fr
+Summary: French language dependand modules and sounds for the FreeSwitch
+Group: System/Servers
+Requires: %name-daemon = %version-%release
+
+%package lang-he
+Summary: Hebrew language dependand modules and sounds for the FreeSwitch
+Group: System/Servers
+Requires: %name-daemon = %version-%release
+
+%package lang-ru
+Summary: Russian language dependand modules and sounds for the FreeSwitch
+Group: System/Servers
+Requires: %name-daemon = %version-%release
+
+%package lang-pt
+Summary: Portugal language dependand modules and sounds for the FreeSwitch
+Group: System/Servers
+Requires: %name-daemon = %version-%release
+
+%package java
+Summary: Java support for the FreeSWITCH open source telephony platform
+Group: Development/Java
+Requires: %name-daemon = %version-%release
+Requires: java >= 1.6.0
+
+%package lua
+Summary: Lua support for the FreeSWITCH open source telephony platform
+Group: Development/Other
+Requires: %name-daemon = %version-%release
+
+%package perl
+Summary: Perl support for the FreeSWITCH open source telephony platform
+Group: Development/Perl
+Requires: %name-daemon = %version-%release
+
+%package vlc
+Summary: VLC support for the FreeSWITCH open source telephony platform
+Group: System/Servers
+
+%package imagick
+Summary: ImageMagick support for the FreeSWITCH open source telephony platform
+Group: System/Servers
+
+%package av
+Summary: FFMpeg support for the FreeSWITCH open source telephony platform
+Group: System/Servers
+
+%package webui
+Summary: Web-based UI for FreeSWITCH
+Group: System/Servers
+Requires: %name-daemon = %version-%release
+
+# {{{ descriptions
+
+%description -n lib%name
+FreeSWITCH shared library
+
+%description -n lib%name-devel
+FreeSWITCH development files
+
+
+%description daemon
+FreeSWITCH is an open source telephony platform designed to facilitate
+the creation of voice and chat driven products scaling from a soft-phone
+up to a soft-switch.  It can be used as a simple switching engine,
+a media gateway or a media server to host IVR applications using simple
+scripts or XML to control the callflow.
+
+%description java
+Java support for the FreeSWITCH open source telephony platform
+
+%description lua
+Lua support for the FreeSWITCH open source telephony platform
+
+%description perl
+Perl support for the FreeSWITCH open source telephony platform
+
+%description vlc
+VLC support for the FreeSWITCH open source telephony platform
+
+%description imagick
+ImageMagick support for the FreeSWITCH open source telephony platform
+
+%description av
+FFMpeg support for the FreeSWITCH open source telephony platform
+
+%description lang-de
+German language phrases module and directory structure for
+say module and voicemail
+
+%description lang-en
+English language phrases module and directory structure for
+say module and voicemail
+
+%description lang-es
+Spanish language phrases module and directory structure for
+say module and voicemail
+
+%description lang-fr
+French language phrases module and directory structure for
+say module and voicemail
+
+%description lang-he
+Hebrew language phrases module and directory structure for
+say module and voicemail
+
+%description lang-pt
+Portugal language phrases module and directory structure for
+say module and voicemail
+
+%description lang-ru
+Russian language phrases module and directory structure for
+say module and voicemail
+
+%description webui
+FreeSWITCH is an open source telephony platform designed to facilitate
+the creation of voice and chat driven products scaling from a soft-phone
+up to a soft-switch.  It can be used as a simple switching engine,
+a media gateway or a media server to host IVR applications using simple
+scripts or XML to control the callflow.
+
+This package provides simple web-based UI.
+
+# }}}
+
+%prep
+%setup
+%patch0 -p1
+
+%build
+# https://github.com/signalwire/freeswitch/issues/1670
+%add_optflags -Wno-error=address
+
+LIBTOOL_M4=/usr/share/libtool/aclocal/libtool.m4 ./bootstrap.sh
+autoreconf -fisv
+cat %SOURCE4 >modules.conf
+# special hack for building libvpx by nasm
+export ASFLAGS='-Ox'
+%configure \
+    --enable-fhs \
+    --enable-system-xmlrpc-c \
+    --enable-system-lua \
+    --localstatedir=%_var \
+    --with-modinstdir=%_libdir/freeswitch \
+    --with-logfiledir=%_var/log/freeswitch \
+    --with-dbdir=%_var/lib/freeswitch/db \
+    --with-htdocsdir=%_datadir/freeswitch/htdocs \
+    --with-soundsdir=%_datadir/freeswitch/sounds \
+    --with-grammardir=%_datadir/freeswitch/grammar \
+    --with-scriptdir=%_datadir/freeswitch/scripts \
+    --with-recordingsdir=%_var/spool/freeswitch \
+    --enable-core-libedit-support \
+    --enable-core-pgsql-support \
+    --enable-core-odbc-support \
+    --enable-zrtp \
+    --with-libcurl \
+    --with-openssl \
+    --disable-static \
+    #
+make
+
+%install
+PERL_ARCHLIB=%perl_vendorarch %make_install sysconfdir=%_sysconfdir/freeswitch DESTDIR=%buildroot install
+%make_install sysconfdir=%_sysconfdir/freeswitch DESTDIR=%buildroot config-vanilla
+(cd conf && find dialplan directory -type f | cpio -pmd %buildroot%_sysconfdir/%name)
+
+install -pm0755 -D %SOURCE1 %buildroot%_initdir/freeswitch
+install -pm0644 -D %SOURCE2 %buildroot%_tmpfilesdir/freeswitch.conf
+install -pm0644 -D %SOURCE3 %buildroot%_sysconfdir/sysconfig/freeswitch
+install -pm0640 -D %SOURCE5 %buildroot%_sysconfdir/fs_cli.conf
+
+install -pm0644 src/include/switch_version.h %buildroot/%_includedir/freeswitch/switch_version.h
+
+mkdir -p \
+    %buildroot%_datadir/%name/sounds \
+    %buildroot%_sysconfdir/freeswitch/ssl \
+    %buildroot%_var/lib/freeswitch/recordings \
+    %buildroot%_logdir/freeswitch/{cdr-csv,xml_cdr}
+
+
+find %buildroot%_libdir/%name  -name \*.la -delete
+
+%triggerun daemon -- freeswitch-daemon < 1.6.6-alt2
+if [ $2 -gt 0 ]  && [ $1 -gt 0 ] && [ -f %_sysconfdir/%name/freeswitch.xml ];then 
+    mv %_sysconfdir/%name %_sysconfdir/%name-update-%version-%release
+fi
+
+#---------------------------------------------------------------
+%triggerpostun daemon -- freeswitch-daemon < 1.6.6-alt2
+if [ -f %_sysconfdir/%name-update-%version-%release/freeswitch.xml ];then
+    mv -Tf %_sysconfdir/%name-update-%version-%release %_sysconfdir/%name
+fi
+
+%pre daemon
+/usr/sbin/groupadd -r -f _pbx &>/dev/null
+/usr/sbin/useradd -r -g _pbx -d /dev/null -s /dev/null \
+    -c "freeswitch" -M -n _pbx &>/dev/null ||:
+
+%post daemon
+%post_service %name
+if [ ! -f %_sysconfdir/%name/freeswitch.xml ];then
+    cp -aR %_docdir/%name-daemon-%version/conf/vanilla/* %_sysconfdir/%name
+fi
+
+%preun daemon
+%preun_service %name
+
+#---------------------------------------------------------------
+%files -n lib%name
+%_libdir/libfreeswitch*.so.*
+
+%files -n lib%name-devel
+%_bindir/fsxs
+%_includedir/freeswitch
+%_libdir/libfreeswitch*.so
+%_pkgconfigdir/freeswitch.pc
+
+
+%files daemon
+%doc conf
+%_initdir/freeswitch
+%_tmpfilesdir/freeswitch.conf
+
+%config(noreplace) %_sysconfdir/sysconfig/freeswitch
+
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name
+
+%dir %_datadir/freeswitch/fonts
+%_datadir/freeswitch/fonts/*.ttf
+%_datadir/freeswitch/fonts/OFL.txt
+%_datadir/freeswitch/fonts/README.fonts
+
+%_sbindir/freeswitch
+%_bindir/fs_cli
+%_sbindir/fs_ivrd
+%_bindir/fs_encode
+%_bindir/fs_tts
+%_bindir/tone2wav
+
+%dir %_libdir/%name
+%_libdir/%name/mod_abstraction.so
+%_libdir/%name/mod_alsa.so
+%_libdir/%name/mod_amr.so
+%_libdir/%name/mod_b64.so
+%_libdir/%name/mod_blacklist.so
+%_libdir/%name/mod_bv.so
+%_libdir/%name/mod_callcenter.so
+%_libdir/%name/mod_cidlookup.so
+%_libdir/%name/mod_cdr_csv.so
+%_libdir/%name/mod_cdr_sqlite.so
+%_libdir/%name/mod_cdr_pg_csv.so
+%_libdir/%name/mod_cluechoo.so
+%_libdir/%name/mod_codec2.so
+%_libdir/%name/mod_commands.so
+%_libdir/%name/mod_conference.so
+%_libdir/%name/mod_console.so
+%_libdir/%name/mod_curl.so
+%_libdir/%name/mod_db.so
+%_libdir/%name/mod_dahdi_codec.so
+%_libdir/%name/mod_dialplan_asterisk.so
+%_libdir/%name/mod_dialplan_directory.so
+%_libdir/%name/mod_dialplan_xml.so
+%_libdir/%name/mod_directory.so
+%_libdir/%name/mod_distributor.so
+%_libdir/%name/mod_dptools.so
+%_libdir/%name/mod_easyroute.so
+%_libdir/%name/mod_enum.so
+%_libdir/%name/mod_esl.so
+%_libdir/%name/mod_esf.so
+%_libdir/%name/mod_event_multicast.so
+%_libdir/%name/mod_event_socket.so
+%_libdir/%name/mod_expr.so
+%_libdir/%name/mod_fifo.so
+%_libdir/%name/mod_flite.so
+%_libdir/%name/mod_format_cdr.so
+%_libdir/%name/mod_fsk.so
+%_libdir/%name/mod_fsv.so
+%_libdir/%name/mod_g723_1.so
+%_libdir/%name/mod_g729.so
+%_libdir/%name/mod_h26x.so
+%_libdir/%name/mod_hash.so
+%_libdir/%name/mod_httapi.so
+%_libdir/%name/mod_http_cache.so
+%_libdir/%name/mod_ilbc.so
+%_libdir/%name/mod_json_cdr.so
+%_libdir/%name/mod_lcr.so
+%_libdir/%name/mod_ldap.so
+%_libdir/%name/mod_limit.so
+%_libdir/%name/mod_local_stream.so
+%_libdir/%name/mod_logfile.so
+%_libdir/%name/mod_loopback.so
+%_libdir/%name/mod_memcache.so
+%_libdir/%name/mod_mp4.so
+%_libdir/%name/mod_mp4v.so
+%_libdir/%name/mod_native_file.so
+%_libdir/%name/mod_nibblebill.so
+%_libdir/%name/mod_opus.so
+%_libdir/%name/mod_oreka.so
+%_libdir/%name/mod_posix_timer.so
+%_libdir/%name/mod_random.so
+%_libdir/%name/mod_redis.so
+%_libdir/%name/mod_reference.so
+%_libdir/%name/mod_rss.so
+%_libdir/%name/mod_rtc.so
+%_libdir/%name/mod_rtmp.so
+%_libdir/%name/mod_shell_stream.so
+%_libdir/%name/mod_shout.so
+%_libdir/%name/mod_siren.so
+%_libdir/%name/mod_sms.so
+%_libdir/%name/mod_snapshot.so
+%_libdir/%name/mod_sndfile.so
+%_libdir/%name/mod_snmp.so
+%_libdir/%name/mod_snom.so
+%_libdir/%name/mod_stress.so
+%_libdir/%name/mod_sofia.so
+%_libdir/%name/mod_sonar.so
+%_libdir/%name/mod_soundtouch.so
+%_libdir/%name/mod_spandsp.so
+%_libdir/%name/mod_spy.so
+%_libdir/%name/mod_syslog.so
+%_libdir/%name/mod_theora.so
+%_libdir/%name/mod_timerfd.so
+%_libdir/%name/mod_tone_stream.so
+%_libdir/%name/mod_translate.so
+%_libdir/%name/mod_tts_commandline.so
+%_libdir/%name/mod_valet_parking.so
+%_libdir/%name/mod_verto.so
+%_libdir/%name/mod_vmd.so
+%_libdir/%name/mod_voicemail.so
+%_libdir/%name/mod_voicemail_ivr.so
+%_libdir/%name/mod_xml_cdr.so
+%_libdir/%name/mod_xml_curl.so
+%_libdir/%name/mod_xml_rpc.so
+%_libdir/%name/mod_yaml.so
+
+%dir %_datadir/%name
+%dir %_datadir/%name/scripts
+%dir %_datadir/%name/sounds
+%dir %_datadir/%name/htdocs
+%dir %_datadir/%name/grammar
+
+%dir %attr(0770, root, _pbx) %_spooldir/%name
+
+%dir %attr(0770, root, _pbx) %_localstatedir/%name
+%dir %attr(0770, root, _pbx) %_localstatedir/%name/db
+%dir %attr(0770, root, _pbx) %_localstatedir/%name/images
+%_localstatedir/%name/images/*
+%dir %attr(0770, root, _pbx) %_logdir/%name
+%dir %attr(0770, root, _pbx) %_logdir/%name/cdr-csv
+%dir %attr(0770, root, _pbx) %_logdir/%name/xml_cdr
+
+%dir %attr(0770, root, _pbx) %_var/run/%name
+
+%files java
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/autoload_configs/java.conf.xml
+%_libdir/%name/mod_java.so*
+%_datadir/%name/scripts/%name.jar
+
+%files lua
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/autoload_configs/lua.conf.xml
+%_libdir/%name/mod_lua.so*
+
+%files perl
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/autoload_configs/perl.conf.xml
+%_libdir/%name/mod_perl.so*
+%perl_vendor_archlib/freeswitch.pm
+%perl_vendor_autolib/freeswitch
+
+%files vlc
+%_libdir/%name/mod_vlc.so*
+
+%files imagick
+%_libdir/%name/mod_imagick.so*
+
+%files av
+%_libdir/%name/mod_av.so
+
+%files lang-de
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/de
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/de/demo
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/de/vm
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/de/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/de/demo/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/de/vm/*.xml
+%_libdir/%name/mod_say_de.so*
+
+%files lang-es
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/es
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/es/demo
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/es/dir
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/es/vm
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/es/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/es/dir/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/es/demo/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/es/vm/*.xml
+%_libdir/%name/mod_say_es.so*
+
+%files lang-en
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/en
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/en/demo
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/en/dir
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/en/ivr
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/en/vm
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/en/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/en/dir/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/en/demo/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/en/ivr/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/en/vm/*.xml
+%_libdir/%name/mod_say_en.so*
+
+%files lang-fr
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/fr
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/fr/dir
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/fr/demo
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/fr/vm
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/fr/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/fr/dir/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/fr/demo/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/fr/vm/*.xml
+%_libdir/%name/mod_say_fr.so*
+
+%files lang-he
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/he
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/he/dir
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/he/demo
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/he/vm
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/he/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/he/dir/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/he/demo/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/he/vm/*.xml
+
+%files lang-pt
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/pt
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/pt/demo
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/pt/dir
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/pt/vm
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/pt/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/pt/dir/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/pt/demo/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/pt/vm/*.xml
+%_libdir/%name/mod_say_pt.so*
+
+%files lang-ru
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/ru
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/ru/dir
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/ru/demo
+%dir %attr(0750, root, _pbx) %_sysconfdir/%name/lang/ru/vm
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/ru/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/ru/dir/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/ru/demo/*.xml
+%config(noreplace) %attr(0640, root, _pbx) %_sysconfdir/%name/lang/ru/vm/*.xml
+%_libdir/%name/mod_say_ru.so*
+
+
+%files webui
+%_datadir/%name/htdocs/portal
+
+%changelog
+* Sat Aug 19 2023 Anton Farygin <rider@altlinux.ru> 1:1.10.10-alt1
+- 1.10.9 -> 1.10.10
+- fixed built with new ImageMagick
+
+* Sat Aug 12 2023 Anton Farygin <rider@altlinux.ru> 1:1.10.9-alt2
+- added commits from upstream to fix the build using gcc12 and openssl 3
+
+* Tue Feb 28 2023 Anton Farygin <rider@altlinux.ru> 1:1.10.9-alt1
+- 1.10.8 -> 1.10.9
+
+* Fri Dec 30 2022 Anton Farygin <rider@altlinux.ru> 1:1.10.8-alt1
+- 1.10.7 -> 1.10.8
+- fix for build with recent curl
+
+* Mon Sep 26 2022 L.A. Kostis <lakostis@altlinux.ru> 1:1.10.7-alt1.3
+- BR: remove openr2 (since freedtm moved out-of-tree).
+
+* Fri Jul 15 2022 L.A. Kostis <lakostis@altlinux.ru> 1:1.10.7-alt1.2
+- Fix gcc9+ warning (-Werror=stringop-truncation).
+- mod_shout: libshout 2.3+ compatibility fixes.
+
+* Fri Jul 15 2022 L.A. Kostis <lakostis@altlinux.ru> 1:1.10.7-alt1.1
+- Add workaround to compile with gcc12.
+
+* Fri Nov 26 2021 Anton Farygin <rider@altlinux.ru> 1:1.10.7-alt1
+- 1.10.6 -> 1.10.7 (Fixes: CVE-2021-41158, CVE-2021-41145, CVE-2021-41157,
+  CVE-2021-41105, CVE-2021-37624, CVE-2021-36513)
+
+* Sat Oct 16 2021 Anton Farygin <rider@altlinux.ru> 1:1.10.6-alt3
+- built without silk support
+
+* Thu Sep 30 2021 Anton Farygin <rider@altlinux.ru> 1:1.10.6-alt2
+- fixed build with gcc-11.2
+- removed build dependency to external gsmlib (removed from Sisyphus)
+- disabled lto to fix unresolved symbols
+- disabled endpoints/mod_skinny due to the quality of code
+
+* Tue Apr 13 2021 Anton Farygin <rider@altlinux.org> 1:1.10.6-alt1
+- 1.10.6
+
+* Fri Feb 26 2021 Anton Farygin <rider@altlinux.org> 1:1.10.5-alt3
+- fixed build with gcc-9
+
+* Sun Nov 08 2020 Anton Farygin <rider@altlinux.ru> 1:1.10.5-alt2
+- built ImageMagick support (closes: #39215)
+
+* Mon Aug 31 2020 Anton Farygin <rider@altlinux.ru> 1:1.10.5-alt1
+- 1.10.5
+
+* Thu May 28 2020 Anton Farygin <rider@altlinux.ru> 1:1.10.3-alt1
+- 1.10.3
+
+* Mon Feb 10 2020 Anton Farygin <rider@altlinux.ru> 1:1.10.2-alt1
+- 1.10.2
+- removed python,freetdm, avmd and mongodb modules
+
+* Tue Oct 08 2019 Michael Shigorin <mike@altlinux.org> 1:1.8.7-alt2
+- E2K: fix build (patch proposed upstream)
+
+* Thu Aug 29 2019 Anton Farygin <rider@altlinux.ru> 1:1.8.7-alt1
+- 1.8.7
+- fixed build on ppc64 (thanks to glebfm@)
+
+* Sat Jun 22 2019 Igor Vlasenko <viy@altlinux.ru> 1:1.8.5-alt2
+- NMU: remove rpm-build-ubt from BR:
+
+* Tue Mar 12 2019 Anton Farygin <rider@altlinux.ru> 1:1.8.5-alt1
+- 1.8.5
+
+* Thu Jan 24 2019 Igor Vlasenko <viy@altlinux.ru> 1:1.8.4-alt1.1
+- rebuild with new perl 5.28.1
+
+* Mon Jan 07 2019 Anton Farygin <rider@altlinux.ru> 1:1.8.4-alt1
+- 1.8.4
+
+* Tue Dec 18 2018 Anton Farygin <rider@altlinux.ru> 1:1.8.2-alt4
+- fixed build with gcc-8
+- disabled build libpri and isdn plugins for freetdm
+
+* Thu Nov 01 2018 Anton Farygin <rider@altlinux.ru> 1:1.8.2-alt3
+- added switch_version.h to devel package (closes: #25924)
+
+* Tue Oct 16 2018 Anton Farygin <rider@altlinux.ru> 1:1.8.2-alt2
+- added fix for build with libav-11
+
+* Fri Sep 28 2018 Anton Farygin <rider@altlinux.ru> 1:1.8.2-alt1
+- 1.8.2
+
+* Thu Aug 09 2018 Anton Farygin <rider@altlinux.ru> 1:1.6.20-alt3
+- rebuilt with libcodec2-0.8
+
+* Tue Jun 19 2018 Anton Farygin <rider@altlinux.ru> 1:1.6.20-alt2
+- disabled sagoma support
+- rebuilt for ffmpeg-4.0
+
+* Fri May 04 2018 Anton Farygin <rider@altlinux.ru> 1:1.6.20-alt1
+- 1.6.20
+
+* Fri Dec 15 2017 Igor Vlasenko <viy@altlinux.ru> 1:1.6.19-alt3.1
+- rebuild with new perl 5.26.1
+
+* Sun Oct 29 2017 Anton Farygin <rider@altlinux.ru> 1:1.6.19-alt3
+- rebuilt for new postgresql 10
+
+* Tue Oct 03 2017 Anton Farygin <rider@altlinux.ru> 1:1.6.19-alt2
+- rebuilt for new libcodev2 0.7
+
+* Wed Jul 19 2017 Anton Farygin <rider@altlinux.ru> 1:1.6.19-alt1.S1
+- 1.6.19
+
+* Wed Jun 28 2017 Anton Farygin <rider@altlinux.ru> 1:1.6.18-alt1
+- 1.6.18
+- build without erlang
+- disabled javascript support
+
+* Sat Jun 17 2017 Anton Farygin <rider@altlinux.ru> 1:1.6.17-alt3
+- build mod_av.so as freeswitch-av subpackage
+
+* Thu Jun 15 2017 Anton Farygin <rider@altlinux.ru> 1:1.6.17-alt2
+- enable mod_rtc build and cleanup modules.conf
+
+* Tue Apr 25 2017 Anton Farygin <rider@altlinux.ru> 1:1.6.17-alt1
+- new version
+
+* Wed Feb 15 2017 Anton Farygin <rider@altlinux.ru> 1:1.6.15-alt1
+- new version
+
+* Fri Feb 03 2017 Igor Vlasenko <viy@altlinux.ru> 1:1.6.14-alt1.1
+- rebuild with new perl 5.24.1
+
+* Thu Jan 19 2017 Anton Farygin <rider@altlinux.ru> 1:1.6.14-alt1
+- new version
+
+* Wed Nov 30 2016 Anton Farygin <rider@altlinux.ru> 1:1.6.13-alt1
+- new version
+
+* Wed Oct 19 2016 Anton Farygin <rider@altlinux.ru> 1:1.6.12-alt1
+- new version
+
+* Wed Oct 12 2016 Anton Farygin <rider@altlinux.ru> 1:1.6.11-alt1
+- new version
+
+* Tue Sep 13 2016 Anton Farygin <rider@altlinux.ru> 1:1.6.10-alt2
+- fixed unresolved symbols in mod_flite
+
+* Fri Aug 26 2016 Anton Farygin <rider@altlinux.ru> 1:1.6.10-alt1
+- new version
+
+* Mon Jul 25 2016 Anton Farygin <rider@altlinux.ru> 1:1.6.9-alt1
+- new version
+
+* Tue Jun 14 2016 Anton Farygin <rider@altlinux.ru> 1:1.6.8-alt1
+- new version
+
+* Fri Mar 18 2016 Anton Farygin <rider@altlinux.ru> 1:1.6.6-alt2
+- removed default configuration from freeswitch-daemon package
+- added subpackage with mod_vlc 
+
+* Sat Mar 12 2016 Anton Farygin <rider@altlinux.ru> 1:1.6.6-alt1
+- new version
+
+* Sat Feb 20 2016 Yuri N. Sedunov <aris@altlinux.org> 1:1.4.26-alt1.1
+- rebuilt against libSoundTouch.so.1
+
+* Mon Dec 07 2015 Anton Farygin <rider@altlinux.ru> 1:1.4.26-alt1
+- new version
+
+* Wed Dec 02 2015 Andrey Cherepanov <cas@altlinux.org> 1:1.4.23-alt2.2
+- rebuild with new libmemcached 1.0.18
+
+* Wed Nov 25 2015 Igor Vlasenko <viy@altlinux.ru> 1:1.4.23-alt2.1
+- rebuild with new perl 5.22.0
+
+* Sun Nov 22 2015 Igor Vlasenko <viy@altlinux.ru> 1:1.4.23-alt2
+- fixed build: added libspeexdsp to BR:.
+
+* Tue Oct 13 2015 Anton Farygin <rider@altlinux.ru> 1:1.4.23-alt1
+- new version
+
+* Wed Jul 15 2015 Anton Farygin <rider@altlinux.ru> 1:1.4.20-alt1
+- build 1.4.20 as new version
+
+* Tue Dec 09 2014 Igor Vlasenko <viy@altlinux.ru> 1.5.13-alt2.1
+- rebuild with new perl 5.20.1
+
+* Tue Nov 18 2014 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.5.13-alt2
+- rebuilt with recent libsoundtouch
+
+* Fri Jul 25 2014 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.5.13-alt1
+- 1.5.13 released
+
+* Fri Oct 11 2013 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.5.5-alt2
+- built mod_gsmopen
+
+* Wed Oct 09 2013 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.5.5-alt1
+- 1.5.5 released
+
+* Fri Aug 30 2013 Vladimir Lettiev <crux@altlinux.ru> 1.2.3-alt2
+- built for perl 5.18
+
+* Tue Sep 25 2012 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.2.3-alt1
+- 1.2.3
+
+* Fri Sep 21 2012 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.2.1-alt1
+- 1.2.1 released
+
+* Tue Sep 04 2012 Vladimir Lettiev <crux@altlinux.ru> 1.0.7-alt0.6
+- rebuilt for perl-5.16
+
+* Thu Nov 24 2011 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.7-alt0.5
+- updated from git b9e28f85
+
+* Mon Nov 07 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 1.0.7-alt0.4.1
+- Rebuild with Python-2.7
+
+* Sun Oct 16 2011 Alexey Tourbin <at@altlinux.ru> 1.0.7-alt0.4
+- rebuilt for perl-5.14
+
+* Wed Aug 10 2011 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.7-alt0.3
+- updated from git 6d1d4a9c
+
+* Wed Jun 15 2011 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.7-alt0.1
+- 1.0.7 (rolling) released
+- obsolete openzap stuff removed
+
+* Wed Jun 15 2011 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.6-alt9
+- mod_memcache temporarily dropped
+
+* Tue Apr 26 2011 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.6-alt8
+- mod_perl again due to perl changes
+
+* Mon Apr 11 2011 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.6-alt7
+- resurrect mod_perl module
+
+* Mon Mar 21 2011 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.6-alt6
+- rebuilt with recent libmemcached
+
+* Wed Mar 16 2011 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.6-alt5
+- exclude mod_erlang_event from build
+
+* Wed Dec 01 2010 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.6-alt4
+- updated from upstream git.2343f685
+
+* Sun Nov 07 2010 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.6-alt3
+- rebuilt with recent libcelt
+
+* Sat May 08 2010 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.6-alt2
+- fixed build with recent libmpg123
+
+* Fri May  7 2010 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.6-alt1
+- 1.0.6 released
+
+* Mon Apr 12 2010 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.4-alt4
+- fixed python module packaging
+
+* Sat Sep 19 2009 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.4-alt2
+- 1.0.4 released
+
+* Wed Jul 29 2009 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.3-alt3
+- rebuilt due spandsp soname change
+
+* Sat May 23 2009 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.3-alt1
+- 1.0.3 released
+
+* Wed Jan 14 2009 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.2-alt1
+- first build for ALTLinux
diff --git a/.gear/freeswitch.sysconfig b/.gear/freeswitch.sysconfig
new file mode 100644
index 0000000000..28a31f8c1e
--- /dev/null
+++ b/.gear/freeswitch.sysconfig
@@ -0,0 +1,2 @@
+# Extra options to freeswitch daemon
+FSOPTIONS=
diff --git a/.gear/freeswitch.tmpfiles b/.gear/freeswitch.tmpfiles
new file mode 100644
index 0000000000..7269ff1c53
--- /dev/null
+++ b/.gear/freeswitch.tmpfiles
@@ -0,0 +1 @@
+d	/var/run/freeswitch	0770	root	_pbx
diff --git a/.gear/fs_cli.conf b/.gear/fs_cli.conf
new file mode 100644
index 0000000000..5fd66c6ade
--- /dev/null
+++ b/.gear/fs_cli.conf
@@ -0,0 +1,22 @@
+default]
+;overide any default options here
+loglevel => 6
+log-uuid => false
+quiet => false
+key_f1 => help
+key_f2 => status
+key_f3 => show channels
+key_f4 => show calls
+key_f5 => sofia status
+key_f6 => reloadxml
+key_f7 => /log console
+key_f8 => /log debug
+key_f9 => sofia status profile internal
+key_f10 => sofia global siptrace on
+key_f11 => sofia global siptrace off
+key_f12 => version
+
+[profile1]
+host     => 127.0.0.1
+port     => 8021
+loglevel => info
diff --git a/.gear/modules.conf b/.gear/modules.conf
new file mode 100644
index 0000000000..f32de647ac
--- /dev/null
+++ b/.gear/modules.conf
@@ -0,0 +1,114 @@
+applications/mod_abstraction
+applications/mod_av
+applications/mod_blacklist
+applications/mod_callcenter
+applications/mod_cidlookup
+applications/mod_cluechoo
+applications/mod_commands
+applications/mod_conference
+applications/mod_curl
+applications/mod_db
+applications/mod_directory
+applications/mod_distributor
+applications/mod_dptools
+applications/mod_easyroute
+applications/mod_enum
+applications/mod_esf
+applications/mod_esl
+applications/mod_expr
+applications/mod_fifo
+applications/mod_fsk
+applications/mod_fsv
+applications/mod_hash
+applications/mod_httapi
+applications/mod_http_cache
+applications/mod_lcr
+applications/mod_limit
+applications/mod_memcache
+applications/mod_mp4
+applications/mod_nibblebill
+applications/mod_oreka
+applications/mod_random
+applications/mod_redis
+applications/mod_rss
+applications/mod_sms
+applications/mod_snapshot
+applications/mod_snom
+applications/mod_sonar
+applications/mod_soundtouch
+applications/mod_spandsp
+applications/mod_spy
+applications/mod_stress
+applications/mod_translate
+applications/mod_valet_parking
+applications/mod_vmd
+applications/mod_voicemail
+applications/mod_voicemail_ivr
+asr_tts/mod_flite
+asr_tts/mod_tts_commandline
+asr_tts/mod_unimrcp
+codecs/mod_amr
+codecs/mod_b64
+codecs/mod_bv
+codecs/mod_codec2
+codecs/mod_dahdi_codec
+codecs/mod_g723_1
+codecs/mod_g729
+codecs/mod_h26x
+codecs/mod_ilbc
+codecs/mod_mp4v
+codecs/mod_opus
+codecs/mod_siren
+codecs/mod_theora
+dialplans/mod_dialplan_asterisk
+dialplans/mod_dialplan_directory
+dialplans/mod_dialplan_xml
+directories/mod_ldap
+endpoints/mod_alsa
+endpoints/mod_dingaling
+endpoints/mod_loopback
+endpoints/mod_reference
+endpoints/mod_rtmp
+endpoints/mod_sofia
+endpoints/mod_verto
+endpoints/mod_rtc
+event_handlers/mod_cdr_csv
+event_handlers/mod_cdr_pg_csv
+event_handlers/mod_cdr_sqlite
+event_handlers/mod_event_multicast
+event_handlers/mod_event_socket
+event_handlers/mod_format_cdr
+event_handlers/mod_json_cdr
+event_handlers/mod_snmp
+formats/mod_imagick
+formats/mod_local_stream
+formats/mod_native_file
+formats/mod_shell_stream
+formats/mod_shout
+formats/mod_sndfile
+formats/mod_tone_stream
+formats/mod_vlc
+languages/mod_java
+languages/mod_lua
+languages/mod_perl
+languages/mod_yaml
+loggers/mod_console
+loggers/mod_logfile
+loggers/mod_syslog
+say/mod_say_de
+say/mod_say_en
+say/mod_say_es
+say/mod_say_fr
+say/mod_say_he
+say/mod_say_hu
+say/mod_say_it
+say/mod_say_nl
+say/mod_say_pt
+say/mod_say_ru
+timers/mod_posix_timer
+timers/mod_timerfd
+xml_int/mod_xml_cdr
+xml_int/mod_xml_curl
+#xml_int/mod_xml_ldap
+xml_int/mod_xml_rpc
+#xml_int/mod_xml_scgi
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000000..9ca4a7c2fd
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,8 @@
+spec: .gear/freeswitch.spec
+copy: .gear/freeswitch.init
+copy: .gear/freeswitch.tmpfiles
+copy: .gear/freeswitch.sysconfig
+copy: .gear/modules.conf
+copy: .gear/fs_cli.conf
+tar: v@version@:.
+diff: v@version@:. . name=@name@-@version@-alt.patch
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000000..62c20ae7c8
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+4cb05e7f4a23645ec387f3b5391194128be7d193 v1.10.10
diff --git a/Makefile.am b/Makefile.am
index fdd339a68b..2f0b91ff59 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,7 +8,7 @@ AM_LIBAPR_CFLAGS := $(shell apr-1-config --cflags)
 AM_LIBAPR_CPPFLAGS := $(shell apr-1-config --cppflags --includes)
 AM_LIBAPR_LDFLAGS := $(shell apr-1-config --ldflags)
 AM_LIBAPR_LIBS := $(shell apr-1-config \--libs)
-AM_LIBAPR_LINKLIBTOOL := $(shell apr-1-config \--link-libtool)
+AM_LIBAPR_LINKLIBTOOL := $(shell pkg-config \--libs apr-1)
 else
 AM_LIBAPR_CFLAGS := $(shell ./libs/apr/apr-1-config --cflags)
 AM_LIBAPR_CPPFLAGS := $(shell ./libs/apr/apr-1-config --cppflags --includes)
@@ -16,7 +16,6 @@ AM_LIBAPR_LDFLAGS := $(shell ./libs/apr/apr-1-config --ldflags)
 AM_LIBAPR_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr/apr-1-config \--libs))
 endif
 
-
 AM_CFLAGS   = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS) 
 AM_CPPFLAGS =
 AM_CPPFLAGS += -I$(switch_srcdir)/libs/libvpx
@@ -249,7 +248,7 @@ library_includetest_HEADERS = \
 	src/include/test/switch_fct.h \
 	src/include/test/switch_test.h
 
-library_includedir      = $(includedir)
+library_includedir      = $(includedir)/freeswitch
 library_include_HEADERS = \
 	src/include/switch_am_config.h \
 	src/include/switch.h \
@@ -412,7 +411,8 @@ src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h
 ##
 ## Applications
 ##
-bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode fs_tts
+bin_PROGRAMS = fs_cli tone2wav fs_encode fs_tts
+sbin_PROGRAMS = freeswitch fs_ivrd
 
 ##
 ## fs_cli ()
@@ -474,7 +474,12 @@ nodist_freeswitch_SOURCES = src/include/switch_version.h
 freeswitch_SOURCES = src/switch.c
 freeswitch_CFLAGS  = $(AM_CFLAGS) $(CORE_CFLAGS)
 freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir)
+if SYSTEM_APR
+freeswitch_LDADD   = libfreeswitch.la $(AM_LIBAPR_LINKLIBTOOL)
+else
 freeswitch_LDADD   = libfreeswitch.la libs/apr/libapr-1.la
+endif
+
 
 if HAVE_ODBC
 freeswitch_LDADD += $(ODBC_LIB_FLAGS)
diff --git a/configure.ac b/configure.ac
index 2c7fd5ed65..cdf7be3bfd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1784,7 +1784,7 @@ then
 		if test "$python_has_distutils" != "no" ; then
 			AC_MSG_CHECKING([location of site-packages])
 
-			PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
+			PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(1));'`"
 
 			if test -z "$PYTHON_SITE_DIR" ; then
 				AC_MSG_ERROR([Unable to detect python site-packages path])
diff --git a/freeswitch.spec b/freeswitch.spec
index ecf9dacf13..d638e946b7 100644
--- a/freeswitch.spec
+++ b/freeswitch.spec
@@ -1379,6 +1379,8 @@ sed -ie 's:confdir="${sysconfdir}/freeswitch":confdir="$sysconfdir":' ./configur
 #
 ######################################################################################################################
 %build
+# https://github.com/signalwire/freeswitch/issues/1670
+%add_optflags -Wno-error=address
 %ifos linux
 %if 0%{?suse_version} > 1000 && 0%{?suse_version} < 1030
 export CFLAGS="$CFLAGS -fstack-protector"
diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c
index 973df741e0..07722d33ea 100644
--- a/libs/esl/fs_cli.c
+++ b/libs/esl/fs_cli.c
@@ -944,7 +944,7 @@ static int process_command(esl_handle_t *handle, const char *cmd)
 			output_printf("Unknown command [%s]\n", cmd);
 		}
 	} else {
-		char cmd_str[1024] = "";
+		char cmd_str[2048] = "";
 		const char *err = NULL;
 
 		if (!strncasecmp(cmd, "console loglevel ", 17)) { 
diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c
new file mode 100644
index 0000000000..36b5a607ca
--- /dev/null
+++ b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c
@@ -0,0 +1,1065 @@
+#include <switch.h>
+#include "ws.h"
+#include <pthread.h>
+
+#ifndef _MSC_VER
+#include <fcntl.h>
+#endif
+
+#if defined(__linux__) || defined(__GLIBC__)
+#include <byteswap.h>
+#endif
+
+#ifndef _MSC_VER
+#define ms_sleep(x)	usleep( x * 1000);
+#else
+#define ms_sleep(x) Sleep( x );
+#endif
+
+#ifdef _MSC_VER
+/* warning C4706: assignment within conditional expression*/
+#pragma warning(disable: 4706)
+#endif
+
+#define WS_BLOCK 1
+#define WS_NOBLOCK 0
+
+#define WS_INIT_SANITY 5000
+#define WS_WRITE_SANITY 200
+
+#define SHA1_HASH_SIZE 20
+static struct ws_globals_s ws_globals;
+
+#ifndef WSS_STANDALONE
+
+void init_ssl(void)
+{
+	//	SSL_library_init();
+}
+void deinit_ssl(void)
+{
+	return;
+}
+
+#else
+static void pthreads_thread_id(CRYPTO_THREADID *id);
+static void pthreads_locking_callback(int mode, int type, const char *file, int line);
+
+static pthread_mutex_t *lock_cs;
+static long *lock_count;
+
+
+
+static void thread_setup(void)
+{
+	int i;
+
+	lock_cs = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t));
+	lock_count = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long));
+
+	for (i = 0; i < CRYPTO_num_locks(); i++) {
+		lock_count[i] = 0;
+		pthread_mutex_init(&(lock_cs[i]), NULL);
+	}
+
+	CRYPTO_THREADID_set_callback(pthreads_thread_id);
+	CRYPTO_set_locking_callback(pthreads_locking_callback);
+}
+
+static void thread_cleanup(void)
+{
+	int i;
+
+	CRYPTO_set_locking_callback(NULL);
+
+	for (i=0; i<CRYPTO_num_locks(); i++) {
+		pthread_mutex_destroy(&(lock_cs[i]));
+	}
+	OPENSSL_free(lock_cs);
+	OPENSSL_free(lock_count);
+
+}
+
+static void pthreads_locking_callback(int mode, int type, const char *file, int line)
+{
+
+	if (mode & CRYPTO_LOCK) {
+		pthread_mutex_lock(&(lock_cs[type]));
+		lock_count[type]++;
+	} else {
+		pthread_mutex_unlock(&(lock_cs[type]));
+	}
+}
+
+
+
+static void pthreads_thread_id(CRYPTO_THREADID *id)
+{
+	CRYPTO_THREADID_set_numeric(id, (unsigned long)pthread_self());
+}
+
+
+void init_ssl(void) {
+	SSL_library_init();
+
+
+	OpenSSL_add_all_algorithms();   /* load & register cryptos */
+	SSL_load_error_strings();     /* load all error messages */
+	ws_globals.ssl_method = SSLv23_server_method();   /* create server instance */
+	ws_globals.ssl_ctx = SSL_CTX_new(ws_globals.ssl_method);         /* create context */
+	assert(ws_globals.ssl_ctx);
+
+	/* Disable SSLv2 */
+	SSL_CTX_set_options(ws_globals.ssl_ctx, SSL_OP_NO_SSLv2);
+	/* Disable SSLv3 */
+	SSL_CTX_set_options(ws_globals.ssl_ctx, SSL_OP_NO_SSLv3);
+	/* Disable TLSv1 */
+	SSL_CTX_set_options(ws_globals.ssl_ctx, SSL_OP_NO_TLSv1);
+	/* Disable Compression CRIME (Compression Ratio Info-leak Made Easy) */
+	SSL_CTX_set_options(ws_globals.ssl_ctx, SSL_OP_NO_COMPRESSION);
+	/* set the local certificate from CertFile */
+	SSL_CTX_use_certificate_file(ws_globals.ssl_ctx, ws_globals.cert, SSL_FILETYPE_PEM);
+	/* set the private key from KeyFile */
+	SSL_CTX_use_PrivateKey_file(ws_globals.ssl_ctx, ws_globals.key, SSL_FILETYPE_PEM);
+	/* verify private key */
+	if ( !SSL_CTX_check_private_key(ws_globals.ssl_ctx) ) {
+		abort();
+    }
+
+	SSL_CTX_set_cipher_list(ws_globals.ssl_ctx, "HIGH:!DSS:!aNULL@STRENGTH");
+
+	thread_setup();
+}
+
+
+void deinit_ssl(void) {
+	thread_cleanup();
+}
+
+#endif
+
+static const char c64[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+
+static int cheezy_get_var(char *data, char *name, char *buf, size_t buflen)
+{
+  char *p=data;
+
+  /* the old way didnt make sure that variable values were used for the name hunt
+   * and didnt ensure that only a full match of the variable name was used
+   */
+
+  do {
+    if(!strncasecmp(p,name,strlen(name)) && *(p+strlen(name))==':') break;
+  } while((p = (strstr(p,"\n")+1))!=(char *)1);
+
+
+  if (p && p != (char *)1 && *p!='\0') {
+    char *v, *e = 0;
+
+    v = strchr(p, ':');
+    if (v) {
+      v++;
+      while(v && *v == ' ') {
+	v++;
+      }
+      if (v)  {
+	e = strchr(v, '\r');
+	if (!e) {
+	  e = strchr(v, '\n');
+	}
+      }
+
+      if (v && e) {
+	int cplen;
+	size_t len = e - v;
+
+	if (len > buflen - 1) {
+	  cplen = buflen -1;
+	} else {
+	  cplen = len;
+	}
+
+	strncpy(buf, v, cplen);
+	*(buf+cplen) = '\0';
+	return 1;
+      }
+
+    }
+  }
+  return 0;
+}
+
+static int b64encode(unsigned char *in, size_t ilen, unsigned char *out, size_t olen)
+{
+	int y=0,bytes=0;
+	size_t x=0;
+	unsigned int b=0,l=0;
+
+	if(olen) {
+	}
+
+	for(x=0;x<ilen;x++) {
+		b = (b<<8) + in[x];
+		l += 8;
+		while (l >= 6) {
+			out[bytes++] = c64[(b>>(l-=6))%64];
+			if(++y!=72) {
+				continue;
+			}
+			//out[bytes++] = '\n';
+			y=0;
+		}
+	}
+
+	if (l > 0) {
+		out[bytes++] = c64[((b%16)<<(6-l))%64];
+	}
+	if (l != 0) while (l < 6) {
+		out[bytes++] = '=', l += 2;
+	}
+
+	return 0;
+}
+
+#ifdef NO_OPENSSL
+static void sha1_digest(char *digest, unsigned char *in)
+{
+	SHA1Context sha;
+	char *p;
+	int x;
+
+
+	SHA1Init(&sha);
+	SHA1Update(&sha, in, strlen(in));
+	SHA1Final(&sha, digest);
+}
+#else
+
+static void sha1_digest(unsigned char *digest, char *in)
+{
+	SHA_CTX sha;
+
+	SHA1_Init(&sha);
+	SHA1_Update(&sha, in, strlen(in));
+	SHA1_Final(digest, &sha);
+
+}
+
+#endif
+
+int ws_handshake(wsh_t *wsh)
+{
+	char key[256] = "";
+	char version[5] = "";
+	char proto[256] = "";
+	char proto_buf[384] = "";
+	char input[512] = "";
+	unsigned char output[SHA1_HASH_SIZE] = "";
+	char b64[256] = "";
+	char respond[1024] = "";
+	ssize_t bytes;
+	char *p, *e = 0;
+
+	if (wsh->sock == ws_sock_invalid) {
+		return -3;
+	}
+
+	while((bytes = ws_raw_read(wsh, wsh->buffer + wsh->datalen, wsh->buflen - wsh->datalen, WS_BLOCK)) > 0) {
+		wsh->datalen += bytes;
+		if (strstr(wsh->buffer, "\r\n\r\n") || strstr(wsh->buffer, "\n\n")) {
+			break;
+		}
+	}
+
+	if (bytes < 0 || bytes > wsh->buflen -1) {
+		goto err;
+	}
+
+	*(wsh->buffer + wsh->datalen) = '\0';
+
+	if (strncasecmp(wsh->buffer, "GET ", 4)) {
+		goto err;
+	}
+
+	p = wsh->buffer + 4;
+
+	e = strchr(p, ' ');
+	if (!e) {
+		goto err;
+	}
+
+	wsh->uri = malloc((e-p) + 1);
+	strncpy(wsh->uri, p, e-p);
+	*(wsh->uri + (e-p)) = '\0';
+
+	cheezy_get_var(wsh->buffer, "Sec-WebSocket-Key", key, sizeof(key));
+	cheezy_get_var(wsh->buffer, "Sec-WebSocket-Version", version, sizeof(version));
+	cheezy_get_var(wsh->buffer, "Sec-WebSocket-Protocol", proto, sizeof(proto));
+
+	if (!*key) {
+		goto err;
+	}
+
+	snprintf(input, sizeof(input), "%s%s", key, WEBSOCKET_GUID);
+	sha1_digest(output, input);
+	b64encode((unsigned char *)output, SHA1_HASH_SIZE, (unsigned char *)b64, sizeof(b64));
+
+	if (*proto) {
+		snprintf(proto_buf, sizeof(proto_buf), "Sec-WebSocket-Protocol: %s\r\n", proto);
+	}
+
+	snprintf(respond, sizeof(respond),
+			 "HTTP/1.1 101 Switching Protocols\r\n"
+			 "Upgrade: websocket\r\n"
+			 "Connection: Upgrade\r\n"
+			 "Sec-WebSocket-Accept: %s\r\n"
+			 "%s\r\n",
+			 b64,
+			 proto_buf);
+	respond[1023] = 0;
+
+	if (ws_raw_write(wsh, respond, strlen(respond)) != (ssize_t)strlen(respond)) {
+		goto err;
+	}
+
+	wsh->handshake = 1;
+
+	return 0;
+
+ err:
+
+	if (!wsh->stay_open) {
+
+		if (bytes > 0) {
+			snprintf(respond, sizeof(respond), "HTTP/1.1 400 Bad Request\r\n"
+					 "Sec-WebSocket-Version: 13\r\n\r\n");
+			respond[1023] = 0;
+
+			ws_raw_write(wsh, respond, strlen(respond));
+		}
+
+		ws_close(wsh, WS_NONE);
+	}
+
+	return -1;
+
+}
+
+ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block)
+{
+	ssize_t r;
+	int err = 0;
+
+	wsh->x++;
+	if (wsh->x > 250) ms_sleep(1);
+
+	if (wsh->ssl) {
+		do {
+			r = SSL_read(wsh->ssl, data, bytes);
+
+			if (r == -1) {
+				err = SSL_get_error(wsh->ssl, r);
+
+				if (err == SSL_ERROR_WANT_READ) {
+					if (!block) {
+						r = -2;
+						goto end;
+					}
+					wsh->x++;
+					ms_sleep(10);
+				} else {
+					r = -1;
+					goto end;
+				}
+			}
+
+		} while (r == -1 && err == SSL_ERROR_WANT_READ && wsh->x < 1000);
+
+		goto end;
+	}
+
+	do {
+
+		r = recv(wsh->sock, data, bytes, 0);
+
+		if (r == -1) {
+			if (!block && xp_is_blocking(xp_errno())) {
+				r = -2;
+				goto end;
+			}
+
+			if (block) {
+				wsh->x++;
+				ms_sleep(10);
+			}
+		}
+	} while (r == -1 && xp_is_blocking(xp_errno()) && wsh->x < 1000);
+
+ end:
+
+	if (wsh->x >= 10000 || (block && wsh->x >= 1000)) {
+		r = -1;
+	}
+
+	if (r > 0) {
+		*((char *)data + r) = '\0';
+	}
+
+	if (r >= 0) {
+		wsh->x = 0;
+	}
+
+	return r;
+}
+
+ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes)
+{
+	ssize_t r;
+	int sanity = WS_WRITE_SANITY;
+	int ssl_err = 0;
+	size_t wrote = 0;
+
+	if (wsh->ssl) {
+		do {
+			r = SSL_write(wsh->ssl, (void *)((unsigned char *)data + wrote), bytes - wrote);
+
+			if (r == 0) {
+				ssl_err = 42;
+				break;
+			}
+			
+			if (r > 0) {
+				wrote += r;
+			}
+
+			if (sanity < WS_WRITE_SANITY) {
+				int ms = 1;
+
+				if (wsh->block) {
+					if (sanity < WS_WRITE_SANITY * 3 / 4) {
+						ms = 50;
+					} else if (sanity < WS_WRITE_SANITY / 2) {
+						ms = 25;
+					}
+				}
+				ms_sleep(ms);
+			}
+
+			if (r == -1) {
+				ssl_err = SSL_get_error(wsh->ssl, r);
+
+				if (ssl_err != SSL_ERROR_WANT_WRITE && ssl_err != SSL_ERROR_WANT_READ) {
+					break;
+				}
+				ssl_err = 0;
+			}
+
+		} while (--sanity > 0 && wrote < bytes);
+
+		if (!sanity) ssl_err = 56;
+		
+		if (ssl_err) {
+			r = ssl_err * -1;
+		}
+
+		return r;
+	}
+
+	do {
+		r = send(wsh->sock, (void *)((unsigned char *)data + wrote), bytes - wrote, 0);
+
+		if (r > 0) {
+			wrote += r;
+		}
+
+		if (sanity < WS_WRITE_SANITY) {
+			int ms = 1;
+
+			if (wsh->block) {
+				if (sanity < WS_WRITE_SANITY * 3 / 4) {
+					ms = 50;
+				} else if (sanity < WS_WRITE_SANITY / 2) {
+					ms = 25;
+				}
+			}
+			ms_sleep(ms);
+		}
+
+		if (r == -1) {
+			if (!xp_is_blocking(xp_errno())) {
+				break;
+			}
+		}
+
+	} while (--sanity > 0 && wrote < bytes);
+
+	//if (r<0) {
+		//printf("wRITE FAIL: %s\n", strerror(errno));
+	//}
+
+	return r < 0 ? r : wrote;
+}
+
+#ifdef _MSC_VER
+static int setup_socket(ws_socket_t sock)
+{
+	unsigned long v = 1;
+
+	if (ioctlsocket(sock, FIONBIO, &v) == SOCKET_ERROR) {
+		return -1;
+	}
+
+	return 0;
+
+}
+
+static int restore_socket(ws_socket_t sock)
+{
+	unsigned long v = 0;
+
+	if (ioctlsocket(sock, FIONBIO, &v) == SOCKET_ERROR) {
+		return -1;
+	}
+
+	return 0;
+
+}
+
+#else
+
+static int setup_socket(ws_socket_t sock)
+{
+	int flags = fcntl(sock, F_GETFL, 0);
+	return fcntl(sock, F_SETFL, flags | O_NONBLOCK);
+}
+
+static int restore_socket(ws_socket_t sock)
+{
+	int flags = fcntl(sock, F_GETFL, 0);
+
+	flags &= ~O_NONBLOCK;
+
+	return fcntl(sock, F_SETFL, flags);
+
+}
+
+#endif
+
+
+int establish_logical_layer(wsh_t *wsh)
+{
+
+	if (!wsh->sanity) {
+		return -1;
+	}
+
+	if (wsh->logical_established) {
+		return 0;
+	}
+
+	if (wsh->secure && !wsh->secure_established) {
+		int code;
+
+		if (!wsh->ssl) {
+			wsh->ssl = SSL_new(wsh->ssl_ctx);
+			assert(wsh->ssl);
+
+			SSL_set_fd(wsh->ssl, wsh->sock);
+		}
+
+		do {
+			code = SSL_accept(wsh->ssl);
+
+			if (code == 1) {
+				wsh->secure_established = 1;
+				break;
+			}
+
+			if (code == 0) {
+				return -1;
+			}
+
+			if (code < 0) {
+				if (code == -1 && SSL_get_error(wsh->ssl, code) != SSL_ERROR_WANT_READ) {
+					return -1;
+				}
+			}
+
+			if (wsh->block) {
+				ms_sleep(10);
+			} else {
+				ms_sleep(1);
+			}
+
+			wsh->sanity--;
+
+			if (!wsh->block) {
+				return -2;
+			}
+
+		} while (wsh->sanity > 0);
+
+		if (!wsh->sanity) {
+			return -1;
+		}
+
+	}
+
+	while (!wsh->down && !wsh->handshake) {
+		int r = ws_handshake(wsh);
+
+		if (r < 0) {
+			wsh->down = 1;
+			return -1;
+		}
+
+		if (!wsh->handshake && !wsh->block) {
+			return -2;
+		}
+
+	}
+
+	wsh->logical_established = 1;
+
+	return 0;
+}
+
+
+int ws_init(wsh_t *wsh, ws_socket_t sock, SSL_CTX *ssl_ctx, int close_sock, int block, int stay_open)
+{
+	memset(wsh, 0, sizeof(*wsh));
+
+	wsh->sock = sock;
+	wsh->block = block;
+	wsh->sanity = WS_INIT_SANITY;
+	wsh->ssl_ctx = ssl_ctx;
+	wsh->stay_open = stay_open;
+
+	if (!ssl_ctx) {
+		ssl_ctx = ws_globals.ssl_ctx;
+	}
+
+	if (close_sock) {
+		wsh->close_sock = 1;
+	}
+
+	wsh->buflen = 1024 * 64;
+	wsh->bbuflen = wsh->buflen;
+
+	wsh->buffer = malloc(wsh->buflen);
+	wsh->bbuffer = malloc(wsh->bbuflen);
+	//printf("init %p %ld\n", (void *) wsh->bbuffer, wsh->bbuflen);
+	//memset(wsh->buffer, 0, wsh->buflen);
+	//memset(wsh->bbuffer, 0, wsh->bbuflen);
+
+	wsh->secure = ssl_ctx ? 1 : 0;
+
+	setup_socket(sock);
+
+	if (establish_logical_layer(wsh) == -1) {
+		return -1;
+	}
+
+	if (wsh->down) {
+		return -1;
+	}
+
+	return 0;
+}
+
+void ws_destroy(wsh_t *wsh)
+{
+
+	if (!wsh) {
+		return;
+	}
+
+	if (!wsh->down) {
+		ws_close(wsh, WS_NONE);
+	}
+
+	if (wsh->down > 1) {
+		return;
+	}
+
+	wsh->down = 2;
+
+	if (wsh->write_buffer) {
+		free(wsh->write_buffer);
+		wsh->write_buffer = NULL;
+		wsh->write_buffer_len = 0;
+	}
+
+	if (wsh->ssl) {
+		int code;
+		do {
+			code = SSL_shutdown(wsh->ssl);
+		} while (code == -1 && SSL_get_error(wsh->ssl, code) == SSL_ERROR_WANT_READ);
+
+		SSL_free(wsh->ssl);
+		wsh->ssl = NULL;
+	}
+
+	if (wsh->buffer) free(wsh->buffer);
+	if (wsh->bbuffer) free(wsh->bbuffer);
+
+	wsh->buffer = wsh->bbuffer = NULL;
+
+}
+
+ssize_t ws_close(wsh_t *wsh, int16_t reason)
+{
+
+	if (wsh->down) {
+		return -1;
+	}
+
+	wsh->down = 1;
+
+	if (wsh->uri) {
+		free(wsh->uri);
+		wsh->uri = NULL;
+	}
+
+	if (reason && wsh->sock != ws_sock_invalid) {
+		uint16_t *u16;
+		uint8_t fr[4] = {WSOC_CLOSE | 0x80, 2, 0};
+
+		u16 = (uint16_t *) &fr[2];
+		*u16 = htons((int16_t)reason);
+		ws_raw_write(wsh, fr, 4);
+	}
+
+	restore_socket(wsh->sock);
+
+	if (wsh->close_sock && wsh->sock != ws_sock_invalid) {
+#ifndef WIN32
+		close(wsh->sock);
+#else
+		closesocket(wsh->sock);
+#endif
+	}
+
+	wsh->sock = ws_sock_invalid;
+
+	return reason * -1;
+
+}
+
+
+uint64_t hton64(uint64_t val)
+{
+	if (__BYTE_ORDER == __BIG_ENDIAN) return (val);
+	else return __bswap_64(val);
+}
+
+uint64_t ntoh64(uint64_t val)
+{
+	if (__BYTE_ORDER == __BIG_ENDIAN) return (val);
+	else return __bswap_64(val);
+}
+
+
+ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
+{
+
+	ssize_t need = 2;
+	char *maskp;
+	int ll = 0;
+	int frag = 0;
+	int blen;
+
+	wsh->body = wsh->bbuffer;
+	wsh->packetlen = 0;
+
+ again:
+	need = 2;
+	maskp = NULL;
+	*data = NULL;
+
+	ll = establish_logical_layer(wsh);
+
+	if (ll < 0) {
+		return ll;
+	}
+
+	if (wsh->down) {
+		return -1;
+	}
+
+	if (!wsh->handshake) {
+		return ws_close(wsh, WS_NONE);
+	}
+
+	if ((wsh->datalen = ws_raw_read(wsh, wsh->buffer, 9, wsh->block)) < 0) {
+		if (wsh->datalen == -2) {
+			return -2;
+		}
+		return ws_close(wsh, WS_NONE);
+	}
+
+	if (wsh->datalen < need) {
+		ssize_t bytes = ws_raw_read(wsh, wsh->buffer + wsh->datalen, 9 - wsh->datalen, WS_BLOCK);
+		
+		if (bytes < 0 || (wsh->datalen += bytes) < need) {
+			/* too small - protocol err */
+			return ws_close(wsh, WS_NONE);
+		}
+	}
+
+	*oc = *wsh->buffer & 0xf;
+
+	switch(*oc) {
+	case WSOC_CLOSE:
+		{
+			wsh->plen = wsh->buffer[1] & 0x7f;
+			*data = (uint8_t *) &wsh->buffer[2];
+			return ws_close(wsh, 1000);
+		}
+		break;
+	case WSOC_CONTINUATION:
+	case WSOC_TEXT:
+	case WSOC_BINARY:
+	case WSOC_PING:
+	case WSOC_PONG:
+		{
+			int fin = (wsh->buffer[0] >> 7) & 1;
+			int mask = (wsh->buffer[1] >> 7) & 1;
+
+
+			if (!fin && *oc != WSOC_CONTINUATION) {
+				frag = 1;
+			} else if (fin && *oc == WSOC_CONTINUATION) {
+				frag = 0;
+			}
+
+			if (mask) {
+				need += 4;
+
+				if (need > wsh->datalen) {
+					/* too small - protocol err */
+					*oc = WSOC_CLOSE;
+					return ws_close(wsh, WS_NONE);
+				}
+			}
+
+			wsh->plen = wsh->buffer[1] & 0x7f;
+			wsh->payload = &wsh->buffer[2];
+
+			if (wsh->plen == 127) {
+				uint64_t *u64;
+				int more = 0;
+
+				need += 8;
+
+				if (need > wsh->datalen) {
+					/* too small - protocol err */
+					//*oc = WSOC_CLOSE;
+					//return ws_close(wsh, WS_PROTO_ERR);
+
+					more = ws_raw_read(wsh, wsh->buffer + wsh->datalen, need - wsh->datalen, WS_BLOCK);
+
+					if (more < 0 || more < need - wsh->datalen) {
+						*oc = WSOC_CLOSE;
+						return ws_close(wsh, WS_NONE);
+					} else {
+						wsh->datalen += more;
+					}
+
+
+				}
+
+				u64 = (uint64_t *) wsh->payload;
+				wsh->payload += 8;
+				wsh->plen = ntoh64(*u64);
+			} else if (wsh->plen == 126) {
+				uint16_t *u16;
+
+				need += 2;
+
+				if (need > wsh->datalen) {
+					/* too small - protocol err */
+					*oc = WSOC_CLOSE;
+					return ws_close(wsh, WS_NONE);
+				}
+
+				u16 = (uint16_t *) wsh->payload;
+				wsh->payload += 2;
+				wsh->plen = ntohs(*u16);
+			}
+
+			if (mask) {
+				maskp = (char *)wsh->payload;
+				wsh->payload += 4;
+			}
+
+			need = (wsh->plen - (wsh->datalen - need));
+
+			if (need < 0) {
+				/* invalid read - protocol err .. */
+				*oc = WSOC_CLOSE;
+				return ws_close(wsh, WS_NONE);
+			}
+
+			blen = wsh->body - wsh->bbuffer;
+
+			if (need + blen > (ssize_t)wsh->bbuflen) {
+				void *tmp;
+
+				wsh->bbuflen = need + blen + wsh->rplen;
+
+				if ((tmp = realloc(wsh->bbuffer, wsh->bbuflen))) {
+					wsh->bbuffer = tmp;
+				} else {
+					abort();
+				}
+
+				wsh->body = wsh->bbuffer + blen;
+			}
+
+			wsh->rplen = wsh->plen - need;
+
+			if (wsh->rplen) {
+				memcpy(wsh->body, wsh->payload, wsh->rplen);
+			}
+
+			while(need) {
+				ssize_t r = ws_raw_read(wsh, wsh->body + wsh->rplen, need, WS_BLOCK);
+
+				if (r < 1) {
+					/* invalid read - protocol err .. */
+					*oc = WSOC_CLOSE;
+					return ws_close(wsh, WS_NONE);
+				}
+
+				wsh->datalen += r;
+				wsh->rplen += r;
+				need -= r;
+			}
+
+			if (mask && maskp) {
+				ssize_t i;
+
+				for (i = 0; i < wsh->datalen; i++) {
+					wsh->body[i] ^= maskp[i % 4];
+				}
+			}
+
+
+			if (*oc == WSOC_PING) {
+				ws_write_frame(wsh, WSOC_PONG, wsh->body, wsh->rplen);
+				goto again;
+			}
+
+			*(wsh->body+wsh->rplen) = '\0';
+			wsh->packetlen += wsh->rplen;
+			wsh->body += wsh->rplen;
+
+			if (frag) {
+				goto again;
+			}
+
+			*data = (uint8_t *)wsh->bbuffer;
+
+			//printf("READ[%ld][%d]-----------------------------:\n[%s]\n-------------------------------\n", wsh->packetlen, *oc, (char *)*data);
+
+
+			return wsh->packetlen;
+		}
+		break;
+	default:
+		{
+			/* invalid op code - protocol err .. */
+			*oc = WSOC_CLOSE;
+			return ws_close(wsh, WS_PROTO_ERR);
+		}
+		break;
+	}
+}
+
+ssize_t ws_write_frame(wsh_t *wsh, ws_opcode_t oc, void *data, size_t bytes)
+{
+	uint8_t hdr[14] = { 0 };
+	size_t hlen = 2;
+	uint8_t *bp;
+	ssize_t raw_ret = 0;
+
+	if (wsh->down) {
+		return -1;
+	}
+
+	//printf("WRITE[%ld]-----------------------------:\n[%s]\n-----------------------------------\n", bytes, (char *) data);
+
+	hdr[0] = (uint8_t)(oc | 0x80);
+
+	if (bytes < 126) {
+		hdr[1] = (uint8_t)bytes;
+	} else if (bytes < 0x10000) {
+		uint16_t *u16;
+
+		hdr[1] = 126;
+		hlen += 2;
+
+		u16 = (uint16_t *) &hdr[2];
+		*u16 = htons((uint16_t) bytes);
+
+	} else {
+		uint64_t *u64;
+
+		hdr[1] = 127;
+		hlen += 8;
+
+		u64 = (uint64_t *) &hdr[2];
+		*u64 = hton64(bytes);
+	}
+
+	if (wsh->write_buffer_len < (hlen + bytes + 1)) {
+		void *tmp;
+
+		wsh->write_buffer_len = hlen + bytes + 1;
+		if ((tmp = realloc(wsh->write_buffer, wsh->write_buffer_len))) {
+			wsh->write_buffer = tmp;
+		} else {
+			abort();
+		}
+	}
+
+	bp = (uint8_t *) wsh->write_buffer;
+	memcpy(bp, (void *) &hdr[0], hlen);
+	memcpy(bp + hlen, data, bytes);
+
+	raw_ret = ws_raw_write(wsh, bp, (hlen + bytes));
+
+	if (raw_ret != (ssize_t) (hlen + bytes)) {
+		return raw_ret;
+	}
+
+	return bytes;
+}
+
+#ifdef _MSC_VER
+
+int xp_errno(void)
+{
+	return WSAGetLastError();
+}
+
+int xp_is_blocking(int errcode)
+{
+	return errcode == WSAEWOULDBLOCK || errcode == WSAEINPROGRESS;
+}
+
+#else
+
+int xp_errno(void)
+{
+	return errno;
+}
+
+int xp_is_blocking(int errcode)
+{
+  return errcode == EAGAIN || errcode == EWOULDBLOCK || errcode == EINPROGRESS || errcode == EINTR || errcode == ETIMEDOUT;
+}
+
+#endif
diff --git a/src/mod/applications/mod_av/Makefile.am b/src/mod/applications/mod_av/Makefile.am
index ebf4c93929..640b5a8278 100644
--- a/src/mod/applications/mod_av/Makefile.am
+++ b/src/mod/applications/mod_av/Makefile.am
@@ -14,7 +14,7 @@ endif
 noinst_LTLIBRARIES = libavmod.la
 
 libavmod_la_SOURCES  = mod_av.c avformat.c avcodec.c
-libavmod_la_CFLAGS   = $(AM_CFLAGS) $(AVFORMAT_CFLAGS) $(AVCODEC_CFLAGS) $(SWSCALE_CFLAGS) $(AVUTIL_CFLAGS) $(RESAMPLE_CFLAGS)
+libavmod_la_CFLAGS   = $(AM_CFLAGS) $(AVFORMAT_CFLAGS) $(AVCODEC_CFLAGS) $(SWSCALE_CFLAGS) $(AVUTIL_CFLAGS) $(RESAMPLE_CFLAGS) -Wno-deprecated-declarations
 
 mod_LTLIBRARIES = mod_av.la
 mod_av_la_SOURCES  =
diff --git a/src/mod/applications/mod_av/test/test_avformat.c b/src/mod/applications/mod_av/test/test_avformat.c
index 5a0043e6cc..7dc194257d 100644
--- a/src/mod/applications/mod_av/test/test_avformat.c
+++ b/src/mod/applications/mod_av/test/test_avformat.c
@@ -171,7 +171,6 @@ FST_CORE_BEGIN("conf")
 			switch_frame_t frame = { 0 };
 			switch_size_t len = SAMPLES;
 			uint32_t flags = SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT | SWITCH_FILE_FLAG_VIDEO;
-			int i = 0;
 
 			sprintf(path, "{no_video_decode=true}%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, "../test_RGB.mp4");
 			// switch_set_string(path, "{no_video_decode=true}/usr/local/freeswitch/storage/bingbing.mp4");
diff --git a/src/mod/applications/mod_conference/conference_event.c b/src/mod/applications/mod_conference/conference_event.c
index a88a5feab9..6d35ccbfd2 100644
--- a/src/mod/applications/mod_conference/conference_event.c
+++ b/src/mod/applications/mod_conference/conference_event.c
@@ -107,8 +107,8 @@ void conference_event_mod_channel_handler(const char *event_channel, cJSON *json
 			}
 		}
 	}
-
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "conf %s CMD %s [%s] %s\n", conference_name, key, action ? action : "N/A", cid);
+	if (key)
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "conf %s CMD %s [%s] %s\n", conference_name, key, action ? action : "N/A", cid);
 
 	if (zstr(action)) {
 		goto end;
diff --git a/src/mod/asr_tts/mod_flite/Makefile.am b/src/mod/asr_tts/mod_flite/Makefile.am
index 76493d6424..7253608de8 100644
--- a/src/mod/asr_tts/mod_flite/Makefile.am
+++ b/src/mod/asr_tts/mod_flite/Makefile.am
@@ -5,7 +5,7 @@ if HAVE_FLITE
 
 mod_LTLIBRARIES = mod_flite.la
 mod_flite_la_SOURCES  = mod_flite.c
-mod_flite_la_CFLAGS   = $(AM_CFLAGS) $(FLITE_CFLAGS)
+mod_flite_la_CFLAGS   = $(AM_CFLAGS) $(FLITE_CFLAGS) -Wno-error=pedantic
 mod_flite_la_LIBADD   = $(switch_builddir)/libfreeswitch.la $(FLITE_LIBS)
 mod_flite_la_LDFLAGS  = -avoid-version -module -no-undefined -shared
 
diff --git a/src/mod/asr_tts/mod_flite/mod_flite.c b/src/mod/asr_tts/mod_flite/mod_flite.c
index b735c151dd..4850fc7385 100644
--- a/src/mod/asr_tts/mod_flite/mod_flite.c
+++ b/src/mod/asr_tts/mod_flite/mod_flite.c
@@ -31,7 +31,8 @@
  */
 
 #include <switch.h>
-#include <flite/flite.h>
+#include <flite.h>
+#include <dlfcn.h>
 
 cst_voice *register_cmu_us_awb(void);
 void unregister_cmu_us_awb(cst_voice * v);
@@ -45,10 +46,6 @@ void unregister_cmu_us_rms(cst_voice * v);
 cst_voice *register_cmu_us_slt(void);
 void unregister_cmu_us_slt(cst_voice * v);
 
-cst_voice *register_cmu_us_kal16(void);
-void unregister_cmu_us_kal16(cst_voice * v);
-
-
 SWITCH_MODULE_LOAD_FUNCTION(mod_flite_load);
 SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_flite_shutdown);
 SWITCH_MODULE_DEFINITION(mod_flite, mod_flite_load, mod_flite_shutdown, NULL);
@@ -58,7 +55,10 @@ static struct {
 	cst_voice *kal;
 	cst_voice *rms;
 	cst_voice *slt;
-	cst_voice *kal16;
+	void * (*uawb)(cst_voice *v);
+	void * (*ukal)(cst_voice *v);
+	void * (*urms)(cst_voice *v);
+	void * (*uslt)(cst_voice *v);
 } globals;
 
 struct flite_data {
@@ -86,16 +86,13 @@ static switch_status_t flite_speech_open(switch_speech_handle_t *sh, const char
 	if (!strcasecmp(voice_name, "awb")) {
 		flite->v = globals.awb;
 	} else if (!strcasecmp(voice_name, "kal")) {
-/*  "kal" is 8kHz and the native rate is set to 16kHz
- *  so kal talks a little bit too fast ...
- *  for now: "symlink" kal to kal16
- */		flite->v = globals.kal16;
+		flite->v = globals.kal;
 	} else if (!strcasecmp(voice_name, "rms")) {
 		flite->v = globals.rms;
 	} else if (!strcasecmp(voice_name, "slt")) {
 		flite->v = globals.slt;
 	} else if (!strcasecmp(voice_name, "kal16")) {
-		flite->v = globals.kal16;
+		flite->v = globals.kal;
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Valid voice names are awb, rms, slt or kal.\n");
 	}
@@ -189,13 +186,36 @@ static void flite_float_param_tts(switch_speech_handle_t *sh, char *param, doubl
 SWITCH_MODULE_LOAD_FUNCTION(mod_flite_load)
 {
 	switch_speech_interface_t *speech_interface;
+	void * vawb = dlopen("libflite_cmu_us_awb.so.1", RTLD_NOW | RTLD_GLOBAL);
+	void * vkal = dlopen("libflite_cmu_us_kal16.so.1", RTLD_NOW | RTLD_GLOBAL);
+	void * vrms = dlopen("libflite_cmu_us_rms.so.1", RTLD_NOW | RTLD_GLOBAL);
+	void * vslt = dlopen("libflite_cmu_us_slt.so.1", RTLD_NOW | RTLD_GLOBAL);
 
 	flite_init();
-	globals.awb = register_cmu_us_awb();
-	globals.kal = register_cmu_us_kal();
-	globals.rms = register_cmu_us_rms();
-	globals.slt = register_cmu_us_slt();
-	globals.kal16 = register_cmu_us_kal16();
+
+	if (vawb != NULL) {
+		void * (*reg)(void) = dlsym(vawb, "register_cmu_us_awb");
+		globals.uawb = dlsym(vawb, "unregister_cmu_us_awb");
+		globals.awb = reg();
+	}
+
+	if (vkal != NULL) {
+		void * (*reg)(void) = dlsym(vkal, "register_cmu_us_kal16");
+		globals.ukal = dlsym(vkal, "unregister_cmu_us_kal16");
+		globals.kal = reg();
+	}
+
+	if (vrms != NULL) {
+		void * (*reg)(void) = dlsym(vrms, "register_cmu_us_rms");
+		globals.urms = dlsym(vrms, "unregister_cmu_us_rms");
+		globals.rms = reg();
+	}
+
+	if (vslt != NULL) {
+		void * (*reg)(void) = dlsym(vslt, "register_cmu_us_slt");
+		globals.uslt = dlsym(vslt, "unregister_cmu_us_slt");
+		globals.slt = reg();
+	}
 
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
@@ -216,11 +236,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_flite_load)
 
 SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_flite_shutdown)
 {
-	unregister_cmu_us_awb(globals.awb);
-	unregister_cmu_us_kal(globals.kal);
-	unregister_cmu_us_rms(globals.rms);
-	unregister_cmu_us_slt(globals.slt);
-	unregister_cmu_us_kal16(globals.kal16);
+	(globals.uawb)(globals.awb);
+	(globals.ukal)(globals.kal);
+	(globals.urms)(globals.rms);
+	(globals.uslt)(globals.slt);
 
 	return SWITCH_STATUS_UNLOAD;
 }
diff --git a/src/mod/formats/mod_imagick/mod_imagick.c b/src/mod/formats/mod_imagick/mod_imagick.c
index 5c185a5e44..c78b92f1ec 100644
--- a/src/mod/formats/mod_imagick/mod_imagick.c
+++ b/src/mod/formats/mod_imagick/mod_imagick.c
@@ -488,10 +488,13 @@ static void myErrorHandler(const ExceptionType t, const char *reason, const char
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s: %s\n", reason, description);
 }
 
+#pragma GCC diagnostic pop
+#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
 static void myFatalErrorHandler(const ExceptionType t, const char *reason, const char *description)
 {
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "%s: %s\n", reason, description);
 }
+#pragma GCC diagnostic push
 
 static void myWarningHandler(const ExceptionType t, const char *reason, const char *description)
 {
diff --git a/src/mod/languages/mod_perl/Makefile.am b/src/mod/languages/mod_perl/Makefile.am
index c1be5d6839..6d14ddabc7 100644
--- a/src/mod/languages/mod_perl/Makefile.am
+++ b/src/mod/languages/mod_perl/Makefile.am
@@ -2,9 +2,9 @@ include $(top_srcdir)/build/modmake.rulesam
 MODNAME=mod_perl
 PERL        = perl
 PERL_LIBDIR =-L`perl -MConfig -e 'print $$Config{archlib}'`/CORE
-PERL_LIBS   =`perl -MConfig -e 'print $$Config{libs}'`
+PERL_LIBS   =`perl -MConfig -e 'print $$Config{vendorarch}'`
 
-perldir=$(prefix)/perl
+perldir=$(PERL_ARCHLIB)/auto/freeswitch
 mod_LTLIBRARIES = mod_perl.la
 perl_LTLIBRARIES = freeswitch.la
 mod_perl_la_SOURCES  = mod_perl.c freeswitch_perl.cpp mod_perl_wrap.cpp perlxsi.c
@@ -37,5 +37,4 @@ orig: mod_perl_wrap.cpp
 
 install-data-local:
 	mkdir -p $(DESTDIR)$(perldir)
-	$(INSTALL) freeswitch.pm $(DESTDIR)$(perldir)
-	if [ ! -f $(DESTDIR)$(perldir)/freeswitch.pm ] ; then $(INSTALL) freeswitch.pm $(DESTDIR)$(perldir) ; fi
+	$(INSTALL) freeswitch.pm $(DESTDIR)$(PERL_ARCHLIB)
diff --git a/src/mod/languages/mod_v8/include/fscurl.hpp b/src/mod/languages/mod_v8/include/fscurl.hpp
index 0a01d264d4..39f7984174 100644
--- a/src/mod/languages/mod_v8/include/fscurl.hpp
+++ b/src/mod/languages/mod_v8/include/fscurl.hpp
@@ -45,7 +45,7 @@
 class FSCURL : public JSBase
 {
 private:
-	switch_CURL *_curl_handle;
+	CURL *_curl_handle;
 	v8::Persistent<v8::Function> _function;
 	v8::Persistent<v8::Object> _user_data;
 	v8::Persistent<v8::Value> _ret;
diff --git a/src/mod/xml_int/mod_xml_rpc/Makefile.am b/src/mod/xml_int/mod_xml_rpc/Makefile.am
index 58066dd008..bd0b901a3f 100644
--- a/src/mod/xml_int/mod_xml_rpc/Makefile.am
+++ b/src/mod/xml_int/mod_xml_rpc/Makefile.am
@@ -5,78 +5,11 @@ mod_LTLIBRARIES = mod_xml_rpc.la
 mod_xml_rpc_la_SOURCES  = mod_xml_rpc.c ws.c
 mod_xml_rpc_la_LIBADD   = $(switch_builddir)/libfreeswitch.la
 mod_xml_rpc_la_LDFLAGS  = -avoid-version -module -no-undefined -shared
+mod_xml_rpc_la_LDFLAGS += -lxmlrpc -lxmlrpc_util -lxmlrpc_abyss -lxmlrpc_server -lxmlrpc_server_abyss
 
-if SYSTEM_XMLRPCC
-mod_xml_rpc_la_CFLAGS=$(SYS_XMLRPC_CFLAGS)
-mod_xml_rpc_la_LDFLAGS+=$(SYS_XMLRPC_LDFLAGS)
-else
-MAKEFLAGS=-j1
 XMLRPC_DIR=$(switch_srcdir)/libs/xmlrpc-c
 XMLRPC_BUILDDIR=$(switch_builddir)/libs/xmlrpc-c
-mod_xml_rpc_la_CFLAGS  = -I$(XMLRPC_DIR)/lib/expat/xmlparse -I$(XMLRPC_DIR)/lib/expat/xmltok -I$(XMLRPC_DIR) -I$(XMLRPC_DIR)/include
-mod_xml_rpc_la_CFLAGS  += -I$(XMLRPC_DIR)/lib/abyss/src -I$(XMLRPC_DIR)/lib/util/include -D_THREAD -D__EXTENSIONS__ -D_GNU_SOURCE
-mod_xml_rpc_la_CFLAGS  += -I$(XMLRPC_BUILDDIR)/include 
-mod_xml_rpc_la_SOURCES += ../../../../libs/xmlrpc-c/src/version.c\
-../../../../libs/xmlrpc-c/lib/libutil/asprintf.c\
-../../../../libs/xmlrpc-c/lib/util/casprintf.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/channel.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/chanswitch.c\
-../../../../libs/xmlrpc-c/lib/util/cmdline_parser.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/conf.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/conn.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/data.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/date.c\
-../../../../libs/xmlrpc-c/src/double.c\
-../../../../libs/xmlrpc-c/lib/libutil/error.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/file.c\
-../../../../libs/xmlrpc-c/lib/expat/gennmtab/gennmtab.c\
-../../../../libs/xmlrpc-c/lib/util/getoptx.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/handler.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/http.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/init.c\
-../../../../libs/xmlrpc-c/lib/libutil/make_printable.c\
-../../../../libs/xmlrpc-c/lib/libutil/memblock.c\
-../../../../libs/xmlrpc-c/src/method.c\
-../../../../libs/xmlrpc-c/src/parse_value.c\
-../../../../libs/xmlrpc-c/src/parse_datetime.c\
-../../../../libs/xmlrpc-c/src/registry.c\
-../../../../libs/xmlrpc-c/src/resource.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/response.c\
-../../../../libs/xmlrpc-c/lib/libutil/select.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/server.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/session.c\
-../../../../libs/xmlrpc-c/lib/libutil/sleep.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/socket.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/socket_unix.c\
-../../../../libs/xmlrpc-c/lib/util/string_parser.c\
-../../../../libs/xmlrpc-c/lib/util/stripcaseeq.c\
-../../../../libs/xmlrpc-c/src/system_method.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/thread_pthread.c\
-../../../../libs/xmlrpc-c/lib/libutil/time.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/token.c\
-../../../../libs/xmlrpc-c/src/xml_trace.c\
-../../../../libs/xmlrpc-c/lib/abyss/src/trace.c\
-../../../../libs/xmlrpc-c/lib/libutil/utf8.c\
-../../../../libs/xmlrpc-c/lib/libutil/string_number.c\
-../../../../libs/xmlrpc-c/lib/libutil/base64.c\
-../../../../libs/xmlrpc-c/lib/expat/xmlparse/xmlparse.c\
-../../../../libs/xmlrpc-c/lib/expat/xmltok/xmlrole.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_array.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_authcookie.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_base64.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_build.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_data.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_datetime.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_decompose.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_expat.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_parse.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_serialize.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_server_abyss.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_server_cgi.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_string.c\
-../../../../libs/xmlrpc-c/src/xmlrpc_struct.c\
-../../../../libs/xmlrpc-c/lib/expat/xmltok/xmltok.c
-endif
-
-mod_xml_rpc_la_CFLAGS  += $(AM_CFLAGS) -I. -w
-
+mod_xml_rpc_la_CFLAGS  = $(AM_CFLAGS) -I. -w
+mod_xml_rpc_la_CFLAGS += -I$(XMLRPC_DIR)/lib/expat/xmlparse -I$(XMLRPC_DIR)/lib/expat/xmltok -I$(XMLRPC_DIR) -I$(XMLRPC_DIR)/include
+mod_xml_rpc_la_CFLAGS += -I$(XMLRPC_DIR)/lib/abyss/src -I$(XMLRPC_DIR)/lib/util/include -D_THREAD -D__EXTENSIONS__ -D_GNU_SOURCE
+mod_xml_rpc_la_CFLAGS += -I$(XMLRPC_BUILDDIR)/include
diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
index 8e49462d2c..7e0de9f84c 100644
--- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
+++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
@@ -1216,6 +1216,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
 	char logfile[512];
 	switch_hash_index_t *hi;
 	const void *var;
+	const char *error;
 	void *val;
 
 	globals.running = 1;
@@ -1245,10 +1246,10 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
 	xmlrpc_server_abyss_set_handler(&env, &globals.abyssServer, "/RPC2", globals.registryP);
 
 	xmlrpc_env_clean(&env);
-
-	if (ServerInit(&globals.abyssServer) != TRUE) {
+	ServerInit2(&globals.abyssServer, &error);
+	if (error) {
 		globals.running = 0;
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to start HTTP Port %d\n", globals.port);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to start HTTP Port %d: %s\n", globals.port, error);
 		xmlrpc_registry_free(globals.registryP);
 		MIMETypeTerm();
 
diff --git a/src/switch_utils.c b/src/switch_utils.c
index c51953f0cf..6f5130c74e 100644
--- a/src/switch_utils.c
+++ b/src/switch_utils.c
@@ -1120,7 +1120,7 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
 {
 	char *bound = "XXXX_boundary_XXXX";
 	const char *mime_type = "audio/inline";
-	char filename[80], buf[B64BUFFLEN];
+	char filename[80] = { 0 }, buf[B64BUFFLEN];
 	int fd = -1, ifd = -1;
 	int x = 0, y = 0, bytes = 0, ilen = 0;
 	unsigned int b = 0, l = 0;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin