Merge branch 'master' into smgmaster
Conflicts: libs/esl/fs_cli.c
This commit is contained in:
commit
c41ea35739
|
@ -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.ActiveCfg = Release DirectSound|x64
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|x64 Setup.Build.0 = 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}.All|x86 Setup.ActiveCfg = Release DirectSound|x64
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug DirectSound|Win32
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug DirectSound|Win32
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|x64
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug DirectSound|x64
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug|x64
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug DirectSound|x64
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64 Setup.ActiveCfg = Debug|x64
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64 Setup.ActiveCfg = Debug DirectSound|x64
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x86 Setup.ActiveCfg = Debug|Win32
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x86 Setup.ActiveCfg = Debug DirectSound|Win32
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release DirectSound|Win32
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release DirectSound|Win32
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|x64
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release DirectSound|x64
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.Build.0 = Release|x64
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.Build.0 = Release DirectSound|x64
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64 Setup.ActiveCfg = Release|x64
|
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64 Setup.ActiveCfg = Release DirectSound|x64
|
||||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x86 Setup.ActiveCfg = Release|Win32
|
{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|Win32.ActiveCfg = Release|x64
|
||||||
{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.ActiveCfg = Release|x64
|
{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.ActiveCfg = Release|x64
|
||||||
{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.Build.0 = 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_speex
|
||||||
codecs/mod_siren
|
codecs/mod_siren
|
||||||
#codecs/mod_celt
|
#codecs/mod_celt
|
||||||
|
#codecs/mod_opus
|
||||||
#codecs/mod_sangoma_codec
|
#codecs/mod_sangoma_codec
|
||||||
#codecs/mod_dahdi_codec
|
#codecs/mod_dahdi_codec
|
||||||
#dialplans/mod_dialplan_directory
|
#dialplans/mod_dialplan_directory
|
||||||
|
|
|
@ -1,21 +1,40 @@
|
||||||
<configuration name="cdr_pg_csv.conf" description="CDR PG CSV Format">
|
<configuration name="cdr_pg_csv.conf" description="CDR PG CSV Format">
|
||||||
<settings>
|
<settings>
|
||||||
<!-- Log a-leg (a), b-leg (b) or both (ab) -->
|
|
||||||
<param name="legs" value="a"/>
|
|
||||||
<!-- See parameters for PQconnectdb() at http://www.postgresql.org/docs/8.4/static/libpq-connect.html -->
|
<!-- See parameters for PQconnectdb() at http://www.postgresql.org/docs/8.4/static/libpq-connect.html -->
|
||||||
<param name="db-info" value="host=localhost dbname=cdr connect_timeout=10" />
|
<param name="db-info" value="host=localhost dbname=cdr connect_timeout=10" />
|
||||||
<!-- CDR table name -->
|
<!-- CDR table name -->
|
||||||
<!--<param name="db-table" value="cdr"/>-->
|
<!--<param name="db-table" value="cdr"/>-->
|
||||||
<param name="default-template" value="example"/>
|
|
||||||
<!-- 'cdr-pg-csv' will always be appended to log-base -->
|
<!-- Log a-leg (a), b-leg (b) or both (ab) -->
|
||||||
<!--<param name="log-base" value="/var/log"/>-->
|
<param name="legs" value="a"/>
|
||||||
|
|
||||||
|
<!-- Directory in which to spool failed SQL inserts -->
|
||||||
|
<!-- <param name="spool-dir" value="$${base_dir}/log/cdr-pg-csv"/> -->
|
||||||
<!-- Disk spool format if DB connection/insert fails - csv (default) or sql -->
|
<!-- Disk spool format if DB connection/insert fails - csv (default) or sql -->
|
||||||
<param name="spool-format" value="csv"/>
|
<param name="spool-format" value="csv"/>
|
||||||
<param name="rotate-on-hup" value="true"/>
|
<param name="rotate-on-hup" value="true"/>
|
||||||
|
|
||||||
<!-- This is like the info app but after the call is hung up -->
|
<!-- This is like the info app but after the call is hung up -->
|
||||||
<!--<param name="debug" value="true"/>-->
|
<!--<param name="debug" value="true"/>-->
|
||||||
</settings>
|
</settings>
|
||||||
<templates>
|
<schema>
|
||||||
<template name="example">"${local_ip_v4}","${caller_id_name}","${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${uuid}","${bleg_uuid}","${accountcode}","${read_codec}","${write_codec}","${sip_hangup_disposition}","${ani}"</template>
|
<field var="local_ip_v4"/>
|
||||||
</templates>
|
<field var="caller_id_name"/>
|
||||||
|
<field var="caller_id_number"/>
|
||||||
|
<field var="destination_number"/>
|
||||||
|
<field var="context"/>
|
||||||
|
<field var="start_stamp"/>
|
||||||
|
<field var="answer_stamp"/>
|
||||||
|
<field var="end_stamp"/>
|
||||||
|
<field var="duration" quote="false"/>
|
||||||
|
<field var="billsec" quote="false"/>
|
||||||
|
<field var="hangup_cause"/>
|
||||||
|
<field var="uuid"/>
|
||||||
|
<field var="bleg_uuid"/>
|
||||||
|
<field var="accountcode"/>
|
||||||
|
<field var="read_codec"/>
|
||||||
|
<field var="write_codec"/>
|
||||||
|
<!-- <field var="sip_hangup_disposition"/> -->
|
||||||
|
<!-- <field var="ani"/> -->
|
||||||
|
</schema>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -78,6 +78,7 @@
|
||||||
<load module="mod_h26x"/>
|
<load module="mod_h26x"/>
|
||||||
<load module="mod_siren"/>
|
<load module="mod_siren"/>
|
||||||
<!--<load module="mod_celt"/>-->
|
<!--<load module="mod_celt"/>-->
|
||||||
|
<!--<load module="mod_opus"/>-->
|
||||||
|
|
||||||
<!-- File Format Interfaces -->
|
<!-- File Format Interfaces -->
|
||||||
<load module="mod_sndfile"/>
|
<load module="mod_sndfile"/>
|
||||||
|
|
|
@ -23,6 +23,10 @@
|
||||||
<settings>
|
<settings>
|
||||||
<!--Colorize the Console -->
|
<!--Colorize the Console -->
|
||||||
<param name="colorize-console" value="true"/>
|
<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.
|
Max number of sessions to allow at any given time.
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,4 @@
|
||||||
<X-PRE-PROCESS cmd="include" data="lang/ru/*.xml"/>
|
<X-PRE-PROCESS cmd="include" data="lang/ru/*.xml"/>
|
||||||
</macros>
|
</macros>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</document>
|
</document>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,8 @@ void CodecWidget::setCodecString(QString codecList)
|
||||||
QStringList parsed = codecList.split("{");
|
QStringList parsed = codecList.split("{");
|
||||||
QString var = parsed.at(1);
|
QString var = parsed.at(1);
|
||||||
var = var.split("}").at(0);
|
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());
|
var = switch_core_get_variable(var.toAscii().data());
|
||||||
if ( ! var.isEmpty() ) {
|
if ( ! var.isEmpty() ) {
|
||||||
codecList = var;
|
codecList = var;
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#define CMD_BUFLEN 1024
|
#define CMD_BUFLEN 1024
|
||||||
#define PROMPT_PREFIX "sangoma-media-gateway"
|
#define PROMPT_PREFIX "sangoma-media-gateway"
|
||||||
|
static int WARN_STOP = 0;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define strdup(src) _strdup(src)
|
#define strdup(src) _strdup(src)
|
||||||
|
@ -536,6 +537,13 @@ static BOOL console_readConsole(HANDLE conIn, char* buf, int len, int* pRed, int
|
||||||
static void handle_SIGINT(int sig)
|
static void handle_SIGINT(int sig)
|
||||||
{
|
{
|
||||||
if (sig);
|
if (sig);
|
||||||
|
|
||||||
|
WARN_STOP = 1;
|
||||||
|
|
||||||
|
signal(SIGINT, handle_SIGINT);
|
||||||
|
#ifdef SIGTSTP
|
||||||
|
signal(SIGTSTP, handle_SIGINT);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,16 +590,36 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
|
||||||
|
|
||||||
while(thread_running && handle->connected) {
|
while(thread_running && handle->connected) {
|
||||||
esl_status_t status = esl_recv_event_timed(handle, 10, 1, NULL);
|
esl_status_t status = esl_recv_event_timed(handle, 10, 1, NULL);
|
||||||
|
int aok = 1;
|
||||||
|
|
||||||
if (status == ESL_FAIL) {
|
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;
|
running = -1; thread_running = 0;
|
||||||
} else if (status == ESL_SUCCESS) {
|
} 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) {
|
if (handle->last_event) {
|
||||||
const char *type = esl_event_get_header(handle->last_event, "content-type");
|
const char *type = esl_event_get_header(handle->last_event, "content-type");
|
||||||
int known = 0;
|
int known = 0;
|
||||||
|
|
||||||
if (!esl_strlen_zero(type)) {
|
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");
|
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)) {
|
if (esl_strlen_zero(userdata) || esl_strlen_zero(filter_uuid) || !strcasecmp(filter_uuid, userdata)) {
|
||||||
|
@ -618,7 +646,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
|
||||||
} else if (!strcasecmp(type, "text/disconnect-notice")) {
|
} else if (!strcasecmp(type, "text/disconnect-notice")) {
|
||||||
running = -1; thread_running = 0;
|
running = -1; thread_running = 0;
|
||||||
known++;
|
known++;
|
||||||
} else if (!strcasecmp(type, "text/event-plain")) {
|
} else if (aok && !strcasecmp(type, "text/event-plain")) {
|
||||||
char *foo;
|
char *foo;
|
||||||
esl_event_serialize(handle->last_ievent, &foo, ESL_FALSE);
|
esl_event_serialize(handle->last_ievent, &foo, ESL_FALSE);
|
||||||
printf("RECV EVENT\n%s\n", foo);
|
printf("RECV EVENT\n%s\n", foo);
|
||||||
|
@ -628,7 +656,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!known) {
|
if (aok && !known) {
|
||||||
char *foo;
|
char *foo;
|
||||||
printf("INCOMING DATA [%s]\n%s\n", type, handle->last_event->body ? handle->last_event->body : "");
|
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);
|
esl_event_serialize(handle->last_event, &foo, ESL_FALSE);
|
||||||
|
@ -638,6 +666,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);
|
usleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1017,6 +1050,9 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
signal(SIGINT, handle_SIGINT);
|
signal(SIGINT, handle_SIGINT);
|
||||||
|
#ifdef SIGTSTP
|
||||||
|
signal(SIGTSTP, handle_SIGINT);
|
||||||
|
#endif
|
||||||
#ifdef SIGQUIT
|
#ifdef SIGQUIT
|
||||||
signal(SIGQUIT, handle_SIGQUIT);
|
signal(SIGQUIT, handle_SIGQUIT);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1067,9 +1067,16 @@ static const char* channel_get_variable(switch_core_session_t *session, switch_e
|
||||||
return variable;
|
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))) {
|
if ((variable = switch_core_get_variable(variable_name))) {
|
||||||
return variable;
|
return variable;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1570,8 +1577,8 @@ ftdm_status_t ftdm_channel_from_event(ftdm_sigmsg_t *sigmsg, switch_core_session
|
||||||
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-ANI2", "%s", channel_caller_data->aniII);
|
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-ANI2", "%s", channel_caller_data->aniII);
|
||||||
|
|
||||||
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-DNIS", "%s", channel_caller_data->dnis.digits);
|
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-DNIS", "%s", channel_caller_data->dnis.digits);
|
||||||
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-DNIS-TON", "%s", channel_caller_data->dnis.type);
|
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-DNIS-TON", "%d", channel_caller_data->dnis.type);
|
||||||
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-DNIS-Plan", "%s", channel_caller_data->dnis.plan);
|
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-DNIS-Plan", "%d", channel_caller_data->dnis.plan);
|
||||||
|
|
||||||
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-RDNIS", "%s", channel_caller_data->rdnis.digits);
|
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-RDNIS", "%s", channel_caller_data->rdnis.digits);
|
||||||
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-RDNIS-TON", "%d", channel_caller_data->rdnis.type);
|
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-RDNIS-TON", "%d", channel_caller_data->rdnis.type);
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>..\..\debug\freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
|
@ -199,7 +199,7 @@
|
||||||
<DataExecutionPrevention>
|
<DataExecutionPrevention>
|
||||||
</DataExecutionPrevention>
|
</DataExecutionPrevention>
|
||||||
<TargetMachine>MachineX64</TargetMachine>
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>..\..\debug\freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
|
@ -199,7 +199,7 @@
|
||||||
<DataExecutionPrevention>
|
<DataExecutionPrevention>
|
||||||
</DataExecutionPrevention>
|
</DataExecutionPrevention>
|
||||||
<TargetMachine>MachineX64</TargetMachine>
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
|
@ -37,9 +37,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef MOYTEST
|
|
||||||
crap
|
|
||||||
#endif
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include "private/ftdm_core.h"
|
#include "private/ftdm_core.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
@ -2509,10 +2506,12 @@ FT_DECLARE(ftdm_status_t) _ftdm_call_place(const char *file, const char *func, i
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we have a locked channel and are not afraid of using it! */
|
/* we have a locked channel and are not afraid of using it! */
|
||||||
status = hunting->result_cb(fchan, caller_data);
|
if (hunting->result_cb) {
|
||||||
if (status != FTDM_SUCCESS) {
|
status = hunting->result_cb(fchan, caller_data);
|
||||||
status = FTDM_ECANCELED;
|
if (status != FTDM_SUCCESS) {
|
||||||
goto done;
|
status = FTDM_ECANCELED;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ftdm_channel_set_caller_data(fchan, caller_data);
|
ftdm_channel_set_caller_data(fchan, caller_data);
|
||||||
|
|
|
@ -61,11 +61,11 @@
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
@ -151,7 +151,7 @@
|
||||||
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
|
|
@ -683,8 +683,8 @@ static ftdm_status_t ftdm_sangoma_isdn_process_state_change(ftdm_channel_t *ftdm
|
||||||
if (!sngisdn_test_flag(sngisdn_info, FLAG_SENT_PROCEED)) {
|
if (!sngisdn_test_flag(sngisdn_info, FLAG_SENT_PROCEED)) {
|
||||||
/* By default, we do not send a progress indicator in the proceed */
|
/* By default, we do not send a progress indicator in the proceed */
|
||||||
ftdm_sngisdn_progind_t prog_ind = {SNGISDN_PROGIND_LOC_USER, SNGISDN_PROGIND_DESCR_INVALID};
|
ftdm_sngisdn_progind_t prog_ind = {SNGISDN_PROGIND_LOC_USER, SNGISDN_PROGIND_DESCR_INVALID};
|
||||||
|
|
||||||
sngisdn_set_flag(sngisdn_info, FLAG_SENT_PROCEED);
|
sngisdn_set_flag(sngisdn_info, FLAG_SENT_PROCEED);
|
||||||
|
|
||||||
sngisdn_snd_proceed(ftdmchan, prog_ind);
|
sngisdn_snd_proceed(ftdmchan, prog_ind);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -800,6 +800,17 @@ static ftdm_status_t ftdm_sangoma_isdn_process_state_change(ftdm_channel_t *ftdm
|
||||||
/* If we never received a PROCEED/ALERT/PROGRESS/CONNECT on an outgoing call, we need to send release instead of disconnect */
|
/* If we never received a PROCEED/ALERT/PROGRESS/CONNECT on an outgoing call, we need to send release instead of disconnect */
|
||||||
sngisdn_snd_release(ftdmchan, 0);
|
sngisdn_snd_release(ftdmchan, 0);
|
||||||
break;
|
break;
|
||||||
|
case FTDM_CHANNEL_STATE_PROCEED:
|
||||||
|
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND)) {
|
||||||
|
if (((sngisdn_span_data_t*)(ftdmchan->span->signal_data))->switchtype == SNGISDN_SWITCH_4ESS ||
|
||||||
|
((sngisdn_span_data_t*)(ftdmchan->span->signal_data))->switchtype == SNGISDN_SWITCH_5ESS) {
|
||||||
|
|
||||||
|
/* When using 5ESS, if the user wants to clear an inbound call, the correct procedure is to send a PROGRESS with in-band info available, and play tones. Then send a DISCONNECT. If we reached this point, it means user did not try to play-tones, so send a RELEASE because remote side does not expect DISCONNECT in state 3 */
|
||||||
|
sngisdn_snd_release(ftdmchan, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* fall-through */
|
||||||
default:
|
default:
|
||||||
sngisdn_snd_disconnect(ftdmchan);
|
sngisdn_snd_disconnect(ftdmchan);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -385,8 +385,12 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)
|
||||||
case FTDM_CHANNEL_STATE_DIALING:
|
case FTDM_CHANNEL_STATE_DIALING:
|
||||||
case FTDM_CHANNEL_STATE_PROCEED:
|
case FTDM_CHANNEL_STATE_PROCEED:
|
||||||
case FTDM_CHANNEL_STATE_PROGRESS:
|
case FTDM_CHANNEL_STATE_PROGRESS:
|
||||||
case FTDM_CHANNEL_STATE_RINGING:
|
case FTDM_CHANNEL_STATE_RINGING:
|
||||||
if (cnStEvnt->progInd.eh.pres && cnStEvnt->progInd.progDesc.val == IN_PD_IBAVAIL) {
|
if ((cnStEvnt->progInd.eh.pres && cnStEvnt->progInd.progDesc.val == IN_PD_IBAVAIL) ||
|
||||||
|
(cnStEvnt->progInd1.eh.pres && cnStEvnt->progInd1.progDesc.val == IN_PD_IBAVAIL) ||
|
||||||
|
(cnStEvnt->progInd2.eh.pres && cnStEvnt->progInd2.progDesc.val == IN_PD_IBAVAIL) ||
|
||||||
|
(cnStEvnt->progInd3.eh.pres && cnStEvnt->progInd3.progDesc.val == IN_PD_IBAVAIL)) {
|
||||||
|
|
||||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Early media available\n");
|
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Early media available\n");
|
||||||
sngisdn_set_flag(sngisdn_info, FLAG_MEDIA_READY);
|
sngisdn_set_flag(sngisdn_info, FLAG_MEDIA_READY);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -74,6 +74,7 @@ int ftmod_ss7_relay_chan_config(int id);
|
||||||
int ft_to_sngss7_cfg_all(void)
|
int ft_to_sngss7_cfg_all(void)
|
||||||
{
|
{
|
||||||
int x = 0;
|
int x = 0;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
/* check if we have done gen_config already */
|
/* check if we have done gen_config already */
|
||||||
if (!(g_ftdm_sngss7_data.gen_config)) {
|
if (!(g_ftdm_sngss7_data.gen_config)) {
|
||||||
|
@ -98,6 +99,7 @@ int ft_to_sngss7_cfg_all(void)
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
SS7_INFO("Started Stack Manager!\n");
|
SS7_INFO("Started Stack Manager!\n");
|
||||||
|
sngss7_set_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_SM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if the configuration had a Relay Channel */
|
/* check if the configuration had a Relay Channel */
|
||||||
|
@ -289,15 +291,17 @@ int ft_to_sngss7_cfg_all(void)
|
||||||
/* check if this link has been configured already */
|
/* check if this link has been configured already */
|
||||||
if (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & SNGSS7_CONFIGURED)) {
|
if (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & SNGSS7_CONFIGURED)) {
|
||||||
|
|
||||||
if (ftmod_ss7_mtp3_nsap_config(x)) {
|
ret = ftmod_ss7_mtp3_nsap_config(x);
|
||||||
SS7_CRITICAL("MTP3 NSAP %d configuration FAILED!\n", x);
|
if (ret) {
|
||||||
|
SS7_CRITICAL("MTP3 NSAP %d configuration FAILED!(%s)\n", x, DECODE_LCM_REASON(ret));
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
SS7_INFO("MTP3 NSAP %d configuration DONE!\n", x);
|
SS7_INFO("MTP3 NSAP %d configuration DONE!\n", x);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ftmod_ss7_isup_nsap_config(x)) {
|
ret = ftmod_ss7_isup_nsap_config(x);
|
||||||
SS7_CRITICAL("ISUP NSAP %d configuration FAILED!\n", x);
|
if (ret) {
|
||||||
|
SS7_CRITICAL("ISUP NSAP %d configuration FAILED!(%s)\n", x, DECODE_LCM_REASON(ret));
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
SS7_INFO("ISUP NSAP %d configuration DONE!\n", x);
|
SS7_INFO("ISUP NSAP %d configuration DONE!\n", x);
|
||||||
|
@ -572,15 +576,13 @@ int ftmod_ss7_mtp3_gen_config(void)
|
||||||
|
|
||||||
|
|
||||||
cfg.t.cfg.s.snGen.typeSP = LSN_TYPE_SP; /* type of signalling postatic int */
|
cfg.t.cfg.s.snGen.typeSP = LSN_TYPE_SP; /* type of signalling postatic int */
|
||||||
cfg.t.cfg.s.snGen.spCode1 = g_ftdm_sngss7_data.cfg.spc; /* our DPC for CCITT version */
|
cfg.t.cfg.s.snGen.spCode1 = 0; /* our DPC for CCITT version */
|
||||||
|
|
||||||
#if (SS7_ANS92 || SS7_ANS88 || SS7_ANS96 || SS7_CHINA || defined(TDS_ROLL_UPGRADE_SUPPORT))
|
#if (SS7_ANS92 || SS7_ANS88 || SS7_ANS96 || SS7_CHINA || defined(TDS_ROLL_UPGRADE_SUPPORT))
|
||||||
cfg.t.cfg.s.snGen.spCode2 = g_ftdm_sngss7_data.cfg.spc; /* our DPC for ANSI or CHINA version */
|
cfg.t.cfg.s.snGen.spCode2 = 0; /* our DPC for ANSI or CHINA version */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cfg.t.cfg.s.snGen.ssfValid = TRUE; /* ssf validation required */
|
cfg.t.cfg.s.snGen.ssfValid = TRUE; /* ssf validation required */
|
||||||
cfg.t.cfg.s.snGen.nmbDLSap = MAX_SN_LINKS; /* number of MTP Data Link SAPs */
|
cfg.t.cfg.s.snGen.nmbDLSap = MAX_SN_LINKS; /* number of MTP Data Link SAPs */
|
||||||
cfg.t.cfg.s.snGen.nmbNSap = MAX_SN_VARIANTS; /* number of Upper Layer Saps */
|
cfg.t.cfg.s.snGen.nmbNSap = MAX_SN_ROUTES; /* number of Upper Layer Saps */
|
||||||
cfg.t.cfg.s.snGen.nmbRouts = MAX_SN_ROUTES; /* maximum number of routing entries */
|
cfg.t.cfg.s.snGen.nmbRouts = MAX_SN_ROUTES; /* maximum number of routing entries */
|
||||||
cfg.t.cfg.s.snGen.nmbLnkSets = MAX_SN_LINKSETS; /* number of link sets */
|
cfg.t.cfg.s.snGen.nmbLnkSets = MAX_SN_LINKSETS; /* number of link sets */
|
||||||
cfg.t.cfg.s.snGen.nmbRteInst = MAX_SN_ROUTES*16; /* number of simultaneous Rte instances */
|
cfg.t.cfg.s.snGen.nmbRteInst = MAX_SN_ROUTES*16; /* number of simultaneous Rte instances */
|
||||||
|
|
|
@ -1131,46 +1131,57 @@ static ftdm_status_t handle_show_status(ftdm_stream_handle_t *stream, int span,
|
||||||
ss7_info = (sngss7_chan_data_t *)g_ftdm_sngss7_data.cfg.isupCkt[x].obj;
|
ss7_info = (sngss7_chan_data_t *)g_ftdm_sngss7_data.cfg.isupCkt[x].obj;
|
||||||
ftdmchan = ss7_info->ftdmchan;
|
ftdmchan = ss7_info->ftdmchan;
|
||||||
|
|
||||||
/* grab the signaling_status */
|
if (ftdmchan == NULL) {
|
||||||
ftdm_channel_get_sig_status(ftdmchan, &sigstatus);
|
/* this should never happen!!! */
|
||||||
|
stream->write_function(stream, "span=%2d|chan=%2d|cic=%4d|FTDMCHAN DOES NOT EXISTS",
|
||||||
|
ckt->span,
|
||||||
|
ckt->chan,
|
||||||
|
ckt->cic);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
/* grab the signaling_status */
|
||||||
|
ftdm_channel_get_sig_status(ftdmchan, &sigstatus);
|
||||||
|
|
||||||
|
stream->write_function(stream, "span=%2d|chan=%2d|cic=%4d|sig_status=%4s|state=%s|",
|
||||||
|
ckt->span,
|
||||||
|
ckt->chan,
|
||||||
|
ckt->cic,
|
||||||
|
ftdm_signaling_status2str(sigstatus),
|
||||||
|
ftdm_channel_state2str(ftdmchan->state));
|
||||||
|
|
||||||
|
if ((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_TX)) ||
|
||||||
|
(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_TX))) {
|
||||||
|
stream->write_function(stream, "l_mn=Y|");
|
||||||
|
}else {
|
||||||
|
stream->write_function(stream, "l_mn=N|");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_RX)) ||
|
||||||
|
(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_RX))) {
|
||||||
|
stream->write_function(stream, "r_mn=Y|");
|
||||||
|
}else {
|
||||||
|
stream->write_function(stream, "r_mn=N|");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_TX)) {
|
||||||
|
stream->write_function(stream, "l_hw=Y|");
|
||||||
|
}else {
|
||||||
|
stream->write_function(stream, "l_hw=N|");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_RX)) {
|
||||||
|
stream->write_function(stream, "r_hw=Y|");
|
||||||
|
}else {
|
||||||
|
stream->write_function(stream, "r_hw=N|");
|
||||||
|
}
|
||||||
|
|
||||||
stream->write_function(stream, "span=%2d|chan=%2d|cic=%4d|sig_status=%4s|state=%s|",
|
if (sngss7_test_ckt_flag(ss7_info, FLAG_RELAY_DOWN)) {
|
||||||
ckt->span,
|
stream->write_function(stream, "relay=Y|");
|
||||||
ckt->chan,
|
}else {
|
||||||
ckt->cic,
|
stream->write_function(stream, "relay=N|");
|
||||||
ftdm_signaling_status2str(sigstatus),
|
}
|
||||||
ftdm_channel_state2str(ftdmchan->state));
|
|
||||||
|
|
||||||
if((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_TX)) || (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_TX))) {
|
|
||||||
stream->write_function(stream, "l_mn=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "l_mn=N|");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_RX)) || (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_RX))) {
|
|
||||||
stream->write_function(stream, "r_mn=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "r_mn=N|");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_TX)) {
|
|
||||||
stream->write_function(stream, "l_hw=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "l_hw=N|");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_RX)) {
|
|
||||||
stream->write_function(stream, "r_hw=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "r_hw=N|");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sngss7_test_ckt_flag(ss7_info, FLAG_RELAY_DOWN)) {
|
|
||||||
stream->write_function(stream, "relay=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "relay=N|");
|
|
||||||
}
|
|
||||||
|
|
||||||
stream->write_function(stream, "flags=0x%X",ss7_info->ckt_flags);
|
stream->write_function(stream, "flags=0x%X",ss7_info->ckt_flags);
|
||||||
|
|
||||||
stream->write_function(stream, "\n");
|
stream->write_function(stream, "\n");
|
||||||
|
|
|
@ -1570,28 +1570,37 @@ static FIO_SIG_UNLOAD_FUNCTION(ftdm_sangoma_ss7_unload)
|
||||||
|
|
||||||
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_CC)) {
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_CC)) {
|
||||||
sng_isup_free_cc();
|
sng_isup_free_cc();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_CC);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP)) {
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP)) {
|
||||||
ftmod_ss7_shutdown_isup();
|
ftmod_ss7_shutdown_isup();
|
||||||
sng_isup_free_isup();
|
sng_isup_free_isup();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP3)) {
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP3)) {
|
||||||
ftmod_ss7_shutdown_mtp3();
|
ftmod_ss7_shutdown_mtp3();
|
||||||
sng_isup_free_mtp3();
|
sng_isup_free_mtp3();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP2)) {
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP2)) {
|
||||||
ftmod_ss7_shutdown_mtp2();
|
ftmod_ss7_shutdown_mtp2();
|
||||||
sng_isup_free_mtp2();
|
sng_isup_free_mtp2();
|
||||||
sng_isup_free_mtp1();
|
sng_isup_free_mtp1();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP2);
|
||||||
}
|
}
|
||||||
|
|
||||||
ftmod_ss7_shutdown_relay();
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_RY)) {
|
||||||
sng_isup_free_relay();
|
ftmod_ss7_shutdown_relay();
|
||||||
|
sng_isup_free_relay();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_RY);
|
||||||
|
}
|
||||||
|
|
||||||
sng_isup_free_sm();
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_SM)) {
|
||||||
|
sng_isup_free_sm();
|
||||||
|
}
|
||||||
|
|
||||||
sng_isup_free_gen();
|
sng_isup_free_gen();
|
||||||
|
|
||||||
|
|
|
@ -219,13 +219,18 @@ typedef struct sng_link_set {
|
||||||
uint32_t links[16];
|
uint32_t links[16];
|
||||||
} sng_link_set_t;
|
} sng_link_set_t;
|
||||||
|
|
||||||
|
typedef struct sng_link_set_list {
|
||||||
|
uint32_t lsId;
|
||||||
|
struct sng_link_set_list *next;
|
||||||
|
} sng_link_set_list_t;
|
||||||
|
|
||||||
typedef struct sng_route {
|
typedef struct sng_route {
|
||||||
char name[MAX_NAME_LEN];
|
char name[MAX_NAME_LEN];
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
uint32_t dpc;
|
uint32_t dpc;
|
||||||
uint32_t cmbLinkSetId;
|
uint32_t cmbLinkSetId;
|
||||||
uint32_t linkSetId;
|
struct sng_link_set_list lnkSets;
|
||||||
uint32_t linkType;
|
uint32_t linkType;
|
||||||
uint32_t switchType;
|
uint32_t switchType;
|
||||||
uint32_t ssf;
|
uint32_t ssf;
|
||||||
|
|
|
@ -464,11 +464,6 @@ static int ftmod_ss7_parse_sng_gen(ftdm_conf_node_t *sng_gen)
|
||||||
SS7_DEBUG("Found license file = %s\n", g_ftdm_sngss7_data.cfg.license);
|
SS7_DEBUG("Found license file = %s\n", g_ftdm_sngss7_data.cfg.license);
|
||||||
SS7_DEBUG("Found signature file = %s\n", g_ftdm_sngss7_data.cfg.signature);
|
SS7_DEBUG("Found signature file = %s\n", g_ftdm_sngss7_data.cfg.signature);
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
} else if (!strcasecmp(parm->var, "spc")) {
|
|
||||||
/**********************************************************************/
|
|
||||||
g_ftdm_sngss7_data.cfg.spc = atoi(parm->val);
|
|
||||||
SS7_DEBUG("Found SPC = %d\n", g_ftdm_sngss7_data.cfg.spc);
|
|
||||||
/**********************************************************************/
|
|
||||||
} else {
|
} else {
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
SS7_ERROR("Found an invalid parameter \"%s\"!\n", parm->val);
|
SS7_ERROR("Found an invalid parameter \"%s\"!\n", parm->val);
|
||||||
|
@ -1268,9 +1263,9 @@ static int ftmod_ss7_parse_mtp_route(ftdm_conf_node_t *mtp_route)
|
||||||
ftdm_conf_parameter_t *parm = mtp_route->parameters;
|
ftdm_conf_parameter_t *parm = mtp_route->parameters;
|
||||||
int num_parms = mtp_route->n_parameters;
|
int num_parms = mtp_route->n_parameters;
|
||||||
int i;
|
int i;
|
||||||
|
sng_link_set_list_t *lnkSet;
|
||||||
|
|
||||||
ftdm_conf_node_t *linkset;
|
ftdm_conf_node_t *linkset;
|
||||||
int ls_id;
|
|
||||||
int numLinks;
|
int numLinks;
|
||||||
|
|
||||||
/* initalize the mtpRoute structure */
|
/* initalize the mtpRoute structure */
|
||||||
|
@ -1383,42 +1378,50 @@ static int ftmod_ss7_parse_mtp_route(ftdm_conf_node_t *mtp_route)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill in the rest of the values in the mtpRoute struct */
|
/* fill in the rest of the values in the mtpRoute struct */
|
||||||
mtpRoute.nwId = mtpRoute.id;
|
mtpRoute.nwId = 0;
|
||||||
mtpRoute.cmbLinkSetId = mtpRoute.id;
|
mtpRoute.cmbLinkSetId = mtpRoute.id;
|
||||||
|
|
||||||
/* parse in the list of linksets this route is reachable by */
|
/* parse in the list of linksets this route is reachable by */
|
||||||
linkset = mtp_route->child->child;
|
linkset = mtp_route->child->child;
|
||||||
|
|
||||||
|
/* initalize the link-list of linkSet Ids */
|
||||||
|
lnkSet = &mtpRoute.lnkSets;
|
||||||
|
|
||||||
while (linkset != NULL) {
|
while (linkset != NULL) {
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/* extract the linkset Id */
|
/* extract the linkset Id */
|
||||||
ls_id = atoi(linkset->parameters->val);
|
lnkSet->lsId = atoi(linkset->parameters->val);
|
||||||
|
|
||||||
if (g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].id != 0) {
|
if (g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].id != 0) {
|
||||||
SS7_DEBUG("Found mtpRoute linkset id = %d that is valid\n",ls_id);
|
SS7_DEBUG("Found mtpRoute linkset id = %d that is valid\n",lnkSet->lsId);
|
||||||
} else {
|
} else {
|
||||||
SS7_ERROR("Found mtpRoute linkset id = %d that is invalid\n",ls_id);
|
SS7_ERROR("Found mtpRoute linkset id = %d that is invalid\n",lnkSet->lsId);
|
||||||
goto move_along;
|
goto move_along;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pull up the linktype, switchtype, and SSF from the linkset */
|
/* pull up the linktype, switchtype, and SSF from the linkset */
|
||||||
mtpRoute.linkType = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].linkType;
|
mtpRoute.linkType = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].linkType;
|
||||||
mtpRoute.switchType = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].switchType;
|
mtpRoute.switchType = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].switchType;
|
||||||
mtpRoute.ssf = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].ssf;
|
mtpRoute.ssf = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].ssf;
|
||||||
|
|
||||||
/* extract the number of cmbLinkSetId aleady on this linkset */
|
/* extract the number of cmbLinkSetId aleady on this linkset */
|
||||||
numLinks = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].numLinks;
|
numLinks = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks;
|
||||||
|
|
||||||
/* add this routes cmbLinkSetId to the list */
|
/* add this routes cmbLinkSetId to the list */
|
||||||
g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].links[numLinks] = mtpRoute.cmbLinkSetId;
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].links[numLinks] = mtpRoute.cmbLinkSetId;
|
||||||
|
|
||||||
/* increment the number of cmbLinkSets on this linkset */
|
/* increment the number of cmbLinkSets on this linkset */
|
||||||
g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].numLinks++;
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks++;
|
||||||
|
|
||||||
|
/* update the linked list */
|
||||||
|
lnkSet->next = ftdm_malloc(sizeof(sng_link_set_list_t));
|
||||||
|
lnkSet = lnkSet->next;
|
||||||
|
lnkSet->lsId = 0;
|
||||||
|
lnkSet->next = NULL;
|
||||||
|
|
||||||
move_along:
|
move_along:
|
||||||
/* move to the next linkset element */
|
/* move to the next linkset element */
|
||||||
linkset = linkset->next;
|
linkset = linkset->next;
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
} /* while (linkset != null) */
|
} /* while (linkset != null) */
|
||||||
|
|
||||||
|
@ -1465,6 +1468,7 @@ static int ftmod_ss7_parse_isup_interface(ftdm_conf_node_t *isup_interface)
|
||||||
{
|
{
|
||||||
sng_isup_inf_t sng_isup;
|
sng_isup_inf_t sng_isup;
|
||||||
sng_isap_t sng_isap;
|
sng_isap_t sng_isap;
|
||||||
|
sng_link_set_list_t *lnkSet;
|
||||||
ftdm_conf_parameter_t *parm = isup_interface->parameters;
|
ftdm_conf_parameter_t *parm = isup_interface->parameters;
|
||||||
int num_parms = isup_interface->n_parameters;
|
int num_parms = isup_interface->n_parameters;
|
||||||
int i;
|
int i;
|
||||||
|
@ -1500,7 +1504,6 @@ static int ftmod_ss7_parse_isup_interface(ftdm_conf_node_t *isup_interface)
|
||||||
} else if (!strcasecmp(parm->var, "spc")) {
|
} else if (!strcasecmp(parm->var, "spc")) {
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
sng_isup.spc = atoi(parm->val);
|
sng_isup.spc = atoi(parm->val);
|
||||||
g_ftdm_sngss7_data.cfg.spc = sng_isup.spc;
|
|
||||||
SS7_DEBUG("Found an isup SPC = %d\n", sng_isup.spc);
|
SS7_DEBUG("Found an isup SPC = %d\n", sng_isup.spc);
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
} else if (!strcasecmp(parm->var, "mtprouteId")) {
|
} else if (!strcasecmp(parm->var, "mtprouteId")) {
|
||||||
|
@ -1747,17 +1750,14 @@ static int ftmod_ss7_parse_isup_interface(ftdm_conf_node_t *isup_interface)
|
||||||
sngss7_set_flag(&sng_isup, SNGSS7_PAUSED);
|
sngss7_set_flag(&sng_isup, SNGSS7_PAUSED);
|
||||||
|
|
||||||
/* trickle down the SPC to all sub entities */
|
/* trickle down the SPC to all sub entities */
|
||||||
int linkSetId;
|
lnkSet = &g_ftdm_sngss7_data.cfg.mtpRoute[sng_isup.mtpRouteId].lnkSets;
|
||||||
|
|
||||||
linkSetId = g_ftdm_sngss7_data.cfg.mtpRoute[sng_isup.mtpRouteId].linkSetId;
|
g_ftdm_sngss7_data.cfg.mtp3Link[lnkSet->lsId].spc = sng_isup.spc;
|
||||||
|
lnkSet = lnkSet->next;
|
||||||
|
|
||||||
i = 1;
|
while (lnkSet->next != NULL) {
|
||||||
while (g_ftdm_sngss7_data.cfg.mtp3Link[i].id != 0) {
|
g_ftdm_sngss7_data.cfg.mtp3Link[lnkSet->lsId].spc = sng_isup.spc;
|
||||||
if (g_ftdm_sngss7_data.cfg.mtp3Link[i].linkSetId == linkSetId) {
|
lnkSet = lnkSet->next;
|
||||||
g_ftdm_sngss7_data.cfg.mtp3Link[i].spc = g_ftdm_sngss7_data.cfg.spc;
|
|
||||||
}
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pull values from the lower levels */
|
/* pull values from the lower levels */
|
||||||
|
@ -2342,7 +2342,10 @@ static int ftmod_ss7_fill_in_mtpLinkSet(sng_link_set_t *mtpLinkSet)
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
||||||
{
|
{
|
||||||
int i = mtp3_route->id;
|
sng_link_set_list_t *lnkSet = NULL;
|
||||||
|
int i = mtp3_route->id;
|
||||||
|
int tmp = 0;
|
||||||
|
|
||||||
|
|
||||||
/* check if this id value has been used already */
|
/* check if this id value has been used already */
|
||||||
if (g_ftdm_sngss7_data.cfg.mtpRoute[i].id == 0) {
|
if (g_ftdm_sngss7_data.cfg.mtpRoute[i].id == 0) {
|
||||||
|
@ -2355,10 +2358,19 @@ static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill in the cmbLinkSet in the linkset structure */
|
/* fill in the cmbLinkSet in the linkset structure */
|
||||||
int tmp = g_ftdm_sngss7_data.cfg.mtpLinkSet[mtp3_route->linkSetId].numLinks;
|
lnkSet = &mtp3_route->lnkSets;
|
||||||
|
|
||||||
g_ftdm_sngss7_data.cfg.mtpLinkSet[mtp3_route->linkSetId].links[tmp] = mtp3_route->cmbLinkSetId;
|
tmp = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks;
|
||||||
g_ftdm_sngss7_data.cfg.mtpLinkSet[mtp3_route->linkSetId].numLinks++;
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].links[tmp] = mtp3_route->cmbLinkSetId;
|
||||||
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks++;
|
||||||
|
|
||||||
|
while (lnkSet->next != NULL) {
|
||||||
|
tmp = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks;
|
||||||
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].links[tmp] = mtp3_route->cmbLinkSetId;
|
||||||
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks++;
|
||||||
|
|
||||||
|
lnkSet = lnkSet->next;
|
||||||
|
}
|
||||||
|
|
||||||
strcpy((char *)g_ftdm_sngss7_data.cfg.mtpRoute[i].name, (char *)mtp3_route->name);
|
strcpy((char *)g_ftdm_sngss7_data.cfg.mtpRoute[i].name, (char *)mtp3_route->name);
|
||||||
|
|
||||||
|
@ -2369,7 +2381,7 @@ static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].cmbLinkSetId = mtp3_route->cmbLinkSetId;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].cmbLinkSetId = mtp3_route->cmbLinkSetId;
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].isSTP = mtp3_route->isSTP;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].isSTP = mtp3_route->isSTP;
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].nwId = mtp3_route->nwId;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].nwId = mtp3_route->nwId;
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].linkSetId = mtp3_route->linkSetId;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].lnkSets = mtp3_route->lnkSets;
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].ssf = mtp3_route->ssf;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].ssf = mtp3_route->ssf;
|
||||||
if (mtp3_route->t6 != 0) {
|
if (mtp3_route->t6 != 0) {
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t6 = mtp3_route->t6;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].t6 = mtp3_route->t6;
|
||||||
|
@ -2439,8 +2451,7 @@ static int ftmod_ss7_fill_in_nsap(sng_route_t *mtp3_route)
|
||||||
i = 1;
|
i = 1;
|
||||||
while (g_ftdm_sngss7_data.cfg.nsap[i].id != 0) {
|
while (g_ftdm_sngss7_data.cfg.nsap[i].id != 0) {
|
||||||
if ((g_ftdm_sngss7_data.cfg.nsap[i].linkType == mtp3_route->linkType) &&
|
if ((g_ftdm_sngss7_data.cfg.nsap[i].linkType == mtp3_route->linkType) &&
|
||||||
(g_ftdm_sngss7_data.cfg.nsap[i].switchType == mtp3_route->switchType) &&
|
(g_ftdm_sngss7_data.cfg.nsap[i].switchType == mtp3_route->switchType)) {
|
||||||
(g_ftdm_sngss7_data.cfg.nsap[i].ssf == mtp3_route->ssf)) {
|
|
||||||
|
|
||||||
/* we have a match so break out of this loop */
|
/* we have a match so break out of this loop */
|
||||||
break;
|
break;
|
||||||
|
@ -2789,6 +2800,7 @@ static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)
|
||||||
sngss7_chan_data_t *ss7_info = NULL;
|
sngss7_chan_data_t *ss7_info = NULL;
|
||||||
int x;
|
int x;
|
||||||
int count = 1;
|
int count = 1;
|
||||||
|
int flag;
|
||||||
|
|
||||||
while (ccSpan->ch_map[0] != '\0') {
|
while (ccSpan->ch_map[0] != '\0') {
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
@ -2799,13 +2811,45 @@ static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)
|
||||||
return FTDM_FAIL;
|
return FTDM_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find the spot in master array for this circuit */
|
/* find a spot for this circuit in the global structure */
|
||||||
x = (ccSpan->procId * 1000) + count;
|
x = (ccSpan->procId * 1000);
|
||||||
|
flag = 0;
|
||||||
|
while (flag == 0) {
|
||||||
|
/**********************************************************************/
|
||||||
|
/* check the id value ( 0 = new, 0 > circuit can be existing) */
|
||||||
|
if (g_ftdm_sngss7_data.cfg.isupCkt[x].id == 0) {
|
||||||
|
/* we're at the end of the list of circuitsl aka this is new */
|
||||||
|
SS7_DEBUG("Found a new circuit %d, ccSpanId=%d, chan=%d\n",
|
||||||
|
x,
|
||||||
|
ccSpan->id,
|
||||||
|
count);
|
||||||
|
|
||||||
/* check if this circuit has already been filled in */
|
/* throw the flag to end the loop */
|
||||||
if (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) {
|
flag = 1;
|
||||||
SS7_DEVEL_DEBUG("Filling in circuit that already exists...%d\n", x);
|
} else {
|
||||||
}
|
/* check the ccspan.id and chan to see if the circuit already exists */
|
||||||
|
if ((g_ftdm_sngss7_data.cfg.isupCkt[x].ccSpanId == ccSpan->id) &&
|
||||||
|
(g_ftdm_sngss7_data.cfg.isupCkt[x].chan == count)) {
|
||||||
|
|
||||||
|
/* we are processing a circuit that already exists */
|
||||||
|
SS7_DEBUG("Found an existing circuit %d, ccSpanId=%d, chan%d\n",
|
||||||
|
x,
|
||||||
|
ccSpan->id,
|
||||||
|
count);
|
||||||
|
|
||||||
|
/* throw the flag to end the loop */
|
||||||
|
flag = 1;
|
||||||
|
|
||||||
|
/* not supporting reconfig at this time */
|
||||||
|
SS7_DEBUG("Not supporting ckt reconfig at this time!\n");
|
||||||
|
goto move_along;
|
||||||
|
} else {
|
||||||
|
/* this is not the droid you are looking for */
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**********************************************************************/
|
||||||
|
} /* while (flag == 0) */
|
||||||
|
|
||||||
/* prepare the global info sturcture */
|
/* prepare the global info sturcture */
|
||||||
ss7_info = ftdm_calloc(1, sizeof(sngss7_chan_data_t));
|
ss7_info = ftdm_calloc(1, sizeof(sngss7_chan_data_t));
|
||||||
|
@ -2901,6 +2945,7 @@ static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)
|
||||||
g_ftdm_sngss7_data.cfg.isupCkt[x].cic,
|
g_ftdm_sngss7_data.cfg.isupCkt[x].cic,
|
||||||
g_ftdm_sngss7_data.cfg.isupCkt[x].id);
|
g_ftdm_sngss7_data.cfg.isupCkt[x].id);
|
||||||
|
|
||||||
|
move_along:
|
||||||
/* increment the span channel count */
|
/* increment the span channel count */
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
|
|
|
@ -61,14 +61,14 @@
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
|
||||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||||
|
|
|
@ -47,7 +47,9 @@
|
||||||
{
|
{
|
||||||
fld dbl
|
fld dbl
|
||||||
frndint
|
frndint
|
||||||
|
fstp dbl
|
||||||
}
|
}
|
||||||
|
return (long int) dbl;
|
||||||
}
|
}
|
||||||
#elif defined (_WIN64)
|
#elif defined (_WIN64)
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
|
|
|
@ -135,7 +135,9 @@ void dump_chan_xml(zap_span_t *span, uint32_t chan_id, switch_stream_handle_t *s
|
||||||
|
|
||||||
static void zap_set_npi(const char *npi_string, uint8_t *target)
|
static void zap_set_npi(const char *npi_string, uint8_t *target)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(npi_string, "isdn") || !strcasecmp(npi_string, "e164")) {
|
if (switch_is_number(npi_string)) {
|
||||||
|
*target = (uint8_t)atoi(npi_string);
|
||||||
|
} else if (!strcasecmp(npi_string, "isdn") || !strcasecmp(npi_string, "e164")) {
|
||||||
*target = ZAP_NPI_ISDN;
|
*target = ZAP_NPI_ISDN;
|
||||||
} else if (!strcasecmp(npi_string, "data")) {
|
} else if (!strcasecmp(npi_string, "data")) {
|
||||||
*target = ZAP_NPI_DATA;
|
*target = ZAP_NPI_DATA;
|
||||||
|
@ -157,7 +159,9 @@ static void zap_set_npi(const char *npi_string, uint8_t *target)
|
||||||
|
|
||||||
static void zap_set_ton(const char *ton_string, uint8_t *target)
|
static void zap_set_ton(const char *ton_string, uint8_t *target)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(ton_string, "national")) {
|
if (switch_is_number(ton_string)) {
|
||||||
|
*target = (uint8_t)atoi(ton_string);
|
||||||
|
} else if (!strcasecmp(ton_string, "national")) {
|
||||||
*target = ZAP_TON_NATIONAL;
|
*target = ZAP_TON_NATIONAL;
|
||||||
} else if (!strcasecmp(ton_string, "international")) {
|
} else if (!strcasecmp(ton_string, "international")) {
|
||||||
*target = ZAP_TON_INTERNATIONAL;
|
*target = ZAP_TON_INTERNATIONAL;
|
||||||
|
@ -1230,27 +1234,25 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||||
zap_set_string(caller_data.ani.digits, dest);
|
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"))) {
|
||||||
if (!strcasecmp(var, "national")) {
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting TON to: %s\n", var);
|
||||||
caller_data.ani.type = ZAP_TON_NATIONAL;
|
zap_set_ton(var, &caller_data.ani.type);
|
||||||
} else if (!strcasecmp(var, "international")) {
|
|
||||||
caller_data.ani.type = ZAP_TON_INTERNATIONAL;
|
|
||||||
} else if (!strcasecmp(var, "local")) {
|
|
||||||
caller_data.ani.type = ZAP_TON_SUBSCRIBER_NUMBER;
|
|
||||||
} else if (!strcasecmp(var, "unknown")) {
|
|
||||||
caller_data.ani.type = ZAP_TON_UNKNOWN;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
caller_data.ani.type = outbound_profile->destination_number_ton;
|
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);
|
zap_set_string((char *)caller_data.raw_data, var);
|
||||||
caller_data.raw_data_len = strlen(var);
|
caller_data.raw_data_len = strlen(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
caller_data.ani.plan = outbound_profile->destination_number_numplan;
|
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 {
|
||||||
|
caller_data.ani.plan = outbound_profile->destination_number_numplan;
|
||||||
|
}
|
||||||
|
|
||||||
/* blindly copy data from outbound_profile. They will be overwritten
|
/* blindly copy data from outbound_profile. They will be overwritten
|
||||||
* by calling zap_caller_data if needed after */
|
* by calling zap_caller_data if needed after */
|
||||||
caller_data.cid_num.type = outbound_profile->caller_ton;
|
caller_data.cid_num.type = outbound_profile->caller_ton;
|
||||||
|
|
|
@ -41,11 +41,11 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
@ -57,11 +57,11 @@
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
@ -77,9 +77,11 @@
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'" Label="PropertySheets">
|
<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="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="..\..\..\..\w32\extlib.props" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'" Label="PropertySheets">
|
<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="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="..\..\..\..\w32\extlib.props" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(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">
|
<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="$(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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||||
|
<Import Project="..\..\..\..\w32\extlib.props" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'" Label="PropertySheets">
|
<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="$(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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||||
|
<Import Project="..\..\..\..\w32\extlib.props" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
@ -110,18 +114,6 @@
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
<_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>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<Midl>
|
<Midl>
|
||||||
|
@ -231,45 +223,23 @@
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<TargetEnvironment>Win32</TargetEnvironment>
|
<TargetEnvironment>Win32</TargetEnvironment>
|
||||||
<TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
|
|
||||||
<HeaderFileName>
|
|
||||||
</HeaderFileName>
|
|
||||||
</Midl>
|
</Midl>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<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>
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)/portaudio.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
|
||||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
|
||||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<Culture>0x0409</Culture>
|
<Culture>0x0409</Culture>
|
||||||
</ResourceCompile>
|
</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>
|
<Bscmake>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
|
|
||||||
</Bscmake>
|
</Bscmake>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">
|
||||||
|
@ -278,45 +248,23 @@
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<TargetEnvironment>X64</TargetEnvironment>
|
<TargetEnvironment>X64</TargetEnvironment>
|
||||||
<TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
|
|
||||||
<HeaderFileName>
|
|
||||||
</HeaderFileName>
|
|
||||||
</Midl>
|
</Midl>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<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>
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
|
||||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
|
||||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<Culture>0x0409</Culture>
|
<Culture>0x0409</Culture>
|
||||||
</ResourceCompile>
|
</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>
|
<Bscmake>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<OutputFile>$(Platform)\$(Configuration)/portaudio_x64.bsc</OutputFile>
|
|
||||||
</Bscmake>
|
</Bscmake>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">
|
||||||
|
@ -325,22 +273,15 @@
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<TargetEnvironment>Win32</TargetEnvironment>
|
<TargetEnvironment>Win32</TargetEnvironment>
|
||||||
<TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
|
|
||||||
<HeaderFileName>
|
|
||||||
</HeaderFileName>
|
|
||||||
</Midl>
|
</Midl>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<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>
|
<StringPooling>true</StringPooling>
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)/portaudio.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
|
||||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
|
||||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -348,20 +289,8 @@
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<Culture>0x0409</Culture>
|
<Culture>0x0409</Culture>
|
||||||
</ResourceCompile>
|
</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>
|
<Bscmake>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
|
|
||||||
</Bscmake>
|
</Bscmake>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">
|
||||||
|
@ -370,22 +299,15 @@
|
||||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<TargetEnvironment>X64</TargetEnvironment>
|
<TargetEnvironment>X64</TargetEnvironment>
|
||||||
<TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
|
|
||||||
<HeaderFileName>
|
|
||||||
</HeaderFileName>
|
|
||||||
</Midl>
|
</Midl>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;%(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>
|
<StringPooling>true</StringPooling>
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
|
||||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
|
||||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -393,20 +315,8 @@
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<Culture>0x0409</Culture>
|
<Culture>0x0409</Culture>
|
||||||
</ResourceCompile>
|
</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>
|
<Bscmake>
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.bsc</OutputFile>
|
|
||||||
</Bscmake>
|
</Bscmake>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -594,6 +504,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -605,6 +516,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -618,6 +530,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -629,6 +542,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -642,6 +556,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -653,6 +568,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -666,6 +582,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -677,6 +594,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -690,6 +608,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -701,6 +620,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -714,6 +634,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -725,6 +646,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -738,6 +660,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -749,6 +672,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -762,6 +686,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
@ -773,6 +698,7 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|Win32'">true</ExcludedFromBuild>
|
<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>
|
<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>
|
<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>
|
<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>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release DirectSound|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<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>
|
<Project>{8b3b4c4c-13c2-446c-beb0-f412cc2cfb9a}</Project>
|
||||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</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">
|
<ProjectReference Include="..\pthread\pthread.2010.vcxproj">
|
||||||
<Project>{df018947-0fff-4eb3-bdee-441dc81da7a4}</Project>
|
<Project>{df018947-0fff-4eb3-bdee-441dc81da7a4}</Project>
|
||||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||||
|
|
|
@ -246,6 +246,7 @@ struct switch_runtime {
|
||||||
int sql_buffer_len;
|
int sql_buffer_len;
|
||||||
int max_sql_buffer_len;
|
int max_sql_buffer_len;
|
||||||
switch_dbtype_t odbc_dbtype;
|
switch_dbtype_t odbc_dbtype;
|
||||||
|
char hostname[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct switch_runtime runtime;
|
extern struct switch_runtime runtime;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* switch_core.h -- Core Library
|
* switch_core.h -- Core Library
|
||||||
|
@ -758,6 +759,9 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_force_locate(_In_z_
|
||||||
\return the value of the desired variable
|
\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(_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
|
\brief Add a global variable to the core
|
||||||
|
@ -1734,6 +1738,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_close(switch_asr_handle_t *ah, s
|
||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Feed DTMF to an asr handle
|
||||||
|
\param ah the handle to feed data to
|
||||||
|
\param dtmf a string of DTMF digits
|
||||||
|
\param flags flags to influence behaviour
|
||||||
|
\return SWITCH_STATUS_SUCCESS
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_feed_dtmf(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Check an asr handle for results
|
\brief Check an asr handle for results
|
||||||
\param ah the handle to check
|
\param ah the handle to check
|
||||||
|
@ -1768,6 +1781,29 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t
|
||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle_t *ah, const char *name);
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle_t *ah, const char *name);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Enable a grammar from an asr handle
|
||||||
|
\param ah the handle to enable the grammar from
|
||||||
|
\param name the name of the grammar to enable
|
||||||
|
\return SWITCH_STATUS_SUCCESS
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_enable_grammar(switch_asr_handle_t *ah, const char *name);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Disable a grammar from an asr handle
|
||||||
|
\param ah the handle to disable the grammar from
|
||||||
|
\param name the name of the grammar to disable
|
||||||
|
\return SWITCH_STATUS_SUCCESS
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_grammar(switch_asr_handle_t *ah, const char *name);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Disable all grammars from an asr handle
|
||||||
|
\param ah the handle to disable the grammars from
|
||||||
|
\return SWITCH_STATUS_SUCCESS
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_all_grammars(switch_asr_handle_t *ah);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Pause detection on an asr handle
|
\brief Pause detection on an asr handle
|
||||||
\param ah the handle to pause
|
\param ah the handle to pause
|
||||||
|
|
|
@ -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) consoleLog(char *level_str, char *msg);
|
||||||
SWITCH_DECLARE(void) consoleCleanLog(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 CoreSession;
|
||||||
|
|
||||||
class IVRMenu {
|
class IVRMenu {
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
* Neal Horman <neal at wanlink dot com>
|
* Neal Horman <neal at wanlink dot com>
|
||||||
* Bret McDanel <trixter AT 0xdecafbad dot com>
|
* Bret McDanel <trixter AT 0xdecafbad dot com>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
* switch_ivr.h -- IVR Library
|
* switch_ivr.h -- IVR Library
|
||||||
*
|
*
|
||||||
|
@ -198,8 +199,38 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_cor
|
||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name);
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Enable a grammar on a background speech detection handle
|
||||||
|
\param session The session to change the grammar on
|
||||||
|
\param name the grammar name
|
||||||
|
\return SWITCH_STATUS_SUCCESS if all is well
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_enable_grammar(switch_core_session_t *session, const char *name);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Disable a grammar on a background speech detection handle
|
||||||
|
\param session The session to change the grammar on
|
||||||
|
\param name the grammar name
|
||||||
|
\return SWITCH_STATUS_SUCCESS if all is well
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_grammar(switch_core_session_t *session, const char *name);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Disable all grammars on a background speech detection handle
|
||||||
|
\param session The session to change the grammar on
|
||||||
|
\return SWITCH_STATUS_SUCCESS if all is well
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_all_grammars(switch_core_session_t *session);
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val);
|
SWITCH_DECLARE(switch_status_t) switch_ivr_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Start input timers on a background speech detection handle
|
||||||
|
\param session The session to start the timers on
|
||||||
|
\return SWITCH_STATUS_SUCCESS if all is well
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(switch_core_session_t *session);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Record a session to disk
|
\brief Record a session to disk
|
||||||
\param session the session to record
|
\param session the session to record
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* switch_module_interfaces.h -- Module Interface Definitions
|
* switch_module_interfaces.h -- Module Interface Definitions
|
||||||
|
@ -396,6 +397,14 @@ struct switch_asr_interface {
|
||||||
switch_mutex_t *reflock;
|
switch_mutex_t *reflock;
|
||||||
switch_loadable_module_interface_t *parent;
|
switch_loadable_module_interface_t *parent;
|
||||||
struct switch_asr_interface *next;
|
struct switch_asr_interface *next;
|
||||||
|
/*! function to enable a grammar to the asr interface */
|
||||||
|
switch_status_t (*asr_enable_grammar) (switch_asr_handle_t *ah, const char *name);
|
||||||
|
/*! function to disable a grammar to the asr interface */
|
||||||
|
switch_status_t (*asr_disable_grammar) (switch_asr_handle_t *ah, const char *name);
|
||||||
|
/*! function to disable all grammars to the asr interface */
|
||||||
|
switch_status_t (*asr_disable_all_grammars) (switch_asr_handle_t *ah);
|
||||||
|
/*! function to feed DTMF to the ASR */
|
||||||
|
switch_status_t (*asr_feed_dtmf) (switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! an abstract representation of an asr speech interface. */
|
/*! an abstract representation of an asr speech interface. */
|
||||||
|
|
|
@ -49,7 +49,7 @@ typedef enum {
|
||||||
SWITCH_NAT_TCP
|
SWITCH_NAT_TCP
|
||||||
} switch_nat_ip_proto_t;
|
} switch_nat_ip_proto_t;
|
||||||
|
|
||||||
|
SWITCH_DECLARE(const char *) switch_nat_get_type(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Initilize the NAT Traversal System
|
\brief Initilize the NAT Traversal System
|
||||||
|
|
|
@ -2625,8 +2625,10 @@ SWITCH_STANDARD_API(cc_config_api_function)
|
||||||
cc_queue_t *queue = NULL;
|
cc_queue_t *queue = NULL;
|
||||||
if ((queue = get_queue(queue_name))) {
|
if ((queue = get_queue(queue_name))) {
|
||||||
queue_rwunlock(queue);
|
queue_rwunlock(queue);
|
||||||
|
stream->write_function(stream, "%s", "+OK\n");
|
||||||
|
} else {
|
||||||
|
stream->write_function(stream, "%s", "-ERR Invalid Queue not found!\n");
|
||||||
}
|
}
|
||||||
stream->write_function(stream, "%s", "+OK\n");
|
|
||||||
}
|
}
|
||||||
} else if (action && !strcasecmp(action, "unload")) {
|
} else if (action && !strcasecmp(action, "unload")) {
|
||||||
if (argc-initial_argc < 1) {
|
if (argc-initial_argc < 1) {
|
||||||
|
@ -2648,8 +2650,10 @@ SWITCH_STANDARD_API(cc_config_api_function)
|
||||||
destroy_queue(queue_name, SWITCH_FALSE);
|
destroy_queue(queue_name, SWITCH_FALSE);
|
||||||
if ((queue = get_queue(queue_name))) {
|
if ((queue = get_queue(queue_name))) {
|
||||||
queue_rwunlock(queue);
|
queue_rwunlock(queue);
|
||||||
|
stream->write_function(stream, "%s", "+OK\n");
|
||||||
|
} else {
|
||||||
|
stream->write_function(stream, "%s", "-ERR Invalid Queue not found!\n");
|
||||||
}
|
}
|
||||||
stream->write_function(stream, "%s", "+OK\n");
|
|
||||||
}
|
}
|
||||||
} else if (action && !strcasecmp(action, "list")) {
|
} else if (action && !strcasecmp(action, "list")) {
|
||||||
if (argc-initial_argc < 1) {
|
if (argc-initial_argc < 1) {
|
||||||
|
@ -2671,7 +2675,6 @@ SWITCH_STANDARD_API(cc_config_api_function)
|
||||||
goto done;
|
goto done;
|
||||||
} else {
|
} else {
|
||||||
const char *queue_name = argv[0 + initial_argc];
|
const char *queue_name = argv[0 + initial_argc];
|
||||||
|
|
||||||
struct list_result cbt;
|
struct list_result cbt;
|
||||||
cbt.row_process = 0;
|
cbt.row_process = 0;
|
||||||
cbt.stream = stream;
|
cbt.stream = stream;
|
||||||
|
|
|
@ -349,7 +349,7 @@ SWITCH_STANDARD_API(timer_test_function)
|
||||||
|
|
||||||
SWITCH_STANDARD_API(group_call_function)
|
SWITCH_STANDARD_API(group_call_function)
|
||||||
{
|
{
|
||||||
char *domain;
|
char *domain, *dup_domain = NULL;
|
||||||
char *group_name = NULL;
|
char *group_name = NULL;
|
||||||
char *flags;
|
char *flags;
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
|
@ -392,7 +392,9 @@ SWITCH_STANDARD_API(group_call_function)
|
||||||
if (domain) {
|
if (domain) {
|
||||||
*domain++ = '\0';
|
*domain++ = '\0';
|
||||||
} else {
|
} else {
|
||||||
domain = switch_core_get_variable("domain");
|
if ((dup_domain = switch_core_get_variable_dup("domain"))) {
|
||||||
|
domain = dup_domain;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!zstr(domain)) {
|
if (!zstr(domain)) {
|
||||||
|
@ -544,13 +546,14 @@ SWITCH_STANDARD_API(group_call_function)
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
||||||
switch_safe_free(group_name);
|
switch_safe_free(group_name);
|
||||||
|
switch_safe_free(dup_domain);
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
stream->write_function(stream, "error/NO_ROUTE_DESTINATION");
|
stream->write_function(stream, "error/NO_ROUTE_DESTINATION");
|
||||||
}
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
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;
|
switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group;
|
||||||
int argc;
|
int argc;
|
||||||
char *mydata = NULL, *argv[2], *user, *domain;
|
char *mydata = NULL, *argv[2], *user, *domain, *dup_domain = NULL;
|
||||||
char delim = ',';
|
char delim = ',';
|
||||||
switch_event_t *params = NULL;
|
switch_event_t *params = NULL;
|
||||||
const char *rval = "false";
|
const char *rval = "false";
|
||||||
|
@ -579,7 +582,9 @@ SWITCH_STANDARD_API(in_group_function)
|
||||||
if ((domain = strchr(user, '@'))) {
|
if ((domain = strchr(user, '@'))) {
|
||||||
*domain++ = '\0';
|
*domain++ = '\0';
|
||||||
} else {
|
} 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);
|
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||||
|
@ -601,6 +606,7 @@ SWITCH_STANDARD_API(in_group_function)
|
||||||
|
|
||||||
switch_xml_free(xml);
|
switch_xml_free(xml);
|
||||||
switch_safe_free(mydata);
|
switch_safe_free(mydata);
|
||||||
|
switch_safe_free(dup_domain);
|
||||||
switch_event_destroy(¶ms);
|
switch_event_destroy(¶ms);
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
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;
|
switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params;
|
||||||
int argc;
|
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 = ' ';
|
char delim = ' ';
|
||||||
const char *container = "params", *elem = "param";
|
const char *container = "params", *elem = "param";
|
||||||
const char *result = NULL;
|
const char *result = NULL;
|
||||||
|
@ -631,7 +637,9 @@ SWITCH_STANDARD_API(user_data_function)
|
||||||
if ((domain = strchr(user, '@'))) {
|
if ((domain = strchr(user, '@'))) {
|
||||||
*domain++ = '\0';
|
*domain++ = '\0';
|
||||||
} else {
|
} else {
|
||||||
if (!(domain = switch_core_get_variable("domain"))) {
|
if ((dup_domain = switch_core_get_variable("domain"))) {
|
||||||
|
domain = dup_domain;
|
||||||
|
} else {
|
||||||
domain = "cluecon.com";
|
domain = "cluecon.com";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -694,6 +702,7 @@ SWITCH_STANDARD_API(user_data_function)
|
||||||
}
|
}
|
||||||
switch_xml_free(xml);
|
switch_xml_free(xml);
|
||||||
switch_safe_free(mydata);
|
switch_safe_free(mydata);
|
||||||
|
switch_safe_free(dup_domain);
|
||||||
switch_event_destroy(¶ms);
|
switch_event_destroy(¶ms);
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -4375,7 +4384,9 @@ SWITCH_STANDARD_API(global_getvar_function)
|
||||||
if (zstr(cmd)) {
|
if (zstr(cmd)) {
|
||||||
switch_core_dump_variables(stream);
|
switch_core_dump_variables(stream);
|
||||||
} else {
|
} 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;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -4428,19 +4439,23 @@ SWITCH_STANDARD_API(strftime_tz_api_function)
|
||||||
|
|
||||||
if ((format = strchr(mycmd, ' '))) {
|
if ((format = strchr(mycmd, ' '))) {
|
||||||
*format++ = '\0';
|
*format++ = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
if ((p = strchr(format, '|'))) {
|
if (format && (p = strchr(format, '|'))) {
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
when = atol(format);
|
when = atol(format);
|
||||||
format = p;
|
format = p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_strftime_tz(tz_name, format, date, sizeof(date), when * 1000000) == SWITCH_STATUS_SUCCESS) { /* The lookup of the zone may fail. */
|
if (zstr(format)) {
|
||||||
|
format = "%Y-%m-%d";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (format && switch_strftime_tz(tz_name, format, date, sizeof(date), when * 1000000) == SWITCH_STATUS_SUCCESS) { /* The lookup of the zone may fail. */
|
||||||
stream->write_function(stream, "%s", date);
|
stream->write_function(stream, "%s", date);
|
||||||
} else {
|
} else {
|
||||||
stream->write_function(stream, "-ERR Invalid Timezone\n");
|
stream->write_function(stream, "-ERR Invalid Timezone/Format\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_safe_free(mycmd);
|
switch_safe_free(mycmd);
|
||||||
|
|
|
@ -3778,6 +3778,7 @@ static void conference_xlist(conference_obj_t *conference, switch_xml_t x_confer
|
||||||
switch_xml_set_attr_d(x_conference, "member-count", ival);
|
switch_xml_set_attr_d(x_conference, "member-count", ival);
|
||||||
switch_snprintf(i, sizeof(i), "%u", conference->rate);
|
switch_snprintf(i, sizeof(i), "%u", conference->rate);
|
||||||
switch_xml_set_attr_d(x_conference, "rate", ival);
|
switch_xml_set_attr_d(x_conference, "rate", ival);
|
||||||
|
switch_xml_set_attr_d(x_conference, "uuid", conference->uuid_str);
|
||||||
|
|
||||||
if (switch_test_flag(conference, CFLAG_LOCKED)) {
|
if (switch_test_flag(conference, CFLAG_LOCKED)) {
|
||||||
switch_xml_set_attr_d(x_conference, "locked", "true");
|
switch_xml_set_attr_d(x_conference, "locked", "true");
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
* Michael Murdock <mike at mmurdock dot org>
|
* Michael Murdock <mike at mmurdock dot org>
|
||||||
* Neal Horman <neal at wanlink dot com>
|
* Neal Horman <neal at wanlink dot com>
|
||||||
* Bret McDanel <trixter AT 0xdecafbad dot com>
|
* Bret McDanel <trixter AT 0xdecafbad dot com>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
* mod_dptools.c -- Raw Audio File Streaming Application Module
|
* mod_dptools.c -- Raw Audio File Streaming Application Module
|
||||||
*
|
*
|
||||||
|
@ -269,7 +270,7 @@ SWITCH_STANDARD_APP(bind_digit_action_function)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR pause OR resume OR stop OR param <name> <value>"
|
#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR grammaron/grammaroff <gram_name> OR grammarsalloff OR pause OR resume OR start_input_timers OR stop OR param <name> <value>"
|
||||||
SWITCH_STANDARD_APP(detect_speech_function)
|
SWITCH_STANDARD_APP(detect_speech_function)
|
||||||
{
|
{
|
||||||
char *argv[4];
|
char *argv[4];
|
||||||
|
@ -282,6 +283,12 @@ SWITCH_STANDARD_APP(detect_speech_function)
|
||||||
switch_ivr_detect_speech_load_grammar(session, argv[1], argv[2]);
|
switch_ivr_detect_speech_load_grammar(session, argv[1], argv[2]);
|
||||||
} else if (!strcasecmp(argv[0], "nogrammar")) {
|
} else if (!strcasecmp(argv[0], "nogrammar")) {
|
||||||
switch_ivr_detect_speech_unload_grammar(session, argv[1]);
|
switch_ivr_detect_speech_unload_grammar(session, argv[1]);
|
||||||
|
} else if (!strcasecmp(argv[0], "grammaron")) {
|
||||||
|
switch_ivr_detect_speech_enable_grammar(session, argv[1]);
|
||||||
|
} else if (!strcasecmp(argv[0], "grammaroff")) {
|
||||||
|
switch_ivr_detect_speech_disable_grammar(session, argv[1]);
|
||||||
|
} else if (!strcasecmp(argv[0], "grammarsalloff")) {
|
||||||
|
switch_ivr_detect_speech_disable_all_grammars(session);
|
||||||
} else if (!strcasecmp(argv[0], "pause")) {
|
} else if (!strcasecmp(argv[0], "pause")) {
|
||||||
switch_ivr_pause_detect_speech(session);
|
switch_ivr_pause_detect_speech(session);
|
||||||
} else if (!strcasecmp(argv[0], "resume")) {
|
} else if (!strcasecmp(argv[0], "resume")) {
|
||||||
|
@ -290,6 +297,8 @@ SWITCH_STANDARD_APP(detect_speech_function)
|
||||||
switch_ivr_stop_detect_speech(session);
|
switch_ivr_stop_detect_speech(session);
|
||||||
} else if (!strcasecmp(argv[0], "param")) {
|
} else if (!strcasecmp(argv[0], "param")) {
|
||||||
switch_ivr_set_param_detect_speech(session, argv[1], argv[2]);
|
switch_ivr_set_param_detect_speech(session, argv[1], argv[2]);
|
||||||
|
} else if (!strcasecmp(argv[0], "start_input_timers")) {
|
||||||
|
switch_ivr_detect_speech_start_input_timers(session);
|
||||||
} else if (argc >= 3) {
|
} else if (argc >= 3) {
|
||||||
switch_ivr_detect_speech(session, argv[0], argv[1], argv[2], argv[3], NULL);
|
switch_ivr_detect_speech(session, argv[0], argv[1], argv[2], argv[3], NULL);
|
||||||
}
|
}
|
||||||
|
@ -2765,7 +2774,7 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
|
||||||
switch_originate_flag_t myflags = SOF_NONE;
|
switch_originate_flag_t myflags = SOF_NONE;
|
||||||
char *cid_name_override = NULL;
|
char *cid_name_override = NULL;
|
||||||
char *cid_num_override = NULL;
|
char *cid_num_override = NULL;
|
||||||
char *domain = NULL;
|
char *domain = NULL, *dup_domain = NULL;
|
||||||
switch_channel_t *new_channel = NULL;
|
switch_channel_t *new_channel = NULL;
|
||||||
unsigned int timelimit = 60;
|
unsigned int timelimit = 60;
|
||||||
const char *skip, *var;
|
const char *skip, *var;
|
||||||
|
@ -2778,7 +2787,8 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
|
||||||
if ((domain = strchr(group, '@'))) {
|
if ((domain = strchr(group, '@'))) {
|
||||||
*domain++ = '\0';
|
*domain++ = '\0';
|
||||||
} else {
|
} 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) {
|
if (!domain) {
|
||||||
|
@ -2850,6 +2860,7 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
|
||||||
|
|
||||||
switch_safe_free(template);
|
switch_safe_free(template);
|
||||||
switch_safe_free(group);
|
switch_safe_free(group);
|
||||||
|
switch_safe_free(dup_domain);
|
||||||
|
|
||||||
if (cause == SWITCH_CAUSE_NONE) {
|
if (cause == SWITCH_CAUSE_NONE) {
|
||||||
cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
|
cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||||
|
@ -2878,7 +2889,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||||
switch_call_cause_t *cancel_cause)
|
switch_call_cause_t *cancel_cause)
|
||||||
{
|
{
|
||||||
switch_xml_t x_domain = NULL, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params;
|
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;
|
const char *dest = NULL;
|
||||||
static switch_call_cause_t cause = SWITCH_CAUSE_NONE;
|
static switch_call_cause_t cause = SWITCH_CAUSE_NONE;
|
||||||
unsigned int timelimit = 60;
|
unsigned int timelimit = 60;
|
||||||
|
@ -2899,7 +2910,8 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||||
if ((domain = strchr(user, '@'))) {
|
if ((domain = strchr(user, '@'))) {
|
||||||
*domain++ = '\0';
|
*domain++ = '\0';
|
||||||
} else {
|
} else {
|
||||||
domain = switch_core_get_variable("domain");
|
domain = switch_core_get_variable_dup("domain");
|
||||||
|
dup_domain = domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!domain) {
|
if (!domain) {
|
||||||
|
@ -3106,6 +3118,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_safe_free(user);
|
switch_safe_free(user);
|
||||||
|
switch_safe_free(dup_domain);
|
||||||
|
|
||||||
return cause;
|
return cause;
|
||||||
}
|
}
|
||||||
|
@ -3184,10 +3197,11 @@ static switch_status_t event_chat_send(const char *proto, const char *from, cons
|
||||||
if (body)
|
if (body)
|
||||||
switch_event_add_body(event, "%s", body);
|
switch_event_add_body(event, "%s", body);
|
||||||
if (to) {
|
if (to) {
|
||||||
const char *v;
|
char *v;
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "To", to);
|
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);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Command", v);
|
||||||
|
free(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3205,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)
|
const char *body, const char *type, const char *hint)
|
||||||
{
|
{
|
||||||
if (to) {
|
if (to) {
|
||||||
const char *v;
|
char *v = NULL;
|
||||||
switch_stream_handle_t stream = { 0 };
|
switch_stream_handle_t stream = { 0 };
|
||||||
char *cmd = NULL, *arg;
|
char *cmd = NULL, *arg;
|
||||||
|
|
||||||
if (!(v = switch_core_get_variable(to))) {
|
if (!(v = switch_core_get_variable_dup(to))) {
|
||||||
v = to;
|
v = strdup(to);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = strdup(v);
|
cmd = v;
|
||||||
switch_assert(cmd);
|
switch_assert(cmd);
|
||||||
|
|
||||||
switch_url_decode(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;
|
char *sp;
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
const char *app_var;
|
const char *app_var;
|
||||||
|
int total = 0;
|
||||||
|
|
||||||
switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA);
|
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) {
|
if (varname && val) {
|
||||||
|
total++;
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "%s setting FSK var [%s][%s]\n",
|
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_get_name(channel), varname, val);
|
||||||
switch_channel_set_variable(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;
|
char *app_arg;
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "%s processing execute_on_fsk [%s]\n",
|
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 */
|
/* 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);
|
rediskey = switch_core_session_sprintf(session, "%s_%s", realm, resource);
|
||||||
|
|
||||||
if ((pvt = switch_channel_get_private(channel, "limit_redis"))) {
|
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_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);
|
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) {
|
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_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);
|
switch_goto_status(SWITCH_STATUS_FALSE, end);
|
||||||
|
@ -193,7 +193,7 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
rediskey = switch_core_session_sprintf(session, "%s_%s", realm, resource);
|
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);
|
switch_core_hash_delete(pvt->hash, (const char *) rediskey);
|
||||||
|
|
||||||
if (credis_decr(redis, rediskey, &val) != 0) {
|
if (credis_decr(redis, rediskey, &val) != 0) {
|
||||||
|
@ -249,13 +249,13 @@ SWITCH_LIMIT_RESET(limit_reset_redis)
|
||||||
{
|
{
|
||||||
REDIS redis;
|
REDIS redis;
|
||||||
if (redis_factory(&redis) == SWITCH_STATUS_SUCCESS) {
|
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;
|
int dec = 0, val = 0, keyc;
|
||||||
char *uuids[2000];
|
char *uuids[2000];
|
||||||
|
|
||||||
if ((keyc = credis_keys(redis, rediskey, uuids, switch_arraylen(uuids))) > 0) {
|
if ((keyc = credis_keys(redis, rediskey, uuids, switch_arraylen(uuids))) > 0) {
|
||||||
int i = 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++){
|
for (i = 0; i < keyc && uuids[i]; i++){
|
||||||
const char *key = uuids[i] + hostnamelen;
|
const char *key = uuids[i] + hostnamelen;
|
||||||
|
|
|
@ -201,14 +201,14 @@ static void event_handler(switch_event_t *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(peer_session = switch_core_session_locate(peer_uuid))) {
|
if (!(peer_session = switch_core_session_locate(peer_uuid))) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cant locate peer session for uuid %s\n", peer_uuid);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't locate peer session for uuid %s\n", peer_uuid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
peer_channel = switch_core_session_get_channel(peer_session);
|
peer_channel = switch_core_session_get_channel(peer_session);
|
||||||
|
|
||||||
if (switch_event_create(&peer_event, SWITCH_EVENT_CHANNEL_BRIDGE) != SWITCH_STATUS_SUCCESS) {
|
if (switch_event_create(&peer_event, SWITCH_EVENT_CHANNEL_BRIDGE) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cant create bridge event for peer channel %s\n", peer_uuid);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't create bridge event for peer channel %s\n", peer_uuid);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ SWITCH_STANDARD_APP(userspy_function)
|
||||||
status = switch_core_hash_insert(globals.spy_hash, argv[0], (void *) uuid);
|
status = switch_core_hash_insert(globals.spy_hash, argv[0], (void *) uuid);
|
||||||
|
|
||||||
if ((status != SWITCH_STATUS_SUCCESS)) {
|
if ((status != SWITCH_STATUS_SUCCESS)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cant insert to spy hash\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Can't insert to spy hash\n");
|
||||||
switch_channel_hangup(channel, SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED);
|
switch_channel_hangup(channel, SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED);
|
||||||
switch_thread_rwlock_unlock(globals.spy_hash_lock);
|
switch_thread_rwlock_unlock(globals.spy_hash_lock);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1277,9 +1277,13 @@ static void message_count(vm_profile_t *profile, const char *id_in, const char *
|
||||||
|
|
||||||
myid = resolve_id(id_in, domain_name, "message-count");
|
myid = resolve_id(id_in, domain_name, "message-count");
|
||||||
|
|
||||||
switch_snprintf(sql, sizeof(sql),
|
switch_snprintf(sql, sizeof(sql), "select 1, read_flags, count(read_epoch) from voicemail_msgs where "
|
||||||
"select read_epoch=0, read_flags, count(read_epoch) from voicemail_msgs where username='%s' and domain='%s' and in_folder='%s' group by read_epoch=0,read_flags;",
|
"username='%s' and domain='%s' and in_folder='%s' "
|
||||||
myid, domain_name, myfolder);
|
"and read_epoch=0 group by read_flags union select 0, read_flags, count(read_epoch) from voicemail_msgs where username='%s' "
|
||||||
|
"and domain='%s' and in_folder='%s' and read_epoch<>0 group by read_flags;",
|
||||||
|
myid, domain_name, myfolder, myid, domain_name, myfolder);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vm_execute_sql_callback(profile, profile->mutex, sql, message_count_callback, &cbt);
|
vm_execute_sql_callback(profile, profile->mutex, sql, message_count_callback, &cbt);
|
||||||
|
|
||||||
|
@ -2734,6 +2738,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
|
||||||
switch_memory_pool_t *pool = NULL;
|
switch_memory_pool_t *pool = NULL;
|
||||||
char *forwarded_by = NULL;
|
char *forwarded_by = NULL;
|
||||||
char *read_flags = NORMAL_FLAG_STRING;
|
char *read_flags = NORMAL_FLAG_STRING;
|
||||||
|
char *dup_domain = NULL;
|
||||||
|
|
||||||
if (zstr(data)) {
|
if (zstr(data)) {
|
||||||
status = SWITCH_STATUS_FALSE;
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
@ -2781,7 +2786,9 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zstr(domain)) {
|
if (zstr(domain)) {
|
||||||
domain = switch_core_get_variable("domain");
|
if ((dup_domain = switch_core_get_variable_dup("domain"))) {
|
||||||
|
domain = dup_domain;
|
||||||
|
}
|
||||||
profile_name = domain;
|
profile_name = domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2915,6 +2922,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
|
||||||
end:
|
end:
|
||||||
|
|
||||||
switch_safe_free(dup);
|
switch_safe_free(dup);
|
||||||
|
switch_safe_free(dup_domain);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
*
|
*
|
||||||
* Brian West <brian@freeswitch.org>
|
* Brian West <brian@freeswitch.org>
|
||||||
* Christopher M. Rienzo <chris@rienzo.net>
|
* Christopher M. Rienzo <chris@rienzo.net>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
* mod_unimrcp.c -- UniMRCP module (MRCP client)
|
* mod_unimrcp.c -- UniMRCP module (MRCP client)
|
||||||
*
|
*
|
||||||
|
@ -48,6 +49,7 @@
|
||||||
#include "mrcp_resource_loader.h"
|
#include "mrcp_resource_loader.h"
|
||||||
#include "mpf_engine.h"
|
#include "mpf_engine.h"
|
||||||
#include "mpf_codec_manager.h"
|
#include "mpf_codec_manager.h"
|
||||||
|
#include "mpf_dtmf_generator.h"
|
||||||
#include "mpf_rtp_termination_factory.h"
|
#include "mpf_rtp_termination_factory.h"
|
||||||
#include "mrcp_sofiasip_client_agent.h"
|
#include "mrcp_sofiasip_client_agent.h"
|
||||||
#include "mrcp_unirtsp_client_agent.h"
|
#include "mrcp_unirtsp_client_agent.h"
|
||||||
|
@ -258,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_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_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_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);
|
static switch_status_t audio_queue_destroy(audio_queue_t *queue);
|
||||||
|
|
||||||
/*********************************************************************************************************************************************
|
/*********************************************************************************************************************************************
|
||||||
|
@ -285,6 +288,8 @@ enum speech_channel_state {
|
||||||
SPEECH_CHANNEL_READY,
|
SPEECH_CHANNEL_READY,
|
||||||
/** processing speech request */
|
/** processing speech request */
|
||||||
SPEECH_CHANNEL_PROCESSING,
|
SPEECH_CHANNEL_PROCESSING,
|
||||||
|
/** finished processing speech request */
|
||||||
|
SPEECH_CHANNEL_DONE,
|
||||||
/** error opening channel */
|
/** error opening channel */
|
||||||
SPEECH_CHANNEL_ERROR
|
SPEECH_CHANNEL_ERROR
|
||||||
};
|
};
|
||||||
|
@ -433,14 +438,20 @@ static const char *grammar_type_to_mime(grammar_type_t type, profile_t *profile)
|
||||||
struct recognizer_data {
|
struct recognizer_data {
|
||||||
/** the available grammars */
|
/** the available grammars */
|
||||||
switch_hash_t *grammars;
|
switch_hash_t *grammars;
|
||||||
/** the last grammar used (for pause/resume) */
|
/** the enabled grammars */
|
||||||
grammar_t *last_grammar;
|
switch_hash_t *enabled_grammars;
|
||||||
/** recognize result */
|
/** recognize result */
|
||||||
char *result;
|
char *result;
|
||||||
/** true, if voice has started */
|
/** true, if voice has started */
|
||||||
int start_of_input;
|
int start_of_input;
|
||||||
/** true, if input timers have started */
|
/** true, if input timers have started */
|
||||||
int timers_started;
|
int timers_started;
|
||||||
|
/** UniMRCP mpf stream */
|
||||||
|
mpf_audio_stream_t *unimrcp_stream;
|
||||||
|
/** DTMF generator */
|
||||||
|
mpf_dtmf_generator_t *dtmf_generator;
|
||||||
|
/** true, if presently transmitting DTMF */
|
||||||
|
char dtmf_generator_active;
|
||||||
};
|
};
|
||||||
typedef struct recognizer_data recognizer_data_t;
|
typedef struct recognizer_data recognizer_data_t;
|
||||||
|
|
||||||
|
@ -451,8 +462,12 @@ static switch_status_t recog_shutdown();
|
||||||
static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags);
|
static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags);
|
||||||
static switch_status_t recog_asr_load_grammar(switch_asr_handle_t *ah, const char *grammar, const char *name);
|
static switch_status_t recog_asr_load_grammar(switch_asr_handle_t *ah, const char *grammar, const char *name);
|
||||||
static switch_status_t recog_asr_unload_grammar(switch_asr_handle_t *ah, const char *name);
|
static switch_status_t recog_asr_unload_grammar(switch_asr_handle_t *ah, const char *name);
|
||||||
|
static switch_status_t recog_asr_enable_grammar(switch_asr_handle_t *ah, const char *name);
|
||||||
|
static switch_status_t recog_asr_disable_grammar(switch_asr_handle_t *ah, const char *name);
|
||||||
|
static switch_status_t recog_asr_disable_all_grammars(switch_asr_handle_t *ah);
|
||||||
static switch_status_t recog_asr_close(switch_asr_handle_t *ah, switch_asr_flag_t *flags);
|
static switch_status_t recog_asr_close(switch_asr_handle_t *ah, switch_asr_flag_t *flags);
|
||||||
static switch_status_t recog_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
|
static switch_status_t recog_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
|
||||||
|
static switch_status_t recog_asr_feed_dtmf(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags);
|
||||||
#if 0
|
#if 0
|
||||||
static switch_status_t recog_asr_start(switch_asr_handle_t *ah, const char *name);
|
static switch_status_t recog_asr_start(switch_asr_handle_t *ah, const char *name);
|
||||||
#endif
|
#endif
|
||||||
|
@ -468,12 +483,16 @@ static void recog_asr_float_param(switch_asr_handle_t *ah, char *param, double v
|
||||||
/* recognizer's interface for UniMRCP */
|
/* recognizer's interface for UniMRCP */
|
||||||
static apt_bool_t recog_message_handler(const mrcp_app_message_t *app_message);
|
static apt_bool_t recog_message_handler(const mrcp_app_message_t *app_message);
|
||||||
static apt_bool_t recog_on_message_receive(mrcp_application_t *application, mrcp_session_t *session, mrcp_channel_t *channel, mrcp_message_t *message);
|
static apt_bool_t recog_on_message_receive(mrcp_application_t *application, mrcp_session_t *session, mrcp_channel_t *channel, mrcp_message_t *message);
|
||||||
|
static apt_bool_t recog_stream_open(mpf_audio_stream_t *stream, mpf_codec_t *codec);
|
||||||
static apt_bool_t recog_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *frame);
|
static apt_bool_t recog_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *frame);
|
||||||
|
|
||||||
/* recognizer specific speech_channel_funcs */
|
/* recognizer specific speech_channel_funcs */
|
||||||
static switch_status_t recog_channel_start(speech_channel_t *schannel, const char *name);
|
static switch_status_t recog_channel_start(speech_channel_t *schannel);
|
||||||
static switch_status_t recog_channel_load_grammar(speech_channel_t *schannel, const char *name, grammar_type_t type, const char *data);
|
static switch_status_t recog_channel_load_grammar(speech_channel_t *schannel, const char *name, grammar_type_t type, const char *data);
|
||||||
static switch_status_t recog_channel_unload_grammar(speech_channel_t *schannel, const char *name);
|
static switch_status_t recog_channel_unload_grammar(speech_channel_t *schannel, const char *name);
|
||||||
|
static switch_status_t recog_channel_enable_grammar(speech_channel_t *schannel, const char *name);
|
||||||
|
static switch_status_t recog_channel_disable_grammar(speech_channel_t *schannel, const char *name);
|
||||||
|
static switch_status_t recog_channel_disable_all_grammars(speech_channel_t *schannel);
|
||||||
static switch_status_t recog_channel_check_results(speech_channel_t *schannel);
|
static switch_status_t recog_channel_check_results(speech_channel_t *schannel);
|
||||||
static switch_status_t recog_channel_set_start_of_input(speech_channel_t *schannel);
|
static switch_status_t recog_channel_set_start_of_input(speech_channel_t *schannel);
|
||||||
static switch_status_t recog_channel_start_input_timers(speech_channel_t *schannel);
|
static switch_status_t recog_channel_start_input_timers(speech_channel_t *schannel);
|
||||||
|
@ -651,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)
|
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;
|
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);
|
switch_mutex_lock(queue->mutex);
|
||||||
|
|
||||||
#ifdef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
|
#ifdef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
|
||||||
switch_size_t len = *data_len;
|
|
||||||
if (queue->file_write) {
|
if (queue->file_write) {
|
||||||
switch_file_write(queue->file_write, data, &len);
|
switch_file_write(queue->file_write, data, &len);
|
||||||
}
|
}
|
||||||
|
@ -692,6 +713,9 @@ static switch_status_t audio_queue_read(audio_queue_t *queue, void *data, switch
|
||||||
{
|
{
|
||||||
switch_size_t requested = *data_len;
|
switch_size_t requested = *data_len;
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
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);
|
switch_mutex_lock(queue->mutex);
|
||||||
|
|
||||||
/* wait for data, if allowed */
|
/* wait for data, if allowed */
|
||||||
|
@ -720,7 +744,6 @@ static switch_status_t audio_queue_read(audio_queue_t *queue, void *data, switch
|
||||||
#ifdef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
|
#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,
|
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);
|
queue->read_bytes, *data_len, requested);
|
||||||
switch_size_t len = *data_len;
|
|
||||||
if (queue->file_read) {
|
if (queue->file_read) {
|
||||||
switch_file_write(queue->file_read, data, &len);
|
switch_file_write(queue->file_read, data, &len);
|
||||||
}
|
}
|
||||||
|
@ -747,6 +770,20 @@ static switch_status_t audio_queue_clear(audio_queue_t *queue)
|
||||||
return SWITCH_STATUS_SUCCESS;
|
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
|
* Destroy the audio queue
|
||||||
*
|
*
|
||||||
|
@ -1325,6 +1362,8 @@ static switch_status_t speech_channel_stop(speech_channel_t *schannel)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) %s stopped\n", schannel->name, speech_channel_type_to_string(schannel->type));
|
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:
|
done:
|
||||||
|
@ -1422,9 +1461,19 @@ static switch_status_t speech_channel_read(speech_channel_t *schannel, void *dat
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_mutex_lock(schannel->mutex);
|
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);
|
audio_queue_read(schannel->audio_queue, data, len, block);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
status = SWITCH_STATUS_BREAK;
|
status = SWITCH_STATUS_BREAK;
|
||||||
}
|
}
|
||||||
switch_mutex_unlock(schannel->mutex);
|
switch_mutex_unlock(schannel->mutex);
|
||||||
|
@ -1447,6 +1496,8 @@ static const char *speech_channel_state_to_string(speech_channel_state_t state)
|
||||||
return "READY";
|
return "READY";
|
||||||
case SPEECH_CHANNEL_PROCESSING:
|
case SPEECH_CHANNEL_PROCESSING:
|
||||||
return "PROCESSING";
|
return "PROCESSING";
|
||||||
|
case SPEECH_CHANNEL_DONE:
|
||||||
|
return "DONE";
|
||||||
case SPEECH_CHANNEL_ERROR:
|
case SPEECH_CHANNEL_ERROR:
|
||||||
return "ERROR";
|
return "ERROR";
|
||||||
}
|
}
|
||||||
|
@ -1482,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) {
|
if (schannel->state == SPEECH_CHANNEL_PROCESSING && state != SPEECH_CHANNEL_PROCESSING) {
|
||||||
/* wake anyone waiting for audio data */
|
/* 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),
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) %s ==> %s\n", schannel->name, speech_channel_state_to_string(schannel->state),
|
||||||
|
@ -1635,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);
|
memset((uint8_t *) data + bytes_read, schannel->silence, *datalen - bytes_read);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
/* ready for next speak request */
|
||||||
|
speech_channel_set_state(schannel, SPEECH_CHANNEL_READY);
|
||||||
*datalen = 0;
|
*datalen = 0;
|
||||||
status = SWITCH_STATUS_BREAK;
|
status = SWITCH_STATUS_BREAK;
|
||||||
}
|
}
|
||||||
|
@ -1862,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) {
|
if (message->start_line.request_state == MRCP_REQUEST_STATE_COMPLETE) {
|
||||||
/* got COMPLETE */
|
/* got COMPLETE */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) COMPLETE\n", schannel->name);
|
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 {
|
} else {
|
||||||
/* received unexpected request state */
|
/* received unexpected request state */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) unexpected STOP response, request_state = %d\n", schannel->name,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) unexpected STOP response, request_state = %d\n", schannel->name,
|
||||||
|
@ -1880,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) {
|
if (message->start_line.method_id == SYNTHESIZER_SPEAK_COMPLETE) {
|
||||||
/* got SPEAK-COMPLETE */
|
/* got SPEAK-COMPLETE */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) SPEAK-COMPLETE\n", schannel->name);
|
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 {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) unexpected event, method_id = %d\n", schannel->name,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) unexpected event, method_id = %d\n", schannel->name,
|
||||||
(int) message->start_line.method_id);
|
(int) message->start_line.method_id);
|
||||||
|
@ -2055,19 +2108,24 @@ static const char *grammar_type_to_mime(grammar_type_t type, profile_t *profile)
|
||||||
* Start RECOGNIZE request
|
* Start RECOGNIZE request
|
||||||
*
|
*
|
||||||
* @param schannel the channel to start
|
* @param schannel the channel to start
|
||||||
* @param name the name of the grammar to use or NULL if to reuse the last grammar
|
|
||||||
* @return SWITCH_STATUS_SUCCESS if successful
|
* @return SWITCH_STATUS_SUCCESS if successful
|
||||||
*/
|
*/
|
||||||
static switch_status_t recog_channel_start(speech_channel_t *schannel, const char *name)
|
static switch_status_t recog_channel_start(speech_channel_t *schannel)
|
||||||
{
|
{
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
switch_hash_index_t *egk;
|
||||||
mrcp_message_t *mrcp_message;
|
mrcp_message_t *mrcp_message;
|
||||||
mrcp_recog_header_t *recog_header;
|
mrcp_recog_header_t *recog_header;
|
||||||
mrcp_generic_header_t *generic_header;
|
mrcp_generic_header_t *generic_header;
|
||||||
recognizer_data_t *r;
|
recognizer_data_t *r;
|
||||||
char *start_input_timers;
|
char *start_input_timers;
|
||||||
const char *mime_type;
|
const char *mime_type;
|
||||||
grammar_t *grammar = NULL;
|
char *key;
|
||||||
|
switch_size_t len;
|
||||||
|
grammar_t *grammar;
|
||||||
|
switch_size_t grammar_uri_count = 0;
|
||||||
|
switch_size_t grammar_uri_list_len = 0;
|
||||||
|
char *grammar_uri_list = NULL;
|
||||||
|
|
||||||
switch_mutex_lock(schannel->mutex);
|
switch_mutex_lock(schannel->mutex);
|
||||||
if (schannel->state != SPEECH_CHANNEL_READY) {
|
if (schannel->state != SPEECH_CHANNEL_READY) {
|
||||||
|
@ -2088,21 +2146,55 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel, const cha
|
||||||
start_input_timers = (char *) switch_core_hash_find(schannel->params, "start-input-timers");
|
start_input_timers = (char *) switch_core_hash_find(schannel->params, "start-input-timers");
|
||||||
r->timers_started = zstr(start_input_timers) || strcasecmp(start_input_timers, "false");
|
r->timers_started = zstr(start_input_timers) || strcasecmp(start_input_timers, "false");
|
||||||
|
|
||||||
/* get the cached grammar */
|
/* count enabled grammars */
|
||||||
if (zstr(name)) {
|
for (egk = switch_hash_first(NULL, r->enabled_grammars); egk; egk = switch_hash_next(egk)) {
|
||||||
grammar = r->last_grammar;
|
// NOTE: This postponed type check is necessary to allow a non-URI-list grammar to execute alone
|
||||||
} else {
|
if (grammar_uri_count == 1 && grammar->type != GRAMMAR_TYPE_URI)
|
||||||
grammar = (grammar_t *) switch_core_hash_find(r->grammars, name);
|
goto no_grammar_alone;
|
||||||
r->last_grammar = grammar;
|
++grammar_uri_count;
|
||||||
}
|
switch_hash_this(egk, (void *) &key, NULL, (void *) &grammar);
|
||||||
if (grammar == NULL) {
|
if (grammar->type != GRAMMAR_TYPE_URI && grammar_uri_count != 1) {
|
||||||
if (name) {
|
no_grammar_alone:
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Undefined grammar, %s\n", schannel->name, name);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Grammar '%s' can only be used alone (not a URI list)\n", schannel->name, key);
|
||||||
} else {
|
status = SWITCH_STATUS_FALSE;
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) No grammar specified\n", schannel->name);
|
goto done;
|
||||||
}
|
}
|
||||||
|
len = strlen(grammar->data);
|
||||||
|
if (!len)
|
||||||
|
continue;
|
||||||
|
grammar_uri_list_len += len;
|
||||||
|
if (grammar->data[len - 1] != '\n')
|
||||||
|
grammar_uri_list_len += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (grammar_uri_count) {
|
||||||
|
case 0:
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) No grammar specified\n", schannel->name);
|
||||||
status = SWITCH_STATUS_FALSE;
|
status = SWITCH_STATUS_FALSE;
|
||||||
goto done;
|
goto done;
|
||||||
|
case 1:
|
||||||
|
/* grammar should already be the unique grammar */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* get the enabled grammars list */
|
||||||
|
grammar_uri_list = switch_core_alloc(schannel->memory_pool, grammar_uri_list_len + 1);
|
||||||
|
grammar_uri_list_len = 0;
|
||||||
|
for (egk = switch_hash_first(NULL, r->enabled_grammars); egk; egk = switch_hash_next(egk)) {
|
||||||
|
switch_hash_this(egk, (void *) &key, NULL, (void *) &grammar);
|
||||||
|
len = strlen(grammar->data);
|
||||||
|
if (!len)
|
||||||
|
continue;
|
||||||
|
memcpy(&(grammar_uri_list[grammar_uri_list_len]), grammar->data, len);
|
||||||
|
grammar_uri_list_len += len;
|
||||||
|
if (grammar_uri_list[grammar_uri_list_len - 1] != '\n')
|
||||||
|
{
|
||||||
|
grammar_uri_list_len += 2;
|
||||||
|
grammar_uri_list[grammar_uri_list_len - 2] = '\r';
|
||||||
|
grammar_uri_list[grammar_uri_list_len - 1] = '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
grammar_uri_list[grammar_uri_list_len++] = '\0';
|
||||||
|
grammar = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create MRCP message */
|
/* create MRCP message */
|
||||||
|
@ -2120,7 +2212,7 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel, const cha
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set Content-Type */
|
/* set Content-Type */
|
||||||
mime_type = grammar_type_to_mime(grammar->type, schannel->profile);
|
mime_type = grammar_type_to_mime(grammar ? grammar->type : GRAMMAR_TYPE_URI, schannel->profile);
|
||||||
if (zstr(mime_type)) {
|
if (zstr(mime_type)) {
|
||||||
status = SWITCH_STATUS_FALSE;
|
status = SWITCH_STATUS_FALSE;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -2129,7 +2221,7 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel, const cha
|
||||||
mrcp_generic_header_property_add(mrcp_message, GENERIC_HEADER_CONTENT_TYPE);
|
mrcp_generic_header_property_add(mrcp_message, GENERIC_HEADER_CONTENT_TYPE);
|
||||||
|
|
||||||
/* set Content-ID for inline grammars */
|
/* set Content-ID for inline grammars */
|
||||||
if (grammar->type != GRAMMAR_TYPE_URI) {
|
if (grammar && grammar->type != GRAMMAR_TYPE_URI) {
|
||||||
apt_string_assign(&generic_header->content_id, grammar->name, mrcp_message->pool);
|
apt_string_assign(&generic_header->content_id, grammar->name, mrcp_message->pool);
|
||||||
mrcp_generic_header_property_add(mrcp_message, GENERIC_HEADER_CONTENT_ID);
|
mrcp_generic_header_property_add(mrcp_message, GENERIC_HEADER_CONTENT_ID);
|
||||||
}
|
}
|
||||||
|
@ -2151,7 +2243,7 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel, const cha
|
||||||
recog_channel_set_params(schannel, mrcp_message, generic_header, recog_header);
|
recog_channel_set_params(schannel, mrcp_message, generic_header, recog_header);
|
||||||
|
|
||||||
/* set message body */
|
/* set message body */
|
||||||
apt_string_assign(&mrcp_message->body, grammar->data, mrcp_message->pool);
|
apt_string_assign(&mrcp_message->body, grammar ? grammar->data : grammar_uri_list, mrcp_message->pool);
|
||||||
|
|
||||||
/* Empty audio queue and send RECOGNIZE to MRCP server */
|
/* Empty audio queue and send RECOGNIZE to MRCP server */
|
||||||
audio_queue_clear(schannel->audio_queue);
|
audio_queue_clear(schannel->audio_queue);
|
||||||
|
@ -2286,12 +2378,84 @@ static switch_status_t recog_channel_unload_grammar(speech_channel_t *schannel,
|
||||||
} else {
|
} else {
|
||||||
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Unloading grammar %s\n", schannel->name, grammar_name);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Unloading grammar %s\n", schannel->name, grammar_name);
|
||||||
|
switch_core_hash_delete(r->enabled_grammars, grammar_name);
|
||||||
switch_core_hash_delete(r->grammars, grammar_name);
|
switch_core_hash_delete(r->grammars, grammar_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable speech recognition grammar
|
||||||
|
*
|
||||||
|
* @param schannel the recognizer channel
|
||||||
|
* @param grammar_name the name of the grammar to enable
|
||||||
|
* @return SWITCH_STATUS_SUCCESS if successful
|
||||||
|
*/
|
||||||
|
static switch_status_t recog_channel_enable_grammar(speech_channel_t *schannel, const char *grammar_name)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
|
if (zstr(grammar_name)) {
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
} else {
|
||||||
|
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
||||||
|
grammar_t *grammar;
|
||||||
|
grammar = (grammar_t *) switch_core_hash_find(r->grammars, grammar_name);
|
||||||
|
if (grammar == NULL)
|
||||||
|
{
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Undefined grammar, %s\n", schannel->name, grammar_name);
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Enabling grammar %s\n", schannel->name, grammar_name);
|
||||||
|
switch_core_hash_insert(r->enabled_grammars, grammar_name, grammar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable speech recognition grammar
|
||||||
|
*
|
||||||
|
* @param schannel the recognizer channel
|
||||||
|
* @param grammar_name the name of the grammar to disable
|
||||||
|
* @return SWITCH_STATUS_SUCCESS if successful
|
||||||
|
*/
|
||||||
|
static switch_status_t recog_channel_disable_grammar(speech_channel_t *schannel, const char *grammar_name)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
|
if (zstr(grammar_name)) {
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
} else {
|
||||||
|
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Disabling grammar %s\n", schannel->name, grammar_name);
|
||||||
|
switch_core_hash_delete(r->enabled_grammars, grammar_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable all speech recognition grammars
|
||||||
|
*
|
||||||
|
* @param schannel the recognizer channel
|
||||||
|
* @return SWITCH_STATUS_SUCCESS if successful
|
||||||
|
*/
|
||||||
|
static switch_status_t recog_channel_disable_all_grammars(speech_channel_t *schannel)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
|
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Disabling all grammars\n", schannel->name);
|
||||||
|
switch_core_hash_destroy(&r->enabled_grammars);
|
||||||
|
switch_core_hash_init(&r->enabled_grammars, schannel->memory_pool);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if recognition is complete
|
* Check if recognition is complete
|
||||||
*
|
*
|
||||||
|
@ -2451,6 +2615,8 @@ static switch_status_t recog_channel_set_params(speech_channel_t *schannel, mrcp
|
||||||
if (id) {
|
if (id) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) \"%s\": \"%s\"\n", schannel->name, param_name, param_val);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) \"%s\": \"%s\"\n", schannel->name, param_name, param_val);
|
||||||
recog_channel_set_header(schannel, id->id, param_val, msg, recog_hdr);
|
recog_channel_set_header(schannel, id->id, param_val, msg, recog_hdr);
|
||||||
|
} else if (!strcasecmp(param_name, "start-recognize")) {
|
||||||
|
// This parameter is used internally only, not in MRCP headers
|
||||||
} else {
|
} else {
|
||||||
/* this is probably a vendor-specific MRCP param */
|
/* this is probably a vendor-specific MRCP param */
|
||||||
apt_str_t apt_param_name = { 0 };
|
apt_str_t apt_param_name = { 0 };
|
||||||
|
@ -2737,6 +2903,7 @@ static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec
|
||||||
schannel->data = r;
|
schannel->data = r;
|
||||||
memset(r, 0, sizeof(recognizer_data_t));
|
memset(r, 0, sizeof(recognizer_data_t));
|
||||||
switch_core_hash_init(&r->grammars, ah->memory_pool);
|
switch_core_hash_init(&r->grammars, ah->memory_pool);
|
||||||
|
switch_core_hash_init(&r->enabled_grammars, ah->memory_pool);
|
||||||
|
|
||||||
/* Open the channel */
|
/* Open the channel */
|
||||||
if (zstr(profile_name)) {
|
if (zstr(profile_name)) {
|
||||||
|
@ -2782,6 +2949,7 @@ static switch_status_t recog_asr_load_grammar(switch_asr_handle_t *ah, const cha
|
||||||
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
||||||
const char *grammar_data = NULL;
|
const char *grammar_data = NULL;
|
||||||
char *grammar_file_data = NULL;
|
char *grammar_file_data = NULL;
|
||||||
|
char *start_recognize;
|
||||||
switch_file_t *grammar_file = NULL;
|
switch_file_t *grammar_file = NULL;
|
||||||
switch_size_t grammar_file_size = 0, to_read = 0;
|
switch_size_t grammar_file_size = 0, to_read = 0;
|
||||||
grammar_type_t type = GRAMMAR_TYPE_UNKNOWN;
|
grammar_type_t type = GRAMMAR_TYPE_UNKNOWN;
|
||||||
|
@ -2886,7 +3054,19 @@ static switch_status_t recog_asr_load_grammar(switch_asr_handle_t *ah, const cha
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = recog_channel_start(schannel, name);
|
start_recognize = (char *) switch_core_hash_find(schannel->params, "start-recognize");
|
||||||
|
if (zstr(start_recognize) || strcasecmp(start_recognize, "false"))
|
||||||
|
{
|
||||||
|
if (recog_channel_disable_all_grammars(schannel) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (recog_channel_enable_grammar(schannel, name) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
status = recog_channel_start(schannel);
|
||||||
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
|
@ -2914,6 +3094,57 @@ static switch_status_t recog_asr_unload_grammar(switch_asr_handle_t *ah, const c
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process asr_enable_grammar request from FreeSWITCH.
|
||||||
|
*
|
||||||
|
* FreeSWITCH sends this request to enable recognition on this grammar.
|
||||||
|
* @param ah the FreeSWITCH speech recognition handle
|
||||||
|
* @param name the grammar name.
|
||||||
|
*/
|
||||||
|
static switch_status_t recog_asr_enable_grammar(switch_asr_handle_t *ah, const char *name)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
||||||
|
if (zstr(name) || speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS || recog_channel_enable_grammar(schannel, name) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process asr_disable_grammar request from FreeSWITCH.
|
||||||
|
*
|
||||||
|
* FreeSWITCH sends this request to disable recognition on this grammar.
|
||||||
|
* @param ah the FreeSWITCH speech recognition handle
|
||||||
|
* @param name the grammar name.
|
||||||
|
*/
|
||||||
|
static switch_status_t recog_asr_disable_grammar(switch_asr_handle_t *ah, const char *name)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
||||||
|
if (zstr(name) || speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS || recog_channel_disable_grammar(schannel, name) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process asr_disable_all_grammars request from FreeSWITCH.
|
||||||
|
*
|
||||||
|
* FreeSWITCH sends this request to disable recognition of all grammars.
|
||||||
|
* @param ah the FreeSWITCH speech recognition handle
|
||||||
|
* @param name the grammar name.
|
||||||
|
*/
|
||||||
|
static switch_status_t recog_asr_disable_all_grammars(switch_asr_handle_t *ah)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
||||||
|
if (speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS || recog_channel_disable_all_grammars(schannel) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process asr_close request from FreeSWITCH
|
* Process asr_close request from FreeSWITCH
|
||||||
*
|
*
|
||||||
|
@ -2928,6 +3159,10 @@ static switch_status_t recog_asr_close(switch_asr_handle_t *ah, switch_asr_flag_
|
||||||
speech_channel_stop(schannel);
|
speech_channel_stop(schannel);
|
||||||
speech_channel_destroy(schannel);
|
speech_channel_destroy(schannel);
|
||||||
switch_core_hash_destroy(&r->grammars);
|
switch_core_hash_destroy(&r->grammars);
|
||||||
|
switch_core_hash_destroy(&r->enabled_grammars);
|
||||||
|
if (r->dtmf_generator) {
|
||||||
|
mpf_dtmf_generator_destroy(r->dtmf_generator);
|
||||||
|
}
|
||||||
|
|
||||||
/* this lets FreeSWITCH's speech_thread know the handle is closed */
|
/* this lets FreeSWITCH's speech_thread know the handle is closed */
|
||||||
switch_set_flag(ah, SWITCH_ASR_FLAG_CLOSED);
|
switch_set_flag(ah, SWITCH_ASR_FLAG_CLOSED);
|
||||||
|
@ -2948,18 +3183,50 @@ static switch_status_t recog_asr_feed(switch_asr_handle_t *ah, void *data, unsig
|
||||||
return speech_channel_write(schannel, data, &slen);
|
return speech_channel_write(schannel, data, &slen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process asr_feed_dtmf request from FreeSWITCH
|
||||||
|
*
|
||||||
|
* @param ah the FreeSWITCH speech recognition handle
|
||||||
|
* @return SWITCH_STATUS_SUCCESS if successful
|
||||||
|
*/
|
||||||
|
static switch_status_t recog_asr_feed_dtmf(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags)
|
||||||
|
{
|
||||||
|
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
||||||
|
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
||||||
|
char digits[2];
|
||||||
|
|
||||||
|
if (!r->dtmf_generator) {
|
||||||
|
if (!r->unimrcp_stream) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Cannot queue DTMF: No UniMRCP stream object open\n", schannel->name);
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
r->dtmf_generator = mpf_dtmf_generator_create(r->unimrcp_stream, schannel->unimrcp_session->pool);
|
||||||
|
if (!r->dtmf_generator) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Cannot queue DTMF: Failed to create DTMF generator\n", schannel->name);
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
digits[0] = dtmf->digit;
|
||||||
|
digits[1] = '\0';
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Queued DTMF: %s\n", schannel->name, digits);
|
||||||
|
mpf_dtmf_generator_enqueue(r->dtmf_generator, digits);
|
||||||
|
r->dtmf_generator_active = 1;
|
||||||
|
|
||||||
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* Process asr_start request from FreeSWITCH
|
* Process asr_start request from FreeSWITCH
|
||||||
* @param ah the FreeSWITCH speech recognition handle
|
* @param ah the FreeSWITCH speech recognition handle
|
||||||
* @param name name of the grammar to use
|
|
||||||
* @return SWITCH_STATUS_SUCCESS if successful
|
* @return SWITCH_STATUS_SUCCESS if successful
|
||||||
*/
|
*/
|
||||||
static switch_status_t recog_asr_start(switch_asr_handle_t *ah, const char *name)
|
static switch_status_t recog_asr_start(switch_asr_handle_t *ah)
|
||||||
{
|
{
|
||||||
switch_status_t status;
|
switch_status_t status;
|
||||||
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
||||||
status = recog_channel_start(schannel, name);
|
status = recog_channel_start(schannel);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -2972,7 +3239,7 @@ static switch_status_t recog_asr_start(switch_asr_handle_t *ah, const char *name
|
||||||
static switch_status_t recog_asr_resume(switch_asr_handle_t *ah)
|
static switch_status_t recog_asr_resume(switch_asr_handle_t *ah)
|
||||||
{
|
{
|
||||||
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
|
||||||
return recog_channel_start(schannel, NULL);
|
return recog_channel_start(schannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3194,6 +3461,23 @@ static apt_bool_t recog_on_message_receive(mrcp_application_t *application, mrcp
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UniMRCP callback requesting open for speech recognition
|
||||||
|
*
|
||||||
|
* @param stream the UniMRCP stream
|
||||||
|
* @param codec the codec
|
||||||
|
* @return TRUE
|
||||||
|
*/
|
||||||
|
static apt_bool_t recog_stream_open(mpf_audio_stream_t *stream, mpf_codec_t *codec)
|
||||||
|
{
|
||||||
|
speech_channel_t *schannel = (speech_channel_t *) stream->obj;
|
||||||
|
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
||||||
|
|
||||||
|
r->unimrcp_stream = stream;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UniMRCP callback requesting next frame for speech recognition
|
* UniMRCP callback requesting next frame for speech recognition
|
||||||
*
|
*
|
||||||
|
@ -3204,6 +3488,7 @@ static apt_bool_t recog_on_message_receive(mrcp_application_t *application, mrcp
|
||||||
static apt_bool_t recog_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *frame)
|
static apt_bool_t recog_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *frame)
|
||||||
{
|
{
|
||||||
speech_channel_t *schannel = (speech_channel_t *) stream->obj;
|
speech_channel_t *schannel = (speech_channel_t *) stream->obj;
|
||||||
|
recognizer_data_t *r = (recognizer_data_t *) schannel->data;
|
||||||
switch_size_t to_read = frame->codec_frame.size;
|
switch_size_t to_read = frame->codec_frame.size;
|
||||||
|
|
||||||
/* grab the data. pad it if there isn't enough */
|
/* grab the data. pad it if there isn't enough */
|
||||||
|
@ -3213,6 +3498,13 @@ static apt_bool_t recog_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *fra
|
||||||
}
|
}
|
||||||
frame->type |= MEDIA_FRAME_TYPE_AUDIO;
|
frame->type |= MEDIA_FRAME_TYPE_AUDIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (r->dtmf_generator_active) {
|
||||||
|
if (!mpf_dtmf_generator_put_frame(r->dtmf_generator, frame)) {
|
||||||
|
if (!mpf_dtmf_generator_sending(r->dtmf_generator))
|
||||||
|
r->dtmf_generator_active = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -3231,8 +3523,12 @@ static switch_status_t recog_load(switch_loadable_module_interface_t *module_int
|
||||||
asr_interface->asr_open = recog_asr_open;
|
asr_interface->asr_open = recog_asr_open;
|
||||||
asr_interface->asr_load_grammar = recog_asr_load_grammar;
|
asr_interface->asr_load_grammar = recog_asr_load_grammar;
|
||||||
asr_interface->asr_unload_grammar = recog_asr_unload_grammar;
|
asr_interface->asr_unload_grammar = recog_asr_unload_grammar;
|
||||||
|
asr_interface->asr_enable_grammar = recog_asr_enable_grammar;
|
||||||
|
asr_interface->asr_disable_grammar = recog_asr_disable_grammar;
|
||||||
|
asr_interface->asr_disable_all_grammars = recog_asr_disable_all_grammars;
|
||||||
asr_interface->asr_close = recog_asr_close;
|
asr_interface->asr_close = recog_asr_close;
|
||||||
asr_interface->asr_feed = recog_asr_feed;
|
asr_interface->asr_feed = recog_asr_feed;
|
||||||
|
asr_interface->asr_feed_dtmf = recog_asr_feed_dtmf;
|
||||||
#if 0
|
#if 0
|
||||||
asr_interface->asr_start = recog_asr_start;
|
asr_interface->asr_start = recog_asr_start;
|
||||||
#endif
|
#endif
|
||||||
|
@ -3255,7 +3551,7 @@ static switch_status_t recog_load(switch_loadable_module_interface_t *module_int
|
||||||
globals.recog.dispatcher.on_channel_remove = speech_on_channel_remove;
|
globals.recog.dispatcher.on_channel_remove = speech_on_channel_remove;
|
||||||
globals.recog.dispatcher.on_message_receive = recog_on_message_receive;
|
globals.recog.dispatcher.on_message_receive = recog_on_message_receive;
|
||||||
globals.recog.audio_stream_vtable.destroy = NULL;
|
globals.recog.audio_stream_vtable.destroy = NULL;
|
||||||
globals.recog.audio_stream_vtable.open_rx = NULL;
|
globals.recog.audio_stream_vtable.open_rx = recog_stream_open;
|
||||||
globals.recog.audio_stream_vtable.close_rx = NULL;
|
globals.recog.audio_stream_vtable.close_rx = NULL;
|
||||||
globals.recog.audio_stream_vtable.read_frame = recog_stream_read;
|
globals.recog.audio_stream_vtable.read_frame = recog_stream_read;
|
||||||
globals.recog.audio_stream_vtable.open_tx = NULL;
|
globals.recog.audio_stream_vtable.open_tx = NULL;
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
switch_call_cause_t *cancel_cause)
|
||||||
{
|
{
|
||||||
const char *profile;
|
const char *profile;
|
||||||
|
char *dup_profile = NULL;
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
profile = switch_channel_get_variable(switch_core_session_get_channel(session), "sip_profile");
|
profile = switch_channel_get_variable(switch_core_session_get_channel(session), "sip_profile");
|
||||||
} else {
|
} else {
|
||||||
profile = switch_core_get_variable("sip_profile");
|
dup_profile = switch_core_get_variable_dup("sip_profile");
|
||||||
|
profile = dup_profile;
|
||||||
}
|
}
|
||||||
if (zstr(profile)) {
|
if (zstr(profile)) {
|
||||||
profile = "default";
|
profile = "default";
|
||||||
|
@ -323,6 +325,8 @@ static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
|
||||||
|
|
||||||
UNPROTECT_INTERFACE(sip_endpoint_interface);
|
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);
|
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")) {
|
} else if (!strcasecmp(var, "ext-rtp-ip")) {
|
||||||
char *ip = globals.guess_ip;
|
char *ip = globals.guess_ip;
|
||||||
if (val && !strcasecmp(val, "auto-nat")) {
|
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")) {
|
} else if (val && !strcasecmp(val, "auto")) {
|
||||||
globals.auto_nat = 0;
|
globals.auto_nat = 0;
|
||||||
ip = globals.guess_ip;
|
ip = globals.guess_ip;
|
||||||
|
@ -2523,7 +2523,7 @@ static switch_status_t load_config(void)
|
||||||
|
|
||||||
memset(&globals, 0, sizeof(globals));
|
memset(&globals, 0, sizeof(globals));
|
||||||
globals.running = 1;
|
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);
|
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"));
|
DBG(FUNC, PVT_FMT(_target, "option drop collect call is '%s'") % (Opt::_options._drop_collect_call() ? "yes" : "no"));
|
||||||
|
|
||||||
// get global filter configuration value
|
// 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));
|
confvalues.push_back(getTriStateValue(tmp_var));
|
||||||
DBG(FUNC, PVT_FMT(_target, "global KDropCollectCall was '%s'") % (tmp_var ? tmp_var : "(empty)"));
|
DBG(FUNC, PVT_FMT(_target, "global KDropCollectCall was '%s'") % (tmp_var ? tmp_var : "(empty)"));
|
||||||
|
switch_safe_free(tmp_var);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,11 +77,12 @@ struct private_object {
|
||||||
|
|
||||||
switch_frame_t cng_frame;
|
switch_frame_t cng_frame;
|
||||||
unsigned char cng_databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
unsigned char cng_databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
||||||
|
switch_timer_t timer;
|
||||||
switch_caller_profile_t *caller_profile;
|
switch_caller_profile_t *caller_profile;
|
||||||
int32_t bowout_frame_count;
|
int32_t bowout_frame_count;
|
||||||
char *other_uuid;
|
char *other_uuid;
|
||||||
switch_queue_t *frame_queue;
|
switch_queue_t *frame_queue;
|
||||||
switch_codec_implementation_t read_impl;
|
int64_t packet_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct private_object private_t;
|
typedef struct private_object private_t;
|
||||||
|
@ -111,6 +112,7 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses
|
||||||
int interval = 20;
|
int interval = 20;
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
const switch_codec_implementation_t *read_impl;
|
||||||
|
|
||||||
if (codec) {
|
if (codec) {
|
||||||
iananame = codec->implementation->iananame;
|
iananame = codec->implementation->iananame;
|
||||||
|
@ -165,7 +167,15 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses
|
||||||
switch_core_session_set_read_codec(session, &tech_pvt->read_codec);
|
switch_core_session_set_read_codec(session, &tech_pvt->read_codec);
|
||||||
switch_core_session_set_write_codec(session, &tech_pvt->write_codec);
|
switch_core_session_set_write_codec(session, &tech_pvt->write_codec);
|
||||||
|
|
||||||
tech_pvt->read_impl = *tech_pvt->read_codec.implementation;
|
if (tech_pvt->flag_mutex) {
|
||||||
|
switch_core_timer_destroy(&tech_pvt->timer);
|
||||||
|
}
|
||||||
|
|
||||||
|
read_impl = tech_pvt->read_codec.implementation;
|
||||||
|
|
||||||
|
switch_core_timer_init(&tech_pvt->timer, "soft",
|
||||||
|
read_impl->microseconds_per_packet / 1000, read_impl->samples_per_packet * 4, switch_core_session_get_pool(session));
|
||||||
|
|
||||||
|
|
||||||
if (!tech_pvt->flag_mutex) {
|
if (!tech_pvt->flag_mutex) {
|
||||||
switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
|
switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
|
||||||
|
@ -367,6 +377,7 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
|
||||||
tech_pvt = switch_core_session_get_private(session);
|
tech_pvt = switch_core_session_get_private(session);
|
||||||
|
|
||||||
if (tech_pvt) {
|
if (tech_pvt) {
|
||||||
|
switch_core_timer_destroy(&tech_pvt->timer);
|
||||||
|
|
||||||
if (switch_core_codec_ready(&tech_pvt->read_codec)) {
|
if (switch_core_codec_ready(&tech_pvt->read_codec)) {
|
||||||
switch_core_codec_destroy(&tech_pvt->read_codec);
|
switch_core_codec_destroy(&tech_pvt->read_codec);
|
||||||
|
@ -558,49 +569,31 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_core_timer_next(&tech_pvt->timer);
|
||||||
|
|
||||||
mutex = tech_pvt->mutex;
|
mutex = tech_pvt->mutex;
|
||||||
|
switch_mutex_lock(mutex);
|
||||||
|
|
||||||
|
if (switch_queue_trypop(tech_pvt->frame_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
|
||||||
if (switch_queue_pop_timeout(tech_pvt->frame_queue, &pop, tech_pvt->read_impl.microseconds_per_packet) == SWITCH_STATUS_SUCCESS && pop) {
|
|
||||||
if (tech_pvt->write_frame) {
|
if (tech_pvt->write_frame) {
|
||||||
switch_frame_free(&tech_pvt->write_frame);
|
switch_frame_free(&tech_pvt->write_frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
tech_pvt->write_frame = (switch_frame_t *) pop;
|
tech_pvt->write_frame = (switch_frame_t *) pop;
|
||||||
tech_pvt->write_frame->codec = &tech_pvt->read_codec;
|
tech_pvt->write_frame->codec = &tech_pvt->read_codec;
|
||||||
*frame = tech_pvt->write_frame;
|
*frame = tech_pvt->write_frame;
|
||||||
|
tech_pvt->packet_count++;
|
||||||
|
switch_clear_flag_locked(tech_pvt, TFLAG_CNG);
|
||||||
|
switch_clear_flag(tech_pvt->write_frame, SFF_CNG);
|
||||||
} else {
|
} else {
|
||||||
switch_set_flag(tech_pvt, TFLAG_CNG);
|
switch_set_flag(tech_pvt, TFLAG_CNG);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_mutex_lock(mutex);
|
|
||||||
|
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_CNG)) {
|
if (switch_test_flag(tech_pvt, TFLAG_CNG)) {
|
||||||
unsigned char data[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
|
||||||
uint32_t flag = 0;
|
|
||||||
switch_status_t encode_status;
|
|
||||||
uint32_t rate = tech_pvt->read_codec.implementation->actual_samples_per_second;
|
|
||||||
|
|
||||||
*frame = &tech_pvt->cng_frame;
|
*frame = &tech_pvt->cng_frame;
|
||||||
tech_pvt->cng_frame.codec = &tech_pvt->read_codec;
|
tech_pvt->cng_frame.codec = &tech_pvt->read_codec;
|
||||||
tech_pvt->cng_frame.datalen = tech_pvt->read_codec.implementation->decoded_bytes_per_packet;
|
tech_pvt->cng_frame.datalen = tech_pvt->read_codec.implementation->decoded_bytes_per_packet;
|
||||||
|
switch_set_flag((&tech_pvt->cng_frame), SFF_CNG);
|
||||||
memset(tech_pvt->cng_frame.data, 0, tech_pvt->cng_frame.datalen);
|
|
||||||
memset(&data, 0, tech_pvt->read_codec.implementation->decoded_bytes_per_packet);
|
|
||||||
|
|
||||||
if (strcasecmp(tech_pvt->read_codec.implementation->iananame, "L16")) {
|
|
||||||
encode_status = switch_core_codec_encode(&tech_pvt->read_codec,
|
|
||||||
NULL,
|
|
||||||
data,
|
|
||||||
tech_pvt->read_codec.implementation->decoded_bytes_per_packet,
|
|
||||||
tech_pvt->read_codec.implementation->actual_samples_per_second,
|
|
||||||
tech_pvt->cng_frame.data, &tech_pvt->cng_frame.datalen, &rate, &flag);
|
|
||||||
if (encode_status != SWITCH_STATUS_SUCCESS) {
|
|
||||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//switch_set_flag((&tech_pvt->cng_frame), SFF_CNG);
|
|
||||||
switch_clear_flag_locked(tech_pvt, TFLAG_CNG);
|
switch_clear_flag_locked(tech_pvt, TFLAG_CNG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,7 +625,10 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
|
||||||
tech_pvt = switch_core_session_get_private(session);
|
tech_pvt = switch_core_session_get_private(session);
|
||||||
switch_assert(tech_pvt != NULL);
|
switch_assert(tech_pvt != NULL);
|
||||||
|
|
||||||
if (switch_test_flag(frame, SFF_CNG) || switch_test_flag(tech_pvt, TFLAG_CNG) || (switch_test_flag(tech_pvt, TFLAG_BOWOUT) && switch_test_flag(tech_pvt, TFLAG_BOWOUT_USED))) {
|
if (switch_test_flag(frame, SFF_CNG) ||
|
||||||
|
switch_test_flag(tech_pvt, TFLAG_CNG) || (switch_test_flag(tech_pvt, TFLAG_BOWOUT) && switch_test_flag(tech_pvt, TFLAG_BOWOUT_USED))) {
|
||||||
|
switch_core_timer_sync(&tech_pvt->timer);
|
||||||
|
switch_core_timer_sync(&tech_pvt->other_tech_pvt->timer);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -765,6 +761,8 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
|
||||||
switch_frame_free(&frame);
|
switch_frame_free(&frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_core_timer_sync(&tech_pvt->timer);
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -68,6 +68,13 @@ struct PACKED keypad_button_message {
|
||||||
uint32_t call_id;
|
uint32_t call_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* EnblocCallMessage */
|
||||||
|
#define ENBLOC_CALL_MESSAGE 0x0004
|
||||||
|
struct PACKED enbloc_call_message {
|
||||||
|
char called_party[24];
|
||||||
|
uint32_t line_instance;
|
||||||
|
};
|
||||||
|
|
||||||
/* StimulusMessage */
|
/* StimulusMessage */
|
||||||
#define STIMULUS_MESSAGE 0x0005
|
#define STIMULUS_MESSAGE 0x0005
|
||||||
struct PACKED stimulus_message {
|
struct PACKED stimulus_message {
|
||||||
|
@ -562,6 +569,7 @@ union skinny_data {
|
||||||
struct register_message reg;
|
struct register_message reg;
|
||||||
struct port_message port;
|
struct port_message port;
|
||||||
struct keypad_button_message keypad_button;
|
struct keypad_button_message keypad_button;
|
||||||
|
struct enbloc_call_message enbloc_call;
|
||||||
struct stimulus_message stimulus;
|
struct stimulus_message stimulus;
|
||||||
struct off_hook_message off_hook;
|
struct off_hook_message off_hook;
|
||||||
struct on_hook_message on_hook;
|
struct on_hook_message on_hook;
|
||||||
|
|
|
@ -1171,6 +1171,29 @@ switch_status_t skinny_handle_keypad_button_message(listener_t *listener, skinny
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_status_t skinny_handle_enbloc_call_message(listener_t *listener, skinny_message_t *request)
|
||||||
|
{
|
||||||
|
uint32_t line_instance = 1;
|
||||||
|
switch_core_session_t *session = NULL;
|
||||||
|
|
||||||
|
skinny_check_data_length(request, sizeof(request->data.enbloc_call.called_party));
|
||||||
|
|
||||||
|
if(skinny_check_data_length_soft(request, sizeof(request->data.enbloc_call))) {
|
||||||
|
if (request->data.enbloc_call.line_instance > 0) {
|
||||||
|
line_instance = request->data.enbloc_call.line_instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
session = skinny_profile_find_session(listener->profile, listener, &line_instance, 0);
|
||||||
|
|
||||||
|
if(session) {
|
||||||
|
skinny_session_process_dest(session, listener, line_instance, request->data.enbloc_call.called_party, '\0', 0);
|
||||||
|
switch_core_session_rwunlock(session);
|
||||||
|
}
|
||||||
|
|
||||||
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_message_t *request)
|
switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_message_t *request)
|
||||||
{
|
{
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -2004,6 +2027,8 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re
|
||||||
return skinny_handle_port_message(listener, request);
|
return skinny_handle_port_message(listener, request);
|
||||||
case KEYPAD_BUTTON_MESSAGE:
|
case KEYPAD_BUTTON_MESSAGE:
|
||||||
return skinny_handle_keypad_button_message(listener, request);
|
return skinny_handle_keypad_button_message(listener, request);
|
||||||
|
case ENBLOC_CALL_MESSAGE:
|
||||||
|
return skinny_handle_enbloc_call_message(listener, request);
|
||||||
case STIMULUS_MESSAGE:
|
case STIMULUS_MESSAGE:
|
||||||
return skinny_handle_stimulus_message(listener, request);
|
return skinny_handle_stimulus_message(listener, request);
|
||||||
case OFF_HOOK_MESSAGE:
|
case OFF_HOOK_MESSAGE:
|
||||||
|
|
|
@ -39,6 +39,7 @@ struct skinny_table SKINNY_MESSAGE_TYPES[] = {
|
||||||
{"RegisterMessage", REGISTER_MESSAGE},
|
{"RegisterMessage", REGISTER_MESSAGE},
|
||||||
{"PortMessage", PORT_MESSAGE},
|
{"PortMessage", PORT_MESSAGE},
|
||||||
{"KeypadButtonMessage", KEYPAD_BUTTON_MESSAGE},
|
{"KeypadButtonMessage", KEYPAD_BUTTON_MESSAGE},
|
||||||
|
{"EnblocCallMessage", ENBLOC_CALL_MESSAGE},
|
||||||
{"StimulusMessage", STIMULUS_MESSAGE},
|
{"StimulusMessage", STIMULUS_MESSAGE},
|
||||||
{"OffHookMessage", OFF_HOOK_MESSAGE},
|
{"OffHookMessage", OFF_HOOK_MESSAGE},
|
||||||
{"OnHookMessage", ON_HOOK_MESSAGE},
|
{"OnHookMessage", ON_HOOK_MESSAGE},
|
||||||
|
|
|
@ -87,7 +87,7 @@ uint32_t func(const char *str)\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern struct skinny_table SKINNY_MESSAGE_TYPES[66];
|
extern struct skinny_table SKINNY_MESSAGE_TYPES[67];
|
||||||
const char *skinny_message_type2str(uint32_t id);
|
const char *skinny_message_type2str(uint32_t id);
|
||||||
uint32_t skinny_str2message_type(const char *str);
|
uint32_t skinny_str2message_type(const char *str);
|
||||||
#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
|
#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
|
||||||
|
|
|
@ -707,11 +707,20 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
|
||||||
cid = generate_pai_str(tech_pvt);
|
cid = generate_pai_str(tech_pvt);
|
||||||
|
|
||||||
|
|
||||||
if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) && tech_pvt->early_sdp && strcmp(tech_pvt->early_sdp, tech_pvt->local_sdp_str)) {
|
if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) && tech_pvt->early_sdp) {
|
||||||
/* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless
|
char *a, *b;
|
||||||
we do so in this case we will abandon the SOA rules and go rogue.
|
|
||||||
*/
|
/* start at the s= line to avoid some devices who update the o= between messages */
|
||||||
sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
|
a = strstr(tech_pvt->early_sdp, "s=");
|
||||||
|
b = strstr(tech_pvt->local_sdp_str, "s=");
|
||||||
|
|
||||||
|
if (!a || !b || strcmp(a, b)) {
|
||||||
|
|
||||||
|
/* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless
|
||||||
|
we do so in this case we will abandon the SOA rules and go rogue.
|
||||||
|
*/
|
||||||
|
sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sofia_use_soa(tech_pvt)) {
|
if (sofia_use_soa(tech_pvt)) {
|
||||||
|
@ -3494,7 +3503,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zstr(domain)) {
|
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;
|
if (!user) goto end;
|
||||||
|
@ -3794,7 +3803,7 @@ SWITCH_STANDARD_API(sofia_function)
|
||||||
|
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
if (strstr(argv[2], "presence")) {
|
if (strstr(argv[2], "presence")) {
|
||||||
mod_sofia_globals.debug_presence = 1;
|
mod_sofia_globals.debug_presence = 10;
|
||||||
stream->write_function(stream, "+OK Debugging presence\n");
|
stream->write_function(stream, "+OK Debugging presence\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4862,7 +4871,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
|
||||||
mod_sofia_globals.running = 1;
|
mod_sofia_globals.running = 1;
|
||||||
switch_mutex_unlock(mod_sofia_globals.mutex);
|
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.presence_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool);
|
||||||
switch_queue_create(&mod_sofia_globals.mwi_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, " : "");
|
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) {
|
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);
|
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);
|
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) {
|
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);
|
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]) {
|
if (!profile->rtpip[0]) {
|
||||||
profile->rtpip[profile->rtpip_index++] = switch_core_strdup(profile->pool, mod_sofia_globals.guess_ip);
|
profile->rtpip[profile->rtpip_index++] = switch_core_strdup(profile->pool, mod_sofia_globals.guess_ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_core_get_variable("nat_type")) {
|
if (switch_nat_get_type()) {
|
||||||
const char *ip = switch_core_get_variable("nat_public_addr");
|
char *ip = switch_core_get_variable_dup("nat_public_addr");
|
||||||
if (ip && !strchr(profile->sipip, ':')) {
|
if (ip && !strchr(profile->sipip, ':')) {
|
||||||
if (!profile->extrtpip) {
|
if (!profile->extrtpip) {
|
||||||
profile->extrtpip = switch_core_strdup(profile->pool, ip);
|
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);
|
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_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) {
|
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);
|
greedy = !!sofia_test_pflag(tech_pvt->profile, PFLAG_GREEDY);
|
||||||
scrooge = !!sofia_test_pflag(tech_pvt->profile, PFLAG_SCROOGE);
|
scrooge = !!sofia_test_pflag(tech_pvt->profile, PFLAG_SCROOGE);
|
||||||
|
|
||||||
if (!greedy || !scrooge) {
|
if ((val = switch_channel_get_variable(channel, "sip_codec_negotiation"))) {
|
||||||
if ((val = switch_channel_get_variable(channel, "sip_codec_negotiation"))) {
|
if (!strcasecmp(val, "generous")) {
|
||||||
if (!strcasecmp(val, "greedy")) {
|
greedy = 0;
|
||||||
greedy = 1;
|
scrooge = 0;
|
||||||
} else if (!strcasecmp(val, "scrooge")) {
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : generous\n" );
|
||||||
scrooge = 1;
|
} else if (!strcasecmp(val, "greedy")) {
|
||||||
greedy = 1;
|
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))) {
|
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;
|
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 */
|
/* nevermind */
|
||||||
match = 0;
|
match = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2570,6 +2570,19 @@ static int sofia_counterpath_crutch(void *pArg, int argc, char **argv, char **co
|
||||||
return 0;
|
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,
|
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[])
|
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] = "";
|
char expstr[30] = "";
|
||||||
long exp = 0, exp_delta = 3600;
|
long exp = 0, exp_delta = 3600;
|
||||||
char *pd_dup = NULL;
|
char *pd_dup = NULL;
|
||||||
int count = 1;
|
int count = 1, sub_count = 0;
|
||||||
char *contact_str;
|
char *contact_str;
|
||||||
int open = 1;
|
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);
|
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 */
|
/* 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);
|
event_type = sip_header_as_string(profile->home, (void *) sip->sip_event);
|
||||||
|
|
||||||
if (count < 2) {
|
if (count < 2) {
|
||||||
if ((sql =
|
if ((sql = switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' "
|
||||||
switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' "
|
" and profile_name='%q' and hostname='%q'",
|
||||||
" and profile_name='%q' and hostname='%q'", from_user, from_host, profile->name, mod_sofia_globals.hostname))) {
|
from_user, from_host, profile->name, mod_sofia_globals.hostname))) {
|
||||||
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
|
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sql =
|
if (sub_count > 0 && (sql = switch_mprintf("insert into sip_presence (sip_user, sip_host, status, rpid, expires, user_agent,"
|
||||||
switch_mprintf("insert into sip_presence (sip_user, sip_host, status, rpid, expires, user_agent,"
|
" profile_name, hostname, open_closed) "
|
||||||
" profile_name, hostname, open_closed) "
|
"values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')",
|
||||||
"values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')",
|
from_user, from_host, note_txt, rpid, exp, full_agent, profile->name,
|
||||||
from_user, from_host, note_txt, rpid, exp, full_agent, profile->name, mod_sofia_globals.hostname, open_closed))) {
|
mod_sofia_globals.hostname, open_closed))) {
|
||||||
|
|
||||||
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
|
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);
|
switch_safe_free(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sub_count > 0) {
|
||||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
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, "proto", SOFIA_CHAT_PROTO);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
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, "login", profile->url);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent", full_agent);
|
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(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, "status", note_txt);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);
|
||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event_type) {
|
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_snprintf(expstr, sizeof(expstr), "%d", exp_delta);
|
||||||
switch_stun_random_string(etag, 8, NULL);
|
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);
|
switch_safe_free(contact_str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,45 +37,95 @@
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include <libpq-fe.h>
|
#include <libpq-fe.h>
|
||||||
|
|
||||||
|
SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_pg_csv_load);
|
||||||
|
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_pg_csv_shutdown);
|
||||||
|
SWITCH_MODULE_DEFINITION(mod_cdr_pg_csv, mod_cdr_pg_csv_load, mod_cdr_pg_csv_shutdown, NULL);
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CDR_LEG_A = (1 << 0),
|
CDR_LEG_A = (1 << 0),
|
||||||
CDR_LEG_B = (1 << 1)
|
CDR_LEG_B = (1 << 1)
|
||||||
} cdr_leg_t;
|
} cdr_leg_t;
|
||||||
|
|
||||||
struct cdr_fd {
|
typedef enum {
|
||||||
|
SPOOL_FORMAT_CSV,
|
||||||
|
SPOOL_FORMAT_SQL
|
||||||
|
} spool_format_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
int fd;
|
int fd;
|
||||||
char *path;
|
char *path;
|
||||||
int64_t bytes;
|
int64_t bytes;
|
||||||
switch_mutex_t *mutex;
|
switch_mutex_t *mutex;
|
||||||
};
|
} cdr_fd_t;
|
||||||
typedef struct cdr_fd cdr_fd_t;
|
|
||||||
|
|
||||||
const char *default_template =
|
typedef struct {
|
||||||
"\"${local_ip_v4}\",\"${caller_id_name}\",\"${caller_id_number}\",\"${destination_number}\",\"${context}\",\"${start_stamp}\","
|
char *col_name;
|
||||||
"\"${answer_stamp}\",\"${end_stamp}\",\"${duration}\",\"${billsec}\",\"${hangup_cause}\",\"${uuid}\",\"${bleg_uuid}\",\"${accountcode}\","
|
char *var_name;
|
||||||
"\"${read_codec}\",\"${write_codec}\"";
|
switch_bool_t quote;
|
||||||
|
switch_bool_t not_null;
|
||||||
|
} cdr_field_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char *columns;
|
||||||
|
cdr_field_t fields[1];
|
||||||
|
} db_schema_t;
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
switch_memory_pool_t *pool;
|
switch_memory_pool_t *pool;
|
||||||
switch_hash_t *fd_hash;
|
switch_hash_t *fd_hash;
|
||||||
switch_hash_t *template_hash;
|
|
||||||
char *log_dir;
|
|
||||||
char *default_template;
|
|
||||||
int shutdown;
|
int shutdown;
|
||||||
int rotate;
|
|
||||||
int debug;
|
|
||||||
cdr_leg_t legs;
|
|
||||||
char *db_info;
|
char *db_info;
|
||||||
char *db_table;
|
char *db_table;
|
||||||
char *spool_format;
|
db_schema_t *db_schema;
|
||||||
PGconn *db_connection;
|
PGconn *db_connection;
|
||||||
int db_online;
|
|
||||||
switch_mutex_t *db_mutex;
|
switch_mutex_t *db_mutex;
|
||||||
} globals = { 0 };
|
int db_online;
|
||||||
|
cdr_leg_t legs;
|
||||||
|
char *spool_dir;
|
||||||
|
spool_format_t spool_format;
|
||||||
|
int rotate;
|
||||||
|
int debug;
|
||||||
|
} globals;
|
||||||
|
|
||||||
|
static switch_xml_config_enum_item_t config_opt_cdr_leg_enum[] = {
|
||||||
|
{"a", CDR_LEG_A},
|
||||||
|
{"b", CDR_LEG_B},
|
||||||
|
{"ab", CDR_LEG_A | CDR_LEG_B},
|
||||||
|
{NULL, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
static switch_xml_config_enum_item_t config_opt_spool_format_enum[] = {
|
||||||
|
{"csv", SPOOL_FORMAT_CSV},
|
||||||
|
{"sql", SPOOL_FORMAT_SQL},
|
||||||
|
{NULL, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
static switch_status_t config_validate_spool_dir(switch_xml_config_item_t *item, const char *newvalue, switch_config_callback_type_t callback_type, switch_bool_t changed)
|
||||||
|
{
|
||||||
|
if ((callback_type == CONFIG_LOAD || callback_type == CONFIG_RELOAD)) {
|
||||||
|
if (zstr(newvalue)) {
|
||||||
|
globals.spool_dir = switch_core_sprintf(globals.pool, "%s%scdr-pg-csv", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static switch_xml_config_item_t config_settings[] = {
|
||||||
|
/* key, type, flags, ptr, default_value, data, syntax, helptext */
|
||||||
|
SWITCH_CONFIG_ITEM_STRING_STRDUP("db-info", CONFIG_RELOADABLE, &globals.db_info, "dbname=cdr", NULL, NULL),
|
||||||
|
SWITCH_CONFIG_ITEM_STRING_STRDUP("db-table", CONFIG_RELOADABLE, &globals.db_table, "cdr", NULL, NULL),
|
||||||
|
SWITCH_CONFIG_ITEM("legs", SWITCH_CONFIG_ENUM, CONFIG_RELOADABLE, &globals.legs, (void *) CDR_LEG_A, &config_opt_cdr_leg_enum, "a|b|ab", NULL),
|
||||||
|
SWITCH_CONFIG_ITEM("spool-format", SWITCH_CONFIG_ENUM, CONFIG_RELOADABLE, &globals.spool_format, (void *) SPOOL_FORMAT_CSV, &config_opt_spool_format_enum, "csv|sql", "Disk spool format to use if SQL insert fails."),
|
||||||
|
SWITCH_CONFIG_ITEM("rotate-on-hup", SWITCH_CONFIG_BOOL, CONFIG_RELOADABLE, &globals.rotate, SWITCH_FALSE, NULL, NULL, NULL),
|
||||||
|
SWITCH_CONFIG_ITEM("debug", SWITCH_CONFIG_BOOL, CONFIG_RELOADABLE, &globals.debug, SWITCH_FALSE, NULL, NULL, NULL),
|
||||||
|
|
||||||
|
/* key, type, flags, ptr, defaultvalue, function, functiondata, syntax, helptext */
|
||||||
|
SWITCH_CONFIG_ITEM_CALLBACK("spool-dir", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, &globals.spool_dir, NULL, config_validate_spool_dir, NULL, NULL, NULL),
|
||||||
|
SWITCH_CONFIG_ITEM_END()
|
||||||
|
};
|
||||||
|
|
||||||
SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_pg_csv_load);
|
|
||||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_pg_csv_shutdown);
|
|
||||||
SWITCH_MODULE_DEFINITION(mod_cdr_pg_csv, mod_cdr_pg_csv_load, mod_cdr_pg_csv_shutdown, NULL);
|
|
||||||
|
|
||||||
static off_t fd_size(int fd)
|
static off_t fd_size(int fd)
|
||||||
{
|
{
|
||||||
|
@ -194,135 +244,13 @@ static void spool_cdr(const char *path, const char *log_line)
|
||||||
switch_safe_free(log_line_lf);
|
switch_safe_free(log_line_lf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static switch_status_t insert_cdr(const char * const template, const char * const cdr)
|
static switch_status_t insert_cdr(const char *values)
|
||||||
{
|
{
|
||||||
char *columns, *values;
|
|
||||||
char *p, *q;
|
|
||||||
unsigned vlen;
|
|
||||||
char *nullValues, *temp, *tp;
|
|
||||||
int nullCounter = 0, charCounter = 0;
|
|
||||||
char *sql = NULL, *path = NULL;
|
char *sql = NULL, *path = NULL;
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
|
|
||||||
if (!template || !*template || !cdr || !*cdr) {
|
sql = switch_mprintf("INSERT INTO %s (%s) VALUES (%s);", globals.db_table, globals.db_schema->columns, values);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Bad parameter\n");
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Build comma-separated list of field names by dropping $ { } ; chars */
|
|
||||||
switch_strdup(columns, template);
|
|
||||||
for (p = columns, q = columns; *p; ++p) {
|
|
||||||
switch (*p) {
|
|
||||||
case '$': case '"': case '{': case '}': case ';':
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
*q++ = *p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*q = '\0';
|
|
||||||
|
|
||||||
/*
|
|
||||||
* In the expanded vars, replace double quotes (") with single quotes (')
|
|
||||||
* for correct PostgreSQL syntax, and replace semi-colon with space to
|
|
||||||
* prevent SQL injection attacks
|
|
||||||
*/
|
|
||||||
switch_strdup(values, cdr);
|
|
||||||
for (p = values; *p; ++p) {
|
|
||||||
switch(*p) {
|
|
||||||
case '"':
|
|
||||||
*p = '\'';
|
|
||||||
break;
|
|
||||||
case ';':
|
|
||||||
*p = ' ';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
vlen = p - values;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Patch for changing empty strings ('') in the expanded variables to
|
|
||||||
* PostgreSQL null
|
|
||||||
*/
|
|
||||||
for (p = values; *p; ++p) {
|
|
||||||
if (*p == ',') {
|
|
||||||
if (charCounter == 0) {
|
|
||||||
nullCounter++;
|
|
||||||
}
|
|
||||||
charCounter = 0;
|
|
||||||
} else if (*p != ' ' && *p != '\'') {
|
|
||||||
charCounter++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (charCounter == 0) {
|
|
||||||
nullCounter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
nullCounter *= 4;
|
|
||||||
vlen += nullCounter;
|
|
||||||
switch_zmalloc(nullValues, strlen(values) + nullCounter + 1);
|
|
||||||
charCounter = 0;
|
|
||||||
temp = nullValues;
|
|
||||||
tp = nullValues;
|
|
||||||
|
|
||||||
for (p = values; *p; ++tp, ++p) {
|
|
||||||
if (*p == ',') {
|
|
||||||
if (charCounter == 0) {
|
|
||||||
temp++;
|
|
||||||
*temp = 'n';
|
|
||||||
temp++;
|
|
||||||
if (temp == tp) tp++;
|
|
||||||
*temp = 'u';
|
|
||||||
temp++;
|
|
||||||
if (temp == tp) tp++;
|
|
||||||
*temp = 'l';
|
|
||||||
temp++;
|
|
||||||
if (temp == tp) tp++;
|
|
||||||
*temp = 'l';
|
|
||||||
temp++;
|
|
||||||
while (temp != tp) {
|
|
||||||
*temp = ' ';
|
|
||||||
temp++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
charCounter = 0;
|
|
||||||
temp = tp;
|
|
||||||
} else if (*p != ' ' && *p != '\'') {
|
|
||||||
charCounter++;
|
|
||||||
}
|
|
||||||
*tp = *p;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (charCounter == 0) {
|
|
||||||
temp++;
|
|
||||||
*temp = 'n';
|
|
||||||
temp++;
|
|
||||||
if (temp == tp) tp++;
|
|
||||||
*temp = 'u';
|
|
||||||
temp++;
|
|
||||||
if (temp == tp) tp++;
|
|
||||||
*temp = 'l';
|
|
||||||
temp++;
|
|
||||||
if (temp == tp) tp++;
|
|
||||||
*temp = 'l';
|
|
||||||
temp++;
|
|
||||||
while (temp != tp) {
|
|
||||||
*temp = ' ';
|
|
||||||
temp++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
charCounter = 0;
|
|
||||||
temp = tp;
|
|
||||||
*tp = 0;
|
|
||||||
tp = values;
|
|
||||||
values = nullValues;
|
|
||||||
switch_safe_free(tp);
|
|
||||||
|
|
||||||
sql = switch_mprintf("INSERT INTO %s (%s) VALUES (%s);", globals.db_table, columns, values);
|
|
||||||
assert(sql);
|
assert(sql);
|
||||||
switch_safe_free(columns);
|
|
||||||
switch_safe_free(values);
|
|
||||||
|
|
||||||
if (globals.debug) {
|
if (globals.debug) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Query: \"%s\"\n", sql);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Query: \"%s\"\n", sql);
|
||||||
|
@ -363,14 +291,14 @@ static switch_status_t insert_cdr(const char * const template, const char * cons
|
||||||
switch_mutex_unlock(globals.db_mutex);
|
switch_mutex_unlock(globals.db_mutex);
|
||||||
|
|
||||||
/* SQL INSERT failed for whatever reason. Spool the attempted query to disk */
|
/* SQL INSERT failed for whatever reason. Spool the attempted query to disk */
|
||||||
if (!strcasecmp(globals.spool_format, "sql")) {
|
if (globals.spool_format == SPOOL_FORMAT_SQL) {
|
||||||
path = switch_mprintf("%s%scdr-spool.sql", globals.log_dir, SWITCH_PATH_SEPARATOR);
|
path = switch_mprintf("%s%scdr-spool.sql", globals.spool_dir, SWITCH_PATH_SEPARATOR);
|
||||||
assert(path);
|
assert(path);
|
||||||
spool_cdr(path, sql);
|
spool_cdr(path, sql);
|
||||||
} else {
|
} else {
|
||||||
path = switch_mprintf("%s%scdr-spool.csv", globals.log_dir, SWITCH_PATH_SEPARATOR);
|
path = switch_mprintf("%s%scdr-spool.csv", globals.spool_dir, SWITCH_PATH_SEPARATOR);
|
||||||
assert(path);
|
assert(path);
|
||||||
spool_cdr(path, cdr);
|
spool_cdr(path, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_safe_free(path);
|
switch_safe_free(path);
|
||||||
|
@ -383,8 +311,10 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
const char *template_str = NULL;
|
char *values = NULL, *tmp = NULL, *pq_var = NULL;
|
||||||
char *expanded_vars = NULL;
|
const char *var = NULL;
|
||||||
|
cdr_field_t *cdr_field = NULL;
|
||||||
|
switch_size_t len, offset;
|
||||||
|
|
||||||
if (globals.shutdown) {
|
if (globals.shutdown) {
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -402,8 +332,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_dir_make_recursive(globals.log_dir, SWITCH_DEFAULT_DIR_PERMS, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
|
if (switch_dir_make_recursive(globals.spool_dir, SWITCH_DEFAULT_DIR_PERMS, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error creating %s\n", globals.log_dir);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error creating %s\n", globals.spool_dir);
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,24 +350,40 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template_str = (const char *) switch_core_hash_find(globals.template_hash, globals.default_template);
|
switch_zmalloc(values, 1);
|
||||||
|
offset = 0;
|
||||||
|
|
||||||
if (!template_str) {
|
for (cdr_field = globals.db_schema->fields; cdr_field->var_name; cdr_field++) {
|
||||||
template_str = default_template;
|
if ((var = switch_channel_get_variable(channel, cdr_field->var_name))) {
|
||||||
|
/* Allocate sufficient buffer for PQescapeString */
|
||||||
|
len = strlen(var);
|
||||||
|
tmp = switch_core_session_alloc(session, len * 2 + 1);
|
||||||
|
PQescapeString(tmp, var, len);
|
||||||
|
var = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cdr_field->quote) {
|
||||||
|
if ((cdr_field->not_null == SWITCH_FALSE) && zstr(var)) {
|
||||||
|
pq_var = switch_mprintf("null,", var);
|
||||||
|
} else {
|
||||||
|
pq_var = switch_mprintf("'%s',", var);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pq_var = switch_mprintf("%s,", var);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Resize values buffer to accomodate next var */
|
||||||
|
len = strlen(pq_var);
|
||||||
|
tmp = realloc(values, offset + len);
|
||||||
|
values = tmp;
|
||||||
|
memcpy(values + offset, pq_var, len);
|
||||||
|
switch_safe_free(pq_var);
|
||||||
|
offset += len;
|
||||||
}
|
}
|
||||||
|
*(values + --offset) = '\0';
|
||||||
|
|
||||||
expanded_vars = switch_channel_expand_variables(channel, template_str);
|
insert_cdr(values);
|
||||||
|
switch_safe_free(values);
|
||||||
if (!expanded_vars) {
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error expanding CDR variables.\n");
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
insert_cdr(template_str, expanded_vars);
|
|
||||||
|
|
||||||
if (expanded_vars != template_str) {
|
|
||||||
switch_safe_free(expanded_vars);
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -485,12 +431,15 @@ static switch_state_handler_table_t state_handlers = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static switch_status_t load_config(switch_memory_pool_t *pool)
|
static switch_status_t load_config(switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
char *cf = "cdr_pg_csv.conf";
|
|
||||||
switch_xml_t cfg, xml, settings, param;
|
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
char *cf = "cdr_pg_csv.conf", *ptr;
|
||||||
|
switch_xml_t cfg, xml, schema, field;
|
||||||
|
const char *attr;
|
||||||
|
int num_fields = 0;
|
||||||
|
switch_size_t len = 0;
|
||||||
|
cdr_field_t *cdr_field;
|
||||||
|
|
||||||
if (globals.db_online) {
|
if (globals.db_online) {
|
||||||
PQfinish(globals.db_connection);
|
PQfinish(globals.db_connection);
|
||||||
|
@ -500,84 +449,72 @@ static switch_status_t load_config(switch_memory_pool_t *pool)
|
||||||
|
|
||||||
memset(&globals, 0, sizeof(globals));
|
memset(&globals, 0, sizeof(globals));
|
||||||
switch_core_hash_init(&globals.fd_hash, pool);
|
switch_core_hash_init(&globals.fd_hash, pool);
|
||||||
switch_core_hash_init(&globals.template_hash, pool);
|
|
||||||
switch_mutex_init(&globals.db_mutex, SWITCH_MUTEX_NESTED, pool);
|
switch_mutex_init(&globals.db_mutex, SWITCH_MUTEX_NESTED, pool);
|
||||||
|
|
||||||
globals.pool = pool;
|
globals.pool = pool;
|
||||||
|
|
||||||
switch_core_hash_insert(globals.template_hash, "default", default_template);
|
if (switch_xml_config_parse_module_settings(cf, SWITCH_FALSE, config_settings) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Adding default template.\n");
|
return SWITCH_STATUS_FALSE;
|
||||||
globals.legs = CDR_LEG_A;
|
}
|
||||||
|
|
||||||
if ((xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
|
if ((xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
|
||||||
|
if ((schema = switch_xml_child(cfg, "schema"))) {
|
||||||
if ((settings = switch_xml_child(cfg, "settings"))) {
|
/* Count fields in schema so we can calculate required buffer size */
|
||||||
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
|
for (field = switch_xml_child(schema, "field"); field; field = field->next) {
|
||||||
char *var = (char *) switch_xml_attr_soft(param, "name");
|
if (switch_xml_attr(field, "var")) {
|
||||||
char *val = (char *) switch_xml_attr_soft(param, "value");
|
num_fields++;
|
||||||
if (!strcasecmp(var, "debug")) {
|
|
||||||
globals.debug = switch_true(val);
|
|
||||||
} else if (!strcasecmp(var, "legs")) {
|
|
||||||
globals.legs = 0;
|
|
||||||
|
|
||||||
if (strchr(val, 'a')) {
|
|
||||||
globals.legs |= CDR_LEG_A;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strchr(val, 'b')) {
|
|
||||||
globals.legs |= CDR_LEG_B;
|
|
||||||
}
|
|
||||||
} else if (!strcasecmp(var, "log-base")) {
|
|
||||||
globals.log_dir = switch_core_sprintf(pool, "%s%scdr-pg-csv", val, SWITCH_PATH_SEPARATOR);
|
|
||||||
} else if (!strcasecmp(var, "rotate-on-hup")) {
|
|
||||||
globals.rotate = switch_true(val);
|
|
||||||
} else if (!strcasecmp(var, "db-info")) {
|
|
||||||
globals.db_info = switch_core_strdup(pool, val);
|
|
||||||
} else if (!strcasecmp(var, "db-table") || !strcasecmp(var, "g-table")) {
|
|
||||||
globals.db_table = switch_core_strdup(pool, val);
|
|
||||||
} else if (!strcasecmp(var, "default-template")) {
|
|
||||||
globals.default_template = switch_core_strdup(pool, val);
|
|
||||||
} else if (!strcasecmp(var, "spool-format")) {
|
|
||||||
globals.spool_format = switch_core_strdup(pool, val);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((settings = switch_xml_child(cfg, "templates"))) {
|
globals.db_schema = switch_core_alloc(pool, (num_fields + 1) * sizeof(cdr_field_t));
|
||||||
for (param = switch_xml_child(settings, "template"); param; param = param->next) {
|
cdr_field = globals.db_schema->fields;
|
||||||
char *var = (char *) switch_xml_attr(param, "name");
|
|
||||||
if (var) {
|
|
||||||
char *tpl;
|
|
||||||
tpl = switch_core_strdup(pool, param->txt);
|
|
||||||
|
|
||||||
switch_core_hash_insert(globals.template_hash, var, tpl);
|
for (field = switch_xml_child(schema, "field"); field; field = field->next) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Adding template %s.\n", var);
|
if ((attr = switch_xml_attr(field, "var"))) {
|
||||||
|
cdr_field->var_name = switch_core_strdup(pool, attr);
|
||||||
|
|
||||||
|
/* Assume SQL column name is the same as FreeSWITCH channel var name, unless specified otherwise */
|
||||||
|
if ((attr = switch_xml_attr(field, "column"))) {
|
||||||
|
cdr_field->col_name = switch_core_strdup(pool, attr);
|
||||||
|
} else {
|
||||||
|
cdr_field->col_name = switch_core_strdup(pool, cdr_field->var_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Assume all fields should be quoted (treated as strings), unless specified otherwise */
|
||||||
|
if ((attr = switch_xml_attr(field, "quote")) && !strncmp(attr, "false", 5)) {
|
||||||
|
cdr_field->quote = SWITCH_FALSE;
|
||||||
|
} else {
|
||||||
|
cdr_field->quote = SWITCH_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Assume all fields allow SQL nulls, unless specified otherwise */
|
||||||
|
if ((attr = switch_xml_attr(field, "not-null")) && !strncmp(attr, "true", 4)) {
|
||||||
|
cdr_field->not_null = SWITCH_TRUE;
|
||||||
|
} else {
|
||||||
|
cdr_field->not_null = SWITCH_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
len += strlen(cdr_field->col_name) + 1;
|
||||||
|
cdr_field++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cdr_field->var_name = 0;
|
||||||
|
|
||||||
|
globals.db_schema->columns = switch_core_alloc(pool, len);
|
||||||
|
ptr = globals.db_schema->columns;
|
||||||
|
for (cdr_field = globals.db_schema->fields; cdr_field->col_name; cdr_field++) {
|
||||||
|
len = strlen(cdr_field->col_name);
|
||||||
|
memcpy(ptr, cdr_field->col_name, len);
|
||||||
|
ptr += len;
|
||||||
|
*ptr = ',';
|
||||||
|
ptr++;
|
||||||
|
}
|
||||||
|
*--ptr = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_xml_free(xml);
|
switch_xml_free(xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!globals.log_dir) {
|
|
||||||
globals.log_dir = switch_core_sprintf(pool, "%s%scdr-pg-csv", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (zstr(globals.db_info)) {
|
|
||||||
globals.db_info = switch_core_strdup(pool, "dbname=cdr");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (zstr(globals.db_table)) {
|
|
||||||
globals.db_table = switch_core_strdup(pool, "cdr");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (zstr(globals.default_template)) {
|
|
||||||
globals.default_template = switch_core_strdup(pool, "default");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (zstr(globals.spool_format)) {
|
|
||||||
globals.spool_format = switch_core_strdup(pool, "csv");
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,8 +525,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_pg_csv_load)
|
||||||
|
|
||||||
load_config(pool);
|
load_config(pool);
|
||||||
|
|
||||||
if ((status = switch_dir_make_recursive(globals.log_dir, SWITCH_DEFAULT_DIR_PERMS, pool)) != SWITCH_STATUS_SUCCESS) {
|
if ((status = switch_dir_make_recursive(globals.spool_dir, SWITCH_DEFAULT_DIR_PERMS, pool)) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error creating %s\n", globals.log_dir);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error creating %s\n", globals.spool_dir);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,7 +538,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_pg_csv_load)
|
||||||
switch_core_add_state_handler(&state_handlers);
|
switch_core_add_state_handler(&state_handlers);
|
||||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||||
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2642,7 +2642,7 @@ static int config(void)
|
||||||
} else if (!strcmp(var, "debug")) {
|
} else if (!strcmp(var, "debug")) {
|
||||||
globals.debug = atoi(val);
|
globals.debug = atoi(val);
|
||||||
} else if (!strcmp(var, "nat-map")) {
|
} 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;
|
prefs.nat_map = 1;
|
||||||
}
|
}
|
||||||
} else if (!strcmp(var, "listen-port")) {
|
} else if (!strcmp(var, "listen-port")) {
|
||||||
|
@ -2795,7 +2795,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
|
||||||
|
|
||||||
close_socket(&listen_list.sock);
|
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);
|
switch_nat_del_mapping(prefs.port, SWITCH_NAT_TCP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,14 @@ FREESWITCH-MIB DEFINITIONS ::= BEGIN
|
||||||
IMPORTS
|
IMPORTS
|
||||||
OBJECT-TYPE, MODULE-IDENTITY,
|
OBJECT-TYPE, MODULE-IDENTITY,
|
||||||
Integer32, Gauge32, Counter32, Counter64, TimeTicks,
|
Integer32, Gauge32, Counter32, Counter64, TimeTicks,
|
||||||
enterprises,
|
enterprises
|
||||||
FROM SNMPv2-SMI
|
FROM SNMPv2-SMI
|
||||||
|
|
||||||
DisplayString
|
DisplayString, DateAndTime
|
||||||
FROM SNMPv2-TC
|
FROM SNMPv2-TC
|
||||||
|
|
||||||
|
InetAddressType, InetAddress
|
||||||
|
FROM INET-ADDRESS-MIB
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,4 +110,214 @@ maxSessionsPerSecond OBJECT-TYPE
|
||||||
"Maximum permissible sessions per second"
|
"Maximum permissible sessions per second"
|
||||||
::= { systemStats 7 }
|
::= { systemStats 7 }
|
||||||
|
|
||||||
|
|
||||||
|
ChannelEntry ::= SEQUENCE {
|
||||||
|
chanIndex Integer32,
|
||||||
|
chanUUID DisplayString,
|
||||||
|
chanDirection DisplayString,
|
||||||
|
chanCreated DateAndTime,
|
||||||
|
chanName DisplayString,
|
||||||
|
chanState DisplayString,
|
||||||
|
chanCIDName DisplayString,
|
||||||
|
chanCIDNum DisplayString,
|
||||||
|
chanInetAddressType InetAddressType,
|
||||||
|
chanInetAddress InetAddress,
|
||||||
|
chanDest DisplayString,
|
||||||
|
chanApplication DisplayString,
|
||||||
|
chanAppData DisplayString,
|
||||||
|
chanDialplan DisplayString,
|
||||||
|
chanContext DisplayString,
|
||||||
|
chanReadCodec DisplayString,
|
||||||
|
chanReadRate Gauge32,
|
||||||
|
chanReadBitRate Gauge32,
|
||||||
|
chanWriteCodec DisplayString,
|
||||||
|
chanWriteRate Gauge32,
|
||||||
|
chanWriteBitRate Gauge32
|
||||||
|
}
|
||||||
|
|
||||||
|
channelList OBJECT-TYPE
|
||||||
|
SYNTAX SEQUENCE OF ChannelEntry
|
||||||
|
MAX-ACCESS not-accessible
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"A table containing a list of active channels"
|
||||||
|
::= { core 9 }
|
||||||
|
|
||||||
|
channelEntry OBJECT-TYPE
|
||||||
|
SYNTAX ChannelEntry
|
||||||
|
MAX-ACCESS not-accessible
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"A channel entry"
|
||||||
|
INDEX { chanIndex }
|
||||||
|
::= { channelList 1 }
|
||||||
|
|
||||||
|
chanIndex OBJECT-TYPE
|
||||||
|
SYNTAX Integer32
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel SNMP index."
|
||||||
|
::= { channelEntry 1 }
|
||||||
|
|
||||||
|
chanUUID OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel UUID."
|
||||||
|
::= { channelEntry 2 }
|
||||||
|
|
||||||
|
chanDirection OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel direction."
|
||||||
|
::= { channelEntry 3 }
|
||||||
|
|
||||||
|
chanCreated OBJECT-TYPE
|
||||||
|
SYNTAX DateAndTime
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel creation timestamp."
|
||||||
|
::= { channelEntry 4 }
|
||||||
|
|
||||||
|
chanName OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel name."
|
||||||
|
::= { channelEntry 5 }
|
||||||
|
|
||||||
|
chanState OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel state."
|
||||||
|
::= { channelEntry 6 }
|
||||||
|
|
||||||
|
chanCIDName OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel caller ID name."
|
||||||
|
::= { channelEntry 7 }
|
||||||
|
|
||||||
|
chanCIDNum OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel caller ID number."
|
||||||
|
::= { channelEntry 8 }
|
||||||
|
|
||||||
|
chanInetAddressType OBJECT-TYPE
|
||||||
|
SYNTAX InetAddressType
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel originator's IP address type (IPv4 or IPv6)."
|
||||||
|
::= { channelEntry 9 }
|
||||||
|
|
||||||
|
chanInetAddress OBJECT-TYPE
|
||||||
|
SYNTAX InetAddress
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel originator's IP address."
|
||||||
|
::= { channelEntry 10 }
|
||||||
|
|
||||||
|
chanDest OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel destination."
|
||||||
|
::= { channelEntry 11 }
|
||||||
|
|
||||||
|
chanApplication OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel application."
|
||||||
|
::= { channelEntry 12 }
|
||||||
|
|
||||||
|
chanAppData OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel application data."
|
||||||
|
::= { channelEntry 13 }
|
||||||
|
|
||||||
|
chanDialplan OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel dialplan."
|
||||||
|
::= { channelEntry 14 }
|
||||||
|
|
||||||
|
chanContext OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel dialplan context."
|
||||||
|
::= { channelEntry 15 }
|
||||||
|
|
||||||
|
chanReadCodec OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel read codec."
|
||||||
|
::= { channelEntry 16 }
|
||||||
|
|
||||||
|
chanReadRate OBJECT-TYPE
|
||||||
|
SYNTAX Gauge32
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel read samples per second."
|
||||||
|
::= { channelEntry 17 }
|
||||||
|
|
||||||
|
chanReadBitRate OBJECT-TYPE
|
||||||
|
SYNTAX Gauge32
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel read bits per second."
|
||||||
|
::= { channelEntry 18 }
|
||||||
|
|
||||||
|
chanWriteCodec OBJECT-TYPE
|
||||||
|
SYNTAX DisplayString
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel write codec."
|
||||||
|
::= { channelEntry 19 }
|
||||||
|
|
||||||
|
chanWriteRate OBJECT-TYPE
|
||||||
|
SYNTAX Gauge32
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel write samples per second."
|
||||||
|
::= { channelEntry 20 }
|
||||||
|
|
||||||
|
chanWriteBitRate OBJECT-TYPE
|
||||||
|
SYNTAX Gauge32
|
||||||
|
MAX-ACCESS read-only
|
||||||
|
STATUS current
|
||||||
|
DESCRIPTION
|
||||||
|
"Channel write bits per second."
|
||||||
|
::= { channelEntry 21 }
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -109,7 +109,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)
|
||||||
*/
|
*/
|
||||||
netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 2);
|
netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 2);
|
||||||
|
|
||||||
init_subagent();
|
init_subagent(pool);
|
||||||
init_snmp("mod_snmp");
|
init_snmp("mod_snmp");
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
|
@ -36,16 +36,136 @@
|
||||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||||
#include "subagent.h"
|
#include "subagent.h"
|
||||||
|
|
||||||
|
netsnmp_table_registration_info *ch_table_info;
|
||||||
|
netsnmp_tdata *ch_table;
|
||||||
|
netsnmp_handler_registration *ch_reginfo;
|
||||||
|
uint32_t idx;
|
||||||
|
|
||||||
void init_subagent(void)
|
|
||||||
|
static void time_t_to_datetime(time_t epoch, char *buf, switch_size_t buflen)
|
||||||
|
{
|
||||||
|
struct tm *dt;
|
||||||
|
uint16_t year;
|
||||||
|
|
||||||
|
dt = gmtime(&epoch);
|
||||||
|
year = dt->tm_year + 1900;
|
||||||
|
switch_snprintf(buf, buflen, "%c%c%c%c%c%c%c%c+%c%c", year >> 8, year & 0xff, dt->tm_mon + 1, dt->tm_mday, dt->tm_hour, dt->tm_min, dt->tm_sec, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)
|
||||||
|
{
|
||||||
|
uint32_t *count = (uint32_t *) pArg;
|
||||||
|
*count = atoi(argv[0]);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int channelList_callback(void *pArg, int argc, char **argv, char **columnNames)
|
||||||
|
{
|
||||||
|
chan_entry_t *entry;
|
||||||
|
netsnmp_tdata_row *row;
|
||||||
|
|
||||||
|
switch_zmalloc(entry, sizeof(chan_entry_t));
|
||||||
|
if (!entry)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
row = netsnmp_tdata_create_row();
|
||||||
|
if (!row) {
|
||||||
|
switch_safe_free(entry);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
row->data = entry;
|
||||||
|
|
||||||
|
entry->idx = idx++;
|
||||||
|
strncpy(entry->uuid, argv[0], sizeof(entry->uuid));
|
||||||
|
strncpy(entry->direction, argv[1], sizeof(entry->direction));
|
||||||
|
entry->created_epoch = atoi(argv[3]);
|
||||||
|
strncpy(entry->name, argv[4], sizeof(entry->name));
|
||||||
|
strncpy(entry->state, argv[5], sizeof(entry->state));
|
||||||
|
strncpy(entry->cid_name, argv[6], sizeof(entry->cid_name));
|
||||||
|
strncpy(entry->cid_num, argv[7], sizeof(entry->cid_num));
|
||||||
|
strncpy(entry->dest, argv[9], sizeof(entry->dest));
|
||||||
|
strncpy(entry->application, argv[10], sizeof(entry->application));
|
||||||
|
strncpy(entry->application_data, argv[11], sizeof(entry->application_data));
|
||||||
|
strncpy(entry->dialplan, argv[12], sizeof(entry->dialplan));
|
||||||
|
strncpy(entry->context, argv[13], sizeof(entry->context));
|
||||||
|
strncpy(entry->read_codec, argv[14], sizeof(entry->read_codec));
|
||||||
|
entry->read_rate = atoi(argv[15]);
|
||||||
|
entry->read_bitrate = atoi(argv[16]);
|
||||||
|
strncpy(entry->write_codec, argv[17], sizeof(entry->write_codec));
|
||||||
|
entry->write_rate = atoi(argv[18]);
|
||||||
|
entry->write_bitrate = atoi(argv[19]);
|
||||||
|
|
||||||
|
memset(&entry->ip_addr, 0, sizeof(entry->ip_addr));
|
||||||
|
if (strchr(argv[8], ':')) {
|
||||||
|
switch_inet_pton(AF_INET6, argv[8], &entry->ip_addr);
|
||||||
|
entry->addr_family = AF_INET6;
|
||||||
|
} else {
|
||||||
|
switch_inet_pton(AF_INET, argv[8], &entry->ip_addr);
|
||||||
|
entry->addr_family = AF_INET;
|
||||||
|
}
|
||||||
|
|
||||||
|
netsnmp_tdata_row_add_index(row, ASN_INTEGER, &entry->idx, sizeof(entry->idx));
|
||||||
|
netsnmp_tdata_add_row(ch_table, row);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void channelList_free(netsnmp_cache *cache, void *magic)
|
||||||
|
{
|
||||||
|
netsnmp_tdata_row *row = netsnmp_tdata_row_first(ch_table);
|
||||||
|
|
||||||
|
/* Delete table rows one by one */
|
||||||
|
while (row) {
|
||||||
|
netsnmp_tdata_remove_and_delete_row(ch_table, row);
|
||||||
|
switch_safe_free(row->data);
|
||||||
|
row = netsnmp_tdata_row_first(ch_table);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int channelList_load(netsnmp_cache *cache, void *vmagic)
|
||||||
|
{
|
||||||
|
switch_cache_db_handle_t *dbh;
|
||||||
|
char sql[1024] = "", hostname[256] = "";
|
||||||
|
|
||||||
|
channelList_free(cache, NULL);
|
||||||
|
|
||||||
|
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
idx = 1;
|
||||||
|
gethostname(hostname, sizeof(hostname));
|
||||||
|
sprintf(sql, "SELECT * FROM channels WHERE hostname='%s' ORDER BY created_epoch", hostname);
|
||||||
|
switch_cache_db_execute_sql_callback(dbh, sql, channelList_callback, NULL, NULL);
|
||||||
|
|
||||||
|
switch_cache_db_release_db_handle(&dbh);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void init_subagent(switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
static oid identity_oid[] = { 1,3,6,1,4,1,27880,1,1 };
|
static oid identity_oid[] = { 1,3,6,1,4,1,27880,1,1 };
|
||||||
static oid systemStats_oid[] = { 1,3,6,1,4,1,27880,1,2 };
|
static oid systemStats_oid[] = { 1,3,6,1,4,1,27880,1,2 };
|
||||||
|
static oid channelList_oid[] = { 1,3,6,1,4,1,27880,1,9 };
|
||||||
|
|
||||||
DEBUGMSGTL(("init_subagent", "Initializing\n"));
|
DEBUGMSGTL(("init_subagent", "mod_snmp subagent initializing\n"));
|
||||||
|
|
||||||
netsnmp_register_scalar_group(netsnmp_create_handler_registration("identity", handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY), 1, 2);
|
netsnmp_register_scalar_group(netsnmp_create_handler_registration("identity", handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY), 1, 2);
|
||||||
netsnmp_register_scalar_group(netsnmp_create_handler_registration("systemStats", handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY), 1, 7);
|
netsnmp_register_scalar_group(netsnmp_create_handler_registration("systemStats", handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY), 1, 7);
|
||||||
|
|
||||||
|
ch_table_info = switch_core_alloc(pool, sizeof(netsnmp_table_registration_info));
|
||||||
|
netsnmp_table_helper_add_indexes(ch_table_info, ASN_INTEGER, 0);
|
||||||
|
ch_table_info->min_column = CH_INDEX;
|
||||||
|
ch_table_info->max_column = CH_WRITE_BITRATE;
|
||||||
|
ch_table = netsnmp_tdata_create_table("channelList", 0);
|
||||||
|
ch_reginfo = netsnmp_create_handler_registration("channelList", handle_channelList, channelList_oid, OID_LENGTH(channelList_oid), HANDLER_CAN_RONLY);
|
||||||
|
netsnmp_tdata_register(ch_reginfo, ch_table, ch_table_info);
|
||||||
|
netsnmp_inject_handler(ch_reginfo, netsnmp_get_cache_handler(5, channelList_load, channelList_free, channelList_oid, OID_LENGTH(channelList_oid)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,7 +209,7 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio
|
||||||
netsnmp_request_info *request = NULL;
|
netsnmp_request_info *request = NULL;
|
||||||
oid subid;
|
oid subid;
|
||||||
switch_time_t uptime;
|
switch_time_t uptime;
|
||||||
uint32_t int_val;
|
uint32_t int_val = 0;
|
||||||
|
|
||||||
switch(reqinfo->mode) {
|
switch(reqinfo->mode) {
|
||||||
case MODE_GET:
|
case MODE_GET:
|
||||||
|
@ -102,32 +222,39 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio
|
||||||
break;
|
break;
|
||||||
case SS_SESSIONS_SINCE_STARTUP:
|
case SS_SESSIONS_SINCE_STARTUP:
|
||||||
int_val = switch_core_session_id() - 1;
|
int_val = switch_core_session_id() - 1;
|
||||||
snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER, (u_char *) &int_val, sizeof(int_val));
|
snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER, int_val);
|
||||||
break;
|
break;
|
||||||
case SS_CURRENT_SESSIONS:
|
case SS_CURRENT_SESSIONS:
|
||||||
int_val = switch_core_session_count();
|
int_val = switch_core_session_count();
|
||||||
snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
|
snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
|
||||||
break;
|
break;
|
||||||
case SS_MAX_SESSIONS:
|
case SS_MAX_SESSIONS:
|
||||||
switch_core_session_ctl(SCSC_MAX_SESSIONS, &int_val);;
|
switch_core_session_ctl(SCSC_MAX_SESSIONS, &int_val);
|
||||||
snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
|
snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
|
||||||
break;
|
break;
|
||||||
case SS_CURRENT_CALLS:
|
case SS_CURRENT_CALLS:
|
||||||
/*
|
{
|
||||||
* This is zero for now, since there is no convenient way to get total call
|
switch_cache_db_handle_t *dbh;
|
||||||
* count (not to be confused with session count), without touching the
|
char sql[1024] = "", hostname[256] = "";
|
||||||
* database.
|
|
||||||
*/
|
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
|
||||||
int_val = 0;
|
return SNMP_ERR_GENERR;
|
||||||
snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
|
}
|
||||||
|
|
||||||
|
gethostname(hostname, sizeof(hostname));
|
||||||
|
sprintf(sql, "SELECT COUNT(*) FROM calls WHERE hostname='%s'", hostname);
|
||||||
|
switch_cache_db_execute_sql_callback(dbh, sql, sql_count_callback, &int_val, NULL);
|
||||||
|
snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
|
||||||
|
switch_cache_db_release_db_handle(&dbh);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SS_SESSIONS_PER_SECOND:
|
case SS_SESSIONS_PER_SECOND:
|
||||||
switch_core_session_ctl(SCSC_LAST_SPS, &int_val);
|
switch_core_session_ctl(SCSC_LAST_SPS, &int_val);
|
||||||
snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
|
snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
|
||||||
break;
|
break;
|
||||||
case SS_MAX_SESSIONS_PER_SECOND:
|
case SS_MAX_SESSIONS_PER_SECOND:
|
||||||
switch_core_session_ctl(SCSC_SPS, &int_val);
|
switch_core_session_ctl(SCSC_SPS, &int_val);
|
||||||
snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
|
snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", (int) subid);
|
snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", (int) subid);
|
||||||
|
@ -145,6 +272,107 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
|
||||||
|
{
|
||||||
|
netsnmp_request_info *request;
|
||||||
|
netsnmp_table_request_info *table_info;
|
||||||
|
chan_entry_t *entry;
|
||||||
|
char dt_str[12];
|
||||||
|
|
||||||
|
switch (reqinfo->mode) {
|
||||||
|
case MODE_GET:
|
||||||
|
for (request = requests; request; request = request->next) {
|
||||||
|
table_info = netsnmp_extract_table_info(request);
|
||||||
|
entry = (chan_entry_t *) netsnmp_tdata_extract_entry(request);
|
||||||
|
|
||||||
|
switch (table_info->colnum) {
|
||||||
|
case CH_INDEX:
|
||||||
|
snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, entry->idx);
|
||||||
|
break;
|
||||||
|
case CH_UUID:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->uuid, strlen(entry->uuid));
|
||||||
|
break;
|
||||||
|
case CH_DIRECTION:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->direction, strlen(entry->direction));
|
||||||
|
break;
|
||||||
|
case CH_CREATED:
|
||||||
|
time_t_to_datetime(entry->created_epoch, (char *) &dt_str, sizeof(dt_str));
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) &dt_str, sizeof(dt_str));
|
||||||
|
break;
|
||||||
|
case CH_NAME:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->name, strlen(entry->name));
|
||||||
|
break;
|
||||||
|
case CH_STATE:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->state, strlen(entry->state));
|
||||||
|
break;
|
||||||
|
case CH_CID_NAME:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->cid_name, strlen(entry->cid_name));
|
||||||
|
break;
|
||||||
|
case CH_CID_NUM:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->cid_num, strlen(entry->cid_num));
|
||||||
|
break;
|
||||||
|
case CH_IP_ADDR_TYPE:
|
||||||
|
if (entry->addr_family == AF_INET6) {
|
||||||
|
snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, INETADDRESSTYPE_IPV6);
|
||||||
|
} else {
|
||||||
|
snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, INETADDRESSTYPE_IPV4);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CH_IP_ADDR:
|
||||||
|
if (entry->addr_family == AF_INET6) {
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) &entry->ip_addr.v6, sizeof(entry->ip_addr.v6));
|
||||||
|
} else {
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) &entry->ip_addr.v4, sizeof(entry->ip_addr.v4));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CH_DEST:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->dest, strlen(entry->dest));
|
||||||
|
break;
|
||||||
|
case CH_APPLICATION:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->application, strlen(entry->application));
|
||||||
|
break;
|
||||||
|
case CH_APPLICATION_DATA:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->application_data, strlen(entry->application_data));
|
||||||
|
break;
|
||||||
|
case CH_DIALPLAN:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->dialplan, strlen(entry->dialplan));
|
||||||
|
break;
|
||||||
|
case CH_CONTEXT:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->context, strlen(entry->context));
|
||||||
|
break;
|
||||||
|
case CH_READ_CODEC:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->read_codec, strlen(entry->read_codec));
|
||||||
|
break;
|
||||||
|
case CH_READ_RATE:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->read_rate, sizeof(entry->read_rate));
|
||||||
|
break;
|
||||||
|
case CH_READ_BITRATE:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->read_bitrate, sizeof(entry->read_bitrate));
|
||||||
|
break;
|
||||||
|
case CH_WRITE_CODEC:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->write_codec, strlen(entry->write_codec));
|
||||||
|
break;
|
||||||
|
case CH_WRITE_RATE:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->write_rate, sizeof(entry->write_rate));
|
||||||
|
break;
|
||||||
|
case CH_WRITE_BITRATE:
|
||||||
|
snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->write_bitrate, sizeof(entry->write_bitrate));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", table_info->colnum);
|
||||||
|
netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* we should never get here, so this is a really bad error */
|
||||||
|
snmp_log(LOG_ERR, "Unknown mode (%d) in handle_foo\n", reqinfo->mode );
|
||||||
|
return SNMP_ERR_GENERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SNMP_ERR_NOERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* For Emacs:
|
/* For Emacs:
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
|
|
|
@ -14,9 +14,64 @@
|
||||||
#define SS_SESSIONS_PER_SECOND 6
|
#define SS_SESSIONS_PER_SECOND 6
|
||||||
#define SS_MAX_SESSIONS_PER_SECOND 7
|
#define SS_MAX_SESSIONS_PER_SECOND 7
|
||||||
|
|
||||||
|
/* .1.3.6.1.4.1.27880.1.9 */
|
||||||
|
#define CH_INDEX 1
|
||||||
|
#define CH_UUID 2
|
||||||
|
#define CH_DIRECTION 3
|
||||||
|
#define CH_CREATED 4
|
||||||
|
#define CH_NAME 5
|
||||||
|
#define CH_STATE 6
|
||||||
|
#define CH_CID_NAME 7
|
||||||
|
#define CH_CID_NUM 8
|
||||||
|
#define CH_IP_ADDR_TYPE 9
|
||||||
|
#define CH_IP_ADDR 10
|
||||||
|
#define CH_DEST 11
|
||||||
|
#define CH_APPLICATION 12
|
||||||
|
#define CH_APPLICATION_DATA 13
|
||||||
|
#define CH_DIALPLAN 14
|
||||||
|
#define CH_CONTEXT 15
|
||||||
|
#define CH_READ_CODEC 16
|
||||||
|
#define CH_READ_RATE 17
|
||||||
|
#define CH_READ_BITRATE 18
|
||||||
|
#define CH_WRITE_CODEC 19
|
||||||
|
#define CH_WRITE_RATE 20
|
||||||
|
#define CH_WRITE_BITRATE 21
|
||||||
|
|
||||||
void init_subagent(void);
|
/* Why aren't these in net-snmp-includes.h ? */
|
||||||
|
#define INETADDRESSTYPE_UNKNOWN 0
|
||||||
|
#define INETADDRESSTYPE_IPV4 1
|
||||||
|
#define INETADDRESSTYPE_IPV6 2
|
||||||
|
#define INETADDRESSTYPE_IPV4Z 3
|
||||||
|
#define INETADDRESSTYPE_IPV6Z 4
|
||||||
|
#define INETADDRESSTYPE_DNS 16
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint32_t idx;
|
||||||
|
char uuid[38];
|
||||||
|
char direction[32];
|
||||||
|
time_t created_epoch;
|
||||||
|
char name[1024];
|
||||||
|
char state[64];
|
||||||
|
char cid_name[1024];
|
||||||
|
char cid_num[256];
|
||||||
|
ip_t ip_addr;
|
||||||
|
uint8_t addr_family;
|
||||||
|
char dest[1024];
|
||||||
|
char application[128];
|
||||||
|
char application_data[4096];
|
||||||
|
char dialplan[128];
|
||||||
|
char context[128];
|
||||||
|
char read_codec[128];
|
||||||
|
uint32_t read_rate;
|
||||||
|
uint32_t read_bitrate;
|
||||||
|
char write_codec[128];
|
||||||
|
uint32_t write_rate;
|
||||||
|
uint32_t write_bitrate;
|
||||||
|
} chan_entry_t;
|
||||||
|
|
||||||
|
void init_subagent(switch_memory_pool_t *pool);
|
||||||
Netsnmp_Node_Handler handle_identity;
|
Netsnmp_Node_Handler handle_identity;
|
||||||
Netsnmp_Node_Handler handle_systemStats;
|
Netsnmp_Node_Handler handle_systemStats;
|
||||||
|
Netsnmp_Node_Handler handle_channelList;
|
||||||
|
|
||||||
#endif /* subagent_H */
|
#endif /* subagent_H */
|
||||||
|
|
|
@ -77,7 +77,7 @@ static int next_file(switch_file_handle_t *handle)
|
||||||
|
|
||||||
|
|
||||||
if (!prefix) {
|
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;
|
prefix = SWITCH_GLOBAL_dirs.sounds_dir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
using namespace LUA;
|
using namespace LUA;
|
||||||
|
|
||||||
SWITCH_BEGIN_EXTERN_C void mod_lua_conjure_event(lua_State * L, switch_event_t *event, const char *name, int destroy_me)
|
SWITCH_BEGIN_EXTERN_C
|
||||||
|
|
||||||
|
void mod_lua_conjure_event(lua_State * L, switch_event_t *event, const char *name, int destroy_me)
|
||||||
{
|
{
|
||||||
Event *result = new Event(event);
|
Event *result = new Event(event);
|
||||||
SWIG_NewPointerObj(L, result, SWIGTYPE_p_Event, destroy_me);
|
SWIG_NewPointerObj(L, result, SWIGTYPE_p_Event, destroy_me);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef MOD_LUA_EXTRA
|
#ifndef MOD_LUA_EXTRA
|
||||||
#define MOD_LUA_EXTRA
|
#define MOD_LUA_EXTRA
|
||||||
SWITCH_BEGIN_EXTERN_C void mod_lua_conjure_event(lua_State * L, switch_event_t *event, const char *name, int destroy_me);
|
SWITCH_BEGIN_EXTERN_C
|
||||||
|
|
||||||
|
void mod_lua_conjure_event(lua_State * L, switch_event_t *event, const char *name, int destroy_me);
|
||||||
void mod_lua_conjure_stream(lua_State * L, switch_stream_handle_t *stream, const char *name, int destroy_me);
|
void mod_lua_conjure_stream(lua_State * L, switch_stream_handle_t *stream, const char *name, int destroy_me);
|
||||||
void mod_lua_conjure_session(lua_State * L, switch_core_session_t *session, const char *name, int destroy_me);
|
void mod_lua_conjure_session(lua_State * L, switch_core_session_t *session, const char *name, int destroy_me);
|
||||||
|
|
||||||
|
|
|
@ -1582,6 +1582,55 @@ fail:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int _wrap_email(lua_State* L) {
|
||||||
|
int SWIG_arg = -1;
|
||||||
|
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;
|
||||||
|
|
||||||
|
SWIG_check_num_args("email",2,7)
|
||||||
|
if(!lua_isstring(L,1)) SWIG_fail_arg("email",1,"char *");
|
||||||
|
if(!lua_isstring(L,2)) SWIG_fail_arg("email",2,"char *");
|
||||||
|
if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("email",3,"char *");
|
||||||
|
if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("email",4,"char *");
|
||||||
|
if(lua_gettop(L)>=5 && !lua_isstring(L,5)) SWIG_fail_arg("email",5,"char *");
|
||||||
|
if(lua_gettop(L)>=6 && !lua_isstring(L,6)) SWIG_fail_arg("email",6,"char *");
|
||||||
|
if(lua_gettop(L)>=7 && !lua_isstring(L,7)) SWIG_fail_arg("email",7,"char *");
|
||||||
|
arg1 = (char *)lua_tostring(L, 1);
|
||||||
|
arg2 = (char *)lua_tostring(L, 2);
|
||||||
|
if(lua_gettop(L)>=3){
|
||||||
|
arg3 = (char *)lua_tostring(L, 3);
|
||||||
|
}
|
||||||
|
if(lua_gettop(L)>=4){
|
||||||
|
arg4 = (char *)lua_tostring(L, 4);
|
||||||
|
}
|
||||||
|
if(lua_gettop(L)>=5){
|
||||||
|
arg5 = (char *)lua_tostring(L, 5);
|
||||||
|
}
|
||||||
|
if(lua_gettop(L)>=6){
|
||||||
|
arg6 = (char *)lua_tostring(L, 6);
|
||||||
|
}
|
||||||
|
if(lua_gettop(L)>=7){
|
||||||
|
arg7 = (char *)lua_tostring(L, 7);
|
||||||
|
}
|
||||||
|
result = (bool)email(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
|
||||||
|
SWIG_arg=0;
|
||||||
|
lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
|
||||||
|
return SWIG_arg;
|
||||||
|
|
||||||
|
if(0) SWIG_fail;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
lua_error(L);
|
||||||
|
return SWIG_arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int _wrap_new_IVRMenu(lua_State* L) {
|
static int _wrap_new_IVRMenu(lua_State* L) {
|
||||||
int SWIG_arg = -1;
|
int SWIG_arg = -1;
|
||||||
IVRMenu *arg1 = (IVRMenu *) 0 ;
|
IVRMenu *arg1 = (IVRMenu *) 0 ;
|
||||||
|
@ -7525,6 +7574,7 @@ static swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_
|
||||||
static const struct luaL_reg swig_commands[] = {
|
static const struct luaL_reg swig_commands[] = {
|
||||||
{ "consoleLog", _wrap_consoleLog},
|
{ "consoleLog", _wrap_consoleLog},
|
||||||
{ "consoleCleanLog", _wrap_consoleCleanLog},
|
{ "consoleCleanLog", _wrap_consoleCleanLog},
|
||||||
|
{ "email", _wrap_email},
|
||||||
{ "console_log", _wrap_console_log},
|
{ "console_log", _wrap_console_log},
|
||||||
{ "console_clean_log", _wrap_console_clean_log},
|
{ "console_clean_log", _wrap_console_clean_log},
|
||||||
{ "msleep", _wrap_msleep},
|
{ "msleep", _wrap_msleep},
|
||||||
|
|
|
@ -8947,6 +8947,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_feed(void * jarg1, void * jarg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_feed_dtmf(void * jarg1, void * jarg2, void * jarg3) {
|
||||||
|
int jresult ;
|
||||||
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
switch_dtmf_t *arg2 = (switch_dtmf_t *) 0 ;
|
||||||
|
switch_asr_flag_t *arg3 = (switch_asr_flag_t *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_handle_t *)jarg1;
|
||||||
|
arg2 = (switch_dtmf_t *)jarg2;
|
||||||
|
arg3 = (switch_asr_flag_t *)jarg3;
|
||||||
|
result = (switch_status_t)switch_core_asr_feed_dtmf(arg1,(switch_dtmf_t const *)arg2,arg3);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_check_results(void * jarg1, void * jarg2) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_check_results(void * jarg1, void * jarg2) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
@ -9007,6 +9023,46 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_unload_grammar(void * jarg1, c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_enable_grammar(void * jarg1, char * jarg2) {
|
||||||
|
int jresult ;
|
||||||
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
char *arg2 = (char *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_handle_t *)jarg1;
|
||||||
|
arg2 = (char *)jarg2;
|
||||||
|
result = (switch_status_t)switch_core_asr_enable_grammar(arg1,(char const *)arg2);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_disable_grammar(void * jarg1, char * jarg2) {
|
||||||
|
int jresult ;
|
||||||
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
char *arg2 = (char *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_handle_t *)jarg1;
|
||||||
|
arg2 = (char *)jarg2;
|
||||||
|
result = (switch_status_t)switch_core_asr_disable_grammar(arg1,(char const *)arg2);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_disable_all_grammars(void * jarg1) {
|
||||||
|
int jresult ;
|
||||||
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_handle_t *)jarg1;
|
||||||
|
result = (switch_status_t)switch_core_asr_disable_all_grammars(arg1);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_pause(void * jarg1) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_pause(void * jarg1) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
@ -18313,6 +18369,94 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_next_get(void * jarg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_enable_grammar_set(void * jarg1, void * jarg2) {
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*arg2)(switch_asr_handle_t *,char const *) = (switch_status_t (*)(switch_asr_handle_t *,char const *)) 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
arg2 = (switch_status_t (*)(switch_asr_handle_t *,char const *))jarg2;
|
||||||
|
if (arg1) (arg1)->asr_enable_grammar = arg2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_asr_enable_grammar_get(void * jarg1) {
|
||||||
|
void * jresult ;
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*result)(switch_asr_handle_t *,char const *) = 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
result = (switch_status_t (*)(switch_asr_handle_t *,char const *)) ((arg1)->asr_enable_grammar);
|
||||||
|
jresult = (void *)result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_disable_grammar_set(void * jarg1, void * jarg2) {
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*arg2)(switch_asr_handle_t *,char const *) = (switch_status_t (*)(switch_asr_handle_t *,char const *)) 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
arg2 = (switch_status_t (*)(switch_asr_handle_t *,char const *))jarg2;
|
||||||
|
if (arg1) (arg1)->asr_disable_grammar = arg2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_asr_disable_grammar_get(void * jarg1) {
|
||||||
|
void * jresult ;
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*result)(switch_asr_handle_t *,char const *) = 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
result = (switch_status_t (*)(switch_asr_handle_t *,char const *)) ((arg1)->asr_disable_grammar);
|
||||||
|
jresult = (void *)result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_disable_all_grammars_set(void * jarg1, void * jarg2) {
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*arg2)(switch_asr_handle_t *) = (switch_status_t (*)(switch_asr_handle_t *)) 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
arg2 = (switch_status_t (*)(switch_asr_handle_t *))jarg2;
|
||||||
|
if (arg1) (arg1)->asr_disable_all_grammars = arg2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_asr_disable_all_grammars_get(void * jarg1) {
|
||||||
|
void * jresult ;
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*result)(switch_asr_handle_t *) = 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
result = (switch_status_t (*)(switch_asr_handle_t *)) ((arg1)->asr_disable_all_grammars);
|
||||||
|
jresult = (void *)result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_feed_dtmf_set(void * jarg1, void * jarg2) {
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*arg2)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *) = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *)) 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
arg2 = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *))jarg2;
|
||||||
|
if (arg1) (arg1)->asr_feed_dtmf = arg2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_asr_feed_dtmf_get(void * jarg1) {
|
||||||
|
void * jresult ;
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*result)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *) = 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
result = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *)) ((arg1)->asr_feed_dtmf);
|
||||||
|
jresult = (void *)result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_asr_interface() {
|
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_asr_interface() {
|
||||||
void * jresult ;
|
void * jresult ;
|
||||||
switch_asr_interface *result = 0 ;
|
switch_asr_interface *result = 0 ;
|
||||||
|
@ -26320,6 +26464,46 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_unload_grammar(void *
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_enable_grammar(void * jarg1, char * jarg2) {
|
||||||
|
int jresult ;
|
||||||
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
char *arg2 = (char *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_core_session_t *)jarg1;
|
||||||
|
arg2 = (char *)jarg2;
|
||||||
|
result = (switch_status_t)switch_ivr_detect_speech_enable_grammar(arg1,(char const *)arg2);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_disable_grammar(void * jarg1, char * jarg2) {
|
||||||
|
int jresult ;
|
||||||
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
char *arg2 = (char *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_core_session_t *)jarg1;
|
||||||
|
arg2 = (char *)jarg2;
|
||||||
|
result = (switch_status_t)switch_ivr_detect_speech_disable_grammar(arg1,(char const *)arg2);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_disable_all_grammars(void * jarg1) {
|
||||||
|
int jresult ;
|
||||||
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_core_session_t *)jarg1;
|
||||||
|
result = (switch_status_t)switch_ivr_detect_speech_disable_all_grammars(arg1);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg1, char * jarg2, char * jarg3) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg1, char * jarg2, char * jarg3) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
@ -26336,6 +26520,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_start_input_timers(void * jarg1) {
|
||||||
|
int jresult ;
|
||||||
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_core_session_t *)jarg1;
|
||||||
|
result = (switch_status_t)switch_ivr_detect_speech_start_input_timers(arg1);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_record_session(void * jarg1, char * jarg2, unsigned long jarg3, void * jarg4) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_record_session(void * jarg1, char * jarg2, unsigned long jarg3, void * jarg4) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
|
|
@ -9238,6 +9238,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_feed(void * jarg1, void * jarg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_feed_dtmf(void * jarg1, void * jarg2, void * jarg3) {
|
||||||
|
int jresult ;
|
||||||
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
switch_dtmf_t *arg2 = (switch_dtmf_t *) 0 ;
|
||||||
|
switch_asr_flag_t *arg3 = (switch_asr_flag_t *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_handle_t *)jarg1;
|
||||||
|
arg2 = (switch_dtmf_t *)jarg2;
|
||||||
|
arg3 = (switch_asr_flag_t *)jarg3;
|
||||||
|
result = (switch_status_t)switch_core_asr_feed_dtmf(arg1,(switch_dtmf_t const *)arg2,arg3);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_check_results(void * jarg1, void * jarg2) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_check_results(void * jarg1, void * jarg2) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
@ -9298,6 +9314,46 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_unload_grammar(void * jarg1, c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_enable_grammar(void * jarg1, char * jarg2) {
|
||||||
|
int jresult ;
|
||||||
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
char *arg2 = (char *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_handle_t *)jarg1;
|
||||||
|
arg2 = (char *)jarg2;
|
||||||
|
result = (switch_status_t)switch_core_asr_enable_grammar(arg1,(char const *)arg2);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_disable_grammar(void * jarg1, char * jarg2) {
|
||||||
|
int jresult ;
|
||||||
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
char *arg2 = (char *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_handle_t *)jarg1;
|
||||||
|
arg2 = (char *)jarg2;
|
||||||
|
result = (switch_status_t)switch_core_asr_disable_grammar(arg1,(char const *)arg2);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_disable_all_grammars(void * jarg1) {
|
||||||
|
int jresult ;
|
||||||
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_handle_t *)jarg1;
|
||||||
|
result = (switch_status_t)switch_core_asr_disable_all_grammars(arg1);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_pause(void * jarg1) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_pause(void * jarg1) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
|
||||||
|
@ -18820,6 +18876,98 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_next_get(void * jarg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_enable_grammar_set(void * jarg1, void * jarg2) {
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*arg2)(switch_asr_handle_t *,char const *) = (switch_status_t (*)(switch_asr_handle_t *,char const *)) 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
arg2 = (switch_status_t (*)(switch_asr_handle_t *,char const *))jarg2;
|
||||||
|
if (arg1) (arg1)->asr_enable_grammar = arg2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_asr_enable_grammar_get(void * jarg1) {
|
||||||
|
void * jresult ;
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*result)(switch_asr_handle_t *,char const *) = 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
result = (switch_status_t (*)(switch_asr_handle_t *,char const *)) ((arg1)->asr_enable_grammar);
|
||||||
|
jresult = (void *)result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_disable_grammar_set(void * jarg1, void * jarg2) {
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*arg2)(switch_asr_handle_t *,char const *) = (switch_status_t (*)(switch_asr_handle_t *,char const *)) 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
arg2 = (switch_status_t (*)(switch_asr_handle_t *,char const *))jarg2;
|
||||||
|
if (arg1) (arg1)->asr_disable_grammar = arg2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_asr_disable_grammar_get(void * jarg1) {
|
||||||
|
void * jresult ;
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*result)(switch_asr_handle_t *,char const *) = 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
result = (switch_status_t (*)(switch_asr_handle_t *,char const *)) ((arg1)->asr_disable_grammar);
|
||||||
|
jresult = (void *)result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_disable_all_grammars_set(void * jarg1, void * jarg2) {
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*arg2)(switch_asr_handle_t *) = (switch_status_t (*)(switch_asr_handle_t *)) 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
arg2 = (switch_status_t (*)(switch_asr_handle_t *))jarg2;
|
||||||
|
if (arg1) (arg1)->asr_disable_all_grammars = arg2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_asr_disable_all_grammars_get(void * jarg1) {
|
||||||
|
void * jresult ;
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*result)(switch_asr_handle_t *) = 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
result = (switch_status_t (*)(switch_asr_handle_t *)) ((arg1)->asr_disable_all_grammars);
|
||||||
|
jresult = (void *)result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_feed_dtmf_set(void * jarg1, void * jarg2) {
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*arg2)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *) = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *)) 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
arg2 = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *))jarg2;
|
||||||
|
if (arg1) (arg1)->asr_feed_dtmf = arg2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_asr_feed_dtmf_get(void * jarg1) {
|
||||||
|
void * jresult ;
|
||||||
|
switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;
|
||||||
|
switch_status_t (*result)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *) = 0 ;
|
||||||
|
|
||||||
|
arg1 = (switch_asr_interface *)jarg1;
|
||||||
|
result = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *)) ((arg1)->asr_feed_dtmf);
|
||||||
|
jresult = (void *)result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_asr_interface() {
|
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_asr_interface() {
|
||||||
void * jresult ;
|
void * jresult ;
|
||||||
switch_asr_interface *result = 0 ;
|
switch_asr_interface *result = 0 ;
|
||||||
|
@ -27013,6 +27161,46 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_unload_grammar(void *
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_enable_grammar(void * jarg1, char * jarg2) {
|
||||||
|
int jresult ;
|
||||||
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
char *arg2 = (char *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_core_session_t *)jarg1;
|
||||||
|
arg2 = (char *)jarg2;
|
||||||
|
result = (switch_status_t)switch_ivr_detect_speech_enable_grammar(arg1,(char const *)arg2);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_disable_grammar(void * jarg1, char * jarg2) {
|
||||||
|
int jresult ;
|
||||||
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
char *arg2 = (char *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_core_session_t *)jarg1;
|
||||||
|
arg2 = (char *)jarg2;
|
||||||
|
result = (switch_status_t)switch_ivr_detect_speech_disable_grammar(arg1,(char const *)arg2);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_disable_all_grammars(void * jarg1) {
|
||||||
|
int jresult ;
|
||||||
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_core_session_t *)jarg1;
|
||||||
|
result = (switch_status_t)switch_ivr_detect_speech_disable_all_grammars(arg1);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg1, char * jarg2, char * jarg3) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg1, char * jarg2, char * jarg3) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
@ -27029,6 +27217,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_start_input_timers(void * jarg1) {
|
||||||
|
int jresult ;
|
||||||
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
switch_status_t result;
|
||||||
|
|
||||||
|
arg1 = (switch_core_session_t *)jarg1;
|
||||||
|
result = (switch_status_t)switch_ivr_detect_speech_start_input_timers(arg1);
|
||||||
|
jresult = result;
|
||||||
|
return jresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_record_session(void * jarg1, char * jarg2, unsigned long jarg3, void * jarg4) {
|
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_record_session(void * jarg1, char * jarg2, unsigned long jarg3, void * jarg4) {
|
||||||
int jresult ;
|
int jresult ;
|
||||||
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||||
|
@ -33152,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) {
|
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 ;
|
void * jresult ;
|
||||||
IVRMenu *arg1 = (IVRMenu *) 0 ;
|
IVRMenu *arg1 = (IVRMenu *) 0 ;
|
||||||
|
|
|
@ -2000,6 +2000,11 @@ public class freeswitch {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_core_asr_feed_dtmf(switch_asr_handle ah, switch_dtmf_t dtmf, SWIGTYPE_p_unsigned_long flags) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_feed_dtmf(switch_asr_handle.getCPtr(ah), switch_dtmf_t.getCPtr(dtmf), SWIGTYPE_p_unsigned_long.getCPtr(flags));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public static switch_status_t switch_core_asr_check_results(switch_asr_handle ah, SWIGTYPE_p_unsigned_long flags) {
|
public static switch_status_t switch_core_asr_check_results(switch_asr_handle ah, SWIGTYPE_p_unsigned_long flags) {
|
||||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_check_results(switch_asr_handle.getCPtr(ah), SWIGTYPE_p_unsigned_long.getCPtr(flags));
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_check_results(switch_asr_handle.getCPtr(ah), SWIGTYPE_p_unsigned_long.getCPtr(flags));
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2020,6 +2025,21 @@ public class freeswitch {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_core_asr_enable_grammar(switch_asr_handle ah, string name) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_enable_grammar(switch_asr_handle.getCPtr(ah), name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_core_asr_disable_grammar(switch_asr_handle ah, string name) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_disable_grammar(switch_asr_handle.getCPtr(ah), name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_core_asr_disable_all_grammars(switch_asr_handle ah) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_disable_all_grammars(switch_asr_handle.getCPtr(ah));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public static switch_status_t switch_core_asr_pause(switch_asr_handle ah) {
|
public static switch_status_t switch_core_asr_pause(switch_asr_handle ah) {
|
||||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_pause(switch_asr_handle.getCPtr(ah));
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_pause(switch_asr_handle.getCPtr(ah));
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -4070,11 +4090,31 @@ public class freeswitch {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_ivr_detect_speech_enable_grammar(SWIGTYPE_p_switch_core_session session, string name) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_enable_grammar(SWIGTYPE_p_switch_core_session.getCPtr(session), name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_ivr_detect_speech_disable_grammar(SWIGTYPE_p_switch_core_session session, string name) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_disable_grammar(SWIGTYPE_p_switch_core_session.getCPtr(session), name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_ivr_detect_speech_disable_all_grammars(SWIGTYPE_p_switch_core_session session) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_disable_all_grammars(SWIGTYPE_p_switch_core_session.getCPtr(session));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public static switch_status_t switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session session, string name, string val) {
|
public static switch_status_t switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session session, string name, string val) {
|
||||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session.getCPtr(session), name, val);
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session.getCPtr(session), name, val);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_ivr_detect_speech_start_input_timers(SWIGTYPE_p_switch_core_session session) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_start_input_timers(SWIGTYPE_p_switch_core_session.getCPtr(session));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public static switch_status_t switch_ivr_record_session(SWIGTYPE_p_switch_core_session session, string file, uint limit, switch_file_handle fh) {
|
public static switch_status_t switch_ivr_record_session(SWIGTYPE_p_switch_core_session session, string file, uint limit, switch_file_handle fh) {
|
||||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_record_session(SWIGTYPE_p_switch_core_session.getCPtr(session), file, limit, switch_file_handle.getCPtr(fh));
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_record_session(SWIGTYPE_p_switch_core_session.getCPtr(session), file, limit, switch_file_handle.getCPtr(fh));
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -7907,6 +7947,9 @@ class freeswitchPINVOKE {
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed")]
|
||||||
public static extern int switch_core_asr_feed(HandleRef jarg1, HandleRef jarg2, uint jarg3, HandleRef jarg4);
|
public static extern int switch_core_asr_feed(HandleRef jarg1, HandleRef jarg2, uint jarg3, HandleRef jarg4);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed_dtmf")]
|
||||||
|
public static extern int switch_core_asr_feed_dtmf(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_check_results")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_check_results")]
|
||||||
public static extern int switch_core_asr_check_results(HandleRef jarg1, HandleRef jarg2);
|
public static extern int switch_core_asr_check_results(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
@ -7919,6 +7962,15 @@ class freeswitchPINVOKE {
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_unload_grammar")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_unload_grammar")]
|
||||||
public static extern int switch_core_asr_unload_grammar(HandleRef jarg1, string jarg2);
|
public static extern int switch_core_asr_unload_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_enable_grammar")]
|
||||||
|
public static extern int switch_core_asr_enable_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_disable_grammar")]
|
||||||
|
public static extern int switch_core_asr_disable_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_disable_all_grammars")]
|
||||||
|
public static extern int switch_core_asr_disable_all_grammars(HandleRef jarg1);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_pause")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_pause")]
|
||||||
public static extern int switch_core_asr_pause(HandleRef jarg1);
|
public static extern int switch_core_asr_pause(HandleRef jarg1);
|
||||||
|
|
||||||
|
@ -10196,6 +10248,30 @@ class freeswitchPINVOKE {
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_next_get")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_next_get")]
|
||||||
public static extern IntPtr switch_asr_interface_next_get(HandleRef jarg1);
|
public static extern IntPtr switch_asr_interface_next_get(HandleRef jarg1);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_enable_grammar_set")]
|
||||||
|
public static extern void switch_asr_interface_asr_enable_grammar_set(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_enable_grammar_get")]
|
||||||
|
public static extern IntPtr switch_asr_interface_asr_enable_grammar_get(HandleRef jarg1);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_grammar_set")]
|
||||||
|
public static extern void switch_asr_interface_asr_disable_grammar_set(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_grammar_get")]
|
||||||
|
public static extern IntPtr switch_asr_interface_asr_disable_grammar_get(HandleRef jarg1);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_all_grammars_set")]
|
||||||
|
public static extern void switch_asr_interface_asr_disable_all_grammars_set(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_all_grammars_get")]
|
||||||
|
public static extern IntPtr switch_asr_interface_asr_disable_all_grammars_get(HandleRef jarg1);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_feed_dtmf_set")]
|
||||||
|
public static extern void switch_asr_interface_asr_feed_dtmf_set(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_feed_dtmf_get")]
|
||||||
|
public static extern IntPtr switch_asr_interface_asr_feed_dtmf_get(HandleRef jarg1);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_asr_interface")]
|
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_asr_interface")]
|
||||||
public static extern IntPtr new_switch_asr_interface();
|
public static extern IntPtr new_switch_asr_interface();
|
||||||
|
|
||||||
|
@ -12140,9 +12216,21 @@ class freeswitchPINVOKE {
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_unload_grammar")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_unload_grammar")]
|
||||||
public static extern int switch_ivr_detect_speech_unload_grammar(HandleRef jarg1, string jarg2);
|
public static extern int switch_ivr_detect_speech_unload_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_enable_grammar")]
|
||||||
|
public static extern int switch_ivr_detect_speech_enable_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_disable_grammar")]
|
||||||
|
public static extern int switch_ivr_detect_speech_disable_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_disable_all_grammars")]
|
||||||
|
public static extern int switch_ivr_detect_speech_disable_all_grammars(HandleRef jarg1);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_set_param_detect_speech")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_set_param_detect_speech")]
|
||||||
public static extern int switch_ivr_set_param_detect_speech(HandleRef jarg1, string jarg2, string jarg3);
|
public static extern int switch_ivr_set_param_detect_speech(HandleRef jarg1, string jarg2, string jarg3);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_start_input_timers")]
|
||||||
|
public static extern int switch_ivr_detect_speech_start_input_timers(HandleRef jarg1);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_record_session")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_record_session")]
|
||||||
public static extern int switch_ivr_record_session(HandleRef jarg1, string jarg2, uint jarg3, HandleRef jarg4);
|
public static extern int switch_ivr_record_session(HandleRef jarg1, string jarg2, uint jarg3, HandleRef jarg4);
|
||||||
|
|
||||||
|
@ -14967,6 +15055,36 @@ namespace FreeSWITCH.Native {
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t {
|
||||||
|
private HandleRef swigCPtr;
|
||||||
|
|
||||||
|
internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
|
||||||
|
swigCPtr = new HandleRef(this, cPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t() {
|
||||||
|
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t obj) {
|
||||||
|
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||||
|
* Version 2.0.1
|
||||||
|
*
|
||||||
|
* Do not make changes to this file unless you know what you are doing--modify
|
||||||
|
* the SWIG interface file instead.
|
||||||
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
namespace FreeSWITCH.Native {
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
|
public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
|
||||||
private HandleRef swigCPtr;
|
private HandleRef swigCPtr;
|
||||||
|
|
||||||
|
@ -19993,6 +20111,50 @@ public class switch_asr_interface : IDisposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t asr_enable_grammar {
|
||||||
|
set {
|
||||||
|
freeswitchPINVOKE.switch_asr_interface_asr_enable_grammar_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t.getCPtr(value));
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_enable_grammar_get(swigCPtr);
|
||||||
|
SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(cPtr, false);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t asr_disable_grammar {
|
||||||
|
set {
|
||||||
|
freeswitchPINVOKE.switch_asr_interface_asr_disable_grammar_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t.getCPtr(value));
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_disable_grammar_get(swigCPtr);
|
||||||
|
SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(cPtr, false);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t asr_disable_all_grammars {
|
||||||
|
set {
|
||||||
|
freeswitchPINVOKE.switch_asr_interface_asr_disable_all_grammars_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t.getCPtr(value));
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_disable_all_grammars_get(swigCPtr);
|
||||||
|
SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t(cPtr, false);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t asr_feed_dtmf {
|
||||||
|
set {
|
||||||
|
freeswitchPINVOKE.switch_asr_interface_asr_feed_dtmf_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t.getCPtr(value));
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_feed_dtmf_get(swigCPtr);
|
||||||
|
SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(cPtr, false);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public switch_asr_interface() : this(freeswitchPINVOKE.new_switch_asr_interface(), true) {
|
public switch_asr_interface() : this(freeswitchPINVOKE.new_switch_asr_interface(), true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28589,7 +28751,8 @@ public enum switch_rtp_bug_flag_t {
|
||||||
RTP_BUG_IGNORE_MARK_BIT = (1 << 2),
|
RTP_BUG_IGNORE_MARK_BIT = (1 << 2),
|
||||||
RTP_BUG_SEND_LINEAR_TIMESTAMPS = (1 << 3),
|
RTP_BUG_SEND_LINEAR_TIMESTAMPS = (1 << 3),
|
||||||
RTP_BUG_START_SEQ_AT_ZERO = (1 << 4),
|
RTP_BUG_START_SEQ_AT_ZERO = (1 << 4),
|
||||||
RTP_BUG_NEVER_SEND_MARKER = (1 << 5)
|
RTP_BUG_NEVER_SEND_MARKER = (1 << 5),
|
||||||
|
RTP_BUG_IGNORE_DTMF_DURATION = (1 << 6)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30446,7 +30609,7 @@ public enum switch_status_t {
|
||||||
SWITCH_STATUS_FALSE,
|
SWITCH_STATUS_FALSE,
|
||||||
SWITCH_STATUS_TIMEOUT,
|
SWITCH_STATUS_TIMEOUT,
|
||||||
SWITCH_STATUS_RESTART,
|
SWITCH_STATUS_RESTART,
|
||||||
SWITCH_STATUS_TERM,
|
SWITCH_STATUS_INTR,
|
||||||
SWITCH_STATUS_NOTIMPL,
|
SWITCH_STATUS_NOTIMPL,
|
||||||
SWITCH_STATUS_MEMERR,
|
SWITCH_STATUS_MEMERR,
|
||||||
SWITCH_STATUS_NOOP,
|
SWITCH_STATUS_NOOP,
|
||||||
|
@ -30463,6 +30626,7 @@ public enum switch_status_t {
|
||||||
SWITCH_STATUS_TOO_SMALL,
|
SWITCH_STATUS_TOO_SMALL,
|
||||||
SWITCH_STATUS_FOUND,
|
SWITCH_STATUS_FOUND,
|
||||||
SWITCH_STATUS_CONTINUE,
|
SWITCH_STATUS_CONTINUE,
|
||||||
|
SWITCH_STATUS_TERM,
|
||||||
SWITCH_STATUS_NOT_INITALIZED
|
SWITCH_STATUS_NOT_INITALIZED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1990,6 +1990,11 @@ public class freeswitch {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_core_asr_feed_dtmf(switch_asr_handle ah, switch_dtmf_t dtmf, SWIGTYPE_p_unsigned_long flags) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_feed_dtmf(switch_asr_handle.getCPtr(ah), switch_dtmf_t.getCPtr(dtmf), SWIGTYPE_p_unsigned_long.getCPtr(flags));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public static switch_status_t switch_core_asr_check_results(switch_asr_handle ah, SWIGTYPE_p_unsigned_long flags) {
|
public static switch_status_t switch_core_asr_check_results(switch_asr_handle ah, SWIGTYPE_p_unsigned_long flags) {
|
||||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_check_results(switch_asr_handle.getCPtr(ah), SWIGTYPE_p_unsigned_long.getCPtr(flags));
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_check_results(switch_asr_handle.getCPtr(ah), SWIGTYPE_p_unsigned_long.getCPtr(flags));
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2010,6 +2015,21 @@ public class freeswitch {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_core_asr_enable_grammar(switch_asr_handle ah, string name) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_enable_grammar(switch_asr_handle.getCPtr(ah), name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_core_asr_disable_grammar(switch_asr_handle ah, string name) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_disable_grammar(switch_asr_handle.getCPtr(ah), name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_core_asr_disable_all_grammars(switch_asr_handle ah) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_disable_all_grammars(switch_asr_handle.getCPtr(ah));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public static switch_status_t switch_core_asr_pause(switch_asr_handle ah) {
|
public static switch_status_t switch_core_asr_pause(switch_asr_handle ah) {
|
||||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_pause(switch_asr_handle.getCPtr(ah));
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_pause(switch_asr_handle.getCPtr(ah));
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -4060,11 +4080,31 @@ public class freeswitch {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_ivr_detect_speech_enable_grammar(SWIGTYPE_p_switch_core_session session, string name) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_enable_grammar(SWIGTYPE_p_switch_core_session.getCPtr(session), name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_ivr_detect_speech_disable_grammar(SWIGTYPE_p_switch_core_session session, string name) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_disable_grammar(SWIGTYPE_p_switch_core_session.getCPtr(session), name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_ivr_detect_speech_disable_all_grammars(SWIGTYPE_p_switch_core_session session) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_disable_all_grammars(SWIGTYPE_p_switch_core_session.getCPtr(session));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public static switch_status_t switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session session, string name, string val) {
|
public static switch_status_t switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session session, string name, string val) {
|
||||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session.getCPtr(session), name, val);
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session.getCPtr(session), name, val);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static switch_status_t switch_ivr_detect_speech_start_input_timers(SWIGTYPE_p_switch_core_session session) {
|
||||||
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_start_input_timers(SWIGTYPE_p_switch_core_session.getCPtr(session));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public static switch_status_t switch_ivr_record_session(SWIGTYPE_p_switch_core_session session, string file, uint limit, switch_file_handle fh) {
|
public static switch_status_t switch_ivr_record_session(SWIGTYPE_p_switch_core_session session, string file, uint limit, switch_file_handle fh) {
|
||||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_record_session(SWIGTYPE_p_switch_core_session.getCPtr(session), file, limit, switch_file_handle.getCPtr(fh));
|
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_record_session(SWIGTYPE_p_switch_core_session.getCPtr(session), file, limit, switch_file_handle.getCPtr(fh));
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -5324,6 +5364,11 @@ public class freeswitch {
|
||||||
freeswitchPINVOKE.consoleCleanLog(msg);
|
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) {
|
public static void console_log(string level_str, string msg) {
|
||||||
freeswitchPINVOKE.console_log(level_str, msg);
|
freeswitchPINVOKE.console_log(level_str, msg);
|
||||||
}
|
}
|
||||||
|
@ -7893,6 +7938,9 @@ class freeswitchPINVOKE {
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed")]
|
||||||
public static extern int switch_core_asr_feed(HandleRef jarg1, HandleRef jarg2, uint jarg3, HandleRef jarg4);
|
public static extern int switch_core_asr_feed(HandleRef jarg1, HandleRef jarg2, uint jarg3, HandleRef jarg4);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed_dtmf")]
|
||||||
|
public static extern int switch_core_asr_feed_dtmf(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_check_results")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_check_results")]
|
||||||
public static extern int switch_core_asr_check_results(HandleRef jarg1, HandleRef jarg2);
|
public static extern int switch_core_asr_check_results(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
@ -7905,6 +7953,15 @@ class freeswitchPINVOKE {
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_unload_grammar")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_unload_grammar")]
|
||||||
public static extern int switch_core_asr_unload_grammar(HandleRef jarg1, string jarg2);
|
public static extern int switch_core_asr_unload_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_enable_grammar")]
|
||||||
|
public static extern int switch_core_asr_enable_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_disable_grammar")]
|
||||||
|
public static extern int switch_core_asr_disable_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_disable_all_grammars")]
|
||||||
|
public static extern int switch_core_asr_disable_all_grammars(HandleRef jarg1);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_pause")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_pause")]
|
||||||
public static extern int switch_core_asr_pause(HandleRef jarg1);
|
public static extern int switch_core_asr_pause(HandleRef jarg1);
|
||||||
|
|
||||||
|
@ -10182,6 +10239,30 @@ class freeswitchPINVOKE {
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_next_get")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_next_get")]
|
||||||
public static extern IntPtr switch_asr_interface_next_get(HandleRef jarg1);
|
public static extern IntPtr switch_asr_interface_next_get(HandleRef jarg1);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_enable_grammar_set")]
|
||||||
|
public static extern void switch_asr_interface_asr_enable_grammar_set(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_enable_grammar_get")]
|
||||||
|
public static extern IntPtr switch_asr_interface_asr_enable_grammar_get(HandleRef jarg1);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_grammar_set")]
|
||||||
|
public static extern void switch_asr_interface_asr_disable_grammar_set(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_grammar_get")]
|
||||||
|
public static extern IntPtr switch_asr_interface_asr_disable_grammar_get(HandleRef jarg1);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_all_grammars_set")]
|
||||||
|
public static extern void switch_asr_interface_asr_disable_all_grammars_set(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_all_grammars_get")]
|
||||||
|
public static extern IntPtr switch_asr_interface_asr_disable_all_grammars_get(HandleRef jarg1);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_feed_dtmf_set")]
|
||||||
|
public static extern void switch_asr_interface_asr_feed_dtmf_set(HandleRef jarg1, HandleRef jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_feed_dtmf_get")]
|
||||||
|
public static extern IntPtr switch_asr_interface_asr_feed_dtmf_get(HandleRef jarg1);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_asr_interface")]
|
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_asr_interface")]
|
||||||
public static extern IntPtr new_switch_asr_interface();
|
public static extern IntPtr new_switch_asr_interface();
|
||||||
|
|
||||||
|
@ -12126,9 +12207,21 @@ class freeswitchPINVOKE {
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_unload_grammar")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_unload_grammar")]
|
||||||
public static extern int switch_ivr_detect_speech_unload_grammar(HandleRef jarg1, string jarg2);
|
public static extern int switch_ivr_detect_speech_unload_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_enable_grammar")]
|
||||||
|
public static extern int switch_ivr_detect_speech_enable_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_disable_grammar")]
|
||||||
|
public static extern int switch_ivr_detect_speech_disable_grammar(HandleRef jarg1, string jarg2);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_disable_all_grammars")]
|
||||||
|
public static extern int switch_ivr_detect_speech_disable_all_grammars(HandleRef jarg1);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_set_param_detect_speech")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_set_param_detect_speech")]
|
||||||
public static extern int switch_ivr_set_param_detect_speech(HandleRef jarg1, string jarg2, string jarg3);
|
public static extern int switch_ivr_set_param_detect_speech(HandleRef jarg1, string jarg2, string jarg3);
|
||||||
|
|
||||||
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_start_input_timers")]
|
||||||
|
public static extern int switch_ivr_detect_speech_start_input_timers(HandleRef jarg1);
|
||||||
|
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_record_session")]
|
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_record_session")]
|
||||||
public static extern int switch_ivr_record_session(HandleRef jarg1, string jarg2, uint jarg3, HandleRef jarg4);
|
public static extern int switch_ivr_record_session(HandleRef jarg1, string jarg2, uint jarg3, HandleRef jarg4);
|
||||||
|
|
||||||
|
@ -13500,6 +13593,9 @@ class freeswitchPINVOKE {
|
||||||
[DllImport("mod_managed", EntryPoint="CSharp_consoleCleanLog")]
|
[DllImport("mod_managed", EntryPoint="CSharp_consoleCleanLog")]
|
||||||
public static extern void consoleCleanLog(string jarg1);
|
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")]
|
[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);
|
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);
|
||||||
|
|
||||||
|
@ -14943,6 +15039,36 @@ namespace FreeSWITCH.Native {
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t {
|
||||||
|
private HandleRef swigCPtr;
|
||||||
|
|
||||||
|
internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
|
||||||
|
swigCPtr = new HandleRef(this, cPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t() {
|
||||||
|
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t obj) {
|
||||||
|
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||||
|
* Version 1.3.35
|
||||||
|
*
|
||||||
|
* Do not make changes to this file unless you know what you are doing--modify
|
||||||
|
* the SWIG interface file instead.
|
||||||
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
namespace FreeSWITCH.Native {
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
|
public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
|
||||||
private HandleRef swigCPtr;
|
private HandleRef swigCPtr;
|
||||||
|
|
||||||
|
@ -19959,6 +20085,50 @@ public class switch_asr_interface : IDisposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t asr_enable_grammar {
|
||||||
|
set {
|
||||||
|
freeswitchPINVOKE.switch_asr_interface_asr_enable_grammar_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t.getCPtr(value));
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_enable_grammar_get(swigCPtr);
|
||||||
|
SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(cPtr, false);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t asr_disable_grammar {
|
||||||
|
set {
|
||||||
|
freeswitchPINVOKE.switch_asr_interface_asr_disable_grammar_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t.getCPtr(value));
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_disable_grammar_get(swigCPtr);
|
||||||
|
SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(cPtr, false);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t asr_disable_all_grammars {
|
||||||
|
set {
|
||||||
|
freeswitchPINVOKE.switch_asr_interface_asr_disable_all_grammars_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t.getCPtr(value));
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_disable_all_grammars_get(swigCPtr);
|
||||||
|
SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t(cPtr, false);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t asr_feed_dtmf {
|
||||||
|
set {
|
||||||
|
freeswitchPINVOKE.switch_asr_interface_asr_feed_dtmf_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t.getCPtr(value));
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_feed_dtmf_get(swigCPtr);
|
||||||
|
SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(cPtr, false);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public switch_asr_interface() : this(freeswitchPINVOKE.new_switch_asr_interface(), true) {
|
public switch_asr_interface() : this(freeswitchPINVOKE.new_switch_asr_interface(), true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2126,6 +2126,15 @@ static JSBool session_media_ready(JSContext * cx, JSObject * obj, uintN argc, js
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static JSBool session_ring_ready(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
|
||||||
|
{
|
||||||
|
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||||
|
|
||||||
|
*rval = BOOLEAN_TO_JSVAL((jss && jss->session && switch_channel_test_flag(switch_core_session_get_channel(jss->session), CF_RING_READY)) ? JS_TRUE : JS_FALSE);
|
||||||
|
|
||||||
|
return JS_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static JSBool session_answered(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
|
static JSBool session_answered(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
|
||||||
{
|
{
|
||||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||||
|
@ -2673,6 +2682,7 @@ static JSFunctionSpec session_methods[] = {
|
||||||
{"ready", session_ready, 0},
|
{"ready", session_ready, 0},
|
||||||
{"answered", session_answered, 0},
|
{"answered", session_answered, 0},
|
||||||
{"mediaReady", session_media_ready, 0},
|
{"mediaReady", session_media_ready, 0},
|
||||||
|
{"ringReady", session_ring_ready, 0},
|
||||||
{"waitForAnswer", session_wait_for_answer, 0},
|
{"waitForAnswer", session_wait_for_answer, 0},
|
||||||
{"waitForMedia", session_wait_for_media, 0},
|
{"waitForMedia", session_wait_for_media, 0},
|
||||||
{"getEvent", session_get_event, 0},
|
{"getEvent", session_get_event, 0},
|
||||||
|
@ -3378,8 +3388,9 @@ static JSBool js_global_get(JSContext * cx, JSObject * obj, uintN argc, jsval *
|
||||||
|
|
||||||
if (argc > 0) {
|
if (argc > 0) {
|
||||||
var_name = JS_GetStringBytes(JS_ValueToString(cx, argv[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));
|
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, val));
|
||||||
|
free(val);
|
||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,12 +293,12 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config_data.err) {
|
if (config_data.err) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error encountered!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error encountered! [%s]\ndata: [%s]\n", binding->url, data);
|
||||||
xml = NULL;
|
xml = NULL;
|
||||||
} else {
|
} else {
|
||||||
if (httpRes == 200) {
|
if (httpRes == 200) {
|
||||||
if (!(xml = switch_xml_parse_file(filename))) {
|
if (!(xml = switch_xml_parse_file(filename))) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result! [%s]\ndata: [%s]\n", binding->url, data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received HTTP error %ld trying to fetch %s\ndata: [%s]\n", httpRes, binding->url,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received HTTP error %ld trying to fetch %s\ndata: [%s]\n", httpRes, binding->url,
|
||||||
|
|
|
@ -322,6 +322,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
||||||
int at = 0;
|
int at = 0;
|
||||||
char *dp;
|
char *dp;
|
||||||
abyss_bool rval = FALSE;
|
abyss_bool rval = FALSE;
|
||||||
|
char *dup_domain = NULL;
|
||||||
|
|
||||||
p = RequestHeaderValue(r, "authorization");
|
p = RequestHeaderValue(r, "authorization");
|
||||||
|
|
||||||
|
@ -354,7 +355,9 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
||||||
if (globals.default_domain) {
|
if (globals.default_domain) {
|
||||||
domain_name = globals.default_domain;
|
domain_name = globals.default_domain;
|
||||||
} else {
|
} 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(mypass1);
|
||||||
switch_safe_free(mypass2);
|
switch_safe_free(mypass2);
|
||||||
switch_safe_free(box);
|
switch_safe_free(box);
|
||||||
|
switch_safe_free(dup_domain);
|
||||||
|
|
||||||
return rval;
|
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)
|
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_assert(channel != NULL);
|
||||||
|
|
||||||
switch_mutex_lock(channel->profile_mutex);
|
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))) {
|
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 (dup && v != vdup) {
|
||||||
if (v)
|
if (v) {
|
||||||
r = switch_core_session_strdup(channel->session, v);
|
r = switch_core_session_strdup(channel->session, v);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
r = v;
|
r = v;
|
||||||
}
|
}
|
||||||
|
@ -2595,14 +2598,15 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready_value(swi
|
||||||
if (var) {
|
if (var) {
|
||||||
char *arg = NULL;
|
char *arg = NULL;
|
||||||
app = switch_core_session_strdup(channel->session, var);
|
app = switch_core_session_strdup(channel->session, var);
|
||||||
if ((arg = strchr(app, ' '))) {
|
|
||||||
*arg++ = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_core_session_in_thread(channel->session)) {
|
if (strstr(app, "::")) {
|
||||||
switch_core_session_execute_application(channel->session, app, arg);
|
|
||||||
} else {
|
|
||||||
switch_core_session_execute_application_async(channel->session, app, arg);
|
switch_core_session_execute_application_async(channel->session, app, arg);
|
||||||
|
} else {
|
||||||
|
if ((arg = strchr(app, ' '))) {
|
||||||
|
*arg++ = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_core_session_execute_application(channel->session, app, arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2653,14 +2657,16 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_
|
||||||
(var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))) && !zstr(var)) {
|
(var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))) && !zstr(var)) {
|
||||||
char *arg = NULL;
|
char *arg = NULL;
|
||||||
app = switch_core_session_strdup(channel->session, var);
|
app = switch_core_session_strdup(channel->session, var);
|
||||||
if ((arg = strchr(app, ' '))) {
|
|
||||||
*arg++ = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_core_session_in_thread(channel->session)) {
|
|
||||||
switch_core_session_execute_application(channel->session, app, arg);
|
if (strstr(app, "::")) {
|
||||||
} else {
|
|
||||||
switch_core_session_execute_application_async(channel->session, app, arg);
|
switch_core_session_execute_application_async(channel->session, app, arg);
|
||||||
|
} else {
|
||||||
|
if ((arg = strchr(app, ' '))) {
|
||||||
|
*arg++ = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_core_session_execute_application(channel->session, app, arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2825,27 +2831,17 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
|
||||||
(!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && (var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))))
|
(!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && (var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))))
|
||||||
&& !zstr(var)) {
|
&& !zstr(var)) {
|
||||||
char *arg = NULL;
|
char *arg = NULL;
|
||||||
char *colon = NULL;
|
|
||||||
|
|
||||||
app = switch_core_session_strdup(channel->session, var);
|
app = switch_core_session_strdup(channel->session, var);
|
||||||
|
|
||||||
arg = strchr(app, ' ');
|
if (strstr(app, "::")) {
|
||||||
colon = strchr(app, ':');
|
switch_core_session_execute_application_async(channel->session, app, arg);
|
||||||
if (colon && (!arg || arg > colon) && *(colon + 1) == ':') {
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "%s execute on answer: %s (BROADCAST)\n", channel->name, app);
|
|
||||||
switch_ivr_broadcast(switch_core_session_get_uuid(channel->session), app, SMF_NONE);
|
|
||||||
} else {
|
} else {
|
||||||
if (arg) {
|
if ((arg = strchr(app, ' '))) {
|
||||||
*arg++ = '\0';
|
*arg++ = '\0';
|
||||||
}
|
}
|
||||||
switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "%s execute on answer: %s(%s)\n", channel->name, app,
|
|
||||||
switch_str_nil(arg));
|
switch_core_session_execute_application(channel->session, app, arg);
|
||||||
|
|
||||||
if (switch_core_session_in_thread(channel->session)) {
|
|
||||||
switch_core_session_execute_application(channel->session, app, arg);
|
|
||||||
} else {
|
|
||||||
switch_core_session_execute_application_async(channel->session, app, arg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -643,9 +643,9 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_list_uuid(const char *line
|
||||||
|
|
||||||
if (!zstr(cursor)) {
|
if (!zstr(cursor)) {
|
||||||
sql = switch_mprintf("select distinct uuid from channels where uuid like '%q%%' and hostname='%q' order by uuid",
|
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 {
|
} 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);
|
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) {
|
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",
|
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) {
|
if (sql) {
|
||||||
|
@ -792,7 +792,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
|
||||||
|
|
||||||
if (h.words == 0) {
|
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 ",
|
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 {
|
} else {
|
||||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
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));
|
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);
|
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);
|
switch_cache_db_persistant_execute(db, mystream.data, 5);
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
} else if (!strcasecmp(argv[0], "add")) {
|
} 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);
|
switch_cache_db_persistant_execute(db, mystream.data, 5);
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
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, "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);
|
switch_cache_db_persistant_execute(db, mystream.data, 1);
|
||||||
}
|
}
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
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) {
|
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_cache_db_persistant_execute(db, sql, 5);
|
||||||
switch_safe_free(sql);
|
switch_safe_free(sql);
|
||||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (1, '%q','%q','%q')",
|
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 {
|
} else {
|
||||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (1, '%w','%w','%w')",
|
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);
|
switch_cache_db_persistant_execute(db, sql, 5);
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
} else if (!strcasecmp(argv[0], "add") && argc == 3) {
|
} 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_cache_db_persistant_execute(db, sql, 5);
|
||||||
switch_safe_free(sql);
|
switch_safe_free(sql);
|
||||||
if (db->type == SCDB_TYPE_CORE_DB) {
|
if (db->type == SCDB_TYPE_CORE_DB) {
|
||||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (0, '%q','%q','%q')",
|
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 {
|
} else {
|
||||||
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (0, '%w','%w','%w')",
|
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);
|
switch_cache_db_persistant_execute(db, sql, 5);
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
} else if (!strcasecmp(argv[0], "del") && argc == 2) {
|
} else if (!strcasecmp(argv[0], "del") && argc == 2) {
|
||||||
char *what = argv[1];
|
char *what = argv[1];
|
||||||
if (!strcasecmp(what, "*")) {
|
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);
|
switch_cache_db_persistant_execute(db, sql, 1);
|
||||||
} else {
|
} 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);
|
switch_cache_db_persistant_execute(db, sql, 5);
|
||||||
}
|
}
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
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_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)
|
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
|
||||||
{
|
{
|
||||||
char *val;
|
char *val;
|
||||||
|
@ -270,6 +275,32 @@ SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
|
||||||
return val;
|
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)
|
static void switch_core_unset_variables(void)
|
||||||
{
|
{
|
||||||
switch_mutex_lock(runtime.global_var_mutex);
|
switch_mutex_lock(runtime.global_var_mutex);
|
||||||
|
@ -1205,12 +1236,18 @@ static void switch_core_set_serial(void)
|
||||||
|
|
||||||
|
|
||||||
if ((fd = open(path, O_RDONLY, 0)) < 0) {
|
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;
|
uint32_t ipi = 0;
|
||||||
switch_byte_t *byte;
|
switch_byte_t *byte;
|
||||||
int i = 0;
|
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;
|
byte = (switch_byte_t *) & ipi;
|
||||||
|
|
||||||
for (i = 0; i < 8; i += 2) {
|
for (i = 0; i < 8; i += 2) {
|
||||||
|
@ -1240,7 +1277,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||||
char guess_ip[256];
|
char guess_ip[256];
|
||||||
int mask = 0;
|
int mask = 0;
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
char hostname[256] = "";
|
|
||||||
|
|
||||||
if (runtime.runlevel > 0) {
|
if (runtime.runlevel > 0) {
|
||||||
/* one per customer */
|
/* one per customer */
|
||||||
|
@ -1315,8 +1352,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||||
runtime.console = stdout;
|
runtime.console = stdout;
|
||||||
}
|
}
|
||||||
|
|
||||||
gethostname(hostname, sizeof(hostname));
|
gethostname(runtime.hostname, sizeof(runtime.hostname));
|
||||||
switch_core_set_variable("hostname", hostname);
|
switch_core_set_variable("hostname", runtime.hostname);
|
||||||
|
|
||||||
switch_find_local_ip(guess_ip, sizeof(guess_ip), &mask, AF_INET);
|
switch_find_local_ip(guess_ip, sizeof(guess_ip), &mask, AF_INET);
|
||||||
switch_core_set_variable("local_ip_v4", guess_ip);
|
switch_core_set_variable("local_ip_v4", guess_ip);
|
||||||
|
@ -1455,7 +1492,7 @@ static void switch_load_core_config(const char *file)
|
||||||
{
|
{
|
||||||
switch_xml_t xml = NULL, cfg = NULL;
|
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);
|
switch_core_hash_insert(runtime.ptimes, "G723", &d_30);
|
||||||
|
|
||||||
if ((xml = switch_xml_open_cfg(file, &cfg, NULL))) {
|
if ((xml = switch_xml_open_cfg(file, &cfg, NULL))) {
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
* Michael Jerris <mike@jerris.com>
|
* Michael Jerris <mike@jerris.com>
|
||||||
* Paul D. Tinsley <pdt at jackhammer.org>
|
* Paul D. Tinsley <pdt at jackhammer.org>
|
||||||
* Christopher M. Rienzo <chris@rienzo.net>
|
* Christopher M. Rienzo <chris@rienzo.net>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* switch_core_asr.c -- Main Core Library (Speech Detection Interface)
|
* switch_core_asr.c -- Main Core Library (Speech Detection Interface)
|
||||||
|
@ -160,6 +161,45 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_enable_grammar(switch_asr_handle_t *ah, const char *name)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
|
switch_assert(ah != NULL);
|
||||||
|
|
||||||
|
if (ah->asr_interface->asr_enable_grammar) {
|
||||||
|
status = ah->asr_interface->asr_enable_grammar(ah, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_grammar(switch_asr_handle_t *ah, const char *name)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
|
switch_assert(ah != NULL);
|
||||||
|
|
||||||
|
if (ah->asr_interface->asr_disable_grammar) {
|
||||||
|
status = ah->asr_interface->asr_disable_grammar(ah, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_all_grammars(switch_asr_handle_t *ah)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
|
switch_assert(ah != NULL);
|
||||||
|
|
||||||
|
if (ah->asr_interface->asr_disable_all_grammars) {
|
||||||
|
status = ah->asr_interface->asr_disable_all_grammars(ah);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_pause(switch_asr_handle_t *ah)
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_pause(switch_asr_handle_t *ah)
|
||||||
{
|
{
|
||||||
switch_assert(ah != NULL);
|
switch_assert(ah != NULL);
|
||||||
|
@ -199,6 +239,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_feed(switch_asr_handle_t *ah, vo
|
||||||
return ah->asr_interface->asr_feed(ah, data, len, flags);
|
return ah->asr_interface->asr_feed(ah, data, len, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_feed_dtmf(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags)
|
||||||
|
{
|
||||||
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
|
switch_assert(ah != NULL);
|
||||||
|
|
||||||
|
if (ah->asr_interface->asr_feed_dtmf) {
|
||||||
|
status = ah->asr_interface->asr_feed_dtmf(ah, dtmf, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_check_results(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
|
SWITCH_DECLARE(switch_status_t) switch_core_asr_check_results(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
|
||||||
{
|
{
|
||||||
switch_assert(ah != NULL);
|
switch_assert(ah != NULL);
|
||||||
|
|
|
@ -102,7 +102,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!spool_path) {
|
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;
|
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_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;
|
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) {
|
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");
|
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_application_interface_t *application_interface;
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
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)) {
|
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);
|
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;
|
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')",
|
new_sql() = switch_mprintf("insert into tasks values(%q,'%q','%q',%q, '%q')",
|
||||||
id,
|
id,
|
||||||
switch_event_get_header_nil(event, "task-desc"),
|
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_DEL_SCHEDULE:
|
||||||
case SWITCH_EVENT_EXE_SCHEDULE:
|
case SWITCH_EVENT_EXE_SCHEDULE:
|
||||||
new_sql() = switch_mprintf("delete from tasks where task_id=%q and hostname='%q'",
|
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;
|
break;
|
||||||
case SWITCH_EVENT_RE_SCHEDULE:
|
case SWITCH_EVENT_RE_SCHEDULE:
|
||||||
{
|
{
|
||||||
|
@ -1153,22 +1153,21 @@ 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'",
|
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-desc"),
|
||||||
switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", id,
|
switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", id,
|
||||||
switch_core_get_variable("hostname"));
|
switch_core_get_hostname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SWITCH_EVENT_CHANNEL_DESTROY:
|
case SWITCH_EVENT_CHANNEL_DESTROY:
|
||||||
{
|
{
|
||||||
const char *uuid = switch_event_get_header(event, "unique-id");
|
const char *uuid = switch_event_get_header(event, "unique-id");
|
||||||
const char *sig = switch_event_get_header(event, "signal_bridge");
|
|
||||||
|
|
||||||
if (uuid) {
|
if (uuid) {
|
||||||
new_sql() = switch_mprintf("delete from channels where uuid='%q' and hostname='%q'",
|
new_sql() = switch_mprintf("delete from channels where uuid='%q' and hostname='%q'",
|
||||||
uuid, switch_core_get_variable("hostname"));
|
uuid, switch_core_get_hostname());
|
||||||
if (switch_true(sig)) {
|
|
||||||
new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' || callee_uuid='%q') and hostname='%q'",
|
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());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1179,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'",
|
"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, "unique-id"),
|
||||||
switch_event_get_header_nil(event, "old-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, "unique-id"),
|
||||||
switch_event_get_header_nil(event, "old-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, "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;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1199,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-state"),
|
||||||
switch_event_get_header_nil(event, "channel-call-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-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;
|
break;
|
||||||
case SWITCH_EVENT_CODEC:
|
case SWITCH_EVENT_CODEC:
|
||||||
|
@ -1212,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-name"),
|
||||||
switch_event_get_header_nil(event, "channel-write-codec-rate"),
|
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, "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;
|
break;
|
||||||
case SWITCH_EVENT_CHANNEL_HOLD:
|
case SWITCH_EVENT_CHANNEL_HOLD:
|
||||||
case SWITCH_EVENT_CHANNEL_UNHOLD:
|
case SWITCH_EVENT_CHANNEL_UNHOLD:
|
||||||
|
@ -1224,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, "application-data"),
|
||||||
switch_event_get_header_nil(event, "channel-presence-id"),
|
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-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()
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1239,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-presence-data"),
|
||||||
switch_event_get_header_nil(event, "channel-call-uuid"),
|
switch_event_get_header_nil(event, "channel-call-uuid"),
|
||||||
extra_cols,
|
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);
|
free(extra_cols);
|
||||||
} else {
|
} else {
|
||||||
new_sql() = switch_mprintf("update channels set "
|
new_sql() = switch_mprintf("update channels set "
|
||||||
|
@ -1247,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-id"),
|
||||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||||
switch_event_get_header_nil(event, "channel-call-uuid"),
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1282,7 +1281,7 @@ static void core_event_handler(switch_event_t *event)
|
||||||
switch_str_nil(name),
|
switch_str_nil(name),
|
||||||
switch_str_nil(number),
|
switch_str_nil(number),
|
||||||
switch_event_get_header_nil(event, "direction"),
|
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");
|
name = switch_event_get_header(event, "callee-name");
|
||||||
number = switch_event_get_header(event, "callee-number");
|
number = switch_event_get_header(event, "callee-number");
|
||||||
|
@ -1299,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'",
|
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, "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;
|
break;
|
||||||
|
@ -1331,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-id"),
|
||||||
switch_event_get_header_nil(event, "channel-presence-data"),
|
switch_event_get_header_nil(event, "channel-presence-data"),
|
||||||
extra_cols,
|
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);
|
free(extra_cols);
|
||||||
} else {
|
} else {
|
||||||
new_sql() = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',"
|
new_sql() = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',"
|
||||||
|
@ -1346,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, "caller-context"),
|
||||||
switch_event_get_header_nil(event, "channel-presence-id"),
|
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-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;
|
break;
|
||||||
default:
|
default:
|
||||||
new_sql() = switch_mprintf("update channels set state='%s' where uuid='%s' and hostname='%q'",
|
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, "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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1378,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'",
|
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, "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) {
|
if (runtime.odbc_dbtype == DBTYPE_DEFAULT) {
|
||||||
func_name = "function";
|
func_name = "function";
|
||||||
|
@ -1405,19 +1404,23 @@ static void core_event_handler(switch_event_t *event)
|
||||||
callee_cid_num,
|
callee_cid_num,
|
||||||
switch_event_get_header_nil(event, "Other-Leg-destination-number"),
|
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-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;
|
break;
|
||||||
case SWITCH_EVENT_CHANNEL_UNBRIDGE:
|
case SWITCH_EVENT_CHANNEL_UNBRIDGE:
|
||||||
new_sql() = switch_mprintf("delete from calls where caller_uuid='%s' and hostname='%q'",
|
{
|
||||||
switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_variable("hostname"));
|
char *uuid = switch_event_get_header_nil(event, "caller-unique-id");
|
||||||
break;
|
|
||||||
|
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:
|
case SWITCH_EVENT_SHUTDOWN:
|
||||||
new_sql() = switch_mprintf("delete from channels where hostname='%q';"
|
new_sql() = switch_mprintf("delete from channels where hostname='%q';"
|
||||||
"delete from interfaces where hostname='%q';"
|
"delete from interfaces where hostname='%q';"
|
||||||
"delete from calls 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;
|
break;
|
||||||
case SWITCH_EVENT_LOG:
|
case SWITCH_EVENT_LOG:
|
||||||
|
@ -1435,7 +1438,7 @@ static void core_event_handler(switch_event_t *event)
|
||||||
switch_mprintf
|
switch_mprintf
|
||||||
("insert into interfaces (type,name,description,syntax,ikey,filename,hostname) values('%q','%q','%q','%q','%q','%q','%q')", type, name,
|
("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_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;
|
break;
|
||||||
|
@ -1446,7 +1449,7 @@ static void core_event_handler(switch_event_t *event)
|
||||||
const char *name = switch_event_get_header_nil(event, "name");
|
const char *name = switch_event_get_header_nil(event, "name");
|
||||||
if (!zstr(type) && !zstr(name)) {
|
if (!zstr(type) && !zstr(name)) {
|
||||||
new_sql() = switch_mprintf("delete from interfaces where type='%q' and name='%q' and hostname='%q'", type, 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;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1458,7 +1461,7 @@ static void core_event_handler(switch_event_t *event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
new_sql() = switch_mprintf("update channels set secure='%s' where uuid='%s' and hostname='%q'",
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1469,12 +1472,12 @@ static void core_event_handler(switch_event_t *event)
|
||||||
if (!strcmp("add", op)) {
|
if (!strcmp("add", op)) {
|
||||||
new_sql() = switch_mprintf("insert into nat (port, proto, sticky, hostname) values (%s, %s, %d,'%q')",
|
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, "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)) {
|
} else if (!strcmp("del", op)) {
|
||||||
new_sql() = switch_mprintf("delete from nat where port=%s and proto=%s and hostname='%q'",
|
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, "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)) {
|
} else if (!strcmp("status", op)) {
|
||||||
/* call show nat api */
|
/* call show nat api */
|
||||||
} else if (!strcmp("status_response", op)) {
|
} else if (!strcmp("status_response", op)) {
|
||||||
|
@ -1661,7 +1664,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
|
||||||
char sql[512] = "";
|
char sql[512] = "";
|
||||||
char *tables[] = { "channels", "calls", "interfaces", "tasks", NULL };
|
char *tables[] = { "channels", "calls", "interfaces", "tasks", NULL };
|
||||||
int i;
|
int i;
|
||||||
const char *hostname = switch_core_get_variable("hostname");
|
const char *hostname = switch_core_get_hostname();
|
||||||
|
|
||||||
for (i = 0; tables[i]; i++) {
|
for (i = 0; tables[i]; i++) {
|
||||||
switch_snprintf(sql, sizeof(sql), "delete from %s where hostname='%s'", tables[i], hostname);
|
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_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)
|
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 *cloned_sub_val = NULL;
|
||||||
char *func_val = NULL;
|
char *func_val = NULL;
|
||||||
int nv = 0;
|
int nv = 0;
|
||||||
|
char *gvar = NULL;
|
||||||
|
|
||||||
nv = switch_string_var_check_const(in) || switch_string_has_escaped_data(in);
|
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))) {
|
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) {
|
if (offset || ooffset) {
|
||||||
|
@ -1785,6 +1789,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(indup);
|
free(indup);
|
||||||
|
switch_safe_free(gvar);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
* Anthony Minessale II <anthm@freeswitch.org>
|
* Anthony Minessale II <anthm@freeswitch.org>
|
||||||
* Michael Jerris <mike@jerris.com>
|
* Michael Jerris <mike@jerris.com>
|
||||||
* Bret McDanel <bret AT 0xdecafbad dot com>
|
* Bret McDanel <bret AT 0xdecafbad dot com>
|
||||||
|
* Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
|
||||||
*
|
*
|
||||||
* switch_ivr_async.c -- IVR Library (async operations)
|
* switch_ivr_async.c -- IVR Library (async operations)
|
||||||
*
|
*
|
||||||
|
@ -3208,6 +3209,20 @@ static switch_bool_t speech_callback(switch_media_bug_t *bug, void *user_data, s
|
||||||
return SWITCH_TRUE;
|
return SWITCH_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static switch_status_t speech_on_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf, switch_dtmf_direction_t direction)
|
||||||
|
{
|
||||||
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||||
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||||
|
|
||||||
|
if (switch_core_asr_feed_dtmf(sth->ah, dtmf, &flags) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error Feeding DTMF\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_stop_detect_speech(switch_core_session_t *session)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_stop_detect_speech(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
@ -3277,6 +3292,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_set_param_detect_speech(switch_core_s
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(switch_core_session_t *session)
|
||||||
|
{
|
||||||
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||||
|
|
||||||
|
if (sth) {
|
||||||
|
switch_core_asr_start_input_timers(sth->ah);
|
||||||
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
@ -3294,6 +3321,57 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_enable_grammar(switch_core_session_t *session, const char *name)
|
||||||
|
{
|
||||||
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||||
|
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
|
if (sth) {
|
||||||
|
if ((status = switch_core_asr_enable_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error enabling Grammar\n");
|
||||||
|
switch_core_asr_close(sth->ah, &flags);
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_grammar(switch_core_session_t *session, const char *name)
|
||||||
|
{
|
||||||
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||||
|
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
|
if (sth) {
|
||||||
|
if ((status = switch_core_asr_disable_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error disabling Grammar\n");
|
||||||
|
switch_core_asr_close(sth->ah, &flags);
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_all_grammars(switch_core_session_t *session)
|
||||||
|
{
|
||||||
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
|
||||||
|
struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
|
if (sth) {
|
||||||
|
if ((status = switch_core_asr_disable_all_grammars(sth->ah)) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error disabling all Grammars\n");
|
||||||
|
switch_core_asr_close(sth->ah, &flags);
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *session,
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *session,
|
||||||
const char *mod_name,
|
const char *mod_name,
|
||||||
const char *grammar, const char *name, const char *dest, switch_asr_handle_t *ah)
|
const char *grammar, const char *name, const char *dest, switch_asr_handle_t *ah)
|
||||||
|
@ -3360,6 +3438,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((status = switch_core_event_hook_add_recv_dtmf(session, speech_on_dtmf)) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
switch_ivr_stop_detect_speech(session);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
switch_channel_set_private(channel, SWITCH_SPEECH_KEY, sth);
|
switch_channel_set_private(channel, SWITCH_SPEECH_KEY, sth);
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
switch_nat_type_t nat_type;
|
switch_nat_type_t nat_type;
|
||||||
|
char nat_type_str[5];
|
||||||
struct UPNPUrls urls;
|
struct UPNPUrls urls;
|
||||||
struct IGDdatas data;
|
struct IGDdatas data;
|
||||||
char *descURL;
|
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_public_addr", nat_globals.pub_addr);
|
||||||
switch_core_set_variable("nat_private_addr", nat_globals.pvt_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");
|
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",
|
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);
|
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;
|
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_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)
|
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)
|
SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_ZRTP
|
#ifdef ENABLE_ZRTP
|
||||||
const char *zid_string = switch_core_get_variable("switch_serial");
|
const char *zid_string = switch_core_get_variable_pdup("switch_serial", pool);
|
||||||
const char *zrtp_enabled = switch_core_get_variable("zrtp_enabled");
|
const char *zrtp_enabled = switch_core_get_variable_pdup("zrtp_enabled", pool);
|
||||||
zrtp_config_t zrtp_config;
|
zrtp_config_t zrtp_config;
|
||||||
char zrtp_cache_path[256] = "";
|
char zrtp_cache_path[256] = "";
|
||||||
zrtp_on = zrtp_enabled ? switch_true(zrtp_enabled) : 0;
|
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)
|
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_n_debug(rtp_session->jb, name);
|
||||||
stfu_global_set_logger(jb_logger);
|
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;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
char *base;
|
char *base;
|
||||||
const char *force_local_ip_v4 = switch_core_get_variable("force_local_ip_v4");
|
char *force_local_ip_v4 = switch_core_get_variable_dup("force_local_ip_v4");
|
||||||
const char *force_local_ip_v6 = switch_core_get_variable("force_local_ip_v6");
|
char *force_local_ip_v6 = switch_core_get_variable_dup("force_local_ip_v6");
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
SOCKET tmp_socket;
|
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:
|
case AF_INET:
|
||||||
if (force_local_ip_v4) {
|
if (force_local_ip_v4) {
|
||||||
switch_copy_string(buf, force_local_ip_v4, len);
|
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;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
if (force_local_ip_v6) {
|
if (force_local_ip_v6) {
|
||||||
switch_copy_string(buf, force_local_ip_v6, len);
|
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;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
switch_safe_free(force_local_ip_v4);
|
||||||
|
switch_safe_free(force_local_ip_v6);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1208,11 +1208,12 @@ static char *expand_vars(char *buf, char *ebuf, switch_size_t elen, switch_size_
|
||||||
var = rp;
|
var = rp;
|
||||||
*e++ = '\0';
|
*e++ = '\0';
|
||||||
rp = e;
|
rp = e;
|
||||||
if ((val = switch_core_get_variable(var))) {
|
if ((val = switch_core_get_variable_dup(var))) {
|
||||||
char *p;
|
char *p;
|
||||||
for (p = val; p && *p && wp <= ep; p++) {
|
for (p = val; p && *p && wp <= ep; p++) {
|
||||||
*wp++ = *p;
|
*wp++ = *p;
|
||||||
}
|
}
|
||||||
|
free(val);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
} else if (err) {
|
} else if (err) {
|
||||||
|
@ -1286,9 +1287,7 @@ static int preprocess_glob(const char *cwd, const char *pattern, int write_fd, i
|
||||||
}
|
}
|
||||||
|
|
||||||
if (glob(pattern, GLOB_NOCHECK, NULL, &glob_data) != 0) {
|
if (glob(pattern, GLOB_NOCHECK, NULL, &glob_data) != 0) {
|
||||||
if (stderr) {
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error including %s\n", pattern);
|
||||||
fprintf(stderr, "Error including %s\n", pattern);
|
|
||||||
}
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1299,11 +1298,9 @@ static int preprocess_glob(const char *cwd, const char *pattern, int write_fd, i
|
||||||
*e = '\0';
|
*e = '\0';
|
||||||
}
|
}
|
||||||
if (preprocess(dir_path, glob_data.gl_pathv[n], write_fd, rlevel) < 0) {
|
if (preprocess(dir_path, glob_data.gl_pathv[n], write_fd, rlevel) < 0) {
|
||||||
const char *reason = strerror(errno);
|
|
||||||
if (rlevel > 100) {
|
if (rlevel > 100) {
|
||||||
reason = "Maximum recursion limit reached";
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error including %s (Maximum recursion limit reached)\n", pattern);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "Error including %s (%s)\n", pattern, reason);
|
|
||||||
}
|
}
|
||||||
free(dir_path);
|
free(dir_path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_config_parse_event(switch_event_t *ev
|
||||||
|
|
||||||
if (int_options) {
|
if (int_options) {
|
||||||
/* Enforce validation options */
|
/* Enforce validation options */
|
||||||
if ((int_options->enforce_min && !(intval > int_options->min)) || (int_options->enforce_max && !(intval < int_options->max))) {
|
if ((int_options->enforce_min && !(intval >= int_options->min)) || (int_options->enforce_max && !(intval <= int_options->max))) {
|
||||||
/* Validation failed, set default */
|
/* Validation failed, set default */
|
||||||
intval = (int) (intptr_t) item->defaultvalue;
|
intval = (int) (intptr_t) item->defaultvalue;
|
||||||
/* Then complain */
|
/* Then complain */
|
||||||
|
|
|
@ -2,7 +2,7 @@ UNAME=`uname`
|
||||||
|
|
||||||
|
|
||||||
NEEDED_PACKAGES_YUM='automake autoconf libtool screen gdb gcc-c++ compat-gcc-32 compat-gcc-32-c++ subversion ncurses-devel unixODBC-devel make wget'
|
NEEDED_PACKAGES_YUM='automake autoconf libtool screen gdb gcc-c++ compat-gcc-32 compat-gcc-32-c++ subversion ncurses-devel unixODBC-devel make wget'
|
||||||
NEEDED_PACAKGES_APT='automake autoconf libtool screen gdb libncurses5-dev unixodbc-dev subversion emacs22-nox gcc g++ make'
|
NEEDED_PACAKGES_APT='automake autoconf libtool screen gdb libncurses5-dev unixodbc-dev subversion emacs22-nox gcc g++ make libjpeg-dev'
|
||||||
NEEDED_PACKAGES_PKG_ADD=''
|
NEEDED_PACKAGES_PKG_ADD=''
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue