diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000000..5331fea2ad --- /dev/null +++ b/.drone.yml @@ -0,0 +1,47 @@ +--- +kind: pipeline +name: unit-tests + +steps: + - name: run-tests + image: signalwire/freeswitch-public-base + pull: true + commands: + - ./bootstrap.sh -j + - echo "applications/mod_test" >> modules.conf + - ./configure + - echo "#!/bin/bash\nmake -j`nproc --all` |& tee ./unit-tests-build-result.txt\nexitstatus=\${PIPESTATUS[0]}\necho \$exitstatus > ./build-status.txt\nmake install\n" > build.sh + - chmod +x build.sh + - ./build.sh + - cd tests/unit + - ./run-tests.sh + - mkdir logs && (mv log_run-tests_*.html logs || true) + - echo 0 > run-tests-status.txt + - ./collect-test-logs.sh && exit 0 || echo 'Some tests failed' + - echo 1 > run-tests-status.txt + - cd logs && ls -la + + - name: notify + image: signalwire/unit-tests-notify + pull: true + environment: + GITHUB_CI_APP_PEM: + from_secret: github_ci_app_pem + SSH_KEY: + from_secret: ssh_key + SLACK_WEBHOOK_URL: + from_secret: slack_webhook_url + commands: + - /root/notify.sh + +trigger: + branch: + - master + event: + - pull_request + - push +--- +kind: signature +hmac: a34718dd1e2b9468a845962219ff05cac0c922ddf90d885af557a937a9e412e0 + +... diff --git a/Freeswitch.2017.sln b/Freeswitch.2017.sln index 537439a95d..adad7bc73e 100644 --- a/Freeswitch.2017.sln +++ b/Freeswitch.2017.sln @@ -586,6 +586,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_pgsql", "src\mod\databa EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_mariadb", "src\mod\databases\mod_mariadb\mod_mariadb.2017.vcxproj", "{0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_switch_core_db", "tests\unit\test_switch_core_db.2017.vcxproj", "{580675D7-C1C9-4197-AAC5-00F64FAFDE78}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_switch_ivr_originate", "tests\unit\test_switch_ivr_originate.2017.vcxproj", "{69A7464A-9B0D-4804-A108-835229DACF58}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2689,6 +2693,30 @@ Global {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Release|Win32.Build.0 = Release|Win32 {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Release|x64.ActiveCfg = Release|x64 {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC}.Release|x64.Build.0 = Release|x64 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.All|Win32.ActiveCfg = Release|Win32 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.All|Win32.Build.0 = Release|Win32 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.All|x64.ActiveCfg = Release|x64 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.All|x64.Build.0 = Release|x64 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.Debug|Win32.ActiveCfg = Debug|Win32 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.Debug|Win32.Build.0 = Debug|Win32 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.Debug|x64.ActiveCfg = Debug|x64 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.Debug|x64.Build.0 = Debug|x64 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.Release|Win32.ActiveCfg = Release|Win32 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.Release|Win32.Build.0 = Release|Win32 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.Release|x64.ActiveCfg = Release|x64 + {580675D7-C1C9-4197-AAC5-00F64FAFDE78}.Release|x64.Build.0 = Release|x64 + {69A7464A-9B0D-4804-A108-835229DACF58}.All|Win32.ActiveCfg = Release|Win32 + {69A7464A-9B0D-4804-A108-835229DACF58}.All|Win32.Build.0 = Release|Win32 + {69A7464A-9B0D-4804-A108-835229DACF58}.All|x64.ActiveCfg = Release|x64 + {69A7464A-9B0D-4804-A108-835229DACF58}.All|x64.Build.0 = Release|x64 + {69A7464A-9B0D-4804-A108-835229DACF58}.Debug|Win32.ActiveCfg = Debug|Win32 + {69A7464A-9B0D-4804-A108-835229DACF58}.Debug|Win32.Build.0 = Debug|Win32 + {69A7464A-9B0D-4804-A108-835229DACF58}.Debug|x64.ActiveCfg = Debug|x64 + {69A7464A-9B0D-4804-A108-835229DACF58}.Debug|x64.Build.0 = Debug|x64 + {69A7464A-9B0D-4804-A108-835229DACF58}.Release|Win32.ActiveCfg = Release|Win32 + {69A7464A-9B0D-4804-A108-835229DACF58}.Release|Win32.Build.0 = Release|Win32 + {69A7464A-9B0D-4804-A108-835229DACF58}.Release|x64.ActiveCfg = Release|x64 + {69A7464A-9B0D-4804-A108-835229DACF58}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2901,6 +2929,8 @@ Global {BC1FD72E-1CD5-4525-A7F5-17C5740BFDED} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {1BA65811-5453-46F6-8190-9ECEEFEB7DF2} = {31C2761D-20E0-4BF8-98B9-E32F0D8DD6E1} {0B612F84-7533-4DEC-AEDD-5C9CBCF15EAC} = {31C2761D-20E0-4BF8-98B9-E32F0D8DD6E1} + {580675D7-C1C9-4197-AAC5-00F64FAFDE78} = {9388C266-C3FC-468A-92EF-0CBC35941412} + {69A7464A-9B0D-4804-A108-835229DACF58} = {9388C266-C3FC-468A-92EF-0CBC35941412} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {09840DE7-9208-45AA-9667-1A71EE93BD1E} diff --git a/Makefile.am b/Makefile.am index 2d144ce233..61b2c609da 100644 --- a/Makefile.am +++ b/Makefile.am @@ -586,7 +586,7 @@ libs/libzrtp/libzrtp.a: cd libs/libzrtp && $(MAKE) libs/libvpx/Makefile: libs/libvpx/.update - cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384 --extra-cflags="$(VISIBILITY_FLAG)" + cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(VISIBILITY_FLAG)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384 libs/libvpx/libvpx.a: libs/libvpx/Makefile libs/libvpx/.update @cd libs/libvpx && $(MAKE) @@ -684,7 +684,7 @@ is-scm: echo ; echo ; \ echo "*****************************************************************************************************" ; \ echo "You cannot update a release tarball without a git tree. Please clone FreeSWITCH as so: " ; \ - echo " git clone https://freeswitch.org/stash/scm/fs/freeswitch.git " ; \ + echo " git clone https://github.com/signalwire/freeswitch.git " ; \ echo "*****************************************************************************************************" ; \ echo ; echo ; \ exit 1; \ diff --git a/README.md b/README.md new file mode 100644 index 0000000000..77de167e3e --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ +# FreeSWITCH + +FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device. Combined with our hosted cloud platform, SignalWire, FreeSWITCH can interconnect with the outside world and scale to any size. + +Visit [https://signalwire.com](https://signalwire.com/) or https://github.com/signalwire for more info. + +## Getting Started + +FreeSWITCH is available on [Github](https://github.com/signalwire/freeswitch) in source code format. You can checkout the development branch and build for many poplular platforms including Linux, Windows, MacOSX and BSD. There is an issue tracker and pull request system available as part of the repo online. + +See [https://freeswitch.com/#getting-started](https://freeswitch.com/#getting-started) for more detailed instructions. + +## Additional Help + +If you need assistance or have an interest in using a commercially supported build, you can contact coreteam@freeswitch.com to learn about professional services to support your project. + +## Voice-over-IP services - SIP / SMS - App Integrations + +[SignalWire](https://signalwire.com) is the primary sponsor of the FreeSWITCH project and was founded by the original developers of FreeSWITCH. SignalWire provides scalable services to enhance and scale your project such as SMS, SIP, Serverless Application hosting as well as programmable telecom. mod_signalwire which is distributed in this code base allows you to instantly pair with SignalWire and extend your FreeSWITCH. + +## Documentation + +The main index for documentation is available at: + + * https://freeswitch.org/confluence/ + +### Release notes: + + * https://freeswitch.org/confluence/display/FREESWITCH/Release+Notes + +### Installation + +Step by step tutorials to install FreeSWITCH from packages or source code are available at: + + * [Debian 10 Buster](https://freeswitch.org/confluence/display/FREESWITCH/Debian+10+Buster) [Recommended] + * [Raspberry Pi](https://freeswitch.org/confluence/display/FREESWITCH/Raspberry+Pi) + * [CentOS 7](https://freeswitch.org/confluence/display/FREESWITCH/CentOS+7+and+RHEL+7) + +## Downloads + + * [Tarballs](https://files.freeswitch.org/releases/freeswitch/) + * [Windows Installer](http://files.freeswitch.org/windows/installer/x64/) + * [Windows Sound Packages](http://files.freeswitch.org/windows/installer/x64/sounds/) + +## Contributions + +GitHub pull requests are the recommended way to contribute to the FreeSWITCH source code: + + * https://github.com/signalwire/freeswitch/pulls + +## Community + +Slack is our chat system where the developers, the FreeSWITCH team, and the most active users are present. +This is the place to get answers faster and chat with other users in real time. All you need to do is enter your email and verify it on the Slack signup page and you are ready to join in the discussion! + +Slack Community: + * https://signalwire.community/ + +Mailing list: + + * http://lists.freeswitch.org/mailman/listinfo/freeswitch-users + +**Thank you for using FreeSWITCH!** \ No newline at end of file diff --git a/build/Makefile.centos5 b/build/Makefile.centos5 index cddd8f29ee..92dc5467a8 100644 --- a/build/Makefile.centos5 +++ b/build/Makefile.centos5 @@ -29,7 +29,7 @@ freeswitch.git/configure: freeswitch.git/bootstrap.sh cd freeswitch.git && sh bootstrap.sh freeswitch.git/bootstrap.sh: has-git - test -d freeswitch.git || git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git + test -d freeswitch.git || git clone https://github.com/signalwire/freeswitch.git freeswitch.git install: freeswitch cd freeswitch.git && make install cd-sounds-install cd-moh-install diff --git a/build/Makefile.centos6 b/build/Makefile.centos6 index 582c3192da..327c2e6454 100644 --- a/build/Makefile.centos6 +++ b/build/Makefile.centos6 @@ -19,7 +19,7 @@ freeswitch.git/configure: freeswitch.git/bootstrap.sh cd freeswitch.git && sh bootstrap.sh freeswitch.git/bootstrap.sh: has-git - test -d freeswitch.git || git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git + test -d freeswitch.git || git clone https://github.com/signalwire/freeswitch.git freeswitch.git rpmforge: (which rpm && rpm -i http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm) || true diff --git a/build/Makefile.openbsd b/build/Makefile.openbsd index c916ae0334..f23dff4075 100644 --- a/build/Makefile.openbsd +++ b/build/Makefile.openbsd @@ -24,7 +24,7 @@ freeswitch.git/configure: freeswitch.git/bootstrap.sh cd freeswitch.git && AUTOCONF_VERSION=2.69 AUTOMAKE_VERSION=1.14 LIBTOOL=/usr/local/bin/libtoolize sh bootstrap.sh freeswitch.git/bootstrap.sh: has-git - test -d freeswitch.git || git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git + test -d freeswitch.git || git clone https://github.com/signalwire/freeswitch.git freeswitch.git install: cd freeswitch.git && AUTOCONF_VERSION=2.69 AUTOMAKE_VERSION=1.14 LIBTOOL=/usr/local/bin/libtoolize gmake install cd-sounds-install cd-moh-install diff --git a/build/Makefile.solaris11 b/build/Makefile.solaris11 index 749773ffc3..dd35215961 100644 --- a/build/Makefile.solaris11 +++ b/build/Makefile.solaris11 @@ -31,7 +31,7 @@ freeswitch.git/configure: freeswitch.git/bootstrap.sh cd freeswitch.git && sh bootstrap.sh freeswitch.git/bootstrap.sh: has-git - test -d freeswitch.git || git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git + test -d freeswitch.git || git clone https://github.com/signalwire/freeswitch.git freeswitch.git install: freeswitch cd freeswitch.git && gmake install cd-sounds-install cd-moh-install diff --git a/build/next-release.txt b/build/next-release.txt index 63973ec2d4..7c64495cce 100644 --- a/build/next-release.txt +++ b/build/next-release.txt @@ -1 +1 @@ -1.10.1-release +1.10.2-release diff --git a/conf/vanilla/autoload_configs/amqp.conf.xml b/conf/vanilla/autoload_configs/amqp.conf.xml index d6c24f4ff7..3db3c32232 100644 --- a/conf/vanilla/autoload_configs/amqp.conf.xml +++ b/conf/vanilla/autoload_configs/amqp.conf.xml @@ -57,6 +57,10 @@ + + + + diff --git a/conf/vanilla/autoload_configs/msrp.conf.xml b/conf/vanilla/autoload_configs/msrp.conf.xml index 8b9e03e300..65c2d61976 100644 --- a/conf/vanilla/autoload_configs/msrp.conf.xml +++ b/conf/vanilla/autoload_configs/msrp.conf.xml @@ -1,8 +1,8 @@ - - + + diff --git a/configure.ac b/configure.ac index 95f4d16d42..57373a6b1e 100644 --- a/configure.ac +++ b/configure.ac @@ -3,10 +3,10 @@ # Must change all of the below together # For a release, set revision for that tagged release as well and uncomment -AC_INIT([freeswitch], [1.10.1-release], bugs@freeswitch.org) +AC_INIT([freeswitch], [1.10.2-release], bugs@freeswitch.org) AC_SUBST(SWITCH_VERSION_MAJOR, [1]) AC_SUBST(SWITCH_VERSION_MINOR, [10]) -AC_SUBST(SWITCH_VERSION_MICRO, [1-release]) +AC_SUBST(SWITCH_VERSION_MICRO, [2-release]) AC_SUBST(SWITCH_VERSION_REVISION, []) AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, []) @@ -1052,14 +1052,17 @@ fi CFLAGS="$saved_CFLAGS" if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then + saved_CFLAGS="$CFLAGS" # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [ + CFLAGS="$CFLAGS -Wno-extended-offsetof" AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no]) ]) AC_MSG_RESULT($ac_cv_clang_extended_offsetof) if test x"$ac_cv_clang_extended_offsetof" = xyes; then APR_ADDTO(CFLAGS, -Wno-extended-offsetof) fi + CFLAGS="$saved_CFLAGS" fi # Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready @@ -1661,7 +1664,7 @@ if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then PHP=php PHP_CONFIG=php-config PHP_LDFLAGS="`$PHP_CONFIG --ldflags`" - PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto)//g'`" + PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre2-8|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto|argon2|sodium)//g'`" PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`" PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`" PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`" diff --git a/debian/README.source b/debian/README.source index 945f15125f..f1d4cff376 100644 --- a/debian/README.source +++ b/debian/README.source @@ -18,7 +18,7 @@ of a FreeSWITCH git repository. You can achieve this with: aptitude update && aptitude install -y git mkdir -p /usr/src/freeswitch - git clone https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch/src + git clone https://github.com/signalwire/freeswitch.git /usr/src/freeswitch/src cd /usr/src/freeswitch/src Ensuring you have a clean build directory diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh index 325265e39d..9ca918bc03 100755 --- a/debian/bootstrap.sh +++ b/debian/bootstrap.sh @@ -338,8 +338,8 @@ Build-Depends: $(debian_wrap "${mod_build_depends}") Standards-Version: 3.9.3 Homepage: https://freeswitch.org/ -Vcs-Git: https://freeswitch.org/stash/scm/fs/freeswitch.git -Vcs-Browser: https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse +Vcs-Git: https://github.com/signalwire/freeswitch.git +Vcs-Browser: https://github.com/signalwire/freeswitch EOF } diff --git a/docker/README b/docker/README.md similarity index 95% rename from docker/README rename to docker/README.md index c18afbbdd4..e9a321e699 100644 --- a/docker/README +++ b/docker/README.md @@ -31,7 +31,7 @@ The container exposes the following ports: If you wish to help improve these please submit a pull request at: -https://freeswitch.org/jira +https://github.com/signalwire/freeswitch Thanks, /b diff --git a/docker/base_image/README.md b/docker/base_image/README.md index 222fab6c39..75e6e02dae 100644 --- a/docker/base_image/README.md +++ b/docker/base_image/README.md @@ -85,7 +85,7 @@ apt-get install freeswitch-conf-vanilla ``` 2) clone freeswitch repo ```sh -git clone https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse +git clone https://github.com/signalwire/freeswitch.git ``` 3) execute ```make_min_archive.sh``` script ```sh @@ -100,4 +100,4 @@ docker build -t freeswitch_custom . Read more --------- -[Dockerfile of official FreeSwitch container](https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse/docker/release) +[Dockerfile of official FreeSwitch container](https://github.com/signalwire/freeswitch/tree/master/docker/release) diff --git a/docs/SubmittingPatches b/docs/SubmittingPatches index 2f0601926e..e98372f7e6 100644 --- a/docs/SubmittingPatches +++ b/docs/SubmittingPatches @@ -4,7 +4,7 @@ How to Contribute Patches to FreeSWITCH Download the Source Code ------------------------ - git clone https://freeswitch.org/stash/scm/fs/freeswitch.git + git clone https://github.com/signalwire/freeswitch.git cd freeswitch Ensure Git is Setup @@ -42,18 +42,18 @@ Create a Pull Request # create an account in JIRA and create a new issue - # navigate to FreeSWITCH Stash - chromium https://freeswitch.org/stash + # navigate to FreeSWITCH github + chromium https://github.com/signalwire/freeswitch - # Using the same credentials as Jira, login to Stash; create a forked FS repository; read + # Using your github credentials, login to github; create a forked FS repository; read # the details here: chromium https://freeswitch.org/confluence/display/FREESWITCH/Pull+Requests # add your repository as a remote (change to your username) - git remote add stash ssh://git@freeswitch.org:7999/~johndoe/freeswitch.git + git remote add fs git@github.com:signalwire/freeswitch.git # push your changes to a branch - git push stash +HEAD:myfeature + git push fs +HEAD:myfeature # create a pull request as described here: chromium https://freeswitch.org/confluence/display/FREESWITCH/Pull+Requests diff --git a/html5/verto/verto_communicator/package.json b/html5/verto/verto_communicator/package.json index 28b4d9536a..902c5f0d6d 100644 --- a/html5/verto/verto_communicator/package.json +++ b/html5/verto/verto_communicator/package.json @@ -35,6 +35,6 @@ }, "repository": { "type": "git", - "url": "https://freeswitch.org/stash/scm/fs/freeswitch.git" + "url": "https://github.com/signalwire/freeswitch.git" } } diff --git a/libs/apr/.update b/libs/apr/.update index 38f319cd1f..fba8701bc7 100644 --- a/libs/apr/.update +++ b/libs/apr/.update @@ -1 +1 @@ -Fri Apr 8 13:43:12 EDT 2016 +Wed Sep 25 15:25:12 EDT 2019 diff --git a/libs/apr/include/apr_pools.h b/libs/apr/include/apr_pools.h index 886323fa66..9b7f15685a 100644 --- a/libs/apr/include/apr_pools.h +++ b/libs/apr/include/apr_pools.h @@ -214,6 +214,12 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, #define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \ APR_POOL__FILE_LINE__) + +APR_DECLARE(int) apr_pool_walk_tree_debug(apr_pool_t *pool, + int(*fn)(apr_pool_t *pool, void *data), + void *data); + +APR_DECLARE(void) apr_pool_get_stats(apr_pool_t *pool, unsigned int *alloc, unsigned int *total_alloc, unsigned int *clear); #endif /** diff --git a/libs/apr/memory/unix/apr_pools.c b/libs/apr/memory/unix/apr_pools.c index 600b0772cc..c412a4aef0 100644 --- a/libs/apr/memory/unix/apr_pools.c +++ b/libs/apr/memory/unix/apr_pools.c @@ -1126,6 +1126,22 @@ static int apr_pool_walk_tree(apr_pool_t *pool, return rv; } +APR_DECLARE(int) apr_pool_walk_tree_debug(apr_pool_t *pool, + int(*fn)(apr_pool_t *pool, void *data), + void *data) +{ + return apr_pool_walk_tree(pool, fn, data); +} + +APR_DECLARE(void) apr_pool_get_stats(apr_pool_t *pool, unsigned int *alloc, unsigned int *total_alloc, unsigned int *clear) +{ + if (pool) { + *alloc = pool->stat_alloc; + *total_alloc = pool->stat_total_alloc; + *clear = pool->stat_clear; + } +} + #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) static void apr_pool_log_event(apr_pool_t *pool, const char *event, const char *file_line, int deref) @@ -1432,7 +1448,7 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) for (index = 0; index < node->index; index++) { memset(node->beginp[index], POOL_POISON_BYTE, - node->endp[index] - node->beginp[index]); + (char *)node->endp[index] - (char *)node->beginp[index]); free(node->beginp[index]); } diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c index 99db32764b..b63fdd845a 100644 --- a/libs/esl/fs_cli.c +++ b/libs/esl/fs_cli.c @@ -674,7 +674,7 @@ static void redisplay(void) esl_mutex_lock(MUTEX); { #ifdef HAVE_LIBEDIT -#ifdef XHAVE_DECL_EL_REFRESH +#ifdef HAVE_DECL_EL_REFRESH #ifdef HAVE_EL_WSET /* Current libedit versions don't implement EL_REFRESH in eln.c so * use the wide version instead. */ @@ -1002,10 +1002,13 @@ static const char *basic_gets(int *cnt) for (x = 0; x < (sizeof(command_buf) - 1); x++) { int c = getchar(); if (c < 0) { + size_t command_buf_len; if (fgets(command_buf, sizeof(command_buf) - 1, stdin) != command_buf) { break; + } + if ((command_buf_len = strlen(command_buf)) > 0) { + command_buf[command_buf_len - 1] = '\0'; /* remove endline */ } - command_buf[strlen(command_buf)-1] = '\0'; /* remove endline */ break; } command_buf[x] = (char) c; diff --git a/libs/esl/php/ESL.php b/libs/esl/php/ESL.php index 4ac5499c32..e3858c8765 100644 --- a/libs/esl/php/ESL.php +++ b/libs/esl/php/ESL.php @@ -2,7 +2,7 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.2 + * Version 3.0.12 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make diff --git a/libs/esl/php/Makefile.am b/libs/esl/php/Makefile.am index bdcd272580..bafc3f8764 100644 --- a/libs/esl/php/Makefile.am +++ b/libs/esl/php/Makefile.am @@ -3,7 +3,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-label -Wno-unused-function all: ESL.so esl_wrap.cpp: - swig3.0 -module ESL -php5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i + swig3.0 -module ESL -php7 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i sed -e 's/ char \*type_name;/ const char \*type_name;/' -i esl_wrap.cpp esl_wrap.o: esl_wrap.cpp diff --git a/libs/esl/php/esl_wrap.cpp b/libs/esl/php/esl_wrap.cpp index 75566f9532..7c8a88b2f7 100644 --- a/libs/esl/php/esl_wrap.cpp +++ b/libs/esl/php/esl_wrap.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.2 + * Version 3.0.12 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -8,7 +8,10 @@ * interface file instead. * ----------------------------------------------------------------------------- */ + +#ifndef SWIGPHP #define SWIGPHP +#endif #define SWIG_PREFIX "" #define SWIG_PREFIX_LEN 0 @@ -103,9 +106,11 @@ template T SwigValueInit() { #endif /* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif # endif #endif @@ -144,6 +149,19 @@ template T SwigValueInit() { # define _SCL_SECURE_NO_DEPRECATE #endif +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif /* ----------------------------------------------------------------------------- * swigrun.swg @@ -642,16 +660,16 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) { char d = *(c++); unsigned char uu; if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); + uu = (unsigned char)((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); + uu = (unsigned char)((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); + uu |= (unsigned char)(d - '0'); else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); + uu |= (unsigned char)(d - ('a'-10)); else return (char *) 0; *u = uu; @@ -731,61 +749,31 @@ extern "C" { #include "zend_API.h" #include "zend_exceptions.h" #include "php.h" + +#if PHP_MAJOR_VERSION != 7 +# error These bindings need PHP7 - to generate PHP5 bindings use: swig -php5 +#endif + #include "ext/standard/php_string.h" #include /* for abort(), used in generated code. */ -#ifdef ZEND_RAW_FENTRY -/* ZEND_RAW_FENTRY was added somewhere between 5.2.0 and 5.2.3 */ -# define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_RAW_FENTRY((char*)#ZN, N, A, 0) -#else -/* This causes warnings from GCC >= 4.2 (assigning a string literal to char*). - * But this seems to be unavoidable without directly assuming knowledge of - * the structure, which changed between PHP4 and PHP5. */ -# define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A) -#endif +/* This indirection is to work around const correctness issues in older PHP. + * FIXME: Remove for PHP7? Or might user code be using it? */ +#define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A) -#ifndef Z_SET_ISREF_P -/* For PHP < 5.3 */ -# define Z_SET_ISREF_P(z) (z)->is_ref = 1 -#endif -#ifndef Z_SET_REFCOUNT_P -/* For PHP < 5.3 */ -# define Z_SET_REFCOUNT_P(z, rc) (z)->refcount = (rc) -#endif - -#define SWIG_LONG_CONSTANT(N, V) zend_register_long_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC) -#define SWIG_DOUBLE_CONSTANT(N, V) zend_register_double_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC) -#define SWIG_STRING_CONSTANT(N, V) zend_register_stringl_constant((char*)#N, sizeof(#N), (char*)(V), strlen(V), CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC) +#define SWIG_BOOL_CONSTANT(N, V) REGISTER_BOOL_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) +#define SWIG_LONG_CONSTANT(N, V) REGISTER_LONG_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) +#define SWIG_DOUBLE_CONSTANT(N, V) REGISTER_DOUBLE_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT) +#define SWIG_STRING_CONSTANT(N, V) REGISTER_STRING_CONSTANT(#N, (char*)V, CONST_CS | CONST_PERSISTENT) #define SWIG_CHAR_CONSTANT(N, V) do {\ - static char swig_char = (V);\ - zend_register_stringl_constant((char*)#N, sizeof(#N), &swig_char, 1, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);\ + char swig_char = (V);\ + REGISTER_STRINGL_CONSTANT(#N, &swig_char, 1, CONST_CS | CONST_PERSISTENT);\ } while (0) -/* These TSRMLS_ stuff should already be defined now, but with older php under - redhat are not... */ -#ifndef TSRMLS_D -#define TSRMLS_D -#endif -#ifndef TSRMLS_DC -#define TSRMLS_DC -#endif -#ifndef TSRMLS_C -#define TSRMLS_C -#endif -#ifndef TSRMLS_CC -#define TSRMLS_CC -#endif - #ifdef __cplusplus } #endif -/* But in fact SWIG_ConvertPtr is the native interface for getting typed - pointer values out of zvals. We need the TSRMLS_ macros for when we - make PHP type calls later as we handle php resources */ -#define SWIG_ConvertPtr(obj,pp,type,flags) SWIG_ZTS_ConvertPtr(obj,pp,type,flags TSRMLS_CC) - - #define SWIG_fail goto fail static const char *default_error_msg = "Unknown error occurred"; @@ -809,14 +797,10 @@ typedef struct { int newobject; } swig_object_wrapper; -/* empty zend destructor for types without one */ -static ZEND_RSRC_DTOR_FUNC(SWIG_landfill) { (void)rsrc; } - -#define SWIG_SetPointerZval(a,b,c,d) SWIG_ZTS_SetPointerZval(a,b,c,d TSRMLS_CC) #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) static void -SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject TSRMLS_DC) { +SWIG_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject) { /* * First test for Null pointers. Return those as PHP native NULL */ @@ -833,19 +817,19 @@ SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject value->newobject=(newobject & 1); if ((newobject & 2) == 0) { /* Just register the pointer as a resource. */ - ZEND_REGISTER_RESOURCE(z, value, *(int *)(type->clientdata)); + ZVAL_RES(z, zend_register_resource(value, *(int *)(type->clientdata))); } else { /* * Wrap the resource in an object, the resource will be accessible * via the "_cPtr" member. This is currently only used by * directorin typemaps. */ - zval *resource; - zend_class_entry **ce = NULL; + zval resource; + zend_class_entry *ce = NULL; const char *type_name = type->name+3; /* +3 so: _p_Foo -> Foo */ size_t type_name_len; - int result; const char * p; + HashTable * ht; /* Namespace__Foo -> Foo */ /* FIXME: ugly and goes wrong for classes with __ in their names. */ @@ -854,26 +838,27 @@ SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject } type_name_len = strlen(type_name); - MAKE_STD_ZVAL(resource); - ZEND_REGISTER_RESOURCE(resource, value, *(int *)(type->clientdata)); + ZVAL_RES(&resource, zend_register_resource(value, *(int *)(type->clientdata))); if (SWIG_PREFIX_LEN > 0) { - char * classname = (char*)emalloc(SWIG_PREFIX_LEN + type_name_len + 1); - strcpy(classname, SWIG_PREFIX); - strcpy(classname + SWIG_PREFIX_LEN, type_name); - result = zend_lookup_class(classname, SWIG_PREFIX_LEN + type_name_len, &ce TSRMLS_CC); - efree(classname); + zend_string * classname = zend_string_alloc(SWIG_PREFIX_LEN + type_name_len, 0); + memcpy(classname->val, SWIG_PREFIX, SWIG_PREFIX_LEN); + memcpy(classname->val + SWIG_PREFIX_LEN, type_name, type_name_len); + ce = zend_lookup_class(classname); + zend_string_release(classname); } else { - result = zend_lookup_class((char *)type_name, type_name_len, &ce TSRMLS_CC); + zend_string * classname = zend_string_init(type_name, type_name_len, 0); + ce = zend_lookup_class(classname); + zend_string_release(classname); } - if (result != SUCCESS) { + if (ce == NULL) { /* class does not exist */ - object_init(z); - } else { - object_init_ex(z, *ce); + ce = zend_standard_class_def; } - Z_SET_REFCOUNT_P(z, 1); - Z_SET_ISREF_P(z); - zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval), NULL); + + ALLOC_HASHTABLE(ht); + zend_hash_init(ht, 1, NULL, NULL, 0); + zend_hash_str_update(ht, "_cPtr", sizeof("_cPtr") - 1, &resource); + object_and_properties_init(z, ce, ht); } return; } @@ -889,11 +874,11 @@ SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject instance of a resource of the type id, so we have to pass type_name as well. The two functions which might call this are: - SWIG_ZTS_ConvertResourcePtr which gets the type name from the resource + SWIG_ConvertResourcePtr which gets the type name from the resource and the registered zend destructors for which we have one per type each with the type name hard wired in. */ static void * -SWIG_ZTS_ConvertResourceData(void * p, const char *type_name, swig_type_info *ty TSRMLS_DC) { +SWIG_ConvertResourceData(void * p, const char *type_name, swig_type_info *ty) { swig_cast_info *tc; void *result = 0; @@ -920,48 +905,53 @@ SWIG_ZTS_ConvertResourceData(void * p, const char *type_name, swig_type_info *ty /* This function returns a pointer of type ty by extracting the pointer and type info from the resource in z. z must be a resource. If it fails, NULL is returned. - It uses SWIG_ZTS_ConvertResourceData to do the real work. */ + It uses SWIG_ConvertResourceData to do the real work. */ static void * -SWIG_ZTS_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags TSRMLS_DC) { +SWIG_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags) { swig_object_wrapper *value; void *p; - int type; const char *type_name; - value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type); - if (type==-1) return NULL; + if (Z_RES_TYPE_P(z) == -1) return NULL; + value = (swig_object_wrapper *) Z_RES_VAL_P(z); if (flags & SWIG_POINTER_DISOWN) { value->newobject = 0; } p = value->ptr; - type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC); + type_name=zend_rsrc_list_get_rsrc_type(Z_RES_P(z)); - return SWIG_ZTS_ConvertResourceData(p, type_name, ty TSRMLS_CC); + return SWIG_ConvertResourceData(p, type_name, ty); } /* We allow passing of a RESOURCE pointing to the object or an OBJECT whose _cPtr is a resource pointing to the object */ static int -SWIG_ZTS_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags TSRMLS_DC) { +SWIG_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags) { if (z == NULL) { *ptr = 0; return 0; } - switch (z->type) { + switch (Z_TYPE_P(z)) { case IS_OBJECT: { - zval ** _cPtr; - if (zend_hash_find(HASH_OF(z),(char*)"_cPtr",sizeof("_cPtr"),(void**)&_cPtr)==SUCCESS) { - if ((*_cPtr)->type==IS_RESOURCE) { - *ptr = SWIG_ZTS_ConvertResourcePtr(*_cPtr, ty, flags TSRMLS_CC); - return (*ptr == NULL ? -1 : 0); - } + HashTable * ht = Z_OBJ_HT_P(z)->get_properties(z); + if (ht) { + zval * _cPtr = zend_hash_str_find(ht, "_cPtr", sizeof("_cPtr") - 1); + if (_cPtr) { + if (Z_TYPE_P(_cPtr) == IS_INDIRECT) { + _cPtr = Z_INDIRECT_P(_cPtr); + } + if (Z_TYPE_P(_cPtr) == IS_RESOURCE) { + *ptr = SWIG_ConvertResourcePtr(_cPtr, ty, flags); + return (*ptr == NULL ? -1 : 0); + } + } } break; } case IS_RESOURCE: - *ptr = SWIG_ZTS_ConvertResourcePtr(z, ty, flags TSRMLS_CC); + *ptr = SWIG_ConvertResourcePtr(z, ty, flags); return (*ptr == NULL ? -1 : 0); case IS_NULL: *ptr = 0; @@ -973,24 +963,17 @@ SWIG_ZTS_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags TSRMLS_DC static char const_name[] = "swig_runtime_data_type_pointer"; static swig_module_info *SWIG_Php_GetModule() { - zval *pointer; - swig_module_info *ret = 0; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(pointer); - - if (zend_get_constant(const_name, sizeof(const_name) - 1, pointer TSRMLS_CC)) { - if (pointer->type == IS_LONG) { - ret = (swig_module_info *) pointer->value.lval; + zval *pointer = zend_get_constant_str(const_name, sizeof(const_name) - 1); + if (pointer) { + if (Z_TYPE_P(pointer) == IS_LONG) { + return (swig_module_info *) pointer->value.lval; } } - FREE_ZVAL(pointer); - return ret; + return NULL; } static void SWIG_Php_SetModule(swig_module_info *pointer) { - TSRMLS_FETCH(); - REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, 0); + REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, CONST_PERSISTENT | CONST_CS); } @@ -1013,19 +996,13 @@ const char *error_msg; int error_code; ZEND_END_MODULE_GLOBALS(ESL) ZEND_DECLARE_MODULE_GLOBALS(ESL) -#ifdef ZTS -#define SWIG_ErrorMsg() TSRMG(ESL_globals_id, zend_ESL_globals *, error_msg ) -#define SWIG_ErrorCode() TSRMG(ESL_globals_id, zend_ESL_globals *, error_code ) -#else #define SWIG_ErrorMsg() (ESL_globals.error_msg) #define SWIG_ErrorCode() (ESL_globals.error_code) -#endif - #ifdef __GNUC__ -static void SWIG_FAIL(TSRMLS_D) __attribute__ ((__noreturn__)); +static void SWIG_FAIL(void) __attribute__ ((__noreturn__)); #endif -static void SWIG_FAIL(TSRMLS_D) { +static void SWIG_FAIL(void) { zend_error(SWIG_ErrorCode(), "%s", SWIG_ErrorMsg()); abort(); } @@ -1034,39 +1011,35 @@ static void ESL_init_globals(zend_ESL_globals *globals ) { globals->error_msg = default_error_msg; globals->error_code = default_error_code; } -static void ESL_destroy_globals(zend_ESL_globals * globals) { (void)globals; } - -static void SWIG_ResetError(TSRMLS_D) { +static void SWIG_ResetError(void) { SWIG_ErrorMsg() = default_error_msg; SWIG_ErrorCode() = default_error_code; } ZEND_NAMED_FUNCTION(_wrap_swig_ESL_alter_newobject) { - zval **args[2]; + zval args[2]; swig_object_wrapper *value; - int type; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type); - value->newobject = zval_is_true(*args[1]); + value = (swig_object_wrapper *) Z_RES_VAL(args[0]); + value->newobject = zval_is_true(&args[1]); return; } ZEND_NAMED_FUNCTION(_wrap_swig_ESL_get_newobject) { - zval **args[1]; + zval args[1]; swig_object_wrapper *value; - int type; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type); + value = (swig_object_wrapper *) Z_RES_VAL(args[0]); RETVAL_LONG(value->newobject); return; @@ -1128,81 +1101,83 @@ static int le_swig__p_ESLconnection=0; /* handle for ESLconnection */ ZEND_NAMED_FUNCTION(_wrap_ESLevent_event_set) { ESLevent *arg1 = (ESLevent *) 0 ; esl_event_t *arg2 = (esl_event_t *) 0 ; - zval **args[2]; + zval args[2]; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_event_set. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_event_set. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - { - if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_esl_event_t, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLevent_event_set. Expected SWIGTYPE_p_esl_event_t"); - } + + if (SWIG_ConvertPtr(&args[1], (void **) &arg2, SWIGTYPE_p_esl_event_t, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLevent_event_set. Expected SWIGTYPE_p_esl_event_t"); } + if (arg1) (arg1)->event = arg2; +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_event_get) { ESLevent *arg1 = (ESLevent *) 0 ; - zval **args[1]; + zval args[1]; esl_event_t *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_event_get. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_event_get. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (esl_event_t *) ((arg1)->event); SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_esl_event_t, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_set) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; - zval **args[2]; + zval args[2]; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_serialized_string_set. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_serialized_string_set. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; @@ -1216,128 +1191,131 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_set) { } } +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_get) { ESLevent *arg1 = (ESLevent *) 0 ; - zval **args[1]; + zval args[1]; char *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_serialized_string_get. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_serialized_string_get. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (char *) ((arg1)->serialized_string); - { - if(!result) { - ZVAL_NULL(return_value); - } else { - ZVAL_STRING(return_value, (char *)result, 1); - } + + if (!result) { + RETVAL_NULL(); + } else { + RETVAL_STRING((const char *)result); } + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_mine_set) { ESLevent *arg1 = (ESLevent *) 0 ; int arg2 ; - zval **args[2]; + zval args[2]; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_mine_set. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_mine_set. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,7,CONVERT_INT_IN@*/ - convert_to_long_ex(args[1]); - arg2 = (int) Z_LVAL_PP(args[1]); + /*@SWIG:/usr/share/swig3.0/php/utils.i,6,CONVERT_INT_IN@*/ + arg2 = (int) zval_get_long(&args[1]); /*@SWIG@*/; if (arg1) (arg1)->mine = arg2; +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_mine_get) { ESLevent *arg1 = (ESLevent *) 0 ; - zval **args[1]; + zval args[1]; int result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_mine_get. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_mine_get. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (int) ((arg1)->mine); - { - ZVAL_LONG(return_value,result); - } + + RETVAL_LONG(result); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_0) { char *arg1 = (char *) 0 ; char *arg2 = (char *) NULL ; - zval **args[2]; + zval args[2]; int arg_count; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<1 || arg_count>2 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[0])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[0])) { arg1 = (char *) 0; } else { - convert_to_string_ex(args[0]); - arg1 = (char *) Z_STRVAL_PP(args[0]); + convert_to_string(&args[0]); + arg1 = (char *) Z_STRVAL(args[0]); } /*@SWIG@*/; if(arg_count > 1) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; @@ -1346,34 +1324,34 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_0) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_1) { esl_event_t *arg1 = (esl_event_t *) 0 ; int arg2 = (int) 0 ; - zval **args[2]; + zval args[2]; int arg_count; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<1 || arg_count>2 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_esl_event_t, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESLevent. Expected SWIGTYPE_p_esl_event_t"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_esl_event_t, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESLevent. Expected SWIGTYPE_p_esl_event_t"); } + if(arg_count > 1) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,7,CONVERT_INT_IN@*/ - convert_to_long_ex(args[1]); - arg2 = (int) Z_LVAL_PP(args[1]); + /*@SWIG:/usr/share/swig3.0/php/utils.i,6,CONVERT_INT_IN@*/ + arg2 = (int) zval_get_long(&args[1]); /*@SWIG@*/; } @@ -1381,54 +1359,56 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_1) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_2) { ESLevent *arg1 = (ESLevent *) 0 ; - zval **args[1]; + zval args[1]; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESLevent. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESLevent. Expected SWIGTYPE_p_ESLevent"); } + result = (ESLevent *)new ESLevent(arg1); SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_new_ESLevent) { int argc; - zval **argv[2]; + zval argv[2]; argc = ZEND_NUM_ARGS(); - zend_get_parameters_array_ex(argc,argv); + zend_get_parameters_array_ex(argc, argv); if ((argc >= 1) && (argc <= 2)) { int _v; { void *tmp; - _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_esl_event_t, 0) >= 0); + _v = (SWIG_ConvertPtr(&argv[0], (void**)&tmp, SWIGTYPE_p_esl_event_t, 0) >= 0); } if (_v) { if (argc <= 1) { _wrap_new_ESLevent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } - _v = (Z_TYPE_PP(argv[1]) == IS_LONG); + _v = (Z_TYPE(argv[1]) == IS_LONG); if (_v) { _wrap_new_ESLevent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } @@ -1438,7 +1418,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent) { int _v; { void *tmp; - _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_ESLevent, 0) >= 0); + _v = (SWIG_ConvertPtr(&argv[0], (void**)&tmp, SWIGTYPE_p_ESLevent, 0) >= 0); } if (_v) { _wrap_new_ESLevent__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; @@ -1446,12 +1426,12 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent) { } if ((argc >= 1) && (argc <= 2)) { int _v; - _v = (Z_TYPE_PP(argv[0]) == IS_STRING); + _v = (Z_TYPE(argv[0]) == IS_STRING); if (_v) { if (argc <= 1) { _wrap_new_ESLevent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } - _v = (Z_TYPE_PP(argv[1]) == IS_STRING); + _v = (Z_TYPE(argv[1]) == IS_STRING); if (_v) { _wrap_new_ESLevent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } @@ -1460,70 +1440,72 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent) { SWIG_ErrorCode() = E_ERROR; SWIG_ErrorMsg() = "No matching function for overloaded 'new_ESLevent'"; - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } /* This function is designed to be called by the zend list destructors */ /* to typecast and do the actual destruction */ -static void __wrap_delete_ESLevent(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) { - swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ; +static void __wrap_delete_ESLevent(zend_resource *res, const char *type_name) { + swig_object_wrapper *value=(swig_object_wrapper *) res->ptr ; void *ptr=value->ptr ; int newobject=value->newobject ; ESLevent *arg1 = (ESLevent *) 0 ; efree(value); if (! newobject) return; /* can't delete it! */ - arg1 = (ESLevent *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_ESLevent TSRMLS_CC); + arg1 = (ESLevent *)SWIG_ConvertResourceData(ptr, type_name, SWIGTYPE_p_ESLevent); if (! arg1) zend_error(E_ERROR, "ESLevent resource already free'd"); delete arg1; +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) NULL ; - zval **args[2]; + zval args[2]; int arg_count; char *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<1 || arg_count>2 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_serialize. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_serialize. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); if(arg_count > 1) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; } result = (char *)(arg1)->serialize((char const *)arg2); - { - if(!result) { - ZVAL_NULL(return_value); - } else { - ZVAL_STRING(return_value, (char *)result, 1); - } + + if (!result) { + RETVAL_NULL(); + } else { + RETVAL_STRING((const char *)result); } + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -1531,37 +1513,37 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_setPriority) { ESLevent *arg1 = (ESLevent *) 0 ; esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ; esl_priority_t *tmp2 ; - zval **args[2]; + zval args[2]; int arg_count; bool result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<1 || arg_count>2 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_setPriority. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_setPriority. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); if(arg_count > 1) { - { - if(SWIG_ConvertPtr(*args[1], (void **) &tmp2, SWIGTYPE_p_esl_priority_t, 0) < 0 || tmp2 == NULL) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLevent_setPriority. Expected SWIGTYPE_p_esl_priority_t"); - } - arg2 = *tmp2; + if (SWIG_ConvertPtr(&args[1], (void **) &tmp2, SWIGTYPE_p_esl_priority_t, 0) < 0 || tmp2 == NULL) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLevent_setPriority. Expected SWIGTYPE_p_esl_priority_t"); } + arg2 = *tmp2; + } result = (bool)(arg1)->setPriority(arg2); - { - ZVAL_BOOL(return_value,(result)?1:0); - } + + RETVAL_BOOL((result) ? 1 : 0); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -1569,147 +1551,150 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_getHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; int arg3 = (int) -1 ; - zval **args[3]; + zval args[3]; int arg_count; char *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<2 || arg_count>3 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_getHeader. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_getHeader. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; if(arg_count > 2) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,7,CONVERT_INT_IN@*/ - convert_to_long_ex(args[2]); - arg3 = (int) Z_LVAL_PP(args[2]); + /*@SWIG:/usr/share/swig3.0/php/utils.i,6,CONVERT_INT_IN@*/ + arg3 = (int) zval_get_long(&args[2]); /*@SWIG@*/; } result = (char *)(arg1)->getHeader((char const *)arg2,arg3); - { - if(!result) { - ZVAL_NULL(return_value); - } else { - ZVAL_STRING(return_value, (char *)result, 1); - } + + if (!result) { + RETVAL_NULL(); + } else { + RETVAL_STRING((const char *)result); } + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_getBody) { ESLevent *arg1 = (ESLevent *) 0 ; - zval **args[1]; + zval args[1]; char *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_getBody. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_getBody. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (char *)(arg1)->getBody(); - { - if(!result) { - ZVAL_NULL(return_value); - } else { - ZVAL_STRING(return_value, (char *)result, 1); - } + + if (!result) { + RETVAL_NULL(); + } else { + RETVAL_STRING((const char *)result); } + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_getType) { ESLevent *arg1 = (ESLevent *) 0 ; - zval **args[1]; + zval args[1]; char *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_getType. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_getType. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (char *)(arg1)->getType(); - { - if(!result) { - ZVAL_NULL(return_value); - } else { - ZVAL_STRING(return_value, (char *)result, 1); - } + + if (!result) { + RETVAL_NULL(); + } else { + RETVAL_STRING((const char *)result); } + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_addBody) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; - zval **args[2]; + zval args[2]; bool result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_addBody. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_addBody. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; result = (bool)(arg1)->addBody((char const *)arg2); - { - ZVAL_BOOL(return_value,(result)?1:0); - } + + RETVAL_BOOL((result) ? 1 : 0); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -1717,47 +1702,48 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - zval **args[3]; + zval args[3]; bool result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_addHeader. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_addHeader. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3); - { - ZVAL_BOOL(return_value,(result)?1:0); - } + + RETVAL_BOOL((result) ? 1 : 0); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -1765,47 +1751,48 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_pushHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - zval **args[3]; + zval args[3]; bool result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_pushHeader. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_pushHeader. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; result = (bool)(arg1)->pushHeader((char const *)arg2,(char const *)arg3); - { - ZVAL_BOOL(return_value,(result)?1:0); - } + + RETVAL_BOOL((result) ? 1 : 0); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -1813,144 +1800,148 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_unshiftHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - zval **args[3]; + zval args[3]; bool result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_unshiftHeader. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_unshiftHeader. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; result = (bool)(arg1)->unshiftHeader((char const *)arg2,(char const *)arg3); - { - ZVAL_BOOL(return_value,(result)?1:0); - } + + RETVAL_BOOL((result) ? 1 : 0); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_delHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; - zval **args[2]; + zval args[2]; bool result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_delHeader. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_delHeader. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; result = (bool)(arg1)->delHeader((char const *)arg2); - { - ZVAL_BOOL(return_value,(result)?1:0); - } + + RETVAL_BOOL((result) ? 1 : 0); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_firstHeader) { ESLevent *arg1 = (ESLevent *) 0 ; - zval **args[1]; + zval args[1]; char *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_firstHeader. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_firstHeader. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (char *)(arg1)->firstHeader(); - { - if(!result) { - ZVAL_NULL(return_value); - } else { - ZVAL_STRING(return_value, (char *)result, 1); - } + + if (!result) { + RETVAL_NULL(); + } else { + RETVAL_STRING((const char *)result); } + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_nextHeader) { ESLevent *arg1 = (ESLevent *) 0 ; - zval **args[1]; + zval args[1]; char *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_nextHeader. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLevent_nextHeader. Expected SWIGTYPE_p_ESLevent"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (char *)(arg1)->nextHeader(); - { - if(!result) { - ZVAL_NULL(return_value); - } else { - ZVAL_STRING(return_value, (char *)result, 1); - } + + if (!result) { + RETVAL_NULL(); + } else { + RETVAL_STRING((const char *)result); } + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -1959,47 +1950,46 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_0) { int arg2 ; char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; - zval **args[4]; + zval args[4]; ESLconnection *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) { WRONG_PARAM_COUNT; } - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[0])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[0])) { arg1 = (char *) 0; } else { - convert_to_string_ex(args[0]); - arg1 = (char *) Z_STRVAL_PP(args[0]); + convert_to_string(&args[0]); + arg1 = (char *) Z_STRVAL(args[0]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,7,CONVERT_INT_IN@*/ - convert_to_long_ex(args[1]); - arg2 = (int) Z_LVAL_PP(args[1]); + /*@SWIG:/usr/share/swig3.0/php/utils.i,6,CONVERT_INT_IN@*/ + arg2 = (int) zval_get_long(&args[1]); /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[3])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[3])) { arg4 = (char *) 0; } else { - convert_to_string_ex(args[3]); - arg4 = (char *) Z_STRVAL_PP(args[3]); + convert_to_string(&args[3]); + arg4 = (char *) Z_STRVAL(args[3]); } /*@SWIG@*/; @@ -2007,9 +1997,10 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_0) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2017,37 +2008,36 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_1) { char *arg1 = (char *) 0 ; int arg2 ; char *arg3 = (char *) 0 ; - zval **args[3]; + zval args[3]; ESLconnection *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { WRONG_PARAM_COUNT; } - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[0])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[0])) { arg1 = (char *) 0; } else { - convert_to_string_ex(args[0]); - arg1 = (char *) Z_STRVAL_PP(args[0]); + convert_to_string(&args[0]); + arg1 = (char *) Z_STRVAL(args[0]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,7,CONVERT_INT_IN@*/ - convert_to_long_ex(args[1]); - arg2 = (int) Z_LVAL_PP(args[1]); + /*@SWIG:/usr/share/swig3.0/php/utils.i,6,CONVERT_INT_IN@*/ + arg2 = (int) zval_get_long(&args[1]); /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; @@ -2055,9 +2045,10 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_1) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2066,51 +2057,51 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_2) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; - zval **args[4]; + zval args[4]; ESLconnection *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) { WRONG_PARAM_COUNT; } - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[0])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[0])) { arg1 = (char *) 0; } else { - convert_to_string_ex(args[0]); - arg1 = (char *) Z_STRVAL_PP(args[0]); + convert_to_string(&args[0]); + arg1 = (char *) Z_STRVAL(args[0]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[3])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[3])) { arg4 = (char *) 0; } else { - convert_to_string_ex(args[3]); - arg4 = (char *) Z_STRVAL_PP(args[3]); + convert_to_string(&args[3]); + arg4 = (char *) Z_STRVAL(args[3]); } /*@SWIG@*/; @@ -2118,9 +2109,10 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_2) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2128,41 +2120,41 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_3) { char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - zval **args[3]; + zval args[3]; ESLconnection *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { WRONG_PARAM_COUNT; } - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[0])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[0])) { arg1 = (char *) 0; } else { - convert_to_string_ex(args[0]); - arg1 = (char *) Z_STRVAL_PP(args[0]); + convert_to_string(&args[0]); + arg1 = (char *) Z_STRVAL(args[0]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; @@ -2170,58 +2162,59 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_3) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_4) { int arg1 ; - zval **args[1]; + zval args[1]; ESLconnection *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - /*@SWIG:/usr/share/swig3.0/php/utils.i,7,CONVERT_INT_IN@*/ - convert_to_long_ex(args[0]); - arg1 = (int) Z_LVAL_PP(args[0]); + /*@SWIG:/usr/share/swig3.0/php/utils.i,6,CONVERT_INT_IN@*/ + arg1 = (int) zval_get_long(&args[0]); /*@SWIG@*/; result = (ESLconnection *)new ESLconnection(arg1); SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { int argc; - zval **argv[4]; + zval argv[4]; argc = ZEND_NUM_ARGS(); - zend_get_parameters_array_ex(argc,argv); + zend_get_parameters_array_ex(argc, argv); if (argc == 1) { int _v; - _v = (Z_TYPE_PP(argv[0]) == IS_LONG); + _v = (Z_TYPE(argv[0]) == IS_LONG); if (_v) { _wrap_new_ESLconnection__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } } if (argc == 3) { int _v; - _v = (Z_TYPE_PP(argv[0]) == IS_STRING); + _v = (Z_TYPE(argv[0]) == IS_STRING); if (_v) { - _v = (Z_TYPE_PP(argv[1]) == IS_LONG); + _v = (Z_TYPE(argv[1]) == IS_LONG); if (_v) { - _v = (Z_TYPE_PP(argv[2]) == IS_STRING); + _v = (Z_TYPE(argv[2]) == IS_STRING); if (_v) { _wrap_new_ESLconnection__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } @@ -2230,11 +2223,11 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { } if (argc == 3) { int _v; - _v = (Z_TYPE_PP(argv[0]) == IS_STRING); + _v = (Z_TYPE(argv[0]) == IS_STRING); if (_v) { - _v = (Z_TYPE_PP(argv[1]) == IS_STRING); + _v = (Z_TYPE(argv[1]) == IS_STRING); if (_v) { - _v = (Z_TYPE_PP(argv[2]) == IS_STRING); + _v = (Z_TYPE(argv[2]) == IS_STRING); if (_v) { _wrap_new_ESLconnection__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } @@ -2243,13 +2236,13 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { } if (argc == 4) { int _v; - _v = (Z_TYPE_PP(argv[0]) == IS_STRING); + _v = (Z_TYPE(argv[0]) == IS_STRING); if (_v) { - _v = (Z_TYPE_PP(argv[1]) == IS_LONG); + _v = (Z_TYPE(argv[1]) == IS_LONG); if (_v) { - _v = (Z_TYPE_PP(argv[2]) == IS_STRING); + _v = (Z_TYPE(argv[2]) == IS_STRING); if (_v) { - _v = (Z_TYPE_PP(argv[3]) == IS_STRING); + _v = (Z_TYPE(argv[3]) == IS_STRING); if (_v) { _wrap_new_ESLconnection__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } @@ -2259,13 +2252,13 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { } if (argc == 4) { int _v; - _v = (Z_TYPE_PP(argv[0]) == IS_STRING); + _v = (Z_TYPE(argv[0]) == IS_STRING); if (_v) { - _v = (Z_TYPE_PP(argv[1]) == IS_STRING); + _v = (Z_TYPE(argv[1]) == IS_STRING); if (_v) { - _v = (Z_TYPE_PP(argv[2]) == IS_STRING); + _v = (Z_TYPE(argv[2]) == IS_STRING); if (_v) { - _v = (Z_TYPE_PP(argv[3]) == IS_STRING); + _v = (Z_TYPE(argv[3]) == IS_STRING); if (_v) { _wrap_new_ESLconnection__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } @@ -2276,168 +2269,173 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { SWIG_ErrorCode() = E_ERROR; SWIG_ErrorMsg() = "No matching function for overloaded 'new_ESLconnection'"; - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } /* This function is designed to be called by the zend list destructors */ /* to typecast and do the actual destruction */ -static void __wrap_delete_ESLconnection(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) { - swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ; +static void __wrap_delete_ESLconnection(zend_resource *res, const char *type_name) { + swig_object_wrapper *value=(swig_object_wrapper *) res->ptr ; void *ptr=value->ptr ; int newobject=value->newobject ; ESLconnection *arg1 = (ESLconnection *) 0 ; efree(value); if (! newobject) return; /* can't delete it! */ - arg1 = (ESLconnection *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_ESLconnection TSRMLS_CC); + arg1 = (ESLconnection *)SWIG_ConvertResourceData(ptr, type_name, SWIGTYPE_p_ESLconnection); if (! arg1) zend_error(E_ERROR, "ESLconnection resource already free'd"); delete arg1; +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_socketDescriptor) { ESLconnection *arg1 = (ESLconnection *) 0 ; - zval **args[1]; + zval args[1]; int result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_socketDescriptor. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_socketDescriptor. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (int)(arg1)->socketDescriptor(); - { - ZVAL_LONG(return_value,result); - } + + RETVAL_LONG(result); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_connected) { ESLconnection *arg1 = (ESLconnection *) 0 ; - zval **args[1]; + zval args[1]; int result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_connected. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_connected. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (int)(arg1)->connected(); - { - ZVAL_LONG(return_value,result); - } + + RETVAL_LONG(result); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_getInfo) { ESLconnection *arg1 = (ESLconnection *) 0 ; - zval **args[1]; + zval args[1]; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_getInfo. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_getInfo. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (ESLevent *)(arg1)->getInfo(); SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_send) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; - zval **args[2]; + zval args[2]; int result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_send. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_send. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; result = (int)(arg1)->send((char const *)arg2); - { - ZVAL_LONG(return_value,result); - } + + RETVAL_LONG(result); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendRecv) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; - zval **args[2]; + zval args[2]; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_sendRecv. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_sendRecv. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; @@ -2445,9 +2443,10 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendRecv) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2455,39 +2454,39 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_api) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; - zval **args[3]; + zval args[3]; int arg_count; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<2 || arg_count>3 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_api. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_api. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; if(arg_count > 2) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; @@ -2496,9 +2495,10 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_api) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2507,50 +2507,50 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_bgapi) { char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; char *arg4 = (char *) NULL ; - zval **args[4]; + zval args[4]; int arg_count; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<2 || arg_count>4 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_bgapi. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_bgapi. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; if(arg_count > 2) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; } if(arg_count > 3) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[3])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[3])) { arg4 = (char *) 0; } else { - convert_to_string_ex(args[3]); - arg4 = (char *) Z_STRVAL_PP(args[3]); + convert_to_string(&args[3]); + arg4 = (char *) Z_STRVAL(args[3]); } /*@SWIG@*/; @@ -2559,41 +2559,43 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_bgapi) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendEvent) { ESLconnection *arg1 = (ESLconnection *) 0 ; ESLevent *arg2 = (ESLevent *) 0 ; - zval **args[2]; + zval args[2]; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_sendEvent. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_sendEvent. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - { - if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLconnection_sendEvent. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[1], (void **) &arg2, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLconnection_sendEvent. Expected SWIGTYPE_p_ESLevent"); } + result = (ESLevent *)(arg1)->sendEvent(arg2); SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2601,104 +2603,106 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendMSG) { ESLconnection *arg1 = (ESLconnection *) 0 ; ESLevent *arg2 = (ESLevent *) 0 ; char *arg3 = (char *) NULL ; - zval **args[3]; + zval args[3]; int arg_count; int result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<2 || arg_count>3 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_sendMSG. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_sendMSG. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - { - if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_ESLevent, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLconnection_sendMSG. Expected SWIGTYPE_p_ESLevent"); - } + + if (SWIG_ConvertPtr(&args[1], (void **) &arg2, SWIGTYPE_p_ESLevent, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESLconnection_sendMSG. Expected SWIGTYPE_p_ESLevent"); } + if(arg_count > 2) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; } result = (int)(arg1)->sendMSG(arg2,(char const *)arg3); - { - ZVAL_LONG(return_value,result); - } + + RETVAL_LONG(result); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_recvEvent) { ESLconnection *arg1 = (ESLconnection *) 0 ; - zval **args[1]; + zval args[1]; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_recvEvent. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_recvEvent. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (ESLevent *)(arg1)->recvEvent(); SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_recvEventTimed) { ESLconnection *arg1 = (ESLconnection *) 0 ; int arg2 ; - zval **args[2]; + zval args[2]; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_recvEventTimed. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_recvEventTimed. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,7,CONVERT_INT_IN@*/ - convert_to_long_ex(args[1]); - arg2 = (int) Z_LVAL_PP(args[1]); + /*@SWIG:/usr/share/swig3.0/php/utils.i,6,CONVERT_INT_IN@*/ + arg2 = (int) zval_get_long(&args[1]); /*@SWIG@*/; result = (ESLevent *)(arg1)->recvEventTimed(arg2); SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2706,37 +2710,37 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_filter) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - zval **args[3]; + zval args[3]; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_filter. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_filter. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; @@ -2744,9 +2748,10 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_filter) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2754,47 +2759,48 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_events) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - zval **args[3]; + zval args[3]; int result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_events. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_events. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; result = (int)(arg1)->events((char const *)arg2,(char const *)arg3); - { - ZVAL_LONG(return_value,result); - } + + RETVAL_LONG(result); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2803,50 +2809,50 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute) { char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; char *arg4 = (char *) NULL ; - zval **args[4]; + zval args[4]; int arg_count; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<2 || arg_count>4 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_execute. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_execute. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; if(arg_count > 2) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; } if(arg_count > 3) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[3])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[3])) { arg4 = (char *) 0; } else { - convert_to_string_ex(args[3]); - arg4 = (char *) Z_STRVAL_PP(args[3]); + convert_to_string(&args[3]); + arg4 = (char *) Z_STRVAL(args[3]); } /*@SWIG@*/; @@ -2855,9 +2861,10 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } @@ -2866,50 +2873,50 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_executeAsync) { char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; char *arg4 = (char *) NULL ; - zval **args[4]; + zval args[4]; int arg_count; ESLevent *result = 0 ; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); if(arg_count<2 || arg_count>4 || zend_get_parameters_array_ex(arg_count,args)!=SUCCESS) WRONG_PARAM_COUNT; - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_executeAsync. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_executeAsync. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; if(arg_count > 2) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[2])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[2])) { arg3 = (char *) 0; } else { - convert_to_string_ex(args[2]); - arg3 = (char *) Z_STRVAL_PP(args[2]); + convert_to_string(&args[2]); + arg3 = (char *) Z_STRVAL(args[2]); } /*@SWIG@*/; } if(arg_count > 3) { - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[3])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[3])) { arg4 = (char *) 0; } else { - convert_to_string_ex(args[3]); - arg4 = (char *) Z_STRVAL_PP(args[3]); + convert_to_string(&args[3]); + arg4 = (char *) Z_STRVAL(args[3]); } /*@SWIG@*/; @@ -2918,307 +2925,169 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_executeAsync) { SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setAsyncExecute) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; - zval **args[2]; + zval args[2]; int result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_setAsyncExecute. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_setAsyncExecute. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; result = (int)(arg1)->setAsyncExecute((char const *)arg2); - { - ZVAL_LONG(return_value,result); - } + + RETVAL_LONG(result); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setEventLock) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; - zval **args[2]; + zval args[2]; int result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_setEventLock. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_setEventLock. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig3.0/php/utils.i,62,CONVERT_STRING_IN@*/ - if ((*args[1])->type==IS_NULL) { + /*@SWIG:/usr/share/swig3.0/php/utils.i,57,CONVERT_STRING_IN@*/ + if (Z_ISNULL(args[1])) { arg2 = (char *) 0; } else { - convert_to_string_ex(args[1]); - arg2 = (char *) Z_STRVAL_PP(args[1]); + convert_to_string(&args[1]); + arg2 = (char *) Z_STRVAL(args[1]); } /*@SWIG@*/; result = (int)(arg1)->setEventLock((char const *)arg2); - { - ZVAL_LONG(return_value,result); - } + + RETVAL_LONG(result); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_disconnect) { ESLconnection *arg1 = (ESLconnection *) 0 ; - zval **args[1]; + zval args[1]; int result; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - { - if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { - SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_disconnect. Expected SWIGTYPE_p_ESLconnection"); - } + + if (SWIG_ConvertPtr(&args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) { + SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_disconnect. Expected SWIGTYPE_p_ESLconnection"); } + if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); result = (int)(arg1)->disconnect(); - { - ZVAL_LONG(return_value,result); - } + + RETVAL_LONG(result); + +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_eslSetLogLevel) { int arg1 ; - zval **args[1]; + zval args[1]; - SWIG_ResetError(TSRMLS_C); + SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { WRONG_PARAM_COUNT; } - /*@SWIG:/usr/share/swig3.0/php/utils.i,7,CONVERT_INT_IN@*/ - convert_to_long_ex(args[0]); - arg1 = (int) Z_LVAL_PP(args[0]); + /*@SWIG:/usr/share/swig3.0/php/utils.i,6,CONVERT_INT_IN@*/ + arg1 = (int) zval_get_long(&args[0]); /*@SWIG@*/; eslSetLogLevel(arg1); +thrown: return; fail: - SWIG_FAIL(TSRMLS_C); + SWIG_FAIL(); } -static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_esl_priority_t) { - /* No destructor for simple type _p_esl_priority_t */ - efree(rsrc->ptr); +static ZEND_RSRC_DTOR_FUNC(_swig_default_rsrc_destroy) { + efree(res->ptr); } static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_ESLevent) { - __wrap_delete_ESLevent(rsrc, SWIGTYPE_p_ESLevent->name TSRMLS_CC); -} -static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_esl_event_t) { - /* No destructor for simple type _p_esl_event_t */ - efree(rsrc->ptr); + __wrap_delete_ESLevent(res, SWIGTYPE_p_ESLevent->name); } static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_ESLconnection) { - __wrap_delete_ESLconnection(rsrc, SWIGTYPE_p_ESLconnection->name TSRMLS_CC); + __wrap_delete_ESLconnection(res, SWIGTYPE_p_ESLconnection->name); } /* end wrapper section */ /* class entry subsection */ /* arginfo subsection */ -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_event_set, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_00, 0, 0, 0) ZEND_ARG_PASS_INFO(0) ZEND_ARG_PASS_INFO(0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_event_get, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_0, 0, 0, 0) ZEND_ARG_PASS_INFO(0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_serialized_string_set, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_serialized_string_get, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_mine_set, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_mine_get, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_new_eslevent, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_serialize, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_setpriority, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_getheader, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_000, 0, 0, 0) ZEND_ARG_PASS_INFO(0) ZEND_ARG_PASS_INFO(0) ZEND_ARG_PASS_INFO(0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_getbody, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_gettype, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_addbody, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_addheader, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_0000, 0, 0, 0) ZEND_ARG_PASS_INFO(0) ZEND_ARG_PASS_INFO(0) ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_pushheader, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_unshiftheader, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_delheader, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_firstheader, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslevent_nextheader, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_new_eslconnection, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_socketdescriptor, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_connected, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_getinfo, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_send, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_sendrecv, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_api, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_bgapi, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_sendevent, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_sendmsg, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_recvevent, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_recveventtimed, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_filter, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_events, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_execute, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_executeasync, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_setasyncexecute, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_seteventlock, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslconnection_disconnect, 0, 0, 0) - ZEND_ARG_PASS_INFO(0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(swig_arginfo_eslsetloglevel, 0, 0, 0) ZEND_ARG_PASS_INFO(0) ZEND_END_ARG_INFO() @@ -3226,64 +3095,60 @@ ZEND_END_ARG_INFO() /* entry subsection */ /* Every non-class user visible function must have an entry here */ static zend_function_entry ESL_functions[] = { - SWIG_ZEND_NAMED_FE(eslevent_event_set,_wrap_ESLevent_event_set,swig_arginfo_eslevent_event_set) - SWIG_ZEND_NAMED_FE(eslevent_event_get,_wrap_ESLevent_event_get,swig_arginfo_eslevent_event_get) - SWIG_ZEND_NAMED_FE(eslevent_serialized_string_set,_wrap_ESLevent_serialized_string_set,swig_arginfo_eslevent_serialized_string_set) - SWIG_ZEND_NAMED_FE(eslevent_serialized_string_get,_wrap_ESLevent_serialized_string_get,swig_arginfo_eslevent_serialized_string_get) - SWIG_ZEND_NAMED_FE(eslevent_mine_set,_wrap_ESLevent_mine_set,swig_arginfo_eslevent_mine_set) - SWIG_ZEND_NAMED_FE(eslevent_mine_get,_wrap_ESLevent_mine_get,swig_arginfo_eslevent_mine_get) - SWIG_ZEND_NAMED_FE(new_eslevent,_wrap_new_ESLevent,swig_arginfo_new_eslevent) - SWIG_ZEND_NAMED_FE(eslevent_serialize,_wrap_ESLevent_serialize,swig_arginfo_eslevent_serialize) - SWIG_ZEND_NAMED_FE(eslevent_setpriority,_wrap_ESLevent_setPriority,swig_arginfo_eslevent_setpriority) - SWIG_ZEND_NAMED_FE(eslevent_getheader,_wrap_ESLevent_getHeader,swig_arginfo_eslevent_getheader) - SWIG_ZEND_NAMED_FE(eslevent_getbody,_wrap_ESLevent_getBody,swig_arginfo_eslevent_getbody) - SWIG_ZEND_NAMED_FE(eslevent_gettype,_wrap_ESLevent_getType,swig_arginfo_eslevent_gettype) - SWIG_ZEND_NAMED_FE(eslevent_addbody,_wrap_ESLevent_addBody,swig_arginfo_eslevent_addbody) - SWIG_ZEND_NAMED_FE(eslevent_addheader,_wrap_ESLevent_addHeader,swig_arginfo_eslevent_addheader) - SWIG_ZEND_NAMED_FE(eslevent_pushheader,_wrap_ESLevent_pushHeader,swig_arginfo_eslevent_pushheader) - SWIG_ZEND_NAMED_FE(eslevent_unshiftheader,_wrap_ESLevent_unshiftHeader,swig_arginfo_eslevent_unshiftheader) - SWIG_ZEND_NAMED_FE(eslevent_delheader,_wrap_ESLevent_delHeader,swig_arginfo_eslevent_delheader) - SWIG_ZEND_NAMED_FE(eslevent_firstheader,_wrap_ESLevent_firstHeader,swig_arginfo_eslevent_firstheader) - SWIG_ZEND_NAMED_FE(eslevent_nextheader,_wrap_ESLevent_nextHeader,swig_arginfo_eslevent_nextheader) - SWIG_ZEND_NAMED_FE(new_eslconnection,_wrap_new_ESLconnection,swig_arginfo_new_eslconnection) - SWIG_ZEND_NAMED_FE(eslconnection_socketdescriptor,_wrap_ESLconnection_socketDescriptor,swig_arginfo_eslconnection_socketdescriptor) - SWIG_ZEND_NAMED_FE(eslconnection_connected,_wrap_ESLconnection_connected,swig_arginfo_eslconnection_connected) - SWIG_ZEND_NAMED_FE(eslconnection_getinfo,_wrap_ESLconnection_getInfo,swig_arginfo_eslconnection_getinfo) - SWIG_ZEND_NAMED_FE(eslconnection_send,_wrap_ESLconnection_send,swig_arginfo_eslconnection_send) - SWIG_ZEND_NAMED_FE(eslconnection_sendrecv,_wrap_ESLconnection_sendRecv,swig_arginfo_eslconnection_sendrecv) - SWIG_ZEND_NAMED_FE(eslconnection_api,_wrap_ESLconnection_api,swig_arginfo_eslconnection_api) - SWIG_ZEND_NAMED_FE(eslconnection_bgapi,_wrap_ESLconnection_bgapi,swig_arginfo_eslconnection_bgapi) - SWIG_ZEND_NAMED_FE(eslconnection_sendevent,_wrap_ESLconnection_sendEvent,swig_arginfo_eslconnection_sendevent) - SWIG_ZEND_NAMED_FE(eslconnection_sendmsg,_wrap_ESLconnection_sendMSG,swig_arginfo_eslconnection_sendmsg) - SWIG_ZEND_NAMED_FE(eslconnection_recvevent,_wrap_ESLconnection_recvEvent,swig_arginfo_eslconnection_recvevent) - SWIG_ZEND_NAMED_FE(eslconnection_recveventtimed,_wrap_ESLconnection_recvEventTimed,swig_arginfo_eslconnection_recveventtimed) - SWIG_ZEND_NAMED_FE(eslconnection_filter,_wrap_ESLconnection_filter,swig_arginfo_eslconnection_filter) - SWIG_ZEND_NAMED_FE(eslconnection_events,_wrap_ESLconnection_events,swig_arginfo_eslconnection_events) - SWIG_ZEND_NAMED_FE(eslconnection_execute,_wrap_ESLconnection_execute,swig_arginfo_eslconnection_execute) - SWIG_ZEND_NAMED_FE(eslconnection_executeasync,_wrap_ESLconnection_executeAsync,swig_arginfo_eslconnection_executeasync) - SWIG_ZEND_NAMED_FE(eslconnection_setasyncexecute,_wrap_ESLconnection_setAsyncExecute,swig_arginfo_eslconnection_setasyncexecute) - SWIG_ZEND_NAMED_FE(eslconnection_seteventlock,_wrap_ESLconnection_setEventLock,swig_arginfo_eslconnection_seteventlock) - SWIG_ZEND_NAMED_FE(eslconnection_disconnect,_wrap_ESLconnection_disconnect,swig_arginfo_eslconnection_disconnect) - SWIG_ZEND_NAMED_FE(eslsetloglevel,_wrap_eslSetLogLevel,swig_arginfo_eslsetloglevel) + SWIG_ZEND_NAMED_FE(eslevent_event_set,_wrap_ESLevent_event_set,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslevent_event_get,_wrap_ESLevent_event_get,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslevent_serialized_string_set,_wrap_ESLevent_serialized_string_set,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslevent_serialized_string_get,_wrap_ESLevent_serialized_string_get,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslevent_mine_set,_wrap_ESLevent_mine_set,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslevent_mine_get,_wrap_ESLevent_mine_get,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(new_eslevent,_wrap_new_ESLevent,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslevent_serialize,_wrap_ESLevent_serialize,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslevent_setpriority,_wrap_ESLevent_setPriority,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslevent_getheader,_wrap_ESLevent_getHeader,swig_arginfo_000) + SWIG_ZEND_NAMED_FE(eslevent_getbody,_wrap_ESLevent_getBody,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslevent_gettype,_wrap_ESLevent_getType,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslevent_addbody,_wrap_ESLevent_addBody,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslevent_addheader,_wrap_ESLevent_addHeader,swig_arginfo_000) + SWIG_ZEND_NAMED_FE(eslevent_pushheader,_wrap_ESLevent_pushHeader,swig_arginfo_000) + SWIG_ZEND_NAMED_FE(eslevent_unshiftheader,_wrap_ESLevent_unshiftHeader,swig_arginfo_000) + SWIG_ZEND_NAMED_FE(eslevent_delheader,_wrap_ESLevent_delHeader,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslevent_firstheader,_wrap_ESLevent_firstHeader,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslevent_nextheader,_wrap_ESLevent_nextHeader,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(new_eslconnection,_wrap_new_ESLconnection,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslconnection_socketdescriptor,_wrap_ESLconnection_socketDescriptor,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslconnection_connected,_wrap_ESLconnection_connected,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslconnection_getinfo,_wrap_ESLconnection_getInfo,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslconnection_send,_wrap_ESLconnection_send,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslconnection_sendrecv,_wrap_ESLconnection_sendRecv,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslconnection_api,_wrap_ESLconnection_api,swig_arginfo_000) + SWIG_ZEND_NAMED_FE(eslconnection_bgapi,_wrap_ESLconnection_bgapi,swig_arginfo_0000) + SWIG_ZEND_NAMED_FE(eslconnection_sendevent,_wrap_ESLconnection_sendEvent,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslconnection_sendmsg,_wrap_ESLconnection_sendMSG,swig_arginfo_000) + SWIG_ZEND_NAMED_FE(eslconnection_recvevent,_wrap_ESLconnection_recvEvent,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslconnection_recveventtimed,_wrap_ESLconnection_recvEventTimed,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslconnection_filter,_wrap_ESLconnection_filter,swig_arginfo_000) + SWIG_ZEND_NAMED_FE(eslconnection_events,_wrap_ESLconnection_events,swig_arginfo_000) + SWIG_ZEND_NAMED_FE(eslconnection_execute,_wrap_ESLconnection_execute,swig_arginfo_0000) + SWIG_ZEND_NAMED_FE(eslconnection_executeasync,_wrap_ESLconnection_executeAsync,swig_arginfo_0000) + SWIG_ZEND_NAMED_FE(eslconnection_setasyncexecute,_wrap_ESLconnection_setAsyncExecute,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslconnection_seteventlock,_wrap_ESLconnection_setEventLock,swig_arginfo_00) + SWIG_ZEND_NAMED_FE(eslconnection_disconnect,_wrap_ESLconnection_disconnect,swig_arginfo_0) + SWIG_ZEND_NAMED_FE(eslsetloglevel,_wrap_eslSetLogLevel,swig_arginfo_0) SWIG_ZEND_NAMED_FE(swig_ESL_alter_newobject,_wrap_swig_ESL_alter_newobject,NULL) SWIG_ZEND_NAMED_FE(swig_ESL_get_newobject,_wrap_swig_ESL_get_newobject,NULL) -{NULL, NULL, NULL} + ZEND_FE_END }; /* init section */ -#if ZEND_MODULE_API_NO <= 20090626 -#undef ZEND_MODULE_BUILD_ID -#define ZEND_MODULE_BUILD_ID (char*)"API" ZEND_TOSTR(ZEND_MODULE_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA -#endif zend_module_entry ESL_module_entry = { STANDARD_MODULE_HEADER, - (char*)"ESL", + "ESL", ESL_functions, PHP_MINIT(ESL), - PHP_MSHUTDOWN(ESL), - PHP_RINIT(ESL), - PHP_RSHUTDOWN(ESL), - PHP_MINFO(ESL), + NULL, /* No MSHUTDOWN code */ + NULL, /* No RINIT code */ + NULL, /* No RSHUTDOWN code */ + NULL, /* No MINFO code */ NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; @@ -3298,6 +3163,7 @@ SWIGEXPORT zend_module_entry *get_module(void) { return &ESL_module_entry; } #endif #define SWIG_php_minit PHP_MINIT_FUNCTION(ESL) + /* ----------------------------------------------------------------------------- * Type initialization: * This problem is tough by the requirement that no dynamic @@ -3355,7 +3221,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found, init; + int init; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { @@ -3374,22 +3240,18 @@ SWIG_InitializeModule(void *clientdata) { /* This is the first module loaded for this interpreter */ /* so set the swig module into the interpreter */ SWIG_SetModule(clientdata, &swig_module); - module_head = &swig_module; } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - found=0; iter=module_head; do { if (iter==&swig_module) { - found=1; - break; + /* Our module is already in the list, so there's nothing more to do. */ + return; } iter=iter->next; } while (iter!= module_head); - /* if the is found in the list, then all is done and we may leave */ - if (found) return; - /* otherwise we must add out module into the list */ + /* otherwise we must add our module into the list */ swig_module.next = module_head->next; module_head->next = &swig_module; } @@ -3534,20 +3396,20 @@ SWIG_PropagateClientData(void) { #endif - SWIG_php_minit { +SWIG_php_minit { SWIG_InitializeModule(0); /* oinit subsection */ -ZEND_INIT_MODULE_GLOBALS(ESL, ESL_init_globals, ESL_destroy_globals); +ZEND_INIT_MODULE_GLOBALS(ESL, ESL_init_globals, NULL); /* Register resource destructors for pointer types */ -le_swig__p_esl_priority_t=zend_register_list_destructors_ex(_wrap_destroy_p_esl_priority_t,NULL,(char *)(SWIGTYPE_p_esl_priority_t->name),module_number); +le_swig__p_esl_priority_t=zend_register_list_destructors_ex(_swig_default_rsrc_destroy, NULL, SWIGTYPE_p_esl_priority_t->name, module_number); SWIG_TypeClientData(SWIGTYPE_p_esl_priority_t,&le_swig__p_esl_priority_t); -le_swig__p_ESLevent=zend_register_list_destructors_ex(_wrap_destroy_p_ESLevent,NULL,(char *)(SWIGTYPE_p_ESLevent->name),module_number); +le_swig__p_ESLevent=zend_register_list_destructors_ex(_wrap_destroy_p_ESLevent, NULL, SWIGTYPE_p_ESLevent->name, module_number); SWIG_TypeClientData(SWIGTYPE_p_ESLevent,&le_swig__p_ESLevent); -le_swig__p_esl_event_t=zend_register_list_destructors_ex(_wrap_destroy_p_esl_event_t,NULL,(char *)(SWIGTYPE_p_esl_event_t->name),module_number); +le_swig__p_esl_event_t=zend_register_list_destructors_ex(_swig_default_rsrc_destroy, NULL, SWIGTYPE_p_esl_event_t->name, module_number); SWIG_TypeClientData(SWIGTYPE_p_esl_event_t,&le_swig__p_esl_event_t); -le_swig__p_ESLconnection=zend_register_list_destructors_ex(_wrap_destroy_p_ESLconnection,NULL,(char *)(SWIGTYPE_p_ESLconnection->name),module_number); +le_swig__p_ESLconnection=zend_register_list_destructors_ex(_wrap_destroy_p_ESLconnection, NULL, SWIGTYPE_p_ESLconnection->name, module_number); SWIG_TypeClientData(SWIGTYPE_p_ESLconnection,&le_swig__p_ESLconnection); CG(active_class_entry) = NULL; /* end oinit subsection */ @@ -3558,33 +3420,4 @@ CG(active_class_entry) = NULL; return SUCCESS; } -PHP_RINIT_FUNCTION(ESL) -{ -/* rinit section */ - -/* vinit subsection */ -/* end vinit subsection */ - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(ESL) -{ -/* shutdown section */ -#ifdef ZTS - ts_free_id(ESL_globals_id); -#endif - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(ESL) -{ -/* rshutdown section */ - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(ESL) -{ -} /* end init section */ diff --git a/libs/esl/php/php_ESL.h b/libs/esl/php/php_ESL.h index d6420ea75d..eddf998dd9 100644 --- a/libs/esl/php/php_ESL.h +++ b/libs/esl/php/php_ESL.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.2 + * Version 3.0.12 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -20,16 +20,6 @@ extern zend_module_entry ESL_module_entry; # define PHP_ESL_API #endif -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(ESL); -PHP_MSHUTDOWN_FUNCTION(ESL); -PHP_RINIT_FUNCTION(ESL); -PHP_RSHUTDOWN_FUNCTION(ESL); -PHP_MINFO_FUNCTION(ESL); - ZEND_NAMED_FUNCTION(_wrap_ESLevent_event_set); ZEND_NAMED_FUNCTION(_wrap_ESLevent_event_get); ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_set); @@ -69,4 +59,6 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setAsyncExecute); ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setEventLock); ZEND_NAMED_FUNCTION(_wrap_ESLconnection_disconnect); ZEND_NAMED_FUNCTION(_wrap_eslSetLogLevel); +PHP_MINIT_FUNCTION(ESL); + #endif /* PHP_ESL_H */ diff --git a/libs/esl/src/esl_event.c b/libs/esl/src/esl_event.c index 75a456c861..fa51194853 100644 --- a/libs/esl/src/esl_event.c +++ b/libs/esl/src/esl_event.c @@ -148,6 +148,7 @@ static const char *EVENT_NAMES[] = { "CALL_DETAIL", "DEVICE_STATE", "TEXT", + "SHUTDOWN_REQUESTED", "ALL" }; diff --git a/libs/esl/src/include/esl_event.h b/libs/esl/src/include/esl_event.h index 765d0e6150..de070ad723 100644 --- a/libs/esl/src/include/esl_event.h +++ b/libs/esl/src/include/esl_event.h @@ -138,6 +138,7 @@ typedef enum { ESL_EVENT_CALL_DETAIL, ESL_EVENT_DEVICE_STATE, ESL_EVENT_TEXT, + ESL_EVENT_SHUTDOWN_REQUESTED, ESL_EVENT_ALL } esl_event_types_t; diff --git a/libs/libvpx/build/make/configure.sh b/libs/libvpx/build/make/configure.sh index 683b430374..4bf61eb5eb 100644 --- a/libs/libvpx/build/make/configure.sh +++ b/libs/libvpx/build/make/configure.sh @@ -757,6 +757,18 @@ process_common_toolchain() { tgt_isa=x86_64 tgt_os=darwin16 ;; + *darwin17*) + tgt_isa=x86_64 + tgt_os=darwin17 + ;; + *darwin18*) + tgt_isa=x86_64 + tgt_os=darwin18 + ;; + *darwin19*) + tgt_isa=x86_64 + tgt_os=darwin19 + ;; x86_64*mingw32*) tgt_os=win64 ;; @@ -885,6 +897,18 @@ process_common_toolchain() { add_cflags "-mmacosx-version-min=10.12" add_ldflags "-mmacosx-version-min=10.12" ;; + *-darwin17-*) + add_cflags "-mmacosx-version-min=10.13" + add_ldflags "-mmacosx-version-min=10.13" + ;; + *-darwin18-*) + add_cflags "-mmacosx-version-min=10.14" + add_ldflags "-mmacosx-version-min=10.14" + ;; + *-darwin19-*) + add_cflags "-mmacosx-version-min=10.15" + add_ldflags "-mmacosx-version-min=10.15" + ;; *-iphonesimulator-*) add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}" add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}" diff --git a/libs/libvpx/build/make/iosbuild.sh b/libs/libvpx/build/make/iosbuild.sh index 365a8c0130..3211d4f5ef 100755 --- a/libs/libvpx/build/make/iosbuild.sh +++ b/libs/libvpx/build/make/iosbuild.sh @@ -35,8 +35,8 @@ ARM_TARGETS="arm64-darwin-gcc armv7s-darwin-gcc" SIM_TARGETS="x86-iphonesimulator-gcc x86_64-iphonesimulator-gcc" -OSX_TARGETS="x86-darwin16-gcc - x86_64-darwin16-gcc" +OSX_TARGETS="x86-darwin18-gcc + x86_64-darwin18-gcc" TARGETS="${ARM_TARGETS} ${SIM_TARGETS}" # Configures for the target specified by $1, and invokes make with the dist @@ -271,7 +271,7 @@ cat << EOF --help: Display this message and exit. --enable-shared: Build a dynamic framework for use on iOS 8 or later. --extra-configure-args : Extra args to pass when configuring libvpx. - --macosx: Uses darwin16 targets instead of iphonesimulator targets for x86 + --macosx: Uses darwin18 targets instead of iphonesimulator targets for x86 and x86_64. Allows linking to framework when builds target MacOSX instead of iOS. --preserve-build-output: Do not delete the build directory. diff --git a/libs/libvpx/configure b/libs/libvpx/configure index e5a74c6f2a..c84c891c0b 100755 --- a/libs/libvpx/configure +++ b/libs/libvpx/configure @@ -129,6 +129,8 @@ all_platforms="${all_platforms} x86-darwin13-gcc" all_platforms="${all_platforms} x86-darwin14-gcc" all_platforms="${all_platforms} x86-darwin15-gcc" all_platforms="${all_platforms} x86-darwin16-gcc" +all_platforms="${all_platforms} x86-darwin17-gcc" +all_platforms="${all_platforms} x86-darwin18-gcc" all_platforms="${all_platforms} x86-iphonesimulator-gcc" all_platforms="${all_platforms} x86-linux-gcc" all_platforms="${all_platforms} x86-linux-icc" @@ -149,6 +151,9 @@ all_platforms="${all_platforms} x86_64-darwin13-gcc" all_platforms="${all_platforms} x86_64-darwin14-gcc" all_platforms="${all_platforms} x86_64-darwin15-gcc" all_platforms="${all_platforms} x86_64-darwin16-gcc" +all_platforms="${all_platforms} x86_64-darwin17-gcc" +all_platforms="${all_platforms} x86_64-darwin18-gcc" +all_platforms="${all_platforms} x86_64-darwin19-gcc" all_platforms="${all_platforms} x86_64-iphonesimulator-gcc" all_platforms="${all_platforms} x86_64-linux-gcc" all_platforms="${all_platforms} x86_64-linux-icc" diff --git a/libs/libzrtp/include/zrtp_config.h b/libs/libzrtp/include/zrtp_config.h index b4631c2007..dbfad31f7d 100644 --- a/libs/libzrtp/include/zrtp_config.h +++ b/libs/libzrtp/include/zrtp_config.h @@ -119,6 +119,12 @@ */ #define ZRTP_BYTE_ORDER ZBO_LITTLE_ENDIAN +#elif defined(__e2k__) +/* + * Elbrus, little endian + */ +#define ZRTP_BYTE_ORDER ZBO_LITTLE_ENDIAN + #endif /* Automatic byte order detection */ #endif diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 8fcd3faae4..84d396ff55 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Mon Aug 19 16:25:57 CDT 2019 +Wed Dec 11 15:38:35 MST 2019 diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c index 5fa444a227..969fff6e93 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c @@ -1040,6 +1040,10 @@ int nua_client_response(nua_client_request_t *cr, if (cr->cr_restarting) return 0; + if (cr->cr_status == 200 && status < 200) { // ignore 183 follows 200 + return 0; + } + nua_client_request_ref(cr); cr->cr_status = status; diff --git a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_sip.c b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_sip.c index bc03a69cfb..9dd0e3f347 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_sip.c +++ b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres_sip.c @@ -904,7 +904,7 @@ sres_sip_log_answers(sres_sip_t *srs, SU_DEBUG_5(("srs(%p): %s IN CNAME %s\n", (void *)srs, domain, cname)); } #if SU_HAVE_IN6 - else if (type == sres_type_cname) { + else if (type == sres_type_aaaa) { sres_aaaa_record_t const *aaaa = sr->sr_aaaa; su_inet_ntop(AF_INET6, &aaaa->aaaa_addr, addr, sizeof(addr)); SU_DEBUG_5(("srs(%p): %s IN AAAA %s\n", (void *)srs, domain, addr)); diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c b/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c index e438a89543..67450734a2 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c @@ -210,8 +210,11 @@ su_inline void safefree(void *b) { b ? free(b) : (void)0; } #endif static inline su_block_t* MEMLOCK(const su_home_t *h) { - if (h && h->suh_lock) _su_home_locker(h->suh_lock); - return h->suh_blocks; + if (h) { + if (h->suh_lock) _su_home_locker(h->suh_lock); + return h->suh_blocks; + } + return NULL; } static inline void* UNLOCK(const su_home_t *h) { if (h && h->suh_lock) _su_home_unlocker(h->suh_lock); @@ -271,9 +274,9 @@ struct su_block_s { static void su_home_check_blocks(su_block_t const *b); -static void su_home_stats_alloc(su_block_t *, void *p, void *preload, +static void su_home_stats_alloc(su_block_t *, void *preload, size_t size, int zero); -static void su_home_stats_free(su_block_t *sub, void *p, void *preload, +static void su_home_stats_free(su_block_t *sub, void *preload, unsigned size); static void _su_home_deinit(su_home_t *home); @@ -529,7 +532,7 @@ void *sub_alloc(su_home_t *home, sua->sua_home = zero > 1; if (sub->sub_stats) - su_home_stats_alloc(sub, data, preload, size, zero); + su_home_stats_alloc(sub, preload, size, zero); } return data; @@ -923,7 +926,7 @@ void su_free(su_home_t *home, void *data) preloaded = data; if (sub->sub_stats) - su_home_stats_free(sub, data, preloaded, allocation->sua_size); + su_home_stats_free(sub, preloaded, allocation->sua_size); if (allocation->sua_home) { su_home_t *subhome = data; @@ -1425,8 +1428,8 @@ void *su_realloc(su_home_t *home, void *data, isize_t size) ndata = realloc(data, size + MEMCHECK_EXTRA); if (ndata) { if (sub->sub_stats) { - su_home_stats_free(sub, data, 0, sua->sua_size); - su_home_stats_alloc(sub, data, 0, size, 1); + su_home_stats_free(sub, 0, sua->sua_size); + su_home_stats_alloc(sub, 0, size, 1); } #if MEMCHECK_EXTRA @@ -1453,8 +1456,8 @@ void *su_realloc(su_home_t *home, void *data, isize_t size) if (p2 <= sub->sub_prsize) { /* Extend/reduce existing preload */ if (sub->sub_stats) { - su_home_stats_free(sub, data, data, sua->sua_size); - su_home_stats_alloc(sub, data, data, size, 0); + su_home_stats_free(sub, data, sua->sua_size); + su_home_stats_alloc(sub, data, size, 0); } sub->sub_prused = (unsigned)p2; @@ -1470,8 +1473,8 @@ void *su_realloc(su_home_t *home, void *data, isize_t size) else if (size < (size_t)sua->sua_size) { /* Reduce existing preload */ if (sub->sub_stats) { - su_home_stats_free(sub, data, data, sua->sua_size); - su_home_stats_alloc(sub, data, data, size, 0); + su_home_stats_free(sub, data, sua->sua_size); + su_home_stats_alloc(sub, data, size, 0); } #if MEMCHECK_EXTRA memcpy((char *)data + size, &term, sizeof (term)); @@ -1488,7 +1491,7 @@ void *su_realloc(su_home_t *home, void *data, isize_t size) /* Free preload */ sub->sub_prused = (char *)data - home->suh_blocks->sub_preload; if (sub->sub_stats) - su_home_stats_free(sub, data, data, sua->sua_size); + su_home_stats_free(sub, data, sua->sua_size); } memcpy(ndata, data, @@ -1500,7 +1503,7 @@ void *su_realloc(su_home_t *home, void *data, isize_t size) #endif if (sub->sub_stats) - su_home_stats_alloc(sub, data, 0, size, 1); + su_home_stats_alloc(sub, 0, size, 1); memset(sua, 0, sizeof *sua); sub->sub_used--; @@ -1837,7 +1840,7 @@ void su_home_get_stats(su_home_t *home, int include_clones, } static -void su_home_stats_alloc(su_block_t *sub, void *p, void *preload, +void su_home_stats_alloc(su_block_t *sub, void *preload, size_t size, int zero) { su_home_stat_t *hs = sub->sub_stats; @@ -1866,7 +1869,7 @@ void su_home_stats_alloc(su_block_t *sub, void *p, void *preload, } static -void su_home_stats_free(su_block_t *sub, void *p, void *preload, +void su_home_stats_free(su_block_t *sub, void *preload, unsigned size) { su_home_stat_t *hs = sub->sub_stats; diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport.c index 286de1a91e..fbfdfa56b6 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport.c @@ -1056,15 +1056,19 @@ int tport_register_secondary(tport_t *self, su_wakeup_f wakeup, int events) && (i = su_root_register(root, wait, wakeup, self, 0)) != -1) { + /* Can't be added to list of opened if already closed */ + if (tport_is_closed(self)) goto fail; + self->tp_index = i; self->tp_events = events; - /* Can't be added to list of opened if already closed */ - if (!tport_is_closed(self)) - tprb_append(&self->tp_pri->pri_open, self); + tprb_append(&self->tp_pri->pri_open, self); + return 0; } +fail: + SU_DEBUG_9(("%s(%p): tport is %s!\n", __func__, (void *)self, (tport_is_closed(self) ? "closed" : "opened"))); su_wait_destroy(wait); return -1; } @@ -2763,6 +2767,7 @@ static int tport_wakeup_pri(su_root_magic_t *m, su_wait_t *w, tport_t *self) int tport_wakeup(su_root_magic_t *magic, su_wait_t *w, tport_t *self) { int events = su_wait_events(w, self->tp_socket); + int error; #if HAVE_POLL assert(w->fd == self->tp_socket); @@ -2777,9 +2782,16 @@ int tport_wakeup(su_root_magic_t *magic, su_wait_t *w, tport_t *self) self->tp_closed ? " (closed)" : "")); if (self->tp_pri->pri_vtable->vtp_wakeup) - return self->tp_pri->pri_vtable->vtp_wakeup(self, events); + error = self->tp_pri->pri_vtable->vtp_wakeup(self, events); else - return tport_base_wakeup(self, events); + error = tport_base_wakeup(self, events); + + if (tport_is_closed(self)) { + SU_DEBUG_9(("%s(%p): tport is closed! Setting secondary timer!\n", "tport_wakeup", (void *)self)); + tport_set_secondary_timer(self); + } + + return error; } static int tport_base_wakeup(tport_t *self, int events) diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c index f06aaaabab..8b079e9117 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c @@ -969,12 +969,19 @@ int tls_connect(su_root_magic_t *magic, su_wait_t *w, tport_t *self) if (events & SU_WAIT_HUP && !self->tp_closed) tport_hup_event(self); - if (self->tp_closed) + if (self->tp_closed) { + SU_DEBUG_9(("%s(%p): tport was closed during connect. Returning, but set secondary timer first.\n", + __func__, (void *)self)); + tport_set_secondary_timer(self); return 0; + } error = su_soerror(self->tp_socket); if (error) { tport_error_report(self, error, NULL); + SU_DEBUG_9(("%s(%p): socket error during connect. Returning, but set secondary timer first.\n", + __func__, (void *)self)); + tport_set_secondary_timer(self); return 0; } diff --git a/scripts/FreeSWITCH-debian-raspbian-installer.sh b/scripts/FreeSWITCH-debian-raspbian-installer.sh index d91a1d8129..e40983783b 100755 --- a/scripts/FreeSWITCH-debian-raspbian-installer.sh +++ b/scripts/FreeSWITCH-debian-raspbian-installer.sh @@ -133,10 +133,10 @@ config_fs_repos() { curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add - if [ "$FS_REV" = "master" ]; then echo "deb http://files.freeswitch.org/repo/deb/debian-unstable/ jessie main" >/etc/apt/sources.list.d/freeswitch.list - REPO="https://freeswitch.org/stash/scm/fs/freeswitch.git" + REPO="https://github.com/signalwire/freeswitch.git" elif [ "$FS_REV" = "1.6" ]; then echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list - REPO="-b v1.6 https://silik0n@freeswitch.org/stash/scm/fs/freeswitch.git" + REPO="-b v1.6 https://github.com/signalwire/freeswitch.git" fi apt-get update 2>&1 >/dev/null } diff --git a/scripts/debian_min_build.sh b/scripts/debian_min_build.sh index f900c3a9a6..953f3840ad 100755 --- a/scripts/debian_min_build.sh +++ b/scripts/debian_min_build.sh @@ -12,7 +12,7 @@ apt-get update && apt-get install -y libtool libjpeg62-turbo-dev ntpdate libfree cd /usr/src -git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git +git clone https://github.com/signalwire/freeswitch.git freeswitch.git cd freeswitch.git diff --git a/src/include/switch_core.h b/src/include/switch_core.h index 8dcea8acf3..8255e13c85 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -623,6 +623,8 @@ SWITCH_DECLARE(const switch_state_handler_table_t *) switch_core_get_state_handl SWITCH_DECLARE(void) switch_core_memory_pool_tag(switch_memory_pool_t *pool, const char *tag); +SWITCH_DECLARE(void) switch_core_pool_stats(switch_stream_handle_t *stream); + SWITCH_DECLARE(switch_status_t) switch_core_perform_new_memory_pool(_Out_ switch_memory_pool_t **pool, _In_z_ const char *file, _In_z_ const char *func, _In_ int line); @@ -1424,6 +1426,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_init_case(_Out_ switch_hash_t * */ SWITCH_DECLARE(switch_status_t) switch_core_hash_destroy(_Inout_ switch_hash_t **hash); +/*! + \brief Insert data into a hash and set flags so the value is automatically freed on delete + \param hash the hash to add data to + \param key the name of the key to add the data to + \param data the data to add + \return SWITCH_STATUS_SUCCESS if the data is added + \note the string key must be a constant or a dynamic string +*/ +SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_auto_free(switch_hash_t *hash, const char *key, const void *data); + /*! \brief Insert data into a hash \param hash the hash to add data to @@ -1842,6 +1854,13 @@ SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_video_write_codec(_In_ */ SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(const char *filename); +/*! + \brief Open a core db (SQLite) in-memory + \param uri to the db to open + \return the db handle +*/ +SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_in_memory(const char *uri); + /*! \brief Execute a sql stmt until it is accepted \param db the db handle @@ -2473,7 +2492,8 @@ typedef int (*switch_core_db_event_callback_func_t) (void *pArg, switch_event_t #define CACHE_DB_LEN 256 typedef enum { CDF_INUSE = (1 << 0), - CDF_PRUNE = (1 << 1) + CDF_PRUNE = (1 << 1), + CDF_NONEXPIRING = (1 << 2) } cache_db_flag_t; typedef enum { @@ -2483,13 +2503,14 @@ typedef enum { } switch_cache_db_handle_type_t; typedef union { - switch_core_db_t *core_db_dbh; + switch_coredb_handle_t *core_db_dbh; switch_odbc_handle_t *odbc_dbh; switch_database_interface_handle_t *database_interface_dbh; } switch_cache_db_native_handle_t; typedef struct { char *db_path; + switch_bool_t in_memory; } switch_cache_db_core_db_options_t; typedef struct { diff --git a/src/include/switch_core_db.h b/src/include/switch_core_db.h index a2d0fd20f7..4fbdc5bc63 100644 --- a/src/include/switch_core_db.h +++ b/src/include/switch_core_db.h @@ -51,6 +51,12 @@ SWITCH_BEGIN_EXTERN_C * following opaque structure. */ typedef struct sqlite3 switch_core_db_t; + +struct switch_coredb_handle { + switch_bool_t in_memory; + switch_core_db_t *handle; +}; + typedef struct sqlite3_stmt switch_core_db_stmt_t; typedef int (*switch_core_db_callback_func_t) (void *pArg, int argc, char **argv, char **columnNames); @@ -103,41 +109,47 @@ SWITCH_DECLARE(int) switch_core_db_close(switch_core_db_t *db); SWITCH_DECLARE(int) switch_core_db_open(const char *filename, switch_core_db_t **ppDb); /** - * The next group of routines returns information about the information - * in a single column of the current result row of a query. In every - * case the first parameter is a pointer to the SQL statement that is being - * executed (the switch_core_db_stmt_t* that was returned from switch_core_db_prepare()) and - * the second argument is the index of the column for which information - * should be returned. iCol is zero-indexed. The left-most column as an - * index of 0. + Same as switch_core_db_open() but additionally allows SQLITE_OPEN_URI + */ +SWITCH_DECLARE(int) switch_core_db_open_v2(const char *filename, switch_core_db_t **ppDb); + +/** + * ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(), + * even empty strings, are always zero-terminated. ^The return + * value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer. * - * If the SQL statement is not currently point to a valid row, or if the - * the colulmn index is out of range, the result is undefined. + * ^The object returned by [sqlite3_column_value()] is an + * [unprotected sqlite3_value] object. An unprotected sqlite3_value object + * may only be used with [sqlite3_bind_value()] and [sqlite3_result_value()]. + * If the [unprotected sqlite3_value] object returned by + * [sqlite3_column_value()] is used in any other way, including calls + * to routines like [sqlite3_value_int()], [sqlite3_value_text()], + * or [sqlite3_value_bytes()], then the behavior is undefined. * - * These routines attempt to convert the value where appropriate. For + * These routines attempt to convert the value where appropriate. ^For * example, if the internal representation is FLOAT and a text result - * is requested, sprintf() is used internally to do the conversion - * automatically. The following table details the conversions that - * are applied: + * is requested, [sqlite3_snprintf()] is used internally to perform the + * conversion automatically. ^(The following table details the conversions + * that are applied: * * Internal Type Requested Type Conversion * ------------- -------------- -------------------------- * NULL INTEGER Result is 0 * NULL FLOAT Result is 0.0 - * NULL TEXT Result is an empty string - * NULL BLOB Result is a zero-length BLOB + * NULL TEXT Result is a NULL pointer + * NULL BLOB Result is a NULL pointer * INTEGER FLOAT Convert from integer to float * INTEGER TEXT ASCII rendering of the integer - * INTEGER BLOB Same as for INTEGER->TEXT - * FLOAT INTEGER Convert from float to integer + * INTEGER BLOB Same as INTEGER->TEXT + * FLOAT INTEGER [CAST] to INTEGER * FLOAT TEXT ASCII rendering of the float - * FLOAT BLOB Same as FLOAT->TEXT - * TEXT INTEGER Use atoi() - * TEXT FLOAT Use atof() + * FLOAT BLOB [CAST] to BLOB + * TEXT INTEGER [CAST] to INTEGER + * TEXT FLOAT [CAST] to REAL * TEXT BLOB No change - * BLOB INTEGER Convert to TEXT then use atoi() - * BLOB FLOAT Convert to TEXT then use atof() - * BLOB TEXT Add a "\000" terminator if needed + * BLOB INTEGER [CAST] to INTEGER + * BLOB FLOAT [CAST] to REAL + * BLOB TEXT Add a zero terminator if needed * * Return the value as UTF-8 text. */ diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h index ab01aa49c0..39e915edc5 100644 --- a/src/include/switch_ivr.h +++ b/src/include/switch_ivr.h @@ -1052,8 +1052,9 @@ SWITCH_DECLARE(int) switch_dial_handle_get_peers(switch_dial_handle_t *handle, i SWITCH_DECLARE(int) switch_dial_handle_get_vars(switch_dial_handle_t *handle, int idx, switch_event_t **array, int max); SWITCH_DECLARE(switch_event_t *) switch_dial_handle_get_global_vars(switch_dial_handle_t *handle); SWITCH_DECLARE(switch_event_t *) switch_dial_leg_get_vars(switch_dial_leg_t *leg); +SWITCH_DECLARE(const char *) switch_dial_leg_get_var(switch_dial_leg_t *leg, const char *key); SWITCH_DECLARE(int) switch_dial_handle_get_total(switch_dial_handle_t *handle); -SWITCH_DECLARE(void) switch_ivr_orig_and_bridge(switch_core_session_t *session, const char *data, switch_dial_handle_t *dh); +SWITCH_DECLARE(switch_status_t) switch_ivr_orig_and_bridge(switch_core_session_t *session, const char *data, switch_dial_handle_t *dh, switch_call_cause_t *cause); SWITCH_DECLARE(switch_status_t) switch_ivr_play_and_collect_input(switch_core_session_t *session, const char *prompt, diff --git a/src/include/switch_msrp.h b/src/include/switch_msrp.h index 0b114c02fa..9ec9243664 100644 --- a/src/include/switch_msrp.h +++ b/src/include/switch_msrp.h @@ -34,9 +34,6 @@ #include -#define MSRP_LISTEN_PORT 2855 -#define MSRP_SSL_LISTEN_PORT 2856 - enum { MSRP_ST_WAIT_HEADER, MSRP_ST_PARSE_HEADER, diff --git a/src/include/switch_types.h b/src/include/switch_types.h index ff69cbd9e5..4cfeb4231d 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -387,7 +387,9 @@ typedef enum { SCF_DIALPLAN_TIMESTAMPS = (1 << 24), SCF_CPF_SOFT_PREFIX = (1 << 25), SCF_CPF_SOFT_LOOKUP = (1 << 26), - SCF_EVENT_CHANNEL_ENABLE_HIERARCHY_DELIVERY = (1 << 27) + SCF_EVENT_CHANNEL_ENABLE_HIERARCHY_DELIVERY = (1 << 27), + SCF_EVENT_CHANNEL_HIERARCHY_DELIVERY_ONCE = (1 << 28), + SCF_EVENT_CHANNEL_LOG_UNDELIVERABLE_JSON = (1 << 29) } switch_core_flag_enum_t; typedef uint32_t switch_core_flag_t; @@ -1892,7 +1894,8 @@ typedef enum { SMBF_SPY_VIDEO_STREAM = (1 << 22), SMBF_SPY_VIDEO_STREAM_BLEG = (1 << 23), SMBF_READ_VIDEO_PATCH = (1 << 24), - SMBF_READ_TEXT_STREAM = (1 << 25) + SMBF_READ_TEXT_STREAM = (1 << 25), + SMBF_FIRST = (1 << 26) } switch_media_bug_flag_enum_t; typedef uint32_t switch_media_bug_flag_t; @@ -1935,7 +1938,8 @@ typedef enum { SWITCH_FILE_NOMUX = (1 << 17), SWITCH_FILE_BREAK_ON_CHANGE = (1 << 18), SWITCH_FILE_FLAG_VIDEO = (1 << 19), - SWITCH_FILE_FLAG_VIDEO_EOF = (1 << 20) + SWITCH_FILE_FLAG_VIDEO_EOF = (1 << 20), + SWITCH_FILE_PRE_CLOSED = (1 << 21) } switch_file_flag_enum_t; typedef uint32_t switch_file_flag_t; @@ -2045,6 +2049,7 @@ typedef uint32_t switch_io_flag_t; SWITCH_EVENT_CALL_SETUP_RESULT SWITCH_EVENT_CALL_DETAIL SWITCH_EVENT_DEVICE_STATE + SWITCH_EVENT_SHUTDOWN_REQUESTED - Shutdown of the system has been requested SWITCH_EVENT_ALL - All events at once @@ -2140,6 +2145,7 @@ typedef enum { SWITCH_EVENT_CALL_DETAIL, SWITCH_EVENT_DEVICE_STATE, SWITCH_EVENT_TEXT, + SWITCH_EVENT_SHUTDOWN_REQUESTED, SWITCH_EVENT_ALL } switch_event_types_t; @@ -2315,6 +2321,7 @@ typedef struct switch_codec_implementation switch_codec_implementation_t; 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_coredb_handle switch_coredb_handle_t; typedef struct switch_odbc_handle switch_odbc_handle_t; typedef struct switch_database_interface_handle switch_database_interface_handle_t; diff --git a/src/include/switch_xml.h b/src/include/switch_xml.h index 5ea600a550..25aa2002c5 100644 --- a/src/include/switch_xml.h +++ b/src/include/switch_xml.h @@ -57,6 +57,8 @@ #define FREESWITCH_XML_H #include +/* Use UTF-8 as the general encoding */ +#define USE_UTF_8_ENCODING SWITCH_TRUE struct switch_xml_binding; @@ -69,7 +71,8 @@ SWITCH_BEGIN_EXTERN_C SWITCH_XML_ROOT = (1 << 0), // root SWITCH_XML_NAMEM = (1 << 1), // name is malloced SWITCH_XML_TXTM = (1 << 2), // txt is malloced - SWITCH_XML_DUP = (1 << 3) // attribute name and value are strduped + SWITCH_XML_DUP = (1 << 3), // attribute name and value are strduped + SWITCH_XML_CDATA = (1 << 4) // body is in CDATA } switch_xml_flag_t; /*! \brief A representation of an XML tree */ @@ -212,10 +215,15 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_get(_In_ switch_xml_t xml,...); ///\ must be freed. ///\param xml the xml node ///\param prn_header add header too +///\param use_utf8_encoding encoding into ampersand entities for UTF-8 chars ///\return the ampersanded html text string to display xml -SWITCH_DECLARE(char *) switch_xml_toxml(_In_ switch_xml_t xml, _In_ switch_bool_t prn_header); -SWITCH_DECLARE(char *) switch_xml_toxml_nolock(switch_xml_t xml, _In_ switch_bool_t prn_header); -SWITCH_DECLARE(char *) switch_xml_tohtml(_In_ switch_xml_t xml, _In_ switch_bool_t prn_header); +#define switch_xml_toxml(xml, prn_header) switch_xml_toxml_ex(xml, prn_header, USE_UTF_8_ENCODING) +#define switch_xml_toxml_nolock(xml, prn_header) switch_xml_toxml_nolock_ex(xml, prn_header, USE_UTF_8_ENCODING) +#define switch_xml_tohtml(xml, prn_header) switch_xml_tohtml_ex(xml, prn_header, USE_UTF_8_ENCODING) + +SWITCH_DECLARE(char *) switch_xml_toxml_ex(_In_ switch_xml_t xml, _In_ switch_bool_t prn_header, switch_bool_t use_utf8_encoding); +SWITCH_DECLARE(char *) switch_xml_toxml_nolock_ex(switch_xml_t xml, _In_ switch_bool_t prn_header, switch_bool_t use_utf8_encoding); +SWITCH_DECLARE(char *) switch_xml_tohtml_ex(_In_ switch_xml_t xml, _In_ switch_bool_t prn_header, switch_bool_t use_utf8_encoding); ///\brief Converts an switch_xml structure back to xml using the buffer passed in the parameters. ///\param xml the xml node @@ -223,9 +231,12 @@ SWITCH_DECLARE(char *) switch_xml_tohtml(_In_ switch_xml_t xml, _In_ switch_bool ///\param buflen size of buffer ///\param offset offset to start at ///\param prn_header add header too +///\param use_utf8_encoding encoding into ampersand entities for UTF-8 chars ///\return the xml text string -SWITCH_DECLARE(char *) switch_xml_toxml_buf(_In_ switch_xml_t xml, _In_z_ char *buf, _In_ switch_size_t buflen, _In_ switch_size_t offset, - _In_ switch_bool_t prn_header); +#define switch_xml_toxml_buf(xml, buf, buflen, offset, prn_header) switch_xml_toxml_buf(xml, buf, buflen, offset, prn_header, USE_UTF_8_ENCODING); +SWITCH_DECLARE(char *) switch_xml_toxml_buf_ex(_In_ switch_xml_t xml, _In_z_ char *buf, _In_ switch_size_t buflen, _In_ switch_size_t offset, + _In_ switch_bool_t prn_header, switch_bool_t use_utf8_encoding); + ///\brief returns a NULL terminated array of processing instructions for the given ///\ target diff --git a/src/include/test/switch_fct.h b/src/include/test/switch_fct.h index f2de6920f7..ab70d882c5 100644 --- a/src/include/test/switch_fct.h +++ b/src/include/test/switch_fct.h @@ -3663,9 +3663,12 @@ with. If we fail a setup up, then we go directly to a teardown mode. */ fct_ts__add_test( \ fctkern_ptr__->ns.ts_curr, fctkern_ptr__->ns.curr_test \ ); \ + } else { \ + fct_test__del(fctkern_ptr__->ns.curr_test); \ + fctkern_ptr__->ns.curr_test = NULL; \ } \ } else { \ - switch_assert("invalid condition for fct_req!"); \ + switch_assert("invalid condition for fct_req!"); \ _fct_req((_CNDTN_)); \ } diff --git a/src/include/test/switch_test.h b/src/include/test/switch_test.h index 1cf1ff94ff..4e7fcfcd8a 100644 --- a/src/include/test/switch_test.h +++ b/src/include/test/switch_test.h @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2018, Anthony Minessale II + * Copyright (C) 2005-2019, Anthony Minessale II * * Version: MPL 1.1 * @@ -113,7 +113,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char switch_core_set_globals(); if (!minimal) { - status = switch_core_init_and_modload(0, SWITCH_TRUE, &err); + status = switch_core_init_and_modload(SCF_USE_SQL, SWITCH_TRUE, &err); switch_sleep(1 * 1000000); switch_core_set_variable("sound_prefix", "." SWITCH_PATH_SEPARATOR); if (status != SWITCH_STATUS_SUCCESS && err) { @@ -308,7 +308,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char /** * Minimal FS core load */ -#define FST_MINCORE_BEGIN() \ +#define FST_MINCORE_BEGIN(confdir) \ FCT_BGN() \ { \ int fst_core = 0; \ @@ -317,7 +317,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char switch_memory_pool_t *fst_pool = NULL; \ int fst_timer_started = 0; \ fst_getenv_default("FST_SUPPRESS_UNUSED_STATIC_WARNING", NULL, SWITCH_FALSE); \ - if (fst_init_core_and_modload(".", NULL, 1) == SWITCH_STATUS_SUCCESS) { /* minimal load */ \ + if (fst_init_core_and_modload(confdir, NULL, 1) == SWITCH_STATUS_SUCCESS) { /* minimal load */ \ fst_core = 1; \ } else { \ fprintf(stderr, "Failed to load FS core\n"); \ @@ -699,7 +699,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char fst_requires(fst_core > 1); \ fst_requires_module("mod_dptools"); \ switch_channel_set_variable(fst_channel, "detect_speech_result", ""); \ - fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mr") == SWITCH_STATUS_SUCCESS); \ + fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mrf") == SWITCH_STATUS_SUCCESS); \ args = switch_core_session_sprintf(fst_session, "%s detect:%s %s", prompt_filename, recognizer, grammar); \ fst_requires(switch_core_session_execute_application(fst_session, "play_and_detect_speech", args) == SWITCH_STATUS_SUCCESS); \ fst_asr_result = switch_channel_get_variable(fst_channel, "detect_speech_result"); \ @@ -729,7 +729,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char char *args = NULL; \ fst_asr_result = NULL; \ fst_requires(fst_core > 1); \ - fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mr") == SWITCH_STATUS_SUCCESS); \ + fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mrf") == SWITCH_STATUS_SUCCESS); \ switch_status_t status = switch_ivr_play_and_detect_speech(fst_session, prompt_filename, recognizer, grammar, (char **)&fst_asr_result, 0, input_args); \ fst_check(fst_asr_result != NULL); \ } diff --git a/src/mod/applications/mod_av/avcodec.c b/src/mod/applications/mod_av/avcodec.c index 0812fabbb3..4de116fec9 100644 --- a/src/mod/applications/mod_av/avcodec.c +++ b/src/mod/applications/mod_av/avcodec.c @@ -1836,15 +1836,13 @@ static char get_media_type_char(enum AVMediaType type) } } -static const AVCodec *next_codec_for_id(enum AVCodecID id, const AVCodec *prev, +static const AVCodec *next_codec_for_id(enum AVCodecID id, const AVCodec *prev, void **index, int encoder) { #if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,10,100)) while ((prev = av_codec_next(prev))) { #else - void *i; - - while ((prev = av_codec_iterate(&i))) { + while ((prev = av_codec_iterate(index))) { #endif if (prev->id == id && (encoder ? av_codec_is_encoder(prev) : av_codec_is_decoder(prev))) @@ -1887,10 +1885,11 @@ static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs) static void print_codecs_for_id(switch_stream_handle_t *stream, enum AVCodecID id, int encoder) { const AVCodec *codec = NULL; + void *index = 0; stream->write_function(stream, " (%s: ", encoder ? "encoders" : "decoders"); - while ((codec = next_codec_for_id(id, codec, encoder))) { + while ((codec = next_codec_for_id(id, codec, &index, encoder))) { stream->write_function(stream, "%s ", codec->name); } @@ -1916,6 +1915,7 @@ void show_codecs(switch_stream_handle_t *stream) for (i = 0; i < nb_codecs; i++) { const AVCodecDescriptor *desc = codecs[i]; const AVCodec *codec = NULL; + void *index = 0; stream->write_function(stream, " "); stream->write_function(stream, avcodec_find_decoder(desc->id) ? "D" : "."); @@ -1930,14 +1930,14 @@ void show_codecs(switch_stream_handle_t *stream) /* print decoders/encoders when there's more than one or their * names are different from codec name */ - while ((codec = next_codec_for_id(desc->id, codec, 0))) { + while ((codec = next_codec_for_id(desc->id, codec, &index, 0))) { if (strcmp(codec->name, desc->name)) { print_codecs_for_id(stream ,desc->id, 0); break; } } - codec = NULL; - while ((codec = next_codec_for_id(desc->id, codec, 1))) { + codec = NULL; index = 0; + while ((codec = next_codec_for_id(desc->id, codec, &index, 1))) { if (strcmp(codec->name, desc->name)) { print_codecs_for_id(stream, desc->id, 1); break; diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 986bfed125..2e0c7de7ab 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -1029,7 +1029,7 @@ void show_formats(switch_stream_handle_t *stream) { #if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,9,100)) while ((ofmt = av_oformat_next(ofmt))) { #else - void *i; + void *i = 0; while ((ofmt = av_muxer_iterate(&i))) { #endif @@ -1047,6 +1047,7 @@ void show_formats(switch_stream_handle_t *stream) { #if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,9,100)) while ((ifmt = av_iformat_next(ifmt))) { #else + i = 0; while ((ifmt = av_demuxer_iterate(&i))) { #endif is_dev = is_device(ifmt->priv_class); diff --git a/src/mod/applications/mod_avmd/mod_avmd.c b/src/mod/applications/mod_avmd/mod_avmd.c index 8069c9bb5e..4b95e1a5c1 100644 --- a/src/mod/applications/mod_avmd/mod_avmd.c +++ b/src/mod/applications/mod_avmd/mod_avmd.c @@ -1403,6 +1403,7 @@ SWITCH_STANDARD_APP(avmd_start_app) { avmd_session_t *avmd_session = NULL; switch_core_media_flag_t flags = 0; const char *direction = "NO DIRECTION"; + uint8_t report = 0; if (session == NULL) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "BUGGG. FreeSWITCH session is NULL! Please report to developers\n"); @@ -1446,6 +1447,8 @@ SWITCH_STANDARD_APP(avmd_start_app) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to set dynamic parameteres for avmd session. Unknown error\n"); goto end; } + + report = avmd_session->settings.report_status; status = init_avmd_session_data(avmd_session, session, avmd_globals.mutex); if (status != SWITCH_STATUS_SUCCESS) { @@ -1508,7 +1511,10 @@ SWITCH_STANDARD_APP(avmd_start_app) { status = switch_core_media_bug_add(session, "avmd", NULL, avmd_callback, avmd_session, 0, flags, &bug); /* Add a media bug that allows me to intercept the audio stream */ if (status != SWITCH_STATUS_SUCCESS) { /* If adding a media bug fails exit */ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to add media bug!\n"); - goto end_unlock; + + switch_mutex_unlock(avmd_session->mutex); + avmd_session_close(avmd_session); + goto end; } switch_mutex_lock(avmd_globals.mutex); @@ -1526,7 +1532,7 @@ end_unlock: end: if (status != SWITCH_STATUS_SUCCESS) { - if (avmd_session == NULL || avmd_session->settings.report_status == 1) { + if (avmd_session == NULL || report) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Avmd on channel [%s] NOT started\n", switch_channel_get_name(channel)); } } diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index f8b75fa459..cdbb9f4361 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -4010,7 +4010,7 @@ SWITCH_STANDARD_API(cc_break_api_function) const char *uuid = NULL; switch_core_session_t *break_session = NULL; switch_channel_t *channel = NULL; - switch_bool_t status = SWITCH_STATUS_SUCCESS; + switch_status_t status = SWITCH_STATUS_SUCCESS; if (!zstr(cmd)) { mydata = strdup(cmd); @@ -4208,12 +4208,19 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load) switch_json_api_interface_t *json_api_interface; switch_status_t status; - + /* create/register custom event message type */ if (switch_event_reserve_subclass(CALLCENTER_EVENT) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", CALLCENTER_EVENT); return SWITCH_STATUS_TERM; } + /* Subscribe to presence request events */ + if (switch_event_bind_removable(modname, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_SUBCLASS_ANY, + cc_presence_event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to subscribe for presence events!\n"); + return SWITCH_STATUS_GENERR; + } + memset(&globals, 0, sizeof(globals)); globals.pool = pool; @@ -4221,15 +4228,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load) switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool); if ((status = load_config()) != SWITCH_STATUS_SUCCESS) { + switch_event_unbind(&globals.node); + switch_event_free_subclass(CALLCENTER_EVENT); + switch_core_hash_destroy(&globals.queue_hash); return status; } - if (switch_event_bind_removable(modname, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_SUBCLASS_ANY, - cc_presence_event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to subscribe for presence events!\n"); - return SWITCH_STATUS_GENERR; - } - switch_mutex_lock(globals.mutex); globals.running = 1; switch_mutex_unlock(globals.mutex); @@ -4242,7 +4246,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load) } SWITCH_ADD_APP(app_interface, "callcenter", "CallCenter", CC_DESC, callcenter_function, CC_USAGE, SAF_NONE); - SWITCH_ADD_APP(app_interface, "callcenter_track", "CallCenter Track Call", "Track external mod_callcenter calls to avoid place new calls", callcenter_track, CC_USAGE, SAF_NONE); + SWITCH_ADD_APP(app_interface, "callcenter_track", "CallCenter Track Call", "Track external mod_callcenter calls to avoid place new calls", callcenter_track, CC_USAGE, SAF_SUPPORT_NOMEDIA); SWITCH_ADD_API(api_interface, "callcenter_config", "Config of callcenter", cc_config_api_function, CC_CONFIG_API_SYNTAX); SWITCH_ADD_API(api_interface, "callcenter_break", "Stop watching an uuid and release agent", cc_break_api_function, "callcenter_break agent "); diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 46eaac71e4..37eda79929 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -685,6 +685,12 @@ end: return SWITCH_STATUS_SUCCESS; } +SWITCH_STANDARD_API(pool_stats_function) +{ + switch_core_pool_stats(stream); + return SWITCH_STATUS_SUCCESS; +} + SWITCH_STANDARD_API(db_cache_function) { int argc; @@ -7502,6 +7508,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) SWITCH_ADD_API(commands_api_interface, "nat_map", "Manage NAT", nat_map_function, "[status|republish|reinit] | [add|del] [tcp|udp] [static]"); SWITCH_ADD_API(commands_api_interface, "originate", "Originate a call", originate_function, ORIGINATE_SYNTAX); SWITCH_ADD_API(commands_api_interface, "pause", "Pause media on a channel", pause_function, PAUSE_SYNTAX); + SWITCH_ADD_API(commands_api_interface, "pool_stats", "Core pool memory usage", pool_stats_function, "Core pool memory usage."); SWITCH_ADD_API(commands_api_interface, "quote_shell_arg", "Quote/escape a string for use on shell command line", quote_shell_arg_function, ""); SWITCH_ADD_API(commands_api_interface, "regex", "Evaluate a regex", regex_function, "|[|][n|b]"); SWITCH_ADD_API(commands_api_interface, "reloadacl", "Reload XML", reload_acl_function, ""); diff --git a/src/mod/applications/mod_conference/conference_event.c b/src/mod/applications/mod_conference/conference_event.c index 9b7f748ae8..6977b8a494 100644 --- a/src/mod/applications/mod_conference/conference_event.c +++ b/src/mod/applications/mod_conference/conference_event.c @@ -651,6 +651,7 @@ void conference_event_adv_la(conference_obj_t *conference, conference_member_t * cJSON_AddItemToObject(msg, "eventChannel", cJSON_CreateString(event_channel)); cJSON_AddItemToObject(msg, "eventType", cJSON_CreateString("channelPvtData")); + cJSON_AddStringToObject(data, "callID", switch_core_session_get_uuid(member->session)); cJSON_AddItemToObject(data, "action", cJSON_CreateString(join ? "conference-liveArray-join" : "conference-liveArray-part")); cJSON_AddItemToObject(data, "laChannel", cJSON_CreateString(conference->la_event_channel)); cJSON_AddItemToObject(data, "laName", cJSON_CreateString(conference->la_name)); diff --git a/src/mod/applications/mod_conference/conference_loop.c b/src/mod/applications/mod_conference/conference_loop.c index 362a2129db..5d284fab97 100644 --- a/src/mod/applications/mod_conference/conference_loop.c +++ b/src/mod/applications/mod_conference/conference_loop.c @@ -1193,7 +1193,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob member->last_score = member->score; - if (member->id == member->conference->floor_holder) { + if ((switch_channel_test_flag(channel, CF_VIDEO) || member->avatar_png_img) && (member->id == member->conference->floor_holder)) { if (member->id != member->conference->video_floor_holder && (member->floor_packets > member->conference->video_floor_packets || member->energy_level == 0)) { conference_video_set_floor_holder(member->conference, member, SWITCH_FALSE); diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 95da2b15e9..625e2406ec 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3866,7 +3866,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_image_t *mute_img = omember->video_mute_img ? omember->video_mute_img : omember->pcanvas_img; if (mute_img) { - switch_image_t *tmp; + switch_image_t *tmp = NULL; switch_img_copy(mute_img, &tmp); switch_img_fit(&tmp, layer->screen_w, layer->screen_h, SWITCH_FIT_SIZE); diff --git a/src/mod/applications/mod_directory/mod_directory.c b/src/mod/applications/mod_directory/mod_directory.c index 1e19adb6f7..3046558c5d 100644 --- a/src/mod/applications/mod_directory/mod_directory.c +++ b/src/mod/applications/mod_directory/mod_directory.c @@ -468,10 +468,10 @@ 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_database_available(val)) { + if (switch_database_available(val) == SWITCH_STATUS_SUCCESS) { switch_set_string(globals.odbc_dsn, val); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DATABASE IS NOT AVAILABLE!\n"); } } else if (!strcasecmp(var, "dbname") && !zstr(val)) { globals.dbname = switch_core_strdup(globals.pool, val); diff --git a/src/mod/applications/mod_distributor/mod_distributor.c b/src/mod/applications/mod_distributor/mod_distributor.c index cbdcc987ed..a653514f89 100644 --- a/src/mod/applications/mod_distributor/mod_distributor.c +++ b/src/mod/applications/mod_distributor/mod_distributor.c @@ -128,6 +128,7 @@ static int load_config(int reloading) if (!(lists = switch_xml_child(cfg, "lists"))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find any lists!\n"); + switch_xml_free(xml); return status; } diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 8749eb8486..1087427b36 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -4392,10 +4392,10 @@ 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_database_available(val)) { + if (switch_database_available(val) == SWITCH_STATUS_SUCCESS) { switch_set_string(globals.odbc_dsn, val); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DATABASE IS NOT AVAILABLE!\n"); } } else if (!strcasecmp(var, "dbname") && !zstr(val)) { globals.dbname = switch_core_strdup(globals.pool, val); diff --git a/src/mod/applications/mod_hiredis/hiredis_utils.c b/src/mod/applications/mod_hiredis/hiredis_utils.c index e90ba6c1ee..ced3f589a2 100644 --- a/src/mod/applications/mod_hiredis/hiredis_utils.c +++ b/src/mod/applications/mod_hiredis/hiredis_utils.c @@ -115,10 +115,14 @@ switch_status_t mod_hiredis_do_config() goto err; } + switch_xml_free(xml); return SWITCH_STATUS_SUCCESS; err: switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Configuration failed\n"); + if (xml) { + switch_xml_free(xml); + } return SWITCH_STATUS_GENERR; } diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index fed78535e2..b0e4e4803c 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -3004,7 +3004,8 @@ static switch_status_t file_open(switch_file_handle_t *handle, const char *path, handle->seekable = context->fh.seekable; handle->speed = context->fh.speed; handle->interval = context->fh.interval; - handle->channels = context->fh.real_channels; + handle->channels = context->fh.channels; + handle->cur_channels = context->fh.real_channels; handle->flags |= SWITCH_FILE_NOMUX; if (switch_test_flag((&context->fh), SWITCH_FILE_NATIVE)) { diff --git a/src/mod/applications/mod_http_cache/mod_http_cache.c b/src/mod/applications/mod_http_cache/mod_http_cache.c index e3f8d06493..55de15fdbc 100644 --- a/src/mod/applications/mod_http_cache/mod_http_cache.c +++ b/src/mod/applications/mod_http_cache/mod_http_cache.c @@ -273,7 +273,7 @@ static void parse_domain(const char *url, char *domain_buf, int domain_buf_len) if (!*start) { return; } - strncpy(domain_buf, start, domain_buf_len); + snprintf(domain_buf, domain_buf_len, "%s", start); end = strchr(domain_buf, '/'); if (end) { *end = '\0'; @@ -985,7 +985,7 @@ static char *cached_url_filename_create(url_cache_t *cache, const char *url, cha /* filename is constructed from UUID and is stored in cache dir (first 2 characters of UUID) */ switch_uuid_get(&uuid); switch_uuid_format(uuid_str, &uuid); - strncpy(uuid_dir, uuid_str, 2); + snprintf(uuid_dir, sizeof(uuid_dir), "%.2s", uuid_str); dirname = switch_mprintf("%s%s%s", cache->location, SWITCH_PATH_SEPARATOR, uuid_dir); /* create sub-directory if it doesn't exist */ @@ -1754,6 +1754,7 @@ static switch_status_t http_cache_file_open(switch_file_handle_t *handle, const handle->speed = context->fh.speed; handle->interval = context->fh.interval; handle->channels = context->fh.channels; + handle->cur_channels = context->fh.real_channels; handle->flags |= SWITCH_FILE_NOMUX; handle->pre_buffer_datalen = 0; diff --git a/src/mod/applications/mod_signalwire/mod_signalwire.c b/src/mod/applications/mod_signalwire/mod_signalwire.c index 71dc8b7e39..46f459372c 100644 --- a/src/mod/applications/mod_signalwire/mod_signalwire.c +++ b/src/mod/applications/mod_signalwire/mod_signalwire.c @@ -459,7 +459,7 @@ SWITCH_STANDARD_API(mod_signalwire_api_function) " /____/_/\\__, /_/ /_/\\__,_/_/ |__/|__/_/_/ \\___/\n" " /____/\n" "\n /=====================================================================\\\n" - "| Connection Token: %s |\n" + " Connection Token: %s\n" " \\=====================================================================/\n" " Go to https://signalwire.com to set up your Connector now!\n", globals.adoption_token); } else { diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c index f674d14811..35d0cb585f 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp.c @@ -485,7 +485,7 @@ static void destroy_descriptor(void *ptr) { tone_descriptor_t *d = (tone_descriptor_t *) ptr; - super_tone_rx_free_descriptor(d->spandsp_tone_descriptor); + tone_descriptor_destroy(d); } switch_status_t load_configuration(switch_bool_t reload) diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.h b/src/mod/applications/mod_spandsp/mod_spandsp.h index 7ffd334ef3..0863831b3c 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.h +++ b/src/mod/applications/mod_spandsp/mod_spandsp.h @@ -133,6 +133,7 @@ typedef struct tone_descriptor tone_descriptor_t; switch_status_t tone_descriptor_create(tone_descriptor_t **descriptor, const char *name, switch_memory_pool_t *memory_pool); +void tone_descriptor_destroy(tone_descriptor_t *descriptor); int tone_descriptor_add_tone(tone_descriptor_t *descriptor, const char *name); switch_status_t tone_descriptor_add_tone_element(tone_descriptor_t *descriptor, int tone_id, int freq1, int freq2, int min, int max); diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c index 9a43271c99..fca74635e8 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c @@ -637,6 +637,20 @@ switch_status_t tone_descriptor_create(tone_descriptor_t **descriptor, const cha return SWITCH_STATUS_SUCCESS; } +/** + * Destroy the tone descriptor + * + * @param descriptor the descriptor to create + * @return void + */ +void tone_descriptor_destroy(tone_descriptor_t *descriptor) +{ + if (descriptor->spandsp_tone_descriptor) { + super_tone_rx_free_descriptor(descriptor->spandsp_tone_descriptor); + descriptor->spandsp_tone_descriptor = NULL; + } +} + /** * Add a tone to the tone descriptor * @@ -711,6 +725,48 @@ static void tone_segment_callback(void *user_data, int f1, int f2, int duration) } } +/** + * Duplicate the tone descriptor + * + * @param descriptor the descriptor to use + * @param memory_pool the pool to use + * @return pointer to a copy of descriptor + */ +static tone_descriptor_t *tone_descriptor_dup(tone_descriptor_t *descriptor, switch_memory_pool_t *pool) +{ + tone_descriptor_t *desc = NULL; + int t = 0, s = 0, tone_count = 0; + + if (descriptor && pool) { + if (tone_descriptor_create(&desc, descriptor->name, pool) != SWITCH_STATUS_SUCCESS) { + return NULL; + } + + tone_count = descriptor->idx + 1; + + for (t = 0; t < tone_count; t++) { + int tone_id = tone_descriptor_add_tone(desc, descriptor->tone_keys[t]); + if (-1 != tone_id) { + int step = descriptor->spandsp_tone_descriptor->tone_segs[tone_id]; + for (s = 0; s < step; s++) { + super_tone_rx_segment_t segment = descriptor->spandsp_tone_descriptor->tone_list[tone_id][s]; + int f1 = (segment.f1 == -1 ? 0 : descriptor->spandsp_tone_descriptor->pitches[segment.f1][0]); + int f2 = (segment.f2 == -1 ? 0 : descriptor->spandsp_tone_descriptor->pitches[segment.f2][0]); + int min = segment.min_duration / 8; + int max = (segment.max_duration == 0x7FFFFFFF ? 0 : segment.max_duration / 8); + tone_descriptor_add_tone_element(desc, tone_id, f1, f2, min, max); + } + } else { + tone_descriptor_destroy(desc); + desc = NULL; + break; + } + } + } + + return desc; +} + /** * Allocate the tone detector * @@ -723,11 +779,8 @@ static void tone_segment_callback(void *user_data, int f1, int f2, int duration) static switch_status_t tone_detector_create(switch_core_session_t *session, tone_detector_t **detector, tone_descriptor_t *descriptor) { tone_detector_t *ldetector = switch_core_session_alloc(session, sizeof(tone_detector_t)); - tone_descriptor_t *desc = switch_core_session_alloc(session, sizeof(tone_descriptor_t)); - memcpy(desc, descriptor, sizeof(tone_descriptor_t)); - - ldetector->descriptor = desc; + ldetector->descriptor = tone_descriptor_dup(descriptor, switch_core_session_get_pool(session)); ldetector->debug = spandsp_globals.tonedebug; ldetector->session = session; *detector = ldetector; @@ -777,6 +830,10 @@ static void tone_detector_destroy(tone_detector_t *detector) super_tone_rx_free(detector->spandsp_detector); detector->spandsp_detector = NULL; } + if (detector->descriptor) { + tone_descriptor_destroy(detector->descriptor); + detector->descriptor = NULL; + } } } diff --git a/src/mod/applications/mod_test/Makefile.am b/src/mod/applications/mod_test/Makefile.am index 35cf0ed45e..960df11231 100644 --- a/src/mod/applications/mod_test/Makefile.am +++ b/src/mod/applications/mod_test/Makefile.am @@ -1,10 +1,14 @@ include $(top_srcdir)/build/modmake.rulesam MODNAME=mod_test +noinst_LTLIBRARIES = libtestmod.la +libtestmod_la_SOURCES = mod_test.c + mod_LTLIBRARIES = mod_test.la -mod_test_la_SOURCES = mod_test.c mod_test_la_CFLAGS = $(AM_CFLAGS) -mod_test_la_LIBADD = $(switch_builddir)/libfreeswitch.la -mod_test_la_LDFLAGS = -avoid-version -module -no-undefined -shared +mod_test_la_SOURCES = +mod_test_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SOFIALA) libtestmod.la +mod_test_la_LDFLAGS = -avoid-version -module -no-undefined -shared SUBDIRS=. test + diff --git a/src/mod/applications/mod_test/mod_test.c b/src/mod/applications/mod_test/mod_test.c index d5460ac364..c8ce62c39f 100644 --- a/src/mod/applications/mod_test/mod_test.c +++ b/src/mod/applications/mod_test/mod_test.c @@ -257,8 +257,6 @@ static switch_status_t test_asr_get_results(switch_asr_handle_t *ah, char **resu { test_asr_t *context = (test_asr_t *) ah->private_info; switch_status_t status = SWITCH_STATUS_SUCCESS; - switch_stream_handle_t result = { 0 }; - SWITCH_STANDARD_STREAM(result); if (switch_test_flag(context, ASRFLAG_RETURNED_RESULT) || switch_test_flag(ah, SWITCH_ASR_FLAG_CLOSED)) { return SWITCH_STATUS_FALSE; diff --git a/src/mod/applications/mod_test/test/Makefile.am b/src/mod/applications/mod_test/test/Makefile.am index 54825db400..3b721482fb 100644 --- a/src/mod/applications/mod_test/test/Makefile.am +++ b/src/mod/applications/mod_test/test/Makefile.am @@ -1,5 +1,6 @@ include $(top_srcdir)/build/modmake.rulesam noinst_PROGRAMS = test_asr test_asr_CFLAGS = $(AM_CFLAGS) -I../ -test_asr_LDFLAGS = $(AM_LDFLAGS) -avoid-version -no-undefined $(freeswitch_LDFLAGS) ../mod_test.la $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) +test_asr_LDFLAGS = $(AM_LDFLAGS) -avoid-version -no-undefined $(freeswitch_LDFLAGS) $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) +test_asr_LDADD = ../libtestmod.la TESTS = $(noinst_PROGRAMS) diff --git a/src/mod/applications/mod_video_filter/mod_video_filter.c b/src/mod/applications/mod_video_filter/mod_video_filter.c index 8645fdb0d0..3cd8c84ce9 100644 --- a/src/mod/applications/mod_video_filter/mod_video_filter.c +++ b/src/mod/applications/mod_video_filter/mod_video_filter.c @@ -70,7 +70,13 @@ typedef struct chromakey_child_context_s { } chromakey_child_context_t; - +typedef struct video_replace_context_s { + switch_image_t *rp_img; + switch_file_handle_t vfh; + switch_core_session_t *session; +} video_replace_context_t; + + static void init_context(chromakey_context_t *context) { switch_color_set_rgb(&context->bgcolor, "#000000"); @@ -817,6 +823,296 @@ SWITCH_STANDARD_API(chromakey_api_function) return SWITCH_STATUS_SUCCESS; } +static switch_status_t video_replace_thread_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data, switch_abc_type_t type) +{ + video_replace_context_t *context = (video_replace_context_t *)user_data; + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_frame_t file_frame = { 0 }; + + if (!switch_channel_ready(channel)) { + return SWITCH_STATUS_FALSE; + } + + if (!frame->img) { + return SWITCH_STATUS_SUCCESS; + } + + if (switch_test_flag(&context->vfh, SWITCH_FILE_OPEN)) { + switch_status_t status = SWITCH_STATUS_FALSE; + + if (type == SWITCH_ABC_TYPE_READ_VIDEO_PING || (context->vfh.params && switch_true(switch_event_get_header(context->vfh.params, "scale")))) { + context->vfh.mm.scale_w = frame->img->d_w; + context->vfh.mm.scale_h = frame->img->d_h; + } + + status = switch_core_file_read_video(&context->vfh, &file_frame, SVR_FLUSH); + switch_core_file_command(&context->vfh, SCFC_FLUSH_AUDIO); + + if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) { + int close = 1; + + if (context->vfh.params) { + const char *loopstr = switch_event_get_header(context->vfh.params, "loop"); + if (switch_true(loopstr)) { + uint32_t pos = 0; + + if (switch_core_file_seek(&context->vfh, &pos, 0, SEEK_SET) == SWITCH_STATUS_SUCCESS) close = 0; + } + } + + if (close) { + switch_core_file_close(&context->vfh); + } + } + + if (file_frame.img) { + switch_img_free(&(context->rp_img)); + context->rp_img = file_frame.img; + } + + if (context->rp_img) { + if (context->rp_img->d_w != frame->img->d_w || context->rp_img->d_h != frame->img->d_h ) { + frame->img = NULL; + } + + switch_img_copy(context->rp_img, &frame->img); + } + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_bool_t video_replace_bug_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type) +{ + switch_core_session_t *session = switch_core_media_bug_get_session(bug); + switch_channel_t *channel = switch_core_session_get_channel(session); + video_replace_context_t *context = (video_replace_context_t *)user_data; + + switch (type) { + case SWITCH_ABC_TYPE_INIT: + { + } + break; + case SWITCH_ABC_TYPE_CLOSE: + { + switch_thread_rwlock_unlock(MODULE_INTERFACE->rwlock); + switch_img_free(&context->rp_img); + + if (switch_test_flag(&context->vfh, SWITCH_FILE_OPEN)) { + switch_core_file_close(&context->vfh); + memset(&context->vfh, 0, sizeof(context->vfh)); + } + } + break; + case SWITCH_ABC_TYPE_READ_VIDEO_PING: + case SWITCH_ABC_TYPE_WRITE_VIDEO_PING: + { + if (switch_test_flag(&context->vfh, SWITCH_FILE_OPEN)) { + switch_frame_t *frame = switch_core_media_bug_get_video_ping_frame(bug); + video_replace_thread_callback(context->session, frame, context, type); + } else { + switch_channel_set_private(channel, "_video_replace_bug_", NULL); + return SWITCH_FALSE; + } + } + break; + default: + break; + } + + return SWITCH_TRUE; +} + +SWITCH_STANDARD_APP(video_replace_start_function) +{ + switch_media_bug_t *bug; + switch_status_t status; + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_media_bug_flag_t flags = 0; + const char *function = "video_replace"; + video_replace_context_t *context; + char *lbuf; + int argc = 0; + char *argv[2] = { 0 }; + char *direction = NULL; + char *file = NULL; + + if ((bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_video_replace_bug_"))) { + if (!zstr(data) && !strcasecmp(data, "stop")) { + switch_channel_set_private(channel, "_video_replace_bug_", NULL); + switch_core_media_bug_remove(session, &bug); + } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "alreday start!\n"); + } + return; + } + + if (data && (lbuf = switch_core_session_strdup(session, data)) + && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) > 0) { + + if (argc > 1) { + direction = argv[0]; + file = argv[1]; + } else { + direction = "write"; + file = lbuf; + } + + if (!strcasecmp(direction, "read")) { + flags = SMBF_READ_VIDEO_PING; + } else if (!strcasecmp(direction, "write")) { + flags = SMBF_WRITE_VIDEO_PING; + } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "invalid replace direction!\n"); + return; + } + } else { + return; + } + + switch_channel_wait_for_flag(channel, CF_VIDEO_READY, SWITCH_TRUE, 10000, NULL); + + context = (video_replace_context_t *) switch_core_session_alloc(session, sizeof(*context)); + switch_assert(context != NULL); + memset(context, 0, sizeof(*context)); + context->session = session; + + switch_thread_rwlock_rdlock(MODULE_INTERFACE->rwlock); + + if (switch_core_file_open(&context->vfh, file, 1, 8000, + SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT | SWITCH_FILE_FLAG_VIDEO, + switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening video file\n"); + switch_thread_rwlock_unlock(MODULE_INTERFACE->rwlock); + return; + } + + if ((status = switch_core_media_bug_add(session, function, NULL, video_replace_bug_callback, context, 0, flags, &bug)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failure!\n"); + switch_thread_rwlock_unlock(MODULE_INTERFACE->rwlock); + return; + } + + switch_channel_set_private(channel, "_video_replace_bug_", bug); +} + +/* API Interface Function */ +#define VIDEO_REPLACE_API_SYNTAX " [read|write] " +SWITCH_STANDARD_API(video_replace_api_function) +{ + switch_core_session_t *rsession = NULL; + switch_channel_t *channel = NULL; + switch_media_bug_t *bug; + switch_status_t status; + video_replace_context_t *context; + char *mycmd = NULL; + int argc = 0; + char *argv[4] = { 0 }; + char *uuid = NULL; + char *action = NULL; + char *file = NULL; + char *direction = NULL; + switch_media_bug_flag_t flags = 0; + const char *function = "video_replace"; + + if (zstr(cmd)) { + goto usage; + } + + if (!(mycmd = strdup(cmd))) { + goto usage; + } + + if ((argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) < 2) { + goto usage; + } + + uuid = argv[0]; + action = argv[1]; + + if (!(rsession = switch_core_session_locate(uuid))) { + stream->write_function(stream, "-ERR Cannot locate session!\n"); + goto done; + } + + channel = switch_core_session_get_channel(rsession); + + bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_video_replace_bug_"); + + if (!strcasecmp(action, "stop")) { + if (bug) { + switch_channel_set_private(channel, "_video_replace_bug_", NULL); + switch_core_media_bug_remove(rsession, &bug); + stream->write_function(stream, "+OK Success\n"); + } else { + stream->write_function(stream, "-ERR not start\n"); + } + + goto done; + } else if (!strcasecmp(action, "start")) { + if (argc == 3) { + direction = "write"; + file = argv[2]; + } else { + direction = argv[2]; + file = argv[3]; + } + + if (zstr(direction) || zstr(file)) goto usage; + + if (!strcasecmp(direction, "read")) { + flags = SMBF_READ_VIDEO_PING; + } else if (!strcasecmp(direction, "write")) { + flags = SMBF_WRITE_VIDEO_PING; + } else { + goto usage; + } + + if (bug) { + stream->write_function(stream, "-ERR alreday start\n"); + goto done; + } + } else { + goto usage; + } + + context = (video_replace_context_t *) switch_core_session_alloc(rsession, sizeof(*context)); + switch_assert(context != NULL); + context->session = rsession; + + switch_thread_rwlock_rdlock(MODULE_INTERFACE->rwlock); + + if (switch_core_file_open(&context->vfh, file, 1, 8000, + SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT | SWITCH_FILE_FLAG_VIDEO, + switch_core_session_get_pool(rsession)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening video file\n"); + switch_thread_rwlock_unlock(MODULE_INTERFACE->rwlock); + goto done; + } + + if ((status = switch_core_media_bug_add(rsession, function, NULL, + video_replace_bug_callback, context, 0, flags, &bug)) != SWITCH_STATUS_SUCCESS) { + stream->write_function(stream, "-ERR Failure!\n"); + switch_thread_rwlock_unlock(MODULE_INTERFACE->rwlock); + goto done; + } else { + switch_channel_set_private(channel, "_video_replace_bug_", bug); + stream->write_function(stream, "+OK Success\n"); + goto done; + } + + usage: + stream->write_function(stream, "-USAGE: %s\n", VIDEO_REPLACE_API_SYNTAX); + + done: + if (rsession) { + switch_core_session_rwunlock(rsession); + } + + switch_safe_free(mycmd); + return SWITCH_STATUS_SUCCESS; +} + SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_video_filter_shutdown) { @@ -837,7 +1133,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_video_filter_load) SWITCH_ADD_API(api_interface, "chromakey", "chromakey", chromakey_api_function, CHROMAKEY_API_SYNTAX); + SWITCH_ADD_APP(app_interface, "video_replace", "video_replace", "video replace bug", + video_replace_start_function, "[read|write] | stop", SAF_NONE); + + SWITCH_ADD_API(api_interface, "uuid_video_replace", "video_replace", video_replace_api_function, VIDEO_REPLACE_API_SYNTAX); + switch_console_set_complete("add chromakey ::console::list_uuid ::[start:stop"); + switch_console_set_complete("add uuid_video_replace ::console::list_uuid start ::[read:write"); + switch_console_set_complete("add uuid_video_replace ::console::list_uuid stop"); return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index ff12ebdc3b..6ef8bf37e7 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -5979,7 +5979,6 @@ SWITCH_STANDARD_API(vm_fsdb_msg_email_function) if (switch_xml_locate_user_merged("id", id, domain, NULL, &x_user, NULL) != SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "-ERR Can't locate user.\n"); - switch_xml_free(x_user); goto done; } @@ -6106,6 +6105,10 @@ SWITCH_STANDARD_API(vm_fsdb_msg_email_function) done: switch_core_destroy_memory_pool(&pool); + if (x_user) { + switch_xml_free(x_user); + } + return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c b/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c index 1d9906d0a9..a19af3a18d 100644 --- a/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c +++ b/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c @@ -186,13 +186,17 @@ static switch_status_t tts_commandline_speech_read_tts(switch_speech_handle_t *s assert(info != NULL); if (switch_core_file_read(info->fh, data, &my_datalen) != SWITCH_STATUS_SUCCESS) { - switch_core_file_close(info->fh); + if (switch_test_flag(info->fh, SWITCH_FILE_OPEN)) { + switch_core_file_close(info->fh); + } unlink(info->file); return SWITCH_STATUS_FALSE; } *datalen = my_datalen * 2; if (datalen == 0) { - switch_core_file_close(info->fh); + if (switch_test_flag(info->fh, SWITCH_FILE_OPEN)) { + switch_core_file_close(info->fh); + } unlink(info->file); return SWITCH_STATUS_BREAK; } else { @@ -205,7 +209,7 @@ static void tts_commandline_speech_flush_tts(switch_speech_handle_t *sh) tts_commandline_t *info = (tts_commandline_t *) sh->private_info; assert(info != NULL); - if (info->fh != NULL && info->fh->file_interface != NULL) { + if (info->fh != NULL && info->fh->file_interface != NULL && switch_test_flag(info->fh, SWITCH_FILE_OPEN)) { switch_core_file_close(info->fh); } if (switch_file_exists(info->file, NULL) == SWITCH_STATUS_SUCCESS) { diff --git a/src/mod/endpoints/mod_loopback/mod_loopback.c b/src/mod/endpoints/mod_loopback/mod_loopback.c index cf52370aa8..6d77eb946b 100644 --- a/src/mod/endpoints/mod_loopback/mod_loopback.c +++ b/src/mod/endpoints/mod_loopback/mod_loopback.c @@ -1461,10 +1461,16 @@ static switch_status_t null_channel_on_consume_media(switch_core_session_t *sess static switch_status_t null_channel_send_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf) { null_private_t *tech_pvt = NULL; + switch_channel_t *channel = switch_core_session_get_channel(session); + const char *dtmf_str = switch_channel_get_variable(channel, "null_channel_dtmf_queued"); tech_pvt = switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); + if (!dtmf_str) dtmf_str = ""; + + switch_channel_set_variable_printf(channel, "null_channel_dtmf_queued", "%s%c", dtmf_str, dtmf->digit); + return SWITCH_STATUS_SUCCESS; } @@ -1545,6 +1551,29 @@ static switch_status_t null_channel_receive_message(switch_core_session_t *sessi case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC: switch_core_timer_sync(&tech_pvt->timer); break; + case SWITCH_MESSAGE_INDICATE_DEFLECT: + if (msg->string_array_arg[0]) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "string_array_arg[0]: %s\n", (char *)msg->string_array_arg[0]); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "string_arg: %s\n", (char *)msg->string_arg); + if (msg->string_arg) { + if (!strncmp(msg->string_arg, "sip:refer-200", 13)) { + switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_BLIND_TRANSFER); + switch_channel_set_variable(channel, "sip_refer_status_code", "202"); + switch_channel_set_variable(channel, "sip_refer_reply", "SIP/2.0 200 OK\r\n"); + } else if (!strncmp(msg->string_arg, "sip:refer-202", 13)) { + switch_channel_set_variable(channel, "sip_refer_status_code", "202"); + // no notify received + switch_yield(5000000); + switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_NORMAL_CLEARING); + } else if (!strncmp(msg->string_arg, "sip:refer-403", 13)) { + switch_channel_set_variable(channel, "sip_refer_status_code", "202"); + switch_channel_set_variable(channel, "sip_refer_reply", "SIP/2.0 403 Forbidden\r\n"); + switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_BLIND_TRANSFER); + } + } + } + break; default: break; } diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 848f1e6924..84da642aff 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -360,7 +360,6 @@ switch_status_t sofia_on_destroy(switch_core_session_t *session) { private_object_t *tech_pvt = (private_object_t *) switch_core_session_get_private(session); switch_channel_t *channel = switch_core_session_get_channel(session); - char *uuid; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s SOFIA DESTROY\n", switch_channel_get_name(channel)); @@ -376,13 +375,7 @@ switch_status_t sofia_on_destroy(switch_core_session_t *session) } if (!zstr(tech_pvt->call_id)) { - switch_mutex_lock(tech_pvt->profile->flag_mutex); - if ((uuid = switch_core_hash_find(tech_pvt->profile->chat_hash, tech_pvt->call_id))) { - free(uuid); - uuid = NULL; - switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->call_id); - } - switch_mutex_unlock(tech_pvt->profile->flag_mutex); + switch_core_hash_delete_locked(tech_pvt->profile->chat_hash, tech_pvt->call_id, tech_pvt->profile->flag_mutex); } @@ -461,7 +454,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session) switch_channel_get_name(channel), switch_channel_cause2str(cause)); if (tech_pvt->hash_key && !sofia_test_pflag(tech_pvt->profile, PFLAG_DESTROY)) { - switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->hash_key); + switch_core_hash_delete_locked(tech_pvt->profile->chat_hash, tech_pvt->hash_key, tech_pvt->profile->flag_mutex); } if (session && tech_pvt->profile->pres_type) { @@ -4782,6 +4775,8 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session goto error; } + profile = gateway_ptr->profile; + if (gateway_ptr->status != SOFIA_GATEWAY_UP) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Gateway \'%s\' is down!\n", gw); cause = SWITCH_CAUSE_GATEWAY_DOWN; @@ -4822,8 +4817,6 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session goto error; } - profile = gateway_ptr->profile; - if (profile && sofia_test_pflag(profile, PFLAG_STANDBY)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "System Paused\n"); cause = SWITCH_CAUSE_SYSTEM_SHUTDOWN; @@ -5187,7 +5180,8 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session goto done; error: - if (gateway_ptr) { + /* gateway pointer lock is really a readlock of the profile so we let the profile release below free that lock if we have a profile */ + if (gateway_ptr && !profile) { sofia_reg_release_gateway(gateway_ptr); } @@ -5391,6 +5385,9 @@ void general_event_handler(switch_event_t *event) if (zstr(dst->contact)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid contact uri [%s]\n", switch_str_nil(dst->contact)); + sofia_glue_free_destination(dst); + switch_safe_free(route_uri); + sofia_glue_release_profile(profile); return; } @@ -5417,10 +5414,10 @@ void general_event_handler(switch_event_t *event) switch_safe_free(route_uri); sofia_glue_free_destination(dst); - - sofia_glue_release_profile(profile); } + sofia_glue_release_profile(profile); + return; } else if (to_uri || from_uri) { if (!es) { @@ -5472,10 +5469,10 @@ void general_event_handler(switch_event_t *event) switch_safe_free(route_uri); sofia_glue_free_destination(dst); - - sofia_glue_release_profile(profile); } + sofia_glue_release_profile(profile); + return; } @@ -5654,6 +5651,7 @@ void general_event_handler(switch_event_t *event) if (!(list = sofia_reg_find_reg_url_multi(profile, user, host))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find registered user %s@%s\n", user, host); + sofia_glue_release_profile(profile); return; } @@ -5783,10 +5781,12 @@ void general_event_handler(switch_event_t *event) nua_handle_unref(nh); } - sofia_glue_release_profile(profile); - done: + if (profile) { + sofia_glue_release_profile(profile); + } + switch_safe_free(local_dup); } diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 0b0b1b82a0..6c33cf45a5 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -821,8 +821,13 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status, while ((call_info = call_info->ci_next) != NULL) { char *tmp = sip_header_as_string(nua_handle_home(nh), (void *) call_info); size_t tmp_len = strlen(tmp); - hold = realloc(hold, cur_len + tmp_len + 2); - switch_assert(hold); + char *tmp_hold = realloc(hold, cur_len + tmp_len + 2); + if (!tmp_hold) { + /* Avoid leak if realloc failed */ + free(hold); + } + switch_assert(tmp_hold); + hold = tmp_hold; strncpy(hold + cur_len, ",", 2); strncpy(hold + cur_len + 1, tmp, tmp_len +1); su_free(nua_handle_home(nh), tmp); @@ -1451,6 +1456,9 @@ static void sofia_handle_sip_r_refer(nua_t *nua, sofia_profile_t *profile, nua_h { private_object_t *tech_pvt = switch_core_session_get_private(session); switch_core_session_t *other_session; + switch_channel_t *channel = switch_core_session_get_channel(session); + + switch_channel_set_variable_printf(channel, "sip_refer_status_code", "%d", status); if (status < 200) { return; @@ -2430,7 +2438,7 @@ void sofia_event_callback(nua_event_t event, tech_pvt->nh = NULL; sofia_set_flag(tech_pvt, TFLAG_BYE); switch_mutex_lock(profile->flag_mutex); - switch_core_hash_insert(profile->chat_hash, tech_pvt->call_id, strdup(switch_core_session_get_uuid(session))); + switch_core_hash_insert_auto_free(profile->chat_hash, tech_pvt->call_id, strdup(switch_core_session_get_uuid(session))); switch_mutex_unlock(profile->flag_mutex); nua_handle_destroy(nh); } else { @@ -2519,10 +2527,11 @@ void sofia_event_callback(nua_event_t event, if (sip->sip_call_id && sip->sip_call_id->i_id) { - char *uuid; + char *uuid = NULL, *tmp; switch_mutex_lock(profile->flag_mutex); - if ((uuid = (char *) switch_core_hash_find(profile->chat_hash, sip->sip_call_id->i_id))) { + if ((tmp = (char *) switch_core_hash_find(profile->chat_hash, sip->sip_call_id->i_id))) { + uuid = strdup(tmp); switch_core_hash_delete(profile->chat_hash, sip->sip_call_id->i_id); } switch_mutex_unlock(profile->flag_mutex); @@ -5050,6 +5059,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name) } } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid ext-rtp-ip\n"); + switch_goto_status(SWITCH_STATUS_GENERR, done); } } else if (!strcasecmp(var, "rtp-ip")) { char *ip = mod_sofia_globals.guess_ip; @@ -5144,6 +5154,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name) } } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid ext-sip-ip\n"); + switch_goto_status(SWITCH_STATUS_GENERR, done); } } else if (!strcasecmp(var, "local-network-acl")) { if (val && !strcasecmp(val, "none")) { @@ -10125,6 +10136,7 @@ switch_status_t sofia_locate_user(char* user, switch_core_session_t *session, si for (un = sip->sip_unknown; un; un = un->un_next) { switch_event_add_header_string(v_event, SWITCH_STACK_BOTTOM, un->un_name, un->un_value); }; + switch_channel_event_set_data(switch_core_session_get_channel(session), v_event); } result = switch_xml_locate_user_merged("id", username, domain, NULL, x_user, v_event); @@ -10530,6 +10542,10 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia switch_channel_set_variable_printf(channel, "sip_invite_stamp", "%" SWITCH_TIME_T_FMT, sip_invite_time); if (*acl_token) { + if (x_user) { + switch_xml_free(x_user); + x_user = NULL; + } switch_channel_set_variable(channel, "acl_token", acl_token); if (sofia_locate_user(acl_token, session, sip, &x_user) == SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Authenticating user %s\n", acl_token); @@ -10537,6 +10553,9 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Error Authenticating user %s\n", acl_token); if (sofia_test_pflag(profile, PFLAG_AUTH_REQUIRE_USER)) { nua_respond(nh, SIP_480_TEMPORARILY_UNAVAILABLE, TAG_END()); + if (v_event) { + switch_event_destroy(&v_event); + } goto fail; } } @@ -11321,7 +11340,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia switch_channel_set_variable(channel, "sip_geolocation_error", un->un_value); } else if (!strcasecmp(un->un_name, "userLocation")) { switch_channel_set_variable(channel, "sip_user_location", un->un_value); - } else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2) || !strcasecmp(un->un_name, "User-to-User") || !strncasecmp(un->un_name, "On", 2)) { + } else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2) || !strcasecmp(un->un_name, "User-to-User") || !strncasecmp(un->un_name, "On", 2) || !strncasecmp(un->un_name, "K-", 2)) { if (!zstr(un->un_value)) { char new_name[512] = ""; int reps = 0; diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 2d1a60243f..72c654fe46 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -852,7 +852,7 @@ char *sofia_overcome_sip_uri_weakness(switch_core_session_t *session, const char stripped = sofia_glue_get_url_from_contact(stripped, 0); - /* remove our params so we don't make any whiny moronic device piss it's pants and forget who it is for a half-hour */ + /* remove our params so we don't make any whiny moronic device piss its pants and forget who it is for a half-hour */ if ((p = (char *) switch_stristr(";fs_", stripped))) { *p = '\0'; } @@ -1097,7 +1097,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) if (!caller_profile) { switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - return SWITCH_STATUS_FALSE; + switch_goto_status(SWITCH_STATUS_FALSE, end); } @@ -1126,7 +1126,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) if ((status = switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0)) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "Port Error!\n"); - return status; + goto end; } if (!switch_channel_get_private(tech_pvt->channel, "t38_options") || zstr(tech_pvt->mparams.local_sdp_str)) { @@ -1160,7 +1160,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) if (zstr(tech_pvt->dest)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "URL Error!\n"); - return SWITCH_STATUS_FALSE; + switch_goto_status(SWITCH_STATUS_FALSE, end); } if ((d_url = sofia_glue_get_url_from_contact(tech_pvt->dest, 1))) { @@ -1265,7 +1265,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) if (!sofia_test_pflag(tech_pvt->profile, PFLAG_TLS) && sofia_glue_transport_has_tls(tech_pvt->transport)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "TLS not supported by profile\n"); - return SWITCH_STATUS_FALSE; + switch_goto_status(SWITCH_STATUS_FALSE, end); } if (zstr(tech_pvt->invite_contact)) { @@ -1360,7 +1360,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) if (!strncasecmp(url_str, "tel:", 4)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "URL Error! tel: uri's not supported at this time\n"); - return SWITCH_STATUS_FALSE; + switch_goto_status(SWITCH_STATUS_FALSE, end); } if (!s) { s = url_str; @@ -1386,7 +1386,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) invite_contact); switch_safe_free(d_url); - return SWITCH_STATUS_FALSE; + switch_goto_status(SWITCH_STATUS_FALSE, end); } if (tech_pvt->dest && (strstr(tech_pvt->dest, ";fs_nat") || strstr(tech_pvt->dest, ";received") @@ -1705,12 +1705,19 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) SIPTAG_PAYLOAD_STR(mp ? mp : tech_pvt->mparams.local_sdp_str), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), SOATAG_HOLD(holdstr), TAG_END()); } - sofia_glue_free_destination(dst); switch_safe_free(extra_headers); switch_safe_free(mp); tech_pvt->redirected = NULL; - return SWITCH_STATUS_SUCCESS; + status = SWITCH_STATUS_SUCCESS; + +end: + + if (dst) { + sofia_glue_free_destination(dst); + } + + return status; } void sofia_glue_do_xfer_invite(switch_core_session_t *session) @@ -3336,6 +3343,7 @@ char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua switch_zmalloc(route_encoded, route_encoded_len); switch_url_encode(route, route_encoded, route_encoded_len); contact_str = switch_mprintf("%s <%s;fs_path=%s>", display, full_contact_dup, route_encoded); + free(route); free(full_contact_dup); free(route_encoded); } diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index de3d360703..be27121cd1 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -1160,6 +1160,7 @@ static switch_event_t *actual_sofia_presence_event_handler(switch_event_t *event if (!mod_sofia_globals.profile_hash) { switch_console_free_matches(&matches); + sofia_glue_release_profile(profile); goto done; } @@ -1413,6 +1414,7 @@ static switch_event_t *actual_sofia_presence_event_handler(switch_event_t *event if (zstr(call_id) && (dh.hits && presence_source && (!strcasecmp(presence_source, "register") || switch_stristr("register", status)))) { + sofia_glue_release_profile(profile); goto done; } @@ -5000,7 +5002,7 @@ void sofia_presence_handle_sip_i_message(int status, abort(); } - if (sofia_test_pflag(profile, PFLAG_IN_DIALOG_CHAT) && (tech_pvt = (private_object_t *) switch_core_hash_find(profile->chat_hash, hash_key))) { + if (sofia_test_pflag(profile, PFLAG_IN_DIALOG_CHAT) && (tech_pvt = (private_object_t *) switch_core_hash_find_locked(profile->chat_hash, hash_key, profile->flag_mutex))) { switch_core_session_queue_event(tech_pvt->session, &event); } else { switch_core_chat_send(proto, event); diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index c523af78ae..569699a1c8 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -2624,9 +2624,8 @@ void sofia_reg_handle_sip_r_challenge(int status, sip_auth_password = dup_pass; } } - - switch_xml_free(x_user); } + switch_xml_free(x_user); } switch_event_destroy(&locate_params); @@ -2929,7 +2928,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, if (switch_xml_locate_user_merged("id", zstr(username) ? "nobody" : username, domain_name, ip, &user, params) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't find user [%s@%s] from %s\n" "You must define a domain called '%s' in your directory and add a user with the id=\"%s\" attribute\n" - "and you must configure your device to use the proper domain in it's authentication credentials.\n", username, domain_name, + "and you must configure your device to use the proper domain in its authentication credentials.\n", username, domain_name, ip, domain_name, username); ret = AUTH_FORBIDDEN; @@ -2937,7 +2936,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, } else { const char *type = switch_xml_attr(user, "type"); if (type && !strcasecmp(type, "pointer")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cant register a pointer.\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't register a pointer.\n"); ret = AUTH_FORBIDDEN; goto end; } diff --git a/src/mod/endpoints/mod_sofia/test/test_sofia_funcs.c b/src/mod/endpoints/mod_sofia/test/test_sofia_funcs.c index f55649c5cf..e5b1baa932 100644 --- a/src/mod/endpoints/mod_sofia/test/test_sofia_funcs.c +++ b/src/mod/endpoints/mod_sofia/test/test_sofia_funcs.c @@ -33,7 +33,7 @@ #include #include "../mod_sofia.c" -FST_MINCORE_BEGIN() +FST_MINCORE_BEGIN("./conf") FST_SUITE_BEGIN(switch_hash) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index f7dba78ae7..efd76ac25c 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1922,7 +1922,7 @@ static void client_run(jsock_t *jsock) int rem = 0; int dur = 0, j = 0; - if (!(size = atoi(p))) { + if ((size = atoi(p)) <= 0) { continue; } diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp.h b/src/mod/event_handlers/mod_amqp/mod_amqp.h index 0282c1a34c..53ea03836c 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp.h +++ b/src/mod/event_handlers/mod_amqp/mod_amqp.h @@ -134,6 +134,12 @@ typedef struct { char *queue; char *binding_key; + /* Queue properties */ + switch_bool_t passive; + switch_bool_t durable; + switch_bool_t exclusive; + switch_bool_t auto_delete; + /* Note: The AMQP channel is not reentrant this MUTEX serializes sending events. */ mod_amqp_connection_t *conn_root; mod_amqp_connection_t *conn_active; diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c index dba6d20eb0..f467001f3d 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c @@ -121,6 +121,12 @@ switch_status_t mod_amqp_command_create(char *name, switch_xml_t cfg) goto err; } + /* Default queue properties, set to match formerly hardcoded values */ + profile->passive = SWITCH_FALSE; + profile->durable = SWITCH_FALSE; + profile->exclusive = SWITCH_FALSE; + profile->auto_delete = SWITCH_TRUE; + if ((params = switch_xml_child(cfg, "params")) != NULL) { for (param = switch_xml_child(params, "param"); param; param = param->next) { char *var = (char *) switch_xml_attr_soft(param, "name"); @@ -147,6 +153,14 @@ switch_status_t mod_amqp_command_create(char *name, switch_xml_t cfg) queue = mod_amqp_expand_header(profile->pool, event, val); } else if (!strncmp(var, "binding_key", 11)) { binding_key = mod_amqp_expand_header(profile->pool, event, val); + } else if (!strncmp(var, "queue-passive", 13)) { + profile->passive = switch_true(val); + } else if (!strncmp(var, "queue-durable", 13)) { + profile->durable = switch_true(val); + } else if (!strncmp(var, "queue-exclusive", 15)) { + profile->exclusive = switch_true(val); + } else if (!strncmp(var, "queue-auto-delete", 17)) { + profile->auto_delete = switch_true(val); } } } @@ -308,8 +322,10 @@ void * SWITCH_THREAD_FUNC mod_amqp_command_thread(switch_thread_t *thread, void recv_queue = amqp_queue_declare(profile->conn_active->state, // state 1, // channel profile->queue ? amqp_cstring_bytes(profile->queue) : amqp_empty_bytes, // queue name - 0, 0, // passive, durable - 0, 1, // exclusive, auto-delete + profile->passive, + profile->durable, + profile->exclusive, + profile->auto_delete, amqp_empty_table); // args if (mod_amqp_log_if_amqp_error(amqp_get_rpc_reply(profile->conn_active->state), "Declaring queue\n")) { diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_connection.c b/src/mod/event_handlers/mod_amqp/mod_amqp_connection.c index 2d8ef8c088..7f56c9579c 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_connection.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_connection.c @@ -220,7 +220,7 @@ switch_status_t mod_amqp_connection_create(mod_amqp_connection_t **conn, switch_ if (interval && interval > 0) { port = interval; } - } else if (!strncmp(var, "heartbeat", 4)) { + } else if (!strncmp(var, "heartbeat", 9)) { int interval = atoi(val); if (interval && interval > 0) { heartbeat = interval; diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_logging.c b/src/mod/event_handlers/mod_amqp/mod_amqp_logging.c index dd6fa599d9..01d08960fa 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_logging.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_logging.c @@ -238,34 +238,7 @@ switch_status_t mod_amqp_logging_create(char *name, switch_xml_t cfg) } } profile->conn_active = NULL; - - if ( mod_amqp_connection_open(profile->conn_root, &(profile->conn_active), profile->name, profile->custom_attr) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile[%s] was unable to connect to any connection\n", profile->name); - goto err; - } - -#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR >= 6 - amqp_exchange_declare(profile->conn_active->state, 1, - amqp_cstring_bytes(profile->exchange), - amqp_cstring_bytes(profile->exchange_type), - 0, /* passive */ - profile->exchange_durable, - profile->exchange_auto_delete, - 0, - amqp_empty_table); -#else - amqp_exchange_declare(profile->conn_active->state, 1, - amqp_cstring_bytes(profile->exchange), - amqp_cstring_bytes(profile->exchange_type), - 0, /* passive */ - profile->exchange_durable, - amqp_empty_table); -#endif - - if (mod_amqp_log_if_amqp_error(amqp_get_rpc_reply(profile->conn_active->state), "Declaring exchange")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile[%s] failed to create exchange\n", profile->name); - goto err; - } + /* We are not going to open the logging queue connection on create, but instead wait for the running thread to open it */ /* Create a bounded FIFO queue for sending messages */ if (switch_queue_create(&(profile->send_queue), profile->send_queue_size, profile->pool) != SWITCH_STATUS_SUCCESS) { diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c b/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c index d4479b1752..d7741d3f41 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c @@ -325,33 +325,7 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg) } } profile->conn_active = NULL; - - if ( mod_amqp_connection_open(profile->conn_root, &(profile->conn_active), profile->name, profile->custom_attr) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile[%s] was unable to connect to any connection\n", profile->name); - goto err; - } -#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR >= 6 - amqp_exchange_declare(profile->conn_active->state, 1, - amqp_cstring_bytes(profile->exchange), - amqp_cstring_bytes(profile->exchange_type), - 0, /* passive */ - profile->exchange_durable, - profile->exchange_auto_delete, - 0, - amqp_empty_table); -#else - amqp_exchange_declare(profile->conn_active->state, 1, - amqp_cstring_bytes(profile->exchange), - amqp_cstring_bytes(profile->exchange_type), - 0, /* passive */ - profile->exchange_durable, - amqp_empty_table); -#endif - - if (mod_amqp_log_if_amqp_error(amqp_get_rpc_reply(profile->conn_active->state), "Declaring exchange\n")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile[%s] failed to create exchange\n", profile->name); - goto err; - } + /* We are not going to open the producer queue connection on create, but instead wait for the running thread to open it */ /* Create a bounded FIFO queue for sending messages */ if (switch_queue_create(&(profile->send_queue), profile->send_queue_size, profile->pool) != SWITCH_STATUS_SUCCESS) { diff --git a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c index 7fe2911ba6..f9fa8ff02b 100644 --- a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c +++ b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c @@ -324,7 +324,7 @@ static void event_handler(switch_event_t *event) &tmplen, (unsigned char *) MAGIC, (int) strlen((char *) MAGIC)); outlen += tmplen; EVP_EncryptFinal(ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH + outlen, &tmplen); - EVP_CIPHER_CTX_cleanup(ctx); + EVP_CIPHER_CTX_free(ctx); #else EVP_CIPHER_CTX_init(&ctx); EVP_EncryptInit(&ctx, EVP_bf_cbc(), NULL, NULL); @@ -577,7 +577,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime) EVP_DecryptInit(ctx, NULL, (unsigned char *) globals.psk, (unsigned char *) uuid_str); EVP_DecryptUpdate(ctx, (unsigned char *) tmp, &outl, (unsigned char *) packet, (int) len); EVP_DecryptFinal(ctx, (unsigned char *) tmp + outl, &tmplen); - EVP_CIPHER_CTX_cleanup(ctx); + EVP_CIPHER_CTX_free(ctx); #else EVP_CIPHER_CTX_init(&ctx); EVP_DecryptInit(&ctx, EVP_bf_cbc(), NULL, NULL); diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index a9234222cf..c8d8a23501 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -375,6 +375,9 @@ static void event_handler(switch_event_t *event) if (!uuid || (l->session && strcmp(uuid, switch_core_session_get_uuid(l->session)))) { send = 0; } + if (!strcmp(switch_core_session_get_uuid(l->session), switch_event_get_header_nil(event, "Job-Owner-UUID"))) { + send = 1; + } } if (send) { @@ -1499,6 +1502,7 @@ struct api_command_struct { listener_t *listener; char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; int bg; + char bg_owner_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; int ack; int console_execute; switch_memory_pool_t *pool; @@ -1557,6 +1561,7 @@ static void *SWITCH_THREAD_FUNC api_exec(switch_thread_t *thread, void *obj) if (switch_event_create(&event, SWITCH_EVENT_BACKGROUND_JOB) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-UUID", acs->uuid_str); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Owner-UUID", acs->bg_owner_uuid_str); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Command", acs->api_cmd); if (acs->arg) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Command-Arg", acs->arg); @@ -2357,6 +2362,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even switch_uuid_get(&uuid); switch_uuid_format(acs->uuid_str, &uuid); } + switch_copy_string(acs->bg_owner_uuid_str, switch_core_session_get_uuid(listener->session), sizeof(acs->bg_owner_uuid_str)); switch_snprintf(reply, reply_len, "~Reply-Text: +OK Job-UUID: %s\nJob-UUID: %s\n\n", acs->uuid_str, acs->uuid_str); switch_thread_create(&thread, thd_attr, api_exec, acs, acs->pool); sanity = 2000; @@ -2631,11 +2637,18 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj) if ((session = listener->session)) { if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Unable to lock session!\n"); locked = 0; goto done; } } + if (!listener->sock) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Listener socket is null!\n"); + switch_clear_flag_locked(listener, LFLAG_RUNNING); + goto done; + } + switch_socket_opt_set(listener->sock, SWITCH_SO_TCP_NODELAY, TRUE); switch_socket_opt_set(listener->sock, SWITCH_SO_NONBLOCK, TRUE); @@ -2928,8 +2941,10 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime) while (!prefs.done) { rv = switch_sockaddr_info_get(&sa, prefs.ip, SWITCH_UNSPEC, prefs.port, 0, pool); - if (rv) + if (rv) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot get information about IP address %s\n", prefs.ip); goto fail; + } rv = switch_socket_create(&listen_list.sock, switch_sockaddr_get_family(sa), SOCK_STREAM, SWITCH_PROTO_TCP, pool); if (rv) goto sock_fail; diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_api.c b/src/mod/event_handlers/mod_kazoo/kazoo_api.c index b070f86336..955ff5c64e 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_api.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_api.c @@ -516,8 +516,9 @@ SWITCH_STANDARD_API(exec_api_cmd) return SWITCH_STATUS_SUCCESS; } -void add_cli_api(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface) +void add_cli_api(switch_loadable_module_interface_t **module_interface) { + switch_api_interface_t *api_interface = NULL; SWITCH_ADD_API(api_interface, "erlang", KAZOO_DESC, exec_api_cmd, KAZOO_SYNTAX); switch_console_set_complete("add erlang status"); switch_console_set_complete("add erlang event_filter"); diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_commands.c b/src/mod/event_handlers/mod_kazoo/kazoo_commands.c index f798d027b7..2e9a8f2459 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_commands.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_commands.c @@ -104,7 +104,8 @@ static void process_history_item(char* value, cJSON *json) switch_safe_free(item); } -SWITCH_STANDARD_API(kz_json_history) { +SWITCH_STANDARD_API(kz_json_history) +{ char *mycmd = NULL, *argv[MAX_HISTORY] = { 0 }; int n, argc = 0; cJSON *json = cJSON_CreateObject(); @@ -145,7 +146,8 @@ SWITCH_STANDARD_API(kz_json_history) { return SWITCH_STATUS_SUCCESS; } -SWITCH_STANDARD_API(kz_first_of) { +SWITCH_STANDARD_API(kz_first_of) +{ char delim = '|'; char *mycmd = NULL, *argv[MAX_FIRST_OF] = { 0 }; int n, argc = 0; @@ -498,7 +500,20 @@ done: return status; } -void add_kz_commands(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface) { +SWITCH_STANDARD_API(kz_expand_api) +{ + if (!zstr(cmd)) { + char * val = kz_expand(cmd); + stream->write_function(stream, "+OK %s", val); + switch_safe_free(val); + } else { + stream->write_function(stream, "ERR invalid input"); + } + return SWITCH_STATUS_SUCCESS; +} + +void add_kz_commands(switch_loadable_module_interface_t **module_interface) { + switch_api_interface_t *api_interface = NULL; SWITCH_ADD_API(api_interface, "kz_uuid_setvar_multi", UUID_SET_DESC, uuid_setvar_multi_function, UUID_MULTISET_SYNTAX); SWITCH_ADD_API(api_interface, "kz_uuid_setvar_multi_encoded", UUID_SET_DESC, uuid_setvar_multi_encoded_function, UUID_MULTISET_SYNTAX); switch_console_set_complete("add kz_uuid_setvar_multi ::console::list_uuid"); @@ -510,5 +525,6 @@ void add_kz_commands(switch_loadable_module_interface_t **module_interface, swit SWITCH_ADD_API(api_interface, "kz_http_put", KZ_HTTP_PUT_DESC, kz_http_put, KZ_HTTP_PUT_SYNTAX); SWITCH_ADD_API(api_interface, "first-of", KZ_FIRST_OF_DESC, kz_first_of, KZ_FIRST_OF_SYNTAX); SWITCH_ADD_API(api_interface, "kz_json_history", KZ_FIRST_OF_DESC, kz_json_history, KZ_FIRST_OF_SYNTAX); + SWITCH_ADD_API(api_interface, "kz_expand", KZ_FIRST_OF_DESC, kz_expand_api, KZ_FIRST_OF_SYNTAX); } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_defs.h b/src/mod/event_handlers/mod_kazoo/kazoo_defs.h new file mode 100644 index 0000000000..7fe86dd354 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_defs.h @@ -0,0 +1,9 @@ +#ifndef KAZOO_DEFS_H_ +#define KAZOO_DEFS_H_ + +#define INTERACTION_VARIABLE "Call-Interaction-ID" + +#define UNIX_EPOCH_IN_GREGORIAN 62167219200 +#define UNIX_EPOCH_IN_GREGORIAN_STR "62167219200" + +#endif /* KAZOO_DEFS_H_ */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c b/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c index 72e2afa18f..da5354f3ec 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c @@ -891,7 +891,8 @@ SWITCH_STANDARD_APP(kz_att_xfer_function) } } -void add_kz_dptools(switch_loadable_module_interface_t **module_interface, switch_application_interface_t *app_interface) { +void add_kz_dptools(switch_loadable_module_interface_t **module_interface) { + switch_application_interface_t *app_interface = NULL; SWITCH_ADD_APP(app_interface, "kz_set", SET_SHORT_DESC, SET_LONG_DESC, set_function, SET_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); SWITCH_ADD_APP(app_interface, "kz_set_encoded", SET_SHORT_DESC, SET_LONG_DESC, set_encoded_function, SET_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); SWITCH_ADD_APP(app_interface, "kz_multiset", MULTISET_SHORT_DESC, MULTISET_LONG_DESC, multiset_function, MULTISET_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei.h b/src/mod/event_handlers/mod_kazoo/kazoo_ei.h index b28a888978..1fe826b846 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_ei.h +++ b/src/mod/event_handlers/mod_kazoo/kazoo_ei.h @@ -10,6 +10,8 @@ #define VERSION "mod_kazoo v1.5.0-1 community" #define KZ_MAX_SEPARATE_STRINGS 10 +#define HOSTNAME_MAX 1024 +#define NODENAME_MAX 1024 typedef enum {KAZOO_FETCH_PROFILE, KAZOO_EVENT_PROFILE} kazoo_profile_type; @@ -139,25 +141,7 @@ struct ei_xml_agent_s { }; -typedef enum { - KZ_TWEAK_INTERACTION_ID, - KZ_TWEAK_EXPORT_VARS, - KZ_TWEAK_SWITCH_URI, - KZ_TWEAK_REPLACES_CALL_ID, - KZ_TWEAK_LOOPBACK_VARS, - KZ_TWEAK_CALLER_ID, - KZ_TWEAK_TRANSFERS, - KZ_TWEAK_BRIDGE, - KZ_TWEAK_BRIDGE_REPLACES_ALEG, - KZ_TWEAK_BRIDGE_REPLACES_CALL_ID, - KZ_TWEAK_BRIDGE_VARIABLES, - KZ_TWEAK_RESTORE_CALLER_ID_ON_BLIND_XFER, - - /* No new flags below this line */ - KZ_TWEAK_MAX -} kz_tweak_t; - -struct globals_s { +struct kz_globals_s { switch_memory_pool_t *pool; switch_atomic_t threads; switch_socket_t *acceptor; @@ -180,6 +164,7 @@ struct globals_s { int ei_compat_rel; char *ip; char *hostname; + struct hostent* hostname_ent; char *ei_cookie; char *ei_nodename; uint32_t flags; @@ -209,8 +194,8 @@ struct globals_s { }; -typedef struct globals_s globals_t; -extern globals_t kazoo_globals; +typedef struct kz_globals_s kz_globals_t; +extern kz_globals_t kazoo_globals; /* kazoo_event_stream.c */ ei_event_stream_t *find_event_stream(ei_event_stream_t *event_streams, const erlang_pid *from); @@ -253,7 +238,7 @@ void fetch_config(); switch_status_t kazoo_load_config(); void kazoo_destroy_config(); - +void kz_set_hostname(); #define _ei_x_encode_string(buf, string) { ei_x_encode_binary(buf, string, strlen(string)); } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c b/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c index 0d2b95a8c2..83828a25a2 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c @@ -95,6 +95,19 @@ static int read_cookie_from_file(char *filename) { } } +void kz_set_hostname() +{ + if (kazoo_globals.hostname == NULL) { + char hostname[NODENAME_MAX]; + memcpy(hostname, switch_core_get_hostname(), NODENAME_MAX); + kazoo_globals.hostname_ent = gethostbyname(hostname); + if(kazoo_globals.hostname_ent != NULL) { + kazoo_globals.hostname = switch_core_strdup(kazoo_globals.pool, kazoo_globals.hostname_ent->h_name); + } else { + kazoo_globals.hostname = switch_core_strdup(kazoo_globals.pool, hostname); + } + } +} switch_status_t kazoo_ei_config(switch_xml_t cfg) { switch_xml_t child, param; @@ -211,11 +224,18 @@ switch_status_t kazoo_ei_config(switch_xml_t cfg) { } if ((child = switch_xml_child(cfg, "tweaks"))) { + char *default_tweaks = (char *) switch_xml_attr_soft(param, "default"); + if (default_tweaks) { + int i, v = switch_true(default_tweaks) ? 1 : 0; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set tweak default : %s\n", default_tweaks); + for (i = 0; i < KZ_TWEAK_MAX; i++) kazoo_globals.tweaks[i] = v; + } for (param = switch_xml_child(child, "tweak"); param; param = param->next) { kz_tweak_t tweak = KZ_TWEAK_MAX; char *var = (char *) switch_xml_attr_soft(param, "name"); char *val = (char *) switch_xml_attr_soft(param, "value"); if(var && val && kz_name_tweak(var, &tweak) == SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set tweak %s : %s\n", var, val); if(switch_true(val)) { kz_set_tweak(tweak); } else { @@ -230,6 +250,7 @@ switch_status_t kazoo_ei_config(switch_xml_t cfg) { char *var = (char *) switch_xml_attr_soft(param, "name"); char *val = (char *) switch_xml_attr_soft(param, "value"); if(var && val) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set core variable %s : %s\n", var, val); switch_core_set_variable(var, val); } } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c b/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c index c1b792f490..7f751db4f9 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c @@ -332,8 +332,6 @@ switch_socket_t *create_socket_with_port(switch_memory_pool_t *pool, switch_port return NULL; } - switch_getnameinfo(&kazoo_globals.hostname, sa, 0); - if (kazoo_globals.nat_map && switch_nat_get_type()) { switch_nat_add_mapping(port, SWITCH_NAT_TCP, NULL, SWITCH_FALSE); } @@ -347,10 +345,9 @@ switch_socket_t *create_socket(switch_memory_pool_t *pool) { } switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei_cnode_s *ei_cnode) { - char hostname[EI_MAXHOSTNAMELEN + 1] = ""; + char hostname[EI_MAXHOSTNAMELEN + 1]; char nodename[MAXNODELEN + 1]; char cnodename[EI_MAXALIVELEN + 1]; - //EI_MAX_COOKIE_SIZE+1 char *atsign; /* copy the erlang interface nodename into something we can modify */ @@ -358,17 +355,13 @@ switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei if ((atsign = strchr(cnodename, '@'))) { /* we got a qualified node name, don't guess the host/domain */ - snprintf(nodename, MAXNODELEN + 1, "%s", kazoo_globals.ei_nodename); + snprintf(nodename, MAXNODELEN + 1, "%s", name); /* truncate the alivename at the @ */ - *atsign = '\0'; + *atsign++ = '\0'; + strncpy(hostname, atsign, EI_MAXHOSTNAMELEN); } else { - if (zstr(kazoo_globals.hostname) || !strncasecmp(kazoo_globals.ip, "0.0.0.0", 7) || !strncasecmp(kazoo_globals.ip, "::", 2)) { - memcpy(hostname, switch_core_get_hostname(), EI_MAXHOSTNAMELEN); - } else { - memcpy(hostname, kazoo_globals.hostname, EI_MAXHOSTNAMELEN); - } - - snprintf(nodename, MAXNODELEN + 1, "%s@%s", kazoo_globals.ei_nodename, hostname); + strncpy(hostname, kazoo_globals.hostname, EI_MAXHOSTNAMELEN); + snprintf(nodename, MAXNODELEN + 1, "%s@%s", name, hostname); } if (kazoo_globals.ei_shortname) { @@ -378,6 +371,8 @@ switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei } } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "creating nodename: %s\n", nodename); + /* init the ec stuff */ if (ei_connect_xinit(ei_cnode, hostname, cnodename, nodename, (Erl_IpAddr) ip_addr, kazoo_globals.ei_cookie, 0) < 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to initialize the erlang interface connection structure\n"); @@ -866,7 +861,8 @@ static void fetch_config_filters(switch_memory_pool_t *pool) if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); - } else if ((child = switch_xml_child(cfg, "event-filter"))) { + } else { + if ((child = switch_xml_child(cfg, "event-filter"))) { switch_hash_t *filter; switch_hash_t *old_filter; @@ -881,9 +877,10 @@ static void fetch_config_filters(switch_memory_pool_t *pool) if (old_filter) { switch_core_hash_destroy(&old_filter); } + } - kazoo_globals.config_fetched = 1; - switch_xml_free(xml); + kazoo_globals.config_fetched = 1; + switch_xml_free(xml); } } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_endpoints.c b/src/mod/event_handlers/mod_kazoo/kazoo_endpoints.c index fba1adddb1..bec5b5e1ea 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_endpoints.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_endpoints.c @@ -32,34 +32,75 @@ */ #include "mod_kazoo.h" +#define INTERACTION_VARIABLE "Call-Interaction-ID" + +static const char *x_bridge_variables[] = { + "Call-Control-Queue", + "Call-Control-PID", + "Call-Control-Node", + INTERACTION_VARIABLE, + "ecallmgr_Ecallmgr-Node", + "sip_h_k-cid", + "Switch-URI", + "Switch-URL", + NULL +}; + +static void kz_tweaks_variables_to_event(switch_core_session_t *session, switch_event_t *event) +{ + int i; + switch_channel_t *channel = switch_core_session_get_channel(session); + for(i = 0; x_bridge_variables[i] != NULL; i++) { + const char *val = switch_channel_get_variable_dup(channel, x_bridge_variables[i], SWITCH_FALSE, -1); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, x_bridge_variables[i], val); + } +} + /* kazoo endpoint */ switch_endpoint_interface_t *kz_endpoint_interface; static switch_call_cause_t kz_endpoint_outgoing_channel(switch_core_session_t *session, - switch_event_t *var_event, - switch_caller_profile_t *outbound_profile, - switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, - switch_call_cause_t *cancel_cause); + switch_event_t *var_event, + switch_caller_profile_t *outbound_profile, + switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, + switch_call_cause_t *cancel_cause); switch_io_routines_t kz_endpoint_io_routines = { /*.outgoing_channel */ kz_endpoint_outgoing_channel }; static switch_call_cause_t kz_endpoint_outgoing_channel(switch_core_session_t *session, - switch_event_t *var_event, - switch_caller_profile_t *outbound_profile, - switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, - switch_call_cause_t *cancel_cause) + switch_event_t *var_event, + switch_caller_profile_t *outbound_profile, + switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, + switch_call_cause_t *cancel_cause) { - switch_xml_t x_user = NULL, x_param, x_params; + switch_xml_t x_user = NULL, x_param, x_params, x_callfwd; char *user = NULL, *domain = NULL, *dup_domain = NULL, *dialed_user = NULL; - const char *dest = NULL; + char *dest = NULL; switch_call_cause_t cause = SWITCH_CAUSE_NONE; unsigned int timelimit = SWITCH_DEFAULT_TIMEOUT; switch_channel_t *new_channel = NULL; switch_event_t *params = NULL, *var_event_orig = var_event; char stupid[128] = ""; const char *skip = NULL, *var = NULL; + switch_core_session_t *a_session = NULL, *e_session = NULL; + cJSON * ctx = NULL; + const char *endpoint_dial = NULL; + const char *callforward_dial = NULL; + const char *failover_dial = NULL; + char *b_failover_dial = NULL; + const char *endpoint_separator = NULL; + const char *varval = NULL; + char *d_dest = NULL; + switch_channel_t *channel = NULL; + switch_originate_flag_t myflags = SOF_NONE; + char *cid_name_override = NULL; + char *cid_num_override = NULL; + switch_event_t *event = NULL; + switch_status_t status = SWITCH_STATUS_SUCCESS; + if (zstr(outbound_profile->destination_number)) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "NO DESTINATION NUMBER\n"); goto done; } @@ -84,6 +125,9 @@ static switch_call_cause_t kz_endpoint_outgoing_channel(switch_core_session_t *s switch_assert(params); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "as_channel", "true"); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "action", "user_call"); + if (session) { + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(session)); + } if (var_event) { switch_event_merge(params, var_event); @@ -102,162 +146,308 @@ static switch_call_cause_t kz_endpoint_outgoing_channel(switch_core_session_t *s goto done; } + if (var_event) { + const char * str_ctx = switch_event_get_header(var_event, "kz-endpoint-runtime-context"); + if ( str_ctx ) { + ctx = cJSON_Parse(str_ctx); + if (ctx) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "call context parsed => %s\n", str_ctx); + } + } + } + + if ((x_params = switch_xml_child(x_user, "variables"))) { + for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) { + const char *pvar = switch_xml_attr_soft(x_param, "name"); + const char *val = switch_xml_attr(x_param, "value"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "adding variable to var_event => %s = %s\n", pvar, val); + if (!var_event) { + switch_event_create(&var_event, SWITCH_EVENT_GENERAL); + } else { + switch_event_del_header(var_event, pvar); + } + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar, val); + } + } + if ((x_params = switch_xml_child(x_user, "params"))) { for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) { const char *pvar = switch_xml_attr_soft(x_param, "name"); const char *val = switch_xml_attr(x_param, "value"); - if (!strcasecmp(pvar, "dial-string")) { - dest = val; + if (!strcasecmp(pvar, "endpoint-dial-string")) { + endpoint_dial = val; + } else if (!strcasecmp(pvar, "callforward-dial-string")) { + callforward_dial = val; + } else if (!strcasecmp(pvar, "endpoint-separator")) { + endpoint_separator = val; } else if (!strncasecmp(pvar, "dial-var-", 9)) { if (!var_event) { switch_event_create(&var_event, SWITCH_EVENT_GENERAL); } else { switch_event_del_header(var_event, pvar + 9); } - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG1, "adding variable to var_event => %s = %s\n", pvar + 9, val); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "adding dialog var to var_event => %s = %s\n", pvar + 9, val); switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val); } } } + x_callfwd = switch_xml_child(x_user, "call-forward"); + if (x_callfwd) { + switch_bool_t call_fwd_is_substitute = SWITCH_FALSE, + call_fwd_is_failover = SWITCH_FALSE, + call_fwd_direct_calls_only = SWITCH_FALSE, + call_fwd_is_valid = SWITCH_TRUE; + for (x_param = switch_xml_child(x_callfwd, "variable"); x_param; x_param = x_param->next) { + const char *var = switch_xml_attr_soft(x_param, "name"); + const char *val = switch_xml_attr(x_param, "value"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "cfw %s => %s\n", var, val); + if (!strcasecmp(var, "Is-Substitute")) { + call_fwd_is_substitute = switch_true(val); + } else if (!strcasecmp(var, "Is-Failover")) { + call_fwd_is_failover = switch_true(val); + } else if (!strcasecmp(var, "Direct-Calls-Only")) { + call_fwd_direct_calls_only = switch_true(val); + } + } + + if (call_fwd_direct_calls_only) { + call_fwd_is_valid = SWITCH_FALSE; + if (ctx ) { + cJSON *json_flags = cJSON_GetObjectItem(ctx, "Flags"); + if (json_flags && json_flags->type == cJSON_Array) { + cJSON *item; + cJSON_ArrayForEach(item, json_flags) { + if (!strcmp(item->valuestring, "direct_call")) { + call_fwd_is_valid = SWITCH_TRUE; + break; + } + } + if (!call_fwd_is_valid) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "call fwd requires direct_call and it was not found\n"); + } + } + } + } + + if (!call_fwd_is_valid) { + dest = strdup(endpoint_dial); + } else if (call_fwd_is_failover) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "setting failover => %s\n", callforward_dial); + dest = strdup(endpoint_dial); + failover_dial = callforward_dial; + } else if (call_fwd_is_substitute) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "setting call fwd substitute => %s\n", callforward_dial); + dest = strdup(callforward_dial); + } else { + dest = switch_mprintf("%s%s%s", endpoint_dial ? endpoint_dial : "", (endpoint_dial ? endpoint_separator ? endpoint_separator : "," : ""), callforward_dial); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "setting call fwd append => %s => %s\n", callforward_dial, dest); + } + } else { + dest = strdup(endpoint_dial); + } + dialed_user = (char *)switch_xml_attr(x_user, "id"); if (var_event) { switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "dialed_user", dialed_user); switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "dialed_domain", domain); - if (!zstr(dest) && !strstr(dest, "presence_id=")) { - switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, "presence_id", "%s@%s", dialed_user, domain); - } } if (!dest) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No dial-string available, please check your user directory.\n"); cause = SWITCH_CAUSE_MANDATORY_IE_MISSING; - } else { - const char *varval; - char *d_dest = NULL; - switch_channel_t *channel; - switch_originate_flag_t myflags = SOF_NONE; - char *cid_name_override = NULL; - char *cid_num_override = NULL; + goto done; + } - if (var_event) { - cid_name_override = switch_event_get_header(var_event, "origination_caller_id_name"); - cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number"); - } + if (var_event) { + cid_name_override = switch_event_get_header(var_event, "origination_caller_id_name"); + cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number"); + } - if (session) { - switch_event_t *event = NULL; - switch_event_create(&event, SWITCH_EVENT_GENERAL); - channel = switch_core_session_get_channel(session); - if ((varval = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE)) - || (var_event && (varval = switch_event_get_header(var_event, "leg_timeout")))) { - timelimit = atoi(varval); - } - switch_channel_event_set_data(channel, event); - if(var_event) { - switch_event_merge(event, var_event); - } - - switch_channel_set_variable(channel, "dialed_user", dialed_user); - switch_channel_set_variable(channel, "dialed_domain", domain); - - d_dest = switch_event_expand_headers(event, dest); - - switch_event_destroy(&event); - - } else { - switch_event_t *event = NULL; - - if (var_event) { - switch_event_dup(&event, var_event); - switch_event_del_header(event, "dialed_user"); - switch_event_del_header(event, "dialed_domain"); - if ((varval = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) || - (varval = switch_event_get_header(var_event, "leg_timeout"))) { - timelimit = atoi(varval); - } - } else { - switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS); - switch_assert(event); - } - - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_user", dialed_user); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_domain", domain); - d_dest = switch_event_expand_headers(event, dest); - switch_event_destroy(&event); - } - - if ((flags & SOF_NO_LIMITS)) { - myflags |= SOF_NO_LIMITS; - } - - if ((flags & SOF_FORKED_DIAL)) { - myflags |= SOF_NOBLOCK; - } - - switch_snprintf(stupid, sizeof(stupid), "kz/%s", dialed_user); - if (switch_stristr(stupid, d_dest)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Waddya Daft? You almost called '%s' in an infinate loop!\n", - stupid); - cause = SWITCH_CAUSE_INVALID_IE_CONTENTS; - } else if (switch_ivr_originate(session, new_session, &cause, d_dest, timelimit, NULL, - cid_name_override, cid_num_override, outbound_profile, var_event, myflags, - cancel_cause, NULL) == SWITCH_STATUS_SUCCESS) { - const char *context; - switch_caller_profile_t *cp; - - if (var_event) { - switch_event_del_header(var_event, "origination_uuid"); - } - - new_channel = switch_core_session_get_channel(*new_session); - - if ((context = switch_channel_get_variable(new_channel, "user_context"))) { - if ((cp = switch_channel_get_caller_profile(new_channel))) { - cp->context = switch_core_strdup(cp->pool, context); - } - } - - if ((x_params = switch_xml_child(x_user, "variables"))) { - for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) { - const char *pvar = switch_xml_attr(x_param, "name"); - const char *val = switch_xml_attr(x_param, "value"); - switch_channel_set_variable(new_channel, pvar, val); - } - } - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(*new_session), SWITCH_LOG_DEBUG1, "CHECKING CALLER-ID\n"); - if ((x_params = switch_xml_child(x_user, "profile-variables"))) { - switch_caller_profile_t *cp = NULL; - const char* val = NULL; - for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) { - const char *pvar = switch_xml_attr(x_param, "name"); - const char *val = switch_xml_attr(x_param, "value"); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(*new_session), SWITCH_LOG_DEBUG1, "setting profile var %s = %s\n", pvar, val); - switch_channel_set_profile_var(new_channel, pvar, val); - } - cp = switch_channel_get_caller_profile(new_channel); - if((val=switch_caller_get_field_by_name(cp, "Endpoint-Caller-ID-Name"))) { - cp->callee_id_name = val; - cp->orig_caller_id_name = val; - } - if((val=switch_caller_get_field_by_name(cp, "Endpoint-Caller-ID-Number"))) { - cp->callee_id_number = val; - cp->orig_caller_id_number = val; - } - } - switch_core_session_rwunlock(*new_session); - } - - if (d_dest != dest) { - switch_safe_free(d_dest); + if(session) { + a_session = session; + } else if(var_event) { + const char* uuid_e_session = switch_event_get_header(var_event, "ent_originate_aleg_uuid"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHECKING ORIGINATE-UUID : %s\n", uuid_e_session); + if (uuid_e_session && (e_session = switch_core_session_force_locate(uuid_e_session)) != NULL) { + a_session = e_session; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "FOUND ORIGINATE-UUID : %s\n", uuid_e_session); } } + if (a_session) { + switch_event_create(&event, SWITCH_EVENT_GENERAL); + channel = switch_core_session_get_channel(a_session); + if ((varval = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE)) + || (var_event && (varval = switch_event_get_header(var_event, "leg_timeout")))) { + timelimit = atoi(varval); + } + switch_channel_event_set_data(channel, event); + + switch_channel_set_variable(channel, "dialed_user", dialed_user); + switch_channel_set_variable(channel, "dialed_domain", domain); + + } else { + if (var_event) { + switch_event_dup(&event, var_event); + switch_event_del_header(event, "dialed_user"); + switch_event_del_header(event, "dialed_domain"); + if ((varval = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) || + (varval = switch_event_get_header(var_event, "leg_timeout"))) { + timelimit = atoi(varval); + } + } else { + switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS); + switch_assert(event); + } + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_user", dialed_user); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_domain", domain); + } + + if ((x_params = switch_xml_child(x_user, "profile-variables"))) { + for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) { + const char *pvar = switch_xml_attr_soft(x_param, "name"); + const char *val = switch_xml_attr(x_param, "value"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "adding profile variable to event => %s = %s\n", pvar, val); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, pvar, val); + } + } + + if ((x_params = switch_xml_child(x_user, "variables"))) { + for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) { + const char *pvar = switch_xml_attr_soft(x_param, "name"); + const char *val = switch_xml_attr(x_param, "value"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "adding variable to event => %s = %s\n", pvar, val); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, pvar, val); + } + } + + if ((x_params = switch_xml_child(x_user, "params"))) { + for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) { + const char *pvar = switch_xml_attr_soft(x_param, "name"); + const char *val = switch_xml_attr(x_param, "value"); + + if (!strncasecmp(pvar, "dial-var-", 9)) { + switch_event_del_header(event, pvar + 9); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "adding dialog var to event => %s = %s\n", pvar + 9, val); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, pvar + 9, val); + } + } + } + + // add runtime vars to event for expand + if (ctx) { + kz_expand_json_to_event(ctx, event, "kz_ctx"); + } + + d_dest = kz_event_expand_headers(event, dest); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "dialing %s => %s\n", dest, d_dest); + + if(failover_dial) { + b_failover_dial = kz_event_expand_headers(event, failover_dial); + } + + if (var_event) { + kz_expand_headers(event, var_event); + } + + switch_event_destroy(&event); + + + if ((flags & SOF_NO_LIMITS)) { + myflags |= SOF_NO_LIMITS; + } + + if ((flags & SOF_FORKED_DIAL)) { + myflags |= SOF_NOBLOCK; + } + + if ( a_session ) { + if(var_event) { + kz_tweaks_variables_to_event(a_session, var_event); + } + } + + if(e_session) { + switch_core_session_rwunlock(e_session); + } + + switch_snprintf(stupid, sizeof(stupid), "kz/%s", dialed_user); + if (switch_stristr(stupid, d_dest)) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Waddya Daft? You almost called '%s' in an infinate loop!\n", stupid); + cause = SWITCH_CAUSE_INVALID_IE_CONTENTS; + goto done; + } + + status = switch_ivr_originate(session, new_session, &cause, d_dest, timelimit, NULL, + cid_name_override, cid_num_override, outbound_profile, var_event, myflags, + cancel_cause, NULL); + + if (status != SWITCH_STATUS_SUCCESS && b_failover_dial) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "trying failover => %s\n", failover_dial); + status = switch_ivr_originate(session, new_session, &cause, b_failover_dial, timelimit, NULL, + cid_name_override, cid_num_override, outbound_profile, var_event, myflags, + cancel_cause, NULL); + } + + if (status == SWITCH_STATUS_SUCCESS) { + const char *context; + switch_caller_profile_t *cp; + + if (var_event) { + switch_event_del_header(var_event, "origination_uuid"); + } + + new_channel = switch_core_session_get_channel(*new_session); + + if ((context = switch_channel_get_variable(new_channel, "user_context"))) { + if ((cp = switch_channel_get_caller_profile(new_channel))) { + cp->context = switch_core_strdup(cp->pool, context); + } + } + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(*new_session), SWITCH_LOG_DEBUG1, "CHECKING CALLER-ID\n"); + if ((x_params = switch_xml_child(x_user, "profile-variables"))) { + switch_caller_profile_t *cp = NULL; + const char* val = NULL; + for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) { + const char *pvar = switch_xml_attr(x_param, "name"); + const char *val = switch_xml_attr(x_param, "value"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(*new_session), SWITCH_LOG_DEBUG1, "setting profile var %s = %s\n", pvar, val); + switch_channel_set_profile_var(new_channel, pvar, val); + } + cp = switch_channel_get_caller_profile(new_channel); + if((val=switch_caller_get_field_by_name(cp, "Endpoint-Caller-ID-Name"))) { + cp->callee_id_name = val; + cp->orig_caller_id_name = val; + } + if((val=switch_caller_get_field_by_name(cp, "Endpoint-Caller-ID-Number"))) { + cp->callee_id_number = val; + cp->orig_caller_id_number = val; + } + } + switch_core_session_rwunlock(*new_session); + } + done: + if (d_dest && d_dest != dest) { + switch_safe_free(d_dest); + } + + if(b_failover_dial && b_failover_dial != failover_dial) { + switch_safe_free(b_failover_dial); + } + + switch_safe_free(dest); + + if (ctx) { + cJSON_Delete(ctx); + } + if (x_user) { switch_xml_free(x_user); } @@ -272,7 +462,6 @@ static switch_call_cause_t kz_endpoint_outgoing_channel(switch_core_session_t *s switch_safe_free(user); switch_safe_free(dup_domain); - return cause; } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_message.c b/src/mod/event_handlers/mod_kazoo/kazoo_message.c index 74ddff6647..a35dfab080 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_message.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_message.c @@ -232,7 +232,9 @@ cJSON * kazoo_event_add_field_to_json(cJSON *dst, switch_event_t *src, kazoo_fie expanded = kz_event_expand_headers(src, field->value); if(expanded != NULL && !zstr(expanded)) { item = kazoo_event_add_json_value(dst, field, field->as ? field->as : field->name, expanded); - free(expanded); + if(expanded != field->value) { + free(expanded); + } } break; @@ -325,6 +327,21 @@ static switch_status_t kazoo_event_add_fields_to_json(kazoo_logging_ptr logging, return SWITCH_STATUS_SUCCESS; } +#define EVENT_TIMESTAMP_FIELD "Event-Date-Timestamp" +#define JSON_TIMESTAMP_FIELD "Event-Timestamp" + +static switch_status_t kazoo_event_add_timestamp(switch_event_t* evt, cJSON* JObj) +{ + switch_event_header_t *header; + cJSON *item = NULL; + if((header = switch_event_get_header_ptr(evt, EVENT_TIMESTAMP_FIELD)) != NULL) { + if ((item = kazoo_event_json_value(JSON_NUMBER, header->value)) != NULL) { + kazoo_cJSON_AddItemToObject(JObj, JSON_TIMESTAMP_FIELD, item); + return SWITCH_STATUS_SUCCESS; + } + } + return SWITCH_STATUS_NOTFOUND; +} kazoo_message_ptr kazoo_message_create_event(switch_event_t* evt, kazoo_event_ptr event, kazoo_event_profile_ptr profile) { @@ -366,6 +383,8 @@ kazoo_message_ptr kazoo_message_create_event(switch_event_t* evt, kazoo_event_pt kazoo_event_init_json(profile->fields, event ? event->fields : NULL, evt, &JObj); + kazoo_event_add_timestamp(evt, JObj); + if(profile->fields) kazoo_event_add_fields_to_json(&logging, JObj, evt, profile->fields->head); @@ -402,6 +421,8 @@ kazoo_message_ptr kazoo_message_create_fetch(switch_event_t* evt, kazoo_fetch_pr kazoo_event_init_json(profile->fields, NULL, evt, &JObj); + kazoo_event_add_timestamp(evt, JObj); + if(profile->fields) kazoo_event_add_fields_to_json(&logging, JObj, evt, profile->fields->head); diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c b/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c index 67f4d37a99..2afcdf1a6a 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c @@ -30,9 +30,6 @@ */ #include "mod_kazoo.h" -#define INTERACTION_VARIABLE "Call-Interaction-ID" -#define BRIDGE_INTERCEPT_VARIABLE "Bridge-Intercepted" - static char *TWEAK_NAMES[] = { "interaction-id", "export-vars", @@ -69,7 +66,6 @@ static switch_status_t kz_tweaks_signal_bridge_on_hangup(switch_core_session_t * switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "tweak signal bridge on hangup: %s , %s\n", switch_core_session_get_uuid(session), peer_uuid); - if (switch_event_create(&my_event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", peer_uuid); @@ -106,7 +102,6 @@ static void kz_tweaks_handle_bridge_variables(switch_event_t *event) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "tweak bridge event handler: variables : %s , %s\n", a_leg, b_leg); - if (a_leg && (a_session = switch_core_session_force_locate(a_leg)) != NULL) { switch_channel_t *a_channel = switch_core_session_get_channel(a_session); if(switch_channel_get_variable_dup(a_channel, bridge_variables[0], SWITCH_FALSE, -1) == NULL) { @@ -137,56 +132,91 @@ static void kz_tweaks_handle_bridge_variables(switch_event_t *event) } -static void kz_tweaks_handle_bridge_intercepted(switch_event_t *event) +static void kz_tweaks_handle_bridge_replaces_aleg(switch_event_t *event) { switch_event_t *my_event; - switch_core_session_t *a_session = NULL; - switch_core_session_t *b_session = NULL; - const char *uuid = switch_event_get_header(event, "Unique-ID"); - const char *a_leg = switch_event_get_header(event, "Bridge-A-Unique-ID"); - const char *b_leg = switch_event_get_header(event, "Bridge-B-Unique-ID"); - const char *bridge_intercepted = NULL; + const char *replaced_call_id = switch_event_get_header(event, "variable_sip_replaces_call_id"); + const char *a_leg_call_id = switch_event_get_header(event, "variable_sip_replaces_a-leg"); + const char *peer_uuid = switch_event_get_header(event, "Unique-ID"); + int processed = 0; if (!kz_test_tweak(KZ_TWEAK_BRIDGE_REPLACES_ALEG)) return; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "tweak bridge event handler: intercepted : %s , %s, %s\n", uuid, a_leg, b_leg); + if(a_leg_call_id && replaced_call_id) { + const char *call_id = switch_event_get_header(event, "Bridge-B-Unique-ID"); + switch_core_session_t *session = NULL; + if ((session = switch_core_session_locate(peer_uuid)) != NULL) { + switch_channel_t *channel = switch_core_session_get_channel(session); + processed = switch_true(switch_channel_get_variable_dup(channel, "Bridge-Event-Processed", SWITCH_FALSE, -1)); + switch_channel_set_variable(channel, "Bridge-Event-Processed", "true"); + switch_core_session_rwunlock(session); + } - if ((a_session = switch_core_session_locate(a_leg)) != NULL) { - switch_channel_t *a_channel = switch_core_session_get_channel(a_session); - bridge_intercepted = switch_channel_get_variable_dup(a_channel, BRIDGE_INTERCEPT_VARIABLE, SWITCH_TRUE, -1); - switch_channel_set_variable(a_channel, BRIDGE_INTERCEPT_VARIABLE, NULL); - if (bridge_intercepted && switch_true(bridge_intercepted)) { - switch_channel_set_variable(a_channel, "Bridge-B-Unique-ID", b_leg); - switch_channel_add_state_handler(a_channel, &kz_tweaks_signal_bridge_state_handlers); - - if ((b_session = switch_core_session_locate(b_leg)) != NULL) { - switch_channel_t *b_channel = switch_core_session_get_channel(b_session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "creating channel_bridge event A - %s , B - %s\n", switch_core_session_get_uuid(b_session), uuid); - if (switch_event_create(&my_event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(b_session)); - switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", uuid); - switch_channel_event_set_data(b_channel, my_event); - switch_event_fire(&my_event); + if(processed) { + if(call_id) { + if((session = switch_core_session_locate(call_id)) != NULL) { + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_channel_set_variable(channel, "Bridge-Event-Processed", "true"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "creating channel_bridge event A - %s , B - %s\n", switch_core_session_get_uuid(session), peer_uuid); + if (switch_event_create(&my_event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); + switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", peer_uuid); + switch_channel_event_set_data(channel, my_event); + switch_event_fire(&my_event); + } + switch_channel_set_variable(channel, "Bridge-B-Unique-ID", peer_uuid); + switch_channel_add_state_handler(channel, &kz_tweaks_signal_bridge_state_handlers); + switch_core_session_rwunlock(session); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "invalid session : %s\n", call_id); + DUMP_EVENT(event); } - switch_core_session_rwunlock(b_session); } } - switch_core_session_rwunlock(a_session); + } - switch_safe_strdup(bridge_intercepted); + +} + +static void kz_tweaks_handle_bridge_replaces_call_id(switch_event_t *event) +{ + switch_event_t *my_event; + + const char *replaced_call_id = switch_event_get_header(event, "variable_sip_replaces_call_id"); + const char *a_leg_call_id = switch_event_get_header(event, "variable_sip_replaces_a-leg"); + const char *peer_uuid = switch_event_get_header(event, "Unique-ID"); + + if (!kz_test_tweak(KZ_TWEAK_BRIDGE_REPLACES_CALL_ID)) return; + + if(a_leg_call_id && replaced_call_id) { + switch_core_session_t *call_session = NULL; + const char *call_id = switch_event_get_header(event, "Bridge-B-Unique-ID"); + if (call_id && (call_session = switch_core_session_force_locate(call_id)) != NULL) { + switch_channel_t *call_channel = switch_core_session_get_channel(call_session); + if (switch_event_create(&my_event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(call_session)); + switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", peer_uuid); + switch_channel_event_set_data(call_channel, my_event); + switch_event_fire(&my_event); + } + switch_channel_set_variable(call_channel, "Bridge-B-Unique-ID", peer_uuid); + switch_channel_add_state_handler(call_channel, &kz_tweaks_signal_bridge_state_handlers); + switch_core_session_rwunlock(call_session); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "NOT FOUND : %s\n", call_id); + } + } + } static void kz_tweaks_channel_bridge_event_handler(switch_event_t *event) { - const char *uuid = switch_event_get_header(event, "Unique-ID"); - if (!kz_test_tweak(KZ_TWEAK_BRIDGE)) return; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "tweak bridge event handler: %s\n", uuid); - - kz_tweaks_handle_bridge_intercepted(event); + kz_tweaks_handle_bridge_replaces_call_id(event); + kz_tweaks_handle_bridge_replaces_aleg(event); kz_tweaks_handle_bridge_variables(event); } @@ -204,21 +234,12 @@ static void kz_tweaks_channel_replaced_event_handler(switch_event_t *event) static void kz_tweaks_channel_intercepted_event_handler(switch_event_t *event) { - switch_core_session_t *uuid_session = NULL; const char *uuid = switch_event_get_header(event, "Unique-ID"); const char *peer_uuid = switch_event_get_header(event, "intercepted_by"); if (!kz_test_tweak(KZ_TWEAK_TRANSFERS)) return; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "tweak intercepted handler : %s was intercepted by %s\n", uuid, peer_uuid); - - if ((uuid_session = switch_core_session_force_locate(peer_uuid)) != NULL) { - switch_channel_t *uuid_channel = switch_core_session_get_channel(uuid_session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "marking %s for channel_bridge handling\n", peer_uuid); - switch_channel_set_variable(uuid_channel, BRIDGE_INTERCEPT_VARIABLE, "true"); - switch_core_session_rwunlock(uuid_session); - } - + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "INTERCEPTED : %s => %s\n", uuid, peer_uuid); } static void kz_tweaks_channel_transferor_event_handler(switch_event_t *event) @@ -423,30 +444,6 @@ static void kz_tweaks_handle_caller_id(switch_core_session_t *session) } } -/* -static switch_status_t kz_tweaks_handle_auth_token(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_event_t *event; - const char *token = switch_channel_get_variable(channel, "sip_h_X-FS-Auth-Token"); - if(token) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Authenticating user for nightmare xfer %s\n", token); - if (switch_ivr_set_user(session, token) == SWITCH_STATUS_SUCCESS) { - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { - switch_channel_event_set_data(channel, event); - switch_event_fire(&event); - } - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Authenticated user from nightmare xfer %s\n", token); - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Error Authenticating user for nightmare xfer %s\n", token); - } - } - - return SWITCH_STATUS_SUCCESS; - -} -*/ - static switch_status_t kz_tweaks_handle_nightmare_xfer_interaction_id(switch_core_session_t *session) { if (kz_test_tweak(KZ_TWEAK_INTERACTION_ID)) { @@ -525,16 +522,26 @@ static switch_status_t kz_tweaks_handle_switch_uri(switch_core_session_t *sessio } +static char * kz_tweaks_new_interaction_id() +{ + long int first = (switch_micro_time_now() / 1000000) + UNIX_EPOCH_IN_GREGORIAN; + char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + switch_uuid_t uuid; + switch_uuid_get(&uuid); + switch_uuid_format(uuid_str, &uuid); + uuid_str[8] = '\0'; + return switch_mprintf("%ld-%s", first, uuid_str); +} + static void kz_tweaks_handle_interaction_id(switch_core_session_t *session) { - const char *expr = "${expr(ceil((${Event-Date-Timestamp} / 1000000) + $${UNIX_EPOCH_IN_GREGORIAN}))}-${regex(${create_uuid()}|^([^-]*)|%1)}"; switch_channel_t *channel = switch_core_session_get_channel(session); char * val = NULL; switch_core_session_t *peer_session = NULL; const char* peer_interaction_id = NULL; if (kz_test_tweak(KZ_TWEAK_INTERACTION_ID)) { - val = kz_expand(expr); + val = kz_tweaks_new_interaction_id(); if (val) { switch_channel_set_variable(channel, "Original-"INTERACTION_VARIABLE, val); if(switch_core_session_get_partner(session, &peer_session) == SWITCH_STATUS_SUCCESS) { @@ -583,32 +590,6 @@ static switch_status_t kz_tweaks_register_handle_blind_xfer(switch_core_session_ return SWITCH_STATUS_SUCCESS; } -static switch_status_t kz_tweaks_set_export_vars(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - const char *exports; - char *var, *new_exports, *new_exports_d = NULL; - - if (kz_test_tweak(KZ_TWEAK_EXPORT_VARS)) { - exports = switch_channel_get_variable(channel, SWITCH_EXPORT_VARS_VARIABLE); - var = switch_core_session_strdup(session, "Switch-URI,Switch-URL"); - - if (exports) { - new_exports_d = switch_mprintf("%s,%s", exports, var); - new_exports = new_exports_d; - } else { - new_exports = var; - } - - switch_channel_set_variable(channel, SWITCH_EXPORT_VARS_VARIABLE, new_exports); - - switch_safe_free(new_exports_d); - } - - - return SWITCH_STATUS_SUCCESS; -} - static switch_status_t kz_tweaks_on_init(switch_core_session_t *session) { switch_channel_t *channel = switch_core_session_get_channel(session); @@ -618,12 +599,10 @@ static switch_status_t kz_tweaks_on_init(switch_core_session_t *session) kz_tweaks_handle_interaction_id(session); kz_tweaks_handle_switch_uri(session); kz_tweaks_handle_caller_id(session); -// kz_tweaks_handle_auth_token(session); kz_tweaks_handle_nightmare_xfer_interaction_id(session); kz_tweaks_handle_replaces_call_id(session); kz_tweaks_handle_loopback(session); kz_tweaks_register_handle_blind_xfer(session); - kz_tweaks_set_export_vars(session); return SWITCH_STATUS_SUCCESS; } @@ -693,7 +672,7 @@ static void kz_tweaks_unbind_events() void kz_tweaks_add_core_variables() { - switch_core_set_variable("UNIX_EPOCH_IN_GREGORIAN", "62167219200"); + switch_core_set_variable("UNIX_EPOCH_IN_GREGORIAN", UNIX_EPOCH_IN_GREGORIAN_STR); } void kz_tweaks_start() diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.h b/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.h new file mode 100644 index 0000000000..11cf5f6561 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.h @@ -0,0 +1,32 @@ +#pragma once + +#include + +typedef enum { + KZ_TWEAK_INTERACTION_ID, + KZ_TWEAK_EXPORT_VARS, + KZ_TWEAK_SWITCH_URI, + KZ_TWEAK_REPLACES_CALL_ID, + KZ_TWEAK_LOOPBACK_VARS, + KZ_TWEAK_CALLER_ID, + KZ_TWEAK_TRANSFERS, + KZ_TWEAK_BRIDGE, + KZ_TWEAK_BRIDGE_REPLACES_ALEG, + KZ_TWEAK_BRIDGE_REPLACES_CALL_ID, + KZ_TWEAK_BRIDGE_VARIABLES, + KZ_TWEAK_RESTORE_CALLER_ID_ON_BLIND_XFER, + + /* No new flags below this line */ + KZ_TWEAK_MAX +} kz_tweak_t; + +void kz_tweaks_start(); +void kz_tweaks_stop(); +SWITCH_DECLARE(const char *) kz_tweak_name(kz_tweak_t tweak); +SWITCH_DECLARE(switch_status_t) kz_name_tweak(const char *name, kz_tweak_t *type); + + +#define kz_test_tweak(flag) (kazoo_globals.tweaks[flag] ? 1 : 0) +#define kz_set_tweak(flag) kazoo_globals.tweaks[flag] = 1 +#define kz_clear_tweak(flag) kazoo_globals.tweaks[flag] = 0 + diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_utils.c b/src/mod/event_handlers/mod_kazoo/kazoo_utils.c index f4050bb34a..34b33c8ae1 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_utils.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_utils.c @@ -90,15 +90,11 @@ SWITCH_DECLARE(switch_status_t) kz_expand_api_execute(const char *cmd, const cha switch_assert(stream->data != NULL); switch_assert(stream->write_function != NULL); - if (strcasecmp(cmd, "console_complete")) { - cmd_used = switch_strip_whitespace(cmd); - arg_used = switch_strip_whitespace(arg); - } else { - cmd_used = (char *) cmd; - arg_used = (char *) arg; - } + cmd_used = switch_strip_whitespace(cmd); + arg_used = switch_strip_whitespace(arg); if (cmd_used && (api = switch_loadable_module_get_api_interface(cmd_used)) != 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "executing [%s] => [%s]\n", cmd_used, arg_used); if ((status = api->function(arg_used, session, stream)) != SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "COMMAND RETURNED ERROR!\n"); } @@ -148,6 +144,7 @@ SWITCH_DECLARE(char *) kz_event_expand_headers_check(switch_event_t *event, cons nv = 0; olen = strlen(in) + 1; indup = strdup(in); + switch_assert(indup); endof_indup = end_of_p(indup) + 1; if ((data = malloc(olen))) { @@ -342,46 +339,37 @@ SWITCH_DECLARE(char *) kz_event_expand_headers_check(switch_event_t *event, cons } else { switch_stream_handle_t stream = { 0 }; char *expanded = NULL; + char *expanded_vname = NULL; SWITCH_STANDARD_STREAM(stream); - if (stream.data) { - char *expanded_vname = NULL; - - if ((expanded_vname = kz_event_expand_headers_check(event, (char *) vname, var_list, api_list, recur+1)) == vname) { - expanded_vname = NULL; - } else { - vname = expanded_vname; - } - - if ((expanded = kz_event_expand_headers_check(event, vval, var_list, api_list, recur+1)) == vval) { - expanded = NULL; - } else { - vval = expanded; - } - - if (!switch_core_test_flag(SCF_API_EXPANSION) || (api_list && !switch_event_check_permission_list(api_list, vname))) { - func_val = NULL; - sub_val = ""; - } else { - stream.param_event = event; - if (kz_expand_api_execute(vname, vval, NULL, &stream) == SWITCH_STATUS_SUCCESS) { - func_val = stream.data; - sub_val = func_val; - } else { - free(stream.data); - } - } - - switch_safe_free(expanded); - switch_safe_free(expanded_vname); - + if ((expanded_vname = kz_event_expand_headers_check(event, (char *) vname, var_list, api_list, recur+1)) == vname) { + expanded_vname = NULL; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n"); - free(data); - free(indup); - return (char *) in; + vname = expanded_vname; } + + if ((expanded = kz_event_expand_headers_check(event, vval, var_list, api_list, recur+1)) == vval) { + expanded = NULL; + } else { + vval = expanded; + } + + if (!switch_core_test_flag(SCF_API_EXPANSION) || (api_list && !switch_event_check_permission_list(api_list, vname))) { + func_val = NULL; + sub_val = ""; + } else { + stream.param_event = event; + if (kz_expand_api_execute(vname, vval, NULL, &stream) == SWITCH_STATUS_SUCCESS) { + func_val = stream.data; + sub_val = func_val; + } else { + free(stream.data); + } + } + + switch_safe_free(expanded); + switch_safe_free(expanded_vname); } if ((nlen = sub_val ? strlen(sub_val) : 0)) { if (len + nlen >= olen) { @@ -435,6 +423,21 @@ SWITCH_DECLARE(char *) kz_event_expand_headers(switch_event_t *event, const char return kz_event_expand_headers_check(event, in, NULL, NULL, 0); } +SWITCH_DECLARE(char *) kz_event_expand_headers_pool(switch_memory_pool_t *pool, switch_event_t *event, char *val) +{ + char *expanded; + char *dup = NULL; + + expanded = kz_event_expand_headers(event, val); + dup = switch_core_strdup(pool, expanded); + + if (expanded != val) { + free(expanded); + } + + return dup; +} + SWITCH_DECLARE(char *) kz_event_expand(const char *in) { switch_event_t *event = NULL; @@ -513,6 +516,32 @@ SWITCH_DECLARE(switch_status_t) kz_switch_event_add_variable_name_printf(switch_ return status; } +SWITCH_DECLARE(switch_status_t) kz_expand_json_to_event(cJSON *json, switch_event_t *event, char * prefix) +{ + char * fmt = switch_mprintf("%s%s%%s", prefix ? prefix : "", prefix ? "_" : ""); + if (event) { + cJSON *item = NULL; + char *response = NULL; + cJSON_ArrayForEach(item, json) { + if (item->type == cJSON_String) { + response = strdup(item->valuestring); + } else if (item->type == cJSON_Object) { + char * fmt1 = switch_mprintf(fmt, item->string); + kz_expand_json_to_event(item, event, fmt1); + switch_safe_free(fmt1); + continue; + } else { + response = cJSON_PrintUnformatted(item); + } + kz_switch_event_add_variable_name_printf(event, SWITCH_STACK_BOTTOM, response, fmt, item->string); + switch_safe_free(response); + } + } + + switch_safe_free(fmt); + return SWITCH_STATUS_SUCCESS; +} + SWITCH_DECLARE(switch_xml_t) kz_xml_child(switch_xml_t xml, const char *name) { xml = (xml) ? xml->child : NULL; @@ -565,6 +594,35 @@ void kz_event_decode(switch_event_t *event) } } +void kz_expand_headers(switch_event_t *resolver, switch_event_t *event) { + switch_event_t *clone = NULL; + switch_event_header_t *header = NULL; + switch_event_create_plain(&clone, event->event_id); + + for(header = event->headers; header; header = header->next) { + char *expanded = kz_event_expand_headers(resolver, header->value); + if (expanded != header->value) { + switch_event_add_header_string(clone, SWITCH_STACK_BOTTOM, header->name, expanded); + switch_safe_free(expanded); + } + } + + /* we don't want to force unique headers + * so we delete and then merge + */ + for(header = clone->headers; header; header = header->next) { + switch_event_del_header(event, header->name); + } + + switch_event_merge(event, clone); + + switch_event_destroy(&clone); +} + +void kz_expand_headers_self(switch_event_t *event) { + kz_expand_headers(event, event); +} + char * kz_expand_vars(char *xml_str) { return kz_expand_vars_pool(xml_str, NULL); } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_utils.h b/src/mod/event_handlers/mod_kazoo/kazoo_utils.h new file mode 100644 index 0000000000..c5ddc3e037 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_utils.h @@ -0,0 +1,53 @@ +#pragma once + +#include + +#ifdef __cplusplus +#define KZ_BEGIN_EXTERN_C extern "C" { +#define KZ_END_EXTERN_C } +#else +#define KZ_BEGIN_EXTERN_C +#define KZ_END_EXTERN_C +#endif + +KZ_BEGIN_EXTERN_C + +void kz_check_set_profile_var(switch_channel_t *channel, char* var, char *val); + +SWITCH_DECLARE(switch_status_t) kz_switch_core_merge_variables(switch_event_t *event); + +SWITCH_DECLARE(switch_status_t) kz_switch_core_base_headers_for_expand(switch_event_t **event); + +SWITCH_DECLARE(switch_status_t) kz_expand_api_execute(const char *cmd, const char *arg, switch_core_session_t *session, switch_stream_handle_t *stream); + +SWITCH_DECLARE(char *) kz_event_expand_headers_check(switch_event_t *event, const char *in, switch_event_t *var_list, switch_event_t *api_list, uint32_t recur); + +SWITCH_DECLARE(char *) kz_event_expand_headers(switch_event_t *event, const char *in); + +SWITCH_DECLARE(char *) kz_event_expand_headers_pool(switch_memory_pool_t *pool, switch_event_t *event, char *val); + +SWITCH_DECLARE(char *) kz_event_expand(const char *in); + +SWITCH_DECLARE(char *) kz_expand(const char *in); + +SWITCH_DECLARE(char *) kz_expand_pool(switch_memory_pool_t *pool, const char *in); + +char* kz_switch_event_get_first_of(switch_event_t *event, const char *list[]); + +SWITCH_DECLARE(switch_status_t) kz_switch_event_add_variable_name_printf(switch_event_t *event, switch_stack_t stack, const char *val, const char *fmt, ...); + +SWITCH_DECLARE(switch_xml_t) kz_xml_child(switch_xml_t xml, const char *name); + +void kz_xml_process(switch_xml_t cfg); +void kz_event_decode(switch_event_t *event); + +char * kz_expand_vars(char *xml_str); +void kz_expand_headers(switch_event_t *resolver, switch_event_t *event); +void kz_expand_headers_self(switch_event_t *event); + +char * kz_expand_vars_pool(char *xml_str, switch_memory_pool_t *pool); +switch_status_t kz_json_api(const char * command, cJSON *args, cJSON **res); + +SWITCH_DECLARE(switch_status_t) kz_expand_json_to_event(cJSON *json, switch_event_t *event, char * prefix); + +KZ_END_EXTERN_C diff --git a/src/mod/event_handlers/mod_kazoo/kz_node.c b/src/mod/event_handlers/mod_kazoo/kz_node.c index 26c362980b..1c50d0586e 100644 --- a/src/mod/event_handlers/mod_kazoo/kz_node.c +++ b/src/mod/event_handlers/mod_kazoo/kz_node.c @@ -86,6 +86,6 @@ SWITCH_STANDARD_JSON_API(kz_node_info_json_function) void add_kz_node(switch_loadable_module_interface_t **module_interface) { - switch_json_api_interface_t *json_api_interface = NULL; + switch_json_api_interface_t *json_api_interface = NULL; SWITCH_ADD_JSON_API(json_api_interface, "node.info", "JSON node API", kz_node_info_json_function, ""); } diff --git a/src/mod/event_handlers/mod_kazoo/mod_kazoo.c b/src/mod/event_handlers/mod_kazoo/mod_kazoo.c index ca0538039b..1be309c28d 100644 --- a/src/mod/event_handlers/mod_kazoo/mod_kazoo.c +++ b/src/mod/event_handlers/mod_kazoo/mod_kazoo.c @@ -32,23 +32,17 @@ */ #include "mod_kazoo.h" -globals_t kazoo_globals = {0}; +kz_globals_t kazoo_globals = {0}; SWITCH_MODULE_DEFINITION(mod_kazoo, mod_kazoo_load, mod_kazoo_shutdown, mod_kazoo_runtime); SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { - switch_api_interface_t *api_interface = NULL; - switch_application_interface_t *app_interface = NULL; memset(&kazoo_globals, 0, sizeof(kazoo_globals)); - kazoo_globals.pool = pool; - kazoo_globals.ei_nodes = NULL; - - // ensure epmd is running - + kz_set_hostname(); if(kazoo_load_config() != SWITCH_STATUS_SUCCESS) { // TODO: what would we need to clean up here? switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Improper configuration!\n"); @@ -66,13 +60,13 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { bind_fetch_agents(); /* create an api for cli debug commands */ - add_cli_api(module_interface, api_interface); + add_cli_api(module_interface); /* add our modified commands */ - add_kz_commands(module_interface, api_interface); + add_kz_commands(module_interface); /* add our modified dptools */ - add_kz_dptools(module_interface, app_interface); + add_kz_dptools(module_interface); /* add our endpoints */ add_kz_endpoints(module_interface); diff --git a/src/mod/event_handlers/mod_kazoo/mod_kazoo.h b/src/mod/event_handlers/mod_kazoo/mod_kazoo.h index 1fc12ba2aa..c9f16f4826 100644 --- a/src/mod/event_handlers/mod_kazoo/mod_kazoo.h +++ b/src/mod/event_handlers/mod_kazoo/mod_kazoo.h @@ -17,8 +17,11 @@ extern const char kz_default_config[]; extern const int kz_default_config_size; +#include "kazoo_defs.h" +#include "kazoo_tweaks.h" #include "kazoo_ei.h" #include "kazoo_message.h" +#include "kazoo_utils.h" typedef enum { LFLAG_RUNNING = (1 << 0) @@ -26,16 +29,17 @@ typedef enum { /* kazoo_commands.c */ -void add_kz_commands(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface); +void add_kz_commands(switch_loadable_module_interface_t **module_interface); /* kazoo_dptools.c */ -void add_kz_dptools(switch_loadable_module_interface_t **module_interface, switch_application_interface_t *app_interface); +void add_kz_dptools(switch_loadable_module_interface_t **module_interface); /* kazoo_api.c */ -void add_cli_api(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface); +void add_cli_api(switch_loadable_module_interface_t **module_interface); void remove_cli_api(); /* kazoo_utils.c */ +/* SWITCH_DECLARE(switch_status_t) kz_switch_core_merge_variables(switch_event_t *event); SWITCH_DECLARE(switch_status_t) kz_switch_core_base_headers_for_expand(switch_event_t **event); void kz_check_set_profile_var(switch_channel_t *channel, char* var, char *val); @@ -49,6 +53,7 @@ SWITCH_DECLARE(char *) kz_event_expand_headers(switch_event_t *event, const char SWITCH_DECLARE(char *) kz_expand(const char *in); SWITCH_DECLARE(char *) kz_expand_pool(switch_memory_pool_t *pool, const char *in); switch_status_t kz_json_api(const char * command, cJSON *args, cJSON **res); +*/ /* kazoo_endpoints.c */ void add_kz_endpoints(switch_loadable_module_interface_t **module_interface); diff --git a/src/mod/event_handlers/mod_smpp/mod_smpp_gateway.c b/src/mod/event_handlers/mod_smpp/mod_smpp_gateway.c index ed96586039..4be9790083 100644 --- a/src/mod/event_handlers/mod_smpp/mod_smpp_gateway.c +++ b/src/mod/event_handlers/mod_smpp/mod_smpp_gateway.c @@ -112,15 +112,15 @@ switch_status_t mod_smpp_gateway_authenticate(mod_smpp_gateway_t *gateway) { strncpy( (char *)req_b->address_range, gateway->host, sizeof(req_b->address_range)); if ( gateway->system_id ) { - strncpy((char *)req_b->system_id, gateway->system_id, sizeof(req_b->system_id)); + snprintf((char *)req_b->system_id, sizeof(req_b->system_id), "%s", gateway->system_id); } if ( gateway->password ) { - strncpy((char *)req_b->password, gateway->password, sizeof(req_b->password)); + snprintf((char *)req_b->password, sizeof(req_b->password), "%s", gateway->password); } if ( gateway->system_type ) { - strncpy((char *)req_b->system_type, gateway->system_type, sizeof(req_b->system_type)); + snprintf((char *)req_b->system_type, sizeof(req_b->system_type), "%s", gateway->system_type); } req_b->interface_version = SMPP_VERSION; diff --git a/src/mod/formats/mod_local_stream/mod_local_stream.c b/src/mod/formats/mod_local_stream/mod_local_stream.c index 9e9a7aa3c9..c70d77410c 100644 --- a/src/mod/formats/mod_local_stream/mod_local_stream.c +++ b/src/mod/formats/mod_local_stream/mod_local_stream.c @@ -764,6 +764,10 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "local_stream://%s partially reloaded.\n",source->name); source->part_reload = 0; source->full_reload = 0; + + if (xml) { + switch_xml_free(xml); + } } } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "local_stream://%s fully reloaded.\n",source->name); diff --git a/src/mod/formats/mod_sndfile/mod_sndfile.c b/src/mod/formats/mod_sndfile/mod_sndfile.c index a6f866356f..a03e28af5c 100644 --- a/src/mod/formats/mod_sndfile/mod_sndfile.c +++ b/src/mod/formats/mod_sndfile/mod_sndfile.c @@ -117,21 +117,19 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha context->sfinfo.format |= map->format; } - if (!strcmp(ext, "r8") || !strcmp(ext, "raw")) { + if (!strcmp(ext, "raw")) { + context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16; + } else if (!strcmp(ext, "r8")) { context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16; - context->sfinfo.channels = 1; context->sfinfo.samplerate = 8000; } else if (!strcmp(ext, "r16")) { context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16; - context->sfinfo.channels = 1; context->sfinfo.samplerate = 16000; } else if (!strcmp(ext, "r24")) { context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_24; - context->sfinfo.channels = 1; context->sfinfo.samplerate = 24000; } else if (!strcmp(ext, "r32")) { context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_32; - context->sfinfo.channels = 1; context->sfinfo.samplerate = 32000; } else if (!strcmp(ext, "gsm")) { context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_GSM610; @@ -269,7 +267,9 @@ static switch_status_t sndfile_file_close(switch_file_handle_t *handle) { sndfile_context *context = handle->private_info; - sf_close(context->handle); + if (context) { + sf_close(context->handle); + } return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index ae2c894584..07efc7d898 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.10 + * Version 3.0.12 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -8545,6 +8545,68 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_SWITCH_CRYPTO_MKI_MAX_get___ } +SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_coredb_handle_in_memory_set___(void * jarg1, int jarg2) { + switch_coredb_handle *arg1 = (switch_coredb_handle *) 0 ; + switch_bool_t arg2 ; + + arg1 = (switch_coredb_handle *)jarg1; + arg2 = (switch_bool_t)jarg2; + if (arg1) (arg1)->in_memory = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_coredb_handle_in_memory_get___(void * jarg1) { + int jresult ; + switch_coredb_handle *arg1 = (switch_coredb_handle *) 0 ; + switch_bool_t result; + + arg1 = (switch_coredb_handle *)jarg1; + result = (switch_bool_t) ((arg1)->in_memory); + jresult = (int)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_coredb_handle_handle_set___(void * jarg1, void * jarg2) { + switch_coredb_handle *arg1 = (switch_coredb_handle *) 0 ; + switch_core_db_t *arg2 = (switch_core_db_t *) 0 ; + + arg1 = (switch_coredb_handle *)jarg1; + arg2 = (switch_core_db_t *)jarg2; + if (arg1) (arg1)->handle = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_coredb_handle_handle_get___(void * jarg1) { + void * jresult ; + switch_coredb_handle *arg1 = (switch_coredb_handle *) 0 ; + switch_core_db_t *result = 0 ; + + arg1 = (switch_coredb_handle *)jarg1; + result = (switch_core_db_t *) ((arg1)->handle); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_new_switch_coredb_handle___() { + void * jresult ; + switch_coredb_handle *result = 0 ; + + result = (switch_coredb_handle *)new switch_coredb_handle(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_delete_switch_coredb_handle___(void * jarg1) { + switch_coredb_handle *arg1 = (switch_coredb_handle *) 0 ; + + arg1 = (switch_coredb_handle *)jarg1; + delete arg1; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_db_close___(void * jarg1) { int jresult ; switch_core_db_t *arg1 = (switch_core_db_t *) 0 ; @@ -8571,6 +8633,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_db_open___(char } +SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_db_open_v2___(char * jarg1, void * jarg2) { + int jresult ; + char *arg1 = (char *) 0 ; + switch_core_db_t **arg2 = (switch_core_db_t **) 0 ; + int result; + + arg1 = (char *)jarg1; + arg2 = (switch_core_db_t **)jarg2; + result = (int)switch_core_db_open_v2((char const *)arg1,arg2); + jresult = result; + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_db_column_text___(void * jarg1, int jarg2) { void * jresult ; switch_core_db_stmt_t *arg1 = (switch_core_db_stmt_t *) 0 ; @@ -9923,7 +9999,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_device_node_t_xml_ } -SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_device_node_t__event_set___(void * jarg1, void * jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_device_node_t_event__set___(void * jarg1, void * jarg2) { device_uuid_node_s *arg1 = (device_uuid_node_s *) 0 ; switch_event_t *arg2 = (switch_event_t *) 0 ; @@ -9933,7 +10009,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_device_node_t__event } -SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_device_node_t__event_get___(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_device_node_t_event__get___(void * jarg1) { void * jresult ; device_uuid_node_s *arg1 = (device_uuid_node_s *) 0 ; switch_event_t *result = 0 ; @@ -12827,6 +12903,14 @@ SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_memory_pool_tag } +SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_pool_stats___(void * jarg1) { + switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ; + + arg1 = (switch_stream_handle_t *)jarg1; + switch_core_pool_stats(arg1); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_perform_new_memory_pool___(void * jarg1, char * jarg2, char * jarg3, int jarg4) { int jresult ; switch_memory_pool_t **arg1 = (switch_memory_pool_t **) 0 ; @@ -14573,6 +14657,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_hash_destroy___( } +SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_hash_insert_auto_free___(void * jarg1, char * jarg2, void * jarg3) { + int jresult ; + switch_hash_t *arg1 = (switch_hash_t *) 0 ; + char *arg2 = (char *) 0 ; + void *arg3 = (void *) 0 ; + switch_status_t result; + + arg1 = (switch_hash_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (void *)jarg3; + result = (switch_status_t)switch_core_hash_insert_auto_free(arg1,(char const *)arg2,(void const *)arg3); + jresult = (int)result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_hash_insert_destructor___(void * jarg1, char * jarg2, void * jarg3, void * jarg4) { int jresult ; switch_hash_t *arg1 = (switch_hash_t *) 0 ; @@ -15426,6 +15526,18 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_db_open_file_ } +SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_db_open_in_memory___(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_core_db_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_core_db_t *)switch_core_db_open_in_memory((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_db_persistant_execute___(void * jarg1, char * jarg2, unsigned long jarg3) { int jresult ; switch_core_db_t *arg1 = (switch_core_db_t *) 0 ; @@ -16936,10 +17048,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_CACHE_DB_LEN_get___() { SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_native_handle_t_core_db_dbh_set___(void * jarg1, void * jarg2) { switch_cache_db_native_handle_t *arg1 = (switch_cache_db_native_handle_t *) 0 ; - switch_core_db_t *arg2 = (switch_core_db_t *) 0 ; + switch_coredb_handle_t *arg2 = (switch_coredb_handle_t *) 0 ; arg1 = (switch_cache_db_native_handle_t *)jarg1; - arg2 = (switch_core_db_t *)jarg2; + arg2 = (switch_coredb_handle_t *)jarg2; if (arg1) (arg1)->core_db_dbh = arg2; } @@ -16947,10 +17059,10 @@ SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_native_hand SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_native_handle_t_core_db_dbh_get___(void * jarg1) { void * jresult ; switch_cache_db_native_handle_t *arg1 = (switch_cache_db_native_handle_t *) 0 ; - switch_core_db_t *result = 0 ; + switch_coredb_handle_t *result = 0 ; arg1 = (switch_cache_db_native_handle_t *)jarg1; - result = (switch_core_db_t *) ((arg1)->core_db_dbh); + result = (switch_coredb_handle_t *) ((arg1)->core_db_dbh); jresult = (void *)result; return jresult; } @@ -17048,6 +17160,28 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_core_db_o } +SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_core_db_options_t_in_memory_set___(void * jarg1, int jarg2) { + switch_cache_db_core_db_options_t *arg1 = (switch_cache_db_core_db_options_t *) 0 ; + switch_bool_t arg2 ; + + arg1 = (switch_cache_db_core_db_options_t *)jarg1; + arg2 = (switch_bool_t)jarg2; + if (arg1) (arg1)->in_memory = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_cache_db_core_db_options_t_in_memory_get___(void * jarg1) { + int jresult ; + switch_cache_db_core_db_options_t *arg1 = (switch_cache_db_core_db_options_t *) 0 ; + switch_bool_t result; + + arg1 = (switch_cache_db_core_db_options_t *)jarg1; + result = (switch_bool_t) ((arg1)->in_memory); + jresult = (int)result; + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_new_switch_cache_db_core_db_options_t___() { void * jresult ; switch_cache_db_core_db_options_t *result = 0 ; @@ -18603,6 +18737,16 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_session_start_te } +SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_get_event_channel_key_separator___() { + char * jresult ; + char *result = 0 ; + + result = (char *)switch_core_get_event_channel_key_separator(); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_loadable_module_interface_module_name_set___(void * jarg1, char * jarg2) { switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; char *arg2 = (char *) 0 ; @@ -28639,7 +28783,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_file_handle_max_sampl } -SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_file_handle__params_set___(void * jarg1, void * jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_file_handle_params__set___(void * jarg1, void * jarg2) { switch_file_handle *arg1 = (switch_file_handle *) 0 ; switch_event_t *arg2 = (switch_event_t *) 0 ; @@ -28649,7 +28793,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_file_handle__params_ } -SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_file_handle__params_get___(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_file_handle_params__get___(void * jarg1) { void * jresult ; switch_file_handle *arg1 = (switch_file_handle *) 0 ; switch_event_t *result = 0 ; @@ -43480,6 +43624,20 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_leg_get_vars_ } +SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_leg_get_var___(void * jarg1, char * jarg2) { + char * jresult ; + switch_dial_leg_t *arg1 = (switch_dial_leg_t *) 0 ; + char *arg2 = (char *) 0 ; + char *result = 0 ; + + arg1 = (switch_dial_leg_t *)jarg1; + arg2 = (char *)jarg2; + result = (char *)switch_dial_leg_get_var(arg1,(char const *)arg2); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_get_total___(void * jarg1) { int jresult ; switch_dial_handle_t *arg1 = (switch_dial_handle_t *) 0 ; @@ -43492,15 +43650,21 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_dial_handle_get_total } -SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_ivr_orig_and_bridge___(void * jarg1, char * jarg2, void * jarg3) { +SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_ivr_orig_and_bridge___(void * jarg1, char * jarg2, void * jarg3, void * jarg4) { + int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; char *arg2 = (char *) 0 ; switch_dial_handle_t *arg3 = (switch_dial_handle_t *) 0 ; + switch_call_cause_t *arg4 = (switch_call_cause_t *) 0 ; + switch_status_t result; arg1 = (switch_core_session_t *)jarg1; arg2 = (char *)jarg2; arg3 = (switch_dial_handle_t *)jarg3; - switch_ivr_orig_and_bridge(arg1,(char const *)arg2,arg3); + arg4 = (switch_call_cause_t *)jarg4; + result = (switch_status_t)switch_ivr_orig_and_bridge(arg1,(char const *)arg2,arg3,arg4); + jresult = (int)result; + return jresult; } @@ -46996,55 +47160,62 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_get___(void * } -SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_toxml___(void * jarg1, int jarg2) { +SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_toxml_ex___(void * jarg1, int jarg2, int jarg3) { char * jresult ; switch_xml_t arg1 = (switch_xml_t) 0 ; switch_bool_t arg2 ; + switch_bool_t arg3 ; char *result = 0 ; arg1 = (switch_xml_t)jarg1; arg2 = (switch_bool_t)jarg2; - result = (char *)switch_xml_toxml(arg1,arg2); + arg3 = (switch_bool_t)jarg3; + result = (char *)switch_xml_toxml_ex(arg1,arg2,arg3); jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } -SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_toxml_nolock___(void * jarg1, int jarg2) { +SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_toxml_nolock_ex___(void * jarg1, int jarg2, int jarg3) { char * jresult ; switch_xml_t arg1 = (switch_xml_t) 0 ; switch_bool_t arg2 ; + switch_bool_t arg3 ; char *result = 0 ; arg1 = (switch_xml_t)jarg1; arg2 = (switch_bool_t)jarg2; - result = (char *)switch_xml_toxml_nolock(arg1,arg2); + arg3 = (switch_bool_t)jarg3; + result = (char *)switch_xml_toxml_nolock_ex(arg1,arg2,arg3); jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } -SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_tohtml___(void * jarg1, int jarg2) { +SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_tohtml_ex___(void * jarg1, int jarg2, int jarg3) { char * jresult ; switch_xml_t arg1 = (switch_xml_t) 0 ; switch_bool_t arg2 ; + switch_bool_t arg3 ; char *result = 0 ; arg1 = (switch_xml_t)jarg1; arg2 = (switch_bool_t)jarg2; - result = (char *)switch_xml_tohtml(arg1,arg2); + arg3 = (switch_bool_t)jarg3; + result = (char *)switch_xml_tohtml_ex(arg1,arg2,arg3); jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } -SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_toxml_buf___(void * jarg1, char * jarg2, void * jarg3, void * jarg4, int jarg5) { +SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_toxml_buf_ex___(void * jarg1, char * jarg2, void * jarg3, void * jarg4, int jarg5, int jarg6) { char * jresult ; switch_xml_t arg1 = (switch_xml_t) 0 ; char *arg2 = (char *) 0 ; switch_size_t arg3 ; switch_size_t arg4 ; switch_bool_t arg5 ; + switch_bool_t arg6 ; switch_size_t *argp3 ; switch_size_t *argp4 ; char *result = 0 ; @@ -47064,7 +47235,8 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_xml_toxml_buf___(v } arg4 = *argp4; arg5 = (switch_bool_t)jarg5; - result = (char *)switch_xml_toxml_buf(arg1,arg2,arg3,arg4,arg5); + arg6 = (switch_bool_t)jarg6; + result = (char *)switch_xml_toxml_buf_ex(arg1,arg2,arg3,arg4,arg5,arg6); jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 6c9218cc82..884806bcab 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -2,7 +2,7 @@ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -65,7 +65,7 @@ public class Api : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -452,7 +452,7 @@ public class CoreSession : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -520,7 +520,7 @@ public class DTMF : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -657,7 +657,7 @@ public partial class Event : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -792,7 +792,7 @@ public class EventConsumer : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -848,7 +848,7 @@ public class IvrMenu : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -901,7 +901,7 @@ public partial class ManagedSession : CoreSession { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -930,7 +930,7 @@ public class SWIGTYPE_p_FILE { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -959,7 +959,7 @@ public class SWIGTYPE_p_a_256__char { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -988,7 +988,7 @@ public class SWIGTYPE_p_a_2__icand_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1017,7 +1017,7 @@ public class SWIGTYPE_p_apr_pool_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1046,7 +1046,7 @@ public class SWIGTYPE_p_cJSON { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1075,7 +1075,7 @@ public class SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_s // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1104,7 +1104,7 @@ public class SWIGTYPE_p_f_p_p_switch_database_interface_handle__switch_status_t // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1133,7 +1133,7 @@ public class SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__swi // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1162,7 +1162,7 @@ public class SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__swit // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1191,7 +1191,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1220,7 +1220,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1249,7 +1249,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_int_p_switch_database_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1278,7 +1278,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_int_p_switch_database_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1307,7 +1307,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_cal // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1336,7 +1336,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_co // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1365,7 +1365,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1394,7 +1394,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1423,7 +1423,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1452,7 +1452,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1481,7 +1481,7 @@ public class SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1510,7 +1510,7 @@ public class SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1539,7 +1539,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1568,7 +1568,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1597,7 +1597,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1626,7 +1626,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1655,7 +1655,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_s // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1684,7 +1684,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1713,7 +1713,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1742,7 +1742,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__cha // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1771,7 +1771,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__s // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1800,7 +1800,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigne // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1829,7 +1829,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1858,7 +1858,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_lon // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1887,7 +1887,7 @@ public class SWIGTYPE_p_f_p_switch_codec__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1916,7 +1916,7 @@ public class SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enu // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1945,7 +1945,7 @@ public class SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_uns // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -1974,7 +1974,7 @@ public class SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2003,7 +2003,7 @@ public class SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_s // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2032,7 +2032,7 @@ public class SWIGTYPE_p_f_p_switch_core_session__int { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2061,7 +2061,7 @@ public class SWIGTYPE_p_f_p_switch_core_session__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2090,7 +2090,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2119,7 +2119,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2148,7 +2148,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_c // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2177,7 +2177,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_swi // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2206,7 +2206,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_i // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2235,7 +2235,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2264,7 +2264,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2293,7 +2293,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2322,7 +2322,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2351,7 +2351,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2380,7 +2380,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_sw // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2409,7 +2409,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__s // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2438,7 +2438,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2467,7 +2467,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_p // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2496,7 +2496,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_p // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2525,7 +2525,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_st // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2554,7 +2554,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2583,7 +2583,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_void__p_void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2612,7 +2612,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2641,7 +2641,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2670,7 +2670,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2699,7 +2699,7 @@ public class SWIGTYPE_p_f_p_switch_database_interface_handle__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2728,7 +2728,7 @@ public class SWIGTYPE_p_f_p_switch_database_interface_handle_enum_switch_bool_t_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2757,7 +2757,7 @@ public class SWIGTYPE_p_f_p_switch_database_interface_handle_p_int__switch_statu // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2786,7 +2786,7 @@ public class SWIGTYPE_p_f_p_switch_database_interface_handle_p_q_const__char_p_c // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2815,7 +2815,7 @@ public class SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2844,7 +2844,7 @@ public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2873,7 +2873,7 @@ public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2902,7 +2902,7 @@ public class SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_st // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2931,7 +2931,7 @@ public class SWIGTYPE_p_f_p_switch_event__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2960,7 +2960,7 @@ public class SWIGTYPE_p_f_p_switch_event__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -2989,7 +2989,7 @@ public class SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3018,7 +3018,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3047,7 +3047,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_con // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3076,7 +3076,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3105,7 +3105,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switc // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3134,7 +3134,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3163,7 +3163,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3192,7 +3192,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3221,7 +3221,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3250,7 +3250,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__swi // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3279,7 +3279,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_st // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3308,7 +3308,7 @@ public class SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3337,7 +3337,7 @@ public class SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3366,7 +3366,7 @@ public class SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3395,7 +3395,7 @@ public class SWIGTYPE_p_f_p_switch_media_bug_p_void__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3424,7 +3424,7 @@ public class SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__swit // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3453,7 +3453,7 @@ public class SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3482,7 +3482,7 @@ public class SWIGTYPE_p_f_p_switch_scheduler_task__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3511,7 +3511,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3540,7 +3540,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3569,7 +3569,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3598,7 +3598,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3627,7 +3627,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3656,7 +3656,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsig // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3685,7 +3685,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3714,7 +3714,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsign // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3743,7 +3743,7 @@ public class SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3772,7 +3772,7 @@ public class SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3801,7 +3801,7 @@ public class SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__ // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3830,7 +3830,7 @@ public class SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3859,7 +3859,7 @@ public class SWIGTYPE_p_f_p_switch_timer__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3888,7 +3888,7 @@ public class SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3917,7 +3917,7 @@ public class SWIGTYPE_p_f_p_void__void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3946,7 +3946,7 @@ public class SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -3975,7 +3975,7 @@ public class SWIGTYPE_p_f_p_void_p_q_const__char__int { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4004,7 +4004,7 @@ public class SWIGTYPE_p_f_p_void_p_switch_event__int { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4033,7 +4033,7 @@ public class SWIGTYPE_p_f_switch_cache_db_database_interface_options_t_p_p_switc // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4062,7 +4062,7 @@ public class SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4091,7 +4091,7 @@ public class SWIGTYPE_p_f_void__p_char { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4120,7 +4120,7 @@ public class SWIGTYPE_p_f_void__switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4149,7 +4149,7 @@ public class SWIGTYPE_p_float { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4178,7 +4178,7 @@ public class SWIGTYPE_p_in6_addr { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4207,7 +4207,7 @@ public class SWIGTYPE_p_int { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4236,7 +4236,7 @@ public class SWIGTYPE_p_p_apr_pool_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4265,7 +4265,7 @@ public class SWIGTYPE_p_p_cJSON { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4294,7 +4294,7 @@ public class SWIGTYPE_p_p_char { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4323,7 +4323,7 @@ public class SWIGTYPE_p_p_p_char { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4352,7 +4352,7 @@ public class SWIGTYPE_p_p_payload_map_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4381,7 +4381,7 @@ public class SWIGTYPE_p_p_real_pcre { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4410,7 +4410,7 @@ public class SWIGTYPE_p_p_sqlite3 { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4439,7 +4439,7 @@ public class SWIGTYPE_p_p_sqlite3_stmt { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4468,7 +4468,7 @@ public class SWIGTYPE_p_p_switch_agc_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4497,7 +4497,7 @@ public class SWIGTYPE_p_p_switch_audio_resampler_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4526,7 +4526,7 @@ public class SWIGTYPE_p_p_switch_buffer { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4555,7 +4555,7 @@ public class SWIGTYPE_p_p_switch_cache_db_handle { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4584,7 +4584,7 @@ public class SWIGTYPE_p_p_switch_caller_extension { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4613,7 +4613,7 @@ public class SWIGTYPE_p_p_switch_channel { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4642,7 +4642,7 @@ public class SWIGTYPE_p_p_switch_codec_implementation { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4671,7 +4671,7 @@ public class SWIGTYPE_p_p_switch_console_callback_match { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4700,7 +4700,7 @@ public class SWIGTYPE_p_p_switch_core_port_allocator { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4729,7 +4729,7 @@ public class SWIGTYPE_p_p_switch_core_session { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4758,7 +4758,7 @@ public class SWIGTYPE_p_p_switch_core_session_message { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4787,7 +4787,7 @@ public class SWIGTYPE_p_p_switch_device_record_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4816,7 +4816,7 @@ public class SWIGTYPE_p_p_switch_dial_handle_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4845,7 +4845,7 @@ public class SWIGTYPE_p_p_switch_dial_leg_list_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4874,7 +4874,7 @@ public class SWIGTYPE_p_p_switch_dial_leg_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4903,7 +4903,7 @@ public class SWIGTYPE_p_p_switch_event { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4932,7 +4932,7 @@ public class SWIGTYPE_p_p_switch_event_node { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4961,7 +4961,7 @@ public class SWIGTYPE_p_p_switch_file_handle { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -4990,7 +4990,7 @@ public class SWIGTYPE_p_p_switch_frame { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5019,7 +5019,7 @@ public class SWIGTYPE_p_p_switch_frame_buffer_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5048,7 +5048,7 @@ public class SWIGTYPE_p_p_switch_hashtable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5077,7 +5077,7 @@ public class SWIGTYPE_p_p_switch_hashtable_iterator { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5106,7 +5106,7 @@ public class SWIGTYPE_p_p_switch_ivr_digit_stream { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5135,7 +5135,7 @@ public class SWIGTYPE_p_p_switch_ivr_digit_stream_parser { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5164,7 +5164,7 @@ public class SWIGTYPE_p_p_switch_ivr_dmachine { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5193,7 +5193,7 @@ public class SWIGTYPE_p_p_switch_ivr_dmachine_match { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5222,7 +5222,7 @@ public class SWIGTYPE_p_p_switch_ivr_menu { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5251,7 +5251,7 @@ public class SWIGTYPE_p_p_switch_ivr_menu_xml_ctx { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5280,7 +5280,7 @@ public class SWIGTYPE_p_p_switch_live_array_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5309,7 +5309,7 @@ public class SWIGTYPE_p_p_switch_log_node_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5338,7 +5338,7 @@ public class SWIGTYPE_p_p_switch_media_bug { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5367,7 +5367,7 @@ public class SWIGTYPE_p_p_switch_network_list { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5396,7 +5396,7 @@ public class SWIGTYPE_p_p_switch_rtp { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5425,7 +5425,7 @@ public class SWIGTYPE_p_p_switch_say_file_handle { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5454,7 +5454,7 @@ public class SWIGTYPE_p_p_switch_sql_queue_manager { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5483,7 +5483,7 @@ public class SWIGTYPE_p_p_switch_thread_data_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5512,7 +5512,7 @@ public class SWIGTYPE_p_p_switch_xml { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5541,7 +5541,7 @@ public class SWIGTYPE_p_p_switch_xml_binding { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5570,7 +5570,7 @@ public class SWIGTYPE_p_p_unsigned_char { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5599,7 +5599,7 @@ public class SWIGTYPE_p_p_void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5628,7 +5628,7 @@ public class SWIGTYPE_p_pid_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5657,7 +5657,7 @@ public class SWIGTYPE_p_real_pcre { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5686,7 +5686,7 @@ public class SWIGTYPE_p_short { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5715,7 +5715,7 @@ public class SWIGTYPE_p_sockaddr { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5744,7 +5744,7 @@ public class SWIGTYPE_p_sockaddr_in6 { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5773,7 +5773,7 @@ public class SWIGTYPE_p_socklen_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5802,7 +5802,7 @@ public class SWIGTYPE_p_sqlite3 { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5831,7 +5831,7 @@ public class SWIGTYPE_p_sqlite3_stmt { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5860,7 +5860,7 @@ public class SWIGTYPE_p_switch_agc_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5889,7 +5889,7 @@ public class SWIGTYPE_p_switch_buffer { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5918,7 +5918,7 @@ public class SWIGTYPE_p_switch_cache_db_handle { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5947,7 +5947,7 @@ public class SWIGTYPE_p_switch_call_cause_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -5976,7 +5976,7 @@ public class SWIGTYPE_p_switch_channel { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6005,7 +6005,7 @@ public class SWIGTYPE_p_switch_codec_control_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6034,7 +6034,7 @@ public class SWIGTYPE_p_switch_core_port_allocator { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6063,7 +6063,7 @@ public class SWIGTYPE_p_switch_core_session { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6092,7 +6092,7 @@ public class SWIGTYPE_p_switch_dial_handle_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6121,7 +6121,7 @@ public class SWIGTYPE_p_switch_dial_leg_list_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6150,7 +6150,7 @@ public class SWIGTYPE_p_switch_dial_leg_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6179,7 +6179,7 @@ public class SWIGTYPE_p_switch_event_types_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6208,7 +6208,7 @@ public class SWIGTYPE_p_switch_file_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6237,7 +6237,7 @@ public class SWIGTYPE_p_switch_frame_buffer_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6266,7 +6266,7 @@ public class SWIGTYPE_p_switch_hashtable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6295,7 +6295,7 @@ public class SWIGTYPE_p_switch_hashtable_iterator { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6324,7 +6324,7 @@ public class SWIGTYPE_p_switch_image_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6353,7 +6353,7 @@ public class SWIGTYPE_p_switch_img_fmt_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6382,7 +6382,7 @@ public class SWIGTYPE_p_switch_img_position_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6411,7 +6411,7 @@ public class SWIGTYPE_p_switch_interval_time_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6440,7 +6440,7 @@ public class SWIGTYPE_p_switch_ivr_action_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6469,7 +6469,7 @@ public class SWIGTYPE_p_switch_ivr_digit_stream { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6498,7 +6498,7 @@ public class SWIGTYPE_p_switch_ivr_digit_stream_parser { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6527,7 +6527,7 @@ public class SWIGTYPE_p_switch_ivr_dmachine { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6556,7 +6556,7 @@ public class SWIGTYPE_p_switch_ivr_menu { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6585,7 +6585,7 @@ public class SWIGTYPE_p_switch_ivr_menu_xml_ctx { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6614,7 +6614,7 @@ public class SWIGTYPE_p_switch_jb_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6643,7 +6643,7 @@ public class SWIGTYPE_p_switch_live_array_s { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6672,7 +6672,7 @@ public class SWIGTYPE_p_switch_media_bug { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6701,7 +6701,7 @@ public class SWIGTYPE_p_switch_mutex_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6730,7 +6730,7 @@ public class SWIGTYPE_p_switch_network_list { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6759,7 +6759,7 @@ public class SWIGTYPE_p_switch_odbc_handle { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6788,7 +6788,7 @@ public class SWIGTYPE_p_switch_pollfd_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6817,7 +6817,7 @@ public class SWIGTYPE_p_switch_queue_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6846,7 +6846,7 @@ public class SWIGTYPE_p_switch_rtcp_frame { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6875,7 +6875,7 @@ public class SWIGTYPE_p_switch_rtp { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6904,7 +6904,7 @@ public class SWIGTYPE_p_switch_rtp_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6933,7 +6933,7 @@ public class SWIGTYPE_p_switch_say_file_handle { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6962,7 +6962,7 @@ public class SWIGTYPE_p_switch_size_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -6991,7 +6991,7 @@ public class SWIGTYPE_p_switch_sockaddr_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7020,7 +7020,7 @@ public class SWIGTYPE_p_switch_socket_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7049,7 +7049,7 @@ public class SWIGTYPE_p_switch_sql_queue_manager { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7078,7 +7078,7 @@ public class SWIGTYPE_p_switch_ssize_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7107,7 +7107,7 @@ public class SWIGTYPE_p_switch_thread_rwlock_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7136,7 +7136,7 @@ public class SWIGTYPE_p_switch_thread_start_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7165,7 +7165,7 @@ public class SWIGTYPE_p_switch_thread_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7194,7 +7194,7 @@ public class SWIGTYPE_p_switch_time_exp_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7223,7 +7223,7 @@ public class SWIGTYPE_p_switch_time_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7252,7 +7252,7 @@ public class SWIGTYPE_p_switch_xml_binding { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7281,7 +7281,7 @@ public class SWIGTYPE_p_time_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7310,7 +7310,7 @@ public class SWIGTYPE_p_unsigned_char { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7339,7 +7339,7 @@ public class SWIGTYPE_p_unsigned_int { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7368,7 +7368,7 @@ public class SWIGTYPE_p_unsigned_long { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7397,7 +7397,7 @@ public class SWIGTYPE_p_unsigned_short { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7426,7 +7426,7 @@ public class SWIGTYPE_p_void { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7495,7 +7495,7 @@ public partial class Stream : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7563,7 +7563,7 @@ public class audio_buffer_header_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7573,7 +7573,8 @@ namespace FreeSWITCH.Native { public enum cache_db_flag_t { CDF_INUSE = (1 << 0), - CDF_PRUNE = (1 << 1) + CDF_PRUNE = (1 << 1), + CDF_NONEXPIRING = (1 << 2) } } @@ -7581,7 +7582,7 @@ public enum cache_db_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7599,7 +7600,7 @@ public enum dm_match_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7688,7 +7689,7 @@ public class dtls_fingerprint_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7710,7 +7711,7 @@ public enum dtls_state_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7730,7 +7731,7 @@ public enum dtls_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7748,7 +7749,7 @@ public enum dtmf_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -7789,6 +7790,11 @@ public class freeswitch { return ret; } + public static int switch_core_db_open_v2(string filename, SWIGTYPE_p_p_sqlite3 ppDb) { + int ret = freeswitchPINVOKE.switch_core_db_open_v2(filename, SWIGTYPE_p_p_sqlite3.getCPtr(ppDb)); + return ret; + } + public static SWIGTYPE_p_unsigned_char switch_core_db_column_text(SWIGTYPE_p_sqlite3_stmt stmt, int iCol) { global::System.IntPtr cPtr = freeswitchPINVOKE.switch_core_db_column_text(SWIGTYPE_p_sqlite3_stmt.getCPtr(stmt), iCol); SWIGTYPE_p_unsigned_char ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); @@ -8303,6 +8309,10 @@ else freeswitchPINVOKE.switch_core_memory_pool_tag(SWIGTYPE_p_apr_pool_t.getCPtr(pool), tag); } + public static void switch_core_pool_stats(switch_stream_handle stream) { + freeswitchPINVOKE.switch_core_pool_stats(switch_stream_handle.getCPtr(stream)); + } + public static switch_status_t switch_core_perform_new_memory_pool(SWIGTYPE_p_p_apr_pool_t pool, string file, string func, int line) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_perform_new_memory_pool(SWIGTYPE_p_p_apr_pool_t.getCPtr(pool), file, func, line); return ret; @@ -8932,6 +8942,11 @@ else return ret; } + public static switch_status_t switch_core_hash_insert_auto_free(SWIGTYPE_p_switch_hashtable hash, string key, SWIGTYPE_p_void data) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_insert_auto_free(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key, SWIGTYPE_p_void.getCPtr(data)); + return ret; + } + public static switch_status_t switch_core_hash_insert_destructor(SWIGTYPE_p_switch_hashtable hash, string key, SWIGTYPE_p_void data, SWIGTYPE_p_f_p_void__void destructor) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_hash_insert_destructor(SWIGTYPE_p_switch_hashtable.getCPtr(hash), key, SWIGTYPE_p_void.getCPtr(data), SWIGTYPE_p_f_p_void__void.getCPtr(destructor)); return ret; @@ -9240,6 +9255,12 @@ else return ret; } + public static SWIGTYPE_p_sqlite3 switch_core_db_open_in_memory(string uri) { + global::System.IntPtr cPtr = freeswitchPINVOKE.switch_core_db_open_in_memory(uri); + SWIGTYPE_p_sqlite3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_sqlite3(cPtr, false); + return ret; + } + public static switch_status_t switch_core_db_persistant_execute(SWIGTYPE_p_sqlite3 db, string sql, uint retries) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_db_persistant_execute(SWIGTYPE_p_sqlite3.getCPtr(db), sql, retries); return ret; @@ -10264,6 +10285,11 @@ else return ret; } + public static string switch_core_get_event_channel_key_separator() { + string ret = freeswitchPINVOKE.switch_core_get_event_channel_key_separator(); + return ret; + } + public static switch_status_t switch_loadable_module_init(switch_bool_t autoload) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_init((int)autoload); return ret; @@ -13593,13 +13619,19 @@ else return ret; } + public static string switch_dial_leg_get_var(SWIGTYPE_p_switch_dial_leg_s leg, string key) { + string ret = freeswitchPINVOKE.switch_dial_leg_get_var(SWIGTYPE_p_switch_dial_leg_s.getCPtr(leg), key); + return ret; + } + public static int switch_dial_handle_get_total(SWIGTYPE_p_switch_dial_handle_s handle) { int ret = freeswitchPINVOKE.switch_dial_handle_get_total(SWIGTYPE_p_switch_dial_handle_s.getCPtr(handle)); return ret; } - public static void switch_ivr_orig_and_bridge(SWIGTYPE_p_switch_core_session session, string data, SWIGTYPE_p_switch_dial_handle_s dh) { - freeswitchPINVOKE.switch_ivr_orig_and_bridge(SWIGTYPE_p_switch_core_session.getCPtr(session), data, SWIGTYPE_p_switch_dial_handle_s.getCPtr(dh)); + public static switch_status_t switch_ivr_orig_and_bridge(SWIGTYPE_p_switch_core_session session, string data, SWIGTYPE_p_switch_dial_handle_s dh, SWIGTYPE_p_switch_call_cause_t cause) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_orig_and_bridge(SWIGTYPE_p_switch_core_session.getCPtr(session), data, SWIGTYPE_p_switch_dial_handle_s.getCPtr(dh), SWIGTYPE_p_switch_call_cause_t.getCPtr(cause)); + return ret; } public static switch_status_t switch_ivr_play_and_collect_input(SWIGTYPE_p_switch_core_session session, string prompt, string recognizer_mod_name, string recognizer_grammar, int min_digits, int max_digits, string terminators, uint digit_timeout, SWIGTYPE_p_p_cJSON recognition_result, ref string digits_collected, string terminator_collected, switch_input_args_t args) { @@ -14158,23 +14190,23 @@ else return ret; } - public static string switch_xml_toxml(switch_xml xml, switch_bool_t prn_header) { - string ret = freeswitchPINVOKE.switch_xml_toxml(switch_xml.getCPtr(xml), (int)prn_header); + public static string switch_xml_toxml_ex(switch_xml xml, switch_bool_t prn_header, switch_bool_t use_utf8_encoding) { + string ret = freeswitchPINVOKE.switch_xml_toxml_ex(switch_xml.getCPtr(xml), (int)prn_header, (int)use_utf8_encoding); return ret; } - public static string switch_xml_toxml_nolock(switch_xml xml, switch_bool_t prn_header) { - string ret = freeswitchPINVOKE.switch_xml_toxml_nolock(switch_xml.getCPtr(xml), (int)prn_header); + public static string switch_xml_toxml_nolock_ex(switch_xml xml, switch_bool_t prn_header, switch_bool_t use_utf8_encoding) { + string ret = freeswitchPINVOKE.switch_xml_toxml_nolock_ex(switch_xml.getCPtr(xml), (int)prn_header, (int)use_utf8_encoding); return ret; } - public static string switch_xml_tohtml(switch_xml xml, switch_bool_t prn_header) { - string ret = freeswitchPINVOKE.switch_xml_tohtml(switch_xml.getCPtr(xml), (int)prn_header); + public static string switch_xml_tohtml_ex(switch_xml xml, switch_bool_t prn_header, switch_bool_t use_utf8_encoding) { + string ret = freeswitchPINVOKE.switch_xml_tohtml_ex(switch_xml.getCPtr(xml), (int)prn_header, (int)use_utf8_encoding); return ret; } - public static string switch_xml_toxml_buf(switch_xml xml, string buf, SWIGTYPE_p_switch_size_t buflen, SWIGTYPE_p_switch_size_t offset, switch_bool_t prn_header) { - string ret = freeswitchPINVOKE.switch_xml_toxml_buf(switch_xml.getCPtr(xml), buf, SWIGTYPE_p_switch_size_t.getCPtr(buflen), SWIGTYPE_p_switch_size_t.getCPtr(offset), (int)prn_header); + public static string switch_xml_toxml_buf_ex(switch_xml xml, string buf, SWIGTYPE_p_switch_size_t buflen, SWIGTYPE_p_switch_size_t offset, switch_bool_t prn_header, switch_bool_t use_utf8_encoding) { + string ret = freeswitchPINVOKE.switch_xml_toxml_buf_ex(switch_xml.getCPtr(xml), buf, SWIGTYPE_p_switch_size_t.getCPtr(buflen), SWIGTYPE_p_switch_size_t.getCPtr(offset), (int)prn_header, (int)use_utf8_encoding); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -14922,7 +14954,7 @@ else // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -17323,12 +17355,33 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_SWITCH_CRYPTO_MKI_MAX_get___")] public static extern int SWITCH_CRYPTO_MKI_MAX_get(); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_coredb_handle_in_memory_set___")] + public static extern void switch_coredb_handle_in_memory_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_coredb_handle_in_memory_get___")] + public static extern int switch_coredb_handle_in_memory_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_coredb_handle_handle_set___")] + public static extern void switch_coredb_handle_handle_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_coredb_handle_handle_get___")] + public static extern global::System.IntPtr switch_coredb_handle_handle_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_new_switch_coredb_handle___")] + public static extern global::System.IntPtr new_switch_coredb_handle(); + + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_delete_switch_coredb_handle___")] + public static extern void delete_switch_coredb_handle(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_db_close___")] public static extern int switch_core_db_close(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_db_open___")] public static extern int switch_core_db_open(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_db_open_v2___")] + public static extern int switch_core_db_open_v2(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_db_column_text___")] public static extern global::System.IntPtr switch_core_db_column_text(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); @@ -17662,11 +17715,11 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_device_node_t_xml_cdr_get___")] public static extern global::System.IntPtr switch_device_node_t_xml_cdr_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_device_node_t__event_set___")] - public static extern void switch_device_node_t__event_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_device_node_t_event__set___")] + public static extern void switch_device_node_t_event__set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_device_node_t__event_get___")] - public static extern global::System.IntPtr switch_device_node_t__event_get(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_device_node_t_event__get___")] + public static extern global::System.IntPtr switch_device_node_t_event__get(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_device_node_t_callstate_set___")] public static extern void switch_device_node_t_callstate_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); @@ -18391,6 +18444,9 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_memory_pool_tag___")] public static extern void switch_core_memory_pool_tag(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_pool_stats___")] + public static extern void switch_core_pool_stats(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_perform_new_memory_pool___")] public static extern int switch_core_perform_new_memory_pool(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, int jarg4); @@ -18769,6 +18825,9 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_hash_destroy___")] public static extern int switch_core_hash_destroy(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_hash_insert_auto_free___")] + public static extern int switch_core_hash_insert_auto_free(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_hash_insert_destructor___")] public static extern int switch_core_hash_insert_destructor(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4); @@ -18949,6 +19008,9 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_db_open_file___")] public static extern global::System.IntPtr switch_core_db_open_file(string jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_db_open_in_memory___")] + public static extern global::System.IntPtr switch_core_db_open_in_memory(string jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_db_persistant_execute___")] public static extern int switch_core_db_persistant_execute(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, uint jarg3); @@ -19330,6 +19392,12 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_core_db_options_t_db_path_get___")] public static extern string switch_cache_db_core_db_options_t_db_path_get(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_core_db_options_t_in_memory_set___")] + public static extern void switch_cache_db_core_db_options_t_in_memory_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_cache_db_core_db_options_t_in_memory_get___")] + public static extern int switch_cache_db_core_db_options_t_in_memory_get(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_new_switch_cache_db_core_db_options_t___")] public static extern global::System.IntPtr new_switch_cache_db_core_db_options_t(); @@ -19696,6 +19764,9 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_session_start_text_thread___")] public static extern int switch_core_session_start_text_thread(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_get_event_channel_key_separator___")] + public static extern string switch_core_get_event_channel_key_separator(); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_loadable_module_interface_module_name_set___")] public static extern void switch_loadable_module_interface_module_name_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); @@ -22102,11 +22173,11 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_file_handle_max_samples_get___")] public static extern int switch_file_handle_max_samples_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_file_handle__params_set___")] - public static extern void switch_file_handle__params_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_file_handle_params__set___")] + public static extern void switch_file_handle_params__set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_file_handle__params_get___")] - public static extern global::System.IntPtr switch_file_handle__params_get(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_file_handle_params__get___")] + public static extern global::System.IntPtr switch_file_handle_params__get(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_file_handle_cur_channels_set___")] public static extern void switch_file_handle_cur_channels_set(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); @@ -25591,11 +25662,14 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_leg_get_vars___")] public static extern global::System.IntPtr switch_dial_leg_get_vars(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_leg_get_var___")] + public static extern string switch_dial_leg_get_var(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_dial_handle_get_total___")] public static extern int switch_dial_handle_get_total(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_ivr_orig_and_bridge___")] - public static extern void switch_ivr_orig_and_bridge(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + public static extern int switch_ivr_orig_and_bridge(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4); [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_ivr_play_and_collect_input___")] public static extern int switch_ivr_play_and_collect_input(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, string jarg4, int jarg5, int jarg6, string jarg7, uint jarg8, global::System.Runtime.InteropServices.HandleRef jarg9, ref string jarg10, string jarg11, global::System.Runtime.InteropServices.HandleRef jarg12); @@ -26425,17 +26499,17 @@ class freeswitchPINVOKE { [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_get___")] public static extern global::System.IntPtr switch_xml_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_toxml___")] - public static extern string switch_xml_toxml(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_toxml_ex___")] + public static extern string switch_xml_toxml_ex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3); - [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_toxml_nolock___")] - public static extern string switch_xml_toxml_nolock(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_toxml_nolock_ex___")] + public static extern string switch_xml_toxml_nolock_ex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3); - [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_tohtml___")] - public static extern string switch_xml_tohtml(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_tohtml_ex___")] + public static extern string switch_xml_tohtml_ex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3); - [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_toxml_buf___")] - public static extern string switch_xml_toxml_buf(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4, int jarg5); + [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_toxml_buf_ex___")] + public static extern string switch_xml_toxml_buf_ex(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4, int jarg5, int jarg6); [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_xml_free___")] public static extern void switch_xml_free(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -27616,7 +27690,7 @@ class freeswitchPINVOKE { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -27774,7 +27848,7 @@ public class icand_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -27792,7 +27866,7 @@ public enum ice_proto_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -27914,7 +27988,7 @@ public class ice_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28005,7 +28079,7 @@ public class input_callback_state_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28075,7 +28149,7 @@ public class ip_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28364,7 +28438,7 @@ public class payload_map_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28443,7 +28517,7 @@ public class profile_node_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28468,7 +28542,7 @@ public enum rtcp_psfb_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28499,7 +28573,7 @@ public enum rtcp_pt_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28522,7 +28596,7 @@ public enum rtcp_rtpfb_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28549,7 +28623,7 @@ public enum rtcp_sdes_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28568,7 +28642,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28598,7 +28672,7 @@ public enum switch_abc_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28741,7 +28815,7 @@ public class switch_api_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28832,7 +28906,7 @@ public class switch_app_log : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -28855,7 +28929,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -29018,7 +29092,7 @@ public class switch_application_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -29040,7 +29114,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -29246,7 +29320,7 @@ public class switch_asr_handle : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -29556,7 +29630,7 @@ public class switch_asr_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -29614,7 +29688,7 @@ public class switch_audio_codec_settings : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -29643,7 +29717,7 @@ public enum switch_audio_col_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -29783,7 +29857,7 @@ public class switch_audio_resampler_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -29807,7 +29881,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -29825,7 +29899,7 @@ public enum switch_bitpack_mode_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30005,7 +30079,7 @@ public class switch_bitpack_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30023,7 +30097,7 @@ public enum switch_bool_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30104,7 +30178,7 @@ public class switch_cache_db_connection_options_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30152,6 +30226,16 @@ public class switch_cache_db_core_db_options_t : global::System.IDisposable { } } + public switch_bool_t in_memory { + set { + freeswitchPINVOKE.switch_cache_db_core_db_options_t_in_memory_set(swigCPtr, (int)value); + } + get { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_cache_db_core_db_options_t_in_memory_get(swigCPtr); + return ret; + } + } + public switch_cache_db_core_db_options_t() : this(freeswitchPINVOKE.new_switch_cache_db_core_db_options_t(), true) { } @@ -30162,7 +30246,7 @@ public class switch_cache_db_core_db_options_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30261,7 +30345,7 @@ public class switch_cache_db_database_interface_options_t : global::System.IDisp // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30280,7 +30364,7 @@ public enum switch_cache_db_handle_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30318,13 +30402,13 @@ public class switch_cache_db_native_handle_t : global::System.IDisposable { } } - public SWIGTYPE_p_sqlite3 core_db_dbh { + public switch_coredb_handle core_db_dbh { set { - freeswitchPINVOKE.switch_cache_db_native_handle_t_core_db_dbh_set(swigCPtr, SWIGTYPE_p_sqlite3.getCPtr(value)); + freeswitchPINVOKE.switch_cache_db_native_handle_t_core_db_dbh_set(swigCPtr, switch_coredb_handle.getCPtr(value)); } get { global::System.IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_native_handle_t_core_db_dbh_get(swigCPtr); - SWIGTYPE_p_sqlite3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_sqlite3(cPtr, false); + switch_coredb_handle ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_coredb_handle(cPtr, false); return ret; } } @@ -30361,7 +30445,7 @@ public class switch_cache_db_native_handle_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30439,7 +30523,7 @@ public class switch_cache_db_odbc_options_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30531,7 +30615,7 @@ public enum switch_call_cause_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30549,7 +30633,7 @@ public enum switch_call_direction_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30639,7 +30723,7 @@ public class switch_caller_application : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -30762,7 +30846,7 @@ public class switch_caller_extension : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31240,7 +31324,7 @@ public class switch_caller_profile : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31262,7 +31346,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31284,7 +31368,7 @@ public enum switch_channel_app_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31309,7 +31393,7 @@ public enum switch_channel_callstate_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31335,7 +31419,7 @@ public enum switch_channel_cap_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31519,7 +31603,7 @@ public enum switch_channel_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31549,7 +31633,7 @@ public enum switch_channel_state_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31740,7 +31824,7 @@ public class switch_channel_timetable : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31757,7 +31841,7 @@ public enum switch_chat_application_flag_enum_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -31920,7 +32004,7 @@ public class switch_chat_application_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32043,7 +32127,7 @@ public class switch_chat_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32219,7 +32303,7 @@ public class switch_codec : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32242,7 +32326,7 @@ public enum switch_codec_control_command_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32261,7 +32345,7 @@ public enum switch_codec_control_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32289,7 +32373,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32388,7 +32472,7 @@ public class switch_codec_fmtp : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32684,7 +32768,7 @@ public class switch_codec_implementation : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32838,7 +32922,7 @@ public class switch_codec_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32908,7 +32992,7 @@ public class switch_codec_settings : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -32928,7 +33012,7 @@ public enum switch_codec_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33067,7 +33151,7 @@ public class switch_config : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33157,7 +33241,7 @@ public class switch_console_callback_match : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33226,7 +33310,7 @@ public class switch_console_callback_match_node : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33263,7 +33347,10 @@ namespace FreeSWITCH.Native { SCF_SESSION_THREAD_POOL = (1 << 23), SCF_DIALPLAN_TIMESTAMPS = (1 << 24), SCF_CPF_SOFT_PREFIX = (1 << 25), - SCF_CPF_SOFT_LOOKUP = (1 << 26) + SCF_CPF_SOFT_LOOKUP = (1 << 26), + SCF_EVENT_CHANNEL_ENABLE_HIERARCHY_DELIVERY = (1 << 27), + SCF_EVENT_CHANNEL_HIERARCHY_DELIVERY_ONCE = (1 << 28), + SCF_EVENT_CHANNEL_LOG_UNDELIVERABLE_JSON = (1 << 29) } } @@ -33271,7 +33358,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33291,7 +33378,7 @@ public enum switch_core_media_ice_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33532,7 +33619,7 @@ public class switch_core_session_message : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33551,7 +33638,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33627,7 +33714,7 @@ public enum switch_core_session_message_types_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33729,7 +33816,7 @@ public class switch_core_thread_session : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33847,7 +33934,76 @@ public class switch_core_time_duration : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 +// +// 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_coredb_handle : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_coredb_handle(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_coredb_handle obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_coredb_handle() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_coredb_handle(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + global::System.GC.SuppressFinalize(this); + } + } + + public switch_bool_t in_memory { + set { + freeswitchPINVOKE.switch_coredb_handle_in_memory_set(swigCPtr, (int)value); + } + get { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_coredb_handle_in_memory_get(swigCPtr); + return ret; + } + } + + public SWIGTYPE_p_sqlite3 handle { + set { + freeswitchPINVOKE.switch_coredb_handle_handle_set(swigCPtr, SWIGTYPE_p_sqlite3.getCPtr(value)); + } + get { + global::System.IntPtr cPtr = freeswitchPINVOKE.switch_coredb_handle_handle_get(swigCPtr); + SWIGTYPE_p_sqlite3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_sqlite3(cPtr, false); + return ret; + } + } + + public switch_coredb_handle() : this(freeswitchPINVOKE.new_switch_coredb_handle(), true) { + } + +} + +} +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -33915,7 +34071,7 @@ public class switch_cputime : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -34035,7 +34191,7 @@ public class switch_crypto_key_material_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -34052,7 +34208,7 @@ public enum switch_database_flag_enum_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -34293,7 +34449,7 @@ public class switch_database_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -34363,7 +34519,7 @@ public class switch_database_interface_handle : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -34422,12 +34578,12 @@ public class switch_device_node_t : global::System.IDisposable { } } - public switch_event _event { + public switch_event event_ { set { - freeswitchPINVOKE.switch_device_node_t__event_set(swigCPtr, switch_event.getCPtr(value)); + freeswitchPINVOKE.switch_device_node_t_event__set(swigCPtr, switch_event.getCPtr(value)); } get { - global::System.IntPtr cPtr = freeswitchPINVOKE.switch_device_node_t__event_get(swigCPtr); + global::System.IntPtr cPtr = freeswitchPINVOKE.switch_device_node_t_event__get(swigCPtr); switch_event ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_event(cPtr, false); return ret; } @@ -34507,7 +34663,7 @@ public class switch_device_node_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -34778,7 +34934,7 @@ public class switch_device_record_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -34801,7 +34957,7 @@ public enum switch_device_state_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35099,7 +35255,7 @@ public class switch_device_stats_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35222,7 +35378,7 @@ public class switch_dialplan_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35241,7 +35397,7 @@ public enum switch_digit_action_target_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35489,7 +35645,7 @@ public class switch_directories : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35506,7 +35662,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35597,7 +35753,7 @@ public class switch_directory_handle : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35764,7 +35920,7 @@ public class switch_directory_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35782,7 +35938,7 @@ public enum switch_dtmf_direction_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35803,7 +35959,7 @@ public enum switch_dtmf_source_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35891,7 +36047,7 @@ public class switch_dtmf_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -35916,7 +36072,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -36072,7 +36228,7 @@ public class switch_endpoint_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -36171,7 +36327,7 @@ public class switch_error_period_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -36344,7 +36500,7 @@ public class switch_event : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -36363,7 +36519,7 @@ public enum switch_event_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -36471,7 +36627,7 @@ public class switch_event_header : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -36570,6 +36726,7 @@ public enum switch_event_types_t { SWITCH_EVENT_CALL_DETAIL, SWITCH_EVENT_DEVICE_STATE, SWITCH_EVENT_TEXT, + SWITCH_EVENT_SHUTDOWN_REQUESTED, SWITCH_EVENT_ALL } @@ -36578,7 +36735,7 @@ public enum switch_event_types_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -36598,7 +36755,7 @@ public enum switch_file_command_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -36627,7 +36784,8 @@ namespace FreeSWITCH.Native { SWITCH_FILE_NOMUX = (1 << 17), SWITCH_FILE_BREAK_ON_CHANGE = (1 << 18), SWITCH_FILE_FLAG_VIDEO = (1 << 19), - SWITCH_FILE_FLAG_VIDEO_EOF = (1 << 20) + SWITCH_FILE_FLAG_VIDEO_EOF = (1 << 20), + SWITCH_FILE_PRE_CLOSED = (1 << 21) } } @@ -36635,7 +36793,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -37104,12 +37262,12 @@ public class switch_file_handle : global::System.IDisposable { } } - public switch_event _params { + public switch_event params_ { set { - freeswitchPINVOKE.switch_file_handle__params_set(swigCPtr, switch_event.getCPtr(value)); + freeswitchPINVOKE.switch_file_handle_params__set(swigCPtr, switch_event.getCPtr(value)); } get { - global::System.IntPtr cPtr = freeswitchPINVOKE.switch_file_handle__params_get(swigCPtr); + global::System.IntPtr cPtr = freeswitchPINVOKE.switch_file_handle_params__get(swigCPtr); switch_event ret = (cPtr == global::System.IntPtr.Zero) ? null : new switch_event(cPtr, false); return ret; } @@ -37230,7 +37388,7 @@ public class switch_file_handle : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -37483,7 +37641,7 @@ public class switch_file_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -37541,7 +37699,7 @@ public class switch_filenames : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -37619,7 +37777,7 @@ public class switch_fps_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -37885,7 +38043,7 @@ public class switch_frame : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -37923,7 +38081,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38041,7 +38199,7 @@ public class switch_frame_geometry_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38134,7 +38292,7 @@ public class switch_hold_record_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38382,7 +38540,7 @@ public class switch_http_request_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38401,7 +38559,7 @@ public enum switch_hup_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38524,7 +38682,7 @@ public class switch_input_args_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38542,7 +38700,7 @@ public enum switch_input_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38612,7 +38770,7 @@ public class switch_io_event_hook_kill_channel : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38682,7 +38840,7 @@ public class switch_io_event_hook_outgoing_channel : global::System.IDisposable // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38752,7 +38910,7 @@ public class switch_io_event_hook_read_frame : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38822,7 +38980,7 @@ public class switch_io_event_hook_receive_event : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38892,7 +39050,7 @@ public class switch_io_event_hook_receive_message : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -38962,7 +39120,7 @@ public class switch_io_event_hook_recv_dtmf : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39032,7 +39190,7 @@ public class switch_io_event_hook_send_dtmf : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39102,7 +39260,7 @@ public class switch_io_event_hook_state_change : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39172,7 +39330,7 @@ public class switch_io_event_hook_state_run : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39242,7 +39400,7 @@ public class switch_io_event_hook_text_read_frame : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39312,7 +39470,7 @@ public class switch_io_event_hook_text_write_frame : global::System.IDisposable // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39382,7 +39540,7 @@ public class switch_io_event_hook_video_read_frame : global::System.IDisposable // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39452,7 +39610,7 @@ public class switch_io_event_hook_video_write_frame : global::System.IDisposable // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39522,7 +39680,7 @@ public class switch_io_event_hook_write_frame : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39724,7 +39882,7 @@ public class switch_io_event_hooks : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39745,7 +39903,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39774,7 +39932,7 @@ public enum switch_io_routine_name_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -39987,7 +40145,7 @@ public class switch_io_routines : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40005,7 +40163,7 @@ public enum switch_io_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40028,7 +40186,7 @@ public enum switch_ivr_action_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40128,7 +40286,7 @@ public class switch_ivr_dmachine_match : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40147,7 +40305,7 @@ public enum switch_ivr_menu_flags { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40166,7 +40324,7 @@ public enum switch_ivr_option_enum_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40309,7 +40467,7 @@ public class switch_json_api_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40487,7 +40645,7 @@ public class switch_limit_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40588,7 +40746,7 @@ public class switch_loadable_module_function_table_t : global::System.IDisposabl // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40865,7 +41023,7 @@ public class switch_loadable_module_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40884,7 +41042,7 @@ public enum switch_loadable_module_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -40952,7 +41110,7 @@ public class switch_log_json_format_item_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41152,7 +41310,7 @@ public class switch_log_json_format_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41188,7 +41346,7 @@ public enum switch_log_level_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41349,7 +41507,7 @@ public class switch_log_node_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41368,7 +41526,7 @@ public enum switch_management_action_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41491,7 +41649,7 @@ public class switch_management_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41526,7 +41684,8 @@ namespace FreeSWITCH.Native { SMBF_SPY_VIDEO_STREAM = (1 << 22), SMBF_SPY_VIDEO_STREAM_BLEG = (1 << 23), SMBF_READ_VIDEO_PATCH = (1 << 24), - SMBF_READ_TEXT_STREAM = (1 << 25) + SMBF_READ_TEXT_STREAM = (1 << 25), + SMBF_FIRST = (1 << 26) } } @@ -41534,7 +41693,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41562,7 +41721,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41583,7 +41742,7 @@ public enum switch_media_flow_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41602,7 +41761,7 @@ public enum switch_media_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41842,7 +42001,7 @@ public class switch_mm_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41860,7 +42019,7 @@ public enum switch_module_flag_enum_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41893,7 +42052,7 @@ public enum switch_module_interface_name_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -41982,7 +42141,7 @@ public class switch_network_port_range : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42006,7 +42165,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42096,7 +42255,7 @@ public class switch_picture : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42120,7 +42279,7 @@ public enum switch_poll_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42141,7 +42300,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42160,7 +42319,7 @@ public enum switch_priority_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42178,7 +42337,7 @@ public enum switch_pvt_class_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42197,7 +42356,7 @@ public enum switch_ring_ready_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42295,7 +42454,7 @@ public class switch_rtcp_hdr_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42563,7 +42722,7 @@ public class switch_rtcp_numbers_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42661,7 +42820,7 @@ public class switch_rtcp_video_counters_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42731,7 +42890,7 @@ public class switch_rtcp_video_stats_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42761,7 +42920,7 @@ public enum switch_rtp_bug_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42782,7 +42941,7 @@ public enum switch_rtp_crypto_direction_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42884,7 +43043,7 @@ public class switch_rtp_crypto_key : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42902,7 +43061,7 @@ public enum switch_rtp_crypto_key_param_method_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42928,7 +43087,7 @@ public enum switch_rtp_crypto_key_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -42996,7 +43155,7 @@ public enum switch_rtp_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -43015,7 +43174,7 @@ public enum switch_rtp_flush_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -43083,7 +43242,7 @@ public class switch_rtp_hdr_ext_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -43221,7 +43380,7 @@ public class switch_rtp_hdr_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -43607,7 +43766,7 @@ public class switch_rtp_numbers_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -43697,7 +43856,7 @@ public class switch_rtp_packet_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -43788,7 +43947,7 @@ public class switch_rtp_stats_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -43806,7 +43965,7 @@ public enum switch_rw_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -43894,7 +44053,7 @@ public class switch_say_args_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -43914,7 +44073,7 @@ public enum switch_say_gender_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44048,7 +44207,7 @@ public class switch_say_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44069,7 +44228,7 @@ public enum switch_say_method_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44104,7 +44263,7 @@ public enum switch_say_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44124,7 +44283,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44253,7 +44412,7 @@ public class switch_scheduler_task : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44271,7 +44430,7 @@ public enum switch_sdp_type_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44423,7 +44582,7 @@ public class switch_secure_settings_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44491,7 +44650,7 @@ public class switch_serial_event_header_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44599,7 +44758,7 @@ public class switch_serial_event_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44658,7 +44817,7 @@ public enum switch_session_ctl_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44678,7 +44837,7 @@ public enum switch_signal_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44769,7 +44928,7 @@ public class switch_slin_data : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -44793,7 +44952,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -45039,7 +45198,7 @@ public class switch_speech_handle : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -45239,7 +45398,7 @@ public class switch_speech_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -45337,7 +45496,7 @@ public class switch_srtp_crypto_suite_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -45358,7 +45517,7 @@ public enum switch_stack_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -45376,7 +45535,7 @@ public enum switch_state_handler_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -45404,7 +45563,7 @@ public enum switch_state_handler_name_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -45605,7 +45764,7 @@ public class switch_state_handler_table : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -45647,7 +45806,7 @@ public enum switch_status_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -45809,7 +45968,7 @@ public class switch_stream_handle : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46007,7 +46166,7 @@ public class switch_t38_options_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46027,7 +46186,7 @@ public enum switch_text_channel_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46119,7 +46278,7 @@ public class switch_thread_data_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46139,7 +46298,7 @@ public enum switch_thread_priority_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46304,7 +46463,7 @@ public class switch_timer : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46321,7 +46480,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46343,7 +46502,7 @@ public enum switch_timer_func_name_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46521,7 +46680,7 @@ public class switch_timer_interface : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46748,7 +46907,7 @@ public class switch_unicast_conninfo : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46768,7 +46927,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46787,7 +46946,7 @@ public enum switch_uri_flags { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46807,7 +46966,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46828,7 +46987,7 @@ public enum switch_vad_state_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46926,7 +47085,7 @@ public class switch_vid_params_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -46945,7 +47104,7 @@ public enum switch_vid_spy_fmt_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -47053,7 +47212,7 @@ public class switch_video_codec_settings : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -47073,7 +47232,7 @@ public enum switch_video_encode_speed_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -47092,7 +47251,7 @@ public enum switch_video_profile_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -47111,7 +47270,7 @@ public enum switch_video_read_flag_t { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -47189,7 +47348,7 @@ public class switch_waitlist_t : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -47373,7 +47532,7 @@ public class switch_xml : global::System.IDisposable { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. @@ -47385,7 +47544,8 @@ namespace FreeSWITCH.Native { SWITCH_XML_ROOT = (1 << 0), SWITCH_XML_NAMEM = (1 << 1), SWITCH_XML_TXTM = (1 << 2), - SWITCH_XML_DUP = (1 << 3) + SWITCH_XML_DUP = (1 << 3), + SWITCH_XML_CDATA = (1 << 4) } } @@ -47393,7 +47553,7 @@ namespace FreeSWITCH.Native { // // // This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.10 +// Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. diff --git a/src/mod/say/mod_say_fr/mod_say_fr.c b/src/mod/say/mod_say_fr/mod_say_fr.c index ba34647c85..5e96417827 100644 --- a/src/mod/say/mod_say_fr/mod_say_fr.c +++ b/src/mod/say/mod_say_fr/mod_say_fr.c @@ -119,7 +119,7 @@ static switch_status_t play_group(switch_say_method_t method, switch_say_gender_ } } - if (c || ((ftdNumber == 1 && (a || b || c)) && (a && (b || c)))) { + if (c || ((ftdNumber == 1 && (a || b || c)) && (a && (b || c))) || (a == 0 && b == 1 && c == 0) ) { /*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "a=%d b=[%d] c=%d\n",a, b,c);*/ int fVal = c; if (ftdNumber == 1) diff --git a/src/switch.c b/src/switch.c index 6a56fd90c5..22f780db63 100644 --- a/src/switch.c +++ b/src/switch.c @@ -84,7 +84,7 @@ static HANDLE shutdown_event; static void handle_SIGILL(int sig) { int32_t arg = 0; - if (sig) {}; + if (sig) {} /* send shutdown signal to the freeswitch core */ switch_core_session_ctl(SCSC_SHUTDOWN, &arg); return; @@ -93,7 +93,7 @@ static void handle_SIGILL(int sig) static void handle_SIGTERM(int sig) { int32_t arg = 0; - if (sig) {}; + if (sig) {} /* send shutdown signal to the freeswitch core */ switch_core_session_ctl(SCSC_SHUTDOWN_ELEGANT, &arg); return; diff --git a/src/switch_core.c b/src/switch_core.c index 359265c02f..d3150835c0 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -2369,6 +2369,20 @@ static void switch_load_core_config(const char *file) } else { switch_clear_flag((&runtime), SCF_EVENT_CHANNEL_ENABLE_HIERARCHY_DELIVERY); } + } else if (!strcasecmp(var, "event-channel-hierarchy-deliver-once") && !zstr(val)) { + int v = switch_true(val); + if (v) { + switch_set_flag((&runtime), SCF_EVENT_CHANNEL_HIERARCHY_DELIVERY_ONCE); + } else { + switch_clear_flag((&runtime), SCF_EVENT_CHANNEL_HIERARCHY_DELIVERY_ONCE); + } + } else if (!strcasecmp(var, "event-channel-log-undeliverable-json") && !zstr(val)) { + int v = switch_true(val); + if (v) { + switch_set_flag((&runtime), SCF_EVENT_CHANNEL_LOG_UNDELIVERABLE_JSON); + } else { + switch_clear_flag((&runtime), SCF_EVENT_CHANNEL_LOG_UNDELIVERABLE_JSON); + } } } } @@ -2795,7 +2809,11 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void * { int x = 19; uint32_t count; - + switch_event_t *shutdown_requested_event = NULL; + if (switch_event_create(&shutdown_requested_event, SWITCH_EVENT_SHUTDOWN_REQUESTED) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header(shutdown_requested_event, SWITCH_STACK_BOTTOM, "Event-Info", "%s", cmd == SCSC_SHUTDOWN_ASAP ? "ASAP" : "elegant"); + switch_event_fire(&shutdown_requested_event); + } switch_set_flag((&runtime), SCF_SHUTDOWN_REQUESTED); if (cmd == SCSC_SHUTDOWN_ASAP) { switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS); diff --git a/src/switch_core_cert.c b/src/switch_core_cert.c index 5bcc046fe4..0cc992b9ed 100644 --- a/src/switch_core_cert.c +++ b/src/switch_core_cert.c @@ -91,6 +91,10 @@ SWITCH_DECLARE(void) switch_ssl_destroy_ssl_locks(void) OPENSSL_free(ssl_mutexes); ssl_count--; } + + if (ssl_pool) { + switch_core_destroy_memory_pool(&ssl_pool); + } } static const EVP_MD *get_evp_by_name(const char *name) diff --git a/src/switch_core_db.c b/src/switch_core_db.c index 5c9efae882..d3701ce91f 100644 --- a/src/switch_core_db.c +++ b/src/switch_core_db.c @@ -50,6 +50,11 @@ SWITCH_DECLARE(int) switch_core_db_open(const char *filename, switch_core_db_t * return sqlite3_open(filename, ppDb); } +SWITCH_DECLARE(int) switch_core_db_open_v2(const char *filename, switch_core_db_t **ppDb) +{ + return sqlite3_open_v2(filename, ppDb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_URI, NULL); +} + SWITCH_DECLARE(int) switch_core_db_close(switch_core_db_t *db) { return sqlite3_close(db); @@ -57,15 +62,7 @@ SWITCH_DECLARE(int) switch_core_db_close(switch_core_db_t *db) SWITCH_DECLARE(const unsigned char *) switch_core_db_column_text(switch_core_db_stmt_t *stmt, int iCol) { - const unsigned char *txt = sqlite3_column_text(stmt, iCol); - - if (!strcasecmp((char *) stmt, "(null)")) { - memset(stmt, 0, 1); - txt = NULL; - } - - return txt; - + return sqlite3_column_text(stmt, iCol); } SWITCH_DECLARE(const char *) switch_core_db_column_name(switch_core_db_stmt_t *stmt, int N) @@ -92,6 +89,7 @@ SWITCH_DECLARE(int) switch_core_db_exec(switch_core_db_t *db, const char *sql, s while (--sane > 0) { ret = sqlite3_exec(db, sql, callback, data, &err); if (ret == SQLITE_BUSY || ret == SQLITE_LOCKED) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "SQLite is %s, sane=%d [%s]\n", (ret == SQLITE_BUSY ? "BUSY" : "LOCKED"), sane, sql); if (sane > 1) { switch_core_db_free(err); switch_yield(100000); @@ -195,6 +193,35 @@ SWITCH_DECLARE(int) switch_core_db_load_extension(switch_core_db_t *db, const ch return ret; } +static int switch_core_db_connection_setup(switch_core_db_t *db, switch_bool_t in_memory) { + int db_ret; + + if ((db_ret = switch_core_db_exec(db, "PRAGMA synchronous=OFF;", NULL, NULL, NULL)) != SQLITE_OK) { + goto end; + } + if ((db_ret = switch_core_db_exec(db, "PRAGMA count_changes=OFF;", NULL, NULL, NULL)) != SQLITE_OK) { + goto end; + } + if ((db_ret = switch_core_db_exec(db, "PRAGMA temp_store=MEMORY;", NULL, NULL, NULL)) != SQLITE_OK) { + goto end; + } + if (!in_memory) { + if ((db_ret = switch_core_db_exec(db, "PRAGMA cache_size=8000;", NULL, NULL, NULL)) != SQLITE_OK) { + goto end; + } + } else { + if ((db_ret = switch_core_db_exec(db, "PRAGMA cache_size=-8192;", NULL, NULL, NULL)) != SQLITE_OK) { + goto end; + } + if ((db_ret = switch_core_db_exec(db, "PRAGMA journal_mode=OFF;", NULL, NULL, NULL)) != SQLITE_OK) { + goto end; + } + } + +end: + return db_ret; +} + SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(const char *filename) { switch_core_db_t *db; @@ -205,16 +232,28 @@ SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(const char *filename if ((db_ret = switch_core_db_open(path, &db)) != SQLITE_OK) { goto end; } - if ((db_ret = switch_core_db_exec(db, "PRAGMA synchronous=OFF;", NULL, NULL, NULL)) != SQLITE_OK) { + if ((db_ret = switch_core_db_connection_setup(db, SWITCH_FALSE)) != SQLITE_OK) { goto end; } - if ((db_ret = switch_core_db_exec(db, "PRAGMA count_changes=OFF;", NULL, NULL, NULL)) != SQLITE_OK) { + +end: + if (db_ret != SQLITE_OK) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR [%s]\n", switch_core_db_errmsg(db)); + switch_core_db_close(db); + db = NULL; + } + return db; +} + +SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_in_memory(const char *uri) +{ + switch_core_db_t *db; + int db_ret; + + if ((db_ret = switch_core_db_open_v2(uri, &db)) != SQLITE_OK) { goto end; } - if ((db_ret = switch_core_db_exec(db, "PRAGMA cache_size=8000;", NULL, NULL, NULL)) != SQLITE_OK) { - goto end; - } - if ((db_ret = switch_core_db_exec(db, "PRAGMA temp_store=MEMORY;", NULL, NULL, NULL)) != SQLITE_OK) { + if ((db_ret = switch_core_db_connection_setup(db, SWITCH_TRUE)) != SQLITE_OK) { goto end; } diff --git a/src/switch_core_file.c b/src/switch_core_file.c index a009f5b19b..717233ce55 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -915,6 +915,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_pre_close(switch_file_handle_t } switch_clear_flag_locked(fh, SWITCH_FILE_OPEN); + switch_set_flag_locked(fh, SWITCH_FILE_PRE_CLOSED); if (fh->file_interface->file_pre_close) { status = fh->file_interface->file_pre_close(fh); @@ -929,8 +930,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh) if (switch_test_flag(fh, SWITCH_FILE_OPEN)) { status = switch_core_file_pre_close(fh); + } else if (!switch_test_flag(fh, SWITCH_FILE_PRE_CLOSED)) { + return SWITCH_STATUS_FALSE; } + switch_clear_flag_locked(fh, SWITCH_FILE_PRE_CLOSED); + fh->file_interface->file_close(fh); if (fh->params) { diff --git a/src/switch_core_hash.c b/src/switch_core_hash.c index a81747bb9f..1655aac726 100644 --- a/src/switch_core_hash.c +++ b/src/switch_core_hash.c @@ -55,6 +55,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_destroy(switch_hash_t **hash) return SWITCH_STATUS_SUCCESS; } +SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_auto_free(switch_hash_t *hash, const char *key, const void *data) +{ + int r = 0; + + r = switch_hashtable_insert_destructor(hash, strdup(key), (void *)data, HASHTABLE_FLAG_FREE_KEY | HASHTABLE_FLAG_FREE_VALUE | HASHTABLE_DUP_CHECK, NULL); + + return r ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; +} + SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_destructor(switch_hash_t *hash, const char *key, const void *data, hashtable_destructor_t destructor) { int r = 0; diff --git a/src/switch_core_io.c b/src/switch_core_io.c index 8b12efaffb..22d0474e3e 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -1127,6 +1127,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core int i, argc; char *argv[256]; int dur_total = 0; + int rate_mult = 8; + + switch_codec_implementation_t write_impl = { 0 }; switch_assert(session != NULL); @@ -1156,13 +1159,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core switch_channel_pre_answer(session->channel); } + switch_core_session_get_write_impl(session, &write_impl); + + if (write_impl.actual_samples_per_second >= 1000) { + rate_mult = (write_impl.actual_samples_per_second / 1000); + } + for (i = 0; i < argc; i++) { dtmf.duration = switch_core_default_dtmf_duration(0); - dur = switch_core_default_dtmf_duration(0) / 8; + dur = switch_core_default_dtmf_duration(0) / rate_mult; if ((p = strchr(argv[i], '@'))) { *p++ = '\0'; - if ((dur = atoi(p)) > (int)switch_core_min_dtmf_duration(0) / 8) { - dtmf.duration = dur * 8; + if ((dur = atoi(p)) > (int)switch_core_min_dtmf_duration(0) / rate_mult) { + dtmf.duration = dur * rate_mult; } } @@ -1192,14 +1201,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s send dtmf\ndigit=%c ms=%u samples=%u\n", switch_channel_get_name(session->channel), dtmf.digit, dur, dtmf.duration); sent++; - dur_total += dtmf.duration + 2000; /* account for 250ms pause */ + dur_total += dtmf.duration + (250 * rate_mult); /* account for 250ms pause */ } } } if (dur_total) { char tmp[32] = ""; - switch_snprintf(tmp, sizeof(tmp), "%d", dur_total / 8); + switch_snprintf(tmp, sizeof(tmp), "%d", dur_total / rate_mult); switch_channel_set_variable(session->channel, "last_dtmf_duration", tmp); } diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 81a3e8591e..c3a29353ee 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -1802,6 +1802,9 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio return 0; } + if (!crypto) { + return 0; + } engine = &session->media_handle->engines[type]; for (i = 0; smh->crypto_suite_order[i] != CRYPTO_INVALID; i++) { @@ -1826,7 +1829,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio if (engine->ssec[engine->crypto_type].remote_crypto_key && switch_rtp_ready(engine->rtp_session)) { /* Compare all the key. The tag may remain the same even if key changed */ - if (crypto && engine->crypto_type != CRYPTO_INVALID && !strcmp(crypto, engine->ssec[engine->crypto_type].remote_crypto_key)) { + if (engine->crypto_type != CRYPTO_INVALID && !strcmp(crypto, engine->ssec[engine->crypto_type].remote_crypto_key)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Existing key is still valid.\n"); got_crypto = 1; } else { @@ -5216,7 +5219,6 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s switch_channel_get_name(session->channel), switch_channel_get_name(other_channel)); switch_core_session_rwunlock(other_session); - pass = 0; match = 0; fmatch = 0; goto done; @@ -6065,7 +6067,6 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s vmatch = 0; almost_vmatch = 0; - nm_idx = 0; m_idx = 0; memset(matches, 0, sizeof(matches[0]) * MAX_MATCHES); memset(near_matches, 0, sizeof(near_matches[0]) * MAX_MATCHES); @@ -10778,7 +10779,6 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess int cur_ptime = 0, this_ptime = 0, cng_type = 0; const char *mult; - i = 0; if (!switch_media_handle_test_media_flag(smh, SCMF_SUPPRESS_CNG) && smh->mparams->cng_pt && use_cng) { cng_type = smh->mparams->cng_pt; @@ -13529,7 +13529,6 @@ static void switch_core_media_set_r_sdp_codec_string(switch_core_session_t *sess if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND || prefer_sdp) { for (map = m->m_rtpmaps; map; map = map->rm_next) { - match = 0; if (map->rm_pt > 127 || already_did[map->rm_pt]) { continue; @@ -13563,7 +13562,6 @@ static void switch_core_media_set_r_sdp_codec_string(switch_core_session_t *sess continue; } for (map = m->m_rtpmaps; map; map = map->rm_next) { - match = 0; if (map->rm_pt > 127 || already_did[map->rm_pt]) { continue; @@ -13601,7 +13599,6 @@ static void switch_core_media_set_r_sdp_codec_string(switch_core_session_t *sess if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND || prefer_sdp) { for (map = m->m_rtpmaps; map; map = map->rm_next) { - match = 0; if (map->rm_pt > 127 || already_did[map->rm_pt]) { continue; @@ -13646,7 +13643,6 @@ static void switch_core_media_set_r_sdp_codec_string(switch_core_session_t *sess } for (map = m->m_rtpmaps; map; map = map->rm_next) { - match = 0; if (map->rm_pt > 127 || already_did[map->rm_pt]) { continue; @@ -14069,7 +14065,9 @@ SWITCH_DECLARE(void) switch_core_media_init(void) SWITCH_DECLARE(void) switch_core_media_deinit(void) { - switch_core_destroy_memory_pool(&video_globals.pool); + if (video_globals.pool) { + switch_core_destroy_memory_pool(&video_globals.pool); + } } static int payload_number(const char *name) @@ -16080,7 +16078,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess enc_frame->ssrc = frame->ssrc; enc_frame->payload = enc_frame->codec->implementation->ianacode; write_frame = enc_frame; - status = SWITCH_STATUS_SUCCESS; break; case SWITCH_STATUS_NOT_INITALIZED: switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Codec init error!\n"); @@ -16234,7 +16231,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess enc_frame->ssrc = frame->ssrc; enc_frame->payload = enc_frame->codec->implementation->ianacode; write_frame = enc_frame; - status = SWITCH_STATUS_SUCCESS; break; case SWITCH_STATUS_NOT_INITALIZED: switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Codec init error!\n"); diff --git a/src/switch_core_media_bug.c b/src/switch_core_media_bug.c index 727d2bccbe..a229f611e9 100644 --- a/src/switch_core_media_bug.c +++ b/src/switch_core_media_bug.c @@ -974,7 +974,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_add(switch_core_session_t session->bugs = bug; added = 1; } - + + if (!added && switch_test_flag(bug, SMBF_FIRST)) { + bug->next = session->bugs; + session->bugs = bug; + added = 1; + } + for(bp = session->bugs; bp; bp = bp->next) { if (bp->ready && !switch_test_flag(bp, SMBF_TAP_NATIVE_READ) && !switch_test_flag(bp, SMBF_TAP_NATIVE_WRITE)) { tap_only = 0; diff --git a/src/switch_core_memory.c b/src/switch_core_memory.c index 288e96d85b..eb35f1b2ca 100644 --- a/src/switch_core_memory.c +++ b/src/switch_core_memory.c @@ -88,7 +88,11 @@ SWITCH_DECLARE(void *) switch_core_perform_session_alloc(switch_core_session_t * (void *) session->pool, (void *) session, apr_pool_tag(session->pool, NULL), (int) memory); #endif +#if APR_POOL_DEBUG + ptr = apr_palloc_debug(session->pool, memory, func); +#else ptr = apr_palloc(session->pool, memory); +#endif switch_assert(ptr != NULL); memset(ptr, 0, memory); @@ -349,7 +353,39 @@ SWITCH_DECLARE(void) switch_pool_clear(switch_memory_pool_t *p) } +#if APR_POOL_DEBUG +static int switch_core_pool_stats_callback(apr_pool_t *pool, void *data) { + switch_stream_handle_t *stream = (switch_stream_handle_t *)data; + unsigned int size = (unsigned int)apr_pool_num_bytes(pool, 1); + unsigned int alloc = 0, total_alloc = 0, clear = 0; + char *line = NULL; + apr_pool_userdata_get((void**)&line, "line", pool); + apr_pool_get_stats(pool, &alloc, &total_alloc, &clear); + + if (stream) { + stream->write_function(stream, "Pool '%s' size: %d, alloc:%d, total_alloc:%d, clear:%d\n", (line ? line : apr_pool_tag(pool, NULL)), (int)size, alloc, total_alloc, clear); + } else { + printf("Pool '%s' size: %d, alloc:%d, total_alloc:%d, clear:%d\n", (line ? line : apr_pool_tag(pool, NULL)), (int)size, alloc, total_alloc, clear); + } + return 0; +} +#endif + +SWITCH_DECLARE(void) switch_core_pool_stats(switch_stream_handle_t *stream) +{ +#if APR_POOL_DEBUG + if (runtime.memory_pool) { + apr_pool_walk_tree_debug(runtime.memory_pool, switch_core_pool_stats_callback, (void *)stream); + } +#else + if (stream) { + stream->write_function(stream, "Unable to get core pool statictics. Please rebuild FreeSWITCH with --enable-pool-debug"); + } else { + printf("Unable to get core pool statictics. Please rebuild FreeSWITCH with --enable-pool-debug"); + } +#endif +} SWITCH_DECLARE(switch_status_t) switch_core_perform_new_memory_pool(switch_memory_pool_t **pool, const char *file, const char *func, int line) { @@ -382,7 +418,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_new_memory_pool(switch_memor abort(); } +#if APR_POOL_DEBUG + if ((apr_pool_create_ex_debug(pool, memory_manager.memory_pool, NULL, my_allocator, func)) != APR_SUCCESS) { +#else if ((apr_pool_create_ex(pool, NULL, NULL, my_allocator)) != APR_SUCCESS) { +#endif abort(); } @@ -405,6 +445,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_new_memory_pool(switch_memor tmp = switch_core_sprintf(*pool, "%s:%d", file, line); apr_pool_tag(*pool, tmp); +#if APR_POOL_DEBUG + apr_pool_userdata_set(tmp, "line", NULL, *pool); +#endif + #ifdef DEBUG_ALLOC2 switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_CONSOLE, "%p New Pool %s\n", (void *) *pool, apr_pool_tag(*pool, NULL)); #endif @@ -438,7 +482,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_destroy_memory_pool(switch_m #ifdef USE_MEM_LOCK switch_mutex_lock(memory_manager.mem_lock); #endif +#if APR_POOL_DEBUG + apr_pool_destroy_debug(*pool, func); +#else apr_pool_destroy(*pool); +#endif #ifdef USE_MEM_LOCK switch_mutex_unlock(memory_manager.mem_lock); #endif @@ -469,7 +517,11 @@ SWITCH_DECLARE(void *) switch_core_perform_alloc(switch_memory_pool_t *pool, swi /*switch_assert(memory < 20000); */ #endif +#if APR_POOL_DEBUG + ptr = apr_palloc_debug(pool, memory, func); +#else ptr = apr_palloc(pool, memory); +#endif switch_assert(ptr != NULL); memset(ptr, 0, memory); diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 3752a06b23..7f5c2aff52 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -95,6 +95,14 @@ static switch_cache_db_handle_t *create_handle(switch_cache_db_handle_type_t typ return new_dbh; } +static void destroy_handle(switch_cache_db_handle_t **dbh) +{ + if (dbh && *dbh && (*dbh)->pool) { + switch_core_destroy_memory_pool(&(*dbh)->pool); + *dbh = NULL; + } +} + static void add_handle(switch_cache_db_handle_t *dbh, const char *db_str, const char *db_callsite_str, const char *thread_str) { switch_ssize_t hlen = -1; @@ -145,6 +153,8 @@ SWITCH_DECLARE(void) switch_cache_db_database_interface_flush_handles(switch_dat switch_mutex_lock(sql_manager.dbh_mutex); +top: + for (dbh_ptr = sql_manager.handle_pool; dbh_ptr; dbh_ptr = dbh_ptr->next) { if (switch_mutex_trylock(dbh_ptr->mutex) == SWITCH_STATUS_SUCCESS) { if (dbh_ptr->type != SCDB_TYPE_DATABASE_INTERFACE) { @@ -161,7 +171,8 @@ SWITCH_DECLARE(void) switch_cache_db_database_interface_flush_handles(switch_dat del_handle(dbh_ptr); switch_mutex_unlock(dbh_ptr->mutex); - switch_core_destroy_memory_pool(&dbh_ptr->pool); + destroy_handle(&dbh_ptr); + goto top; } } @@ -179,18 +190,27 @@ static switch_cache_db_handle_t *get_handle(const char *db_str, const char *user switch_mutex_lock(sql_manager.dbh_mutex); + /* First loop allows a thread to use a handle multiple times sumiltaneously + but only if that handle is in use by the same thread. In that case use_count will be incremented. + This allows SQLite to read and write within a single thread, giving the same handle for both operations. + */ for (dbh_ptr = sql_manager.handle_pool; dbh_ptr; dbh_ptr = dbh_ptr->next) { - if (dbh_ptr->thread_hash == thread_hash && dbh_ptr->hash == hash && !dbh_ptr->use_count && + if (dbh_ptr->thread_hash == thread_hash && dbh_ptr->hash == hash && !switch_test_flag(dbh_ptr, CDF_PRUNE) && switch_mutex_trylock(dbh_ptr->mutex) == SWITCH_STATUS_SUCCESS) { r = dbh_ptr; + break; } } if (!r) { + /* If a handle idles, take it and associate with the thread. + If a handle is in use, skip and create new one. + */ for (dbh_ptr = sql_manager.handle_pool; dbh_ptr; dbh_ptr = dbh_ptr->next) { - if (dbh_ptr->hash == hash && (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->use_count && !switch_test_flag(dbh_ptr, CDF_PRUNE) && switch_mutex_trylock(dbh_ptr->mutex) == SWITCH_STATUS_SUCCESS) { r = dbh_ptr; + r->thread_hash = thread_hash; break; } } @@ -200,8 +220,6 @@ static switch_cache_db_handle_t *get_handle(const char *db_str, const char *user r->use_count++; r->total_used_count++; sql_manager.total_used_handles++; - r->hash = switch_ci_hashfunc_default(db_str, &hlen); - r->thread_hash = thread_hash; switch_set_string(r->last_user, user_str); } @@ -259,7 +277,7 @@ static void sql_close(time_t prune) diff = (time_t) prune - dbh->last_used; } - if (prune > 0 && (dbh->use_count || (diff < SQL_CACHE_TIMEOUT && !switch_test_flag(dbh, CDF_PRUNE)))) { + if (prune > 0 && (dbh->use_count || switch_test_flag(dbh, CDF_NONEXPIRING) || (diff < SQL_CACHE_TIMEOUT && !switch_test_flag(dbh, CDF_PRUNE)))) { continue; } @@ -280,15 +298,15 @@ static void sql_close(time_t prune) break; case SCDB_TYPE_CORE_DB: { - switch_core_db_close(dbh->native_handle.core_db_dbh); - dbh->native_handle.core_db_dbh = NULL; + switch_core_db_close(dbh->native_handle.core_db_dbh->handle); + dbh->native_handle.core_db_dbh->handle = NULL; } break; } del_handle(dbh); switch_mutex_unlock(dbh->mutex); - switch_core_destroy_memory_pool(&dbh->pool); + destroy_handle(&dbh); goto top; } else { @@ -349,9 +367,7 @@ SWITCH_DECLARE(void) switch_cache_db_release_db_handle(switch_cache_db_handle_t (*dbh)->io_mutex = NULL; if ((*dbh)->use_count) { - if (--(*dbh)->use_count == 0) { - (*dbh)->thread_hash = 1; - } + --(*dbh)->use_count; } switch_mutex_unlock((*dbh)->mutex); sql_manager.total_used_handles--; @@ -419,7 +435,7 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle_dsn_ex(switch_cac const char *file, const char *func, int line) { switch_cache_db_connection_options_t connection_options = { {0} }; - switch_cache_db_handle_type_t type; + switch_cache_db_handle_type_t type = SCDB_TYPE_CORE_DB; switch_database_interface_t *database_interface = NULL; char tmp[256] = ""; char *p; @@ -448,6 +464,10 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle_dsn_ex(switch_cac if (!strncasecmp(dsn, "sqlite://", 9)) { type = SCDB_TYPE_CORE_DB; connection_options.core_db_options.db_path = (char *)(dsn + 9); + if (!strncasecmp(connection_options.core_db_options.db_path, "memory://", 9)) { + connection_options.core_db_options.in_memory = SWITCH_TRUE; + connection_options.core_db_options.db_path = (char *)(connection_options.core_db_options.db_path + 9); + } } else if ((!(i = strncasecmp(dsn, "odbc://", 7))) || (strchr(dsn + 2, ':') && !colon_slashes)) { type = SCDB_TYPE_ODBC; @@ -610,7 +630,11 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h break; case SCDB_TYPE_CORE_DB: { - db = switch_core_db_open_file(connection_options->core_db_options.db_path); + if (!connection_options->core_db_options.in_memory) { + db = switch_core_db_open_file(connection_options->core_db_options.db_path); + } else { + db = switch_core_db_open_in_memory(connection_options->core_db_options.db_path); + } } break; @@ -631,7 +655,13 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h if (database_interface_dbh) { new_dbh->native_handle.database_interface_dbh = database_interface_dbh; } else if (db) { - new_dbh->native_handle.core_db_dbh = db; + if (!(new_dbh->native_handle.core_db_dbh = switch_core_alloc(new_dbh->pool, sizeof(*new_dbh->native_handle.core_db_dbh)))) { + destroy_handle(&new_dbh); + switch_core_db_close(db); + goto end; + } + new_dbh->native_handle.core_db_dbh->handle = db; + new_dbh->native_handle.core_db_dbh->in_memory = connection_options->core_db_options.in_memory; } else if (odbc_dbh) { new_dbh->native_handle.odbc_dbh = odbc_dbh; } @@ -681,7 +711,7 @@ static switch_status_t switch_cache_db_execute_sql_real(switch_cache_db_handle_t break; case SCDB_TYPE_CORE_DB: { - int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh, sql, NULL, NULL, &errmsg); + int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh->handle, sql, NULL, NULL, &errmsg); type = "NATIVE"; if (ret == SWITCH_CORE_DB_OK) { @@ -805,7 +835,7 @@ SWITCH_DECLARE(int) switch_cache_db_affected_rows(switch_cache_db_handle_t *dbh) switch (dbh->type) { case SCDB_TYPE_CORE_DB: { - return switch_core_db_changes(dbh->native_handle.core_db_dbh); + return switch_core_db_changes(dbh->native_handle.core_db_dbh->handle); } break; case SCDB_TYPE_ODBC: @@ -831,7 +861,7 @@ SWITCH_DECLARE(int) switch_cache_db_load_extension(switch_cache_db_handle_t *dbh case SCDB_TYPE_CORE_DB: { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "try to load extension [%s]!\n", extension); - return switch_core_db_load_extension(dbh->native_handle.core_db_dbh, extension); + return switch_core_db_load_extension(dbh->native_handle.core_db_dbh->handle, extension); } break; case SCDB_TYPE_ODBC: @@ -863,7 +893,7 @@ SWITCH_DECLARE(char *) switch_cache_db_execute_sql2str(switch_cache_db_handle_t { switch_core_db_stmt_t *stmt; - if (switch_core_db_prepare(dbh->native_handle.core_db_dbh, sql, -1, &stmt, 0)) { + if (switch_core_db_prepare(dbh->native_handle.core_db_dbh->handle, sql, -1, &stmt, 0)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Statement Error [%s]!\n", sql); goto end; } else { @@ -879,8 +909,6 @@ SWITCH_DECLARE(char *) switch_cache_db_execute_sql2str(switch_cache_db_handle_t if ((txt = switch_core_db_column_text(stmt, 0))) { switch_copy_string(str, (char *) txt, len); status = SWITCH_STATUS_SUCCESS; - } else { - goto end; } } break; @@ -1203,7 +1231,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_event_callback(switc break; case SCDB_TYPE_CORE_DB: { - int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh, sql, helper_callback, &h, &errmsg); + int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh->handle, sql, helper_callback, &h, &errmsg); if (ret == SWITCH_CORE_DB_OK || ret == SWITCH_CORE_DB_ABORT) { status = SWITCH_STATUS_SUCCESS; @@ -1270,7 +1298,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_event_callback_err(s break; case SCDB_TYPE_CORE_DB: { - int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh, sql, helper_callback, &h, &errmsg); + int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh->handle, sql, helper_callback, &h, &errmsg); if (ret == SWITCH_CORE_DB_OK || ret == SWITCH_CORE_DB_ABORT) { status = SWITCH_STATUS_SUCCESS; @@ -1329,7 +1357,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_callback(switch_cach break; case SCDB_TYPE_CORE_DB: { - int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh, sql, callback, pdata, &errmsg); + int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh->handle, sql, callback, pdata, &errmsg); if (ret == SWITCH_CORE_DB_OK || ret == SWITCH_CORE_DB_ABORT) { status = SWITCH_STATUS_SUCCESS; @@ -1391,7 +1419,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_callback_err(switch_ break; case SCDB_TYPE_CORE_DB: { - int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh, sql, callback, pdata, &errmsg); + int ret = switch_core_db_exec(dbh->native_handle.core_db_dbh->handle, sql, callback, pdata, &errmsg); if (ret == SWITCH_CORE_DB_OK || ret == SWITCH_CORE_DB_ABORT) { status = SWITCH_STATUS_SUCCESS; @@ -1518,21 +1546,21 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive_ex(switch_cache_db_h case SCDB_TYPE_CORE_DB: { char *errmsg = NULL; - switch_core_db_exec(dbh->native_handle.core_db_dbh, test_sql, NULL, NULL, &errmsg); + switch_core_db_exec(dbh->native_handle.core_db_dbh->handle, test_sql, NULL, NULL, &errmsg); if (errmsg) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SQL ERR [%s]\n[%s]\nAuto Generating Table!\n", errmsg, test_sql); switch_core_db_free(errmsg); errmsg = NULL; if (drop_sql) { - switch_core_db_exec(dbh->native_handle.core_db_dbh, drop_sql, NULL, NULL, &errmsg); + switch_core_db_exec(dbh->native_handle.core_db_dbh->handle, drop_sql, NULL, NULL, &errmsg); } if (errmsg) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Ignoring SQL ERR [%s]\n[%s]\n", errmsg, drop_sql); switch_core_db_free(errmsg); errmsg = NULL; } - switch_core_db_exec(dbh->native_handle.core_db_dbh, reactive_sql, NULL, NULL, &errmsg); + switch_core_db_exec(dbh->native_handle.core_db_dbh->handle, reactive_sql, NULL, NULL, &errmsg); if (errmsg) { r = SWITCH_FALSE; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SQL ERR [%s]\n[%s]\n", errmsg, reactive_sql); @@ -3776,6 +3804,10 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ switch_cache_db_execute_sql(sql_manager.dbh, create_tasks_sql, NULL); switch_cache_db_execute_sql(sql_manager.dbh, detailed_calls_sql, NULL); switch_cache_db_execute_sql(sql_manager.dbh, basic_calls_sql, NULL); + + if (sql_manager.dbh->native_handle.core_db_dbh->in_memory == SWITCH_TRUE) { + switch_set_flag(sql_manager.dbh, CDF_NONEXPIRING); + } } break; } @@ -3822,6 +3854,14 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ skip: if (sql_manager.manage) { + /* Initiate switch_sql_queue_manager */ + switch_threadattr_create(&thd_attr, sql_manager.memory_pool); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME); + switch_core_sqldb_start_thread(); + switch_thread_create(&sql_manager.db_thread, thd_attr, switch_core_sql_db_thread, NULL, sql_manager.memory_pool); + + /* switch_sql_queue_manager initiated, now we can bind to core_event_handler */ #ifdef SWITCH_SQL_BIND_EVERY_EVENT switch_event_bind("core_db", SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL); #else @@ -3851,13 +3891,6 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ switch_event_bind("core_db", SWITCH_EVENT_NAT, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL); switch_event_bind("core_db", SWITCH_EVENT_CODEC, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL); #endif - - switch_threadattr_create(&thd_attr, sql_manager.memory_pool); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME); - switch_core_sqldb_start_thread(); - switch_thread_create(&sql_manager.db_thread, thd_attr, switch_core_sql_db_thread, NULL, sql_manager.memory_pool); - } switch_cache_db_release_db_handle(&sql_manager.dbh); @@ -4005,14 +4038,14 @@ SWITCH_DECLARE(void) switch_cache_db_status(switch_stream_handle_t *stream) used++; } - stream->write_function(stream, "%s\n\tType: %s\n\tLast used: %d\n\tTotal used: %ld\n\tFlags: %s, %s(%d)\n" + stream->write_function(stream, "%s\n\tType: %s\n\tLast used: %d\n\tTotal used: %ld\n\tFlags: %s, %s(%d)%s\n" "\tCreator: %s\n\tLast User: %s\n", cleankey_str, switch_cache_db_type_name(dbh->type), diff, dbh->total_used_count, locked ? "Locked" : "Unlocked", - dbh->use_count ? "Attached" : "Detached", dbh->use_count, dbh->creator, dbh->last_user); + dbh->use_count ? "Attached" : "Detached", dbh->use_count, switch_test_flag(dbh, CDF_NONEXPIRING) ? ", Non-expiring" : "", dbh->creator, dbh->last_user); } stream->write_function(stream, "%d total. %d in use.\n", count, used); diff --git a/src/switch_event.c b/src/switch_event.c index 7392e41618..8b8d57250c 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -223,6 +223,7 @@ static char *EVENT_NAMES[] = { "CALL_DETAIL", "DEVICE_STATE", "TEXT", + "SHUTDOWN_REQUESTED", "ALL" }; @@ -571,9 +572,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping dispatch threads\n"); - for(x = 0; x < (uint32_t)DISPATCH_THREAD_COUNT; x++) { - switch_status_t st; - switch_thread_join(&st, EVENT_DISPATCH_QUEUE_THREADS[x]); + for(x = 0; x < (uint32_t)MAX_DISPATCH; x++) { + if (EVENT_DISPATCH_QUEUE_THREADS[x]) { + switch_status_t st; + switch_thread_join(&st, EVENT_DISPATCH_QUEUE_THREADS[x]); + } } } @@ -2934,17 +2937,21 @@ static void ecd_deliver(event_channel_data_t **ecdP) const char *sep = switch_core_get_event_channel_key_separator(); char *x_argv[SWITCH_CHANNEL_DISPATCH_MAX_KEY_PARTS] = { 0 }; int x_argc = switch_separate_string_string(key, (char*) sep, x_argv, SWITCH_CHANNEL_DISPATCH_MAX_KEY_PARTS); - char buf[512]; - int i; + char buf[1024]; + int i, r; for(i=x_argc - 1; i > 0; i--) { int z; - memset(buf, 0, 512); + memset(buf, 0, 1024); sprintf(buf, "%s", x_argv[0]); for(z=1; z < i; z++) { strcat(buf, sep); strcat(buf, x_argv[z]); } - t += _switch_event_channel_broadcast(buf, ecd->event_channel, ecd->json, ecd->key, ecd->id); + r = _switch_event_channel_broadcast(buf, ecd->event_channel, ecd->json, ecd->key, ecd->id); + t += r; + if (r && switch_core_test_flag(SCF_EVENT_CHANNEL_HIERARCHY_DELIVERY_ONCE)) { + break; + } } } else { char *p = NULL; @@ -2958,7 +2965,13 @@ static void ecd_deliver(event_channel_data_t **ecdP) t += _switch_event_channel_broadcast(SWITCH_EVENT_CHANNEL_GLOBAL, ecd->event_channel, ecd->json, ecd->key, ecd->id); if(t == 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "no subscribers for %s , %s\n", ecd->event_channel, ecd->key); + if (switch_core_test_flag(SCF_EVENT_CHANNEL_LOG_UNDELIVERABLE_JSON)) { + char *json = cJSON_Print(ecd->json); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "no subscribers for %s , %s => %s\n", ecd->event_channel, ecd->key, json); + switch_safe_free(json); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "no subscribers for %s , %s\n", ecd->event_channel, ecd->key); + } } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "delivered to %u subscribers for %s\n", t, ecd->event_channel); } @@ -3057,7 +3070,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_channel_broadcast(const char *event cJSON_Delete(ecd->json); ecd->json = NULL; destroy_ecd(&ecd); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Event Channel Queue failure for channel %s\n", event_channel); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Event Channel Queue failure for channel %s, status = %d\n", event_channel, status); } else { ecd = NULL; } diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index bb629e9af2..db1bb1e4e5 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -1007,6 +1007,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_ displace_helper_t *dh; const char *p; switch_bool_t hangup_on_error = SWITCH_FALSE; + switch_media_bug_flag_enum_t bug_flags = 0; switch_codec_implementation_t read_impl = { 0 }; switch_core_session_get_read_impl(session, &read_impl); @@ -1092,6 +1093,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_ dh->loop++; } + if (flags && strchr(flags, 'f')) { + bug_flags |= SMBF_FIRST; + } + if (flags && strchr(flags, 'r')) { if (strchr(flags, 'w')) { // r&w mode, both sides can hear the same file int len = dh->fh.samplerate / 10 * 2 * dh->fh.channels; // init with 100ms @@ -1101,10 +1106,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_ } status = switch_core_media_bug_add(session, "displace", file, - read_displace_callback, dh, to, SMBF_WRITE_REPLACE | SMBF_READ_REPLACE | SMBF_NO_PAUSE, &bug); + read_displace_callback, dh, to, bug_flags | SMBF_WRITE_REPLACE | SMBF_READ_REPLACE | SMBF_NO_PAUSE, &bug); } else { status = switch_core_media_bug_add(session, "displace", file, - write_displace_callback, dh, to, SMBF_WRITE_REPLACE | SMBF_READ_REPLACE | SMBF_NO_PAUSE, &bug); + write_displace_callback, dh, to, bug_flags | SMBF_WRITE_REPLACE | SMBF_READ_REPLACE | SMBF_NO_PAUSE, &bug); } if (status != SWITCH_STATUS_SUCCESS) { @@ -4673,9 +4678,9 @@ static void *SWITCH_THREAD_FUNC speech_thread(switch_thread_t *thread, void *obj status = switch_core_asr_get_results(sth->ah, &xmlstr, &flags); - if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) { + if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK && status != SWITCH_STATUS_MORE_DATA) { goto done; - } else if (status == SWITCH_STATUS_SUCCESS) { + } else { /* Try to fetch extra information for this result, the return value doesn't really matter here - it's just optional data. */ switch_core_asr_get_result_headers(sth->ah, &headers, &flags); } @@ -4732,6 +4737,14 @@ static void *SWITCH_THREAD_FUNC speech_thread(switch_thread_t *thread, void *obj switch_event_merge(event, headers); } + switch_event_add_body(event, "%s", xmlstr); + } else if (status == SWITCH_STATUS_MORE_DATA) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Speech-Type", "detected-partial-speech"); + + if (headers) { + switch_event_merge(event, headers); + } + switch_event_add_body(event, "%s", xmlstr); } else { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Speech-Type", "begin-speaking"); diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index 767754a59f..5ff242e102 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -233,8 +233,8 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj) } - if (switch_test_flag(read_frame, SFF_CNG) || - switch_channel_test_flag(channel, CF_LEG_HOLDING) || switch_channel_test_flag(b_channel, CF_VIDEO_READ_FILE_ATTACHED)) { + if (read_frame && (switch_test_flag(read_frame, SFF_CNG) || + switch_channel_test_flag(channel, CF_LEG_HOLDING) || switch_channel_test_flag(b_channel, CF_VIDEO_READ_FILE_ATTACHED))) { continue; } @@ -670,7 +670,6 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) } else { switch_ivr_3p_nomedia(switch_core_session_get_uuid(session_a), SMF_REBRIDGE); } - bypass_media_after_bridge = 0; switch_channel_clear_flag(chan_b, CF_BYPASS_MEDIA_AFTER_BRIDGE); goto end_of_bridge_loop; } @@ -1099,7 +1098,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_bridge_bleg(switch_core_session_t *se switch_channel_clear_flag(channel, CF_ARRANGED_BRIDGE); return SWITCH_STATUS_FALSE; } else { - audio_bridge_on_exchange_media(session); + switch_channel_t *channel = switch_core_session_get_channel(session); + if (!switch_channel_test_flag(channel, CF_TRANSFER)) { + audio_bridge_on_exchange_media(session); + } } return SWITCH_STATUS_SUCCESS; diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 0ed6f0644f..9e9ebdb19c 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -1587,7 +1587,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess /* extract channel variables, allowing multiple sets of braces */ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Parsing ultra-global variables\n"); - while (*data == '<') { + while (data && *data == '<') { char *parsed = NULL; if (switch_event_create_brackets(data, '<', '>', ',', &var_event, &parsed, SWITCH_FALSE) != SWITCH_STATUS_SUCCESS || !parsed) { @@ -2742,7 +2742,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess end = NULL; - chan_type = peer_names[i]; + if (!(chan_type = peer_names[i])) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Empty dial string\n"); + switch_goto_status(SWITCH_STATUS_FALSE, done); + } /* strip leading spaces */ @@ -4383,6 +4386,12 @@ SWITCH_DECLARE(switch_event_t *) switch_dial_leg_get_vars(switch_dial_leg_t *leg return leg->leg_vars; } +SWITCH_DECLARE(const char *) switch_dial_leg_get_var(switch_dial_leg_t *leg, const char *key) +{ + switch_assert(leg); + + return switch_event_get_header(leg->leg_vars, key); +} static switch_status_t vars_serialize_json_obj(switch_event_t *event, cJSON **json) { @@ -4559,32 +4568,31 @@ static switch_status_t o_bridge_on_dtmf(switch_core_session_t *session, void *in return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(void) switch_ivr_orig_and_bridge(switch_core_session_t *session, const char *data, switch_dial_handle_t *dh) +SWITCH_DECLARE(switch_status_t) switch_ivr_orig_and_bridge(switch_core_session_t *session, const char *data, switch_dial_handle_t *dh, switch_call_cause_t *cause) { switch_channel_t *caller_channel = switch_core_session_get_channel(session); switch_core_session_t *peer_session = NULL; - switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING; switch_status_t status = SWITCH_STATUS_FALSE; int fail = 0; if ((status = switch_ivr_originate(session, &peer_session, - &cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL, dh)) != SWITCH_STATUS_SUCCESS) { + cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL, dh)) != SWITCH_STATUS_SUCCESS) { fail = 1; } if (fail) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Originate Failed. Cause: %s\n", switch_channel_cause2str(cause)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Originate Failed. Cause: %s\n", switch_channel_cause2str(*cause)); - switch_channel_set_variable(caller_channel, "originate_failed_cause", switch_channel_cause2str(cause)); + switch_channel_set_variable(caller_channel, "originate_failed_cause", switch_channel_cause2str(*cause)); - switch_channel_handle_cause(caller_channel, cause); + switch_channel_handle_cause(caller_channel, *cause); - return; + return status; } else { - switch_channel_t *peer_channel = switch_core_session_get_channel(peer_session); + if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE)) || switch_true(switch_channel_get_variable(peer_channel, SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE))) { switch_channel_set_flag(caller_channel, CF_BYPASS_MEDIA_AFTER_BRIDGE); @@ -4620,6 +4628,8 @@ SWITCH_DECLARE(void) switch_ivr_orig_and_bridge(switch_core_session_t *session, switch_core_session_rwunlock(peer_session); } } + + return status; } diff --git a/src/switch_msrp.c b/src/switch_msrp.c index 6cf2974d3e..da5e288dc0 100644 --- a/src/switch_msrp.c +++ b/src/switch_msrp.c @@ -36,8 +36,6 @@ #define MSRP_BUFF_SIZE (SWITCH_RTP_MAX_BUF_LEN - 32) #define DEBUG_MSRP 0 -#define MSRP_LISTEN_PORT 2855 -#define MSRP_SSL_LISTEN_PORT 2856 struct msrp_socket_s { switch_port_t port; @@ -108,6 +106,10 @@ static void msrp_deinit_ssl() SSL_CTX_free(globals.ssl_ctx); globals.ssl_ctx = NULL; } + if (globals.ssl_client_ctx) { + SSL_CTX_free(globals.ssl_client_ctx); + globals.ssl_client_ctx = NULL; + } } static void msrp_init_ssl() @@ -293,35 +295,41 @@ SWITCH_DECLARE(switch_status_t) switch_msrp_init() memset(&globals, 0, sizeof(globals)); set_global_ip("0.0.0.0"); globals.pool = pool; - globals.msock.port = (switch_port_t)MSRP_LISTEN_PORT; - globals.msock_ssl.port = (switch_port_t)MSRP_SSL_LISTEN_PORT; + globals.msock.port = (switch_port_t)0; + globals.msock_ssl.port = (switch_port_t)0; globals.msock_ssl.secure = 1; globals.message_buffer_size = 50; globals.debug = DEBUG_MSRP; load_config(); - globals.running = 1; + if (globals.msock.port) { + globals.running = 1; - status = msock_init(globals.ip, globals.msock.port, &globals.msock.sock, pool); + status = msock_init(globals.ip, globals.msock.port, &globals.msock.sock, pool); - if (status == SWITCH_STATUS_SUCCESS) { - switch_threadattr_create(&thd_attr, pool); - // switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, msrp_listener, &globals.msock, pool); - globals.msock.thread = thread; + if (status == SWITCH_STATUS_SUCCESS) { + switch_threadattr_create(&thd_attr, pool); + // switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&thread, thd_attr, msrp_listener, &globals.msock, pool); + globals.msock.thread = thread; + } } - msrp_init_ssl(); - status = msock_init(globals.ip, globals.msock_ssl.port, &globals.msock_ssl.sock, pool); + if (globals.msock_ssl.port) { + globals.running = 1; - if (status == SWITCH_STATUS_SUCCESS) { - switch_threadattr_create(&thd_attr, pool); - // switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, msrp_listener, &globals.msock_ssl, pool); - globals.msock_ssl.thread = thread; + msrp_init_ssl(); + status = msock_init(globals.ip, globals.msock_ssl.port, &globals.msock_ssl.sock, pool); + + if (status == SWITCH_STATUS_SUCCESS) { + switch_threadattr_create(&thd_attr, pool); + // switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&thread, thd_attr, msrp_listener, &globals.msock_ssl, pool); + globals.msock_ssl.thread = thread; + } } return SWITCH_STATUS_SUCCESS; @@ -407,7 +415,7 @@ SWITCH_DECLARE(switch_status_t) switch_msrp_session_destroy(switch_msrp_session_ switch_status_t switch_msrp_session_push_msg(switch_msrp_session_t *ms, switch_msrp_msg_t *msg) { switch_mutex_lock(ms->mutex); - + if (ms->last_msg == NULL) { ms->last_msg = msg; ms->msrp_msg = msg; diff --git a/src/switch_resample.c b/src/switch_resample.c index 2c9529b8e2..866acdd99c 100644 --- a/src/switch_resample.c +++ b/src/switch_resample.c @@ -522,7 +522,9 @@ SWITCH_DECLARE(switch_status_t) switch_agc_feed(switch_agc_t *agc, int16_t *data energy += abs(data[i]); } - agc->score = energy / samples * channels; + if (samples) { + agc->score = energy / samples * channels; + } agc->score_sum += agc->score; agc->score_count++; diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 4d60b7c41e..fb8d5d2cf2 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -842,7 +842,7 @@ static switch_status_t ice_out(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice) elapsed = (unsigned int) ((switch_micro_time_now() - rtp_session->last_stun) / 1000); if (elapsed > 30000) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "No %s stun for a long time!\n", rtp_type(rtp_session)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "No %s stun for a long time!\n", rtp_type(rtp_session)); rtp_session->last_stun = switch_micro_time_now(); //status = SWITCH_STATUS_GENERR; //goto end; @@ -9039,7 +9039,6 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra data = frame->data; len = frame->datalen; ts = rtp_session->flags[SWITCH_RTP_FLAG_RAW_WRITE] ? (uint32_t) frame->timestamp : 0; - if (!ts) ts = rtp_session->last_write_ts + rtp_session->samples_per_interval; } /* diff --git a/src/switch_stun.c b/src/switch_stun.c index b60a3cd5ea..6149ac3dc3 100644 --- a/src/switch_stun.c +++ b/src/switch_stun.c @@ -884,9 +884,6 @@ SWITCH_DECLARE(switch_status_t) switch_stun_ip_lookup(char **external_ip, const stun_port = (switch_port_t)iport; } } - else { - p = stun_ip; - } switch_find_local_ip(ip_buf, sizeof(ip_buf), NULL, AF_INET); diff --git a/src/switch_time.c b/src/switch_time.c index cbb47f9ef7..e0c12aa737 100644 --- a/src/switch_time.c +++ b/src/switch_time.c @@ -1459,7 +1459,6 @@ SWITCH_DECLARE(switch_status_t) switch_time_exp_tz_name(const char *tz, switch_t tzdef = switch_lookup_timezone(tz_name); } else { /* We set the default timezone to GMT. */ - tz_name = "GMT"; tzdef = "GMT"; } diff --git a/src/switch_xml.c b/src/switch_xml.c index f2e43f6318..f794d6f744 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -103,9 +103,6 @@ void globfree(glob_t *); #define SWITCH_XML_WS "\t\r\n " /* whitespace */ #define SWITCH_XML_ERRL 128 /* maximum error string length */ -/* Use UTF-8 as the general encoding */ -static switch_bool_t USE_UTF_8_ENCODING = SWITCH_TRUE; - static void preprocess_exec_set(char *keyval) { char *key = keyval; @@ -1139,10 +1136,14 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len) if (!(s = strstr(s + 3, "--")) || (*(s += 2) != '>' && *s) || (!*s && e != '>')) return switch_xml_err(root, d, "unclosed