mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-26 12:37:26 +00:00
Merge remote branch 'fsorig/master'
This commit is contained in:
commit
865d04ef2f
206
.gitignore
vendored
206
.gitignore
vendored
@ -11,10 +11,6 @@
|
||||
.deps
|
||||
.\#*
|
||||
\#*
|
||||
/Debug/
|
||||
/Release/
|
||||
/All/
|
||||
/bin/
|
||||
*.user
|
||||
*.suo
|
||||
*.ncb
|
||||
@ -39,105 +35,115 @@
|
||||
*.xz
|
||||
*.bz2
|
||||
*.tbz2
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.cache
|
||||
configure.lineno
|
||||
config.log
|
||||
config.status
|
||||
core.*
|
||||
/Path
|
||||
|
||||
/w32/Library/lastversion
|
||||
/w32/Library/tmpVersion.Bat
|
||||
!/w32/Console/FreeSwitchConsole.vcproj.user
|
||||
!/w32/Setup/inno_setup/vcredist_x64.exe
|
||||
!/w32/Setup/inno_setup/vcredist_x86.exe
|
||||
.version
|
||||
AUTHORS
|
||||
COPYING
|
||||
ChangeLog
|
||||
Makefile
|
||||
Makefile.in
|
||||
NEWS
|
||||
README
|
||||
TAGS
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
build/Makefile
|
||||
build/Makefile.in
|
||||
build/config/compile
|
||||
build/config/config.guess
|
||||
build/config/depcomp
|
||||
build/config/install-sh
|
||||
build/config/ltmain.sh
|
||||
build/config/missing
|
||||
build/freeswitch.pc
|
||||
build/getlib.sh
|
||||
build/getsounds.sh
|
||||
build/modmake.rules
|
||||
build/getg729.sh
|
||||
config.cache
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
configure.lineno
|
||||
freeswitch
|
||||
fs_cli
|
||||
fs_encode
|
||||
fs_ivrd
|
||||
libtool
|
||||
noreg
|
||||
modules.conf
|
||||
quiet_libtool
|
||||
tone2wav
|
||||
scripts/fsxs
|
||||
scripts/gentls_cert
|
||||
a.out.dSYM
|
||||
src/mod/applications/mod_easyroute/Makefile
|
||||
src/mod/applications/mod_lcr/Makefile
|
||||
src/mod/applications/mod_nibblebill/Makefile
|
||||
src/mod/applications/mod_rss/Makefile
|
||||
src/mod/applications/mod_snipe_hunt/Makefile
|
||||
src/mod/codecs/mod_dahdi_codec/Makefile
|
||||
src/mod/dialplans/mod_dialplan_directory/Makefile
|
||||
src/mod/formats/mod_shell_stream/Makefile
|
||||
src/mod/say/mod_say_de/Makefile
|
||||
src/mod/say/mod_say_es/Makefile
|
||||
src/mod/say/mod_say_fr/Makefile
|
||||
src/mod/say/mod_say_it/Makefile
|
||||
src/mod/say/mod_say_nl/Makefile
|
||||
src/mod/say/mod_say_th/Makefile
|
||||
src/mod/say/mod_say_zh/Makefile
|
||||
libs/curl/lib/ca-bundle.h
|
||||
libs/g729/
|
||||
libs/fsg729-*-installer
|
||||
src/mod/codecs/mod_com_g729/
|
||||
src/mod/languages/mod_lua/mod_lua_wrap.cpp.orig
|
||||
src/mod/languages/mod_perl/mod_perl_wrap.cpp.orig
|
||||
src/mod/languages/mod_python/mod_python_wrap.cpp.orig
|
||||
libs/freetdm/detect_dtmf
|
||||
libs/freetdm/detect_tones
|
||||
libs/freetdm/testanalog
|
||||
libs/freetdm/testapp
|
||||
libs/freetdm/testcid
|
||||
libs/freetdm/testpri
|
||||
libs/freetdm/testr2
|
||||
libs/freetdm/testsangomaboost
|
||||
libs/freetdm/testtones
|
||||
libs/esl/fs_cli
|
||||
libs/esl/ivrd
|
||||
libs/esl/testserver
|
||||
libs/esl/testclient
|
||||
libs/libcodec2/Makefile
|
||||
libs/libcodec2/Makefile.in
|
||||
libs/libcodec2/config.guess
|
||||
libs/libcodec2/config.sub
|
||||
libs/libcodec2/configure
|
||||
libs/libcodec2/depcomp
|
||||
libs/libcodec2/install-sh
|
||||
libs/libcodec2/libtool
|
||||
libs/libcodec2/ltmain.sh
|
||||
libs/libcodec2/missing
|
||||
libs/libcodec2/src/Makefile
|
||||
libs/libcodec2/src/Makefile.in
|
||||
libs/libcodec2/unittest/Makefile
|
||||
libs/libcodec2/unittest/Makefile.in
|
||||
src/mod/applications/mod_osp/Makefile
|
||||
src/mod/applications/mod_osp/Makefile.in
|
||||
src/mod/applications/mod_hash/Makefile
|
||||
src/mod/applications/mod_hash/Makefile.in
|
||||
src/mod/applications/mod_hash/mod_hash.log
|
||||
|
||||
/.version
|
||||
/a.out.dSYM
|
||||
/AUTHORS
|
||||
/ChangeLog
|
||||
/configure
|
||||
/COPYING
|
||||
/freeswitch
|
||||
/fs_cli
|
||||
/fs_encode
|
||||
/fs_ivrd
|
||||
/libtool
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/modules.conf
|
||||
/NEWS
|
||||
/Path
|
||||
/quiet_libtool
|
||||
/README
|
||||
/TAGS
|
||||
/tone2wav
|
||||
|
||||
/All/
|
||||
/Debug/
|
||||
/bin/
|
||||
/Release/
|
||||
|
||||
/build/config/compile
|
||||
/build/config/config.guess
|
||||
/build/config/depcomp
|
||||
/build/config/install-sh
|
||||
/build/config/ltmain.sh
|
||||
/build/config/missing
|
||||
/build/freeswitch.pc
|
||||
/build/getlib.sh
|
||||
/build/getsounds.sh
|
||||
/build/Makefile
|
||||
/build/Makefile.in
|
||||
/build/modmake.rules
|
||||
|
||||
/libs/curl/lib/ca-bundle.h
|
||||
/libs/esl/fs_cli
|
||||
/libs/esl/ivrd
|
||||
/libs/esl/testclient
|
||||
/libs/esl/testserver
|
||||
/libs/freetdm/detect_dtmf
|
||||
/libs/freetdm/detect_tones
|
||||
/libs/freetdm/testanalog
|
||||
/libs/freetdm/testapp
|
||||
/libs/freetdm/testcid
|
||||
/libs/freetdm/testpri
|
||||
/libs/freetdm/testr2
|
||||
/libs/freetdm/testsangomaboost
|
||||
/libs/freetdm/testtones
|
||||
/libs/fsg729-*-installer
|
||||
/libs/g729/
|
||||
/libs/libcodec2/config.guess
|
||||
/libs/libcodec2/config.sub
|
||||
/libs/libcodec2/configure
|
||||
/libs/libcodec2/depcomp
|
||||
/libs/libcodec2/install-sh
|
||||
/libs/libcodec2/libtool
|
||||
/libs/libcodec2/ltmain.sh
|
||||
/libs/libcodec2/Makefile
|
||||
/libs/libcodec2/Makefile.in
|
||||
/libs/libcodec2/missing
|
||||
/libs/libcodec2/src/Makefile
|
||||
/libs/libcodec2/src/Makefile.in
|
||||
/libs/libcodec2/unittest/Makefile
|
||||
/libs/libcodec2/unittest/Makefile.in
|
||||
|
||||
/scripts/fsxs
|
||||
/scripts/gentls_cert
|
||||
|
||||
/src/mod/applications/mod_easyroute/Makefile
|
||||
/src/mod/applications/mod_hash/Makefile
|
||||
/src/mod/applications/mod_hash/Makefile.in
|
||||
/src/mod/applications/mod_hash/mod_hash.log
|
||||
/src/mod/applications/mod_lcr/Makefile
|
||||
/src/mod/applications/mod_nibblebill/Makefile
|
||||
/src/mod/applications/mod_osp/Makefile
|
||||
/src/mod/applications/mod_osp/Makefile.in
|
||||
/src/mod/applications/mod_rss/Makefile
|
||||
/src/mod/applications/mod_snipe_hunt/Makefile
|
||||
/src/mod/codecs/mod_com_g729/
|
||||
/src/mod/codecs/mod_dahdi_codec/Makefile
|
||||
/src/mod/dialplans/mod_dialplan_directory/Makefile
|
||||
/src/mod/formats/mod_shell_stream/Makefile
|
||||
/src/mod/languages/mod_lua/mod_lua_wrap.cpp.orig
|
||||
/src/mod/languages/mod_perl/mod_perl_wrap.cpp.orig
|
||||
/src/mod/languages/mod_python/mod_python_wrap.cpp.orig
|
||||
/src/mod/say/mod_say_de/Makefile
|
||||
/src/mod/say/mod_say_es/Makefile
|
||||
/src/mod/say/mod_say_fr/Makefile
|
||||
/src/mod/say/mod_say_it/Makefile
|
||||
/src/mod/say/mod_say_nl/Makefile
|
||||
/src/mod/say/mod_say_th/Makefile
|
||||
/src/mod/say/mod_say_zh/Makefile
|
||||
|
||||
|
@ -356,7 +356,7 @@ scripts/fsxs: scripts/fsxs.in
|
||||
## misc
|
||||
##
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
pkgconfig_DATA = build/freeswitch.pc
|
||||
|
||||
$(switch_builddir)/modules.conf:
|
||||
|
@ -1,5 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
bz="false"
|
||||
|
||||
BUNZIP=/usr/bin/bunzip2
|
||||
TAR=@TAR@
|
||||
ZCAT=@ZCAT@
|
||||
WGET=@WGET@
|
||||
@ -17,14 +20,26 @@ base=http://files.freeswitch.org/downloads/libs/
|
||||
tarfile=$1
|
||||
url=`echo $tarfile | grep "://"`
|
||||
|
||||
if [ `echo $tarfile | grep bz2` ] ; then
|
||||
bz="true"
|
||||
UNZIPPER=$BUNZIP
|
||||
else
|
||||
UNZIPPER=$ZCAT
|
||||
fi
|
||||
|
||||
if [ ! -z $url ] ; then
|
||||
base=$tarfile/
|
||||
tarfile=$2
|
||||
fi
|
||||
|
||||
if [ ! -d $tarfile ] ; then
|
||||
uncompressed=`echo $tarfile | sed "s/\.tar\.gz//g"`
|
||||
uncompressed=`echo $uncompressed | sed "s/\.tgz//g"`
|
||||
|
||||
if [ $bz = "true" ] ; then
|
||||
uncompressed=`echo $tarfile | sed "s/\.tar\.bz2//g"`
|
||||
else
|
||||
uncompressed=`echo $tarfile | sed "s/\.tar\.gz//g"`
|
||||
uncompressed=`echo $uncompressed | sed "s/\.tgz//g"`
|
||||
fi
|
||||
|
||||
if [ ! -f $tarfile ] ; then
|
||||
rm -fr $uncompressed
|
||||
@ -35,7 +50,7 @@ if [ ! -d $tarfile ] ; then
|
||||
fi
|
||||
fi
|
||||
if [ ! -d $uncompressed ] ; then
|
||||
$ZCAT -c -d $tarfile | $TAR xf -
|
||||
$UNZIPPER -c -d $tarfile | $TAR xf -
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -52,8 +52,9 @@
|
||||
|
||||
<!-- If TTS is enabled all audio-file params beginning with -->
|
||||
<!-- 'say:' will be considered text to say with TTS -->
|
||||
<!-- Set a default path here so you can use relative paths in the other sound params-->
|
||||
<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>
|
||||
<!-- Override the default path here, after which you use relative paths in the other sound params -->
|
||||
<!-- Note: The default path is the conference's first caller's sound_prefix -->
|
||||
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
|
||||
<!-- File to play to acknowledge succees -->
|
||||
<!--<param name="ack-sound" value="beep.wav"/>-->
|
||||
<!-- File to play to acknowledge failure -->
|
||||
@ -106,7 +107,7 @@
|
||||
<param name="rate" value="16000"/>
|
||||
<param name="interval" value="20"/>
|
||||
<param name="energy-level" value="300"/>
|
||||
<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>
|
||||
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
|
||||
<param name="muted-sound" value="conference/conf-muted.wav"/>
|
||||
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
|
||||
<param name="alone-sound" value="conference/conf-alone.wav"/>
|
||||
@ -131,7 +132,7 @@
|
||||
<param name="rate" value="32000"/>
|
||||
<param name="interval" value="20"/>
|
||||
<param name="energy-level" value="300"/>
|
||||
<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>
|
||||
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
|
||||
<param name="muted-sound" value="conference/conf-muted.wav"/>
|
||||
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
|
||||
<param name="alone-sound" value="conference/conf-alone.wav"/>
|
||||
@ -156,7 +157,7 @@
|
||||
<param name="rate" value="48000"/>
|
||||
<param name="interval" value="10"/>
|
||||
<param name="energy-level" value="300"/>
|
||||
<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>
|
||||
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
|
||||
<param name="muted-sound" value="conference/conf-muted.wav"/>
|
||||
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
|
||||
<param name="alone-sound" value="conference/conf-alone.wav"/>
|
||||
|
@ -24,6 +24,11 @@
|
||||
<!--Colorize the Console -->
|
||||
<param name="colorize-console" value="true"/>
|
||||
|
||||
<!-- maximum number of simo db handles open -->
|
||||
<param name="max-db-handles" value="50"/>
|
||||
<!-- maximum number of seconds to wait for a new db handle before failing -->
|
||||
<param name="db-handle-timeout" value="10"/>
|
||||
|
||||
<!-- minimum idle CPU before refusing calls -->
|
||||
<!--<param name="min-idle-cpu" value="25"/>-->
|
||||
|
||||
|
@ -16,12 +16,16 @@
|
||||
<soft-key-set-sets>
|
||||
<soft-key-set-set name="default">
|
||||
<soft-key-set name="KeySetOnHook" value="SoftkeyNewcall,SoftkeyRedial"/>
|
||||
<soft-key-set name="KeySetOffHook" value=",SoftkeyRedial,SoftkeyEndcall"/>
|
||||
<soft-key-set name="KeySetDigitsAfterDialingFirstDigit" value="SoftkeyBackspace,,SoftkeyEndcall"/>
|
||||
<soft-key-set name="KeySetConnected" value="SoftkeyEndcall,SoftkeyHold,SoftkeyNewcall,SoftkeyTransfer"/>
|
||||
<soft-key-set name="KeySetRingIn" value="SoftkeyAnswer,SoftkeyEndcall,SoftkeyNewcall"/>
|
||||
<soft-key-set name="KeySetOnHold" value="SoftkeyNewcall,SoftkeyResume,SoftkeyEndcall"/>
|
||||
<soft-key-set name="KeySetRingIn" value="SoftkeyAnswer,SoftkeyEndcall,SoftkeyNewcall"/>
|
||||
<soft-key-set name="KeySetOffHook" value=",SoftkeyRedial,SoftkeyEndcall"/>
|
||||
<soft-key-set name="KeySetConnectedWithTransfer" value="SoftkeyEndcall,SoftkeyHold,SoftkeyNewcall,SoftkeyTransfer"/>
|
||||
<soft-key-set name="KeySetDigitsAfterDialingFirstDigit" value="SoftkeyBackspace,,SoftkeyEndcall"/>
|
||||
<!-- <soft-key-set name="KeySetConnectedWithConference" value=""/> -->
|
||||
<soft-key-set name="KeySetRingOut" value=",,SoftkeyEndcall,SoftkeyTransfer"/>
|
||||
<soft-key-set name="KeySetOffHookWithFeatures" value=",SoftkeyRedial,SoftkeyEndcall"/>
|
||||
<soft-key-set name="KeySetInUseHint" value="SoftkeyNewcall,SoftkeyRedial"/>
|
||||
</soft-key-set-set>
|
||||
</soft-key-set-sets>
|
||||
<device-types>
|
||||
|
@ -207,6 +207,7 @@
|
||||
<X-PRE-PROCESS cmd="set" data="de-ring=%(1000,4000,425,0)"/>
|
||||
<X-PRE-PROCESS cmd="set" data="dz-ring=%(1500,3500,425.0,0.0)"/>
|
||||
<X-PRE-PROCESS cmd="set" data="pl-ring=%(1000,4000,425,0)"/>
|
||||
<X-PRE-PROCESS cmd="set" data="il-ring=%(1000,2000,425.0,0)"/>
|
||||
<X-PRE-PROCESS cmd="set" data="bong-ring=v=-7;%(100,0,941.0,1477.0);v=-7;>=2;+=.1;%(1400,0,350,440)"/>
|
||||
<X-PRE-PROCESS cmd="set" data="sit=%(274,0,913.8);%(274,0,1370.6);%(380,0,1776.7)"/>
|
||||
<!--
|
||||
|
11
configure.in
11
configure.in
@ -93,6 +93,17 @@ AC_SUBST(libdir)
|
||||
AC_SUBST(bindir)
|
||||
AC_SUBST(includedir)
|
||||
|
||||
AC_ARG_WITH([pkgconfigdir],
|
||||
[AS_HELP_STRING([--with-pkgconfigdir=DIR], [Installation directory for pkgconfig file (default: ${libdir}/pkgconfig)])],
|
||||
[case "${withval}" in
|
||||
yes|no) AC_MSG_ERROR([Invalid value ${withval} for option --with-pkgconfigdir]) ;;
|
||||
*) pkgconfigdir="${withval}" ;;
|
||||
esac
|
||||
],
|
||||
[pkgconfigdir="${libdir}/pkgconfig"]
|
||||
)
|
||||
AC_SUBST([pkgconfigdir])
|
||||
|
||||
#Set default language
|
||||
AC_LANG_C
|
||||
# Checks for programs.
|
||||
|
@ -53,6 +53,7 @@ static unsigned char esl_console_complete(const char *buffer, const char *cursor
|
||||
#endif
|
||||
|
||||
static char prompt_str[512] = "";
|
||||
static int CONNECTED = 0;
|
||||
|
||||
typedef struct {
|
||||
char name[128];
|
||||
@ -537,6 +538,11 @@ static void handle_SIGINT(int sig)
|
||||
{
|
||||
if (sig);
|
||||
|
||||
if (!CONNECTED) {
|
||||
fprintf(stdout, "Interrupted.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
WARN_STOP = 1;
|
||||
|
||||
signal(SIGINT, handle_SIGINT);
|
||||
@ -1235,6 +1241,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
connect:
|
||||
|
||||
CONNECTED = 0;
|
||||
|
||||
while (--loops > 0) {
|
||||
memset(&handle, 0, sizeof(handle));
|
||||
if (esl_connect(&handle, profile->host, profile->port, profile->user, profile->pass)) {
|
||||
@ -1252,6 +1260,8 @@ int main(int argc, char *argv[])
|
||||
esl_log(ESL_LOG_INFO, "Retrying\n");
|
||||
}
|
||||
} else {
|
||||
CONNECTED = 1;
|
||||
|
||||
if (temp_log < 0 ) {
|
||||
esl_global_set_default_logger(profile->debug);
|
||||
} else {
|
||||
|
@ -790,11 +790,12 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1api(JNIEn
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1bgapi(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) {
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1bgapi(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4) {
|
||||
jlong jresult = 0 ;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
(void)jenv;
|
||||
@ -811,10 +812,16 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_esl_eslJNI_ESLconnection_1bgapi(JNI
|
||||
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
|
||||
if (!arg3) return 0;
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3);
|
||||
arg4 = 0;
|
||||
if (jarg4) {
|
||||
arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0);
|
||||
if (!arg4) return 0;
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
*(ESLevent **)&jresult = result;
|
||||
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
|
||||
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
|
||||
if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,8 @@ public class ESLconnection {
|
||||
return (cPtr == 0) ? null : new ESLevent(cPtr, true);
|
||||
}
|
||||
|
||||
public ESLevent bgapi(String cmd, String arg) {
|
||||
long cPtr = eslJNI.ESLconnection_bgapi(swigCPtr, this, cmd, arg);
|
||||
public ESLevent bgapi(String cmd, String arg, String job_uuid) {
|
||||
long cPtr = eslJNI.ESLconnection_bgapi(swigCPtr, this, cmd, arg, job_uuid);
|
||||
return (cPtr == 0) ? null : new ESLevent(cPtr, true);
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ class eslJNI {
|
||||
public final static native int ESLconnection_send(long jarg1, ESLconnection jarg1_, String jarg2);
|
||||
public final static native long ESLconnection_sendRecv(long jarg1, ESLconnection jarg1_, String jarg2);
|
||||
public final static native long ESLconnection_api(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3);
|
||||
public final static native long ESLconnection_bgapi(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3);
|
||||
public final static native long ESLconnection_bgapi(long jarg1, ESLconnection jarg1_, String jarg2, String jarg3, String jarg4);
|
||||
public final static native long ESLconnection_sendEvent(long jarg1, ESLconnection jarg1_, long jarg2, ESLevent jarg2_);
|
||||
public final static native long ESLconnection_recvEvent(long jarg1, ESLconnection jarg1_);
|
||||
public final static native long ESLconnection_recvEventTimed(long jarg1, ESLconnection jarg1_, int jarg2);
|
||||
|
@ -2498,12 +2498,14 @@ static int _wrap_ESLconnection_bgapi(lua_State* L) {
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("bgapi",2,3)
|
||||
SWIG_check_num_args("bgapi",2,4)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bgapi",1,"ESLconnection *");
|
||||
if(!lua_isstring(L,2)) SWIG_fail_arg("bgapi",2,"char const *");
|
||||
if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("bgapi",3,"char const *");
|
||||
if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("bgapi",4,"char const *");
|
||||
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
|
||||
SWIG_fail_ptr("ESLconnection_bgapi",1,SWIGTYPE_p_ESLconnection);
|
||||
@ -2513,7 +2515,10 @@ static int _wrap_ESLconnection_bgapi(lua_State* L) {
|
||||
if(lua_gettop(L)>=3){
|
||||
arg3 = (char *)lua_tostring(L, 3);
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3);
|
||||
if(lua_gettop(L)>=4){
|
||||
arg4 = (char *)lua_tostring(L, 4);
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
SWIG_arg=0;
|
||||
SWIG_NewPointerObj(L,result,SWIGTYPE_p_ESLevent,1); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
@ -275,7 +275,7 @@ class ESLPINVOKE {
|
||||
public static extern IntPtr ESLconnection_Api(HandleRef jarg1, string jarg2, string jarg3);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_ESLconnection_Bgapi")]
|
||||
public static extern IntPtr ESLconnection_Bgapi(HandleRef jarg1, string jarg2, string jarg3);
|
||||
public static extern IntPtr ESLconnection_Bgapi(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
|
||||
|
||||
[DllImport("ESL", EntryPoint="CSharp_ESLconnection_SendEvent")]
|
||||
public static extern IntPtr ESLconnection_SendEvent(HandleRef jarg1, HandleRef jarg2);
|
||||
|
@ -80,8 +80,8 @@ public class ESLconnection : IDisposable {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public ESLevent Bgapi(string cmd, string arg) {
|
||||
IntPtr cPtr = ESLPINVOKE.ESLconnection_Bgapi(swigCPtr, cmd, arg);
|
||||
public ESLevent Bgapi(string cmd, string arg, string job_uuid) {
|
||||
IntPtr cPtr = ESLPINVOKE.ESLconnection_Bgapi(swigCPtr, cmd, arg, job_uuid);
|
||||
ESLevent ret = (cPtr == IntPtr.Zero) ? null : new ESLevent(cPtr, true);
|
||||
return ret;
|
||||
}
|
||||
|
@ -677,17 +677,19 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Api(void * jarg1, char * jarg
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Bgapi(void * jarg1, char * jarg2, char * jarg3) {
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Bgapi(void * jarg1, char * jarg2, char * jarg3, char * jarg4) {
|
||||
void * jresult ;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3);
|
||||
arg4 = (char *)jarg4;
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
@ -3072,6 +3072,7 @@ XS(_wrap_ESLconnection_bgapi) {
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
@ -3081,11 +3082,14 @@ XS(_wrap_ESLconnection_bgapi) {
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int res4 ;
|
||||
char *buf4 = 0 ;
|
||||
int alloc4 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 3)) {
|
||||
SWIG_croak("Usage: ESLconnection_bgapi(self,cmd,arg);");
|
||||
if ((items < 2) || (items > 4)) {
|
||||
SWIG_croak("Usage: ESLconnection_bgapi(self,cmd,arg,job_uuid);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
@ -3104,16 +3108,25 @@ XS(_wrap_ESLconnection_bgapi) {
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3);
|
||||
if (items > 3) {
|
||||
res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
|
||||
if (!SWIG_IsOK(res4)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ESLconnection_bgapi" "', argument " "4"" of type '" "char const *""'");
|
||||
}
|
||||
arg4 = reinterpret_cast< char * >(buf4);
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
|
||||
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
@ -152,10 +152,11 @@ class ESLconnection {
|
||||
return is_resource($r) ? new ESLevent($r) : $r;
|
||||
}
|
||||
|
||||
function bgapi($cmd,$arg=null) {
|
||||
function bgapi($cmd,$arg=null,$job_uuid=null) {
|
||||
switch (func_num_args()) {
|
||||
case 1: $r=ESLconnection_bgapi($this->_cPtr,$cmd); break;
|
||||
default: $r=ESLconnection_bgapi($this->_cPtr,$cmd,$arg);
|
||||
case 2: $r=ESLconnection_bgapi($this->_cPtr,$cmd,$arg); break;
|
||||
default: $r=ESLconnection_bgapi($this->_cPtr,$cmd,$arg,$job_uuid);
|
||||
}
|
||||
return is_resource($r) ? new ESLevent($r) : $r;
|
||||
}
|
||||
|
@ -2075,13 +2075,14 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_bgapi) {
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
zval **args[3];
|
||||
zval **args[4];
|
||||
int arg_count;
|
||||
|
||||
SWIG_ResetError();
|
||||
arg_count = ZEND_NUM_ARGS();
|
||||
if(arg_count<2 || arg_count>3 ||
|
||||
if(arg_count<2 || arg_count>4 ||
|
||||
zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
|
||||
WRONG_PARAM_COUNT;
|
||||
|
||||
@ -2104,7 +2105,14 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_bgapi) {
|
||||
/*@SWIG@*/;
|
||||
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3);
|
||||
if(arg_count > 3) {
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
convert_to_string_ex(args[3]);
|
||||
arg4 = (char *) Z_STRVAL_PP(args[3]);
|
||||
/*@SWIG@*/;
|
||||
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
{
|
||||
SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0);
|
||||
}
|
||||
|
@ -4151,6 +4151,7 @@ SWIGINTERN PyObject *_wrap_ESLconnection_bgapi(PyObject *SWIGUNUSEDPARM(self), P
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
@ -4160,12 +4161,16 @@ SWIGINTERN PyObject *_wrap_ESLconnection_bgapi(PyObject *SWIGUNUSEDPARM(self), P
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int res4 ;
|
||||
char *buf4 = 0 ;
|
||||
int alloc4 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
PyObject * obj3 = 0 ;
|
||||
|
||||
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO|O:ESLconnection_bgapi",&obj0,&obj1,&obj2)) SWIG_fail;
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO|OO:ESLconnection_bgapi",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_bgapi" "', argument " "1"" of type '" "ESLconnection *""'");
|
||||
@ -4183,19 +4188,28 @@ SWIGINTERN PyObject *_wrap_ESLconnection_bgapi(PyObject *SWIGUNUSEDPARM(self), P
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
}
|
||||
if (obj3) {
|
||||
res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
|
||||
if (!SWIG_IsOK(res4)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ESLconnection_bgapi" "', argument " "4"" of type '" "char const *""'");
|
||||
}
|
||||
arg4 = reinterpret_cast< char * >(buf4);
|
||||
}
|
||||
{
|
||||
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3);
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
SWIG_PYTHON_THREAD_END_ALLOW;
|
||||
}
|
||||
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return resultobj;
|
||||
fail:
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
SWIG_PYTHON_THREAD_END_BLOCK;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -3055,6 +3055,7 @@ _wrap_ESLconnection_bgapi(int argc, VALUE *argv, VALUE self) {
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
@ -3064,9 +3065,12 @@ _wrap_ESLconnection_bgapi(int argc, VALUE *argv, VALUE self) {
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int res4 ;
|
||||
char *buf4 = 0 ;
|
||||
int alloc4 = 0 ;
|
||||
VALUE vresult = Qnil;
|
||||
|
||||
if ((argc < 1) || (argc > 2)) {
|
||||
if ((argc < 1) || (argc > 3)) {
|
||||
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
|
||||
@ -3086,14 +3090,23 @@ _wrap_ESLconnection_bgapi(int argc, VALUE *argv, VALUE self) {
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3);
|
||||
if (argc > 2) {
|
||||
res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
|
||||
if (!SWIG_IsOK(res4)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","bgapi", 4, argv[2] ));
|
||||
}
|
||||
arg4 = reinterpret_cast< char * >(buf4);
|
||||
}
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_POINTER_OWN | 0 );
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
return vresult;
|
||||
fail:
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
@ -949,15 +949,18 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_
|
||||
while(!revent && handle->connected) {
|
||||
esl_size_t len1;
|
||||
|
||||
if ((len1 = esl_buffer_read_packet(handle->packet_buf, handle->socket_buf, sizeof(handle->socket_buf)))) {
|
||||
if ((len1 = esl_buffer_read_packet(handle->packet_buf, handle->socket_buf, sizeof(handle->socket_buf) - 1))) {
|
||||
char *data = (char *) handle->socket_buf;
|
||||
char *p, *e;
|
||||
|
||||
*(data + len1) = '\0';
|
||||
|
||||
esl_event_create(&revent, ESL_EVENT_CLONE);
|
||||
revent->event_id = ESL_EVENT_SOCKET_DATA;
|
||||
esl_event_add_header_string(revent, ESL_STACK_BOTTOM, "Event-Name", "SOCKET_DATA");
|
||||
|
||||
hname = p = data;
|
||||
|
||||
while(p) {
|
||||
hname = p;
|
||||
p = NULL;
|
||||
@ -984,7 +987,8 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_
|
||||
break;
|
||||
}
|
||||
|
||||
rrval = handle_recv(handle, handle->socket_buf, sizeof(handle->socket_buf));
|
||||
rrval = handle_recv(handle, handle->socket_buf, sizeof(handle->socket_buf) - 1);
|
||||
*((char *)handle->socket_buf + rrval) = '\0';
|
||||
|
||||
if (rrval == 0) {
|
||||
if (++zc >= 100) {
|
||||
@ -1020,7 +1024,8 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_
|
||||
if (s >= len) {
|
||||
sofar = esl_buffer_read(handle->packet_buf, body, len);
|
||||
} else {
|
||||
r = handle_recv(handle, handle->socket_buf, sizeof(handle->socket_buf));
|
||||
r = handle_recv(handle, handle->socket_buf, sizeof(handle->socket_buf) - 1);
|
||||
*((char *)handle->socket_buf + r) = '\0';
|
||||
|
||||
if (r < 0) {
|
||||
strerror_r(handle->errnum, handle->err, sizeof(handle->err));
|
||||
@ -1061,7 +1066,10 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_
|
||||
hval = esl_event_get_header(revent, "content-type");
|
||||
|
||||
if (!esl_safe_strcasecmp(hval, "text/disconnect-notice") && revent->body) {
|
||||
goto fail;
|
||||
const char *dval = esl_event_get_header(revent, "content-disposition");
|
||||
if (esl_strlen_zero(dval) || strcasecmp(dval, "linger")) {
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
if (revent->body) {
|
||||
|
@ -131,6 +131,8 @@ static const char *EVENT_NAMES[] = {
|
||||
"NAT",
|
||||
"RECORD_START",
|
||||
"RECORD_STOP",
|
||||
"PLAYBACK_START",
|
||||
"PLAYBACK_STOP",
|
||||
"CALL_UPDATE",
|
||||
"FAILURE",
|
||||
"SOCKET_DATA",
|
||||
|
@ -105,7 +105,7 @@ ESLevent *ESLconnection::api(const char *cmd, const char *arg)
|
||||
return event;
|
||||
}
|
||||
|
||||
ESLevent *ESLconnection::bgapi(const char *cmd, const char *arg)
|
||||
ESLevent *ESLconnection::bgapi(const char *cmd, const char *arg, const char *job_uuid)
|
||||
{
|
||||
size_t len;
|
||||
char *cmd_buf;
|
||||
@ -115,12 +115,17 @@ ESLevent *ESLconnection::bgapi(const char *cmd, const char *arg)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
len = strlen(cmd) + (arg ? strlen(arg) : 0) + 10;
|
||||
len = strlen(cmd) + (arg ? strlen(arg) : 0) + (job_uuid ? strlen(job_uuid) + 12 : 0) + 10;
|
||||
|
||||
cmd_buf = (char *) malloc(len + 1);
|
||||
assert(cmd_buf);
|
||||
|
||||
if (job_uuid) {
|
||||
snprintf(cmd_buf, len, "bgapi %s%s%s\nJob-UUID: %s", cmd, arg ? " " : "", arg ? arg : "", job_uuid);
|
||||
} else {
|
||||
snprintf(cmd_buf, len, "bgapi %s%s%s", cmd, arg ? " " : "", arg ? arg : "");
|
||||
}
|
||||
|
||||
snprintf(cmd_buf, len, "bgapi %s %s", cmd, arg ? arg : "");
|
||||
*(cmd_buf + (len)) = '\0';
|
||||
|
||||
event = sendRecv(cmd_buf);
|
||||
|
@ -119,6 +119,8 @@ typedef enum {
|
||||
ESL_EVENT_NAT,
|
||||
ESL_EVENT_RECORD_START,
|
||||
ESL_EVENT_RECORD_STOP,
|
||||
ESL_EVENT_PLAYBACK_START,
|
||||
ESL_EVENT_PLAYBACK_STOP,
|
||||
ESL_EVENT_CALL_UPDATE,
|
||||
ESL_EVENT_FAILURE,
|
||||
ESL_EVENT_SOCKET_DATA,
|
||||
|
@ -82,7 +82,7 @@ class ESLconnection {
|
||||
int send(const char *cmd);
|
||||
ESLevent *sendRecv(const char *cmd);
|
||||
ESLevent *api(const char *cmd, const char *arg = NULL);
|
||||
ESLevent *bgapi(const char *cmd, const char *arg = NULL);
|
||||
ESLevent *bgapi(const char *cmd, const char *arg = NULL, const char *job_uuid = NULL);
|
||||
ESLevent *sendEvent(ESLevent *send_me);
|
||||
ESLevent *recvEvent();
|
||||
ESLevent *recvEventTimed(int ms);
|
||||
|
@ -61,7 +61,7 @@ LINK = $(LIBTOOL) --mode=link --tag=CC $(CC) $(FTDM_CFLAGS) $(LDFLAGS) -o $
|
||||
#
|
||||
EXTRA_DIST = freetdm.pc.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
pkgconfig_DATA = freetdm.pc
|
||||
|
||||
|
||||
|
@ -54,6 +54,9 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
<!-- whether you want to wait for caller id -->
|
||||
<param name="enable-callerid" value="true"/>
|
||||
|
||||
<!-- How much to wait for dial tone (0 if you just want to dial out immediately without waiting for dial tone) -->
|
||||
<!--<param name="wait-dialtone-timeout" value="5000"/>-->
|
||||
|
||||
<!-- whether you want to enable callwaiting feature -->
|
||||
<!--<param name="callwaiting" value="true"/>-->
|
||||
|
||||
|
@ -65,6 +65,18 @@ AC_ARG_WITH([modinstdir],
|
||||
)
|
||||
AC_SUBST([modinstdir])
|
||||
|
||||
# freetdm.pc pkgconfig file
|
||||
AC_ARG_WITH([pkgconfigdir],
|
||||
[AS_HELP_STRING([--with-pkgconfigdir=DIR], [Installation directory for pkgconfig file (default: ${libdir}/pkgconfig)])],
|
||||
[case "${withval}" in
|
||||
yes|no) AC_MSG_ERROR([Invalid value ${withval} for option --with-pkgconfigdir]) ;;
|
||||
*) pkgconfigdir="${withval}" ;;
|
||||
esac
|
||||
],
|
||||
[pkgconfigdir="${libdir}/pkgconfig"]
|
||||
)
|
||||
AC_SUBST([pkgconfigdir])
|
||||
|
||||
AC_ARG_ENABLE([enable_64],
|
||||
[AS_HELP_STRING([--enable-64], [Enable 64bit compilation])],
|
||||
[enable_64="${enableval}"],
|
||||
|
@ -2780,6 +2780,7 @@ static switch_status_t load_config(void)
|
||||
const char *hangup_polarity = "false";
|
||||
int polarity_delay = 600;
|
||||
int callwaiting = 1;
|
||||
int dialtone_timeout = 5000;
|
||||
|
||||
uint32_t span_id = 0, to = 0, max = 0;
|
||||
ftdm_span_t *span = NULL;
|
||||
@ -2820,6 +2821,8 @@ static switch_status_t load_config(void)
|
||||
tonegroup = val;
|
||||
} else if (!strcasecmp(var, "digit_timeout") || !strcasecmp(var, "digit-timeout")) {
|
||||
digit_timeout = val;
|
||||
} else if (!strcasecmp(var, "wait-dialtone-timeout")) {
|
||||
dialtone_timeout = atoi(val);
|
||||
} else if (!strcasecmp(var, "context")) {
|
||||
context = val;
|
||||
} else if (!strcasecmp(var, "dialplan")) {
|
||||
@ -2920,6 +2923,7 @@ static switch_status_t load_config(void)
|
||||
"hangup_polarity_reverse", hangup_polarity,
|
||||
"polarity_delay", &polarity_delay,
|
||||
"callwaiting", &callwaiting,
|
||||
"wait_dialtone_timeout", &dialtone_timeout,
|
||||
FTDM_TAG_END) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "Error configuring FreeTDM analog span %s\n", ftdm_span_get_name(span));
|
||||
continue;
|
||||
|
@ -2335,7 +2335,7 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_indicate(const char *file, const ch
|
||||
break;
|
||||
case FTDM_CHANNEL_INDICATE_PROCEED:
|
||||
if (!ftdm_test_flag(ftdmchan->span, FTDM_SPAN_USE_PROCEED_STATE) ||
|
||||
ftdmchan->state == FTDM_CHANNEL_STATE_PROCEED) {
|
||||
ftdmchan->state >= FTDM_CHANNEL_STATE_PROCEED) {
|
||||
ftdm_ack_indication(ftdmchan, indication, status);
|
||||
goto done;
|
||||
}
|
||||
@ -2411,11 +2411,6 @@ static ftdm_status_t _ftdm_channel_call_place_nl(const char *file, const char *f
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (ftdmchan->state != FTDM_CHANNEL_STATE_DOWN) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Cannot place call in channel in state %s!\n", ftdm_channel_state2str(ftdmchan->state));
|
||||
goto done;
|
||||
}
|
||||
|
||||
status = ftdmchan->span->outgoing_call(ftdmchan);
|
||||
if (status == FTDM_BREAK) {
|
||||
/* the signaling module detected glare on time */
|
||||
@ -5542,17 +5537,30 @@ FT_DECLARE(ftdm_status_t) ftdm_global_init(void)
|
||||
ftdm_mutex_create(&globals.call_id_mutex);
|
||||
|
||||
ftdm_sched_global_init();
|
||||
globals.running = 1;
|
||||
if (ftdm_sched_create(&globals.timingsched, "freetdm-master") != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_CRIT, "Failed to create master timing schedule context\n");
|
||||
return FTDM_FAIL;
|
||||
goto global_init_fail;
|
||||
}
|
||||
if (ftdm_sched_free_run(globals.timingsched) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_CRIT, "Failed to run master timing schedule context\n");
|
||||
return FTDM_FAIL;
|
||||
goto global_init_fail;
|
||||
}
|
||||
|
||||
globals.running = 1;
|
||||
|
||||
return FTDM_SUCCESS;
|
||||
|
||||
global_init_fail:
|
||||
globals.running = 0;
|
||||
ftdm_mutex_destroy(&globals.mutex);
|
||||
ftdm_mutex_destroy(&globals.span_mutex);
|
||||
ftdm_mutex_destroy(&globals.group_mutex);
|
||||
ftdm_mutex_destroy(&globals.call_id_mutex);
|
||||
hashtable_destroy(globals.interface_hash);
|
||||
hashtable_destroy(globals.module_hash);
|
||||
hashtable_destroy(globals.span_hash);
|
||||
hashtable_destroy(globals.group_hash);
|
||||
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
FT_DECLARE(ftdm_status_t) ftdm_global_configuration(void)
|
||||
|
@ -182,7 +182,7 @@ static FIO_SIG_CONFIGURE_FUNCTION(ftdm_analog_configure_span)
|
||||
const char *tonemap = "us";
|
||||
const char *hotline = "";
|
||||
uint32_t digit_timeout = 10;
|
||||
uint32_t wait_dialtone_timeout = 30000;
|
||||
uint32_t wait_dialtone_timeout = 5000;
|
||||
uint32_t max_dialstr = MAX_DTMF;
|
||||
uint32_t polarity_delay = 600;
|
||||
const char *var, *val;
|
||||
|
@ -649,7 +649,7 @@ void sngisdn_process_rel_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_TERMINATING:
|
||||
if (sngisdn_test_flag(sngisdn_info, FLAG_GLARE) &&
|
||||
sngisdn_info->glare.suInstId != suInstId) {
|
||||
sngisdn_info->glare.suInstId != suInstId) {
|
||||
/* This release if for the outbound call that we already started clearing */
|
||||
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Received RELEASE for local glared call\n");
|
||||
@ -667,7 +667,6 @@ void sngisdn_process_rel_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
default:
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_CRIT, "Received RELEASE in an invalid state (%s)\n",
|
||||
ftdm_channel_state2str(ftdmchan->state));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,10 @@ struct stfu_instance {
|
||||
|
||||
int32_t ts_offset;
|
||||
int32_t ts_drift;
|
||||
|
||||
int32_t max_drift;
|
||||
uint32_t drift_dropped_packets;
|
||||
uint32_t drift_max_dropped;
|
||||
|
||||
int32_t ts_diff;
|
||||
int32_t last_ts_diff;
|
||||
int32_t same_ts;
|
||||
@ -258,7 +261,7 @@ stfu_status_t stfu_n_resize(stfu_instance_t *i, uint32_t qlen)
|
||||
return s;
|
||||
}
|
||||
|
||||
stfu_instance_t *stfu_n_init(uint32_t qlen, uint32_t max_qlen, uint32_t samples_per_packet, uint32_t samples_per_second)
|
||||
stfu_instance_t *stfu_n_init(uint32_t qlen, uint32_t max_qlen, uint32_t samples_per_packet, uint32_t samples_per_second, uint32_t max_drift_ms)
|
||||
{
|
||||
struct stfu_instance *i;
|
||||
|
||||
@ -277,6 +280,12 @@ stfu_instance_t *stfu_n_init(uint32_t qlen, uint32_t max_qlen, uint32_t samples_
|
||||
stfu_n_init_aqueue(&i->b_queue, qlen);
|
||||
stfu_n_init_aqueue(&i->c_queue, qlen);
|
||||
|
||||
i->max_drift = (int32_t)(max_drift_ms * (samples_per_second / 1000) * -1);
|
||||
|
||||
if (max_drift_ms && samples_per_packet) {
|
||||
i->drift_max_dropped = (samples_per_second * 2) / samples_per_packet;
|
||||
}
|
||||
|
||||
i->in_queue = &i->a_queue;
|
||||
i->out_queue = &i->b_queue;
|
||||
i->old_queue = &i->c_queue;
|
||||
@ -396,6 +405,9 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint32_t pt, void
|
||||
if (i->last_ts_diff == i->ts_diff) {
|
||||
if (++i->same_ts == 5) {
|
||||
i->samples_per_packet = i->ts_diff;
|
||||
if (i->max_drift && i->samples_per_packet) {
|
||||
i->drift_max_dropped = (i->samples_per_second * 2) / i->samples_per_packet;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
i->same_ts = 0;
|
||||
@ -409,11 +421,24 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint32_t pt, void
|
||||
}
|
||||
}
|
||||
|
||||
if (timer_ts && ts && !i->ts_offset) {
|
||||
i->ts_offset = timer_ts - ts;
|
||||
}
|
||||
if (timer_ts) {
|
||||
if (ts && !i->ts_offset) {
|
||||
i->ts_offset = timer_ts - ts;
|
||||
}
|
||||
|
||||
i->ts_drift = ts + (i->ts_offset - timer_ts);
|
||||
i->ts_drift = ts + (i->ts_offset - timer_ts);
|
||||
|
||||
if (i->max_drift) {
|
||||
if (i->ts_drift < i->max_drift) {
|
||||
if (++i->drift_dropped_packets < i->drift_max_dropped) {
|
||||
stfu_log(STFU_LOG_EMERG, "%s TOO LATE !!! %u \n\n\n", i->name, ts);
|
||||
return STFU_ITS_TOO_LATE;
|
||||
}
|
||||
} else {
|
||||
i->drift_dropped_packets = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i->sync_in) {
|
||||
good_ts = 1;
|
||||
@ -493,12 +518,12 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint32_t pt, void
|
||||
|
||||
|
||||
if (stfu_log != null_logger && i->debug) {
|
||||
stfu_log(STFU_LOG_EMERG, "I: %s %u i=%u/%u - g:%u/%u c:%u/%u b:%u - %u:%u - %u %d %u %u %d %d %d\n", i->name,
|
||||
stfu_log(STFU_LOG_EMERG, "I: %s %u i=%u/%u - g:%u/%u c:%u/%u b:%u - %u:%u - %u %d %u %u %d %d %d/%d\n", i->name,
|
||||
i->qlen, i->period_packet_in_count, i->period_time, i->consecutive_good_count,
|
||||
i->decrement_time, i->period_clean_count, i->decrement_time, i->consecutive_bad_count,
|
||||
ts, ts / i->samples_per_packet,
|
||||
i->period_missing_count, i->period_need_range_avg,
|
||||
i->last_wr_ts, ts, i->diff, i->diff_total / least1(i->period_packet_in_count), i->ts_drift);
|
||||
i->last_wr_ts, ts, i->diff, i->diff_total / least1(i->period_packet_in_count), i->ts_drift, i->max_drift);
|
||||
}
|
||||
|
||||
if (last || i->in_queue->array_len == i->in_queue->array_size) {
|
||||
@ -597,7 +622,7 @@ stfu_frame_t *stfu_n_read_a_frame(stfu_instance_t *i)
|
||||
|
||||
if (!i->ready) {
|
||||
if (stfu_log != null_logger && i->debug) {
|
||||
stfu_log(STFU_LOG_EMERG, "%s XXXSKIP\n", i->name);
|
||||
stfu_log(STFU_LOG_EMERG, "%s JITTERBUFFER NOT READY: IGNORING FRAME\n", i->name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -612,7 +637,7 @@ stfu_frame_t *stfu_n_read_a_frame(stfu_instance_t *i)
|
||||
}
|
||||
if (i->cur_ts == 0) {
|
||||
if (stfu_log != null_logger && i->debug) {
|
||||
stfu_log(STFU_LOG_EMERG, "%s XXXPUNT\n", i->name);
|
||||
stfu_log(STFU_LOG_EMERG, "%s JITTERBUFFER ERROR: PUNTING\n", i->name);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ typedef void (*stfu_n_call_me_t)(stfu_instance_t *i, void *);
|
||||
|
||||
void stfu_n_report(stfu_instance_t *i, stfu_report_t *r);
|
||||
void stfu_n_destroy(stfu_instance_t **i);
|
||||
stfu_instance_t *stfu_n_init(uint32_t qlen, uint32_t max_qlen, uint32_t samples_per_packet, uint32_t samples_per_second);
|
||||
stfu_instance_t *stfu_n_init(uint32_t qlen, uint32_t max_qlen, uint32_t samples_per_packet, uint32_t samples_per_second, uint32_t max_drift_ms);
|
||||
stfu_status_t stfu_n_resize(stfu_instance_t *i, uint32_t qlen);
|
||||
stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint32_t pt, void *data, size_t datalen, uint32_t timer_ts, int last);
|
||||
stfu_frame_t *stfu_n_read_a_frame(stfu_instance_t *i);
|
||||
|
@ -249,6 +249,8 @@ struct switch_runtime {
|
||||
switch_dbtype_t odbc_dbtype;
|
||||
char hostname[256];
|
||||
int multiple_registrations;
|
||||
uint32_t max_db_handles;
|
||||
uint32_t db_handle_timeout;
|
||||
};
|
||||
|
||||
extern struct switch_runtime runtime;
|
||||
|
@ -79,6 +79,7 @@ SWITCH_DECLARE(int) switch_channel_test_ready(switch_channel_t *channel, switch_
|
||||
|
||||
#define switch_channel_ready(_channel) switch_channel_test_ready(_channel, SWITCH_TRUE, SWITCH_FALSE)
|
||||
#define switch_channel_media_ready(_channel) switch_channel_test_ready(_channel, SWITCH_TRUE, SWITCH_TRUE)
|
||||
#define switch_channel_media_up(_channel) (switch_channel_test_flag(_channel, CF_ANSWERED) || switch_channel_test_flag(_channel, CF_EARLY_MEDIA))
|
||||
|
||||
#define switch_channel_up(_channel) (switch_channel_get_state(_channel) < CS_HANGUP)
|
||||
#define switch_channel_down(_channel) (switch_channel_get_state(_channel) >= CS_HANGUP)
|
||||
|
@ -2075,52 +2075,40 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_preprocess_session(switch_core_sessio
|
||||
*/
|
||||
|
||||
#define CACHE_DB_LEN 256
|
||||
typedef enum {
|
||||
CDF_INUSE = (1 << 0),
|
||||
CDF_PRUNE = (1 << 1)
|
||||
} cache_db_flag_t;
|
||||
typedef enum {
|
||||
CDF_INUSE = (1 << 0),
|
||||
CDF_PRUNE = (1 << 1)
|
||||
} cache_db_flag_t;
|
||||
|
||||
typedef enum {
|
||||
SCDB_TYPE_CORE_DB,
|
||||
SCDB_TYPE_ODBC
|
||||
} switch_cache_db_handle_type_t;
|
||||
typedef enum {
|
||||
SCDB_TYPE_CORE_DB,
|
||||
SCDB_TYPE_ODBC
|
||||
} switch_cache_db_handle_type_t;
|
||||
|
||||
typedef union {
|
||||
switch_core_db_t *core_db_dbh;
|
||||
switch_odbc_handle_t *odbc_dbh;
|
||||
} switch_cache_db_native_handle_t;
|
||||
typedef union {
|
||||
switch_core_db_t *core_db_dbh;
|
||||
switch_odbc_handle_t *odbc_dbh;
|
||||
} switch_cache_db_native_handle_t;
|
||||
|
||||
typedef struct {
|
||||
char *db_path;
|
||||
} switch_cache_db_core_db_options_t;
|
||||
typedef struct {
|
||||
char *db_path;
|
||||
} switch_cache_db_core_db_options_t;
|
||||
|
||||
typedef struct {
|
||||
char *dsn;
|
||||
char *user;
|
||||
char *pass;
|
||||
} switch_cache_db_odbc_options_t;
|
||||
typedef struct {
|
||||
char *dsn;
|
||||
char *user;
|
||||
char *pass;
|
||||
} switch_cache_db_odbc_options_t;
|
||||
|
||||
typedef union {
|
||||
switch_cache_db_core_db_options_t core_db_options;
|
||||
switch_cache_db_odbc_options_t odbc_options;
|
||||
} switch_cache_db_connection_options_t;
|
||||
typedef union {
|
||||
switch_cache_db_core_db_options_t core_db_options;
|
||||
switch_cache_db_odbc_options_t odbc_options;
|
||||
} switch_cache_db_connection_options_t;
|
||||
|
||||
typedef struct {
|
||||
char name[CACHE_DB_LEN];
|
||||
switch_cache_db_handle_type_t type;
|
||||
switch_cache_db_native_handle_t native_handle;
|
||||
time_t last_used;
|
||||
switch_mutex_t *mutex;
|
||||
switch_mutex_t *io_mutex;
|
||||
switch_memory_pool_t *pool;
|
||||
int32_t flags;
|
||||
unsigned long hash;
|
||||
char creator[CACHE_DB_LEN];
|
||||
char last_user[CACHE_DB_LEN];
|
||||
} switch_cache_db_handle_t;
|
||||
struct switch_cache_db_handle;
|
||||
typedef struct switch_cache_db_handle switch_cache_db_handle_t;
|
||||
|
||||
|
||||
static inline const char *switch_cache_db_type_name(switch_cache_db_handle_type_t type)
|
||||
static inline const char *switch_cache_db_type_name(switch_cache_db_handle_type_t type)
|
||||
{
|
||||
const char *type_str = "INVALID";
|
||||
|
||||
@ -2140,6 +2128,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_preprocess_session(switch_core_sessio
|
||||
return type_str;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_cache_db_handle_type_t) switch_cache_db_get_type(switch_cache_db_handle_t *dbh);
|
||||
|
||||
/*!
|
||||
\brief Returns the handle to the pool, immediately available for other
|
||||
threads to use.
|
||||
@ -2152,11 +2142,6 @@ SWITCH_DECLARE(void) switch_cache_db_dismiss_db_handle(switch_cache_db_handle_t
|
||||
\param [in] The handle
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_cache_db_release_db_handle(switch_cache_db_handle_t ** dbh);
|
||||
/*!
|
||||
\brief Removes the handle from the pool and frees up the handle resources.
|
||||
\param [in] The handle
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_cache_db_destroy_db_handle(switch_cache_db_handle_t ** dbh);
|
||||
/*!
|
||||
\brief Gets a new cached handle from the pool, potentially creating a new connection.
|
||||
The connection is bound to the thread until it (the thread) terminates unless
|
||||
@ -2217,19 +2202,40 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand
|
||||
const char *test_sql, const char *drop_sql, const char *reactive_sql);
|
||||
SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute(switch_cache_db_handle_t *dbh, const char *sql, uint32_t retries);
|
||||
SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_cache_db_handle_t *dbh, char *sql, uint32_t retries);
|
||||
/*!
|
||||
\brief Tries to detach all free connections from current thread.
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_cache_db_detach(void);
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_core_debug_level(void);
|
||||
SWITCH_DECLARE(void) switch_cache_db_flush_handles(void);
|
||||
SWITCH_DECLARE(const char *) switch_core_banner(void);
|
||||
SWITCH_DECLARE(switch_bool_t) switch_core_session_in_thread(switch_core_session_t *session);
|
||||
SWITCH_DECLARE(uint32_t) switch_default_ptime(const char *name, uint32_t number);
|
||||
|
||||
/*!
|
||||
\brief Add user registration
|
||||
\param [in] user
|
||||
\param [in] realm
|
||||
\param [in] token
|
||||
\param [in] url - a freeswitch dial string
|
||||
\param [in] expires
|
||||
\param [in] network_ip
|
||||
\param [in] network_port
|
||||
\param [in] network_proto - one of tls, tcp, udp
|
||||
\param [out] err - Error if it exists
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_add_registration(const char *user, const char *realm, const char *token, const char *url, uint32_t expires,
|
||||
const char *network_ip, const char *network_port, const char *network_proto);
|
||||
/*!
|
||||
\brief Delete user registration
|
||||
\param [in] user
|
||||
\param [in] realm
|
||||
\param [in] token
|
||||
\param [out] err - Error if it exists
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_del_registration(const char *user, const char *realm, const char *token);
|
||||
/*!
|
||||
\brief Expire user registrations
|
||||
\param [in] force delete all registrations
|
||||
\param [out] err - Error if it exists
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_expire_registration(int force);
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
@ -39,6 +39,7 @@
|
||||
|
||||
*/
|
||||
#define switch_normalize_volume(x) if (x > 4) x = 4; if (x < -4) x = -4;
|
||||
#define switch_normalize_volume_granular(x) if (x > 12) x = 12; if (x < -12) x = -12;
|
||||
|
||||
#ifndef SWITCH_RESAMPLE_H
|
||||
#define SWITCH_RESAMPLE_H
|
||||
@ -158,6 +159,14 @@ SWITCH_DECLARE(void) switch_generate_sln_silence(int16_t *data, uint32_t samples
|
||||
\param vol the volume factor -4 -> 4
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_change_sln_volume(int16_t *data, uint32_t samples, int32_t vol);
|
||||
|
||||
/*!
|
||||
\brief Change the volume of a signed linear audio frame with more granularity
|
||||
\param data the audio data
|
||||
\param samples the number of 2 byte samples
|
||||
\param vol the volume factor -12 -> 12
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_change_sln_volume_granular(int16_t *data, uint32_t samples, int32_t vol);
|
||||
///\}
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_merge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples);
|
||||
|
@ -232,7 +232,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_rtcp(switch_rtp_t *rtp_sessi
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_activate_jitter_buffer(switch_rtp_t *rtp_session,
|
||||
uint32_t queue_frames,
|
||||
uint32_t max_queue_frames,
|
||||
uint32_t samples_per_packet, uint32_t samples_per_second);
|
||||
uint32_t samples_per_packet, uint32_t samples_per_second, uint32_t max_drift);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_debug_jitter_buffer(switch_rtp_t *rtp_session, const char *name);
|
||||
|
||||
|
@ -1504,6 +1504,8 @@ typedef enum {
|
||||
SWITCH_EVENT_NAT,
|
||||
SWITCH_EVENT_RECORD_START,
|
||||
SWITCH_EVENT_RECORD_STOP,
|
||||
SWITCH_EVENT_PLAYBACK_START,
|
||||
SWITCH_EVENT_PLAYBACK_STOP,
|
||||
SWITCH_EVENT_CALL_UPDATE,
|
||||
SWITCH_EVENT_FAILURE,
|
||||
SWITCH_EVENT_SOCKET_DATA,
|
||||
|
@ -189,10 +189,12 @@ static inline char switch_itodtmf(char i)
|
||||
char r = i;
|
||||
|
||||
if (i > 9 && i < 14) {
|
||||
r = i + 55;
|
||||
r += 55;
|
||||
} else {
|
||||
r += 48;
|
||||
}
|
||||
|
||||
return r + 48;
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline int switch_dtmftoi(char *s)
|
||||
|
@ -1223,7 +1223,7 @@ static switch_status_t load_agent(const char *agent_name)
|
||||
cc_agent_update("reject_delay_time", reject_delay_time, agent_name);
|
||||
}
|
||||
if (busy_delay_time) {
|
||||
cc_agent_update("busy_delay_time", reject_delay_time, agent_name);
|
||||
cc_agent_update("busy_delay_time", busy_delay_time, agent_name);
|
||||
}
|
||||
|
||||
if (type && res == CC_STATUS_AGENT_ALREADY_EXIST) {
|
||||
|
@ -90,11 +90,11 @@ static switch_status_t select_url(const char *user,
|
||||
|
||||
if (exclude_contact) {
|
||||
sql = switch_mprintf("select url, '%q' "
|
||||
"from registrations where user='%q' and realm='%q' "
|
||||
"from registrations where reg_user='%q' and realm='%q' "
|
||||
"and url not like '%%%s%%'", (concat != NULL) ? concat : "", user, domain, exclude_contact);
|
||||
} else {
|
||||
sql = switch_mprintf("select url, '%q' "
|
||||
"from registrations where user='%q' and realm='%q'",
|
||||
"from registrations where reg_user='%q' and realm='%q'",
|
||||
(concat != NULL) ? concat : "", user, domain);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2893,7 +2893,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||
switch_xml_t x_domain = NULL, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params;
|
||||
char *user = NULL, *domain = NULL, *dup_domain = NULL;
|
||||
const char *dest = NULL;
|
||||
static switch_call_cause_t cause = SWITCH_CAUSE_NONE;
|
||||
switch_call_cause_t cause = SWITCH_CAUSE_NONE;
|
||||
unsigned int timelimit = 60;
|
||||
switch_channel_t *new_channel = NULL;
|
||||
switch_event_t *params = NULL, *var_event_orig = var_event;
|
||||
|
@ -595,11 +595,12 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
|
||||
callback_t *cbt = (callback_t *) pArg;
|
||||
char *key = NULL;
|
||||
int i = 0;
|
||||
int r = 0;
|
||||
|
||||
switch_memory_pool_t *pool = cbt->pool;
|
||||
|
||||
additional = switch_core_alloc(pool, sizeof(lcr_obj_t));
|
||||
additional->fields = switch_core_alloc(pool, sizeof(switch_event_t));
|
||||
switch_event_create(&additional->fields, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
|
||||
for (i = 0; i < argc ; i++) {
|
||||
if (CF("lcr_digits")) {
|
||||
@ -652,9 +653,9 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Adding %s to head of list\n", additional->carrier_name);
|
||||
if (switch_core_hash_insert(cbt->dedup_hash, key, additional) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error inserting into dedup hash\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
r = -1; goto end;
|
||||
}
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
r = 0; goto end;
|
||||
}
|
||||
|
||||
|
||||
@ -676,7 +677,7 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
|
||||
additional->prev = current;
|
||||
if (switch_core_hash_insert(cbt->dedup_hash, key, additional) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error inserting into dedup hash\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
r = -1; goto end;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -697,7 +698,7 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
|
||||
current->prev = additional;
|
||||
if (switch_core_hash_insert(cbt->dedup_hash, key, additional) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error inserting into dedup hash\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
r = -1; goto end;
|
||||
}
|
||||
break;
|
||||
} else if (current->next == NULL) {
|
||||
@ -707,13 +708,19 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
|
||||
additional->prev = current;
|
||||
if (switch_core_hash_insert(cbt->dedup_hash, key, additional) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error inserting into dedup hash\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
r = -1; goto end;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
end:
|
||||
|
||||
switch_event_destroy(&additional->fields);
|
||||
|
||||
return r;
|
||||
|
||||
}
|
||||
|
||||
static int intrastatelata_callback(void *pArg, int argc, char **argv, char **columnNames)
|
||||
|
@ -114,7 +114,13 @@ SWITCH_STANDARD_APP(valet_parking_function)
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_event_t *event;
|
||||
char dtmf_buf[128] = "";
|
||||
int is_auto = 0;
|
||||
int is_auto = 0, play_announce = 1;
|
||||
const char *var;
|
||||
|
||||
|
||||
if ((var = switch_channel_get_variable(channel, "valet_announce_slot"))) {
|
||||
play_announce = switch_true(var);
|
||||
}
|
||||
|
||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
|
||||
@ -254,7 +260,9 @@ SWITCH_STANDARD_APP(valet_parking_function)
|
||||
switch_core_session_t *b_session;
|
||||
|
||||
if ((b_session = switch_core_session_locate(uuid))) {
|
||||
switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
|
||||
if (play_announce) {
|
||||
switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
|
||||
}
|
||||
switch_ivr_session_transfer(b_session, dest, "inline", NULL);
|
||||
switch_mutex_unlock(lot->mutex);
|
||||
switch_core_session_rwunlock(b_session);
|
||||
@ -263,7 +271,9 @@ SWITCH_STANDARD_APP(valet_parking_function)
|
||||
}
|
||||
}
|
||||
|
||||
switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
|
||||
if (play_announce) {
|
||||
switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -3155,15 +3155,19 @@ static switch_status_t recog_asr_disable_all_grammars(switch_asr_handle_t *ah)
|
||||
static switch_status_t recog_asr_close(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
|
||||
{
|
||||
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
||||
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
||||
speech_channel_stop(schannel);
|
||||
speech_channel_destroy(schannel);
|
||||
switch_core_hash_destroy(&r->grammars);
|
||||
switch_core_hash_destroy(&r->enabled_grammars);
|
||||
if (r->dtmf_generator) {
|
||||
mpf_dtmf_generator_destroy(r->dtmf_generator);
|
||||
}
|
||||
recognizer_data_t *r = NULL;
|
||||
|
||||
/* close if not already closed */
|
||||
if (schannel != NULL && !switch_test_flag(ah, SWITCH_ASR_FLAG_CLOSED)) {
|
||||
r = (recognizer_data_t *) schannel->data;
|
||||
speech_channel_stop(schannel);
|
||||
speech_channel_destroy(schannel);
|
||||
switch_core_hash_destroy(&r->grammars);
|
||||
switch_core_hash_destroy(&r->enabled_grammars);
|
||||
if (r->dtmf_generator) {
|
||||
mpf_dtmf_generator_destroy(r->dtmf_generator);
|
||||
}
|
||||
}
|
||||
/* this lets FreeSWITCH's speech_thread know the handle is closed */
|
||||
switch_set_flag(ah, SWITCH_ASR_FLAG_CLOSED);
|
||||
|
||||
|
@ -77,6 +77,7 @@ typedef enum {
|
||||
TFLAG_TERM = (1 << 20),
|
||||
TFLAG_TRANSPORT_ACCEPT = (1 << 21),
|
||||
TFLAG_READY = (1 << 22),
|
||||
TFLAG_NAT_MAP = (1 << 22)
|
||||
} TFLAGS;
|
||||
|
||||
typedef enum {
|
||||
@ -158,6 +159,7 @@ struct private_object {
|
||||
ldl_session_t *dlsession;
|
||||
char *remote_ip;
|
||||
switch_port_t local_port;
|
||||
switch_port_t adv_local_port;
|
||||
switch_port_t remote_port;
|
||||
char local_user[17];
|
||||
char local_pass[17];
|
||||
@ -596,9 +598,9 @@ static void ipchanged_event_handler(switch_event_t *event)
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "EVENT_TRAP: IP change detected\n");
|
||||
|
||||
if (cond && !strcmp(cond, "network-address-change")) {
|
||||
const char *old_ip4 = switch_event_get_header_nil(event, "network-address-previous-v4");
|
||||
const char *new_ip4 = switch_event_get_header_nil(event, "network-address-change-v4");
|
||||
if (cond && !strcmp(cond, "network-external-address-change")) {
|
||||
const char *old_ip4 = switch_event_get_header_nil(event, "network-external-address-previous-v4");
|
||||
const char *new_ip4 = switch_event_get_header_nil(event, "network-external-address-change-v4");
|
||||
switch_hash_index_t *hi;
|
||||
void *val;
|
||||
char *tmp;
|
||||
@ -886,11 +888,22 @@ static int activate_rtp(struct private_object *tech_pvt)
|
||||
if (globals.auto_nat && tech_pvt->profile->local_network && !switch_check_network_list_ip(tech_pvt->remote_ip, tech_pvt->profile->local_network)) {
|
||||
switch_port_t external_port = 0;
|
||||
switch_nat_add_mapping((switch_port_t) tech_pvt->local_port, SWITCH_NAT_UDP, &external_port, SWITCH_FALSE);
|
||||
tech_pvt->local_port = external_port;
|
||||
|
||||
if (external_port) {
|
||||
tech_pvt->adv_local_port = external_port;
|
||||
switch_set_flag(tech_pvt, TFLAG_NAT_MAP);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "NAT mapping returned 0. Run freeswitch with -nonat since it's not working right.\n");
|
||||
}
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "SETUP RTP %s:%d -> %s:%d\n", tech_pvt->profile->ip,
|
||||
tech_pvt->local_port, tech_pvt->remote_ip, tech_pvt->remote_port);
|
||||
if (tech_pvt->adv_local_port != tech_pvt->local_port) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "SETUP RTP %s:%d(%d) -> %s:%d\n", tech_pvt->profile->ip,
|
||||
tech_pvt->local_port, tech_pvt->adv_local_port, tech_pvt->remote_ip, tech_pvt->remote_port);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "SETUP RTP %s:%d -> %s:%d\n", tech_pvt->profile->ip,
|
||||
tech_pvt->local_port, tech_pvt->remote_ip, tech_pvt->remote_port);
|
||||
}
|
||||
|
||||
flags = SWITCH_RTP_FLAG_DATAWAIT | SWITCH_RTP_FLAG_GOOGLEHACK | SWITCH_RTP_FLAG_AUTOADJ | SWITCH_RTP_FLAG_RAW_WRITE | SWITCH_RTP_FLAG_AUTO_CNG;
|
||||
|
||||
@ -964,7 +977,7 @@ static int do_candidates(struct private_object *tech_pvt, int force)
|
||||
}
|
||||
|
||||
|
||||
cand[0].port = tech_pvt->local_port;
|
||||
cand[0].port = tech_pvt->adv_local_port;
|
||||
cand[0].address = advip;
|
||||
|
||||
if (!strncasecmp(advip, "stun:", 5)) {
|
||||
@ -1253,9 +1266,9 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
|
||||
tech_pvt->rtp_session = NULL;
|
||||
}
|
||||
|
||||
if (globals.auto_nat && tech_pvt->profile->local_network && tech_pvt->remote_ip && tech_pvt->profile->local_network &&
|
||||
!switch_check_network_list_ip(tech_pvt->remote_ip, tech_pvt->profile->local_network)) {
|
||||
switch_nat_del_mapping((switch_port_t) tech_pvt->local_port, SWITCH_NAT_UDP);
|
||||
if (switch_test_flag(tech_pvt, TFLAG_NAT_MAP)) {
|
||||
switch_nat_del_mapping((switch_port_t) tech_pvt->adv_local_port, SWITCH_NAT_UDP);
|
||||
switch_clear_flag(tech_pvt, TFLAG_NAT_MAP);
|
||||
}
|
||||
|
||||
if (switch_core_codec_ready(&tech_pvt->read_codec)) {
|
||||
@ -1751,6 +1764,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
terminate_session(new_session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||
}
|
||||
tech_pvt->adv_local_port = tech_pvt->local_port;
|
||||
tech_pvt->recip = switch_core_session_strdup(*new_session, full_id);
|
||||
if (dnis) {
|
||||
tech_pvt->dnis = switch_core_session_strdup(*new_session, dnis);
|
||||
@ -2992,6 +3006,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
||||
status = LDL_STATUS_FALSE;
|
||||
goto done;
|
||||
}
|
||||
tech_pvt->adv_local_port = tech_pvt->local_port;
|
||||
switch_set_flag_locked(tech_pvt, TFLAG_ANSWER);
|
||||
tech_pvt->recip = switch_core_session_strdup(session, from);
|
||||
if (!(exten = ldl_session_get_value(dlsession, "dnis"))) {
|
||||
|
@ -651,7 +651,7 @@ int channel_on_routing_callback(void *pArg, int argc, char **argv, char **column
|
||||
} else {
|
||||
send_set_lamp(listener, SKINNY_BUTTON_LINE, line_instance, SKINNY_LAMP_ON);
|
||||
skinny_line_set_state(listener, line_instance, helper->tech_pvt->call_id, SKINNY_IN_USE_REMOTELY);
|
||||
send_select_soft_keys(listener, line_instance, helper->tech_pvt->call_id, 10, 0xffff);
|
||||
send_select_soft_keys(listener, line_instance, helper->tech_pvt->call_id, SKINNY_KEY_SET_IN_USE_HINT, 0xffff);
|
||||
send_display_prompt_status(listener, 0, SKINNY_DISP_IN_USE_REMOTE,
|
||||
line_instance, helper->tech_pvt->call_id);
|
||||
skinny_session_send_call_info(helper->tech_pvt->session, listener, line_instance);
|
||||
@ -1243,6 +1243,21 @@ static void walk_listeners(skinny_listener_callback_func_t callback, void *pvt)
|
||||
switch_mutex_unlock(globals.mutex);
|
||||
}
|
||||
|
||||
static int flush_listener_callback(void *pArg, int argc, char **argv, char **columnNames)
|
||||
{
|
||||
char *profile_name = argv[0];
|
||||
char *value = argv[1];
|
||||
char *domain_name = argv[2];
|
||||
char *device_name = argv[3];
|
||||
char *device_instance = argv[4];
|
||||
|
||||
char *token = switch_mprintf("skinny/%q/%q/%q:%q", profile_name, value, device_name, device_instance);
|
||||
switch_core_del_registration(value, domain_name, token);
|
||||
switch_safe_free(token);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void flush_listener(listener_t *listener)
|
||||
{
|
||||
|
||||
@ -1250,6 +1265,18 @@ static void flush_listener(listener_t *listener)
|
||||
skinny_profile_t *profile = listener->profile;
|
||||
char *sql;
|
||||
|
||||
if ((sql = switch_mprintf(
|
||||
"SELECT '%q', value, '%q', '%q', '%d' "
|
||||
"FROM skinny_lines "
|
||||
"WHERE device_name='%s' AND device_instance=%d "
|
||||
"ORDER BY position",
|
||||
profile->name, profile->domain, listener->device_name, listener->device_instance,
|
||||
listener->device_name, listener->device_instance
|
||||
))) {
|
||||
skinny_execute_sql_callback(profile, profile->sql_mutex, sql, flush_listener_callback, NULL);
|
||||
switch_safe_free(sql);
|
||||
}
|
||||
|
||||
if ((sql = switch_mprintf(
|
||||
"DELETE FROM skinny_devices "
|
||||
"WHERE name='%s' and instance=%d",
|
||||
@ -1488,6 +1515,8 @@ static void *SWITCH_THREAD_FUNC skinny_profile_run(switch_thread_t *thread, void
|
||||
listener_t *listener;
|
||||
switch_memory_pool_t *tmp_pool = NULL, *listener_pool = NULL;
|
||||
uint32_t errs = 0;
|
||||
switch_sockaddr_t *local_sa = NULL;
|
||||
switch_sockaddr_t *remote_sa =NULL;
|
||||
|
||||
if (switch_core_new_memory_pool(&tmp_pool) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "OH OH no pool\n");
|
||||
@ -1496,8 +1525,9 @@ static void *SWITCH_THREAD_FUNC skinny_profile_run(switch_thread_t *thread, void
|
||||
|
||||
new_socket:
|
||||
while(globals.running) {
|
||||
char *listening_ip = NULL;
|
||||
switch_clear_flag_locked(profile, PFLAG_RESPAWN);
|
||||
rv = switch_sockaddr_info_get(&sa, profile->ip, SWITCH_INET, profile->port, 0, tmp_pool);
|
||||
rv = switch_sockaddr_info_get(&sa, profile->ip, SWITCH_UNSPEC, profile->port, 0, tmp_pool);
|
||||
if (rv)
|
||||
goto fail;
|
||||
rv = switch_socket_create(&profile->sock, switch_sockaddr_get_family(sa), SOCK_STREAM, SWITCH_PROTO_TCP, tmp_pool);
|
||||
@ -1512,6 +1542,10 @@ new_socket:
|
||||
rv = switch_socket_listen(profile->sock, 5);
|
||||
if (rv)
|
||||
goto sock_fail;
|
||||
switch_sockaddr_ip_get(&listening_ip, sa);
|
||||
if (!profile->ip || strcmp(listening_ip, profile->ip)) {
|
||||
profile->ip = switch_core_strdup(profile->pool, listening_ip);
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Socket up listening on %s:%u\n", profile->ip, profile->port);
|
||||
|
||||
break;
|
||||
@ -1566,9 +1600,14 @@ new_socket:
|
||||
|
||||
switch_mutex_init(&listener->flag_mutex, SWITCH_MUTEX_NESTED, listener->pool);
|
||||
|
||||
switch_socket_addr_get(&listener->sa, SWITCH_TRUE, listener->sock);
|
||||
switch_get_addr(listener->remote_ip, sizeof(listener->remote_ip), listener->sa);
|
||||
listener->remote_port = switch_sockaddr_get_port(listener->sa);
|
||||
switch_socket_addr_get(&remote_sa, SWITCH_TRUE, listener->sock);
|
||||
switch_get_addr(listener->remote_ip, sizeof(listener->remote_ip), remote_sa);
|
||||
listener->remote_port = switch_sockaddr_get_port(remote_sa);
|
||||
|
||||
switch_socket_addr_get(&local_sa, SWITCH_FALSE, listener->sock);
|
||||
switch_get_addr(listener->local_ip, sizeof(listener->local_ip), local_sa);
|
||||
listener->local_port = switch_sockaddr_get_port(local_sa);
|
||||
|
||||
launch_listener_thread(listener);
|
||||
|
||||
}
|
||||
@ -1636,7 +1675,7 @@ switch_status_t skinny_profile_set(skinny_profile_t *profile, const char *var, c
|
||||
profile->domain = switch_core_strdup(profile->pool, val);
|
||||
} else if (!strcasecmp(var, "ip")) {
|
||||
if (!profile->ip || strcmp(val, profile->ip)) {
|
||||
profile->ip = switch_core_strdup(profile->pool, val);
|
||||
profile->ip = switch_core_strdup(profile->pool, zstr(val) ? NULL : val);
|
||||
switch_set_flag_locked(profile, PFLAG_SHOULD_RESPAWN);
|
||||
}
|
||||
} else if (!strcasecmp(var, "port")) {
|
||||
@ -1784,6 +1823,9 @@ static switch_status_t load_skinny_config(void)
|
||||
size_t string_len = strlen(val);
|
||||
size_t string_pos, start = 0;
|
||||
int field_no = 0;
|
||||
if (zstr(val)) {
|
||||
continue;
|
||||
}
|
||||
if (soft_key_set_id > 15) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
|
||||
"soft-key-set name '%s' is greater than 15 in soft-key-set-set '%s' in profile %s.\n",
|
||||
|
@ -132,25 +132,25 @@ typedef enum {
|
||||
|
||||
#define SKINNY_MAX_LINES 42
|
||||
struct listener {
|
||||
skinny_profile_t *profile;
|
||||
char device_name[16];
|
||||
uint32_t device_instance;
|
||||
uint32_t device_type;
|
||||
|
||||
skinny_profile_t *profile;
|
||||
char device_name[16];
|
||||
uint32_t device_instance;
|
||||
uint32_t device_type;
|
||||
|
||||
char firmware_version[16];
|
||||
char *soft_key_set_set;
|
||||
|
||||
switch_socket_t *sock;
|
||||
switch_memory_pool_t *pool;
|
||||
switch_thread_rwlock_t *rwlock;
|
||||
switch_sockaddr_t *sa;
|
||||
char remote_ip[50];
|
||||
switch_mutex_t *flag_mutex;
|
||||
uint32_t flags;
|
||||
switch_port_t remote_port;
|
||||
uint32_t id;
|
||||
time_t expire_time;
|
||||
struct listener *next;
|
||||
switch_socket_t *sock;
|
||||
switch_memory_pool_t *pool;
|
||||
switch_thread_rwlock_t *rwlock;
|
||||
char remote_ip[50];
|
||||
switch_port_t remote_port;
|
||||
char local_ip[50];
|
||||
switch_port_t local_port;
|
||||
switch_mutex_t *flag_mutex;
|
||||
uint32_t flags;
|
||||
time_t expire_time;
|
||||
struct listener *next;
|
||||
};
|
||||
|
||||
typedef struct listener listener_t;
|
||||
|
@ -43,10 +43,10 @@ char* skinny_codec2string(enum skinny_codecs skinnycodec)
|
||||
switch (skinnycodec) {
|
||||
case SKINNY_CODEC_ALAW_64K:
|
||||
case SKINNY_CODEC_ALAW_56K:
|
||||
return "ALAW";
|
||||
return "PCMA";
|
||||
case SKINNY_CODEC_ULAW_64K:
|
||||
case SKINNY_CODEC_ULAW_56K:
|
||||
return "ULAW";
|
||||
return "PCMU";
|
||||
case SKINNY_CODEC_G722_64K:
|
||||
case SKINNY_CODEC_G722_56K:
|
||||
case SKINNY_CODEC_G722_48K:
|
||||
|
@ -97,6 +97,12 @@ struct PACKED on_hook_message {
|
||||
uint32_t call_id;
|
||||
};
|
||||
|
||||
/* ForwardStatReqMessage */
|
||||
#define FORWARD_STAT_REQ_MESSAGE 0x0009
|
||||
struct PACKED forward_stat_req_message {
|
||||
uint32_t line_instance;
|
||||
};
|
||||
|
||||
/* SpeedDialStatReqMessage */
|
||||
#define SPEED_DIAL_STAT_REQ_MESSAGE 0x000A
|
||||
struct PACKED speed_dial_stat_req_message {
|
||||
@ -125,7 +131,7 @@ struct PACKED line_stat_req_message {
|
||||
#define CAPABILITIES_RES_MESSAGE 0x0010
|
||||
struct PACKED station_capabilities {
|
||||
uint32_t codec;
|
||||
uint16_t frames;
|
||||
uint16_t max_frames_per_packet;
|
||||
char reserved[10];
|
||||
};
|
||||
|
||||
@ -328,6 +334,19 @@ struct PACKED call_info_message {
|
||||
uint32_t party_pi_restriction_bits;
|
||||
};
|
||||
|
||||
/* ForwardStatMessage */
|
||||
#define FORWARD_STAT_MESSAGE 0x0090
|
||||
struct PACKED forward_stat_message {
|
||||
uint32_t active_forward;
|
||||
uint32_t line_instance;
|
||||
uint32_t forward_all_active;
|
||||
char forward_all_number[24];
|
||||
uint32_t forward_busy_active;
|
||||
char forward_busy_number[24];
|
||||
uint32_t forward_noanswer_active;
|
||||
char forward_noanswer_number[24];
|
||||
};
|
||||
|
||||
/* SpeedDialStatMessage */
|
||||
#define SPEED_DIAL_STAT_RES_MESSAGE 0x0091
|
||||
struct PACKED speed_dial_stat_res_message {
|
||||
@ -566,76 +585,78 @@ struct PACKED service_url_stat_res_message {
|
||||
|
||||
union skinny_data {
|
||||
/* no data for KEEP_ALIVE_MESSAGE */
|
||||
struct register_message reg;
|
||||
struct port_message port;
|
||||
struct keypad_button_message keypad_button;
|
||||
struct enbloc_call_message enbloc_call;
|
||||
struct stimulus_message stimulus;
|
||||
struct off_hook_message off_hook;
|
||||
struct on_hook_message on_hook;
|
||||
struct speed_dial_stat_req_message speed_dial_req;
|
||||
struct line_stat_req_message line_req;
|
||||
/* no data for CONFIG_STAT_REQ_MESSAGE */
|
||||
/* no data for TIME_DATE_REQ_MESSAGE */
|
||||
/* no data for BUTTON_TEMPLATE_REQ_MESSAGE */
|
||||
/* no data for VERSION_REQ_MESSAGE */
|
||||
struct capabilities_res_message cap_res;
|
||||
struct alarm_message alarm;
|
||||
struct open_receive_channel_ack_message open_receive_channel_ack;
|
||||
/* no data for SOFT_KEY_SET_REQ_MESSAGE */
|
||||
struct soft_key_event_message soft_key_event;
|
||||
/* no data for UNREGISTER_MESSAGE */
|
||||
/* no data for SOFT_KEY_TEMPLATE_REQ_MESSAGE */
|
||||
struct headset_status_message headset_status;
|
||||
struct register_available_lines_message reg_lines;
|
||||
/* see field "data" for DEVICE_TO_USER_DATA_MESSAGE */
|
||||
/* see field "data" for DEVICE_TO_USER_DATA_RESPONSE_MESSAGE */
|
||||
struct service_url_stat_req_message service_url_req;
|
||||
struct feature_stat_req_message feature_req;
|
||||
/* see field "extended_data" for DEVICE_TO_USER_DATA_VERSION1_MESSAGE */
|
||||
/* see field "extended_data" for DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE */
|
||||
struct register_ack_message reg_ack;
|
||||
struct start_tone_message start_tone;
|
||||
struct stop_tone_message stop_tone;
|
||||
struct set_ringer_message ringer;
|
||||
struct set_lamp_message lamp;
|
||||
struct set_speaker_mode_message speaker_mode;
|
||||
struct start_media_transmission_message start_media;
|
||||
struct stop_media_transmission_message stop_media;
|
||||
struct call_info_message call_info;
|
||||
struct speed_dial_stat_res_message speed_dial_res;
|
||||
struct line_stat_res_message line_res;
|
||||
struct config_stat_res_message config_res;
|
||||
struct define_time_date_message define_time_date;
|
||||
struct button_template_message button_template;
|
||||
struct version_message version;
|
||||
/* no data for CAPABILITIES_REQ_MESSAGE */
|
||||
struct register_reject_message reg_rej;
|
||||
struct reset_message reset;
|
||||
/* no data for KEEP_ALIVE_ACK_MESSAGE */
|
||||
struct open_receive_channel_message open_receive_channel;
|
||||
struct close_receive_channel_message close_receive_channel;
|
||||
struct soft_key_template_res_message soft_key_template;
|
||||
struct soft_key_set_res_message soft_key_set;
|
||||
struct select_soft_keys_message select_soft_keys;
|
||||
struct call_state_message call_state;
|
||||
struct display_prompt_status_message display_prompt_status;
|
||||
struct clear_prompt_status_message clear_prompt_status;
|
||||
struct activate_call_plane_message activate_call_plane;
|
||||
struct unregister_ack_message unregister_ack;
|
||||
struct back_space_req_message back_space_req;
|
||||
struct dialed_number_message dialed_number;
|
||||
/* see field "data" for USER_TO_DEVICE_DATA_MESSAGE */
|
||||
struct feature_stat_res_message feature_res;
|
||||
struct display_pri_notify_message display_pri_notify;
|
||||
struct service_url_stat_res_message service_url_res;
|
||||
/* see field "extended_data" for USER_TO_DEVICE_DATA_VERSION1_MESSAGE */
|
||||
struct register_message reg;
|
||||
struct port_message port;
|
||||
struct keypad_button_message keypad_button;
|
||||
struct enbloc_call_message enbloc_call;
|
||||
struct stimulus_message stimulus;
|
||||
struct off_hook_message off_hook;
|
||||
struct on_hook_message on_hook;
|
||||
struct forward_stat_req_message forward_stat_req;
|
||||
struct speed_dial_stat_req_message speed_dial_req;
|
||||
struct line_stat_req_message line_req;
|
||||
/* no data for CONFIG_STAT_REQ_MESSAGE */
|
||||
/* no data for TIME_DATE_REQ_MESSAGE */
|
||||
/* no data for BUTTON_TEMPLATE_REQ_MESSAGE */
|
||||
/* no data for VERSION_REQ_MESSAGE */
|
||||
struct capabilities_res_message cap_res;
|
||||
struct alarm_message alarm;
|
||||
struct open_receive_channel_ack_message open_receive_channel_ack;
|
||||
/* no data for SOFT_KEY_SET_REQ_MESSAGE */
|
||||
struct soft_key_event_message soft_key_event;
|
||||
/* no data for UNREGISTER_MESSAGE */
|
||||
/* no data for SOFT_KEY_TEMPLATE_REQ_MESSAGE */
|
||||
struct headset_status_message headset_status;
|
||||
struct register_available_lines_message reg_lines;
|
||||
/* see field "data" for DEVICE_TO_USER_DATA_MESSAGE */
|
||||
/* see field "data" for DEVICE_TO_USER_DATA_RESPONSE_MESSAGE */
|
||||
struct service_url_stat_req_message service_url_req;
|
||||
struct feature_stat_req_message feature_req;
|
||||
/* see field "extended_data" for DEVICE_TO_USER_DATA_VERSION1_MESSAGE */
|
||||
/* see field "extended_data" for DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE */
|
||||
struct register_ack_message reg_ack;
|
||||
struct start_tone_message start_tone;
|
||||
struct stop_tone_message stop_tone;
|
||||
struct set_ringer_message ringer;
|
||||
struct set_lamp_message lamp;
|
||||
struct set_speaker_mode_message speaker_mode;
|
||||
struct start_media_transmission_message start_media;
|
||||
struct stop_media_transmission_message stop_media;
|
||||
struct call_info_message call_info;
|
||||
struct forward_stat_message forward_stat;
|
||||
struct speed_dial_stat_res_message speed_dial_res;
|
||||
struct line_stat_res_message line_res;
|
||||
struct config_stat_res_message config_res;
|
||||
struct define_time_date_message define_time_date;
|
||||
struct button_template_message button_template;
|
||||
struct version_message version;
|
||||
/* no data for CAPABILITIES_REQ_MESSAGE */
|
||||
struct register_reject_message reg_rej;
|
||||
struct reset_message reset;
|
||||
/* no data for KEEP_ALIVE_ACK_MESSAGE */
|
||||
struct open_receive_channel_message open_receive_channel;
|
||||
struct close_receive_channel_message close_receive_channel;
|
||||
struct soft_key_template_res_message soft_key_template;
|
||||
struct soft_key_set_res_message soft_key_set;
|
||||
struct select_soft_keys_message select_soft_keys;
|
||||
struct call_state_message call_state;
|
||||
struct display_prompt_status_message display_prompt_status;
|
||||
struct clear_prompt_status_message clear_prompt_status;
|
||||
struct activate_call_plane_message activate_call_plane;
|
||||
struct unregister_ack_message unregister_ack;
|
||||
struct back_space_req_message back_space_req;
|
||||
struct dialed_number_message dialed_number;
|
||||
/* see field "data" for USER_TO_DEVICE_DATA_MESSAGE */
|
||||
struct feature_stat_res_message feature_res;
|
||||
struct display_pri_notify_message display_pri_notify;
|
||||
struct service_url_stat_res_message service_url_res;
|
||||
/* see field "extended_data" for USER_TO_DEVICE_DATA_VERSION1_MESSAGE */
|
||||
|
||||
struct data_message data;
|
||||
struct extended_data_message extended_data;
|
||||
|
||||
uint16_t as_uint16;
|
||||
char as_char[1];
|
||||
uint16_t as_uint16;
|
||||
char as_char[1];
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -555,6 +555,7 @@ int skinny_ring_lines_callback(void *pArg, int argc, char **argv, char **columnN
|
||||
skinny_session_send_call_info(helper->tech_pvt->session, listener, line_instance);
|
||||
send_set_lamp(listener, SKINNY_BUTTON_LINE, line_instance, SKINNY_LAMP_BLINK);
|
||||
send_set_ringer(listener, SKINNY_RING_INSIDE, SKINNY_RING_FOREVER, 0, helper->tech_pvt->call_id);
|
||||
switch_channel_mark_ring_ready(channel);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1006,6 +1007,10 @@ switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *r
|
||||
}
|
||||
if ((xbuttons = switch_xml_child(xskinny, "buttons"))) {
|
||||
uint32_t line_instance = 1;
|
||||
char *network_ip = inet_ntoa(request->data.reg.ip);
|
||||
int network_port = 0;
|
||||
char network_port_c[6];
|
||||
snprintf(network_port_c, sizeof(network_port_c), "%d", network_port);
|
||||
for (xbutton = switch_xml_child(xbuttons, "button"); xbutton; xbutton = xbutton->next) {
|
||||
uint32_t position = atoi(switch_xml_attr_soft(xbutton, "position"));
|
||||
uint32_t type = skinny_str2button(switch_xml_attr_soft(xbutton, "type"));
|
||||
@ -1031,8 +1036,14 @@ switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *r
|
||||
label, value, caller_name,
|
||||
ring_on_idle, ring_on_active, busy_trigger,
|
||||
forward_all, forward_busy, forward_noanswer, noanswer_duration))) {
|
||||
char *token, *url;
|
||||
skinny_execute_sql(profile, sql, profile->sql_mutex);
|
||||
switch_safe_free(sql);
|
||||
token = switch_mprintf("skinny/%q/%q/%q:%d", profile->name, value, request->data.reg.device_name, request->data.reg.instance);
|
||||
url = switch_mprintf("skinny/%q/%q", profile->name, value);
|
||||
switch_core_add_registration(value, profile->domain, token, url, 0, network_ip, network_port_c, "tcp");
|
||||
switch_safe_free(token);
|
||||
switch_safe_free(url);
|
||||
}
|
||||
if (line_instance == 1) {
|
||||
switch_event_t *message_query_event = NULL;
|
||||
@ -1318,6 +1329,22 @@ switch_status_t skinny_handle_on_hook_message(listener_t *listener, skinny_messa
|
||||
|
||||
return status;
|
||||
}
|
||||
switch_status_t skinny_handle_forward_stat_req_message(listener_t *listener, skinny_message_t *request)
|
||||
{
|
||||
skinny_message_t *message;
|
||||
|
||||
skinny_check_data_length(request, sizeof(request->data.forward_stat_req));
|
||||
|
||||
message = switch_core_alloc(listener->pool, 12+sizeof(message->data.forward_stat));
|
||||
message->type = FORWARD_STAT_MESSAGE;
|
||||
message->length = 4 + sizeof(message->data.forward_stat);
|
||||
|
||||
message->data.forward_stat.line_instance = request->data.forward_stat_req.line_instance;
|
||||
|
||||
skinny_send_reply(listener, message);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
switch_status_t skinny_handle_speed_dial_stat_request(listener_t *listener, skinny_message_t *request)
|
||||
{
|
||||
@ -1649,12 +1676,12 @@ switch_status_t skinny_handle_open_receive_channel_ack_message(listener_t *liste
|
||||
goto end;
|
||||
}
|
||||
|
||||
tech_pvt->local_sdp_audio_ip = listener->local_ip;
|
||||
/* Request a local port from the core's allocator */
|
||||
if (!(tech_pvt->local_sdp_audio_port = switch_rtp_request_port(listener->profile->ip))) {
|
||||
if (!(tech_pvt->local_sdp_audio_port = switch_rtp_request_port(tech_pvt->local_sdp_audio_ip))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_CRIT, "No RTP ports available!\n");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
tech_pvt->local_sdp_audio_ip = switch_core_strdup(switch_core_session_get_pool(session), listener->profile->ip);
|
||||
|
||||
tech_pvt->remote_sdp_audio_ip = inet_ntoa(request->data.open_receive_channel_ack.ip);
|
||||
tech_pvt->remote_sdp_audio_port = request->data.open_receive_channel_ack.port;
|
||||
@ -2035,6 +2062,8 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re
|
||||
return skinny_handle_off_hook_message(listener, request);
|
||||
case ON_HOOK_MESSAGE:
|
||||
return skinny_handle_on_hook_message(listener, request);
|
||||
case FORWARD_STAT_REQ_MESSAGE:
|
||||
return skinny_handle_forward_stat_req_message(listener, request);
|
||||
case SPEED_DIAL_STAT_REQ_MESSAGE:
|
||||
return skinny_handle_speed_dial_stat_request(listener, request);
|
||||
case LINE_STAT_REQ_MESSAGE:
|
||||
|
@ -35,73 +35,75 @@
|
||||
|
||||
/* Translation tables */
|
||||
struct skinny_table SKINNY_MESSAGE_TYPES[] = {
|
||||
{"KeepAliveMessage", KEEP_ALIVE_MESSAGE},
|
||||
{"RegisterMessage", REGISTER_MESSAGE},
|
||||
{"PortMessage", PORT_MESSAGE},
|
||||
{"KeypadButtonMessage", KEYPAD_BUTTON_MESSAGE},
|
||||
{"EnblocCallMessage", ENBLOC_CALL_MESSAGE},
|
||||
{"StimulusMessage", STIMULUS_MESSAGE},
|
||||
{"OffHookMessage", OFF_HOOK_MESSAGE},
|
||||
{"OnHookMessage", ON_HOOK_MESSAGE},
|
||||
{"SpeedDialStatReqMessage", SPEED_DIAL_STAT_REQ_MESSAGE},
|
||||
{"LineStatReqMessage", LINE_STAT_REQ_MESSAGE},
|
||||
{"ConfigStatReqMessage", CONFIG_STAT_REQ_MESSAGE},
|
||||
{"TimeDateReqMessage", TIME_DATE_REQ_MESSAGE},
|
||||
{"ButtonTemplateReqMessage", BUTTON_TEMPLATE_REQ_MESSAGE},
|
||||
{"VersionReqMessage", VERSION_REQ_MESSAGE},
|
||||
{"CapabilitiesReqMessage", CAPABILITIES_RES_MESSAGE},
|
||||
{"AlarmMessage", ALARM_MESSAGE},
|
||||
{"OpenReceiveChannelAckMessage", OPEN_RECEIVE_CHANNEL_ACK_MESSAGE},
|
||||
{"SoftKeySetReqMessage", SOFT_KEY_SET_REQ_MESSAGE},
|
||||
{"SoftKeyEventMessage", SOFT_KEY_EVENT_MESSAGE},
|
||||
{"UnregisterMessage", UNREGISTER_MESSAGE},
|
||||
{"SoftKeyTemplateReqMessage", SOFT_KEY_TEMPLATE_REQ_MESSAGE},
|
||||
{"HeadsetStatusMessage", HEADSET_STATUS_MESSAGE},
|
||||
{"RegisterAvailableLinesMessage", REGISTER_AVAILABLE_LINES_MESSAGE},
|
||||
{"DeviceToUserDataMessage", DEVICE_TO_USER_DATA_MESSAGE},
|
||||
{"DeviceToUserDataResponseMessage", DEVICE_TO_USER_DATA_RESPONSE_MESSAGE},
|
||||
{"ServiceUrlStatReqMessage", SERVICE_URL_STAT_REQ_MESSAGE},
|
||||
{"FeatureStatReqMessage", FEATURE_STAT_REQ_MESSAGE},
|
||||
{"DeviceToUserDataVersion1Message", DEVICE_TO_USER_DATA_VERSION1_MESSAGE},
|
||||
{"DeviceToUserDataResponseVersion1Message", DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE},
|
||||
{"RegisterAckMessage", REGISTER_ACK_MESSAGE},
|
||||
{"StartToneMessage", START_TONE_MESSAGE},
|
||||
{"StopToneMessage", STOP_TONE_MESSAGE},
|
||||
{"SetRingerMessage", SET_RINGER_MESSAGE},
|
||||
{"SetLampMessage", SET_LAMP_MESSAGE},
|
||||
{"SetSpeakerModeMessage", SET_SPEAKER_MODE_MESSAGE},
|
||||
{"StartMediaTransmissionMessage", START_MEDIA_TRANSMISSION_MESSAGE},
|
||||
{"StopMediaTransmissionMessage", STOP_MEDIA_TRANSMISSION_MESSAGE},
|
||||
{"CallInfoMessage", CALL_INFO_MESSAGE},
|
||||
{"SpeedDialStatResMessage", SPEED_DIAL_STAT_RES_MESSAGE},
|
||||
{"LineStatResMessage", LINE_STAT_RES_MESSAGE},
|
||||
{"ConfigStatResMessage", CONFIG_STAT_RES_MESSAGE},
|
||||
{"DefineTimeDateMessage", DEFINE_TIME_DATE_MESSAGE},
|
||||
{"ButtonTemplateResMessage", BUTTON_TEMPLATE_RES_MESSAGE},
|
||||
{"VersionMessage", VERSION_MESSAGE},
|
||||
{"CapabilitiesReqMessage", CAPABILITIES_REQ_MESSAGE},
|
||||
{"RegisterRejectMessage", REGISTER_REJECT_MESSAGE},
|
||||
{"ResetMessage", RESET_MESSAGE},
|
||||
{"KeepAliveAckMessage", KEEP_ALIVE_ACK_MESSAGE},
|
||||
{"OpenReceiveChannelMessage", OPEN_RECEIVE_CHANNEL_MESSAGE},
|
||||
{"CloseReceiveChannelMessage", CLOSE_RECEIVE_CHANNEL_MESSAGE},
|
||||
{"SoftKeyTemplateResMessage", SOFT_KEY_TEMPLATE_RES_MESSAGE},
|
||||
{"SoftKeySetResMessage", SOFT_KEY_SET_RES_MESSAGE},
|
||||
{"SelectSoftKeysMessage", SELECT_SOFT_KEYS_MESSAGE},
|
||||
{"CallStateMessage", CALL_STATE_MESSAGE},
|
||||
{"DisplayPromptStatusMessage", DISPLAY_PROMPT_STATUS_MESSAGE},
|
||||
{"ClearPromptStatusMessage", CLEAR_PROMPT_STATUS_MESSAGE},
|
||||
{"ActivateCallPlaneMessage", ACTIVATE_CALL_PLANE_MESSAGE},
|
||||
{"UnregisterAckMessage", UNREGISTER_ACK_MESSAGE},
|
||||
{"BackSpaceReqMessage", BACK_SPACE_REQ_MESSAGE},
|
||||
{"DialedNumberMessage", DIALED_NUMBER_MESSAGE},
|
||||
{"UserToDeviceDataMessage", USER_TO_DEVICE_DATA_MESSAGE},
|
||||
{"FeatureResMessage", FEATURE_STAT_RES_MESSAGE},
|
||||
{"DisplayPriNotifyMessage", DISPLAY_PRI_NOTIFY_MESSAGE},
|
||||
{"ServiceUrlStatMessage", SERVICE_URL_STAT_RES_MESSAGE},
|
||||
{"UserToDeviceDataVersion1Message", USER_TO_DEVICE_DATA_VERSION1_MESSAGE},
|
||||
{"XMLAlarmMessage", XML_ALARM_MESSAGE},
|
||||
{NULL, 0}
|
||||
{"KeepAliveMessage", KEEP_ALIVE_MESSAGE},
|
||||
{"RegisterMessage", REGISTER_MESSAGE},
|
||||
{"PortMessage", PORT_MESSAGE},
|
||||
{"KeypadButtonMessage", KEYPAD_BUTTON_MESSAGE},
|
||||
{"EnblocCallMessage", ENBLOC_CALL_MESSAGE},
|
||||
{"StimulusMessage", STIMULUS_MESSAGE},
|
||||
{"OffHookMessage", OFF_HOOK_MESSAGE},
|
||||
{"OnHookMessage", ON_HOOK_MESSAGE},
|
||||
{"ForwardStatReqMessage", FORWARD_STAT_REQ_MESSAGE},
|
||||
{"SpeedDialStatReqMessage", SPEED_DIAL_STAT_REQ_MESSAGE},
|
||||
{"LineStatReqMessage", LINE_STAT_REQ_MESSAGE},
|
||||
{"ConfigStatReqMessage", CONFIG_STAT_REQ_MESSAGE},
|
||||
{"TimeDateReqMessage", TIME_DATE_REQ_MESSAGE},
|
||||
{"ButtonTemplateReqMessage", BUTTON_TEMPLATE_REQ_MESSAGE},
|
||||
{"VersionReqMessage", VERSION_REQ_MESSAGE},
|
||||
{"CapabilitiesReqMessage", CAPABILITIES_RES_MESSAGE},
|
||||
{"AlarmMessage", ALARM_MESSAGE},
|
||||
{"OpenReceiveChannelAckMessage", OPEN_RECEIVE_CHANNEL_ACK_MESSAGE},
|
||||
{"SoftKeySetReqMessage", SOFT_KEY_SET_REQ_MESSAGE},
|
||||
{"SoftKeyEventMessage", SOFT_KEY_EVENT_MESSAGE},
|
||||
{"UnregisterMessage", UNREGISTER_MESSAGE},
|
||||
{"SoftKeyTemplateReqMessage", SOFT_KEY_TEMPLATE_REQ_MESSAGE},
|
||||
{"HeadsetStatusMessage", HEADSET_STATUS_MESSAGE},
|
||||
{"RegisterAvailableLinesMessage", REGISTER_AVAILABLE_LINES_MESSAGE},
|
||||
{"DeviceToUserDataMessage", DEVICE_TO_USER_DATA_MESSAGE},
|
||||
{"DeviceToUserDataResponseMessage", DEVICE_TO_USER_DATA_RESPONSE_MESSAGE},
|
||||
{"ServiceUrlStatReqMessage", SERVICE_URL_STAT_REQ_MESSAGE},
|
||||
{"FeatureStatReqMessage", FEATURE_STAT_REQ_MESSAGE},
|
||||
{"DeviceToUserDataVersion1Message", DEVICE_TO_USER_DATA_VERSION1_MESSAGE},
|
||||
{"DeviceToUserDataResponseVersion1Message", DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE},
|
||||
{"RegisterAckMessage", REGISTER_ACK_MESSAGE},
|
||||
{"StartToneMessage", START_TONE_MESSAGE},
|
||||
{"StopToneMessage", STOP_TONE_MESSAGE},
|
||||
{"SetRingerMessage", SET_RINGER_MESSAGE},
|
||||
{"SetLampMessage", SET_LAMP_MESSAGE},
|
||||
{"SetSpeakerModeMessage", SET_SPEAKER_MODE_MESSAGE},
|
||||
{"StartMediaTransmissionMessage", START_MEDIA_TRANSMISSION_MESSAGE},
|
||||
{"StopMediaTransmissionMessage", STOP_MEDIA_TRANSMISSION_MESSAGE},
|
||||
{"CallInfoMessage", CALL_INFO_MESSAGE},
|
||||
{"ForwardStatMessage", FORWARD_STAT_MESSAGE},
|
||||
{"SpeedDialStatResMessage", SPEED_DIAL_STAT_RES_MESSAGE},
|
||||
{"LineStatResMessage", LINE_STAT_RES_MESSAGE},
|
||||
{"ConfigStatResMessage", CONFIG_STAT_RES_MESSAGE},
|
||||
{"DefineTimeDateMessage", DEFINE_TIME_DATE_MESSAGE},
|
||||
{"ButtonTemplateResMessage", BUTTON_TEMPLATE_RES_MESSAGE},
|
||||
{"VersionMessage", VERSION_MESSAGE},
|
||||
{"CapabilitiesReqMessage", CAPABILITIES_REQ_MESSAGE},
|
||||
{"RegisterRejectMessage", REGISTER_REJECT_MESSAGE},
|
||||
{"ResetMessage", RESET_MESSAGE},
|
||||
{"KeepAliveAckMessage", KEEP_ALIVE_ACK_MESSAGE},
|
||||
{"OpenReceiveChannelMessage", OPEN_RECEIVE_CHANNEL_MESSAGE},
|
||||
{"CloseReceiveChannelMessage", CLOSE_RECEIVE_CHANNEL_MESSAGE},
|
||||
{"SoftKeyTemplateResMessage", SOFT_KEY_TEMPLATE_RES_MESSAGE},
|
||||
{"SoftKeySetResMessage", SOFT_KEY_SET_RES_MESSAGE},
|
||||
{"SelectSoftKeysMessage", SELECT_SOFT_KEYS_MESSAGE},
|
||||
{"CallStateMessage", CALL_STATE_MESSAGE},
|
||||
{"DisplayPromptStatusMessage", DISPLAY_PROMPT_STATUS_MESSAGE},
|
||||
{"ClearPromptStatusMessage", CLEAR_PROMPT_STATUS_MESSAGE},
|
||||
{"ActivateCallPlaneMessage", ACTIVATE_CALL_PLANE_MESSAGE},
|
||||
{"UnregisterAckMessage", UNREGISTER_ACK_MESSAGE},
|
||||
{"BackSpaceReqMessage", BACK_SPACE_REQ_MESSAGE},
|
||||
{"DialedNumberMessage", DIALED_NUMBER_MESSAGE},
|
||||
{"UserToDeviceDataMessage", USER_TO_DEVICE_DATA_MESSAGE},
|
||||
{"FeatureResMessage", FEATURE_STAT_RES_MESSAGE},
|
||||
{"DisplayPriNotifyMessage", DISPLAY_PRI_NOTIFY_MESSAGE},
|
||||
{"ServiceUrlStatMessage", SERVICE_URL_STAT_RES_MESSAGE},
|
||||
{"UserToDeviceDataVersion1Message", USER_TO_DEVICE_DATA_VERSION1_MESSAGE},
|
||||
{"XMLAlarmMessage", XML_ALARM_MESSAGE},
|
||||
{NULL, 0}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, "UnknownMessage")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2message_type, SKINNY_MESSAGE_TYPES, -1)
|
||||
@ -216,6 +218,7 @@ struct skinny_table SKINNY_KEY_SETS[] = {
|
||||
{"KeySetConnectedWithConference", SKINNY_KEY_SET_CONNECTED_WITH_CONFERENCE},
|
||||
{"KeySetRingOut", SKINNY_KEY_SET_RING_OUT},
|
||||
{"KeySetOffHookWithFeatures", SKINNY_KEY_SET_OFF_HOOK_WITH_FEATURES},
|
||||
{"KeySetInUseHint", SKINNY_KEY_SET_IN_USE_HINT},
|
||||
{NULL, 0}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_soft_key_set2str, SKINNY_KEY_SETS, "UNKNOWN_SOFT_KEY_SET")
|
||||
|
@ -87,7 +87,7 @@ uint32_t func(const char *str)\
|
||||
}
|
||||
|
||||
|
||||
extern struct skinny_table SKINNY_MESSAGE_TYPES[67];
|
||||
extern struct skinny_table SKINNY_MESSAGE_TYPES[69];
|
||||
const char *skinny_message_type2str(uint32_t id);
|
||||
uint32_t skinny_str2message_type(const char *str);
|
||||
#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
|
||||
@ -210,8 +210,9 @@ enum skinny_key_set {
|
||||
SKINNY_KEY_SET_CONNECTED_WITH_CONFERENCE = 7,
|
||||
SKINNY_KEY_SET_RING_OUT = 8,
|
||||
SKINNY_KEY_SET_OFF_HOOK_WITH_FEATURES = 9,
|
||||
SKINNY_KEY_SET_IN_USE_HINT = 10,
|
||||
};
|
||||
extern struct skinny_table SKINNY_KEY_SETS[11];
|
||||
extern struct skinny_table SKINNY_KEY_SETS[12];
|
||||
const char *skinny_soft_key_set2str(uint32_t id);
|
||||
uint32_t skinny_str2soft_key_set(const char *str);
|
||||
#define SKINNY_PUSH_SOFT_KEY_SETS SKINNY_DECLARE_PUSH_MATCH(SKINNY_KEY_SETS)
|
||||
|
@ -1349,10 +1349,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
case SWITCH_MESSAGE_INDICATE_JITTER_BUFFER:
|
||||
{
|
||||
if (switch_rtp_ready(tech_pvt->rtp_session)) {
|
||||
int len, maxlen = 0, qlen = 0, maxqlen = 50;
|
||||
int len, maxlen = 0, qlen = 0, maxqlen = 50, max_drift = 0;
|
||||
|
||||
if (msg->string_arg) {
|
||||
char *p;
|
||||
char *p, *q;
|
||||
const char *s;
|
||||
|
||||
if (!strcasecmp(msg->string_arg, "pause")) {
|
||||
@ -1379,6 +1379,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
if ((p = strchr(msg->string_arg, ':'))) {
|
||||
p++;
|
||||
maxlen = atol(p);
|
||||
if ((q = strchr(p, ':'))) {
|
||||
q++;
|
||||
max_drift = abs(atol(q));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1391,9 +1395,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
if (qlen) {
|
||||
if (switch_rtp_activate_jitter_buffer(tech_pvt->rtp_session, qlen, maxqlen,
|
||||
tech_pvt->read_impl.samples_per_packet,
|
||||
tech_pvt->read_impl.samples_per_second) == SWITCH_STATUS_SUCCESS) {
|
||||
tech_pvt->read_impl.samples_per_second, max_drift) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session),
|
||||
SWITCH_LOG_DEBUG, "Setting Jitterbuffer to %dms (%d frames) (%d max frames)\n", len, qlen, maxqlen);
|
||||
SWITCH_LOG_DEBUG, "Setting Jitterbuffer to %dms (%d frames) (%d max frames) (%d max drift)\n",
|
||||
len, qlen, maxqlen, max_drift);
|
||||
switch_channel_set_flag(tech_pvt->channel, CF_JITTERBUFFER);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session),
|
||||
@ -1439,10 +1444,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
|
||||
case SWITCH_MESSAGE_INDICATE_BRIDGE:
|
||||
{
|
||||
const char *var = switch_channel_get_variable(tech_pvt->channel, "sip_jitter_buffer_during_bridge");
|
||||
|
||||
sofia_glue_tech_track(tech_pvt->profile, session);
|
||||
|
||||
sofia_glue_tech_simplify(tech_pvt);
|
||||
|
||||
if (switch_rtp_ready(tech_pvt->rtp_session)) {
|
||||
if (switch_false(var) && switch_rtp_ready(tech_pvt->rtp_session)) {
|
||||
const char *val;
|
||||
int ok = 0;
|
||||
|
||||
@ -1477,6 +1485,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
const char *val;
|
||||
int ok = 0;
|
||||
|
||||
sofia_glue_tech_track(tech_pvt->profile, session);
|
||||
|
||||
if (switch_channel_test_flag(tech_pvt->channel, CF_JITTERBUFFER)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
|
||||
"%s RESUME Jitterbuffer\n", switch_channel_get_name(channel));
|
||||
@ -3513,7 +3523,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
|
||||
profile = sofia_glue_find_profile(profile_name);
|
||||
}
|
||||
|
||||
if (!profile) {
|
||||
if (!profile && !zstr(domain)) {
|
||||
profile = sofia_glue_find_profile(domain);
|
||||
}
|
||||
}
|
||||
@ -4587,17 +4597,42 @@ static void general_event_handler(switch_event_t *event)
|
||||
case SWITCH_EVENT_TRAP:
|
||||
{
|
||||
const char *cond = switch_event_get_header(event, "condition");
|
||||
switch_hash_index_t *hi;
|
||||
const void *var;
|
||||
void *val;
|
||||
sofia_profile_t *profile;
|
||||
|
||||
if (zstr(cond)) {
|
||||
cond = "";
|
||||
}
|
||||
|
||||
if (cond && !strcmp(cond, "network-address-change") && mod_sofia_globals.auto_restart) {
|
||||
if (!strcmp(cond, "network-external-address-change") && mod_sofia_globals.auto_restart) {
|
||||
const char *old_ip4 = switch_event_get_header_nil(event, "network-external-address-previous-v4");
|
||||
const char *new_ip4 = switch_event_get_header_nil(event, "network-external-address-change-v4");
|
||||
|
||||
switch_mutex_lock(mod_sofia_globals.hash_mutex);
|
||||
if (mod_sofia_globals.profile_hash && !zstr(old_ip4) && !zstr(new_ip4)) {
|
||||
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
|
||||
if ((profile = (sofia_profile_t *) val)) {
|
||||
if (!zstr(profile->extsipip) && !strcmp(profile->extsipip, old_ip4)) {
|
||||
profile->extsipip = switch_core_strdup(profile->pool, new_ip4);
|
||||
}
|
||||
|
||||
if (!zstr(profile->extrtpip) && !strcmp(profile->extrtpip, old_ip4)) {
|
||||
profile->extrtpip = switch_core_strdup(profile->pool, new_ip4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
|
||||
sofia_glue_restart_all_profiles();
|
||||
} else if (!strcmp(cond, "network-address-change") && mod_sofia_globals.auto_restart) {
|
||||
const char *old_ip4 = switch_event_get_header_nil(event, "network-address-previous-v4");
|
||||
const char *new_ip4 = switch_event_get_header_nil(event, "network-address-change-v4");
|
||||
const char *old_ip6 = switch_event_get_header_nil(event, "network-address-previous-v6");
|
||||
const char *new_ip6 = switch_event_get_header_nil(event, "network-address-change-v6");
|
||||
switch_hash_index_t *hi;
|
||||
const void *var;
|
||||
void *val;
|
||||
sofia_profile_t *profile;
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "EVENT_TRAP: IP change detected\n");
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IP change detected [%s]->[%s] [%s]->[%s]\n", old_ip4, new_ip4, old_ip6, new_ip6);
|
||||
|
@ -2135,7 +2135,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
|
||||
|
||||
register_transport = (char *) sofia_glue_transport2str(gateway->register_transport);
|
||||
|
||||
if (contact_params) {
|
||||
if (! zstr(contact_params)) {
|
||||
if (*contact_params == ';') {
|
||||
params = switch_core_sprintf(gateway->pool, "%s;transport=%s;gw=%s", contact_params, register_transport, gateway->name);
|
||||
} else {
|
||||
|
@ -3166,12 +3166,16 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
|
||||
if ((val = switch_channel_get_variable(tech_pvt->channel, "jitterbuffer_msec")) || (val = tech_pvt->profile->jb_msec)) {
|
||||
int jb_msec = atoi(val);
|
||||
int maxlen = 0;
|
||||
char *p;
|
||||
|
||||
int maxlen = 0, max_drift = 0;
|
||||
char *p, *q;
|
||||
|
||||
if ((p = strchr(val, ':'))) {
|
||||
p++;
|
||||
maxlen = atoi(p);
|
||||
if ((q = strchr(p, ':'))) {
|
||||
q++;
|
||||
max_drift = abs(atoi(q));
|
||||
}
|
||||
}
|
||||
|
||||
if (jb_msec < 20 || jb_msec > 10000) {
|
||||
@ -3188,7 +3192,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
|
||||
if (switch_rtp_activate_jitter_buffer(tech_pvt->rtp_session, qlen, maxqlen,
|
||||
tech_pvt->read_impl.samples_per_packet,
|
||||
tech_pvt->read_impl.samples_per_second) == SWITCH_STATUS_SUCCESS) {
|
||||
tech_pvt->read_impl.samples_per_second, max_drift) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session),
|
||||
SWITCH_LOG_DEBUG, "Setting Jitterbuffer to %dms (%d frames)\n", jb_msec, qlen);
|
||||
switch_channel_set_flag(tech_pvt->channel, CF_JITTERBUFFER);
|
||||
@ -3238,7 +3242,9 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
}
|
||||
|
||||
if (tech_pvt->audio_recv_pt != tech_pvt->agreed_pt) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_CRIT, "Set audio receive payload to %u\n", tech_pvt->audio_recv_pt);
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG,
|
||||
"%s Set audio receive payload to %u\n", switch_channel_get_name(tech_pvt->channel), tech_pvt->audio_recv_pt);
|
||||
|
||||
switch_rtp_set_recv_pt(tech_pvt->rtp_session, tech_pvt->audio_recv_pt);
|
||||
}
|
||||
|
||||
@ -3423,8 +3429,8 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
|
||||
if (tech_pvt->video_recv_pt != tech_pvt->video_agreed_pt) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG,
|
||||
"Set video receive payload to %u\n", tech_pvt->video_recv_pt);
|
||||
switch_rtp_set_recv_pt(tech_pvt->rtp_session, tech_pvt->video_recv_pt);
|
||||
"%s Set video receive payload to %u\n", switch_channel_get_name(tech_pvt->channel), tech_pvt->video_recv_pt);
|
||||
switch_rtp_set_recv_pt(tech_pvt->video_rtp_session, tech_pvt->video_recv_pt);
|
||||
}
|
||||
|
||||
switch_channel_set_variable_printf(tech_pvt->channel, "sip_use_video_pt", "%d", tech_pvt->video_agreed_pt);
|
||||
@ -3484,6 +3490,59 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
|
||||
}
|
||||
|
||||
static void add_audio_codec(sdp_rtpmap_t *map, int ptime, char *buf, switch_size_t buflen)
|
||||
{
|
||||
int codec_ms = ptime;
|
||||
uint32_t map_bit_rate = 0;
|
||||
char ptstr[20] = "";
|
||||
char ratestr[20] = "";
|
||||
char bitstr[20] = "";
|
||||
switch_codec_fmtp_t codec_fmtp = { 0 };
|
||||
|
||||
if (!codec_ms) {
|
||||
codec_ms = switch_default_ptime(map->rm_encoding, map->rm_pt);
|
||||
}
|
||||
|
||||
map_bit_rate = switch_known_bitrate(map->rm_pt);
|
||||
|
||||
if (!ptime && !strcasecmp(map->rm_encoding, "g723")) {
|
||||
ptime = codec_ms = 30;
|
||||
}
|
||||
|
||||
if (zstr(map->rm_fmtp)) {
|
||||
if (!strcasecmp(map->rm_encoding, "ilbc")) {
|
||||
ptime = codec_ms = 30;
|
||||
map_bit_rate = 13330;
|
||||
}
|
||||
} else {
|
||||
if ((switch_core_codec_parse_fmtp(map->rm_encoding, map->rm_fmtp, map->rm_rate, &codec_fmtp)) == SWITCH_STATUS_SUCCESS) {
|
||||
if (codec_fmtp.bits_per_second) {
|
||||
map_bit_rate = codec_fmtp.bits_per_second;
|
||||
}
|
||||
if (codec_fmtp.microseconds_per_packet) {
|
||||
codec_ms = (codec_fmtp.microseconds_per_packet / 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (map->rm_rate) {
|
||||
switch_snprintf(ratestr, sizeof(ratestr), "@%uh", (unsigned int) map->rm_rate);
|
||||
}
|
||||
|
||||
if (codec_ms) {
|
||||
switch_snprintf(ptstr, sizeof(ptstr), "@%di", codec_ms);
|
||||
}
|
||||
|
||||
if (map_bit_rate) {
|
||||
switch_snprintf(bitstr, sizeof(bitstr), "@%db", map_bit_rate);
|
||||
}
|
||||
|
||||
switch_snprintf(buf + strlen(buf), buflen - strlen(buf), ",%s%s%s%s", map->rm_encoding, ratestr, ptstr, bitstr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const char *codec_string, sdp_session_t *sdp)
|
||||
{
|
||||
char buf[1024] = { 0 };
|
||||
@ -3500,7 +3559,13 @@ void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const cha
|
||||
const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS] = { 0 };
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
private_object_t *tech_pvt = switch_core_session_get_private(session);
|
||||
int prefer_sdp = 0;
|
||||
const char *var;
|
||||
|
||||
if ((var = switch_channel_get_variable(channel, "ep_codec_prefer_sdp")) && switch_true(var)) {
|
||||
prefer_sdp = 1;
|
||||
}
|
||||
|
||||
if (!zstr(codec_string)) {
|
||||
char *tmp_codec_string;
|
||||
if ((tmp_codec_string = strdup(codec_string))) {
|
||||
@ -3551,78 +3616,62 @@ void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const cha
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_codecs; i++) {
|
||||
const switch_codec_implementation_t *imp = codecs[i];
|
||||
if (imp->codec_type != SWITCH_CODEC_TYPE_AUDIO || imp->ianacode > 127 || already_did[imp->ianacode]) {
|
||||
continue;
|
||||
}
|
||||
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND || prefer_sdp) {
|
||||
for (map = m->m_rtpmaps; map; map = map->rm_next) {
|
||||
if (map->rm_pt > 127 || already_did[map->rm_pt]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((zstr(map->rm_encoding) || (tech_pvt->profile->ndlb & PFLAG_NDLB_ALLOW_BAD_IANANAME)) && map->rm_pt < 96) {
|
||||
match = (map->rm_pt == imp->ianacode) ? 1 : 0;
|
||||
} else {
|
||||
if (map->rm_encoding) {
|
||||
match = strcasecmp(map->rm_encoding, imp->iananame) ? 0 : 1;
|
||||
for (i = 0; i < num_codecs; i++) {
|
||||
const switch_codec_implementation_t *imp = codecs[i];
|
||||
|
||||
if ((zstr(map->rm_encoding) || (tech_pvt->profile->ndlb & PFLAG_NDLB_ALLOW_BAD_IANANAME)) && map->rm_pt < 96) {
|
||||
match = (map->rm_pt == imp->ianacode) ? 1 : 0;
|
||||
} else {
|
||||
match = 0;
|
||||
if (map->rm_encoding) {
|
||||
match = strcasecmp(map->rm_encoding, imp->iananame) ? 0 : 1;
|
||||
} else {
|
||||
match = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (match) {
|
||||
add_audio_codec(map, ptime, buf, sizeof(buf));
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (match) {
|
||||
int codec_ms = ptime;
|
||||
uint32_t map_bit_rate = 0;
|
||||
char ptstr[20] = "";
|
||||
char ratestr[20] = "";
|
||||
char bitstr[20] = "";
|
||||
switch_codec_fmtp_t codec_fmtp = { 0 };
|
||||
|
||||
if (!codec_ms) {
|
||||
codec_ms = switch_default_ptime(map->rm_encoding, map->rm_pt);
|
||||
} else {
|
||||
for (i = 0; i < num_codecs; i++) {
|
||||
const switch_codec_implementation_t *imp = codecs[i];
|
||||
if (imp->codec_type != SWITCH_CODEC_TYPE_AUDIO || imp->ianacode > 127 || already_did[imp->ianacode]) {
|
||||
continue;
|
||||
}
|
||||
for (map = m->m_rtpmaps; map; map = map->rm_next) {
|
||||
if (map->rm_pt > 127 || already_did[map->rm_pt]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
map_bit_rate = switch_known_bitrate(map->rm_pt);
|
||||
|
||||
if (!ptime && !strcasecmp(map->rm_encoding, "g723")) {
|
||||
ptime = codec_ms = 30;
|
||||
}
|
||||
|
||||
if (zstr(map->rm_fmtp)) {
|
||||
if (!strcasecmp(map->rm_encoding, "ilbc")) {
|
||||
ptime = codec_ms = 30;
|
||||
map_bit_rate = 13330;
|
||||
}
|
||||
if ((zstr(map->rm_encoding) || (tech_pvt->profile->ndlb & PFLAG_NDLB_ALLOW_BAD_IANANAME)) && map->rm_pt < 96) {
|
||||
match = (map->rm_pt == imp->ianacode) ? 1 : 0;
|
||||
} else {
|
||||
if ((switch_core_codec_parse_fmtp(map->rm_encoding, map->rm_fmtp, map->rm_rate, &codec_fmtp)) == SWITCH_STATUS_SUCCESS) {
|
||||
if (codec_fmtp.bits_per_second) {
|
||||
map_bit_rate = codec_fmtp.bits_per_second;
|
||||
}
|
||||
if (codec_fmtp.microseconds_per_packet) {
|
||||
codec_ms = (codec_fmtp.microseconds_per_packet / 1000);
|
||||
}
|
||||
if (map->rm_encoding) {
|
||||
match = strcasecmp(map->rm_encoding, imp->iananame) ? 0 : 1;
|
||||
} else {
|
||||
match = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (map->rm_rate) {
|
||||
switch_snprintf(ratestr, sizeof(ratestr), "@%uh", (unsigned int) map->rm_rate);
|
||||
if (match) {
|
||||
add_audio_codec(map, ptime, buf, sizeof(buf));
|
||||
break;
|
||||
}
|
||||
|
||||
if (codec_ms) {
|
||||
switch_snprintf(ptstr, sizeof(ptstr), "@%di", codec_ms);
|
||||
}
|
||||
|
||||
if (map_bit_rate) {
|
||||
switch_snprintf(bitstr, sizeof(bitstr), "@%db", map_bit_rate);
|
||||
}
|
||||
|
||||
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s%s%s%s", map->rm_encoding, ratestr, ptstr, bitstr);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (m->m_type == sdp_media_video && m->m_port) {
|
||||
connection = sdp->sdp_connection;
|
||||
if (m->m_connections) {
|
||||
@ -3814,6 +3863,7 @@ static switch_t38_options_t *tech_process_udptl(private_object_t *tech_pvt, sdp_
|
||||
{
|
||||
switch_t38_options_t *t38_options = switch_channel_get_private(tech_pvt->channel, "t38_options");
|
||||
sdp_attribute_t *attr;
|
||||
const char *var;
|
||||
|
||||
if (!t38_options) {
|
||||
t38_options = switch_core_session_alloc(tech_pvt->session, sizeof(switch_t38_options_t));
|
||||
@ -3893,6 +3943,21 @@ static switch_t38_options_t *tech_process_udptl(private_object_t *tech_pvt, sdp_
|
||||
switch_channel_set_private(tech_pvt->channel, "t38_options", t38_options);
|
||||
switch_channel_set_app_flag_key("T38", tech_pvt->channel, CF_APP_T38);
|
||||
|
||||
if ((var = switch_channel_get_variable(tech_pvt->channel, "sip_execute_on_image"))) {
|
||||
char *app, *arg = NULL;
|
||||
app = switch_core_session_strdup(tech_pvt->session, var);
|
||||
|
||||
if (strstr(app, "::")) {
|
||||
switch_core_session_execute_application_async(tech_pvt->session, app, arg);
|
||||
} else {
|
||||
if ((arg = strchr(app, ' '))) {
|
||||
*arg++ = '\0';
|
||||
}
|
||||
|
||||
switch_core_session_execute_application(tech_pvt->session, app, arg);
|
||||
}
|
||||
}
|
||||
|
||||
return t38_options;
|
||||
}
|
||||
|
||||
@ -5166,7 +5231,7 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName
|
||||
tech_pvt->local_sdp_str = switch_core_session_strdup(session, tmp);
|
||||
}
|
||||
|
||||
if ((tmp = switch_channel_get_variable(channel, "switch_r_sdp"))) {
|
||||
if ((tmp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE))) {
|
||||
tech_pvt->remote_sdp_str = switch_core_session_strdup(session, tmp);
|
||||
}
|
||||
|
||||
|
@ -91,6 +91,7 @@ switch_status_t sofia_presence_chat_send(const char *proto, const char *from, co
|
||||
char *user_via = NULL;
|
||||
char *contact_str = NULL;
|
||||
char *dup_dest = NULL;
|
||||
char *p = NULL;
|
||||
char *remote_host = NULL;
|
||||
|
||||
if (!to) {
|
||||
@ -187,7 +188,12 @@ switch_status_t sofia_presence_chat_send(const char *proto, const char *from, co
|
||||
|
||||
/* sofia_glue is running sofia_overcome_sip_uri_weakness we do not, not sure if it matters */
|
||||
|
||||
dup_dest = strdup(dst->contact);
|
||||
if (dst->route_uri) {
|
||||
dup_dest = strdup(dst->route_uri);
|
||||
} else {
|
||||
dup_dest = strdup(dst->to);
|
||||
}
|
||||
|
||||
|
||||
if (dst->route_uri) {
|
||||
remote_host = strdup(dst->route_uri);
|
||||
@ -226,17 +232,12 @@ switch_status_t sofia_presence_chat_send(const char *proto, const char *from, co
|
||||
contact_str = profile->url;
|
||||
}
|
||||
|
||||
switch_safe_free(dup_dest);
|
||||
switch_safe_free(remote_host);
|
||||
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
/*
|
||||
if ((p = strstr(contact, ";fs_"))) {
|
||||
if (dup_dest && (p = strstr(dup_dest, ";fs_"))) {
|
||||
*p = '\0';
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/* if this cries, add contact here too, change the 1 to 0 and omit the safe_free */
|
||||
|
||||
msg_nh = nua_handle(profile->nua, NULL,
|
||||
@ -244,7 +245,7 @@ switch_status_t sofia_presence_chat_send(const char *proto, const char *from, co
|
||||
TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)),
|
||||
SIPTAG_FROM_STR(from),
|
||||
TAG_IF(contact, NUTAG_URL(contact)),
|
||||
SIPTAG_TO_STR(dst->to),
|
||||
SIPTAG_TO_STR(dup_dest),
|
||||
SIPTAG_CONTACT_STR(contact_str),
|
||||
TAG_END());
|
||||
|
||||
@ -257,6 +258,8 @@ switch_status_t sofia_presence_chat_send(const char *proto, const char *from, co
|
||||
TAG_END());
|
||||
|
||||
sofia_glue_free_destination(dst);
|
||||
switch_safe_free(dup_dest);
|
||||
switch_safe_free(remote_host);
|
||||
}
|
||||
|
||||
switch_console_free_matches(&list);
|
||||
|
@ -653,7 +653,7 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot)
|
||||
"and profile_name='%s' and expires <= %ld", mod_sofia_globals.hostname, profile->name, (long) now);
|
||||
|
||||
sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_sla_dialog_del_callback, profile);
|
||||
switch_snprintf(sql, sizeof(sql), "delete from sip_registrations where expires > 0 and hostname='%s' and expires <= %ld",
|
||||
switch_snprintf(sql, sizeof(sql), "delete from sip_shared_appearance_dialogs where expires > 0 and hostname='%s' and expires <= %ld",
|
||||
mod_sofia_globals.hostname, (long) now);
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
include ../../../../build/modmake.rules
|
||||
|
||||
LOCAL_CFLAGS=-I `net-snmp-config --cflags`
|
||||
LOCAL_CFLAGS=`net-snmp-config --cflags`
|
||||
LOCAL_LDFLAGS=`net-snmp-config --agent-libs`
|
||||
LOCAL_OBJS=subagent.o
|
||||
|
||||
|
@ -67,42 +67,42 @@ static int channelList_callback(void *pArg, int argc, char **argv, char **column
|
||||
netsnmp_tdata_row *row;
|
||||
|
||||
switch_zmalloc(entry, sizeof(chan_entry_t));
|
||||
if (!entry)
|
||||
return 0;
|
||||
|
||||
row = netsnmp_tdata_create_row();
|
||||
|
||||
if (!row) {
|
||||
switch_safe_free(entry);
|
||||
return 0;
|
||||
}
|
||||
|
||||
row->data = entry;
|
||||
|
||||
entry->idx = idx++;
|
||||
strncpy(entry->uuid, argv[0], sizeof(entry->uuid));
|
||||
strncpy(entry->direction, argv[1], sizeof(entry->direction));
|
||||
strncpy(entry->uuid, switch_str_nil(argv[0]), sizeof(entry->uuid));
|
||||
strncpy(entry->direction, switch_str_nil(argv[1]), sizeof(entry->direction));
|
||||
entry->created_epoch = atoi(argv[3]);
|
||||
strncpy(entry->name, argv[4], sizeof(entry->name));
|
||||
strncpy(entry->state, argv[5], sizeof(entry->state));
|
||||
strncpy(entry->cid_name, argv[6], sizeof(entry->cid_name));
|
||||
strncpy(entry->cid_num, argv[7], sizeof(entry->cid_num));
|
||||
strncpy(entry->dest, argv[9], sizeof(entry->dest));
|
||||
strncpy(entry->application, argv[10], sizeof(entry->application));
|
||||
strncpy(entry->application_data, argv[11], sizeof(entry->application_data));
|
||||
strncpy(entry->dialplan, argv[12], sizeof(entry->dialplan));
|
||||
strncpy(entry->context, argv[13], sizeof(entry->context));
|
||||
strncpy(entry->read_codec, argv[14], sizeof(entry->read_codec));
|
||||
entry->read_rate = atoi(argv[15]);
|
||||
entry->read_bitrate = atoi(argv[16]);
|
||||
strncpy(entry->write_codec, argv[17], sizeof(entry->write_codec));
|
||||
entry->write_rate = atoi(argv[18]);
|
||||
entry->write_bitrate = atoi(argv[19]);
|
||||
strncpy(entry->name, switch_str_nil(argv[4]), sizeof(entry->name));
|
||||
strncpy(entry->state, switch_str_nil(argv[5]), sizeof(entry->state));
|
||||
strncpy(entry->cid_name, switch_str_nil(argv[6]), sizeof(entry->cid_name));
|
||||
strncpy(entry->cid_num, switch_str_nil(argv[7]), sizeof(entry->cid_num));
|
||||
strncpy(entry->dest, switch_str_nil(argv[9]), sizeof(entry->dest));
|
||||
strncpy(entry->application, switch_str_nil(argv[10]), sizeof(entry->application));
|
||||
strncpy(entry->application_data, switch_str_nil(argv[11]), sizeof(entry->application_data));
|
||||
strncpy(entry->dialplan, switch_str_nil(argv[12]), sizeof(entry->dialplan));
|
||||
strncpy(entry->context, switch_str_nil(argv[13]), sizeof(entry->context));
|
||||
strncpy(entry->read_codec, switch_str_nil(argv[14]), sizeof(entry->read_codec));
|
||||
entry->read_rate = atoi(switch_str_nil(argv[15]));
|
||||
entry->read_bitrate = atoi(switch_str_nil(argv[16]));
|
||||
strncpy(entry->write_codec, switch_str_nil(argv[17]), sizeof(entry->write_codec));
|
||||
entry->write_rate = atoi(switch_str_nil(argv[18]));
|
||||
entry->write_bitrate = atoi(switch_str_nil(argv[19]));
|
||||
|
||||
memset(&entry->ip_addr, 0, sizeof(entry->ip_addr));
|
||||
if (strchr(argv[8], ':')) {
|
||||
switch_inet_pton(AF_INET6, argv[8], &entry->ip_addr);
|
||||
if (strchr(switch_str_nil(argv[8]), ':')) {
|
||||
switch_inet_pton(AF_INET6, switch_str_nil(argv[8]), &entry->ip_addr);
|
||||
entry->addr_family = AF_INET6;
|
||||
} else {
|
||||
switch_inet_pton(AF_INET, argv[8], &entry->ip_addr);
|
||||
switch_inet_pton(AF_INET, switch_str_nil(argv[8]), &entry->ip_addr);
|
||||
entry->addr_family = AF_INET;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ void channelList_free(netsnmp_cache *cache, void *magic)
|
||||
int channelList_load(netsnmp_cache *cache, void *vmagic)
|
||||
{
|
||||
switch_cache_db_handle_t *dbh;
|
||||
char sql[1024] = "", hostname[256] = "";
|
||||
char sql[1024] = "";
|
||||
|
||||
channelList_free(cache, NULL);
|
||||
|
||||
@ -137,8 +137,8 @@ int channelList_load(netsnmp_cache *cache, void *vmagic)
|
||||
}
|
||||
|
||||
idx = 1;
|
||||
gethostname(hostname, sizeof(hostname));
|
||||
sprintf(sql, "SELECT * FROM channels WHERE hostname='%s' ORDER BY created_epoch", hostname);
|
||||
|
||||
sprintf(sql, "SELECT * FROM channels WHERE hostname='%s' ORDER BY created_epoch", switch_core_get_hostname());
|
||||
switch_cache_db_execute_sql_callback(dbh, sql, channelList_callback, NULL, NULL);
|
||||
|
||||
switch_cache_db_release_db_handle(&dbh);
|
||||
@ -282,6 +282,9 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio
|
||||
switch (reqinfo->mode) {
|
||||
case MODE_GET:
|
||||
for (request = requests; request; request = request->next) {
|
||||
if (request->processed)
|
||||
continue;
|
||||
|
||||
table_info = netsnmp_extract_table_info(request);
|
||||
entry = (chan_entry_t *) netsnmp_tdata_extract_entry(request);
|
||||
|
||||
@ -366,7 +369,7 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio
|
||||
break;
|
||||
default:
|
||||
/* we should never get here, so this is a really bad error */
|
||||
snmp_log(LOG_ERR, "Unknown mode (%d) in handle_foo\n", reqinfo->mode );
|
||||
snmp_log(LOG_ERR, "Unknown mode (%d) in handle_channelList\n", reqinfo->mode );
|
||||
return SNMP_ERR_GENERR;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
LAME=lame-3.97
|
||||
SHOUT=libshout-2.2.2
|
||||
MPG123=mpg123
|
||||
MPG123=mpg123-1.13.2
|
||||
BASE=../../../..
|
||||
|
||||
WANT_CURL=yes
|
||||
|
@ -17,6 +17,10 @@ public class freeswitch {
|
||||
freeswitchJNI.consoleCleanLog(msg);
|
||||
}
|
||||
|
||||
public static boolean email(String to, String from, String headers, String body, String file, String convert_cmd, String convert_ext) {
|
||||
return freeswitchJNI.email(to, from, headers, body, file, convert_cmd, convert_ext);
|
||||
}
|
||||
|
||||
public static void console_log(String level_str, String msg) {
|
||||
freeswitchJNI.console_log(level_str, msg);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ package org.freeswitch.swig;
|
||||
class freeswitchJNI {
|
||||
public final static native void consoleLog(String jarg1, String jarg2);
|
||||
public final static native void consoleCleanLog(String jarg1);
|
||||
public final static native boolean email(String jarg1, String jarg2, String jarg3, String jarg4, String jarg5, String jarg6, String jarg7);
|
||||
public final static native long new_IVRMenu(long jarg1, IVRMenu jarg1_, String jarg2, String jarg3, String jarg4, String jarg5, String jarg6, String jarg7, String jarg8, String jarg9, String jarg10, int jarg11, int jarg12, int jarg13, int jarg14, int jarg15, int jarg16);
|
||||
public final static native void delete_IVRMenu(long jarg1);
|
||||
public final static native void IVRMenu_bindAction(long jarg1, IVRMenu jarg1_, String jarg2, String jarg3, String jarg4);
|
||||
|
@ -244,6 +244,67 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_consoleCleanLog(J
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_email(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3, jstring jarg4, jstring jarg5, jstring jarg6, jstring jarg7) {
|
||||
jboolean jresult = 0 ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
char *arg5 = (char *) NULL ;
|
||||
char *arg6 = (char *) NULL ;
|
||||
char *arg7 = (char *) NULL ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = 0;
|
||||
if (jarg1) {
|
||||
arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0);
|
||||
if (!arg1) return 0;
|
||||
}
|
||||
arg2 = 0;
|
||||
if (jarg2) {
|
||||
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
|
||||
if (!arg2) return 0;
|
||||
}
|
||||
arg3 = 0;
|
||||
if (jarg3) {
|
||||
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
|
||||
if (!arg3) return 0;
|
||||
}
|
||||
arg4 = 0;
|
||||
if (jarg4) {
|
||||
arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0);
|
||||
if (!arg4) return 0;
|
||||
}
|
||||
arg5 = 0;
|
||||
if (jarg5) {
|
||||
arg5 = (char *)jenv->GetStringUTFChars(jarg5, 0);
|
||||
if (!arg5) return 0;
|
||||
}
|
||||
arg6 = 0;
|
||||
if (jarg6) {
|
||||
arg6 = (char *)jenv->GetStringUTFChars(jarg6, 0);
|
||||
if (!arg6) return 0;
|
||||
}
|
||||
arg7 = 0;
|
||||
if (jarg7) {
|
||||
arg7 = (char *)jenv->GetStringUTFChars(jarg7, 0);
|
||||
if (!arg7) return 0;
|
||||
}
|
||||
result = (bool)email(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
|
||||
jresult = (jboolean)result;
|
||||
if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1);
|
||||
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
|
||||
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
|
||||
if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4);
|
||||
if (arg5) jenv->ReleaseStringUTFChars(jarg5, (const char *)arg5);
|
||||
if (arg6) jenv->ReleaseStringUTFChars(jarg6, (const char *)arg6);
|
||||
if (arg7) jenv->ReleaseStringUTFChars(jarg7, (const char *)arg7);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_new_1IVRMenu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4, jstring jarg5, jstring jarg6, jstring jarg7, jstring jarg8, jstring jarg9, jstring jarg10, jint jarg11, jint jarg12, jint jarg13, jint jarg14, jint jarg15, jint jarg16) {
|
||||
jlong jresult = 0 ;
|
||||
IVRMenu *arg1 = (IVRMenu *) 0 ;
|
||||
|
@ -7182,6 +7182,42 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_variable(char * jarg1) {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_variable_dup(char * jarg1) {
|
||||
char * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
result = (char *)switch_core_get_variable_dup((char const *)arg1);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_variable_pdup(char * jarg1, void * jarg2) {
|
||||
char * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
switch_memory_pool_t *arg2 = (switch_memory_pool_t *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (switch_memory_pool_t *)jarg2;
|
||||
result = (char *)switch_core_get_variable_pdup((char const *)arg1,arg2);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_hostname() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)switch_core_get_hostname();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_set_variable(char * jarg1, char * jarg2) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@ -10071,293 +10107,6 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_cache_db_connection_options_t(v
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_name_set(void * jarg1, char * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
if(arg2) {
|
||||
strncpy((char*)arg1->name, (const char *)arg2, 256-1);
|
||||
arg1->name[256-1] = 0;
|
||||
} else {
|
||||
arg1->name[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_handle_t_name_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (char *)(char *) ((arg1)->name);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_type_set(void * jarg1, int jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_handle_type_t arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_cache_db_handle_type_t)jarg2;
|
||||
if (arg1) (arg1)->type = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_handle_t_type_get(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_handle_type_t result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_cache_db_handle_type_t) ((arg1)->type);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_native_handle_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_native_handle_t *arg2 = (switch_cache_db_native_handle_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_cache_db_native_handle_t *)jarg2;
|
||||
if (arg1) (arg1)->native_handle = *arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_native_handle_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_native_handle_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_cache_db_native_handle_t *)& ((arg1)->native_handle);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_last_used_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
time_t arg2 ;
|
||||
time_t *argp2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
argp2 = (time_t *)jarg2;
|
||||
if (!argp2) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null time_t", 0);
|
||||
return ;
|
||||
}
|
||||
arg2 = *argp2;
|
||||
if (arg1) (arg1)->last_used = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_last_used_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
time_t result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = ((arg1)->last_used);
|
||||
jresult = new time_t((const time_t &)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_mutex_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_mutex_t *arg2 = (switch_mutex_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_mutex_t *)jarg2;
|
||||
if (arg1) (arg1)->mutex = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_mutex_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_mutex_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_mutex_t *) ((arg1)->mutex);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_io_mutex_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_mutex_t *arg2 = (switch_mutex_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_mutex_t *)jarg2;
|
||||
if (arg1) (arg1)->io_mutex = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_io_mutex_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_mutex_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_mutex_t *) ((arg1)->io_mutex);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_pool_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_memory_pool_t *arg2 = (switch_memory_pool_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_memory_pool_t *)jarg2;
|
||||
if (arg1) (arg1)->pool = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_pool_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_memory_pool_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_memory_pool_t *) ((arg1)->pool);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_flags_set(void * jarg1, int jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
int32_t arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
if (arg1) (arg1)->flags = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_handle_t_flags_get(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
int32_t result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (int32_t) ((arg1)->flags);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_hash_set(void * jarg1, unsigned long jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
unsigned long arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (unsigned long)jarg2;
|
||||
if (arg1) (arg1)->hash = arg2;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_cache_db_handle_t_hash_get(void * jarg1) {
|
||||
unsigned long jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
unsigned long result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (unsigned long) ((arg1)->hash);
|
||||
jresult = (unsigned long)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_creator_set(void * jarg1, char * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
if(arg2) {
|
||||
strncpy((char*)arg1->creator, (const char *)arg2, 256-1);
|
||||
arg1->creator[256-1] = 0;
|
||||
} else {
|
||||
arg1->creator[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_handle_t_creator_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (char *)(char *) ((arg1)->creator);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_last_user_set(void * jarg1, char * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
if(arg2) {
|
||||
strncpy((char*)arg1->last_user, (const char *)arg2, 256-1);
|
||||
arg1->last_user[256-1] = 0;
|
||||
} else {
|
||||
arg1->last_user[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_handle_t_last_user_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (char *)(char *) ((arg1)->last_user);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_cache_db_handle_t() {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *result = 0 ;
|
||||
|
||||
result = (switch_cache_db_handle_t *)new switch_cache_db_handle_t();
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_cache_db_handle_t(void * jarg1) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
delete arg1;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_type_name(int jarg1) {
|
||||
char * jresult ;
|
||||
switch_cache_db_handle_type_t arg1 ;
|
||||
@ -10370,6 +10119,18 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_type_name(int jarg1) {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_get_type(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_handle_type_t result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_cache_db_handle_type_t)switch_cache_db_get_type(arg1);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_dismiss_db_handle(void * jarg1) {
|
||||
switch_cache_db_handle_t **arg1 = (switch_cache_db_handle_t **) 0 ;
|
||||
|
||||
@ -10386,14 +10147,6 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_release_db_handle(void * jarg
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_destroy_db_handle(void * jarg1) {
|
||||
switch_cache_db_handle_t **arg1 = (switch_cache_db_handle_t **) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t **)jarg1;
|
||||
switch_cache_db_destroy_db_handle(arg1);
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp__switch_cache_db_get_db_handle(void * jarg1, int jarg2, void * jarg3, char * jarg4, char * jarg5, int jarg6) {
|
||||
int jresult ;
|
||||
switch_cache_db_handle_t **arg1 = (switch_cache_db_handle_t **) 0 ;
|
||||
@ -10560,11 +10313,6 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_persistant_execute_trans(void
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_detach() {
|
||||
switch_cache_db_detach();
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_debug_level() {
|
||||
unsigned long jresult ;
|
||||
uint32_t result;
|
||||
@ -10616,6 +10364,60 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_default_ptime(char * jarg1, u
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_add_registration(char * jarg1, char * jarg2, char * jarg3, char * jarg4, unsigned long jarg5, char * jarg6, char * jarg7, char * jarg8) {
|
||||
int jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
uint32_t arg5 ;
|
||||
char *arg6 = (char *) 0 ;
|
||||
char *arg7 = (char *) 0 ;
|
||||
char *arg8 = (char *) 0 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
arg5 = (uint32_t)jarg5;
|
||||
arg6 = (char *)jarg6;
|
||||
arg7 = (char *)jarg7;
|
||||
arg8 = (char *)jarg8;
|
||||
result = (switch_status_t)switch_core_add_registration((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_del_registration(char * jarg1, char * jarg2, char * jarg3) {
|
||||
int jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (switch_status_t)switch_core_del_registration((char const *)arg1,(char const *)arg2,(char const *)arg3);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_expire_registration(int jarg1) {
|
||||
int jresult ;
|
||||
int arg1 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (int)jarg1;
|
||||
result = (switch_status_t)switch_core_expire_registration(arg1);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_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 ;
|
||||
@ -25728,6 +25530,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_change_sln_volume(void * jarg1, unsign
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_change_sln_volume_granular(void * jarg1, unsigned long jarg2, int jarg3) {
|
||||
int16_t *arg1 = (int16_t *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
int32_t arg3 ;
|
||||
|
||||
arg1 = (int16_t *)jarg1;
|
||||
arg2 = (uint32_t)jarg2;
|
||||
arg3 = (int32_t)jarg3;
|
||||
switch_change_sln_volume_granular(arg1,arg2,arg3);
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_merge_sln(void * jarg1, unsigned long jarg2, void * jarg3, unsigned long jarg4) {
|
||||
unsigned long jresult ;
|
||||
int16_t *arg1 = (int16_t *) 0 ;
|
||||
@ -28723,13 +28537,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_rtcp(void * jarg1, int jar
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_jitter_buffer(void * jarg1, unsigned long jarg2, unsigned long jarg3, unsigned long jarg4, unsigned long jarg5) {
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_jitter_buffer(void * jarg1, unsigned long jarg2, unsigned long jarg3, unsigned long jarg4, unsigned long jarg5, unsigned long jarg6) {
|
||||
int jresult ;
|
||||
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
uint32_t arg3 ;
|
||||
uint32_t arg4 ;
|
||||
uint32_t arg5 ;
|
||||
uint32_t arg6 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (switch_rtp_t *)jarg1;
|
||||
@ -28737,7 +28552,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_jitter_buffer(void * jarg1
|
||||
arg3 = (uint32_t)jarg3;
|
||||
arg4 = (uint32_t)jarg4;
|
||||
arg5 = (uint32_t)jarg5;
|
||||
result = (switch_status_t)switch_rtp_activate_jitter_buffer(arg1,arg2,arg3,arg4,arg5);
|
||||
arg6 = (uint32_t)jarg6;
|
||||
result = (switch_status_t)switch_rtp_activate_jitter_buffer(arg1,arg2,arg3,arg4,arg5,arg6);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
@ -29121,6 +28937,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_telephony_recv_event(void * ja
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_recv_pt(void * jarg1, unsigned char jarg2) {
|
||||
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
|
||||
switch_payload_t arg2 ;
|
||||
|
||||
arg1 = (switch_rtp_t *)jarg1;
|
||||
arg2 = (switch_payload_t)jarg2;
|
||||
switch_rtp_set_recv_pt(arg1,arg2);
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_cng_pt(void * jarg1, unsigned char jarg2) {
|
||||
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
|
||||
switch_payload_t arg2 ;
|
||||
@ -32587,6 +32413,30 @@ SWIGEXPORT void SWIGSTDCALL CSharp_consoleCleanLog(char * jarg1) {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_email(char * jarg1, char * jarg2, char * jarg3, char * jarg4, char * jarg5, char * jarg6, char * jarg7) {
|
||||
unsigned int jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
char *arg5 = (char *) NULL ;
|
||||
char *arg6 = (char *) NULL ;
|
||||
char *arg7 = (char *) NULL ;
|
||||
bool result;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
arg5 = (char *)jarg5;
|
||||
arg6 = (char *)jarg6;
|
||||
arg7 = (char *)jarg7;
|
||||
result = (bool)email(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_IvrMenu(void * jarg1, char * jarg2, char * jarg3, char * jarg4, char * jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10, int jarg11, int jarg12, int jarg13, int jarg14, int jarg15, int jarg16) {
|
||||
void * jresult ;
|
||||
IVRMenu *arg1 = (IVRMenu *) 0 ;
|
||||
|
@ -7473,6 +7473,42 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_variable(char * jarg1) {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_variable_dup(char * jarg1) {
|
||||
char * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
result = (char *)switch_core_get_variable_dup((char const *)arg1);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_variable_pdup(char * jarg1, void * jarg2) {
|
||||
char * jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
switch_memory_pool_t *arg2 = (switch_memory_pool_t *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (switch_memory_pool_t *)jarg2;
|
||||
result = (char *)switch_core_get_variable_pdup((char const *)arg1,arg2);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_hostname() {
|
||||
char * jresult ;
|
||||
char *result = 0 ;
|
||||
|
||||
result = (char *)switch_core_get_hostname();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_set_variable(char * jarg1, char * jarg2) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
@ -10371,290 +10407,6 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_cache_db_connection_options_t(v
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_name_set(void * jarg1, char * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
if (arg2) strncpy((char *)arg1->name, (const char *)arg2, 256);
|
||||
else arg1->name[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_handle_t_name_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (char *)(char *) ((arg1)->name);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_type_set(void * jarg1, int jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_handle_type_t arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_cache_db_handle_type_t)jarg2;
|
||||
if (arg1) (arg1)->type = arg2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_handle_t_type_get(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_handle_type_t result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_cache_db_handle_type_t) ((arg1)->type);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_native_handle_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_native_handle_t *arg2 = (switch_cache_db_native_handle_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_cache_db_native_handle_t *)jarg2;
|
||||
if (arg1) (arg1)->native_handle = *arg2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_native_handle_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_native_handle_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_cache_db_native_handle_t *)& ((arg1)->native_handle);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_last_used_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
time_t arg2 ;
|
||||
time_t *argp2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
argp2 = (time_t *)jarg2;
|
||||
if (!argp2) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null time_t", 0);
|
||||
return ;
|
||||
}
|
||||
arg2 = *argp2;
|
||||
if (arg1) (arg1)->last_used = arg2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_last_used_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
time_t result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = ((arg1)->last_used);
|
||||
jresult = new time_t((time_t &)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_mutex_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_mutex_t *arg2 = (switch_mutex_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_mutex_t *)jarg2;
|
||||
if (arg1) (arg1)->mutex = arg2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_mutex_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_mutex_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_mutex_t *) ((arg1)->mutex);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_io_mutex_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_mutex_t *arg2 = (switch_mutex_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_mutex_t *)jarg2;
|
||||
if (arg1) (arg1)->io_mutex = arg2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_io_mutex_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_mutex_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_mutex_t *) ((arg1)->io_mutex);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_pool_set(void * jarg1, void * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_memory_pool_t *arg2 = (switch_memory_pool_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (switch_memory_pool_t *)jarg2;
|
||||
if (arg1) (arg1)->pool = arg2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_cache_db_handle_t_pool_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_memory_pool_t *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_memory_pool_t *) ((arg1)->pool);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_flags_set(void * jarg1, int jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
int32_t arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
if (arg1) (arg1)->flags = arg2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_handle_t_flags_get(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
int32_t result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (int32_t) ((arg1)->flags);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_hash_set(void * jarg1, unsigned long jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
unsigned long arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (unsigned long)jarg2;
|
||||
if (arg1) (arg1)->hash = arg2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_cache_db_handle_t_hash_get(void * jarg1) {
|
||||
unsigned long jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
unsigned long result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (unsigned long) ((arg1)->hash);
|
||||
jresult = (unsigned long)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_creator_set(void * jarg1, char * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
if (arg2) strncpy((char *)arg1->creator, (const char *)arg2, 256);
|
||||
else arg1->creator[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_handle_t_creator_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (char *)(char *) ((arg1)->creator);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_handle_t_last_user_set(void * jarg1, char * jarg2) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *arg2 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
if (arg2) strncpy((char *)arg1->last_user, (const char *)arg2, 256);
|
||||
else arg1->last_user[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_handle_t_last_user_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (char *)(char *) ((arg1)->last_user);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_cache_db_handle_t() {
|
||||
void * jresult ;
|
||||
switch_cache_db_handle_t *result = 0 ;
|
||||
|
||||
result = (switch_cache_db_handle_t *)new switch_cache_db_handle_t();
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_cache_db_handle_t(void * jarg1) {
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
delete arg1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_type_name(int jarg1) {
|
||||
char * jresult ;
|
||||
switch_cache_db_handle_type_t arg1 ;
|
||||
@ -10667,6 +10419,18 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_cache_db_type_name(int jarg1) {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_get_type(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
|
||||
switch_cache_db_handle_type_t result;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t *)jarg1;
|
||||
result = (switch_cache_db_handle_type_t)switch_cache_db_get_type(arg1);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_dismiss_db_handle(void * jarg1) {
|
||||
switch_cache_db_handle_t **arg1 = (switch_cache_db_handle_t **) 0 ;
|
||||
|
||||
@ -10683,14 +10447,6 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_release_db_handle(void * jarg
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_destroy_db_handle(void * jarg1) {
|
||||
switch_cache_db_handle_t **arg1 = (switch_cache_db_handle_t **) 0 ;
|
||||
|
||||
arg1 = (switch_cache_db_handle_t **)jarg1;
|
||||
switch_cache_db_destroy_db_handle(arg1);
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp__switch_cache_db_get_db_handle(void * jarg1, int jarg2, void * jarg3, char * jarg4, char * jarg5, int jarg6) {
|
||||
int jresult ;
|
||||
switch_cache_db_handle_t **arg1 = (switch_cache_db_handle_t **) 0 ;
|
||||
@ -10857,11 +10613,6 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_persistant_execute_trans(void
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_detach() {
|
||||
switch_cache_db_detach();
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_debug_level() {
|
||||
unsigned long jresult ;
|
||||
uint32_t result;
|
||||
@ -10913,6 +10664,60 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_default_ptime(char * jarg1, u
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_add_registration(char * jarg1, char * jarg2, char * jarg3, char * jarg4, unsigned long jarg5, char * jarg6, char * jarg7, char * jarg8) {
|
||||
int jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
uint32_t arg5 ;
|
||||
char *arg6 = (char *) 0 ;
|
||||
char *arg7 = (char *) 0 ;
|
||||
char *arg8 = (char *) 0 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
arg5 = (uint32_t)jarg5;
|
||||
arg6 = (char *)jarg6;
|
||||
arg7 = (char *)jarg7;
|
||||
arg8 = (char *)jarg8;
|
||||
result = (switch_status_t)switch_core_add_registration((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_del_registration(char * jarg1, char * jarg2, char * jarg3) {
|
||||
int jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (switch_status_t)switch_core_del_registration((char const *)arg1,(char const *)arg2,(char const *)arg3);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_expire_registration(int jarg1) {
|
||||
int jresult ;
|
||||
int arg1 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (int)jarg1;
|
||||
result = (switch_status_t)switch_core_expire_registration(arg1);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_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 ;
|
||||
@ -26411,6 +26216,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_change_sln_volume(void * jarg1, unsign
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_change_sln_volume_granular(void * jarg1, unsigned long jarg2, int jarg3) {
|
||||
int16_t *arg1 = (int16_t *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
int32_t arg3 ;
|
||||
|
||||
arg1 = (int16_t *)jarg1;
|
||||
arg2 = (uint32_t)jarg2;
|
||||
arg3 = (int32_t)jarg3;
|
||||
switch_change_sln_volume_granular(arg1,arg2,arg3);
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_merge_sln(void * jarg1, unsigned long jarg2, void * jarg3, unsigned long jarg4) {
|
||||
unsigned long jresult ;
|
||||
int16_t *arg1 = (int16_t *) 0 ;
|
||||
@ -29431,13 +29248,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_rtcp(void * jarg1, int jar
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_jitter_buffer(void * jarg1, unsigned long jarg2, unsigned long jarg3, unsigned long jarg4, unsigned long jarg5) {
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_jitter_buffer(void * jarg1, unsigned long jarg2, unsigned long jarg3, unsigned long jarg4, unsigned long jarg5, unsigned long jarg6) {
|
||||
int jresult ;
|
||||
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
uint32_t arg3 ;
|
||||
uint32_t arg4 ;
|
||||
uint32_t arg5 ;
|
||||
uint32_t arg6 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (switch_rtp_t *)jarg1;
|
||||
@ -29445,7 +29263,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_jitter_buffer(void * jarg1
|
||||
arg3 = (uint32_t)jarg3;
|
||||
arg4 = (uint32_t)jarg4;
|
||||
arg5 = (uint32_t)jarg5;
|
||||
result = (switch_status_t)switch_rtp_activate_jitter_buffer(arg1,arg2,arg3,arg4,arg5);
|
||||
arg6 = (uint32_t)jarg6;
|
||||
result = (switch_status_t)switch_rtp_activate_jitter_buffer(arg1,arg2,arg3,arg4,arg5,arg6);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
@ -29829,6 +29648,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_telephony_recv_event(void * ja
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_recv_pt(void * jarg1, unsigned char jarg2) {
|
||||
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
|
||||
switch_payload_t arg2 ;
|
||||
|
||||
arg1 = (switch_rtp_t *)jarg1;
|
||||
arg2 = (switch_payload_t)jarg2;
|
||||
switch_rtp_set_recv_pt(arg1,arg2);
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_cng_pt(void * jarg1, unsigned char jarg2) {
|
||||
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
|
||||
switch_payload_t arg2 ;
|
||||
|
@ -1394,6 +1394,21 @@ public class freeswitch {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_core_get_variable_dup(string varname) {
|
||||
string ret = freeswitchPINVOKE.switch_core_get_variable_dup(varname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_core_get_variable_pdup(string varname, SWIGTYPE_p_apr_pool_t pool) {
|
||||
string ret = freeswitchPINVOKE.switch_core_get_variable_pdup(varname, SWIGTYPE_p_apr_pool_t.getCPtr(pool));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_core_get_hostname() {
|
||||
string ret = freeswitchPINVOKE.switch_core_get_hostname();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void switch_core_set_variable(string varname, string value) {
|
||||
freeswitchPINVOKE.switch_core_set_variable(varname, value);
|
||||
}
|
||||
@ -2336,40 +2351,41 @@ public class freeswitch {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void switch_cache_db_dismiss_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_dismiss_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static void switch_cache_db_release_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_release_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static void switch_cache_db_destroy_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_destroy_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static switch_status_t _switch_cache_db_get_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh, switch_cache_db_handle_type_t type, switch_cache_db_connection_options_t connection_options, string file, string func, int line) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE._switch_cache_db_get_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh), (int)type, switch_cache_db_connection_options_t.getCPtr(connection_options), file, func, line);
|
||||
public static switch_cache_db_handle_type_t switch_cache_db_get_type(SWIGTYPE_p_switch_cache_db_handle dbh) {
|
||||
switch_cache_db_handle_type_t ret = (switch_cache_db_handle_type_t)freeswitchPINVOKE.switch_cache_db_get_type(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_cache_db_execute_sql2str(switch_cache_db_handle_t dbh, string sql, string str, uint len, ref string err) {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_execute_sql2str(switch_cache_db_handle_t.getCPtr(dbh), sql, str, len, ref err);
|
||||
public static void switch_cache_db_dismiss_db_handle(SWIGTYPE_p_p_switch_cache_db_handle dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_dismiss_db_handle(SWIGTYPE_p_p_switch_cache_db_handle.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static void switch_cache_db_release_db_handle(SWIGTYPE_p_p_switch_cache_db_handle dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_release_db_handle(SWIGTYPE_p_p_switch_cache_db_handle.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static switch_status_t _switch_cache_db_get_db_handle(SWIGTYPE_p_p_switch_cache_db_handle dbh, switch_cache_db_handle_type_t type, switch_cache_db_connection_options_t connection_options, string file, string func, int line) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE._switch_cache_db_get_db_handle(SWIGTYPE_p_p_switch_cache_db_handle.getCPtr(dbh), (int)type, switch_cache_db_connection_options_t.getCPtr(connection_options), file, func, line);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_cache_db_execute_sql(switch_cache_db_handle_t dbh, string sql, ref string err) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_execute_sql(switch_cache_db_handle_t.getCPtr(dbh), sql, ref err);
|
||||
public static string switch_cache_db_execute_sql2str(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, string str, uint len, ref string err) {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_execute_sql2str(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, str, len, ref err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_cache_db_execute_sql_callback(switch_cache_db_handle_t dbh, string sql, SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int callback, SWIGTYPE_p_void pdata, ref string err) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_execute_sql_callback(switch_cache_db_handle_t.getCPtr(dbh), sql, SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int.getCPtr(callback), SWIGTYPE_p_void.getCPtr(pdata), ref err);
|
||||
public static switch_status_t switch_cache_db_execute_sql(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, ref string err) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_execute_sql(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, ref err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static int switch_cache_db_affected_rows(switch_cache_db_handle_t dbh) {
|
||||
int ret = freeswitchPINVOKE.switch_cache_db_affected_rows(switch_cache_db_handle_t.getCPtr(dbh));
|
||||
public static switch_status_t switch_cache_db_execute_sql_callback(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int callback, SWIGTYPE_p_void pdata, ref string err) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_execute_sql_callback(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int.getCPtr(callback), SWIGTYPE_p_void.getCPtr(pdata), ref err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static int switch_cache_db_affected_rows(SWIGTYPE_p_switch_cache_db_handle dbh) {
|
||||
int ret = freeswitchPINVOKE.switch_cache_db_affected_rows(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2377,30 +2393,26 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_cache_db_status(switch_stream_handle.getCPtr(stream));
|
||||
}
|
||||
|
||||
public static switch_status_t _switch_core_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh, string file, string func, int line) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE._switch_core_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh), file, func, line);
|
||||
public static switch_status_t _switch_core_db_handle(SWIGTYPE_p_p_switch_cache_db_handle dbh, string file, string func, int line) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE._switch_core_db_handle(SWIGTYPE_p_p_switch_cache_db_handle.getCPtr(dbh), file, func, line);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_bool_t switch_cache_db_test_reactive(switch_cache_db_handle_t db, string test_sql, string drop_sql, string reactive_sql) {
|
||||
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_cache_db_test_reactive(switch_cache_db_handle_t.getCPtr(db), test_sql, drop_sql, reactive_sql);
|
||||
public static switch_bool_t switch_cache_db_test_reactive(SWIGTYPE_p_switch_cache_db_handle db, string test_sql, string drop_sql, string reactive_sql) {
|
||||
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_cache_db_test_reactive(SWIGTYPE_p_switch_cache_db_handle.getCPtr(db), test_sql, drop_sql, reactive_sql);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_cache_db_persistant_execute(switch_cache_db_handle_t dbh, string sql, uint retries) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_persistant_execute(switch_cache_db_handle_t.getCPtr(dbh), sql, retries);
|
||||
public static switch_status_t switch_cache_db_persistant_execute(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, uint retries) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_persistant_execute(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, retries);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_cache_db_persistant_execute_trans(switch_cache_db_handle_t dbh, string sql, uint retries) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_persistant_execute_trans(switch_cache_db_handle_t.getCPtr(dbh), sql, retries);
|
||||
public static switch_status_t switch_cache_db_persistant_execute_trans(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, uint retries) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_persistant_execute_trans(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, retries);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void switch_cache_db_detach() {
|
||||
freeswitchPINVOKE.switch_cache_db_detach();
|
||||
}
|
||||
|
||||
public static uint switch_core_debug_level() {
|
||||
uint ret = freeswitchPINVOKE.switch_core_debug_level();
|
||||
return ret;
|
||||
@ -2425,6 +2437,21 @@ public class freeswitch {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_core_add_registration(string user, string realm, string token, string url, uint expires, string network_ip, string network_port, string network_proto) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_add_registration(user, realm, token, url, expires, network_ip, network_port, network_proto);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_core_del_registration(string user, string realm, string token) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_del_registration(user, realm, token);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_core_expire_registration(int force) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_expire_registration(force);
|
||||
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;
|
||||
@ -3984,6 +4011,10 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_change_sln_volume(SWIGTYPE_p_short.getCPtr(data), samples, vol);
|
||||
}
|
||||
|
||||
public static void switch_change_sln_volume_granular(SWIGTYPE_p_short data, uint samples, int vol) {
|
||||
freeswitchPINVOKE.switch_change_sln_volume_granular(SWIGTYPE_p_short.getCPtr(data), samples, vol);
|
||||
}
|
||||
|
||||
public static uint switch_merge_sln(SWIGTYPE_p_short data, uint samples, SWIGTYPE_p_short other_data, uint other_samples) {
|
||||
uint ret = freeswitchPINVOKE.switch_merge_sln(SWIGTYPE_p_short.getCPtr(data), samples, SWIGTYPE_p_short.getCPtr(other_data), other_samples);
|
||||
return ret;
|
||||
@ -4729,8 +4760,8 @@ public class freeswitch {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session, uint queue_frames, uint max_queue_frames, uint samples_per_packet, uint samples_per_second) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), queue_frames, max_queue_frames, samples_per_packet, samples_per_second);
|
||||
public static switch_status_t switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session, uint queue_frames, uint max_queue_frames, uint samples_per_packet, uint samples_per_second, uint max_drift) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), queue_frames, max_queue_frames, samples_per_packet, samples_per_second, max_drift);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -4867,6 +4898,10 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_rtp_set_telephony_recv_event(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), te);
|
||||
}
|
||||
|
||||
public static void switch_rtp_set_recv_pt(SWIGTYPE_p_switch_rtp rtp_session, byte pt) {
|
||||
freeswitchPINVOKE.switch_rtp_set_recv_pt(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), pt);
|
||||
}
|
||||
|
||||
public static void switch_rtp_set_cng_pt(SWIGTYPE_p_switch_rtp rtp_session, byte pt) {
|
||||
freeswitchPINVOKE.switch_rtp_set_cng_pt(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), pt);
|
||||
}
|
||||
@ -5374,6 +5409,11 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.consoleCleanLog(msg);
|
||||
}
|
||||
|
||||
public static bool email(string to, string from, string headers, string body, string file, string convert_cmd, string convert_ext) {
|
||||
bool ret = freeswitchPINVOKE.email(to, from, headers, body, file, convert_cmd, convert_ext);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void console_log(string level_str, string msg) {
|
||||
freeswitchPINVOKE.console_log(level_str, msg);
|
||||
}
|
||||
@ -7578,6 +7618,15 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_variable")]
|
||||
public static extern string switch_core_get_variable(string jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_variable_dup")]
|
||||
public static extern string switch_core_get_variable_dup(string jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_variable_pdup")]
|
||||
public static extern string switch_core_get_variable_pdup(string jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_hostname")]
|
||||
public static extern string switch_core_get_hostname();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_set_variable")]
|
||||
public static extern void switch_core_set_variable(string jarg1, string jarg2);
|
||||
|
||||
@ -8226,90 +8275,18 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_cache_db_connection_options_t")]
|
||||
public static extern void delete_switch_cache_db_connection_options_t(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_name_set")]
|
||||
public static extern void switch_cache_db_handle_t_name_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_name_get")]
|
||||
public static extern string switch_cache_db_handle_t_name_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_type_set")]
|
||||
public static extern void switch_cache_db_handle_t_type_set(HandleRef jarg1, int jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_type_get")]
|
||||
public static extern int switch_cache_db_handle_t_type_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_native_handle_set")]
|
||||
public static extern void switch_cache_db_handle_t_native_handle_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_native_handle_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_native_handle_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_last_used_set")]
|
||||
public static extern void switch_cache_db_handle_t_last_used_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_last_used_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_last_used_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_mutex_set")]
|
||||
public static extern void switch_cache_db_handle_t_mutex_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_mutex_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_mutex_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_io_mutex_set")]
|
||||
public static extern void switch_cache_db_handle_t_io_mutex_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_io_mutex_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_io_mutex_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_pool_set")]
|
||||
public static extern void switch_cache_db_handle_t_pool_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_pool_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_pool_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_flags_set")]
|
||||
public static extern void switch_cache_db_handle_t_flags_set(HandleRef jarg1, int jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_flags_get")]
|
||||
public static extern int switch_cache_db_handle_t_flags_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_hash_set")]
|
||||
public static extern void switch_cache_db_handle_t_hash_set(HandleRef jarg1, uint jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_hash_get")]
|
||||
public static extern uint switch_cache_db_handle_t_hash_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_creator_set")]
|
||||
public static extern void switch_cache_db_handle_t_creator_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_creator_get")]
|
||||
public static extern string switch_cache_db_handle_t_creator_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_last_user_set")]
|
||||
public static extern void switch_cache_db_handle_t_last_user_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_last_user_get")]
|
||||
public static extern string switch_cache_db_handle_t_last_user_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_cache_db_handle_t")]
|
||||
public static extern IntPtr new_switch_cache_db_handle_t();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_cache_db_handle_t")]
|
||||
public static extern void delete_switch_cache_db_handle_t(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_type_name")]
|
||||
public static extern string switch_cache_db_type_name(int jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_get_type")]
|
||||
public static extern int switch_cache_db_get_type(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_dismiss_db_handle")]
|
||||
public static extern void switch_cache_db_dismiss_db_handle(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_release_db_handle")]
|
||||
public static extern void switch_cache_db_release_db_handle(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_destroy_db_handle")]
|
||||
public static extern void switch_cache_db_destroy_db_handle(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp__switch_cache_db_get_db_handle")]
|
||||
public static extern int _switch_cache_db_get_db_handle(HandleRef jarg1, int jarg2, HandleRef jarg3, string jarg4, string jarg5, int jarg6);
|
||||
|
||||
@ -8340,9 +8317,6 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_persistant_execute_trans")]
|
||||
public static extern int switch_cache_db_persistant_execute_trans(HandleRef jarg1, string jarg2, uint jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_detach")]
|
||||
public static extern void switch_cache_db_detach();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_debug_level")]
|
||||
public static extern uint switch_core_debug_level();
|
||||
|
||||
@ -8358,6 +8332,15 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_default_ptime")]
|
||||
public static extern uint switch_default_ptime(string jarg1, uint jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_add_registration")]
|
||||
public static extern int switch_core_add_registration(string jarg1, string jarg2, string jarg3, string jarg4, uint jarg5, string jarg6, string jarg7, string jarg8);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_del_registration")]
|
||||
public static extern int switch_core_del_registration(string jarg1, string jarg2, string jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_expire_registration")]
|
||||
public static extern int switch_core_expire_registration(int jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_set")]
|
||||
public static extern void switch_loadable_module_interface_module_name_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
@ -12051,6 +12034,9 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_change_sln_volume")]
|
||||
public static extern void switch_change_sln_volume(HandleRef jarg1, uint jarg2, int jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_change_sln_volume_granular")]
|
||||
public static extern void switch_change_sln_volume_granular(HandleRef jarg1, uint jarg2, int jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_merge_sln")]
|
||||
public static extern uint switch_merge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4);
|
||||
|
||||
@ -12661,7 +12647,7 @@ class freeswitchPINVOKE {
|
||||
public static extern int switch_rtp_activate_rtcp(HandleRef jarg1, int jarg2, ushort jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_jitter_buffer")]
|
||||
public static extern int switch_rtp_activate_jitter_buffer(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5);
|
||||
public static extern int switch_rtp_activate_jitter_buffer(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5, uint jarg6);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_debug_jitter_buffer")]
|
||||
public static extern int switch_rtp_debug_jitter_buffer(HandleRef jarg1, string jarg2);
|
||||
@ -12747,6 +12733,9 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_telephony_recv_event")]
|
||||
public static extern void switch_rtp_set_telephony_recv_event(HandleRef jarg1, byte jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_recv_pt")]
|
||||
public static extern void switch_rtp_set_recv_pt(HandleRef jarg1, byte jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_cng_pt")]
|
||||
public static extern void switch_rtp_set_cng_pt(HandleRef jarg1, byte jarg2);
|
||||
|
||||
@ -13602,6 +13591,9 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_consoleCleanLog")]
|
||||
public static extern void consoleCleanLog(string jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_email")]
|
||||
public static extern bool email(string jarg1, string jarg2, string jarg3, string jarg4, string jarg5, string jarg6, string jarg7);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_new_IvrMenu")]
|
||||
public static extern IntPtr new_IvrMenu(HandleRef jarg1, string jarg2, string jarg3, string jarg4, string jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, int jarg11, int jarg12, int jarg13, int jarg14, int jarg15, int jarg16);
|
||||
|
||||
@ -17185,18 +17177,18 @@ namespace FreeSWITCH.Native {
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class SWIGTYPE_p_p_switch_cache_db_handle_t {
|
||||
public class SWIGTYPE_p_p_switch_cache_db_handle {
|
||||
private HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_p_switch_cache_db_handle_t(IntPtr cPtr, bool futureUse) {
|
||||
internal SWIGTYPE_p_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_p_switch_cache_db_handle_t() {
|
||||
protected SWIGTYPE_p_p_switch_cache_db_handle() {
|
||||
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_cache_db_handle_t obj) {
|
||||
internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_cache_db_handle obj) {
|
||||
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
@ -18205,6 +18197,36 @@ namespace FreeSWITCH.Native {
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class SWIGTYPE_p_switch_cache_db_handle {
|
||||
private HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_switch_cache_db_handle() {
|
||||
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static HandleRef getCPtr(SWIGTYPE_p_switch_cache_db_handle obj) {
|
||||
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 2.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
namespace FreeSWITCH.Native {
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class SWIGTYPE_p_switch_call_cause_t {
|
||||
private HandleRef swigCPtr;
|
||||
|
||||
@ -20687,171 +20709,6 @@ public class switch_cache_db_core_db_options_t : IDisposable {
|
||||
|
||||
namespace FreeSWITCH.Native {
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class switch_cache_db_handle_t : IDisposable {
|
||||
private HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal switch_cache_db_handle_t(IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static HandleRef getCPtr(switch_cache_db_handle_t obj) {
|
||||
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~switch_cache_db_handle_t() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
freeswitchPINVOKE.delete_switch_cache_db_handle_t(swigCPtr);
|
||||
}
|
||||
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||
}
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public string name {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_name_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_handle_t_name_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public switch_cache_db_handle_type_t type {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_type_set(swigCPtr, (int)value);
|
||||
}
|
||||
get {
|
||||
switch_cache_db_handle_type_t ret = (switch_cache_db_handle_type_t)freeswitchPINVOKE.switch_cache_db_handle_t_type_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public switch_cache_db_native_handle_t native_handle {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_native_handle_set(swigCPtr, switch_cache_db_native_handle_t.getCPtr(value));
|
||||
}
|
||||
get {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_handle_t_native_handle_get(swigCPtr);
|
||||
switch_cache_db_native_handle_t ret = (cPtr == IntPtr.Zero) ? null : new switch_cache_db_native_handle_t(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_time_t last_used {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_last_used_set(swigCPtr, SWIGTYPE_p_time_t.getCPtr(value));
|
||||
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
get {
|
||||
SWIGTYPE_p_time_t ret = new SWIGTYPE_p_time_t(freeswitchPINVOKE.switch_cache_db_handle_t_last_used_get(swigCPtr), true);
|
||||
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_switch_mutex_t mutex {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_mutex_set(swigCPtr, SWIGTYPE_p_switch_mutex_t.getCPtr(value));
|
||||
}
|
||||
get {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_handle_t_mutex_get(swigCPtr);
|
||||
SWIGTYPE_p_switch_mutex_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_mutex_t(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_switch_mutex_t io_mutex {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_io_mutex_set(swigCPtr, SWIGTYPE_p_switch_mutex_t.getCPtr(value));
|
||||
}
|
||||
get {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_handle_t_io_mutex_get(swigCPtr);
|
||||
SWIGTYPE_p_switch_mutex_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_mutex_t(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_apr_pool_t pool {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_pool_set(swigCPtr, SWIGTYPE_p_apr_pool_t.getCPtr(value));
|
||||
}
|
||||
get {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_handle_t_pool_get(swigCPtr);
|
||||
SWIGTYPE_p_apr_pool_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_apr_pool_t(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public int flags {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_flags_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
int ret = freeswitchPINVOKE.switch_cache_db_handle_t_flags_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public uint hash {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_hash_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
uint ret = freeswitchPINVOKE.switch_cache_db_handle_t_hash_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public string creator {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_creator_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_handle_t_creator_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public string last_user {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_last_user_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_handle_t_last_user_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public switch_cache_db_handle_t() : this(freeswitchPINVOKE.new_switch_cache_db_handle_t(), true) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 2.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
namespace FreeSWITCH.Native {
|
||||
|
||||
public enum switch_cache_db_handle_type_t {
|
||||
SCDB_TYPE_CORE_DB,
|
||||
SCDB_TYPE_ODBC
|
||||
@ -24977,6 +24834,8 @@ public enum switch_event_types_t {
|
||||
SWITCH_EVENT_NAT,
|
||||
SWITCH_EVENT_RECORD_START,
|
||||
SWITCH_EVENT_RECORD_STOP,
|
||||
SWITCH_EVENT_PLAYBACK_START,
|
||||
SWITCH_EVENT_PLAYBACK_STOP,
|
||||
SWITCH_EVENT_CALL_UPDATE,
|
||||
SWITCH_EVENT_FAILURE,
|
||||
SWITCH_EVENT_SOCKET_DATA,
|
||||
|
@ -1384,6 +1384,21 @@ public class freeswitch {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_core_get_variable_dup(string varname) {
|
||||
string ret = freeswitchPINVOKE.switch_core_get_variable_dup(varname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_core_get_variable_pdup(string varname, SWIGTYPE_p_apr_pool_t pool) {
|
||||
string ret = freeswitchPINVOKE.switch_core_get_variable_pdup(varname, SWIGTYPE_p_apr_pool_t.getCPtr(pool));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_core_get_hostname() {
|
||||
string ret = freeswitchPINVOKE.switch_core_get_hostname();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void switch_core_set_variable(string varname, string value) {
|
||||
freeswitchPINVOKE.switch_core_set_variable(varname, value);
|
||||
}
|
||||
@ -2326,40 +2341,41 @@ public class freeswitch {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void switch_cache_db_dismiss_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_dismiss_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static void switch_cache_db_release_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_release_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static void switch_cache_db_destroy_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_destroy_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static switch_status_t _switch_cache_db_get_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh, switch_cache_db_handle_type_t type, switch_cache_db_connection_options_t connection_options, string file, string func, int line) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE._switch_cache_db_get_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh), (int)type, switch_cache_db_connection_options_t.getCPtr(connection_options), file, func, line);
|
||||
public static switch_cache_db_handle_type_t switch_cache_db_get_type(SWIGTYPE_p_switch_cache_db_handle dbh) {
|
||||
switch_cache_db_handle_type_t ret = (switch_cache_db_handle_type_t)freeswitchPINVOKE.switch_cache_db_get_type(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string switch_cache_db_execute_sql2str(switch_cache_db_handle_t dbh, string sql, string str, uint len, ref string err) {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_execute_sql2str(switch_cache_db_handle_t.getCPtr(dbh), sql, str, len, ref err);
|
||||
public static void switch_cache_db_dismiss_db_handle(SWIGTYPE_p_p_switch_cache_db_handle dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_dismiss_db_handle(SWIGTYPE_p_p_switch_cache_db_handle.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static void switch_cache_db_release_db_handle(SWIGTYPE_p_p_switch_cache_db_handle dbh) {
|
||||
freeswitchPINVOKE.switch_cache_db_release_db_handle(SWIGTYPE_p_p_switch_cache_db_handle.getCPtr(dbh));
|
||||
}
|
||||
|
||||
public static switch_status_t _switch_cache_db_get_db_handle(SWIGTYPE_p_p_switch_cache_db_handle dbh, switch_cache_db_handle_type_t type, switch_cache_db_connection_options_t connection_options, string file, string func, int line) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE._switch_cache_db_get_db_handle(SWIGTYPE_p_p_switch_cache_db_handle.getCPtr(dbh), (int)type, switch_cache_db_connection_options_t.getCPtr(connection_options), file, func, line);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_cache_db_execute_sql(switch_cache_db_handle_t dbh, string sql, ref string err) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_execute_sql(switch_cache_db_handle_t.getCPtr(dbh), sql, ref err);
|
||||
public static string switch_cache_db_execute_sql2str(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, string str, uint len, ref string err) {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_execute_sql2str(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, str, len, ref err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_cache_db_execute_sql_callback(switch_cache_db_handle_t dbh, string sql, SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int callback, SWIGTYPE_p_void pdata, ref string err) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_execute_sql_callback(switch_cache_db_handle_t.getCPtr(dbh), sql, SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int.getCPtr(callback), SWIGTYPE_p_void.getCPtr(pdata), ref err);
|
||||
public static switch_status_t switch_cache_db_execute_sql(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, ref string err) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_execute_sql(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, ref err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static int switch_cache_db_affected_rows(switch_cache_db_handle_t dbh) {
|
||||
int ret = freeswitchPINVOKE.switch_cache_db_affected_rows(switch_cache_db_handle_t.getCPtr(dbh));
|
||||
public static switch_status_t switch_cache_db_execute_sql_callback(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int callback, SWIGTYPE_p_void pdata, ref string err) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_execute_sql_callback(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int.getCPtr(callback), SWIGTYPE_p_void.getCPtr(pdata), ref err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static int switch_cache_db_affected_rows(SWIGTYPE_p_switch_cache_db_handle dbh) {
|
||||
int ret = freeswitchPINVOKE.switch_cache_db_affected_rows(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2367,30 +2383,26 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_cache_db_status(switch_stream_handle.getCPtr(stream));
|
||||
}
|
||||
|
||||
public static switch_status_t _switch_core_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t dbh, string file, string func, int line) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE._switch_core_db_handle(SWIGTYPE_p_p_switch_cache_db_handle_t.getCPtr(dbh), file, func, line);
|
||||
public static switch_status_t _switch_core_db_handle(SWIGTYPE_p_p_switch_cache_db_handle dbh, string file, string func, int line) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE._switch_core_db_handle(SWIGTYPE_p_p_switch_cache_db_handle.getCPtr(dbh), file, func, line);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_bool_t switch_cache_db_test_reactive(switch_cache_db_handle_t db, string test_sql, string drop_sql, string reactive_sql) {
|
||||
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_cache_db_test_reactive(switch_cache_db_handle_t.getCPtr(db), test_sql, drop_sql, reactive_sql);
|
||||
public static switch_bool_t switch_cache_db_test_reactive(SWIGTYPE_p_switch_cache_db_handle db, string test_sql, string drop_sql, string reactive_sql) {
|
||||
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_cache_db_test_reactive(SWIGTYPE_p_switch_cache_db_handle.getCPtr(db), test_sql, drop_sql, reactive_sql);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_cache_db_persistant_execute(switch_cache_db_handle_t dbh, string sql, uint retries) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_persistant_execute(switch_cache_db_handle_t.getCPtr(dbh), sql, retries);
|
||||
public static switch_status_t switch_cache_db_persistant_execute(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, uint retries) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_persistant_execute(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, retries);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_cache_db_persistant_execute_trans(switch_cache_db_handle_t dbh, string sql, uint retries) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_persistant_execute_trans(switch_cache_db_handle_t.getCPtr(dbh), sql, retries);
|
||||
public static switch_status_t switch_cache_db_persistant_execute_trans(SWIGTYPE_p_switch_cache_db_handle dbh, string sql, uint retries) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_cache_db_persistant_execute_trans(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), sql, retries);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void switch_cache_db_detach() {
|
||||
freeswitchPINVOKE.switch_cache_db_detach();
|
||||
}
|
||||
|
||||
public static uint switch_core_debug_level() {
|
||||
uint ret = freeswitchPINVOKE.switch_core_debug_level();
|
||||
return ret;
|
||||
@ -2415,6 +2427,21 @@ public class freeswitch {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_core_add_registration(string user, string realm, string token, string url, uint expires, string network_ip, string network_port, string network_proto) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_add_registration(user, realm, token, url, expires, network_ip, network_port, network_proto);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_core_del_registration(string user, string realm, string token) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_del_registration(user, realm, token);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_core_expire_registration(int force) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_expire_registration(force);
|
||||
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;
|
||||
@ -3974,6 +4001,10 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_change_sln_volume(SWIGTYPE_p_short.getCPtr(data), samples, vol);
|
||||
}
|
||||
|
||||
public static void switch_change_sln_volume_granular(SWIGTYPE_p_short data, uint samples, int vol) {
|
||||
freeswitchPINVOKE.switch_change_sln_volume_granular(SWIGTYPE_p_short.getCPtr(data), samples, vol);
|
||||
}
|
||||
|
||||
public static uint switch_merge_sln(SWIGTYPE_p_short data, uint samples, SWIGTYPE_p_short other_data, uint other_samples) {
|
||||
uint ret = freeswitchPINVOKE.switch_merge_sln(SWIGTYPE_p_short.getCPtr(data), samples, SWIGTYPE_p_short.getCPtr(other_data), other_samples);
|
||||
return ret;
|
||||
@ -4719,8 +4750,8 @@ public class freeswitch {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session, uint queue_frames, uint max_queue_frames, uint samples_per_packet, uint samples_per_second) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), queue_frames, max_queue_frames, samples_per_packet, samples_per_second);
|
||||
public static switch_status_t switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session, uint queue_frames, uint max_queue_frames, uint samples_per_packet, uint samples_per_second, uint max_drift) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), queue_frames, max_queue_frames, samples_per_packet, samples_per_second, max_drift);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -4857,6 +4888,10 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_rtp_set_telephony_recv_event(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), te);
|
||||
}
|
||||
|
||||
public static void switch_rtp_set_recv_pt(SWIGTYPE_p_switch_rtp rtp_session, byte pt) {
|
||||
freeswitchPINVOKE.switch_rtp_set_recv_pt(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), pt);
|
||||
}
|
||||
|
||||
public static void switch_rtp_set_cng_pt(SWIGTYPE_p_switch_rtp rtp_session, byte pt) {
|
||||
freeswitchPINVOKE.switch_rtp_set_cng_pt(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), pt);
|
||||
}
|
||||
@ -7569,6 +7604,15 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_variable")]
|
||||
public static extern string switch_core_get_variable(string jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_variable_dup")]
|
||||
public static extern string switch_core_get_variable_dup(string jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_variable_pdup")]
|
||||
public static extern string switch_core_get_variable_pdup(string jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_hostname")]
|
||||
public static extern string switch_core_get_hostname();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_set_variable")]
|
||||
public static extern void switch_core_set_variable(string jarg1, string jarg2);
|
||||
|
||||
@ -8217,90 +8261,18 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_cache_db_connection_options_t")]
|
||||
public static extern void delete_switch_cache_db_connection_options_t(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_name_set")]
|
||||
public static extern void switch_cache_db_handle_t_name_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_name_get")]
|
||||
public static extern string switch_cache_db_handle_t_name_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_type_set")]
|
||||
public static extern void switch_cache_db_handle_t_type_set(HandleRef jarg1, int jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_type_get")]
|
||||
public static extern int switch_cache_db_handle_t_type_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_native_handle_set")]
|
||||
public static extern void switch_cache_db_handle_t_native_handle_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_native_handle_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_native_handle_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_last_used_set")]
|
||||
public static extern void switch_cache_db_handle_t_last_used_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_last_used_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_last_used_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_mutex_set")]
|
||||
public static extern void switch_cache_db_handle_t_mutex_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_mutex_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_mutex_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_io_mutex_set")]
|
||||
public static extern void switch_cache_db_handle_t_io_mutex_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_io_mutex_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_io_mutex_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_pool_set")]
|
||||
public static extern void switch_cache_db_handle_t_pool_set(HandleRef jarg1, HandleRef jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_pool_get")]
|
||||
public static extern IntPtr switch_cache_db_handle_t_pool_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_flags_set")]
|
||||
public static extern void switch_cache_db_handle_t_flags_set(HandleRef jarg1, int jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_flags_get")]
|
||||
public static extern int switch_cache_db_handle_t_flags_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_hash_set")]
|
||||
public static extern void switch_cache_db_handle_t_hash_set(HandleRef jarg1, uint jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_hash_get")]
|
||||
public static extern uint switch_cache_db_handle_t_hash_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_creator_set")]
|
||||
public static extern void switch_cache_db_handle_t_creator_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_creator_get")]
|
||||
public static extern string switch_cache_db_handle_t_creator_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_last_user_set")]
|
||||
public static extern void switch_cache_db_handle_t_last_user_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_handle_t_last_user_get")]
|
||||
public static extern string switch_cache_db_handle_t_last_user_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_cache_db_handle_t")]
|
||||
public static extern IntPtr new_switch_cache_db_handle_t();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_cache_db_handle_t")]
|
||||
public static extern void delete_switch_cache_db_handle_t(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_type_name")]
|
||||
public static extern string switch_cache_db_type_name(int jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_get_type")]
|
||||
public static extern int switch_cache_db_get_type(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_dismiss_db_handle")]
|
||||
public static extern void switch_cache_db_dismiss_db_handle(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_release_db_handle")]
|
||||
public static extern void switch_cache_db_release_db_handle(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_destroy_db_handle")]
|
||||
public static extern void switch_cache_db_destroy_db_handle(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp__switch_cache_db_get_db_handle")]
|
||||
public static extern int _switch_cache_db_get_db_handle(HandleRef jarg1, int jarg2, HandleRef jarg3, string jarg4, string jarg5, int jarg6);
|
||||
|
||||
@ -8331,9 +8303,6 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_persistant_execute_trans")]
|
||||
public static extern int switch_cache_db_persistant_execute_trans(HandleRef jarg1, string jarg2, uint jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_detach")]
|
||||
public static extern void switch_cache_db_detach();
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_debug_level")]
|
||||
public static extern uint switch_core_debug_level();
|
||||
|
||||
@ -8349,6 +8318,15 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_default_ptime")]
|
||||
public static extern uint switch_default_ptime(string jarg1, uint jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_add_registration")]
|
||||
public static extern int switch_core_add_registration(string jarg1, string jarg2, string jarg3, string jarg4, uint jarg5, string jarg6, string jarg7, string jarg8);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_del_registration")]
|
||||
public static extern int switch_core_del_registration(string jarg1, string jarg2, string jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_expire_registration")]
|
||||
public static extern int switch_core_expire_registration(int jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_set")]
|
||||
public static extern void switch_loadable_module_interface_module_name_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
@ -12042,6 +12020,9 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_change_sln_volume")]
|
||||
public static extern void switch_change_sln_volume(HandleRef jarg1, uint jarg2, int jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_change_sln_volume_granular")]
|
||||
public static extern void switch_change_sln_volume_granular(HandleRef jarg1, uint jarg2, int jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_merge_sln")]
|
||||
public static extern uint switch_merge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4);
|
||||
|
||||
@ -12652,7 +12633,7 @@ class freeswitchPINVOKE {
|
||||
public static extern int switch_rtp_activate_rtcp(HandleRef jarg1, int jarg2, ushort jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_jitter_buffer")]
|
||||
public static extern int switch_rtp_activate_jitter_buffer(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5);
|
||||
public static extern int switch_rtp_activate_jitter_buffer(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5, uint jarg6);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_debug_jitter_buffer")]
|
||||
public static extern int switch_rtp_debug_jitter_buffer(HandleRef jarg1, string jarg2);
|
||||
@ -12738,6 +12719,9 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_telephony_recv_event")]
|
||||
public static extern void switch_rtp_set_telephony_recv_event(HandleRef jarg1, byte jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_recv_pt")]
|
||||
public static extern void switch_rtp_set_recv_pt(HandleRef jarg1, byte jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_cng_pt")]
|
||||
public static extern void switch_rtp_set_cng_pt(HandleRef jarg1, byte jarg2);
|
||||
|
||||
@ -17139,18 +17123,18 @@ namespace FreeSWITCH.Native {
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class SWIGTYPE_p_p_switch_cache_db_handle_t {
|
||||
public class SWIGTYPE_p_p_switch_cache_db_handle {
|
||||
private HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_p_switch_cache_db_handle_t(IntPtr cPtr, bool futureUse) {
|
||||
internal SWIGTYPE_p_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_p_switch_cache_db_handle_t() {
|
||||
protected SWIGTYPE_p_p_switch_cache_db_handle() {
|
||||
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_cache_db_handle_t obj) {
|
||||
internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_cache_db_handle obj) {
|
||||
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
@ -18159,6 +18143,36 @@ namespace FreeSWITCH.Native {
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class SWIGTYPE_p_switch_cache_db_handle {
|
||||
private HandleRef swigCPtr;
|
||||
|
||||
internal SWIGTYPE_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
|
||||
swigCPtr = new HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_switch_cache_db_handle() {
|
||||
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static HandleRef getCPtr(SWIGTYPE_p_switch_cache_db_handle obj) {
|
||||
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 1.3.35
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
namespace FreeSWITCH.Native {
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class SWIGTYPE_p_switch_call_cause_t {
|
||||
private HandleRef swigCPtr;
|
||||
|
||||
@ -20653,169 +20667,6 @@ public class switch_cache_db_core_db_options_t : IDisposable {
|
||||
|
||||
namespace FreeSWITCH.Native {
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class switch_cache_db_handle_t : IDisposable {
|
||||
private HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal switch_cache_db_handle_t(IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static HandleRef getCPtr(switch_cache_db_handle_t obj) {
|
||||
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~switch_cache_db_handle_t() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
freeswitchPINVOKE.delete_switch_cache_db_handle_t(swigCPtr);
|
||||
}
|
||||
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public string name {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_name_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_handle_t_name_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public switch_cache_db_handle_type_t type {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_type_set(swigCPtr, (int)value);
|
||||
}
|
||||
get {
|
||||
switch_cache_db_handle_type_t ret = (switch_cache_db_handle_type_t)freeswitchPINVOKE.switch_cache_db_handle_t_type_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public switch_cache_db_native_handle_t native_handle {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_native_handle_set(swigCPtr, switch_cache_db_native_handle_t.getCPtr(value));
|
||||
}
|
||||
get {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_handle_t_native_handle_get(swigCPtr);
|
||||
switch_cache_db_native_handle_t ret = (cPtr == IntPtr.Zero) ? null : new switch_cache_db_native_handle_t(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_time_t last_used {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_last_used_set(swigCPtr, SWIGTYPE_p_time_t.getCPtr(value));
|
||||
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
get {
|
||||
SWIGTYPE_p_time_t ret = new SWIGTYPE_p_time_t(freeswitchPINVOKE.switch_cache_db_handle_t_last_used_get(swigCPtr), true);
|
||||
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_switch_mutex_t mutex {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_mutex_set(swigCPtr, SWIGTYPE_p_switch_mutex_t.getCPtr(value));
|
||||
}
|
||||
get {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_handle_t_mutex_get(swigCPtr);
|
||||
SWIGTYPE_p_switch_mutex_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_mutex_t(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_switch_mutex_t io_mutex {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_io_mutex_set(swigCPtr, SWIGTYPE_p_switch_mutex_t.getCPtr(value));
|
||||
}
|
||||
get {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_handle_t_io_mutex_get(swigCPtr);
|
||||
SWIGTYPE_p_switch_mutex_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_mutex_t(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public SWIGTYPE_p_apr_pool_t pool {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_pool_set(swigCPtr, SWIGTYPE_p_apr_pool_t.getCPtr(value));
|
||||
}
|
||||
get {
|
||||
IntPtr cPtr = freeswitchPINVOKE.switch_cache_db_handle_t_pool_get(swigCPtr);
|
||||
SWIGTYPE_p_apr_pool_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_apr_pool_t(cPtr, false);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public int flags {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_flags_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
int ret = freeswitchPINVOKE.switch_cache_db_handle_t_flags_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public uint hash {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_hash_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
uint ret = freeswitchPINVOKE.switch_cache_db_handle_t_hash_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public string creator {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_creator_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_handle_t_creator_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public string last_user {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_cache_db_handle_t_last_user_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
string ret = freeswitchPINVOKE.switch_cache_db_handle_t_last_user_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public switch_cache_db_handle_t() : this(freeswitchPINVOKE.new_switch_cache_db_handle_t(), true) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 1.3.35
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
namespace FreeSWITCH.Native {
|
||||
|
||||
public enum switch_cache_db_handle_type_t {
|
||||
SCDB_TYPE_CORE_DB,
|
||||
SCDB_TYPE_ODBC
|
||||
@ -24889,6 +24740,8 @@ public enum switch_event_types_t {
|
||||
SWITCH_EVENT_NAT,
|
||||
SWITCH_EVENT_RECORD_START,
|
||||
SWITCH_EVENT_RECORD_STOP,
|
||||
SWITCH_EVENT_PLAYBACK_START,
|
||||
SWITCH_EVENT_PLAYBACK_STOP,
|
||||
SWITCH_EVENT_CALL_UPDATE,
|
||||
SWITCH_EVENT_FAILURE,
|
||||
SWITCH_EVENT_SOCKET_DATA,
|
||||
|
@ -50,6 +50,7 @@ package freeswitch;
|
||||
|
||||
*consoleLog = *freeswitchc::consoleLog;
|
||||
*consoleCleanLog = *freeswitchc::consoleCleanLog;
|
||||
*email = *freeswitchc::email;
|
||||
*console_log = *freeswitchc::console_log;
|
||||
*console_clean_log = *freeswitchc::console_clean_log;
|
||||
*msleep = *freeswitchc::msleep;
|
||||
|
@ -1566,6 +1566,19 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
|
||||
|
||||
|
||||
|
||||
SWIGINTERNINLINE SV *
|
||||
SWIG_From_bool SWIG_PERL_DECL_ARGS_1(bool value)
|
||||
{
|
||||
SV *obj = sv_newmortal();
|
||||
if (value) {
|
||||
sv_setsv(obj, &PL_sv_yes);
|
||||
} else {
|
||||
sv_setsv(obj, &PL_sv_no);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
#include <limits.h>
|
||||
#if !defined(SWIG_NO_LLONG_MAX)
|
||||
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
|
||||
@ -1780,19 +1793,6 @@ SWIG_From_char SWIG_PERL_DECL_ARGS_1(char c)
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERNINLINE SV *
|
||||
SWIG_From_bool SWIG_PERL_DECL_ARGS_1(bool value)
|
||||
{
|
||||
SV *obj = sv_newmortal();
|
||||
if (value) {
|
||||
sv_setsv(obj, &PL_sv_yes);
|
||||
} else {
|
||||
sv_setsv(obj, &PL_sv_no);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
|
||||
{
|
||||
@ -1982,6 +1982,111 @@ XS(_wrap_consoleCleanLog) {
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_email) {
|
||||
{
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
char *arg5 = (char *) NULL ;
|
||||
char *arg6 = (char *) NULL ;
|
||||
char *arg7 = (char *) NULL ;
|
||||
bool result;
|
||||
int res1 ;
|
||||
char *buf1 = 0 ;
|
||||
int alloc1 = 0 ;
|
||||
int res2 ;
|
||||
char *buf2 = 0 ;
|
||||
int alloc2 = 0 ;
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int res4 ;
|
||||
char *buf4 = 0 ;
|
||||
int alloc4 = 0 ;
|
||||
int res5 ;
|
||||
char *buf5 = 0 ;
|
||||
int alloc5 = 0 ;
|
||||
int res6 ;
|
||||
char *buf6 = 0 ;
|
||||
int alloc6 = 0 ;
|
||||
int res7 ;
|
||||
char *buf7 = 0 ;
|
||||
int alloc7 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 7)) {
|
||||
SWIG_croak("Usage: email(to,from,headers,body,file,convert_cmd,convert_ext);");
|
||||
}
|
||||
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "email" "', argument " "1"" of type '" "char *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
|
||||
if (!SWIG_IsOK(res2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "email" "', argument " "2"" of type '" "char *""'");
|
||||
}
|
||||
arg2 = reinterpret_cast< char * >(buf2);
|
||||
if (items > 2) {
|
||||
res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "email" "', argument " "3"" of type '" "char *""'");
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
}
|
||||
if (items > 3) {
|
||||
res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
|
||||
if (!SWIG_IsOK(res4)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "email" "', argument " "4"" of type '" "char *""'");
|
||||
}
|
||||
arg4 = reinterpret_cast< char * >(buf4);
|
||||
}
|
||||
if (items > 4) {
|
||||
res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5);
|
||||
if (!SWIG_IsOK(res5)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "email" "', argument " "5"" of type '" "char *""'");
|
||||
}
|
||||
arg5 = reinterpret_cast< char * >(buf5);
|
||||
}
|
||||
if (items > 5) {
|
||||
res6 = SWIG_AsCharPtrAndSize(ST(5), &buf6, NULL, &alloc6);
|
||||
if (!SWIG_IsOK(res6)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "email" "', argument " "6"" of type '" "char *""'");
|
||||
}
|
||||
arg6 = reinterpret_cast< char * >(buf6);
|
||||
}
|
||||
if (items > 6) {
|
||||
res7 = SWIG_AsCharPtrAndSize(ST(6), &buf7, NULL, &alloc7);
|
||||
if (!SWIG_IsOK(res7)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "email" "', argument " "7"" of type '" "char *""'");
|
||||
}
|
||||
arg7 = reinterpret_cast< char * >(buf7);
|
||||
}
|
||||
result = (bool)email(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
|
||||
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
|
||||
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
|
||||
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
|
||||
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_new_IVRMenu) {
|
||||
{
|
||||
IVRMenu *arg1 = (IVRMenu *) 0 ;
|
||||
@ -9336,6 +9441,7 @@ static swig_variable_info swig_variables[] = {
|
||||
static swig_command_info swig_commands[] = {
|
||||
{"freeswitchc::consoleLog", _wrap_consoleLog},
|
||||
{"freeswitchc::consoleCleanLog", _wrap_consoleCleanLog},
|
||||
{"freeswitchc::email", _wrap_email},
|
||||
{"freeswitchc::new_IVRMenu", _wrap_new_IVRMenu},
|
||||
{"freeswitchc::delete_IVRMenu", _wrap_delete_IVRMenu},
|
||||
{"freeswitchc::IVRMenu_bindAction", _wrap_IVRMenu_bindAction},
|
||||
|
@ -50,6 +50,7 @@ del types
|
||||
|
||||
consoleLog = _freeswitch.consoleLog
|
||||
consoleCleanLog = _freeswitch.consoleCleanLog
|
||||
email = _freeswitch.email
|
||||
class IVRMenu(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, IVRMenu, name, value)
|
||||
|
@ -2687,6 +2687,13 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
|
||||
|
||||
|
||||
|
||||
SWIGINTERNINLINE PyObject*
|
||||
SWIG_From_bool (bool value)
|
||||
{
|
||||
return PyBool_FromLong(value ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
#include <limits.h>
|
||||
#if !defined(SWIG_NO_LLONG_MAX)
|
||||
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
|
||||
@ -2916,13 +2923,6 @@ SWIG_From_char (char c)
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERNINLINE PyObject*
|
||||
SWIG_From_bool (bool value)
|
||||
{
|
||||
return PyBool_FromLong(value ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
|
||||
{
|
||||
@ -3071,6 +3071,113 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_email(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
char *arg5 = (char *) NULL ;
|
||||
char *arg6 = (char *) NULL ;
|
||||
char *arg7 = (char *) NULL ;
|
||||
bool result;
|
||||
int res1 ;
|
||||
char *buf1 = 0 ;
|
||||
int alloc1 = 0 ;
|
||||
int res2 ;
|
||||
char *buf2 = 0 ;
|
||||
int alloc2 = 0 ;
|
||||
int res3 ;
|
||||
char *buf3 = 0 ;
|
||||
int alloc3 = 0 ;
|
||||
int res4 ;
|
||||
char *buf4 = 0 ;
|
||||
int alloc4 = 0 ;
|
||||
int res5 ;
|
||||
char *buf5 = 0 ;
|
||||
int alloc5 = 0 ;
|
||||
int res6 ;
|
||||
char *buf6 = 0 ;
|
||||
int alloc6 = 0 ;
|
||||
int res7 ;
|
||||
char *buf7 = 0 ;
|
||||
int alloc7 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
PyObject * obj3 = 0 ;
|
||||
PyObject * obj4 = 0 ;
|
||||
PyObject * obj5 = 0 ;
|
||||
PyObject * obj6 = 0 ;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO|OOOOO:email",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
|
||||
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "email" "', argument " "1"" of type '" "char *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
|
||||
if (!SWIG_IsOK(res2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "email" "', argument " "2"" of type '" "char *""'");
|
||||
}
|
||||
arg2 = reinterpret_cast< char * >(buf2);
|
||||
if (obj2) {
|
||||
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "email" "', argument " "3"" of type '" "char *""'");
|
||||
}
|
||||
arg3 = reinterpret_cast< char * >(buf3);
|
||||
}
|
||||
if (obj3) {
|
||||
res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
|
||||
if (!SWIG_IsOK(res4)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "email" "', argument " "4"" of type '" "char *""'");
|
||||
}
|
||||
arg4 = reinterpret_cast< char * >(buf4);
|
||||
}
|
||||
if (obj4) {
|
||||
res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
|
||||
if (!SWIG_IsOK(res5)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "email" "', argument " "5"" of type '" "char *""'");
|
||||
}
|
||||
arg5 = reinterpret_cast< char * >(buf5);
|
||||
}
|
||||
if (obj5) {
|
||||
res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6);
|
||||
if (!SWIG_IsOK(res6)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "email" "', argument " "6"" of type '" "char *""'");
|
||||
}
|
||||
arg6 = reinterpret_cast< char * >(buf6);
|
||||
}
|
||||
if (obj6) {
|
||||
res7 = SWIG_AsCharPtrAndSize(obj6, &buf7, NULL, &alloc7);
|
||||
if (!SWIG_IsOK(res7)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "email" "', argument " "7"" of type '" "char *""'");
|
||||
}
|
||||
arg7 = reinterpret_cast< char * >(buf7);
|
||||
}
|
||||
result = (bool)email(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
|
||||
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
|
||||
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
|
||||
return resultobj;
|
||||
fail:
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
||||
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
||||
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
||||
if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
|
||||
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
|
||||
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_IVRMenu(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
IVRMenu *arg1 = (IVRMenu *) 0 ;
|
||||
@ -8878,6 +8985,7 @@ SWIGINTERN PyObject *Session_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObje
|
||||
static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"consoleLog", _wrap_consoleLog, METH_VARARGS, NULL},
|
||||
{ (char *)"consoleCleanLog", _wrap_consoleCleanLog, METH_VARARGS, NULL},
|
||||
{ (char *)"email", _wrap_email, METH_VARARGS, NULL},
|
||||
{ (char *)"new_IVRMenu", _wrap_new_IVRMenu, METH_VARARGS, NULL},
|
||||
{ (char *)"delete_IVRMenu", _wrap_delete_IVRMenu, METH_VARARGS, NULL},
|
||||
{ (char *)"IVRMenu_bindAction", _wrap_IVRMenu_bindAction, METH_VARARGS, NULL},
|
||||
|
@ -2882,8 +2882,8 @@ static JSBool session_construct(JSContext * cx, JSObject * obj, uintN argc, jsva
|
||||
if (switch_ivr_originate(old_jss ? old_jss->session : NULL,
|
||||
&jss->session, &jss->cause, uuid, 60, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_set_flag(jss, S_HUP);
|
||||
switch_channel_set_state(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE);
|
||||
switch_channel_wait_for_state_timeout(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE, 5000);
|
||||
//switch_channel_set_state(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE);
|
||||
//switch_channel_wait_for_state_timeout(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE, 5000);
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_TRUE);
|
||||
} else {
|
||||
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, switch_channel_cause2str(jss->cause)));
|
||||
@ -3054,7 +3054,7 @@ static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsva
|
||||
jss->session = peer_session;
|
||||
switch_set_flag(jss, S_HUP);
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_TRUE);
|
||||
switch_channel_set_state(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE);
|
||||
//switch_channel_set_state(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE);
|
||||
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Missing Args\n");
|
||||
|
35
src/mod/sdk/autotools/.gitignore
vendored
Normal file
35
src/mod/sdk/autotools/.gitignore
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
*.o
|
||||
*.lo
|
||||
*.so
|
||||
*.a
|
||||
*.orig
|
||||
*.rej
|
||||
*.log
|
||||
*.la
|
||||
|
||||
.deps
|
||||
.libs
|
||||
|
||||
stamp-h1
|
||||
samples*
|
||||
Makefile
|
||||
Makefile.in
|
||||
config.log
|
||||
config.sub
|
||||
config.guess
|
||||
config.status
|
||||
configure
|
||||
libtool
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
depcomp
|
||||
install-sh
|
||||
compile
|
||||
missing
|
||||
ltmain.sh
|
||||
doxygen
|
||||
m4/libtool.m4
|
||||
m4/ltsugar.m4
|
||||
m4/ltoptions.m4
|
||||
m4/ltversion.m4
|
||||
m4/lt~obsolete.m4
|
4
src/mod/sdk/autotools/Makefile.am
Normal file
4
src/mod/sdk/autotools/Makefile.am
Normal file
@ -0,0 +1,4 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
AUTOMAKE_OPTIONS = foreign no-dist subdir-objects
|
||||
|
||||
SUBDIRS = src
|
2
src/mod/sdk/autotools/autogen.sh
Executable file
2
src/mod/sdk/autotools/autogen.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
autoreconf -i -f
|
252
src/mod/sdk/autotools/configure.ac
Normal file
252
src/mod/sdk/autotools/configure.ac
Normal file
@ -0,0 +1,252 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
# website url
|
||||
m4_define([AC_PACKAGE_URL], [http://www.example.com/])
|
||||
|
||||
AC_PREREQ([2.61])
|
||||
AC_INIT([mod_example], [0.0.0], [contact@example.com])
|
||||
AC_CONFIG_SRCDIR([src/mod_example.c])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign no-dist subdir-objects])
|
||||
AC_DISABLE_STATIC
|
||||
|
||||
# disable libtool fortran and c++ checks
|
||||
m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
|
||||
m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
|
||||
|
||||
# >=automake-1.11
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
# pkgconfig
|
||||
AC_PATH_PROG([PKG_CONFIG], [pkg-config], ["no"])
|
||||
if test "x${PKG_CONFIG}" = "xno"
|
||||
then
|
||||
AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])
|
||||
fi
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
# Checks for cflags
|
||||
AC_MSG_RESULT([${as_nl}<<>> Compiler vendor and features])
|
||||
|
||||
##
|
||||
## Compiler vendor and flag checks
|
||||
##
|
||||
HAVE_VISIBILITY="no"
|
||||
AC_ARG_ENABLE([visibility],
|
||||
[AS_HELP_STRING([--disable-visibility], [Disable symbol visibility support (default: enabled, if available)])],
|
||||
[case "${enableval}" in
|
||||
yes) enable_visibility="yes" ;;
|
||||
no) enable_visibility="no" ;;
|
||||
*) AC_MSG_ERROR([Invalid value ${enableval} for parameter --disable-visibility]) ;;
|
||||
esac],
|
||||
[enable_visibility="yes"]
|
||||
)
|
||||
|
||||
AX_COMPILER_VENDOR
|
||||
|
||||
case "${ax_cv_c_compiler_vendor}" in
|
||||
gnu)
|
||||
AC_MSG_CHECKING([whether the compiler supports -fvisibility=hidden])
|
||||
AS_IF([test "x${enable_visibility}" != "xno"],
|
||||
[save_CFLAGS="${CFLAGS}"
|
||||
CFLAGS="${CFLAGS} -fvisibility=hidden"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[int foo __attribute__ ((visibility("default")));],
|
||||
[;]
|
||||
)],
|
||||
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([HAVE_VISIBILITY],[1],[GCC visibility support])
|
||||
HAVE_VISIBILITY="yes"],
|
||||
|
||||
[AC_MSG_RESULT([no])
|
||||
HAVE_VISIBILITY="no"]
|
||||
)
|
||||
CFLAGS="${save_CFLAGS}"],
|
||||
[AC_MSG_RESULT([disabled by user])]
|
||||
)
|
||||
|
||||
AS_IF([test "x${HAVE_VISIBILITY}" != "xno"],
|
||||
[save_CFLAGS="${CFLAGS}"
|
||||
CFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
|
||||
AC_MSG_CHECKING([whether the compiler supports -fvisibility-inlines-hidden])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[;], [;]
|
||||
)],
|
||||
|
||||
[AC_MSG_RESULT([yes])
|
||||
HAVE_VISIBILITY_INLINES_HIDDEN="yes"],
|
||||
|
||||
[AC_MSG_RESULT([no])
|
||||
HAVE_VISIBILITY_INLINES_HIDDEN="no"]
|
||||
)
|
||||
CFLAGS="${save_CFLAGS}"],
|
||||
[:]
|
||||
)
|
||||
AC_DEFINE([COMPILER_GCC], [1], [Compiler is GCC])
|
||||
;;
|
||||
sun)
|
||||
AC_MSG_CHECKING([whether the compiler supports -xldscope=hidden])
|
||||
AS_IF([test "x${enable_visibility}" != "xno"],
|
||||
[save_CFLAGS="${CFLAGS}"
|
||||
CFLAGS="${CFLAGS} -xldscope=hidden"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[int foo __attribute__ ((visibility("default")));],
|
||||
[;]
|
||||
)],
|
||||
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([HAVE_VISIBILITY],[1],[SUNCC visibility support])
|
||||
HAVE_VISIBILITY="yes"],
|
||||
|
||||
[AC_MSG_RESULT([no])
|
||||
HAVE_VISIBILITY="no"]
|
||||
)
|
||||
CFLAGS="${save_CFLAGS}"],
|
||||
[AC_MSG_RESULT([disabled by user])]
|
||||
)
|
||||
AC_DEFINE([COMPILER_SUNCC], [1], [Compiler is SunCC])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_WARN([No visibility checks for this compiler defined])
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL([COMPILER_GCC], [test "x${ax_cv_c_compiler_vendor}" = "xgnu"])
|
||||
AM_CONDITIONAL([COMPILER_SUNCC], [test "x${ax_cv_c_compiler_vendor}" = "xsun"])
|
||||
|
||||
AM_CONDITIONAL([HAVE_VISIBILITY], [test "x${HAVE_VISIBILITY}" = "xyes"])
|
||||
AM_CONDITIONAL([HAVE_VISIBILITY_INLINES_HIDDEN], [test "x${HAVE_VISIBILITY_INLINES_HIDDEN}" = "xyes"])
|
||||
|
||||
##
|
||||
## pkgconfig based freeswitch detection code
|
||||
##
|
||||
AC_MSG_RESULT([${as_nl}<<>> FreeSWITCH environment])
|
||||
|
||||
PKG_CHECK_MODULES([freeswitch], [freeswitch],
|
||||
[save_LIBS="${LIBS}"
|
||||
save_CFLAGS="${CFLAGS}"
|
||||
save_CPPFLAGS="${CPPFLAGS}"
|
||||
|
||||
AC_MSG_CHECKING([FreeSWITCH version])
|
||||
|
||||
FREESWITCH_VERSION="`${PKG_CONFIG} --modversion freeswitch 2>/dev/null`"
|
||||
AS_IF([test "x${FREESWITCH_VERSION}" = "x"],
|
||||
[AC_MSG_ERROR([failed to get FreeSWITCH version])],
|
||||
[AC_MSG_RESULT([$FREESWITCH_VERSION])]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether FreeSWITCH ${FREESWITCH_VERSION} is usable])
|
||||
CFLAGS="${freeswitch_CFLAGS}"
|
||||
CPPFLAGS="${freeswitch_CPPFLAGS}"
|
||||
LIBS="${freeswitch_LIBS}"
|
||||
AC_TRY_LINK([#include <switch.h>],
|
||||
[switch_core_init(0, 0, NULL);],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([libfreeswitch is unusable, please check config.log for details])]
|
||||
)
|
||||
LIBS="${save_LIBS}"
|
||||
CFLAGS="${save_CFLAGS}"
|
||||
CPPFLAGS="${save_CPPFLAGS}"
|
||||
|
||||
# get locations, critical first
|
||||
AC_MSG_CHECKING([for installation prefix])
|
||||
FREESWITCH_PREFIX_DIR="`${PKG_CONFIG} --variable=prefix freeswitch 2>/dev/null`"
|
||||
AS_IF(
|
||||
[test "x${FREESWITCH_PREFIX_DIR}" = "x"], [AC_MSG_ERROR([unable to get FreeSWITCH prefix directory])],
|
||||
[test ! -e "${FREESWITCH_PREFIX_DIR}"], [AC_MSG_ERROR([FreeSWITCH prefix directory ${FREESWITCH_PREFIX_DIR} does not exist])]
|
||||
)
|
||||
AC_MSG_RESULT([${FREESWITCH_PREFIX_DIR}])
|
||||
|
||||
AC_MSG_CHECKING([for modules directory])
|
||||
FREESWITCH_MODULES_DIR="`${PKG_CONFIG} --variable=modulesdir freeswitch 2>/dev/null`"
|
||||
AS_IF(
|
||||
[test "x${FREESWITCH_MODULES_DIR}" = "x"], [AC_MSG_ERROR([unable to get FreeSWITCH modules directory])],
|
||||
[test ! -e "${FREESWITCH_MODULES_DIR}"], [AC_MSG_ERROR([FreeSWITCH modules directory ${FREESWITCH_MODULES_DIR} does not exist])]
|
||||
)
|
||||
AC_MSG_RESULT([${FREESWITCH_MODULES_DIR}])
|
||||
|
||||
AC_MSG_CHECKING([for configuration directory])
|
||||
FREESWITCH_CONFIG_DIR="`${PKG_CONFIG} --variable=sysconfdir freeswitch 2>/dev/null`"
|
||||
AS_IF(
|
||||
[test "x${FREESWITCH_CONFIG_DIR}" = "x"], [AC_MSG_ERROR([unable to get FreeSWITCH configuration directory])],
|
||||
[test ! -e "${FREESWITCH_CONFIG_DIR}"], [AC_MSG_ERROR([FreeSWITCH configuration directory ${FREESWITCH_CONFIG_DIR} does not exist])]
|
||||
)
|
||||
AC_MSG_RESULT([${FREESWITCH_CONFIG_DIR}])
|
||||
|
||||
# non-critical paths
|
||||
FREESWITCH_HTDOCS_DIR="`${PKG_CONFIG} --variable=htdocsdir freeswitch 2>/dev/null`"
|
||||
|
||||
FREESWITCH_RUNTIME_DIR="`${PKG_CONFIG} --variable=runtimedir freeswitch 2>/dev/null`"
|
||||
FREESWITCH_SCRIPTS_DIR="`${PKG_CONFIG} --variable=scriptsdir freeswitch 2>/dev/null`"
|
||||
|
||||
# cflags, libs
|
||||
AC_SUBST([FREESWITCH_CFLAGS], [${freeswitch_CFLAGS}])
|
||||
AC_SUBST([FREESWITCH_CPPFLAGS], [${freeswitch_CPPFLAGS}])
|
||||
AC_SUBST([FREESWITCH_LIBS], [${freeswitch_LIBS}])
|
||||
|
||||
# version
|
||||
AC_SUBST([FREESWITCH_VERSION])
|
||||
|
||||
# locations
|
||||
AC_SUBST([FREESWITCH_PREFIX_DIR])
|
||||
AC_SUBST([FREESWITCH_HTDOCS_DIR])
|
||||
AC_SUBST([FREESWITCH_CONFIG_DIR])
|
||||
AC_SUBST([FREESWITCH_MODULES_DIR])
|
||||
AC_SUBST([FREESWITCH_SCRIPTS_DIR])
|
||||
AC_SUBST([FREESWITCH_RUNTIME_DIR])
|
||||
],
|
||||
[AC_MSG_ERROR([FreeSWITCH not found])]
|
||||
)
|
||||
|
||||
##
|
||||
## Add your other dependency checks here
|
||||
##
|
||||
AC_MSG_RESULT([${as_nl}<<>> Other dependencies])
|
||||
|
||||
# Checks for header files.
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
|
||||
# Checks for library functions.
|
||||
|
||||
AC_MSG_RESULT([${as_nl}<<>> Create output files])
|
||||
AC_CONFIG_FILES([Makefile src/Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
AC_MSG_RESULT([
|
||||
====================== Configuration Summary =====================
|
||||
+ Package
|
||||
Name:...................... ${PACKAGE_NAME}
|
||||
Version:................... ${PACKAGE_VERSION}
|
||||
Bugreports:................ ${PACKAGE_BUGREPORT}
|
||||
Website:................... ${PACKAGE_URL}
|
||||
|
||||
+ Compiler
|
||||
Vendor:.................... ${ax_cv_c_compiler_vendor}
|
||||
Symbol visibility:......... ${HAVE_VISIBILITY}
|
||||
|
||||
+ FreeSWITCH
|
||||
Version:................... ${FREESWITCH_VERSION}
|
||||
Prefix:.................... ${FREESWITCH_PREFIX_DIR}
|
||||
Modules directory:......... ${FREESWITCH_MODULES_DIR}
|
||||
Configuration directory:... ${FREESWITCH_CONFIG_DIR}
|
||||
|
||||
Cflags/CPPflags/CXXflags:.. ${FREESWITCH_CFLAGS} ${FREESWITCH_CPPFLAGS}
|
||||
LDflags/Libs:.............. ${FREESWITCH_LIBS} ${FREESWITCH_LDFLAGS}
|
||||
|
||||
+ Other
|
||||
N/A
|
||||
==================================================================
|
||||
])
|
15
src/mod/sdk/autotools/m4/ax_compiler_vendor.m4
Normal file
15
src/mod/sdk/autotools/m4/ax_compiler_vendor.m4
Normal file
@ -0,0 +1,15 @@
|
||||
AC_DEFUN([AX_COMPILER_VENDOR],
|
||||
[
|
||||
AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
|
||||
[ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown
|
||||
# note: don't check for gcc first since some other compilers define __GNUC__
|
||||
for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
|
||||
vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
|
||||
#if !($vencpp)
|
||||
thisisanerror;
|
||||
#endif
|
||||
])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
|
||||
done
|
||||
])
|
||||
])
|
66
src/mod/sdk/autotools/src/Makefile.am
Normal file
66
src/mod/sdk/autotools/src/Makefile.am
Normal file
@ -0,0 +1,66 @@
|
||||
moddir = @FREESWITCH_MODULES_DIR@
|
||||
sysconfdir = @FREESWITCH_CONFIG_DIR@
|
||||
|
||||
###
|
||||
# Flags
|
||||
#
|
||||
AM_CFLAGS =
|
||||
AM_CXXFLAGS=
|
||||
AM_CPPFLAGS= -I. -I$(includedir)
|
||||
AM_LDFLAGS = -L. -L$(libdir) -avoid-version -module -no-undefined -shared
|
||||
|
||||
###
|
||||
# GCC specific flags
|
||||
#
|
||||
if COMPILER_GCC
|
||||
AM_CFLAGS += -Wall
|
||||
# symbol visibility support
|
||||
if HAVE_VISIBILITY
|
||||
AM_CFLAGS += -fvisibility=hidden
|
||||
AM_CXXFLAGS+= -fvisibility=hidden
|
||||
AM_CPPFLAGS+= -DSWITCH_API_VISIBILITY=1
|
||||
endif
|
||||
if HAVE_VISIBILITY_INLINES_HIDDEN
|
||||
AM_CXXFLAGS += -fvisibility-inlines-hidden
|
||||
endif
|
||||
endif
|
||||
|
||||
###
|
||||
# SunCC specific flags
|
||||
#
|
||||
if COMPILER_SUNCC
|
||||
AM_CFLAGS +=
|
||||
# symbol visibility support
|
||||
if HAVE_VISIBILITY
|
||||
AM_CFLAGS += -xldscope=hidden
|
||||
AM_CXXFLAGS += -xldscope=hidden
|
||||
AM_CPPFLAGS += -DSWITCH_API_VISIBILITY=1
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
###
|
||||
# add module(s) here, with suffix '.la'
|
||||
#
|
||||
mod_LTLIBRARIES = mod_example.la
|
||||
|
||||
###
|
||||
# mod_example
|
||||
#
|
||||
mod_example_la_SOURCES = mod_example.c
|
||||
mod_example_la_CFLAGS = $(AM_CFLAGS) $(FREESWITCH_CFLAGS)
|
||||
mod_example_la_CPPFLAGS= $(AM_CPPFLAGS) $(FREESWITCH_CPPFLAGS)
|
||||
mod_example_la_LDFLAGS = $(AM_LDFLAGS)
|
||||
mod_example_la_LIBADD = $(FREESWITCH_LIBS)
|
||||
|
||||
# configuration file
|
||||
#sysconf_DATA = example.conf.xml
|
||||
|
||||
#
|
||||
# install configuration
|
||||
#
|
||||
#install-sysconfDATA:
|
||||
# $(INSTALL) -d $(DESTDIR)/$(sysconfdir)
|
||||
# for x in $(sysconf_DATA); do \
|
||||
# test -e $(DESTDIR)$(sysconfdir)/$$x || $(INSTALL) -m644 $$x $(DESTDIR)$(sysconfdir)/$$x ; \
|
||||
# done
|
84
src/mod/sdk/autotools/src/mod_example.c
Normal file
84
src/mod/sdk/autotools/src/mod_example.c
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
|
||||
*
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Anthony Minessale II <anthmct@yahoo.com>
|
||||
* Portions created by the Initial Developer are Copyright (C)
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Anthony Minessale II <anthmct@yahoo.com>
|
||||
* Neal Horman <neal at wanlink dot com>
|
||||
*
|
||||
*
|
||||
* mod_example.c -- Framework Demo Module
|
||||
*
|
||||
*/
|
||||
#include <switch.h>
|
||||
|
||||
/*
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_example_shutdown);
|
||||
SWITCH_MODULE_RUNTIME_FUNCTION(mod_example_runtime);
|
||||
*/
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_example_load);
|
||||
SWITCH_MODULE_DEFINITION(mod_example, mod_example_load, NULL, NULL);
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_example_load)
|
||||
{
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hello World!\n");
|
||||
|
||||
/* indicate that the module should continue to be loaded */
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
Called when the system shuts down
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_example_shutdown);
|
||||
{
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
If it exists, this is called in it's own thread when the module-load completes
|
||||
If it returns anything but SWITCH_STATUS_TERM it will be called again automaticly
|
||||
SWITCH_MODULE_RUNTIME_FUNCTION(mod_example_runtime);
|
||||
{
|
||||
while(looping)
|
||||
{
|
||||
switch_yield(1000);
|
||||
}
|
||||
return SWITCH_STATUS_TERM;
|
||||
}
|
||||
*/
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
* indent-tabs-mode:nil
|
||||
* tab-width:4
|
||||
* c-basic-offset:4
|
||||
* End:
|
||||
* For VIM:
|
||||
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
||||
*/
|
14
src/switch.c
14
src/switch.c
@ -404,7 +404,8 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
"\t-help -- this message\n" "\t-version -- print the version and exit\n"
|
||||
#ifdef HAVE_SETRLIMIT
|
||||
"\t-waste -- allow memory waste\n" "\t-core -- dump cores\n"
|
||||
"\t-waste -- allow memory waste\n"
|
||||
"\t-core -- dump cores\n"
|
||||
#endif
|
||||
"\t-hp -- enable high priority settings\n"
|
||||
"\t-vg -- run under valgrind\n"
|
||||
@ -552,6 +553,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (local_argv[x] && !strcmp(local_argv[x], "-waste")) {
|
||||
fprintf(stderr, "WARNING: Wasting up to 8 megs of memory per thread.\n");
|
||||
sleep(2);
|
||||
waste++;
|
||||
known_opt++;
|
||||
}
|
||||
|
||||
if (local_argv[x] && !strcmp(local_argv[x], "-no-auto-stack")) {
|
||||
waste++;
|
||||
known_opt++;
|
||||
}
|
||||
@ -771,8 +779,8 @@ int main(int argc, char *argv[])
|
||||
char buf[1024] = "";
|
||||
int i = 0;
|
||||
|
||||
fprintf(stderr, "Error: stacksize %d is too large: run ulimit -s %d or run %s -waste.\nauto-adjusting stack size for optimal performance...\n",
|
||||
(int) (rlp.rlim_max / 1024), SWITCH_THREAD_STACKSIZE / 1024, local_argv[0]);
|
||||
fprintf(stderr, "Error: stacksize %d is too large: run ulimit -s %d from your shell before starting the application.\nauto-adjusting stack size for optimal performance...\n",
|
||||
(int) (rlp.rlim_max / 1024), SWITCH_THREAD_STACKSIZE / 1024);
|
||||
|
||||
memset(&rlp, 0, sizeof(rlp));
|
||||
rlp.rlim_cur = SWITCH_THREAD_STACKSIZE;
|
||||
|
@ -1206,18 +1206,20 @@ SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, sw
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_channel_wait_for_state_timeout(switch_channel_t *other_channel, switch_channel_state_t want_state, uint32_t timeout)
|
||||
SWITCH_DECLARE(void) switch_channel_wait_for_state_timeout(switch_channel_t *channel, switch_channel_state_t want_state, uint32_t timeout)
|
||||
{
|
||||
switch_channel_state_t state;
|
||||
uint32_t count = 0;
|
||||
|
||||
for (;;) {
|
||||
state = switch_channel_get_running_state(other_channel);
|
||||
state = switch_channel_get_running_state(channel);
|
||||
|
||||
if (state >= want_state) {
|
||||
if ((channel->state == channel->running_state && channel->running_state == want_state) || channel->state >= CS_HANGUP) {
|
||||
break;
|
||||
}
|
||||
|
||||
switch_cond_next();
|
||||
|
||||
if (++count >= timeout) {
|
||||
break;
|
||||
}
|
||||
@ -2042,10 +2044,13 @@ SWITCH_DECLARE(void) switch_channel_event_set_extended_data(switch_channel_t *ch
|
||||
event->event_id == SWITCH_EVENT_REQUEST_PARAMS ||
|
||||
event->event_id == SWITCH_EVENT_CHANNEL_DATA ||
|
||||
event->event_id == SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE ||
|
||||
event->event_id == SWITCH_EVENT_CHANNEL_DESTROY ||
|
||||
event->event_id == SWITCH_EVENT_SESSION_HEARTBEAT ||
|
||||
event->event_id == SWITCH_EVENT_API ||
|
||||
event->event_id == SWITCH_EVENT_RECORD_START ||
|
||||
event->event_id == SWITCH_EVENT_RECORD_STOP ||
|
||||
event->event_id == SWITCH_EVENT_PLAYBACK_START ||
|
||||
event->event_id == SWITCH_EVENT_PLAYBACK_STOP ||
|
||||
event->event_id == SWITCH_EVENT_CALL_UPDATE ||
|
||||
event->event_id == SWITCH_EVENT_MEDIA_BUG_START ||
|
||||
event->event_id == SWITCH_EVENT_MEDIA_BUG_STOP ||
|
||||
|
@ -252,7 +252,7 @@ SWITCH_DECLARE(char *) switch_console_expand_alias(char *cmd, char *arg)
|
||||
}
|
||||
|
||||
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
sql = switch_mprintf("select command from aliases where alias='%q'", cmd);
|
||||
} else {
|
||||
sql = switch_mprintf("select command from aliases where alias='%w'", cmd);
|
||||
@ -268,7 +268,7 @@ SWITCH_DECLARE(char *) switch_console_expand_alias(char *cmd, char *arg)
|
||||
switch_safe_free(sql);
|
||||
|
||||
if (!r) {
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
sql = switch_mprintf("select command from aliases where alias='%q %q'", cmd, arg);
|
||||
} else {
|
||||
sql = switch_mprintf("select command from aliases where alias='%w %w'", cmd, arg);
|
||||
@ -794,7 +794,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
|
||||
stream.write_function(&stream, "select distinct a1 from complete where " "a1 not in (select name from interfaces where hostname='%s') %s ",
|
||||
switch_core_get_hostname(), argc ? "and" : "");
|
||||
} else {
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
stream.write_function(&stream, "select distinct a%d,'%q','%q' from complete where ", h.words + 1, switch_str_nil(dup), switch_str_nil(lp));
|
||||
} else {
|
||||
stream.write_function(&stream, "select distinct a%d,'%q','%w' from complete where ", h.words + 1, switch_str_nil(dup), switch_str_nil(lp));
|
||||
@ -803,7 +803,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
|
||||
|
||||
for (x = 0; x < argc && x < 11; x++) {
|
||||
if (h.words + 1 > argc) {
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
stream.write_function(&stream, "(a%d like '::%%' or a%d = '' or a%d = '%q')%q",
|
||||
x + 1, x + 1, x + 1, switch_str_nil(argv[x]), x == argc - 1 ? "" : " and ");
|
||||
} else {
|
||||
@ -811,7 +811,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
|
||||
x + 1, x + 1, x + 1, switch_str_nil(argv[x]), x == argc - 1 ? "" : " and ");
|
||||
}
|
||||
} else {
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
stream.write_function(&stream, "(a%d like '::%%' or a%d = '' or a%d like '%q%%')%q",
|
||||
x + 1, x + 1, x + 1, switch_str_nil(argv[x]), x == argc - 1 ? "" : " and ");
|
||||
} else {
|
||||
@ -1765,6 +1765,11 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
|
||||
char *mydata = NULL, *argv[11] = { 0 };
|
||||
int argc, x;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
switch_core_flag_t cflags = switch_core_flags();
|
||||
|
||||
if (!(cflags & SCF_USE_SQL)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (string && (mydata = strdup(string))) {
|
||||
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
|
||||
@ -1787,7 +1792,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
|
||||
if (argv[x + 1] && !strcasecmp(argv[x + 1], "_any_")) {
|
||||
mystream.write_function(&mystream, "%s", "'', ");
|
||||
} else {
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
mystream.write_function(&mystream, "'%q', ", switch_str_nil(argv[x + 1]));
|
||||
} else {
|
||||
mystream.write_function(&mystream, "'%w', ", switch_str_nil(argv[x + 1]));
|
||||
@ -1803,7 +1808,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
|
||||
if (argv[x + 1] && !strcasecmp(argv[x + 1], "_any_")) {
|
||||
mystream.write_function(&mystream, "%s", "'', ");
|
||||
} else {
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
mystream.write_function(&mystream, "'%q', ", switch_str_nil(argv[x + 1]));
|
||||
} else {
|
||||
mystream.write_function(&mystream, "'%w', ", switch_str_nil(argv[x + 1]));
|
||||
@ -1821,7 +1826,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
|
||||
} else {
|
||||
mystream.write_function(&mystream, "delete from complete where ");
|
||||
for (x = 0; x < argc - 1; x++) {
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
mystream.write_function(&mystream, "a%d = '%q'%q", x + 1, switch_str_nil(argv[x + 1]), x == argc - 2 ? "" : " and ");
|
||||
} else {
|
||||
mystream.write_function(&mystream, "a%d = '%w'%w", x + 1, switch_str_nil(argv[x + 1]), x == argc - 2 ? "" : " and ");
|
||||
@ -1866,7 +1871,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_alias(const char *string)
|
||||
sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_hostname());
|
||||
switch_cache_db_persistant_execute(db, sql, 5);
|
||||
switch_safe_free(sql);
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (1, '%q','%q','%q')",
|
||||
argv[1], argv[2], switch_core_get_hostname());
|
||||
} else {
|
||||
@ -1879,7 +1884,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_alias(const char *string)
|
||||
sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_hostname());
|
||||
switch_cache_db_persistant_execute(db, sql, 5);
|
||||
switch_safe_free(sql);
|
||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||
if (switch_cache_db_get_type(db) == SCDB_TYPE_CORE_DB) {
|
||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (0, '%q','%q','%q')",
|
||||
argv[1], argv[2], switch_core_get_hostname());
|
||||
} else {
|
||||
|
@ -98,10 +98,9 @@ static void check_ip(void)
|
||||
char old_ip6[256] = "";
|
||||
int ok4 = 1, ok6 = 1;
|
||||
int mask = 0;
|
||||
static char hostname[256] = "";
|
||||
|
||||
gethostname(hostname, sizeof(hostname));
|
||||
switch_core_set_variable("hostname", hostname);
|
||||
gethostname(runtime.hostname, sizeof(runtime.hostname));
|
||||
switch_core_set_variable("hostname", runtime.hostname);
|
||||
|
||||
switch_find_local_ip(guess_ip4, sizeof(guess_ip4), &mask, AF_INET);
|
||||
switch_find_local_ip(guess_ip6, sizeof(guess_ip6), NULL, AF_INET6);
|
||||
@ -1280,7 +1279,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||
/* one per customer */
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
memset(&runtime, 0, sizeof(runtime));
|
||||
gethostname(runtime.hostname, sizeof(runtime.hostname));
|
||||
|
||||
runtime.max_db_handles = 50;
|
||||
runtime.db_handle_timeout = 5000000;;
|
||||
|
||||
runtime.runlevel++;
|
||||
runtime.sql_buffer_len = 1024 * 32;
|
||||
runtime.max_sql_buffer_len = 1024 * 1024;
|
||||
@ -1348,9 +1353,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||
runtime.console = stdout;
|
||||
}
|
||||
|
||||
gethostname(runtime.hostname, sizeof(runtime.hostname));
|
||||
switch_core_set_variable("hostname", runtime.hostname);
|
||||
|
||||
switch_find_local_ip(guess_ip, sizeof(guess_ip), &mask, AF_INET);
|
||||
switch_core_set_variable("local_ip_v4", guess_ip);
|
||||
in.s_addr = mask;
|
||||
@ -1549,6 +1552,23 @@ static void switch_load_core_config(const char *file)
|
||||
if (tmp > -1 && tmp < 11) {
|
||||
switch_core_session_ctl(SCSC_DEBUG_LEVEL, &tmp);
|
||||
}
|
||||
} else if (!strcasecmp(var, "max-db-handles")) {
|
||||
long tmp = atol(val);
|
||||
|
||||
if (tmp > 4 && tmp < 5001) {
|
||||
runtime.max_db_handles = (uint32_t) tmp;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "max-db-handles must be between 5 and 5000\n");
|
||||
}
|
||||
} else if (!strcasecmp(var, "db-handle-timeout")) {
|
||||
long tmp = atol(val);
|
||||
|
||||
if (tmp > 0 && tmp < 5001) {
|
||||
runtime.db_handle_timeout = (uint32_t) tmp * 1000000;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "db-handle-timeout must be between 1 and 5000\n");
|
||||
}
|
||||
|
||||
} else if (!strcasecmp(var, "multiple-registrations")) {
|
||||
runtime.multiple_registrations = switch_true(val);
|
||||
} else if (!strcasecmp(var, "sql-buffer-len")) {
|
||||
|
@ -94,7 +94,7 @@ SWITCH_DECLARE(int) switch_core_db_exec(switch_core_db_t *db, const char *sql, s
|
||||
if (ret == SQLITE_BUSY || ret == SQLITE_LOCKED) {
|
||||
if (sane > 1) {
|
||||
switch_core_db_free(err);
|
||||
switch_yield(100000);
|
||||
switch_yield(1000); /* Was 100000. I think it's too much */
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
@ -182,9 +182,27 @@ SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(const char *filename
|
||||
{
|
||||
switch_core_db_t *db;
|
||||
char path[1024];
|
||||
int db_ret;
|
||||
|
||||
db_pick_path(filename, path, sizeof(path));
|
||||
if (switch_core_db_open(path, &db)) {
|
||||
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)) {
|
||||
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 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)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -310,6 +310,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
||||
} else {
|
||||
memset(session->raw_read_frame.data, 255, read_frame->codec->implementation->decoded_bytes_per_packet);
|
||||
}
|
||||
|
||||
session->raw_read_frame.timestamp = 0;
|
||||
session->raw_read_frame.datalen = read_frame->codec->implementation->decoded_bytes_per_packet;
|
||||
session->raw_read_frame.samples = session->raw_read_frame.datalen / sizeof(int16_t);
|
||||
read_frame = &session->raw_read_frame;
|
||||
|
@ -409,9 +409,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_new_memory_pool(switch_memor
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_perform_destroy_memory_pool(switch_memory_pool_t **pool, const char *file, const char *func, int line)
|
||||
{
|
||||
switch_assert(pool != NULL);
|
||||
if (switch_core_memory_pool_get_data(*pool, "_in_thread")) {
|
||||
switch_cache_db_detach();
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ALLOC2
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_CONSOLE, "Free Pool\n");
|
||||
#endif
|
||||
|
@ -203,16 +203,12 @@ SWITCH_DECLARE(void) switch_core_session_hupall_matching_var(const char *var_nam
|
||||
for (hi = switch_hash_first(NULL, session_manager.session_table); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
if (val) {
|
||||
const char *this_val;
|
||||
session = (switch_core_session_t *) val;
|
||||
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_channel_up(session->channel) &&
|
||||
(this_val = switch_channel_get_variable(session->channel, var_name)) && (!strcmp(this_val, var_val))) {
|
||||
np = switch_core_alloc(pool, sizeof(*np));
|
||||
np->str = switch_core_strdup(pool, session->uuid_str);
|
||||
np->next = head;
|
||||
head = np;
|
||||
}
|
||||
np = switch_core_alloc(pool, sizeof(*np));
|
||||
np->str = switch_core_strdup(pool, session->uuid_str);
|
||||
np->next = head;
|
||||
head = np;
|
||||
switch_core_session_rwunlock(session);
|
||||
}
|
||||
}
|
||||
@ -221,7 +217,11 @@ SWITCH_DECLARE(void) switch_core_session_hupall_matching_var(const char *var_nam
|
||||
|
||||
for(np = head; np; np = np->next) {
|
||||
if ((session = switch_core_session_locate(np->str))) {
|
||||
switch_channel_hangup(session->channel, cause);
|
||||
const char *this_val;
|
||||
if (switch_channel_up(session->channel) &&
|
||||
(this_val = switch_channel_get_variable(session->channel, var_name)) && (!strcmp(this_val, var_val))) {
|
||||
switch_channel_hangup(session->channel, cause);
|
||||
}
|
||||
switch_core_session_rwunlock(session);
|
||||
}
|
||||
}
|
||||
@ -1947,7 +1947,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_get_flag
|
||||
|
||||
do {
|
||||
sanity--;
|
||||
ready = switch_channel_media_ready(session->channel);
|
||||
ready = switch_channel_media_up(session->channel);
|
||||
switch_cond_next();
|
||||
} while(!ready && sanity);
|
||||
|
||||
|
@ -36,6 +36,21 @@
|
||||
#include "private/switch_core_pvt.h"
|
||||
//*#define DEBUG_SQL 1
|
||||
|
||||
struct switch_cache_db_handle {
|
||||
char name[CACHE_DB_LEN];
|
||||
switch_cache_db_handle_type_t type;
|
||||
switch_cache_db_native_handle_t native_handle;
|
||||
time_t last_used;
|
||||
switch_mutex_t *mutex;
|
||||
switch_mutex_t *io_mutex;
|
||||
switch_memory_pool_t *pool;
|
||||
int32_t flags;
|
||||
unsigned long hash;
|
||||
char creator[CACHE_DB_LEN];
|
||||
char last_user[CACHE_DB_LEN];
|
||||
struct switch_cache_db_handle *next;
|
||||
};
|
||||
|
||||
static struct {
|
||||
switch_cache_db_handle_t *event_db;
|
||||
switch_queue_t *sql_queue[2];
|
||||
@ -48,12 +63,77 @@ static struct {
|
||||
switch_bool_t manage;
|
||||
switch_mutex_t *io_mutex;
|
||||
switch_mutex_t *dbh_mutex;
|
||||
switch_hash_t *dbh_hash;
|
||||
switch_cache_db_handle_t *handle_pool;
|
||||
switch_thread_cond_t *cond;
|
||||
switch_mutex_t *cond_mutex;
|
||||
uint32_t total_handles;
|
||||
uint32_t total_used_handles;
|
||||
} sql_manager;
|
||||
|
||||
|
||||
static void add_handle(switch_cache_db_handle_t *dbh)
|
||||
{
|
||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||
switch_set_flag(dbh, CDF_INUSE);
|
||||
sql_manager.total_used_handles++;
|
||||
dbh->next = sql_manager.handle_pool;
|
||||
sql_manager.handle_pool = dbh;
|
||||
sql_manager.total_handles++;
|
||||
switch_mutex_lock(dbh->mutex);
|
||||
switch_mutex_unlock(sql_manager.dbh_mutex);
|
||||
}
|
||||
|
||||
static void del_handle(switch_cache_db_handle_t *dbh)
|
||||
{
|
||||
switch_cache_db_handle_t *dbhp, *last = NULL;
|
||||
|
||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||
for (dbhp = sql_manager.handle_pool; dbhp; dbhp = dbhp->next) {
|
||||
if (dbhp == dbh) {
|
||||
if (last) {
|
||||
last->next = dbhp->next;
|
||||
} else {
|
||||
sql_manager.handle_pool = dbhp->next;
|
||||
}
|
||||
sql_manager.total_handles--;
|
||||
break;
|
||||
}
|
||||
|
||||
last = dbhp;
|
||||
}
|
||||
switch_mutex_unlock(sql_manager.dbh_mutex);
|
||||
}
|
||||
|
||||
static switch_cache_db_handle_t *get_handle(const char *db_str, const char *user_str)
|
||||
{
|
||||
switch_ssize_t hlen = -1;
|
||||
unsigned long hash = 0;
|
||||
switch_cache_db_handle_t *dbhp, *r = NULL;
|
||||
|
||||
|
||||
hash = switch_ci_hashfunc_default(db_str, &hlen);
|
||||
|
||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||
for (dbhp = sql_manager.handle_pool; dbhp; dbhp = dbhp->next) {
|
||||
if (dbhp->hash == hash && !switch_test_flag(dbhp, CDF_INUSE) &&
|
||||
!switch_test_flag(dbhp, CDF_PRUNE) && switch_mutex_trylock(dbhp->mutex) == SWITCH_STATUS_SUCCESS) {
|
||||
r = dbhp;
|
||||
|
||||
switch_set_flag(dbhp, CDF_INUSE);
|
||||
sql_manager.total_used_handles++;
|
||||
dbhp->hash = switch_ci_hashfunc_default(db_str, &hlen);
|
||||
switch_set_string(dbhp->last_user, user_str);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch_mutex_unlock(sql_manager.dbh_mutex);
|
||||
|
||||
return r;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#define SWITCH_CORE_DB "core"
|
||||
/*!
|
||||
\brief Open the default system database
|
||||
@ -93,62 +173,56 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t
|
||||
#define SQL_CACHE_TIMEOUT 120
|
||||
#define SQL_REG_TIMEOUT 15
|
||||
|
||||
|
||||
static void sql_close(time_t prune)
|
||||
{
|
||||
switch_hash_index_t *hi;
|
||||
const void *var;
|
||||
void *val;
|
||||
switch_cache_db_handle_t *dbh = NULL;
|
||||
int locked = 0;
|
||||
char *key;
|
||||
|
||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||
top:
|
||||
locked = 0;
|
||||
|
||||
for (hi = switch_hash_first(NULL, sql_manager.dbh_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
key = (char *) var;
|
||||
for (dbh = sql_manager.handle_pool; dbh; dbh = dbh->next) {
|
||||
time_t diff = 0;
|
||||
|
||||
if ((dbh = (switch_cache_db_handle_t *) val)) {
|
||||
time_t diff = 0;
|
||||
|
||||
if (prune > 0 && prune > dbh->last_used) {
|
||||
diff = (time_t) prune - dbh->last_used;
|
||||
}
|
||||
|
||||
if (prune > 0 && diff < SQL_CACHE_TIMEOUT && !switch_test_flag(dbh, CDF_PRUNE)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (switch_mutex_trylock(dbh->mutex) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Dropping idle DB connection %s\n", key);
|
||||
|
||||
switch (dbh->type) {
|
||||
case SCDB_TYPE_ODBC:
|
||||
{
|
||||
switch_odbc_handle_destroy(&dbh->native_handle.odbc_dbh);
|
||||
}
|
||||
break;
|
||||
case SCDB_TYPE_CORE_DB:
|
||||
{
|
||||
switch_core_db_close(dbh->native_handle.core_db_dbh);
|
||||
dbh->native_handle.core_db_dbh = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
switch_core_hash_delete(sql_manager.dbh_hash, key);
|
||||
switch_mutex_unlock(dbh->mutex);
|
||||
switch_core_destroy_memory_pool(&dbh->pool);
|
||||
goto top;
|
||||
|
||||
} else {
|
||||
if (!prune)
|
||||
locked++;
|
||||
continue;
|
||||
}
|
||||
if (prune > 0 && prune > dbh->last_used) {
|
||||
diff = (time_t) prune - dbh->last_used;
|
||||
}
|
||||
|
||||
if (prune > 0 && (switch_test_flag(dbh, CDF_INUSE) || (diff < SQL_CACHE_TIMEOUT && !switch_test_flag(dbh, CDF_PRUNE)))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (switch_mutex_trylock(dbh->mutex) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Dropping idle DB connection %s\n", dbh->name);
|
||||
|
||||
switch (dbh->type) {
|
||||
case SCDB_TYPE_ODBC:
|
||||
{
|
||||
switch_odbc_handle_destroy(&dbh->native_handle.odbc_dbh);
|
||||
}
|
||||
break;
|
||||
case SCDB_TYPE_CORE_DB:
|
||||
{
|
||||
switch_core_db_close(dbh->native_handle.core_db_dbh);
|
||||
dbh->native_handle.core_db_dbh = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
del_handle(dbh);
|
||||
switch_mutex_unlock(dbh->mutex);
|
||||
switch_core_destroy_memory_pool(&dbh->pool);
|
||||
goto top;
|
||||
|
||||
} else {
|
||||
if (!prune) {
|
||||
locked++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (locked) {
|
||||
@ -159,135 +233,69 @@ static void sql_close(time_t prune)
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_cache_db_handle_type_t) switch_cache_db_get_type(switch_cache_db_handle_t *dbh)
|
||||
{
|
||||
return dbh->type;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_cache_db_flush_handles(void)
|
||||
{
|
||||
sql_close(switch_epoch_time_now(NULL) + SQL_CACHE_TIMEOUT + 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_cache_db_release_db_handle(switch_cache_db_handle_t **dbh)
|
||||
{
|
||||
if (dbh && *dbh) {
|
||||
|
||||
switch ((*dbh)->type) {
|
||||
case SCDB_TYPE_ODBC:
|
||||
{
|
||||
switch_clear_flag((*dbh), CDF_INUSE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||
(*dbh)->last_used = switch_epoch_time_now(NULL);
|
||||
switch_clear_flag((*dbh), CDF_INUSE);
|
||||
switch_mutex_unlock((*dbh)->mutex);
|
||||
sql_manager.total_used_handles--;
|
||||
*dbh = NULL;
|
||||
switch_mutex_unlock(sql_manager.dbh_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_cache_db_dismiss_db_handle(switch_cache_db_handle_t **dbh)
|
||||
{
|
||||
if (dbh && *dbh) {
|
||||
|
||||
if ((*dbh)->type == SCDB_TYPE_CORE_DB) {
|
||||
switch_set_flag((*dbh), CDF_PRUNE);
|
||||
} else {
|
||||
switch_clear_flag((*dbh), CDF_INUSE);
|
||||
}
|
||||
|
||||
switch_mutex_unlock((*dbh)->mutex);
|
||||
*dbh = NULL;
|
||||
}
|
||||
switch_cache_db_release_db_handle(dbh);
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_cache_db_destroy_db_handle(switch_cache_db_handle_t **dbh)
|
||||
{
|
||||
if (dbh && *dbh) {
|
||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Deleting DB connection %s\n", (*dbh)->name);
|
||||
|
||||
switch ((*dbh)->type) {
|
||||
case SCDB_TYPE_ODBC:
|
||||
{
|
||||
switch_odbc_handle_destroy(&(*dbh)->native_handle.odbc_dbh);
|
||||
}
|
||||
break;
|
||||
case SCDB_TYPE_CORE_DB:
|
||||
{
|
||||
switch_core_db_close((*dbh)->native_handle.core_db_dbh);
|
||||
(*dbh)->native_handle.core_db_dbh = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch_core_hash_delete(sql_manager.dbh_hash, (*dbh)->name);
|
||||
switch_mutex_unlock((*dbh)->mutex);
|
||||
switch_core_destroy_memory_pool(&(*dbh)->pool);
|
||||
*dbh = NULL;
|
||||
switch_mutex_unlock(sql_manager.dbh_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_cache_db_detach(void)
|
||||
{
|
||||
char thread_str[CACHE_DB_LEN] = "";
|
||||
switch_hash_index_t *hi;
|
||||
const void *var;
|
||||
void *val;
|
||||
char *key;
|
||||
switch_cache_db_handle_t *dbh = NULL;
|
||||
int prune = 0;
|
||||
|
||||
snprintf(thread_str, sizeof(thread_str) - 1, "%lu", (unsigned long) (intptr_t) switch_thread_self());
|
||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||
|
||||
for (hi = switch_hash_first(NULL, sql_manager.dbh_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
key = (char *) var;
|
||||
if ((dbh = (switch_cache_db_handle_t *) val)) {
|
||||
if (switch_mutex_trylock(dbh->mutex) == SWITCH_STATUS_SUCCESS) {
|
||||
if (strstr(dbh->name, thread_str)) {
|
||||
if (dbh->type == SCDB_TYPE_CORE_DB) {
|
||||
switch_set_flag(dbh, CDF_PRUNE);
|
||||
prune++;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10,
|
||||
"Detach cached DB handle %s [%s]\n", thread_str, switch_cache_db_type_name(dbh->type));
|
||||
switch_clear_flag(dbh, CDF_INUSE);
|
||||
}
|
||||
}
|
||||
switch_mutex_unlock(dbh->mutex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch_mutex_unlock(sql_manager.dbh_mutex);
|
||||
|
||||
if (prune) {
|
||||
sql_close(switch_epoch_time_now(NULL));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_handle_t **dbh,
|
||||
switch_cache_db_handle_type_t type,
|
||||
switch_cache_db_connection_options_t *connection_options,
|
||||
const char *file, const char *func, int line)
|
||||
{
|
||||
switch_thread_id_t self = switch_thread_self();
|
||||
char thread_str[CACHE_DB_LEN] = "";
|
||||
char db_str[CACHE_DB_LEN] = "";
|
||||
char db_callsite_str[CACHE_DB_LEN] = "";
|
||||
switch_cache_db_handle_t *new_dbh = NULL;
|
||||
switch_ssize_t hlen = -1;
|
||||
int waiting = 0;
|
||||
uint32_t yield_len = 100000, total_yield = 0;
|
||||
|
||||
const char *db_name = NULL;
|
||||
const char *db_user = NULL;
|
||||
const char *db_pass = NULL;
|
||||
|
||||
while(runtime.max_db_handles && sql_manager.total_handles >= runtime.max_db_handles && sql_manager.total_used_handles >= sql_manager.total_handles) {
|
||||
if (!waiting++) {
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_WARNING, "Max handles %u exceeded, blocking....\n",
|
||||
runtime.max_db_handles);
|
||||
}
|
||||
|
||||
switch_yield(yield_len);
|
||||
total_yield += yield_len;
|
||||
|
||||
if (runtime.db_handle_timeout && total_yield > runtime.db_handle_timeout) {
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_ERROR, "Error connecting\n");
|
||||
*dbh = NULL;
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case SCDB_TYPE_ODBC:
|
||||
{
|
||||
@ -310,45 +318,13 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
|
||||
}
|
||||
|
||||
snprintf(db_str, sizeof(db_str) - 1, "db=\"%s\";user=\"%s\";pass=\"%s\"", db_name, db_user, db_pass);
|
||||
snprintf(thread_str, sizeof(thread_str) - 1, "%s;thread=\"%lu\"", db_str, (unsigned long) (intptr_t) self);
|
||||
snprintf(db_callsite_str, sizeof(db_callsite_str) - 1, "%s:%d", file, line);
|
||||
|
||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||
if ((new_dbh = switch_core_hash_find(sql_manager.dbh_hash, thread_str))) {
|
||||
switch_set_string(new_dbh->last_user, db_callsite_str);
|
||||
|
||||
if ((new_dbh = get_handle(db_str, db_callsite_str))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG10,
|
||||
"Reuse Cached DB handle %s [%s]\n", thread_str, switch_cache_db_type_name(new_dbh->type));
|
||||
"Reuse Unused Cached DB handle %s [%s]\n", new_dbh->name, switch_cache_db_type_name(new_dbh->type));
|
||||
} else {
|
||||
switch_hash_index_t *hi;
|
||||
const void *var;
|
||||
void *val;
|
||||
char *key;
|
||||
unsigned long hash = 0;
|
||||
|
||||
hash = switch_ci_hashfunc_default(db_str, &hlen);
|
||||
|
||||
for (hi = switch_hash_first(NULL, sql_manager.dbh_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
key = (char *) var;
|
||||
|
||||
if ((new_dbh = (switch_cache_db_handle_t *) val)) {
|
||||
if (hash == new_dbh->hash && !strncasecmp(new_dbh->name, db_str, strlen(db_str)) &&
|
||||
!switch_test_flag(new_dbh, CDF_INUSE) && !switch_test_flag(new_dbh, CDF_PRUNE)
|
||||
&& switch_mutex_trylock(new_dbh->mutex) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_set_flag(new_dbh, CDF_INUSE);
|
||||
switch_set_string(new_dbh->name, thread_str);
|
||||
new_dbh->hash = switch_ci_hashfunc_default(db_str, &hlen);
|
||||
switch_set_string(new_dbh->last_user, db_callsite_str);
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG10,
|
||||
"Reuse Unused Cached DB handle %s [%s]\n", thread_str, switch_cache_db_type_name(new_dbh->type));
|
||||
break;
|
||||
}
|
||||
}
|
||||
new_dbh = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!new_dbh) {
|
||||
switch_memory_pool_t *pool = NULL;
|
||||
switch_core_db_t *db = NULL;
|
||||
switch_odbc_handle_t *odbc_dbh = NULL;
|
||||
@ -388,17 +364,15 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG10,
|
||||
"Create Cached DB handle %s [%s]\n", thread_str, switch_cache_db_type_name(type));
|
||||
"Create Cached DB handle %s [%s] %s:%d\n", new_dbh->name, switch_cache_db_type_name(type), file, line);
|
||||
|
||||
switch_core_new_memory_pool(&pool);
|
||||
new_dbh = switch_core_alloc(pool, sizeof(*new_dbh));
|
||||
new_dbh->pool = pool;
|
||||
new_dbh->type = type;
|
||||
switch_set_string(new_dbh->name, thread_str);
|
||||
switch_set_flag(new_dbh, CDF_INUSE);
|
||||
switch_set_string(new_dbh->name, db_str);
|
||||
new_dbh->hash = switch_ci_hashfunc_default(db_str, &hlen);
|
||||
|
||||
|
||||
if (db) {
|
||||
new_dbh->native_handle.core_db_dbh = db;
|
||||
} else {
|
||||
@ -407,9 +381,7 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
|
||||
|
||||
switch_mutex_init(&new_dbh->mutex, SWITCH_MUTEX_UNNESTED, new_dbh->pool);
|
||||
switch_set_string(new_dbh->creator, db_callsite_str);
|
||||
switch_mutex_lock(new_dbh->mutex);
|
||||
|
||||
switch_core_hash_insert(sql_manager.dbh_hash, new_dbh->name, new_dbh);
|
||||
add_handle(new_dbh);
|
||||
}
|
||||
|
||||
end:
|
||||
@ -417,9 +389,7 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
|
||||
if (new_dbh) {
|
||||
new_dbh->last_used = switch_epoch_time_now(NULL);
|
||||
}
|
||||
|
||||
switch_mutex_unlock(sql_manager.dbh_mutex);
|
||||
|
||||
|
||||
*dbh = new_dbh;
|
||||
|
||||
return *dbh ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
|
||||
@ -431,13 +401,13 @@ static switch_status_t switch_cache_db_execute_sql_real(switch_cache_db_handle_t
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
char *errmsg = NULL;
|
||||
char *tmp = NULL;
|
||||
switch_mutex_t *io_mutex = dbh->io_mutex;
|
||||
|
||||
if (io_mutex) switch_mutex_lock(io_mutex);
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_lock(dbh->io_mutex);
|
||||
}
|
||||
|
||||
if (err)
|
||||
if (err) {
|
||||
*err = NULL;
|
||||
}
|
||||
|
||||
switch (dbh->type) {
|
||||
case SCDB_TYPE_ODBC:
|
||||
@ -469,9 +439,7 @@ static switch_status_t switch_cache_db_execute_sql_real(switch_cache_db_handle_t
|
||||
}
|
||||
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_unlock(dbh->io_mutex);
|
||||
}
|
||||
if (io_mutex) switch_mutex_unlock(io_mutex);
|
||||
|
||||
return status;
|
||||
}
|
||||
@ -556,10 +524,9 @@ static switch_status_t switch_cache_db_execute_sql_chunked(switch_cache_db_handl
|
||||
SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql(switch_cache_db_handle_t *dbh, char *sql, char **err)
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
switch_mutex_t *io_mutex = dbh->io_mutex;
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_lock(dbh->io_mutex);
|
||||
}
|
||||
if (io_mutex) switch_mutex_lock(io_mutex);
|
||||
|
||||
switch (dbh->type) {
|
||||
default:
|
||||
@ -569,9 +536,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql(switch_cache_db_hand
|
||||
break;
|
||||
}
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_unlock(dbh->io_mutex);
|
||||
}
|
||||
if (io_mutex) switch_mutex_unlock(io_mutex);
|
||||
|
||||
return status;
|
||||
|
||||
@ -599,11 +564,9 @@ SWITCH_DECLARE(int) switch_cache_db_affected_rows(switch_cache_db_handle_t *dbh)
|
||||
SWITCH_DECLARE(char *) switch_cache_db_execute_sql2str(switch_cache_db_handle_t *dbh, char *sql, char *str, size_t len, char **err)
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
switch_mutex_t *io_mutex = dbh->io_mutex;
|
||||
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_lock(dbh->io_mutex);
|
||||
}
|
||||
if (io_mutex) switch_mutex_lock(io_mutex);
|
||||
|
||||
switch (dbh->type) {
|
||||
case SCDB_TYPE_CORE_DB:
|
||||
@ -612,7 +575,7 @@ SWITCH_DECLARE(char *) switch_cache_db_execute_sql2str(switch_cache_db_handle_t
|
||||
|
||||
if (switch_core_db_prepare(dbh->native_handle.core_db_dbh, sql, -1, &stmt, 0)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Statement Error [%s]!\n", sql);
|
||||
return NULL;
|
||||
goto end;
|
||||
} else {
|
||||
int running = 1;
|
||||
int colcount;
|
||||
@ -652,9 +615,7 @@ SWITCH_DECLARE(char *) switch_cache_db_execute_sql2str(switch_cache_db_handle_t
|
||||
|
||||
end:
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_unlock(dbh->io_mutex);
|
||||
}
|
||||
if (io_mutex) switch_mutex_unlock(io_mutex);
|
||||
|
||||
return status == SWITCH_STATUS_SUCCESS ? str : NULL;
|
||||
|
||||
@ -665,18 +626,20 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute(switch_cache_
|
||||
char *errmsg = NULL;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
uint8_t forever = 0;
|
||||
switch_mutex_t *io_mutex = dbh->io_mutex;
|
||||
|
||||
if (!retries) {
|
||||
forever = 1;
|
||||
retries = 1000;
|
||||
}
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_lock(dbh->io_mutex);
|
||||
}
|
||||
|
||||
while (retries > 0) {
|
||||
|
||||
if (io_mutex) switch_mutex_lock(io_mutex);
|
||||
switch_cache_db_execute_sql_real(dbh, sql, &errmsg);
|
||||
if (io_mutex) switch_mutex_unlock(io_mutex);
|
||||
|
||||
|
||||
if (errmsg) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR [%s]\n", errmsg);
|
||||
switch_safe_free(errmsg);
|
||||
@ -691,11 +654,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute(switch_cache_
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_unlock(dbh->io_mutex);
|
||||
}
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@ -707,15 +666,14 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_
|
||||
uint8_t forever = 0;
|
||||
unsigned begin_retries = 100;
|
||||
uint8_t again = 0;
|
||||
switch_mutex_t *io_mutex = dbh->io_mutex;
|
||||
|
||||
if (!retries) {
|
||||
forever = 1;
|
||||
retries = 1000;
|
||||
}
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_lock(dbh->io_mutex);
|
||||
}
|
||||
if (io_mutex) switch_mutex_lock(io_mutex);
|
||||
|
||||
again:
|
||||
|
||||
@ -726,6 +684,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_
|
||||
switch_cache_db_execute_sql_real(dbh, "BEGIN", &errmsg);
|
||||
} else {
|
||||
switch_odbc_status_t result;
|
||||
|
||||
if ((result = switch_odbc_SQLSetAutoCommitAttr(dbh->native_handle.odbc_dbh, 0)) != SWITCH_ODBC_SUCCESS) {
|
||||
char tmp[100];
|
||||
switch_snprintf(tmp, sizeof(tmp), "%s-%i", "Unable to Set AutoCommit Off", result);
|
||||
@ -753,23 +712,23 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_
|
||||
|
||||
goto again;
|
||||
}
|
||||
|
||||
|
||||
switch_yield(100000);
|
||||
|
||||
if (begin_retries == 0) {
|
||||
goto done;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
while (retries > 0) {
|
||||
|
||||
switch_cache_db_execute_sql(dbh, sql, &errmsg);
|
||||
|
||||
|
||||
if (errmsg) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR [%s]\n", errmsg);
|
||||
free(errmsg);
|
||||
@ -795,10 +754,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_
|
||||
switch_odbc_SQLSetAutoCommitAttr(dbh->native_handle.odbc_dbh, 1);
|
||||
}
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_unlock(dbh->io_mutex);
|
||||
}
|
||||
|
||||
if (io_mutex) switch_mutex_unlock(io_mutex);
|
||||
|
||||
return status;
|
||||
}
|
||||
@ -808,14 +764,14 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_callback(switch_cach
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
char *errmsg = NULL;
|
||||
switch_mutex_t *io_mutex = dbh->io_mutex;
|
||||
|
||||
if (err)
|
||||
if (err) {
|
||||
*err = NULL;
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_lock(dbh->io_mutex);
|
||||
}
|
||||
|
||||
if (io_mutex) switch_mutex_lock(io_mutex);
|
||||
|
||||
|
||||
switch (dbh->type) {
|
||||
case SCDB_TYPE_ODBC:
|
||||
@ -829,16 +785,16 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_callback(switch_cach
|
||||
|
||||
if (errmsg) {
|
||||
dbh->last_used = switch_epoch_time_now(NULL) - (SQL_CACHE_TIMEOUT * 2);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR: [%s] %s\n", sql, errmsg);
|
||||
if (!strstr(errmsg, "query abort")) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR: [%s] %s\n", sql, errmsg);
|
||||
}
|
||||
switch_core_db_free(errmsg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_unlock(dbh->io_mutex);
|
||||
}
|
||||
if (io_mutex) switch_mutex_unlock(io_mutex);
|
||||
|
||||
return status;
|
||||
}
|
||||
@ -848,15 +804,14 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand
|
||||
{
|
||||
char *errmsg;
|
||||
switch_bool_t r = SWITCH_TRUE;
|
||||
switch_mutex_t *io_mutex = dbh->io_mutex;
|
||||
|
||||
if (!switch_test_flag((&runtime), SCF_AUTO_SCHEMAS)) {
|
||||
switch_cache_db_execute_sql(dbh, (char *)test_sql, NULL);
|
||||
return SWITCH_TRUE;
|
||||
}
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_lock(dbh->io_mutex);
|
||||
}
|
||||
if (io_mutex) switch_mutex_lock(io_mutex);
|
||||
|
||||
switch (dbh->type) {
|
||||
case SCDB_TYPE_ODBC:
|
||||
@ -901,9 +856,7 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand
|
||||
}
|
||||
|
||||
|
||||
if (dbh->io_mutex) {
|
||||
switch_mutex_unlock(dbh->io_mutex);
|
||||
}
|
||||
if (io_mutex) switch_mutex_unlock(io_mutex);
|
||||
|
||||
return r;
|
||||
}
|
||||
@ -922,7 +875,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_db_thread(switch_thread_t *threa
|
||||
sec = 0;
|
||||
}
|
||||
|
||||
if (++reg_sec == SQL_REG_TIMEOUT) {
|
||||
if (switch_test_flag((&runtime), SCF_USE_SQL) && ++reg_sec == SQL_REG_TIMEOUT) {
|
||||
switch_core_expire_registration(0);
|
||||
reg_sec = 0;
|
||||
}
|
||||
@ -1648,6 +1601,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_add_registration(const char *user, c
|
||||
switch_cache_db_handle_t *dbh;
|
||||
char *sql;
|
||||
|
||||
if (!switch_test_flag((&runtime), SCF_USE_SQL)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
@ -1691,12 +1648,20 @@ SWITCH_DECLARE(switch_status_t) switch_core_del_registration(const char *user, c
|
||||
switch_cache_db_handle_t *dbh;
|
||||
char *sql;
|
||||
|
||||
if (!switch_test_flag((&runtime), SCF_USE_SQL)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
sql = switch_mprintf("delete from registrations where reg_user='%q' and realm='%q' and hostname='%q'", user, realm, switch_core_get_hostname());
|
||||
if (!zstr(token) && runtime.multiple_registrations) {
|
||||
sql = switch_mprintf("delete from registrations where reg_user='%q' and realm='%q' and hostname='%q' and token='%q'", user, realm, switch_core_get_hostname(), token);
|
||||
} else {
|
||||
sql = switch_mprintf("delete from registrations where reg_user='%q' and realm='%q' and hostname='%q'", user, realm, switch_core_get_hostname());
|
||||
}
|
||||
|
||||
switch_cache_db_execute_sql(dbh, sql, NULL);
|
||||
switch_cache_db_release_db_handle(&dbh);
|
||||
@ -1713,6 +1678,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_expire_registration(int force)
|
||||
char *sql;
|
||||
switch_time_t now;
|
||||
|
||||
if (!switch_test_flag((&runtime), SCF_USE_SQL)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
@ -1723,7 +1692,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_expire_registration(int force)
|
||||
if (force) {
|
||||
sql = switch_mprintf("delete from registrations where hostname='%q'", switch_core_get_hostname());
|
||||
} else {
|
||||
sql = switch_mprintf("delete from registrations where expires <= %ld and hostname='%q'", now, switch_core_get_hostname());
|
||||
sql = switch_mprintf("delete from registrations where expires > 0 and expires <= %ld and hostname='%q'", now, switch_core_get_hostname());
|
||||
}
|
||||
|
||||
switch_cache_db_execute_sql(dbh, sql, NULL);
|
||||
@ -1750,8 +1719,6 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
|
||||
|
||||
switch_thread_cond_create(&sql_manager.cond, sql_manager.memory_pool);
|
||||
|
||||
switch_core_hash_init(&sql_manager.dbh_hash, sql_manager.memory_pool);
|
||||
|
||||
top:
|
||||
|
||||
if (!sql_manager.manage) goto skip;
|
||||
@ -1917,7 +1884,7 @@ void switch_core_sqldb_stop(void)
|
||||
if (sql_manager.manage) {
|
||||
switch_queue_push(sql_manager.sql_queue[0], NULL);
|
||||
switch_queue_push(sql_manager.sql_queue[1], NULL);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Waiting for unfinished SQL transactions\n");
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Waiting for unfinished SQL transactions\n");
|
||||
wake_thread(0);
|
||||
}
|
||||
|
||||
@ -1933,61 +1900,58 @@ void switch_core_sqldb_stop(void)
|
||||
|
||||
switch_cache_db_flush_handles();
|
||||
sql_close(0);
|
||||
|
||||
switch_core_hash_destroy(&sql_manager.dbh_hash);
|
||||
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_cache_db_status(switch_stream_handle_t *stream)
|
||||
{
|
||||
/* return some status info suitable for the cli */
|
||||
switch_hash_index_t *hi;
|
||||
switch_cache_db_handle_t *dbh = NULL;
|
||||
void *val;
|
||||
const void *var;
|
||||
char *key;
|
||||
switch_bool_t locked = SWITCH_FALSE;
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
char cleankey_str[CACHE_DB_LEN];
|
||||
char *pos1 = NULL;
|
||||
char *pos2 = NULL;
|
||||
int count = 0, used = 0;
|
||||
|
||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||
|
||||
for (hi = switch_hash_first(NULL, sql_manager.dbh_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
key = (char *) var;
|
||||
for (dbh = sql_manager.handle_pool; dbh; dbh = dbh->next) {
|
||||
char *needle = "pass=\"";
|
||||
time_t diff = 0;
|
||||
|
||||
if ((dbh = (switch_cache_db_handle_t *) val)) {
|
||||
char *needle = "pass=\"";
|
||||
time_t diff = 0;
|
||||
diff = now - dbh->last_used;
|
||||
|
||||
diff = now - dbh->last_used;
|
||||
|
||||
if (switch_mutex_trylock(dbh->mutex) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_mutex_unlock(dbh->mutex);
|
||||
locked = SWITCH_FALSE;
|
||||
} else {
|
||||
locked = SWITCH_TRUE;
|
||||
}
|
||||
|
||||
/* sanitize password */
|
||||
memset(cleankey_str, 0, sizeof(cleankey_str));
|
||||
pos1 = strstr(key, needle) + strlen(needle);
|
||||
pos2 = strstr(pos1, "\"");
|
||||
strncpy(cleankey_str, key, pos1 - key);
|
||||
strcpy(&cleankey_str[pos1 - key], pos2);
|
||||
|
||||
|
||||
stream->write_function(stream, "%s\n\tType: %s\n\tLast used: %d\n\tFlags: %s, %s\n"
|
||||
"\tCreator: %s\n\tLast User: %s\n",
|
||||
cleankey_str,
|
||||
switch_cache_db_type_name(dbh->type),
|
||||
diff,
|
||||
locked ? "Locked" : "Unlocked",
|
||||
switch_test_flag(dbh, CDF_INUSE) ? "Attached" : "Detached", dbh->creator, dbh->last_user);
|
||||
if (switch_mutex_trylock(dbh->mutex) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_mutex_unlock(dbh->mutex);
|
||||
locked = SWITCH_FALSE;
|
||||
} else {
|
||||
locked = SWITCH_TRUE;
|
||||
}
|
||||
|
||||
/* sanitize password */
|
||||
memset(cleankey_str, 0, sizeof(cleankey_str));
|
||||
pos1 = strstr(dbh->name, needle) + strlen(needle);
|
||||
pos2 = strstr(pos1, "\"");
|
||||
strncpy(cleankey_str, dbh->name, pos1 - dbh->name);
|
||||
strcpy(&cleankey_str[pos1 - dbh->name], pos2);
|
||||
|
||||
count++;
|
||||
|
||||
if (switch_test_flag(dbh, CDF_INUSE)) {
|
||||
used++;
|
||||
}
|
||||
|
||||
stream->write_function(stream, "%s\n\tType: %s\n\tLast used: %d\n\tFlags: %s, %s\n"
|
||||
"\tCreator: %s\n\tLast User: %s\n",
|
||||
cleankey_str,
|
||||
switch_cache_db_type_name(dbh->type),
|
||||
diff,
|
||||
locked ? "Locked" : "Unlocked",
|
||||
switch_test_flag(dbh, CDF_INUSE) ? "Attached" : "Detached", dbh->creator, dbh->last_user);
|
||||
}
|
||||
|
||||
stream->write_function(stream, "%d total. %d in use.\n", count, used);
|
||||
|
||||
switch_mutex_unlock(sql_manager.dbh_mutex);
|
||||
}
|
||||
|
||||
|
@ -468,7 +468,7 @@ static void api_hook(switch_core_session_t *session, const char *hook_var, int u
|
||||
{
|
||||
if (!zstr(hook_var)) {
|
||||
switch_stream_handle_t stream = { 0 };
|
||||
char *cmd = switch_core_session_strdup(session, hook_var);
|
||||
char *cmd = strdup(hook_var);
|
||||
char *arg = NULL;
|
||||
char *expanded = NULL;
|
||||
|
||||
@ -485,7 +485,7 @@ static void api_hook(switch_core_session_t *session, const char *hook_var, int u
|
||||
|
||||
switch_channel_get_variables(session->channel, &stream.param_event);
|
||||
switch_channel_event_set_data(session->channel, stream.param_event);
|
||||
expanded = switch_channel_expand_variables(session->channel, arg);
|
||||
expanded = switch_event_expand_headers(stream.param_event, arg);
|
||||
|
||||
switch_api_execute(cmd, expanded, use_session ? session : NULL, &stream);
|
||||
|
||||
@ -496,6 +496,9 @@ static void api_hook(switch_core_session_t *session, const char *hook_var, int u
|
||||
if (expanded != arg) {
|
||||
switch_safe_free(expanded);
|
||||
}
|
||||
|
||||
switch_safe_free(cmd);
|
||||
|
||||
switch_safe_free(stream.data);
|
||||
}
|
||||
}
|
||||
|
@ -501,8 +501,14 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession()
|
||||
|
||||
SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession(char *nuuid, CoreSession *a_leg)
|
||||
{
|
||||
switch_channel_t *other_channel = NULL;
|
||||
|
||||
init_vars();
|
||||
|
||||
if (a_leg && a_leg->session) {
|
||||
other_channel = switch_core_session_get_channel(a_leg->session);
|
||||
}
|
||||
|
||||
if (!strchr(nuuid, '/') && (session = switch_core_session_locate(nuuid))) {
|
||||
uuid = strdup(nuuid);
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@ -516,6 +522,7 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession(char *nuuid, CoreSession *a_
|
||||
switch_set_flag(this, S_HUP);
|
||||
uuid = strdup(switch_core_session_get_uuid(session));
|
||||
switch_channel_set_state(switch_core_session_get_channel(session), CS_SOFT_EXECUTE);
|
||||
switch_channel_wait_for_state(channel, other_channel, CS_SOFT_EXECUTE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -189,6 +189,8 @@ static char *EVENT_NAMES[] = {
|
||||
"NAT",
|
||||
"RECORD_START",
|
||||
"RECORD_STOP",
|
||||
"PLAYBACK_START",
|
||||
"PLAYBACK_STOP",
|
||||
"CALL_UPDATE",
|
||||
"FAILURE",
|
||||
"SOCKET_DATA",
|
||||
|
@ -2289,7 +2289,7 @@ SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint3
|
||||
|
||||
qlen = delay_ms / (interval);
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Setting delay to %dms (%d frames)\n", delay_ms, qlen);
|
||||
jb = stfu_n_init(qlen, qlen, read_impl.samples_per_packet, read_impl.samples_per_second);
|
||||
jb = stfu_n_init(qlen, qlen, read_impl.samples_per_packet, read_impl.samples_per_second, 0);
|
||||
|
||||
write_frame.codec = switch_core_session_get_read_codec(session);
|
||||
|
||||
|
@ -3216,8 +3216,10 @@ static switch_status_t speech_on_dtmf(switch_core_session_t *session, const swit
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||
|
||||
if (switch_core_asr_feed_dtmf(sth->ah, dtmf, &flags) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error Feeding DTMF\n");
|
||||
if (sth) {
|
||||
if (switch_core_asr_feed_dtmf(sth->ah, dtmf, &flags) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error Feeding DTMF\n");
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -3231,6 +3233,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_stop_detect_speech(switch_core_sessio
|
||||
switch_assert(channel != NULL);
|
||||
if ((sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY))) {
|
||||
switch_channel_set_private(channel, SWITCH_SPEECH_KEY, NULL);
|
||||
switch_core_event_hook_remove_recv_dtmf(session, speech_on_dtmf);
|
||||
switch_core_media_bug_remove(session, &sth->bug);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
@ -3265,14 +3268,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_resume_detect_speech(switch_core_sess
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_core_session_t *session, char *grammar, char *name)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||
switch_status_t status;
|
||||
|
||||
if (sth) {
|
||||
if ((status = switch_core_asr_load_grammar(sth->ah, grammar, name)) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error loading Grammar\n");
|
||||
switch_core_asr_close(sth->ah, &flags);
|
||||
switch_ivr_stop_detect_speech(session);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@ -3307,14 +3309,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(swit
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||
switch_status_t status;
|
||||
|
||||
if (sth) {
|
||||
if ((status = switch_core_asr_unload_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error unloading Grammar\n");
|
||||
switch_core_asr_close(sth->ah, &flags);
|
||||
switch_ivr_stop_detect_speech(session);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@ -3324,14 +3325,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_enable_grammar(switch_core_session_t *session, const char *name)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||
switch_status_t status;
|
||||
|
||||
if (sth) {
|
||||
if ((status = switch_core_asr_enable_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error enabling Grammar\n");
|
||||
switch_core_asr_close(sth->ah, &flags);
|
||||
switch_ivr_stop_detect_speech(session);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@ -3341,14 +3341,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_enable_grammar(switch_c
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_grammar(switch_core_session_t *session, const char *name)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||
switch_status_t status;
|
||||
|
||||
if (sth) {
|
||||
if ((status = switch_core_asr_disable_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error disabling Grammar\n");
|
||||
switch_core_asr_close(sth->ah, &flags);
|
||||
switch_ivr_stop_detect_speech(session);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@ -3358,14 +3357,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_grammar(switch_
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_all_grammars(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||
switch_status_t status;
|
||||
|
||||
if (sth) {
|
||||
if ((status = switch_core_asr_disable_all_grammars(sth->ah)) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error disabling all Grammars\n");
|
||||
switch_core_asr_close(sth->ah, &flags);
|
||||
switch_ivr_stop_detect_speech(session);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@ -3397,7 +3395,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *
|
||||
if (sth) {
|
||||
if (switch_core_asr_load_grammar(sth->ah, grammar, name) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error loading Grammar\n");
|
||||
switch_core_asr_close(sth->ah, &flags);
|
||||
switch_ivr_stop_detect_speech(session);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1398,10 +1398,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
//if (!switch_channel_test_flag(originator_channel, CF_ANSWERED)) {
|
||||
if (!switch_channel_media_ready(originator_channel)) {
|
||||
if (switch_channel_media_ready(originatee_channel)) {
|
||||
//if (switch_channel_test_flag(originatee_channel, CF_ANSWERED)) {
|
||||
if (!switch_channel_media_up(originator_channel)) {
|
||||
if (switch_channel_media_up(originatee_channel)) {
|
||||
swap_session = originator_session;
|
||||
originator_session = originatee_session;
|
||||
originatee_session = swap_session;
|
||||
|
@ -746,12 +746,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
|
||||
|
||||
}
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_RECORD_STOP) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Record-File-Path", file);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
if (fill_cng || waste_resources) {
|
||||
switch_core_codec_destroy(&write_codec);
|
||||
}
|
||||
@ -766,6 +760,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
|
||||
|
||||
switch_channel_set_variable_printf(channel, "record_samples", "%d", fh->samples_out);
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_RECORD_STOP) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Record-File-Path", file);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
|
||||
return status;
|
||||
}
|
||||
@ -951,6 +951,38 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_release_file_handle(switch_core_sessi
|
||||
#define FILE_BLOCKSIZE 1024 * 8
|
||||
#define FILE_BUFSIZE 1024 * 64
|
||||
|
||||
static void add_playback_vars_to_event(switch_core_session_t *session, switch_event_t *event, char *vars)
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
if (!session || !event || !vars)
|
||||
return;
|
||||
|
||||
if ((tmp = switch_core_session_strdup(session, vars))) {
|
||||
char *argv[128] = { 0 };
|
||||
int argc, i;
|
||||
|
||||
if (!(argc = switch_separate_string(tmp, ',', argv, (sizeof(argv) / sizeof(argv[0])))))
|
||||
return;
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
char *var, *val;
|
||||
|
||||
if ((var = strchr(argv[i], '='))) {
|
||||
*var = '\0';
|
||||
val = var+1;
|
||||
var = argv[i];
|
||||
|
||||
if (var && *var && val && *val) {
|
||||
if ((var = switch_core_session_sprintf(session, "playback_variable_%s", var))) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, var, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, const char *file, switch_input_args_t *args)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
@ -990,6 +1022,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||
int timeout_samples = 0;
|
||||
const char *var;
|
||||
int more_data = 0;
|
||||
char *playback_vars, *tmp;
|
||||
switch_event_t *event;
|
||||
|
||||
if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
@ -1138,6 +1172,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||
}
|
||||
}
|
||||
|
||||
/* Try to parse extra parameters for this playback (parameters within {} at the end of the filename */
|
||||
playback_vars = NULL;
|
||||
if ((tmp = strchr(file, '{'))) {
|
||||
char *tfile, *e;
|
||||
|
||||
if ((tfile = switch_core_session_strdup(session, tmp))) {
|
||||
if ((e = switch_find_end_paren(tfile, '{', '}')) && *(e + 1) == '\0') {
|
||||
*tmp = '\0';
|
||||
*e = '\0';
|
||||
playback_vars = tfile+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!fh) {
|
||||
fh = &lfh;
|
||||
@ -1293,6 +1340,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||
|
||||
ilen = samples;
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PLAYBACK_START) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Playback-File-Path", file);
|
||||
add_playback_vars_to_event(session, event, playback_vars);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
int do_speed = 1;
|
||||
int last_speed = -1;
|
||||
@ -1586,6 +1640,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||
}
|
||||
switch_channel_set_variable_printf(channel, "playback_samples", "%d", fh->samples_in);
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PLAYBACK_STOP) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Playback-File-Path", file);
|
||||
if (status == SWITCH_STATUS_BREAK) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Playback-Status", "break");
|
||||
} else {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Playback-Status", "done");
|
||||
}
|
||||
add_playback_vars_to_event(session, event, playback_vars);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
switch_core_session_io_write_lock(session);
|
||||
switch_channel_set_private(channel, "__fh", NULL);
|
||||
switch_core_session_io_rwunlock(session);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user