mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-30 10:15:52 +00:00
Merge branch 'master' of ssh://git.freeswitch.org/freeswitch
This commit is contained in:
commit
b3086c1d6b
Freeswitch.2010.slnswitch_channel.cswitch_console.cswitch_core.cswitch_core_file.cswitch_core_session.cswitch_core_sqldb.cswitch_cpp.cppswitch_event.cswitch_nat.cswitch_rtp.cswitch_utils.cswitch_xml.c
build
conf/autoload_configs
fscomm/widgets
libs
esl
freetdm/mod_freetdm
ilbc/src
openzap/mod_openzap
portaudio/build/msvc
win32/sofia
src
include
mod
applications
mod_commands
mod_dptools
mod_fsk
mod_redis
mod_voicemail
asr_tts/mod_unimrcp
codecs/mod_opus
dialplans/mod_dialplan_asterisk
endpoints
mod_dingaling
mod_khomp/src
mod_portaudio
mod_sofia
event_handlers/mod_event_socket
formats/mod_file_string
languages
xml_int/mod_xml_rpc
@ -1569,18 +1569,18 @@ Global
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|x64 Setup.ActiveCfg = Release DirectSound|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|x64 Setup.Build.0 = Release DirectSound|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|x86 Setup.ActiveCfg = Release DirectSound|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64 Setup.ActiveCfg = Debug|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x86 Setup.ActiveCfg = Debug|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.Build.0 = Release|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64 Setup.ActiveCfg = Release|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x86 Setup.ActiveCfg = Release|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug DirectSound|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug DirectSound|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug DirectSound|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug DirectSound|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64 Setup.ActiveCfg = Debug DirectSound|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x86 Setup.ActiveCfg = Debug DirectSound|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release DirectSound|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release DirectSound|Win32
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release DirectSound|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.Build.0 = Release DirectSound|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64 Setup.ActiveCfg = Release DirectSound|x64
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x86 Setup.ActiveCfg = Release DirectSound|Win32
|
||||
{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|Win32.ActiveCfg = Release|x64
|
||||
{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.ActiveCfg = Release|x64
|
||||
{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.Build.0 = Release|x64
|
||||
|
@ -48,6 +48,7 @@ codecs/mod_ilbc
|
||||
codecs/mod_speex
|
||||
codecs/mod_siren
|
||||
#codecs/mod_celt
|
||||
#codecs/mod_opus
|
||||
#codecs/mod_sangoma_codec
|
||||
#codecs/mod_dahdi_codec
|
||||
#dialplans/mod_dialplan_directory
|
||||
|
@ -78,6 +78,7 @@
|
||||
<load module="mod_h26x"/>
|
||||
<load module="mod_siren"/>
|
||||
<!--<load module="mod_celt"/>-->
|
||||
<!--<load module="mod_opus"/>-->
|
||||
|
||||
<!-- File Format Interfaces -->
|
||||
<load module="mod_sndfile"/>
|
||||
|
@ -23,6 +23,10 @@
|
||||
<settings>
|
||||
<!--Colorize the Console -->
|
||||
<param name="colorize-console" value="true"/>
|
||||
|
||||
<!-- minimum idle CPU before refusing calls -->
|
||||
<param name="min-idle-cpu" value="25"/>
|
||||
|
||||
<!--
|
||||
Max number of sessions to allow at any given time.
|
||||
|
||||
|
@ -131,6 +131,8 @@ void CodecWidget::setCodecString(QString codecList)
|
||||
QStringList parsed = codecList.split("{");
|
||||
QString var = parsed.at(1);
|
||||
var = var.split("}").at(0);
|
||||
// warning switch_core_get_Variable may return an unsafe pointer in some cases.
|
||||
// revise to use switch_core_get_variable_dup, and then free it after you are done.
|
||||
var = switch_core_get_variable(var.toAscii().data());
|
||||
if ( ! var.isEmpty() ) {
|
||||
codecList = var;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <signal.h>
|
||||
|
||||
#define CMD_BUFLEN 1024
|
||||
static int WARN_STOP = 0;
|
||||
|
||||
#ifdef WIN32
|
||||
#define strdup(src) _strdup(src)
|
||||
@ -535,6 +536,13 @@ static BOOL console_readConsole(HANDLE conIn, char* buf, int len, int* pRed, int
|
||||
static void handle_SIGINT(int sig)
|
||||
{
|
||||
if (sig);
|
||||
|
||||
WARN_STOP = 1;
|
||||
|
||||
signal(SIGINT, handle_SIGINT);
|
||||
#ifdef SIGTSTP
|
||||
signal(SIGTSTP, handle_SIGINT);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@ -581,16 +589,36 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
|
||||
|
||||
while(thread_running && handle->connected) {
|
||||
esl_status_t status = esl_recv_event_timed(handle, 10, 1, NULL);
|
||||
int aok = 1;
|
||||
|
||||
if (status == ESL_FAIL) {
|
||||
esl_log(ESL_LOG_WARNING, "Disconnected.\n");
|
||||
if (aok) esl_log(ESL_LOG_WARNING, "Disconnected.\n");
|
||||
running = -1; thread_running = 0;
|
||||
} else if (status == ESL_SUCCESS) {
|
||||
#ifndef WIN32
|
||||
fd_set can_write;
|
||||
int fd;
|
||||
struct timeval to;
|
||||
|
||||
fd = fileno(stdout);
|
||||
memset(&to, 0, sizeof(to));
|
||||
FD_ZERO(&can_write);
|
||||
FD_SET(fd, &can_write);
|
||||
to.tv_sec = 0;
|
||||
to.tv_usec = 100000;
|
||||
if (select(fd + 1, NULL, &can_write, NULL, &to) > 0) {
|
||||
aok = FD_ISSET(fd, &can_write);
|
||||
} else {
|
||||
aok = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (handle->last_event) {
|
||||
const char *type = esl_event_get_header(handle->last_event, "content-type");
|
||||
int known = 0;
|
||||
|
||||
if (!esl_strlen_zero(type)) {
|
||||
if (!strcasecmp(type, "log/data")) {
|
||||
if (aok && !strcasecmp(type, "log/data")) {
|
||||
const char *userdata = esl_event_get_header(handle->last_event, "user-data");
|
||||
|
||||
if (esl_strlen_zero(userdata) || esl_strlen_zero(filter_uuid) || !strcasecmp(filter_uuid, userdata)) {
|
||||
@ -617,7 +645,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
|
||||
} else if (!strcasecmp(type, "text/disconnect-notice")) {
|
||||
running = -1; thread_running = 0;
|
||||
known++;
|
||||
} else if (!strcasecmp(type, "text/event-plain")) {
|
||||
} else if (aok && !strcasecmp(type, "text/event-plain")) {
|
||||
char *foo;
|
||||
esl_event_serialize(handle->last_ievent, &foo, ESL_FALSE);
|
||||
printf("RECV EVENT\n%s\n", foo);
|
||||
@ -627,7 +655,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
|
||||
}
|
||||
}
|
||||
|
||||
if (!known) {
|
||||
if (aok && !known) {
|
||||
char *foo;
|
||||
printf("INCOMING DATA [%s]\n%s\n", type, handle->last_event->body ? handle->last_event->body : "");
|
||||
esl_event_serialize(handle->last_event, &foo, ESL_FALSE);
|
||||
@ -637,6 +665,11 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
|
||||
}
|
||||
}
|
||||
|
||||
if (WARN_STOP) {
|
||||
if (aok) printf("Type control-D or /exit or /quit or /bye to exit.\n\n");
|
||||
WARN_STOP = 0;
|
||||
}
|
||||
|
||||
usleep(1000);
|
||||
}
|
||||
|
||||
@ -1023,6 +1056,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
signal(SIGINT, handle_SIGINT);
|
||||
#ifdef SIGTSTP
|
||||
signal(SIGTSTP, handle_SIGINT);
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
signal(SIGQUIT, handle_SIGQUIT);
|
||||
#endif
|
||||
|
@ -1067,9 +1067,16 @@ static const char* channel_get_variable(switch_core_session_t *session, switch_e
|
||||
return variable;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This is unsafe, I don't see anywhere in the whole code where this is called with NULL session anyway.
|
||||
// There is a new switch_core_get_variable_dup that will strdup it for you and then you must free it.
|
||||
// That messes up the abstraction completely so I am just commenting it out for you.....
|
||||
/*
|
||||
if ((variable = switch_core_get_variable(variable_name))) {
|
||||
return variable;
|
||||
}
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,9 @@
|
||||
{
|
||||
fld dbl
|
||||
frndint
|
||||
fstp dbl
|
||||
}
|
||||
return (long int) dbl;
|
||||
}
|
||||
#elif defined (_WIN64)
|
||||
#include <intrin.h>
|
||||
|
@ -1234,19 +1234,19 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
zap_set_string(caller_data.ani.digits, dest);
|
||||
}
|
||||
|
||||
if ((var = switch_event_get_header(var_event, "openzap_outbound_ton")) || (var = switch_core_get_variable("openzap_outbound_ton"))) {
|
||||
if ((var = switch_event_get_header(var_event, "openzap_outbound_ton"))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting TON to: %s\n", var);
|
||||
zap_set_ton(var, &caller_data.ani.type);
|
||||
} else {
|
||||
caller_data.ani.type = outbound_profile->destination_number_ton;
|
||||
}
|
||||
|
||||
if ((var = switch_event_get_header(var_event, "openzap_custom_call_data")) || (var = switch_core_get_variable("openzap_custom_call_data"))) {
|
||||
if ((var = switch_event_get_header(var_event, "openzap_custom_call_data"))) {
|
||||
zap_set_string((char *)caller_data.raw_data, var);
|
||||
caller_data.raw_data_len = strlen(var);
|
||||
}
|
||||
|
||||
if ((var = switch_event_get_header(var_event, "openzap_outbound_npi")) || (var = switch_core_get_variable("openzap_outbound_npi"))) {
|
||||
if ((var = switch_event_get_header(var_event, "openzap_outbound_npi"))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting NPI to: %s\n", var);
|
||||
zap_set_npi(var, &caller_data.ani.plan);
|
||||
} else {
|
||||
|
@ -41,11 +41,11 @@
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
@ -57,11 +57,11 @@
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
@ -77,9 +77,11 @@
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\..\w32\extlib.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\..\w32\extlib.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
@ -92,10 +94,12 @@
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
<Import Project="..\..\..\..\w32\extlib.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
<Import Project="..\..\..\..\w32\extlib.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
@ -110,18 +114,6 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
@ -231,45 +223,23 @@
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_WMME;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)/portaudio.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ksuser.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x86.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(Platform)\$(Configuration)\portaudio_x86.pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<ImportLibrary>$(Platform)\$(Configuration)\portaudio_x86.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">
|
||||
@ -278,45 +248,23 @@
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_WMME;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ksuser.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(Platform)\$(Configuration)/portaudio_x64.pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<ImportLibrary>$(Platform)\$(Configuration)\portaudio_x64.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)/portaudio_x64.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">
|
||||
@ -325,22 +273,15 @@
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_WMME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)/portaudio.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
@ -348,20 +289,8 @@
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x86.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
|
||||
<ProgramDatabaseFile>$(Platform)\$(Configuration)\portaudio_x86.pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<ImportLibrary>$(Platform)\$(Configuration)\portaudio_x86.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">
|
||||
@ -370,22 +299,15 @@
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_WMME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
@ -393,20 +315,8 @@
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
|
||||
<ProgramDatabaseFile>$(Platform)\$(Configuration)/portaudio_x64.pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<ImportLibrary>$(Platform)\$(Configuration)/portaudio_x64.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
@ -594,6 +504,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -605,6 +516,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@ -618,6 +530,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -629,6 +542,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@ -642,6 +556,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -653,6 +568,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@ -666,6 +582,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -677,6 +594,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@ -690,6 +608,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -701,6 +620,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@ -714,6 +634,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -725,6 +646,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@ -738,6 +660,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -749,6 +672,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@ -762,6 +686,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -773,6 +698,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
|
@ -508,6 +508,12 @@ if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
|
||||
<Project>{8b3b4c4c-13c2-446c-beb0-f412cc2cfb9a}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\openssl\libeay32.2010.vcxproj">
|
||||
<Project>{d331904d-a00a-4694-a5a3-fcff64ab5dbe}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\openssl\ssleay32.2010.vcxproj">
|
||||
<Project>{b4b62169-5ad4-4559-8707-3d933ac5db39}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\pthread\pthread.2010.vcxproj">
|
||||
<Project>{df018947-0fff-4eb3-bdee-441dc81da7a4}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
|
@ -246,6 +246,7 @@ struct switch_runtime {
|
||||
int sql_buffer_len;
|
||||
int max_sql_buffer_len;
|
||||
switch_dbtype_t odbc_dbtype;
|
||||
char hostname[256];
|
||||
};
|
||||
|
||||
extern struct switch_runtime runtime;
|
||||
|
@ -759,6 +759,9 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_force_locate(_In_z_
|
||||
\return the value of the desired variable
|
||||
*/
|
||||
SWITCH_DECLARE(char *) switch_core_get_variable(_In_z_ const char *varname);
|
||||
SWITCH_DECLARE(char *) switch_core_get_variable_dup(_In_z_ const char *varname);
|
||||
SWITCH_DECLARE(char *) switch_core_get_variable_pdup(_In_z_ const char *varname, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(const char *) switch_core_get_hostname(void);
|
||||
|
||||
/*!
|
||||
\brief Add a global variable to the core
|
||||
|
@ -68,6 +68,10 @@ Note that the first parameter to the new operator is implicitly handled by c++..
|
||||
SWITCH_DECLARE(void) consoleLog(char *level_str, char *msg);
|
||||
SWITCH_DECLARE(void) consoleCleanLog(char *msg);
|
||||
|
||||
SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *body = NULL,
|
||||
char *file = NULL, char *convert_cmd = NULL, char *convert_ext = NULL);
|
||||
|
||||
|
||||
class CoreSession;
|
||||
|
||||
class IVRMenu {
|
||||
|
@ -49,7 +49,7 @@ typedef enum {
|
||||
SWITCH_NAT_TCP
|
||||
} switch_nat_ip_proto_t;
|
||||
|
||||
|
||||
SWITCH_DECLARE(const char *) switch_nat_get_type(void);
|
||||
|
||||
/*!
|
||||
\brief Initilize the NAT Traversal System
|
||||
|
@ -349,7 +349,7 @@ SWITCH_STANDARD_API(timer_test_function)
|
||||
|
||||
SWITCH_STANDARD_API(group_call_function)
|
||||
{
|
||||
char *domain;
|
||||
char *domain, *dup_domain = NULL;
|
||||
char *group_name = NULL;
|
||||
char *flags;
|
||||
int ok = 0;
|
||||
@ -392,7 +392,9 @@ SWITCH_STANDARD_API(group_call_function)
|
||||
if (domain) {
|
||||
*domain++ = '\0';
|
||||
} else {
|
||||
domain = switch_core_get_variable("domain");
|
||||
if ((dup_domain = switch_core_get_variable_dup("domain"))) {
|
||||
domain = dup_domain;
|
||||
}
|
||||
}
|
||||
|
||||
if (!zstr(domain)) {
|
||||
@ -544,13 +546,14 @@ SWITCH_STANDARD_API(group_call_function)
|
||||
}
|
||||
|
||||
end:
|
||||
|
||||
|
||||
switch_safe_free(group_name);
|
||||
switch_safe_free(dup_domain);
|
||||
|
||||
if (!ok) {
|
||||
stream->write_function(stream, "error/NO_ROUTE_DESTINATION");
|
||||
}
|
||||
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -559,7 +562,7 @@ SWITCH_STANDARD_API(in_group_function)
|
||||
{
|
||||
switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group;
|
||||
int argc;
|
||||
char *mydata = NULL, *argv[2], *user, *domain;
|
||||
char *mydata = NULL, *argv[2], *user, *domain, *dup_domain = NULL;
|
||||
char delim = ',';
|
||||
switch_event_t *params = NULL;
|
||||
const char *rval = "false";
|
||||
@ -579,7 +582,9 @@ SWITCH_STANDARD_API(in_group_function)
|
||||
if ((domain = strchr(user, '@'))) {
|
||||
*domain++ = '\0';
|
||||
} else {
|
||||
domain = switch_core_get_variable("domain");
|
||||
if ((dup_domain = switch_core_get_variable_dup("domain"))) {
|
||||
domain = dup_domain;
|
||||
}
|
||||
}
|
||||
|
||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
@ -601,6 +606,7 @@ SWITCH_STANDARD_API(in_group_function)
|
||||
|
||||
switch_xml_free(xml);
|
||||
switch_safe_free(mydata);
|
||||
switch_safe_free(dup_domain);
|
||||
switch_event_destroy(¶ms);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@ -610,7 +616,7 @@ SWITCH_STANDARD_API(user_data_function)
|
||||
{
|
||||
switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params;
|
||||
int argc;
|
||||
char *mydata = NULL, *argv[3], *key = NULL, *type = NULL, *user, *domain;
|
||||
char *mydata = NULL, *argv[3], *key = NULL, *type = NULL, *user, *domain, *dup_domain = NULL;
|
||||
char delim = ' ';
|
||||
const char *container = "params", *elem = "param";
|
||||
const char *result = NULL;
|
||||
@ -631,7 +637,9 @@ SWITCH_STANDARD_API(user_data_function)
|
||||
if ((domain = strchr(user, '@'))) {
|
||||
*domain++ = '\0';
|
||||
} else {
|
||||
if (!(domain = switch_core_get_variable("domain"))) {
|
||||
if ((dup_domain = switch_core_get_variable("domain"))) {
|
||||
domain = dup_domain;
|
||||
} else {
|
||||
domain = "cluecon.com";
|
||||
}
|
||||
}
|
||||
@ -694,6 +702,7 @@ SWITCH_STANDARD_API(user_data_function)
|
||||
}
|
||||
switch_xml_free(xml);
|
||||
switch_safe_free(mydata);
|
||||
switch_safe_free(dup_domain);
|
||||
switch_event_destroy(¶ms);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@ -4375,7 +4384,9 @@ SWITCH_STANDARD_API(global_getvar_function)
|
||||
if (zstr(cmd)) {
|
||||
switch_core_dump_variables(stream);
|
||||
} else {
|
||||
stream->write_function(stream, "%s", switch_str_nil(switch_core_get_variable(cmd)));
|
||||
char *var = switch_core_get_variable_dup(cmd);
|
||||
stream->write_function(stream, "%s", switch_str_nil(var));
|
||||
switch_safe_free(var);
|
||||
}
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -2774,7 +2774,7 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
|
||||
switch_originate_flag_t myflags = SOF_NONE;
|
||||
char *cid_name_override = NULL;
|
||||
char *cid_num_override = NULL;
|
||||
char *domain = NULL;
|
||||
char *domain = NULL, *dup_domain = NULL;
|
||||
switch_channel_t *new_channel = NULL;
|
||||
unsigned int timelimit = 60;
|
||||
const char *skip, *var;
|
||||
@ -2787,7 +2787,8 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
|
||||
if ((domain = strchr(group, '@'))) {
|
||||
*domain++ = '\0';
|
||||
} else {
|
||||
domain = switch_core_get_variable("domain");
|
||||
domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));
|
||||
dup_domain = domain;
|
||||
}
|
||||
|
||||
if (!domain) {
|
||||
@ -2859,6 +2860,7 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
|
||||
|
||||
switch_safe_free(template);
|
||||
switch_safe_free(group);
|
||||
switch_safe_free(dup_domain);
|
||||
|
||||
if (cause == SWITCH_CAUSE_NONE) {
|
||||
cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||
@ -2887,7 +2889,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||
switch_call_cause_t *cancel_cause)
|
||||
{
|
||||
switch_xml_t x_domain = NULL, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params;
|
||||
char *user = NULL, *domain = NULL;
|
||||
char *user = NULL, *domain = NULL, *dup_domain = NULL;
|
||||
const char *dest = NULL;
|
||||
static switch_call_cause_t cause = SWITCH_CAUSE_NONE;
|
||||
unsigned int timelimit = 60;
|
||||
@ -2908,7 +2910,8 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||
if ((domain = strchr(user, '@'))) {
|
||||
*domain++ = '\0';
|
||||
} else {
|
||||
domain = switch_core_get_variable("domain");
|
||||
domain = switch_core_get_variable_dup("domain");
|
||||
dup_domain = domain;
|
||||
}
|
||||
|
||||
if (!domain) {
|
||||
@ -3115,6 +3118,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||
}
|
||||
|
||||
switch_safe_free(user);
|
||||
switch_safe_free(dup_domain);
|
||||
|
||||
return cause;
|
||||
}
|
||||
@ -3193,10 +3197,11 @@ static switch_status_t event_chat_send(const char *proto, const char *from, cons
|
||||
if (body)
|
||||
switch_event_add_body(event, "%s", body);
|
||||
if (to) {
|
||||
const char *v;
|
||||
char *v;
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "To", to);
|
||||
if ((v = switch_core_get_variable(to))) {
|
||||
if ((v = switch_core_get_variable_dup(to))) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Command", v);
|
||||
free(v);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3214,15 +3219,15 @@ static switch_status_t api_chat_send(const char *proto, const char *from, const
|
||||
const char *body, const char *type, const char *hint)
|
||||
{
|
||||
if (to) {
|
||||
const char *v;
|
||||
char *v = NULL;
|
||||
switch_stream_handle_t stream = { 0 };
|
||||
char *cmd = NULL, *arg;
|
||||
|
||||
if (!(v = switch_core_get_variable(to))) {
|
||||
v = to;
|
||||
if (!(v = switch_core_get_variable_dup(to))) {
|
||||
v = strdup(to);
|
||||
}
|
||||
|
||||
cmd = strdup(v);
|
||||
cmd = v;
|
||||
switch_assert(cmd);
|
||||
|
||||
switch_url_decode(cmd);
|
||||
|
@ -220,6 +220,7 @@ static switch_bool_t fsk_detect_callback(switch_media_bug_t *bug, void *user_dat
|
||||
char *sp;
|
||||
switch_event_t *event;
|
||||
const char *app_var;
|
||||
int total = 0;
|
||||
|
||||
switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA);
|
||||
|
||||
@ -255,6 +256,7 @@ static switch_bool_t fsk_detect_callback(switch_media_bug_t *bug, void *user_dat
|
||||
}
|
||||
|
||||
if (varname && val) {
|
||||
total++;
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "%s setting FSK var [%s][%s]\n",
|
||||
switch_channel_get_name(channel), varname, val);
|
||||
switch_channel_set_variable(channel, varname, val);
|
||||
@ -270,7 +272,7 @@ static switch_bool_t fsk_detect_callback(switch_media_bug_t *bug, void *user_dat
|
||||
}
|
||||
}
|
||||
|
||||
if ((app_var = switch_channel_get_variable(channel, "execute_on_fsk"))) {
|
||||
if (total && (app_var = switch_channel_get_variable(channel, "execute_on_fsk"))) {
|
||||
char *app_arg;
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "%s processing execute_on_fsk [%s]\n",
|
||||
|
@ -89,7 +89,7 @@ SWITCH_LIMIT_INCR(limit_incr_redis)
|
||||
}
|
||||
|
||||
/* Get the keys for redis server */
|
||||
uuid_rediskey = switch_core_session_sprintf(session,"%s_%s_%s", switch_core_get_variable("hostname"), realm, resource);
|
||||
uuid_rediskey = switch_core_session_sprintf(session,"%s_%s_%s", switch_core_get_hostname(), realm, resource);
|
||||
rediskey = switch_core_session_sprintf(session, "%s_%s", realm, resource);
|
||||
|
||||
if ((pvt = switch_channel_get_private(channel, "limit_redis"))) {
|
||||
@ -179,7 +179,7 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Couldn't decrement value corresponding to %s\n", (char *)p_key);
|
||||
switch_goto_status(SWITCH_STATUS_FALSE, end);
|
||||
}
|
||||
p_uuid_key = switch_core_session_sprintf(session, "%s_%s", switch_core_get_variable("hostname"), (char *)p_key);
|
||||
p_uuid_key = switch_core_session_sprintf(session, "%s_%s", switch_core_get_hostname(), (char *)p_key);
|
||||
if (credis_decr(redis,p_uuid_key,&uuid_val) != 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Couldn't decrement value corresponding to %s\n", p_uuid_key);
|
||||
switch_goto_status(SWITCH_STATUS_FALSE, end);
|
||||
@ -193,7 +193,7 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)
|
||||
|
||||
} else {
|
||||
rediskey = switch_core_session_sprintf(session, "%s_%s", realm, resource);
|
||||
uuid_rediskey = switch_core_session_sprintf(session, "%s_%s_%s", switch_core_get_variable("hostname"), realm, resource);
|
||||
uuid_rediskey = switch_core_session_sprintf(session, "%s_%s_%s", switch_core_get_hostname(), realm, resource);
|
||||
switch_core_hash_delete(pvt->hash, (const char *) rediskey);
|
||||
|
||||
if (credis_decr(redis, rediskey, &val) != 0) {
|
||||
@ -249,13 +249,13 @@ SWITCH_LIMIT_RESET(limit_reset_redis)
|
||||
{
|
||||
REDIS redis;
|
||||
if (redis_factory(&redis) == SWITCH_STATUS_SUCCESS) {
|
||||
char *rediskey = switch_mprintf("%s_*", switch_core_get_variable("hostname"));
|
||||
char *rediskey = switch_mprintf("%s_*", switch_core_get_hostname());
|
||||
int dec = 0, val = 0, keyc;
|
||||
char *uuids[2000];
|
||||
|
||||
if ((keyc = credis_keys(redis, rediskey, uuids, switch_arraylen(uuids))) > 0) {
|
||||
int i = 0;
|
||||
int hostnamelen = strlen(switch_core_get_variable("hostname"))+1;
|
||||
int hostnamelen = strlen(switch_core_get_hostname())+1;
|
||||
|
||||
for (i = 0; i < keyc && uuids[i]; i++){
|
||||
const char *key = uuids[i] + hostnamelen;
|
||||
|
@ -2734,6 +2734,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
|
||||
switch_memory_pool_t *pool = NULL;
|
||||
char *forwarded_by = NULL;
|
||||
char *read_flags = NORMAL_FLAG_STRING;
|
||||
char *dup_domain = NULL;
|
||||
|
||||
if (zstr(data)) {
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
@ -2781,7 +2782,9 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
|
||||
}
|
||||
|
||||
if (zstr(domain)) {
|
||||
domain = switch_core_get_variable("domain");
|
||||
if ((dup_domain = switch_core_get_variable_dup("domain"))) {
|
||||
domain = dup_domain;
|
||||
}
|
||||
profile_name = domain;
|
||||
}
|
||||
|
||||
@ -2915,6 +2918,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
|
||||
end:
|
||||
|
||||
switch_safe_free(dup);
|
||||
switch_safe_free(dup_domain);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -260,6 +260,7 @@ static switch_status_t audio_queue_create(audio_queue_t ** queue, const char *na
|
||||
static switch_status_t audio_queue_write(audio_queue_t *queue, void *data, switch_size_t *data_len);
|
||||
static switch_status_t audio_queue_read(audio_queue_t *queue, void *data, switch_size_t *data_len, int block);
|
||||
static switch_status_t audio_queue_clear(audio_queue_t *queue);
|
||||
static switch_status_t audio_queue_signal(audio_queue_t *queue);
|
||||
static switch_status_t audio_queue_destroy(audio_queue_t *queue);
|
||||
|
||||
/*********************************************************************************************************************************************
|
||||
@ -287,6 +288,8 @@ enum speech_channel_state {
|
||||
SPEECH_CHANNEL_READY,
|
||||
/** processing speech request */
|
||||
SPEECH_CHANNEL_PROCESSING,
|
||||
/** finished processing speech request */
|
||||
SPEECH_CHANNEL_DONE,
|
||||
/** error opening channel */
|
||||
SPEECH_CHANNEL_ERROR
|
||||
};
|
||||
@ -667,10 +670,12 @@ static switch_status_t audio_queue_create(audio_queue_t ** audio_queue, const ch
|
||||
static switch_status_t audio_queue_write(audio_queue_t *queue, void *data, switch_size_t *data_len)
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
#ifdef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
|
||||
switch_size_t len = *data_len;
|
||||
#endif
|
||||
switch_mutex_lock(queue->mutex);
|
||||
|
||||
#ifdef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
|
||||
switch_size_t len = *data_len;
|
||||
if (queue->file_write) {
|
||||
switch_file_write(queue->file_write, data, &len);
|
||||
}
|
||||
@ -708,6 +713,9 @@ static switch_status_t audio_queue_read(audio_queue_t *queue, void *data, switch
|
||||
{
|
||||
switch_size_t requested = *data_len;
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
#ifdef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
|
||||
switch_size_t len = *data_len;
|
||||
#endif
|
||||
switch_mutex_lock(queue->mutex);
|
||||
|
||||
/* wait for data, if allowed */
|
||||
@ -736,7 +744,6 @@ static switch_status_t audio_queue_read(audio_queue_t *queue, void *data, switch
|
||||
#ifdef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) audio queue read total = %ld\tread = %ld\trequested = %ld\n", queue->name,
|
||||
queue->read_bytes, *data_len, requested);
|
||||
switch_size_t len = *data_len;
|
||||
if (queue->file_read) {
|
||||
switch_file_write(queue->file_read, data, &len);
|
||||
}
|
||||
@ -763,6 +770,20 @@ static switch_status_t audio_queue_clear(audio_queue_t *queue)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wake any threads waiting on this queue
|
||||
*
|
||||
* @param queue the queue to empty
|
||||
* @return SWITCH_STATUS_SUCCESS
|
||||
*/
|
||||
static switch_status_t audio_queue_signal(audio_queue_t *queue)
|
||||
{
|
||||
switch_mutex_lock(queue->mutex);
|
||||
switch_thread_cond_signal(queue->cond);
|
||||
switch_mutex_unlock(queue->mutex);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the audio queue
|
||||
*
|
||||
@ -1341,6 +1362,8 @@ static switch_status_t speech_channel_stop(speech_channel_t *schannel)
|
||||
goto done;
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) %s stopped\n", schannel->name, speech_channel_type_to_string(schannel->type));
|
||||
} else if (schannel->state == SPEECH_CHANNEL_DONE) {
|
||||
speech_channel_set_state(schannel, SPEECH_CHANNEL_READY);
|
||||
}
|
||||
|
||||
done:
|
||||
@ -1438,9 +1461,19 @@ static switch_status_t speech_channel_read(speech_channel_t *schannel, void *dat
|
||||
}
|
||||
|
||||
switch_mutex_lock(schannel->mutex);
|
||||
if (schannel->state == SPEECH_CHANNEL_PROCESSING) {
|
||||
switch (schannel->state) {
|
||||
case SPEECH_CHANNEL_DONE:
|
||||
/* pull any remaining audio - never blocking */
|
||||
if (audio_queue_read(schannel->audio_queue, data, len, 0) == SWITCH_STATUS_FALSE) {
|
||||
/* all frames read */
|
||||
status = SWITCH_STATUS_BREAK;
|
||||
}
|
||||
break;
|
||||
case SPEECH_CHANNEL_PROCESSING:
|
||||
/* IN-PROGRESS */
|
||||
audio_queue_read(schannel->audio_queue, data, len, block);
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
status = SWITCH_STATUS_BREAK;
|
||||
}
|
||||
switch_mutex_unlock(schannel->mutex);
|
||||
@ -1463,6 +1496,8 @@ static const char *speech_channel_state_to_string(speech_channel_state_t state)
|
||||
return "READY";
|
||||
case SPEECH_CHANNEL_PROCESSING:
|
||||
return "PROCESSING";
|
||||
case SPEECH_CHANNEL_DONE:
|
||||
return "DONE";
|
||||
case SPEECH_CHANNEL_ERROR:
|
||||
return "ERROR";
|
||||
}
|
||||
@ -1498,7 +1533,7 @@ static switch_status_t speech_channel_set_state_unlocked(speech_channel_t *schan
|
||||
{
|
||||
if (schannel->state == SPEECH_CHANNEL_PROCESSING && state != SPEECH_CHANNEL_PROCESSING) {
|
||||
/* wake anyone waiting for audio data */
|
||||
audio_queue_clear(schannel->audio_queue);
|
||||
audio_queue_signal(schannel->audio_queue);
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) %s ==> %s\n", schannel->name, speech_channel_state_to_string(schannel->state),
|
||||
@ -1651,6 +1686,8 @@ static switch_status_t synth_speech_read_tts(switch_speech_handle_t *sh, void *d
|
||||
memset((uint8_t *) data + bytes_read, schannel->silence, *datalen - bytes_read);
|
||||
}
|
||||
} else {
|
||||
/* ready for next speak request */
|
||||
speech_channel_set_state(schannel, SPEECH_CHANNEL_READY);
|
||||
*datalen = 0;
|
||||
status = SWITCH_STATUS_BREAK;
|
||||
}
|
||||
@ -1878,7 +1915,7 @@ static apt_bool_t synth_on_message_receive(mrcp_application_t *application, mrcp
|
||||
if (message->start_line.request_state == MRCP_REQUEST_STATE_COMPLETE) {
|
||||
/* got COMPLETE */
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) COMPLETE\n", schannel->name);
|
||||
speech_channel_set_state(schannel, SPEECH_CHANNEL_READY);
|
||||
speech_channel_set_state(schannel, SPEECH_CHANNEL_DONE);
|
||||
} else {
|
||||
/* received unexpected request state */
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) unexpected STOP response, request_state = %d\n", schannel->name,
|
||||
@ -1896,7 +1933,7 @@ static apt_bool_t synth_on_message_receive(mrcp_application_t *application, mrcp
|
||||
if (message->start_line.method_id == SYNTHESIZER_SPEAK_COMPLETE) {
|
||||
/* got SPEAK-COMPLETE */
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) SPEAK-COMPLETE\n", schannel->name);
|
||||
speech_channel_set_state(schannel, SPEECH_CHANNEL_READY);
|
||||
speech_channel_set_state(schannel, SPEECH_CHANNEL_DONE);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) unexpected event, method_id = %d\n", schannel->name,
|
||||
(int) message->start_line.method_id);
|
||||
|
28
src/mod/codecs/mod_opus/Makefile
Normal file
28
src/mod/codecs/mod_opus/Makefile
Normal file
@ -0,0 +1,28 @@
|
||||
BASE=../../../..
|
||||
|
||||
OPUS=opus-0.9.0
|
||||
|
||||
OPUS_DIR=$(switch_srcdir)/libs/$(OPUS)
|
||||
OPUS_BUILDDIR=$(switch_builddir)/libs/$(OPUS)
|
||||
LOCAL_CFLAGS=-I$(OPUS_DIR)/src -g -O2
|
||||
|
||||
IETF_LA=$(OPUS_BUILDDIR)/src/.libs/libietfcodec.a
|
||||
CELT_LA=$(OPUS_BUILDDIR)/celt/libcelt/.libs/libcelt0.a
|
||||
SILK_LA=$(OPUS_BUILDDIR)/silk/.libs/libSKP_SILK_SDK.a
|
||||
|
||||
LOCAL_LIBADD=$(IETF_LA) $(CELT_LA) $(SILK_LA) -lm -lz
|
||||
|
||||
include $(BASE)/build/modmake.rules
|
||||
|
||||
$(OPUS_DIR):
|
||||
$(GETLIB) $(OPUS).tar.gz
|
||||
|
||||
$(OPUS_BUILDDIR)/Makefile: $(OPUS_DIR)
|
||||
mkdir -p $(OPUS_BUILDDIR)
|
||||
cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure --disable-shared --with-pic --srcdir=$(OPUS_DIR)
|
||||
$(TOUCH_TARGET)
|
||||
|
||||
$(IETF_LA): $(OPUS_BUILDDIR)/Makefile
|
||||
cd $(OPUS_BUILDDIR) && $(MAKE)
|
||||
$(TOUCH_TARGET)
|
||||
|
200
src/mod/codecs/mod_opus/mod_opus.c
Normal file
200
src/mod/codecs/mod_opus/mod_opus.c
Normal file
@ -0,0 +1,200 @@
|
||||
/*
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
* Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
|
||||
*
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Anthony Minessale II <anthm@freeswitch.org>
|
||||
* Portions created by the Initial Developer are Copyright (C)
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Brian K. West <brian@freeswitch.org>
|
||||
*
|
||||
* mod_opus.c -- The OPUS ultra-low delay audio codec (http://www.opus-codec.org/)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "switch.h"
|
||||
#include "opus.h"
|
||||
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_opus_load);
|
||||
SWITCH_MODULE_DEFINITION(mod_opus, mod_opus_load, NULL, NULL);
|
||||
|
||||
struct opus_context {
|
||||
OpusEncoder *encoder_object;
|
||||
OpusDecoder *decoder_object;
|
||||
int frame_size;
|
||||
};
|
||||
|
||||
static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
|
||||
{
|
||||
struct opus_context *context = NULL;
|
||||
int encoding = (flags & SWITCH_CODEC_FLAG_ENCODE);
|
||||
int decoding = (flags & SWITCH_CODEC_FLAG_DECODE);
|
||||
|
||||
if (!(encoding || decoding) || (!(context = switch_core_alloc(codec->memory_pool, sizeof(*context))))) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
context->frame_size = codec->implementation->samples_per_packet;
|
||||
|
||||
if (encoding) {
|
||||
/* come up with a way to specify these */
|
||||
int bitrate_bps = codec->implementation->bits_per_second;
|
||||
int mode = MODE_HYBRID;
|
||||
int use_vbr = 1;
|
||||
int complexity = 10;
|
||||
int use_inbandfec = 1;
|
||||
int use_dtx = 1;
|
||||
int bandwidth = BANDWIDTH_FULLBAND;
|
||||
|
||||
context->encoder_object = opus_encoder_create(codec->implementation->actual_samples_per_second, codec->implementation->number_of_channels);
|
||||
|
||||
opus_encoder_ctl(context->encoder_object, OPUS_SET_MODE(mode));
|
||||
opus_encoder_ctl(context->encoder_object, OPUS_SET_BITRATE(bitrate_bps));
|
||||
opus_encoder_ctl(context->encoder_object, OPUS_SET_BANDWIDTH(bandwidth));
|
||||
opus_encoder_ctl(context->encoder_object, OPUS_SET_VBR_FLAG(use_vbr));
|
||||
opus_encoder_ctl(context->encoder_object, OPUS_SET_COMPLEXITY(complexity));
|
||||
opus_encoder_ctl(context->encoder_object, OPUS_SET_INBAND_FEC_FLAG(use_inbandfec));
|
||||
opus_encoder_ctl(context->encoder_object, OPUS_SET_DTX_FLAG(use_dtx));
|
||||
|
||||
}
|
||||
|
||||
if (decoding) {
|
||||
context->decoder_object = opus_decoder_create(codec->implementation->actual_samples_per_second, codec->implementation->number_of_channels);
|
||||
}
|
||||
|
||||
codec->private_info = context;
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t switch_opus_destroy(switch_codec_t *codec)
|
||||
{
|
||||
codec->private_info = NULL;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t switch_opus_encode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *decoded_data,
|
||||
uint32_t decoded_data_len,
|
||||
uint32_t decoded_rate, void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate,
|
||||
unsigned int *flag)
|
||||
{
|
||||
struct opus_context *context = codec->private_info;
|
||||
int bytes = 0;
|
||||
int len = (int) *encoded_data_len;
|
||||
|
||||
if (!context) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (len > 1275) len = 1275;
|
||||
|
||||
bytes = opus_encode(context->encoder_object, (void *) decoded_data, decoded_data_len / 2, (unsigned char *) encoded_data, len);
|
||||
|
||||
if (bytes > 0) {
|
||||
*encoded_data_len = (uint32_t) bytes;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Encoder Error!\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
static switch_status_t switch_opus_decode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *encoded_data,
|
||||
uint32_t encoded_data_len,
|
||||
uint32_t encoded_rate, void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate,
|
||||
unsigned int *flag)
|
||||
{
|
||||
struct opus_context *context = codec->private_info;
|
||||
int samples = 0;
|
||||
|
||||
if (!context) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
samples = opus_decode(context->decoder_object, encoded_data, encoded_data_len, decoded_data, *decoded_data_len);
|
||||
|
||||
if (samples < 0) {
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
*decoded_data_len = samples * 2;
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_opus_load)
|
||||
{
|
||||
switch_codec_interface_t *codec_interface;
|
||||
int samples = 80;
|
||||
int bytes = 960;
|
||||
int mss = 10000;
|
||||
int x = 0;
|
||||
int rate = 48000;
|
||||
int bits = 32000;
|
||||
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
|
||||
SWITCH_ADD_CODEC(codec_interface, "OPUS (BETA 0.9.0)");
|
||||
|
||||
for (x = 0; x < 2; x++) {
|
||||
switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
|
||||
115, /* the IANA code number */
|
||||
"Opus-0.9.0",/* the IANA code name */
|
||||
NULL, /* default fmtp to send (can be overridden by the init function) */
|
||||
rate, /* samples transferred per second */
|
||||
rate, /* actual samples transferred per second */
|
||||
bits, /* bits transferred per second */
|
||||
mss, /* number of microseconds per frame */
|
||||
samples, /* number of samples per frame */
|
||||
bytes, /* number of bytes per frame decompressed */
|
||||
0, /* number of bytes per frame compressed */
|
||||
1, /* number of channels represented */
|
||||
1, /* number of frames per network packet */
|
||||
switch_opus_init, /* function to initialize a codec handle using this implementation */
|
||||
switch_opus_encode, /* function to encode raw data into encoded data */
|
||||
switch_opus_decode, /* function to decode encoded data into raw data */
|
||||
switch_opus_destroy); /* deinitalize a codec handle using this implementation */
|
||||
|
||||
bytes *= 2;
|
||||
samples *= 2;
|
||||
mss *= 2;
|
||||
|
||||
}
|
||||
|
||||
/* indicate that the module should continue to be loaded */
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
* indent-tabs-mode:t
|
||||
* tab-width:4
|
||||
* c-basic-offset:4
|
||||
* End:
|
||||
* For VIM:
|
||||
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
|
||||
*/
|
@ -309,11 +309,13 @@ static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
|
||||
switch_call_cause_t *cancel_cause)
|
||||
{
|
||||
const char *profile;
|
||||
char *dup_profile = NULL;
|
||||
|
||||
if (session) {
|
||||
profile = switch_channel_get_variable(switch_core_session_get_channel(session), "sip_profile");
|
||||
} else {
|
||||
profile = switch_core_get_variable("sip_profile");
|
||||
dup_profile = switch_core_get_variable_dup("sip_profile");
|
||||
profile = dup_profile;
|
||||
}
|
||||
if (zstr(profile)) {
|
||||
profile = "default";
|
||||
@ -323,6 +325,8 @@ static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
|
||||
|
||||
UNPROTECT_INTERFACE(sip_endpoint_interface);
|
||||
|
||||
switch_safe_free(dup_profile);
|
||||
|
||||
return switch_core_session_outgoing_channel(session, var_event, "sofia", outbound_profile, new_session, pool, SOF_NONE, cancel_cause);
|
||||
}
|
||||
|
||||
|
@ -2049,7 +2049,7 @@ static void set_profile_val(mdl_profile_t *profile, char *var, char *val)
|
||||
} else if (!strcasecmp(var, "ext-rtp-ip")) {
|
||||
char *ip = globals.guess_ip;
|
||||
if (val && !strcasecmp(val, "auto-nat")) {
|
||||
ip = globals.auto_nat ? switch_core_get_variable("nat_public_addr") : globals.guess_ip;
|
||||
ip = globals.auto_nat ? switch_core_get_variable_pdup("nat_public_addr", module_pool) : globals.guess_ip;
|
||||
} else if (val && !strcasecmp(val, "auto")) {
|
||||
globals.auto_nat = 0;
|
||||
ip = globals.guess_ip;
|
||||
@ -2523,7 +2523,7 @@ static switch_status_t load_config(void)
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
globals.running = 1;
|
||||
globals.auto_nat = (switch_core_get_variable("nat_type") ? 1 : 0);
|
||||
globals.auto_nat = (switch_nat_get_type() ? 1 : 0);
|
||||
|
||||
switch_find_local_ip(globals.guess_ip, sizeof(globals.guess_ip), NULL, AF_INET);
|
||||
|
||||
|
@ -1625,9 +1625,10 @@ bool Board::KhompPvt::setCollectCall()
|
||||
DBG(FUNC, PVT_FMT(_target, "option drop collect call is '%s'") % (Opt::_options._drop_collect_call() ? "yes" : "no"));
|
||||
|
||||
// get global filter configuration value
|
||||
tmp_var = switch_core_get_variable("KDropCollectCall");
|
||||
tmp_var = switch_core_get_variable_dup("KDropCollectCall");
|
||||
confvalues.push_back(getTriStateValue(tmp_var));
|
||||
DBG(FUNC, PVT_FMT(_target, "global KDropCollectCall was '%s'") % (tmp_var ? tmp_var : "(empty)"));
|
||||
switch_safe_free(tmp_var);
|
||||
|
||||
try
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -3501,7 +3501,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
|
||||
}
|
||||
|
||||
if (zstr(domain)) {
|
||||
domain = switch_core_get_variable("domain");
|
||||
domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));
|
||||
}
|
||||
|
||||
if (!user) goto end;
|
||||
@ -4776,7 +4776,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
|
||||
mod_sofia_globals.running = 1;
|
||||
switch_mutex_unlock(mod_sofia_globals.mutex);
|
||||
|
||||
mod_sofia_globals.auto_nat = (switch_core_get_variable("nat_type") ? 1 : 0);
|
||||
mod_sofia_globals.auto_nat = (switch_nat_get_type() ? 1 : 0);
|
||||
|
||||
switch_queue_create(&mod_sofia_globals.presence_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool);
|
||||
switch_queue_create(&mod_sofia_globals.mwi_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool);
|
||||
|
@ -1459,7 +1459,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
||||
|
||||
supported = switch_core_sprintf(profile->pool, "%s%sprecondition, path, replaces", use_100rel ? "100rel, " : "", use_timer ? "timer, " : "");
|
||||
|
||||
if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_core_get_variable("nat_type")) {
|
||||
if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_nat_get_type()) {
|
||||
if (switch_nat_add_mapping(profile->sip_port, SWITCH_NAT_UDP, NULL, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
|
||||
}
|
||||
@ -1676,7 +1676,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
||||
switch_event_fire(&s_event);
|
||||
}
|
||||
|
||||
if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_core_get_variable("nat_type")) {
|
||||
if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_nat_get_type()) {
|
||||
if (switch_nat_del_mapping(profile->sip_port, SWITCH_NAT_UDP) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleted UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
|
||||
}
|
||||
@ -3741,9 +3741,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
|
||||
if (!profile->rtpip[0]) {
|
||||
profile->rtpip[profile->rtpip_index++] = switch_core_strdup(profile->pool, mod_sofia_globals.guess_ip);
|
||||
}
|
||||
|
||||
if (switch_core_get_variable("nat_type")) {
|
||||
const char *ip = switch_core_get_variable("nat_public_addr");
|
||||
|
||||
if (switch_nat_get_type()) {
|
||||
char *ip = switch_core_get_variable_dup("nat_public_addr");
|
||||
if (ip && !strchr(profile->sipip, ':')) {
|
||||
if (!profile->extrtpip) {
|
||||
profile->extrtpip = switch_core_strdup(profile->pool, ip);
|
||||
@ -3754,6 +3754,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
|
||||
sofia_set_pflag(profile, PFLAG_AUTO_NAT);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "NAT detected setting external ip to %s\n", ip);
|
||||
}
|
||||
switch_safe_free(ip);
|
||||
}
|
||||
|
||||
if (profile->nonce_ttl < 60) {
|
||||
|
@ -4071,15 +4071,22 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
|
||||
greedy = !!sofia_test_pflag(tech_pvt->profile, PFLAG_GREEDY);
|
||||
scrooge = !!sofia_test_pflag(tech_pvt->profile, PFLAG_SCROOGE);
|
||||
|
||||
if (!greedy || !scrooge) {
|
||||
if ((val = switch_channel_get_variable(channel, "sip_codec_negotiation"))) {
|
||||
if (!strcasecmp(val, "greedy")) {
|
||||
greedy = 1;
|
||||
} else if (!strcasecmp(val, "scrooge")) {
|
||||
scrooge = 1;
|
||||
greedy = 1;
|
||||
}
|
||||
}
|
||||
if ((val = switch_channel_get_variable(channel, "sip_codec_negotiation"))) {
|
||||
if (!strcasecmp(val, "generous")) {
|
||||
greedy = 0;
|
||||
scrooge = 0;
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : generous\n" );
|
||||
} else if (!strcasecmp(val, "greedy")) {
|
||||
greedy = 1;
|
||||
scrooge = 0;
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : greedy\n" );
|
||||
} else if (!strcasecmp(val, "scrooge")) {
|
||||
scrooge = 1;
|
||||
greedy = 1;
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : scrooge\n" );
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation ignored invalid value : '%s' \n", val );
|
||||
}
|
||||
}
|
||||
|
||||
if ((tech_pvt->origin = switch_core_session_strdup(session, (char *) sdp->sdp_origin->o_username))) {
|
||||
@ -4473,7 +4480,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
|
||||
match = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;
|
||||
}
|
||||
|
||||
if (match && bit_rate && map_bit_rate && map_bit_rate != bit_rate) {
|
||||
if (match && bit_rate && map_bit_rate && map_bit_rate != bit_rate && strcasecmp(map->rm_encoding, "ilbc")) {
|
||||
/* nevermind */
|
||||
match = 0;
|
||||
}
|
||||
|
@ -2570,6 +2570,19 @@ static int sofia_counterpath_crutch(void *pArg, int argc, char **argv, char **co
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uint32_t sofia_presence_contact_count(sofia_profile_t *profile, const char *contact_str)
|
||||
{
|
||||
char buf[32] = "";
|
||||
char *sql;
|
||||
|
||||
sql = switch_mprintf("select count(*) from sip_subscriptions where profile_name='%q' and contact='%q'", profile->name, contact_str);
|
||||
|
||||
sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, buf, sizeof(buf));
|
||||
switch_safe_free(sql);
|
||||
return atoi(buf);
|
||||
}
|
||||
|
||||
void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip,
|
||||
tagi_t tags[])
|
||||
{
|
||||
@ -2584,7 +2597,7 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
|
||||
char expstr[30] = "";
|
||||
long exp = 0, exp_delta = 3600;
|
||||
char *pd_dup = NULL;
|
||||
int count = 1;
|
||||
int count = 1, sub_count = 0;
|
||||
char *contact_str;
|
||||
int open = 1;
|
||||
|
||||
@ -2667,24 +2680,25 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
|
||||
count = sofia_reg_reg_count(profile, from_user, from_host);
|
||||
}
|
||||
|
||||
sub_count = sofia_presence_contact_count(profile, contact_str);
|
||||
|
||||
/* if (count > 1) let's not and say we did or all the clients who subscribe to their own presence will think they selves is offline */
|
||||
|
||||
event_type = sip_header_as_string(profile->home, (void *) sip->sip_event);
|
||||
|
||||
if (count < 2) {
|
||||
if ((sql =
|
||||
switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' "
|
||||
" and profile_name='%q' and hostname='%q'", from_user, from_host, profile->name, mod_sofia_globals.hostname))) {
|
||||
if ((sql = switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' "
|
||||
" and profile_name='%q' and hostname='%q'",
|
||||
from_user, from_host, profile->name, mod_sofia_globals.hostname))) {
|
||||
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
|
||||
}
|
||||
|
||||
if ((sql =
|
||||
switch_mprintf("insert into sip_presence (sip_user, sip_host, status, rpid, expires, user_agent,"
|
||||
" profile_name, hostname, open_closed) "
|
||||
"values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')",
|
||||
from_user, from_host, note_txt, rpid, exp, full_agent, profile->name, mod_sofia_globals.hostname, open_closed))) {
|
||||
|
||||
if (sub_count > 0 && (sql = switch_mprintf("insert into sip_presence (sip_user, sip_host, status, rpid, expires, user_agent,"
|
||||
" profile_name, hostname, open_closed) "
|
||||
"values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')",
|
||||
from_user, from_host, note_txt, rpid, exp, full_agent, profile->name,
|
||||
mod_sofia_globals.hostname, open_closed))) {
|
||||
|
||||
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
|
||||
}
|
||||
|
||||
@ -2696,16 +2710,17 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
|
||||
switch_safe_free(sql);
|
||||
}
|
||||
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent", full_agent);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", note_txt);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);
|
||||
switch_event_fire(&event);
|
||||
if (sub_count > 0) {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent", full_agent);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", note_txt);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
||||
if (event_type) {
|
||||
@ -2728,7 +2743,12 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
|
||||
|
||||
switch_snprintf(expstr, sizeof(expstr), "%d", exp_delta);
|
||||
switch_stun_random_string(etag, 8, NULL);
|
||||
nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), SIPTAG_ETAG_STR(etag), SIPTAG_EXPIRES_STR(expstr), TAG_END());
|
||||
|
||||
if (sub_count > 0) {
|
||||
nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), SIPTAG_ETAG_STR(etag), SIPTAG_EXPIRES_STR(expstr), TAG_END());
|
||||
} else {
|
||||
nua_respond(nh, SIP_404_NOT_FOUND, NUTAG_WITH_THIS(nua), TAG_END());
|
||||
}
|
||||
|
||||
switch_safe_free(contact_str);
|
||||
}
|
||||
|
@ -2642,7 +2642,7 @@ static int config(void)
|
||||
} else if (!strcmp(var, "debug")) {
|
||||
globals.debug = atoi(val);
|
||||
} else if (!strcmp(var, "nat-map")) {
|
||||
if (switch_true(val) && switch_core_get_variable("nat_type")) {
|
||||
if (switch_true(val) && switch_nat_get_type()) {
|
||||
prefs.nat_map = 1;
|
||||
}
|
||||
} else if (!strcmp(var, "listen-port")) {
|
||||
@ -2795,7 +2795,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
|
||||
|
||||
close_socket(&listen_list.sock);
|
||||
|
||||
if (prefs.nat_map && switch_core_get_variable("nat_type")) {
|
||||
if (prefs.nat_map && switch_nat_get_type()) {
|
||||
switch_nat_del_mapping(prefs.port, SWITCH_NAT_TCP);
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ static int next_file(switch_file_handle_t *handle)
|
||||
|
||||
|
||||
if (!prefix) {
|
||||
if (!(prefix = switch_core_get_variable("sound_prefix"))) {
|
||||
if (!(prefix = switch_core_get_variable_pdup("sound_prefix", handle->memory_pool))) {
|
||||
prefix = SWITCH_GLOBAL_dirs.sounds_dir;
|
||||
}
|
||||
}
|
||||
|
@ -33352,6 +33352,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 ;
|
||||
|
@ -5364,6 +5364,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);
|
||||
}
|
||||
@ -13588,6 +13593,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);
|
||||
|
||||
|
@ -3378,8 +3378,9 @@ static JSBool js_global_get(JSContext * cx, JSObject * obj, uintN argc, jsval *
|
||||
|
||||
if (argc > 0) {
|
||||
var_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
|
||||
val = switch_core_get_variable(var_name);
|
||||
val = switch_core_get_variable_dup(var_name);
|
||||
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, val));
|
||||
free(val);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
@ -322,6 +322,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
||||
int at = 0;
|
||||
char *dp;
|
||||
abyss_bool rval = FALSE;
|
||||
char *dup_domain = NULL;
|
||||
|
||||
p = RequestHeaderValue(r, "authorization");
|
||||
|
||||
@ -354,7 +355,9 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
||||
if (globals.default_domain) {
|
||||
domain_name = globals.default_domain;
|
||||
} else {
|
||||
domain_name = switch_core_get_variable("domain");
|
||||
if ((dup_domain = switch_core_get_variable_dup("domain"))) {
|
||||
domain_name = dup_domain;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -465,6 +468,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
||||
switch_safe_free(mypass1);
|
||||
switch_safe_free(mypass2);
|
||||
switch_safe_free(box);
|
||||
switch_safe_free(dup_domain);
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
@ -672,7 +672,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_hold_music_partner(switch_channe
|
||||
|
||||
SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *channel, const char *varname, switch_bool_t dup)
|
||||
{
|
||||
const char *v = NULL, *r = NULL;
|
||||
const char *v = NULL, *r = NULL, *vdup = NULL;
|
||||
switch_assert(channel != NULL);
|
||||
|
||||
switch_mutex_lock(channel->profile_mutex);
|
||||
@ -690,13 +690,16 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *c
|
||||
}
|
||||
|
||||
if (!cp || !(v = switch_caller_get_field_by_name(cp, varname))) {
|
||||
v = switch_core_get_variable(varname);
|
||||
if ((vdup = switch_core_get_variable_pdup(varname, switch_core_session_get_pool(channel->session)))) {
|
||||
v = vdup;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dup) {
|
||||
if (v)
|
||||
if (dup && v != vdup) {
|
||||
if (v) {
|
||||
r = switch_core_session_strdup(channel->session, v);
|
||||
}
|
||||
} else {
|
||||
r = v;
|
||||
}
|
||||
|
@ -643,9 +643,9 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_list_uuid(const char *line
|
||||
|
||||
if (!zstr(cursor)) {
|
||||
sql = switch_mprintf("select distinct uuid from channels where uuid like '%q%%' and hostname='%q' order by uuid",
|
||||
cursor, switch_core_get_variable("hostname"));
|
||||
cursor, switch_core_get_hostname());
|
||||
} else {
|
||||
sql = switch_mprintf("select distinct uuid from channels where hostname='%q' order by uuid", switch_core_get_variable("hostname"));
|
||||
sql = switch_mprintf("select distinct uuid from channels where hostname='%q' order by uuid", switch_core_get_hostname());
|
||||
}
|
||||
|
||||
switch_cache_db_execute_sql_callback(db, sql, uuid_callback, &h, &errmsg);
|
||||
@ -764,7 +764,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
|
||||
|
||||
if (h.words == 0) {
|
||||
sql = switch_mprintf("select distinct name from interfaces where type='api' and name like '%q%%' and hostname='%q' order by name",
|
||||
buf, switch_core_get_variable("hostname"));
|
||||
buf, switch_core_get_hostname());
|
||||
}
|
||||
|
||||
if (sql) {
|
||||
@ -792,7 +792,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
|
||||
|
||||
if (h.words == 0) {
|
||||
stream.write_function(&stream, "select distinct a1 from complete where " "a1 not in (select name from interfaces where hostname='%s') %s ",
|
||||
switch_core_get_variable("hostname"), argc ? "and" : "");
|
||||
switch_core_get_hostname(), argc ? "and" : "");
|
||||
} else {
|
||||
if (db->type == 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));
|
||||
@ -821,7 +821,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
|
||||
}
|
||||
}
|
||||
|
||||
stream.write_function(&stream, " and hostname='%s' order by a%d", switch_core_get_variable("hostname"), h.words + 1);
|
||||
stream.write_function(&stream, " and hostname='%s' order by a%d", switch_core_get_hostname(), h.words + 1);
|
||||
|
||||
switch_cache_db_execute_sql_callback(db, stream.data, comp_callback, &h, &errmsg);
|
||||
|
||||
@ -1794,7 +1794,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
|
||||
}
|
||||
}
|
||||
}
|
||||
mystream.write_function(&mystream, " '%s')", switch_core_get_variable("hostname"));
|
||||
mystream.write_function(&mystream, " '%s')", switch_core_get_hostname());
|
||||
switch_cache_db_persistant_execute(db, mystream.data, 5);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
} else if (!strcasecmp(argv[0], "add")) {
|
||||
@ -1810,7 +1810,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
|
||||
}
|
||||
}
|
||||
}
|
||||
mystream.write_function(&mystream, " '%s')", switch_core_get_variable("hostname"));
|
||||
mystream.write_function(&mystream, " '%s')", switch_core_get_hostname());
|
||||
|
||||
switch_cache_db_persistant_execute(db, mystream.data, 5);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
@ -1827,7 +1827,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
|
||||
mystream.write_function(&mystream, "a%d = '%w'%w", x + 1, switch_str_nil(argv[x + 1]), x == argc - 2 ? "" : " and ");
|
||||
}
|
||||
}
|
||||
mystream.write_function(&mystream, " and hostname='%s'", switch_core_get_variable("hostname"));
|
||||
mystream.write_function(&mystream, " and hostname='%s'", switch_core_get_hostname());
|
||||
switch_cache_db_persistant_execute(db, mystream.data, 1);
|
||||
}
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
@ -1863,38 +1863,38 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_alias(const char *string)
|
||||
}
|
||||
|
||||
if (!strcasecmp(argv[0], "stickyadd") && argc == 3) {
|
||||
sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_variable("hostname"));
|
||||
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) {
|
||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (1, '%q','%q','%q')",
|
||||
argv[1], argv[2], switch_core_get_variable("hostname"));
|
||||
argv[1], argv[2], switch_core_get_hostname());
|
||||
} else {
|
||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (1, '%w','%w','%w')",
|
||||
argv[1], argv[2], switch_core_get_variable("hostname"));
|
||||
argv[1], argv[2], switch_core_get_hostname());
|
||||
}
|
||||
switch_cache_db_persistant_execute(db, sql, 5);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
} else if (!strcasecmp(argv[0], "add") && argc == 3) {
|
||||
sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_variable("hostname"));
|
||||
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) {
|
||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (0, '%q','%q','%q')",
|
||||
argv[1], argv[2], switch_core_get_variable("hostname"));
|
||||
argv[1], argv[2], switch_core_get_hostname());
|
||||
} else {
|
||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (0, '%w','%w','%w')",
|
||||
argv[1], argv[2], switch_core_get_variable("hostname"));
|
||||
argv[1], argv[2], switch_core_get_hostname());
|
||||
}
|
||||
switch_cache_db_persistant_execute(db, sql, 5);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
} else if (!strcasecmp(argv[0], "del") && argc == 2) {
|
||||
char *what = argv[1];
|
||||
if (!strcasecmp(what, "*")) {
|
||||
sql = switch_mprintf("delete from aliases where hostname='%q'", switch_core_get_variable("hostname"));
|
||||
sql = switch_mprintf("delete from aliases where hostname='%q'", switch_core_get_hostname());
|
||||
switch_cache_db_persistant_execute(db, sql, 1);
|
||||
} else {
|
||||
sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_variable("hostname"));
|
||||
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);
|
||||
}
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
|
@ -261,6 +261,11 @@ SWITCH_DECLARE(void) switch_core_dump_variables(switch_stream_handle_t *stream)
|
||||
switch_mutex_unlock(runtime.global_mutex);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(const char *) switch_core_get_hostname(void)
|
||||
{
|
||||
return runtime.hostname;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
|
||||
{
|
||||
char *val;
|
||||
@ -270,6 +275,32 @@ SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
|
||||
return val;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(char *) switch_core_get_variable_dup(const char *varname)
|
||||
{
|
||||
char *val = NULL, *v;
|
||||
|
||||
switch_mutex_lock(runtime.global_var_mutex);
|
||||
if ((v = (char *) switch_event_get_header(runtime.global_vars, varname))) {
|
||||
val = strdup(v);
|
||||
}
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(char *) switch_core_get_variable_pdup(const char *varname, switch_memory_pool_t *pool)
|
||||
{
|
||||
char *val = NULL, *v;
|
||||
|
||||
switch_mutex_lock(runtime.global_var_mutex);
|
||||
if ((v = (char *) switch_event_get_header(runtime.global_vars, varname))) {
|
||||
val = switch_core_strdup(pool, v);
|
||||
}
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static void switch_core_unset_variables(void)
|
||||
{
|
||||
switch_mutex_lock(runtime.global_var_mutex);
|
||||
@ -1202,12 +1233,18 @@ static void switch_core_set_serial(void)
|
||||
|
||||
|
||||
if ((fd = open(path, O_RDONLY, 0)) < 0) {
|
||||
char *ip = switch_core_get_variable("local_ip_v4");
|
||||
char *ip = switch_core_get_variable_dup("local_ip_v4");
|
||||
uint32_t ipi = 0;
|
||||
switch_byte_t *byte;
|
||||
int i = 0;
|
||||
|
||||
switch_inet_pton(AF_INET, ip, &ipi);
|
||||
if (ip) {
|
||||
switch_inet_pton(AF_INET, ip, &ipi);
|
||||
free(ip);
|
||||
ip = NULL;
|
||||
}
|
||||
|
||||
|
||||
byte = (switch_byte_t *) & ipi;
|
||||
|
||||
for (i = 0; i < 8; i += 2) {
|
||||
@ -1237,7 +1274,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||
char guess_ip[256];
|
||||
int mask = 0;
|
||||
struct in_addr in;
|
||||
char hostname[256] = "";
|
||||
|
||||
|
||||
if (runtime.runlevel > 0) {
|
||||
/* one per customer */
|
||||
@ -1310,8 +1347,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||
runtime.console = stdout;
|
||||
}
|
||||
|
||||
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_ip, sizeof(guess_ip), &mask, AF_INET);
|
||||
switch_core_set_variable("local_ip_v4", guess_ip);
|
||||
@ -1449,7 +1486,7 @@ static void switch_load_core_config(const char *file)
|
||||
{
|
||||
switch_xml_t xml = NULL, cfg = NULL;
|
||||
|
||||
//switch_core_hash_insert(runtime.ptimes, "ilbc", &d_30);
|
||||
switch_core_hash_insert(runtime.ptimes, "ilbc", &d_30);
|
||||
switch_core_hash_insert(runtime.ptimes, "G723", &d_30);
|
||||
|
||||
if ((xml = switch_xml_open_cfg(file, &cfg, NULL))) {
|
||||
|
@ -102,7 +102,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
|
||||
}
|
||||
|
||||
if (!spool_path) {
|
||||
spool_path = switch_core_get_variable(SWITCH_AUDIO_SPOOL_PATH_VARIABLE);
|
||||
spool_path = switch_core_get_variable_pdup(SWITCH_AUDIO_SPOOL_PATH_VARIABLE, fh->memory_pool);
|
||||
}
|
||||
|
||||
file_path = fh->file_path;
|
||||
|
@ -1865,6 +1865,17 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_app_flags(const char *ap
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_async(switch_core_session_t *session, const char *app, const char *arg)
|
||||
{
|
||||
switch_event_t *execute_event;
|
||||
char *ap, *arp;
|
||||
|
||||
if (!arg && strstr(app, "::")) {
|
||||
ap = switch_core_session_strdup(session, app);
|
||||
app = ap;
|
||||
|
||||
if ((arp = strstr(ap, "::"))) {
|
||||
*arp = '\0';
|
||||
arg = arp + 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (switch_event_create(&execute_event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header_string(execute_event, SWITCH_STACK_BOTTOM, "call-command", "execute");
|
||||
@ -1894,6 +1905,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_get_flag
|
||||
switch_application_interface_t *application_interface;
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
if (!arg && strstr(app, "::")) {
|
||||
return switch_core_session_execute_application_async(session, app, arg);
|
||||
}
|
||||
|
||||
if (switch_channel_down(session->channel)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Channel is hungup, aborting execution of application: %s\n", app);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
@ -1134,7 +1134,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
new_sql() = switch_mprintf("insert into tasks values(%q,'%q','%q',%q, '%q')",
|
||||
id,
|
||||
switch_event_get_header_nil(event, "task-desc"),
|
||||
switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", switch_core_get_variable("hostname")
|
||||
switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", switch_core_get_hostname()
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1142,7 +1142,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
case SWITCH_EVENT_DEL_SCHEDULE:
|
||||
case SWITCH_EVENT_EXE_SCHEDULE:
|
||||
new_sql() = switch_mprintf("delete from tasks where task_id=%q and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "task-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "task-id"), switch_core_get_hostname());
|
||||
break;
|
||||
case SWITCH_EVENT_RE_SCHEDULE:
|
||||
{
|
||||
@ -1153,7 +1153,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
new_sql() = switch_mprintf("update tasks set task_desc='%q',task_group='%q', task_sql_manager=%q where task_id=%q and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "task-desc"),
|
||||
switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", id,
|
||||
switch_core_get_variable("hostname"));
|
||||
switch_core_get_hostname());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1163,10 +1163,10 @@ static void core_event_handler(switch_event_t *event)
|
||||
|
||||
if (uuid) {
|
||||
new_sql() = switch_mprintf("delete from channels where uuid='%q' and hostname='%q'",
|
||||
uuid, switch_core_get_variable("hostname"));
|
||||
uuid, switch_core_get_hostname());
|
||||
|
||||
new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",
|
||||
uuid, uuid, switch_core_get_variable("hostname"));
|
||||
uuid, uuid, switch_core_get_hostname());
|
||||
|
||||
}
|
||||
}
|
||||
@ -1178,12 +1178,12 @@ static void core_event_handler(switch_event_t *event)
|
||||
"update calls set callee_uuid='%q' where callee_uuid='%q' and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "unique-id"),
|
||||
switch_event_get_header_nil(event, "old-unique-id"),
|
||||
switch_core_get_variable("hostname"),
|
||||
switch_core_get_hostname(),
|
||||
switch_event_get_header_nil(event, "unique-id"),
|
||||
switch_event_get_header_nil(event, "old-unique-id"),
|
||||
switch_core_get_variable("hostname"),
|
||||
switch_core_get_hostname(),
|
||||
switch_event_get_header_nil(event, "unique-id"),
|
||||
switch_event_get_header_nil(event, "old-unique-id"), switch_core_get_variable("hostname")
|
||||
switch_event_get_header_nil(event, "old-unique-id"), switch_core_get_hostname()
|
||||
);
|
||||
break;
|
||||
}
|
||||
@ -1198,7 +1198,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
switch_event_get_header_nil(event, "channel-state"),
|
||||
switch_event_get_header_nil(event, "channel-call-state"),
|
||||
switch_event_get_header_nil(event, "caller-dialplan"),
|
||||
switch_event_get_header_nil(event, "caller-context"), switch_core_get_variable("hostname")
|
||||
switch_event_get_header_nil(event, "caller-context"), switch_core_get_hostname()
|
||||
);
|
||||
break;
|
||||
case SWITCH_EVENT_CODEC:
|
||||
@ -1211,7 +1211,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
switch_event_get_header_nil(event, "channel-write-codec-name"),
|
||||
switch_event_get_header_nil(event, "channel-write-codec-rate"),
|
||||
switch_event_get_header_nil(event, "channel-write-codec-bit-rate"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
|
||||
break;
|
||||
case SWITCH_EVENT_CHANNEL_HOLD:
|
||||
case SWITCH_EVENT_CHANNEL_UNHOLD:
|
||||
@ -1223,7 +1223,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
switch_event_get_header_nil(event, "application-data"),
|
||||
switch_event_get_header_nil(event, "channel-presence-id"),
|
||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname")
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname()
|
||||
);
|
||||
|
||||
}
|
||||
@ -1238,7 +1238,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||
switch_event_get_header_nil(event, "channel-call-uuid"),
|
||||
extra_cols,
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
|
||||
free(extra_cols);
|
||||
} else {
|
||||
new_sql() = switch_mprintf("update channels set "
|
||||
@ -1246,7 +1246,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
switch_event_get_header_nil(event, "channel-presence-id"),
|
||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||
switch_event_get_header_nil(event, "channel-call-uuid"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
|
||||
}
|
||||
|
||||
}
|
||||
@ -1281,7 +1281,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
switch_str_nil(name),
|
||||
switch_str_nil(number),
|
||||
switch_event_get_header_nil(event, "direction"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
|
||||
|
||||
name = switch_event_get_header(event, "callee-name");
|
||||
number = switch_event_get_header(event, "callee-number");
|
||||
@ -1298,7 +1298,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
{
|
||||
new_sql() = switch_mprintf("update channels set callstate='%q' where uuid='%q' and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "channel-call-state"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
|
||||
|
||||
}
|
||||
break;
|
||||
@ -1330,7 +1330,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
switch_event_get_header_nil(event, "channel-presence-id"),
|
||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||
extra_cols,
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
|
||||
free(extra_cols);
|
||||
} else {
|
||||
new_sql() = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',"
|
||||
@ -1345,13 +1345,13 @@ static void core_event_handler(switch_event_t *event)
|
||||
switch_event_get_header_nil(event, "caller-context"),
|
||||
switch_event_get_header_nil(event, "channel-presence-id"),
|
||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
new_sql() = switch_mprintf("update channels set state='%s' where uuid='%s' and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "channel-state"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1377,7 +1377,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
|
||||
new_sql() = switch_mprintf("update channels set call_uuid='%q' where uuid='%s' and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "channel-call-uuid"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
|
||||
|
||||
if (runtime.odbc_dbtype == DBTYPE_DEFAULT) {
|
||||
func_name = "function";
|
||||
@ -1404,19 +1404,23 @@ static void core_event_handler(switch_event_t *event)
|
||||
callee_cid_num,
|
||||
switch_event_get_header_nil(event, "Other-Leg-destination-number"),
|
||||
switch_event_get_header_nil(event, "Other-Leg-channel-name"),
|
||||
switch_event_get_header_nil(event, "Other-Leg-unique-id"), switch_core_get_variable("hostname")
|
||||
switch_event_get_header_nil(event, "Other-Leg-unique-id"), switch_core_get_hostname()
|
||||
);
|
||||
}
|
||||
break;
|
||||
case SWITCH_EVENT_CHANNEL_UNBRIDGE:
|
||||
new_sql() = switch_mprintf("delete from calls where (caller_uuid='%s' or callee_uuid='%q') and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_variable("hostname"));
|
||||
break;
|
||||
{
|
||||
char *uuid = switch_event_get_header_nil(event, "caller-unique-id");
|
||||
|
||||
new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",
|
||||
uuid, uuid, switch_core_get_hostname());
|
||||
break;
|
||||
}
|
||||
case SWITCH_EVENT_SHUTDOWN:
|
||||
new_sql() = switch_mprintf("delete from channels where hostname='%q';"
|
||||
"delete from interfaces where hostname='%q';"
|
||||
"delete from calls where hostname='%q'",
|
||||
switch_core_get_variable("hostname"), switch_core_get_variable("hostname"), switch_core_get_variable("hostname")
|
||||
switch_core_get_hostname(), switch_core_get_hostname(), switch_core_get_hostname()
|
||||
);
|
||||
break;
|
||||
case SWITCH_EVENT_LOG:
|
||||
@ -1434,7 +1438,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
switch_mprintf
|
||||
("insert into interfaces (type,name,description,syntax,ikey,filename,hostname) values('%q','%q','%q','%q','%q','%q','%q')", type, name,
|
||||
switch_str_nil(description), switch_str_nil(syntax), switch_str_nil(key), switch_str_nil(filename),
|
||||
switch_core_get_variable("hostname")
|
||||
switch_core_get_hostname()
|
||||
);
|
||||
}
|
||||
break;
|
||||
@ -1445,7 +1449,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
const char *name = switch_event_get_header_nil(event, "name");
|
||||
if (!zstr(type) && !zstr(name)) {
|
||||
new_sql() = switch_mprintf("delete from interfaces where type='%q' and name='%q' and hostname='%q'", type, name,
|
||||
switch_core_get_variable("hostname"));
|
||||
switch_core_get_hostname());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1457,7 +1461,7 @@ static void core_event_handler(switch_event_t *event)
|
||||
break;
|
||||
}
|
||||
new_sql() = switch_mprintf("update channels set secure='%s' where uuid='%s' and hostname='%q'",
|
||||
type, switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_variable("hostname")
|
||||
type, switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_hostname()
|
||||
);
|
||||
break;
|
||||
}
|
||||
@ -1468,12 +1472,12 @@ static void core_event_handler(switch_event_t *event)
|
||||
if (!strcmp("add", op)) {
|
||||
new_sql() = switch_mprintf("insert into nat (port, proto, sticky, hostname) values (%s, %s, %d,'%q')",
|
||||
switch_event_get_header_nil(event, "port"),
|
||||
switch_event_get_header_nil(event, "proto"), sticky, switch_core_get_variable("hostname")
|
||||
switch_event_get_header_nil(event, "proto"), sticky, switch_core_get_hostname()
|
||||
);
|
||||
} else if (!strcmp("del", op)) {
|
||||
new_sql() = switch_mprintf("delete from nat where port=%s and proto=%s and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "port"),
|
||||
switch_event_get_header_nil(event, "proto"), switch_core_get_variable("hostname"));
|
||||
switch_event_get_header_nil(event, "proto"), switch_core_get_hostname());
|
||||
} else if (!strcmp("status", op)) {
|
||||
/* call show nat api */
|
||||
} else if (!strcmp("status_response", op)) {
|
||||
@ -1660,7 +1664,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
|
||||
char sql[512] = "";
|
||||
char *tables[] = { "channels", "calls", "interfaces", "tasks", NULL };
|
||||
int i;
|
||||
const char *hostname = switch_core_get_variable("hostname");
|
||||
const char *hostname = switch_core_get_hostname();
|
||||
|
||||
for (i = 0; tables[i]; i++) {
|
||||
switch_snprintf(sql, sizeof(sql), "delete from %s where hostname='%s'", tables[i], hostname);
|
||||
|
@ -1195,6 +1195,13 @@ SWITCH_DECLARE(void) console_clean_log(char *msg)
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN,SWITCH_LOG_DEBUG, "%s", switch_str_nil(msg));
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(bool) email(char *to, char *from, char *headers, char *body, char *file, char *convert_cmd, char *convert_ext)
|
||||
{
|
||||
if (switch_simple_email(to, from, headers, body, file, convert_cmd, convert_ext) == SWITCH_TRUE) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) msleep(unsigned ms)
|
||||
{
|
||||
|
@ -1561,6 +1561,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
|
||||
char *cloned_sub_val = NULL;
|
||||
char *func_val = NULL;
|
||||
int nv = 0;
|
||||
char *gvar = NULL;
|
||||
|
||||
nv = switch_string_var_check_const(in) || switch_string_has_escaped_data(in);
|
||||
|
||||
@ -1689,7 +1690,10 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
|
||||
}
|
||||
|
||||
if (!(sub_val = switch_event_get_header(event, vname))) {
|
||||
sub_val = switch_core_get_variable(vname);
|
||||
switch_safe_free(gvar);
|
||||
if ((gvar = switch_core_get_variable_dup(vname))) {
|
||||
sub_val = gvar;
|
||||
}
|
||||
}
|
||||
|
||||
if (offset || ooffset) {
|
||||
@ -1785,6 +1789,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
|
||||
}
|
||||
}
|
||||
free(indup);
|
||||
switch_safe_free(gvar);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
@ -45,6 +45,7 @@
|
||||
|
||||
typedef struct {
|
||||
switch_nat_type_t nat_type;
|
||||
char nat_type_str[5];
|
||||
struct UPNPUrls urls;
|
||||
struct IGDdatas data;
|
||||
char *descURL;
|
||||
@ -420,6 +421,7 @@ SWITCH_DECLARE(void) switch_nat_init(switch_memory_pool_t *pool)
|
||||
switch_core_set_variable("nat_public_addr", nat_globals.pub_addr);
|
||||
switch_core_set_variable("nat_private_addr", nat_globals.pvt_addr);
|
||||
switch_core_set_variable("nat_type", nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp");
|
||||
strncpy(nat_globals.nat_type_str, nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", sizeof(nat_globals.nat_type_str) - 1);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "NAT detected type: %s, ExtIP: '%s'\n",
|
||||
nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", nat_globals.pub_addr);
|
||||
|
||||
@ -564,6 +566,11 @@ static switch_status_t switch_nat_del_mapping_upnp(switch_port_t port, switch_na
|
||||
return status;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(const char *) switch_nat_get_type(void)
|
||||
{
|
||||
return nat_globals.nat_type_str;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_nat_add_mapping_internal(switch_port_t port, switch_nat_ip_proto_t proto, switch_port_t * external_port,
|
||||
switch_bool_t sticky, switch_bool_t publish)
|
||||
{
|
||||
|
@ -791,8 +791,8 @@ static void zrtp_logger(int level, const char *data, int len, int offset)
|
||||
SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool)
|
||||
{
|
||||
#ifdef ENABLE_ZRTP
|
||||
const char *zid_string = switch_core_get_variable("switch_serial");
|
||||
const char *zrtp_enabled = switch_core_get_variable("zrtp_enabled");
|
||||
const char *zid_string = switch_core_get_variable_pdup("switch_serial", pool);
|
||||
const char *zrtp_enabled = switch_core_get_variable_pdup("zrtp_enabled", pool);
|
||||
zrtp_config_t zrtp_config;
|
||||
char zrtp_cache_path[256] = "";
|
||||
zrtp_on = zrtp_enabled ? switch_true(zrtp_enabled) : 0;
|
||||
@ -1875,6 +1875,10 @@ static void jb_logger(const char *file, const char *func, int line, int level, c
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_debug_jitter_buffer(switch_rtp_t *rtp_session, const char *name)
|
||||
{
|
||||
|
||||
if (!switch_rtp_ready(rtp_session)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
stfu_n_debug(rtp_session->jb, name);
|
||||
stfu_global_set_logger(jb_logger);
|
||||
|
||||
|
@ -1154,8 +1154,8 @@ SWITCH_DECLARE(switch_status_t) switch_find_local_ip(char *buf, int len, int *ma
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
char *base;
|
||||
const char *force_local_ip_v4 = switch_core_get_variable("force_local_ip_v4");
|
||||
const char *force_local_ip_v6 = switch_core_get_variable("force_local_ip_v6");
|
||||
char *force_local_ip_v4 = switch_core_get_variable_dup("force_local_ip_v4");
|
||||
char *force_local_ip_v6 = switch_core_get_variable_dup("force_local_ip_v6");
|
||||
|
||||
#ifdef WIN32
|
||||
SOCKET tmp_socket;
|
||||
@ -1176,14 +1176,20 @@ SWITCH_DECLARE(switch_status_t) switch_find_local_ip(char *buf, int len, int *ma
|
||||
case AF_INET:
|
||||
if (force_local_ip_v4) {
|
||||
switch_copy_string(buf, force_local_ip_v4, len);
|
||||
switch_safe_free(force_local_ip_v4);
|
||||
switch_safe_free(force_local_ip_v6);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
case AF_INET6:
|
||||
if (force_local_ip_v6) {
|
||||
switch_copy_string(buf, force_local_ip_v6, len);
|
||||
switch_safe_free(force_local_ip_v4);
|
||||
switch_safe_free(force_local_ip_v6);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
default:
|
||||
switch_safe_free(force_local_ip_v4);
|
||||
switch_safe_free(force_local_ip_v6);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1208,11 +1208,12 @@ static char *expand_vars(char *buf, char *ebuf, switch_size_t elen, switch_size_
|
||||
var = rp;
|
||||
*e++ = '\0';
|
||||
rp = e;
|
||||
if ((val = switch_core_get_variable(var))) {
|
||||
if ((val = switch_core_get_variable_dup(var))) {
|
||||
char *p;
|
||||
for (p = val; p && *p && wp <= ep; p++) {
|
||||
*wp++ = *p;
|
||||
}
|
||||
free(val);
|
||||
}
|
||||
continue;
|
||||
} else if (err) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user