mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-15 05:48:33 +00:00
FS-6450 [unimrcp] Update library
[apr] Backport APR_RING_FOREACH and APR_RING_FOREACH_SAFE macros to APR for unimrcp compatibility. [unimrcp] configure.gnu - need full path, not relative path for library paths [unimrcp] added uni_revision.h - couldn't get it to autogenerate from build [mod_unimrcp] add better logging and error checking on module load. Currently dumps core on MRCPv1 TTS attempt [mod_unimrcp] don't configure MRCPv1 session with a connection agent- causes crash
This commit is contained in:
1 parent
f198d82bac
commit
8330336e9a
533 files changed
+16386
-18997
No files matched your search
@@ -1,6 +1,27 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
SUBDIRS = libunimrcp-server unimrcp-server \
|
||||
libunimrcp-client unimrcp-client \
|
||||
libasr-client asr-client \
|
||||
umc
|
||||
SUBDIRS =
|
||||
|
||||
if UNIMRCP_CLIENT_LIB
|
||||
SUBDIRS += libunimrcp-client
|
||||
endif
|
||||
|
||||
if UNIMRCP_CLIENT_APP
|
||||
SUBDIRS += unimrcp-client
|
||||
endif
|
||||
|
||||
if UMC
|
||||
SUBDIRS += umc
|
||||
endif
|
||||
|
||||
if ASR_CLIENT
|
||||
SUBDIRS += libasr-client asr-client
|
||||
endif
|
||||
|
||||
if UNIMRCP_SERVER_LIB
|
||||
SUBDIRS += libunimrcp-server
|
||||
endif
|
||||
|
||||
if UNIMRCP_SERVER_APP
|
||||
SUBDIRS += unimrcp-server
|
||||
endif
|
||||
@@ -1,24 +1,10 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
AM_CPPFLAGS = -Iinclude \
|
||||
-I$(top_srcdir)/platforms/libasr-client/include \
|
||||
-I$(top_srcdir)/platforms/libunimrcp-client/include \
|
||||
-I$(top_srcdir)/libs/mrcp-client/include \
|
||||
-I$(top_srcdir)/libs/mrcp-signaling/include \
|
||||
-I$(top_srcdir)/libs/mrcpv2-transport/include \
|
||||
-I$(top_srcdir)/libs/mrcp/include \
|
||||
-I$(top_srcdir)/libs/mrcp/message/include \
|
||||
-I$(top_srcdir)/libs/mrcp/control/include \
|
||||
-I$(top_srcdir)/libs/mrcp/resources/include \
|
||||
-I$(top_srcdir)/libs/mpf/include \
|
||||
-I$(top_srcdir)/libs/apr-toolkit/include \
|
||||
$(UNIMRCP_APR_INCLUDES) $(UNIMRCP_APU_INCLUDES)
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/platforms/libasr-client/include \
|
||||
$(UNIMRCP_CLIENTAPP_INCLUDES)
|
||||
|
||||
bin_PROGRAMS = asrclient
|
||||
asrclient_SOURCES = src/main.c
|
||||
|
||||
asrclient_LDADD = $(top_builddir)/platforms/libasr-client/libasrclient.la
|
||||
|
||||
if ISMAC
|
||||
asrclient_LDFLAGS = -framework CoreFoundation -framework SystemConfiguration
|
||||
endif
|
||||
asrclient_SOURCES = src/main.c
|
||||
asrclient_LDADD = $(top_builddir)/platforms/libasr-client/libasrclient.la
|
||||
asrclient_LDFLAGS = $(UNIMRCP_CLIENTAPP_OPTS)
|
||||
|
||||
include $(top_srcdir)/build/rules/uniclientapp.am
|
||||
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{6B83AC6D-01CE-4E1C-81CE-02AD8116C684}</ProjectGuid>
|
||||
<RootNamespace>asrclient</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;..\libasr-client\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libasrclient.lib;libapr-1.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;..\libasr-client\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libasrclient.lib;libapr-1.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;..\libasr-client\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libasrclient.lib;libapr-1.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;..\libasr-client\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>libasrclient.lib;libapr-1.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\main.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\libasr-client\libasrclient.vcxproj">
|
||||
<Project>{272fafa8-2b2f-4716-b95f-3b37cf2e0cb3}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="include">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\main.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: main.c 1541 2010-02-22 20:20:10Z achaloyan $
|
||||
* $Id: main.c 2213 2014-11-06 03:02:45Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -146,7 +146,7 @@ static apt_bool_t cmdline_run(asr_engine_t *engine)
|
||||
{
|
||||
apt_bool_t running = TRUE;
|
||||
char cmdline[1024];
|
||||
int i;
|
||||
apr_size_t i;
|
||||
do {
|
||||
printf(">");
|
||||
memset(&cmdline, 0, sizeof(cmdline));
|
||||
@@ -165,7 +165,7 @@ static apt_bool_t cmdline_run(asr_engine_t *engine)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void usage()
|
||||
static void usage(void)
|
||||
{
|
||||
printf(
|
||||
"\n"
|
||||
@@ -220,7 +220,7 @@ static client_options_t* options_load(int argc, const char * const *argv)
|
||||
options = apr_palloc(pool,sizeof(client_options_t));
|
||||
options->pool = pool;
|
||||
/* set the default options */
|
||||
options->root_dir_path = "../";
|
||||
options->root_dir_path = NULL;
|
||||
options->log_priority = APT_PRIO_INFO;
|
||||
options->log_output = APT_LOG_OUTPUT_CONSOLE;
|
||||
|
||||
|
||||
@@ -1,25 +1,12 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
AM_CPPFLAGS = -Iinclude \
|
||||
-I$(unimrcp_srcdir)/platforms/libasr-client/include \
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/platforms/libasr-client/include \
|
||||
-I$(top_srcdir)/platforms/libunimrcp-client/include \
|
||||
-I$(top_srcdir)/libs/mrcp-client/include \
|
||||
-I$(top_srcdir)/libs/mrcp-signaling/include \
|
||||
-I$(top_srcdir)/libs/mrcpv2-transport/include \
|
||||
-I$(top_srcdir)/libs/mrcp/include \
|
||||
-I$(top_srcdir)/libs/mrcp/message/include \
|
||||
-I$(top_srcdir)/libs/mrcp/control/include \
|
||||
-I$(top_srcdir)/libs/mrcp/resources/include \
|
||||
-I$(top_srcdir)/libs/mpf/include \
|
||||
-I$(top_srcdir)/libs/apr-toolkit/include \
|
||||
$(UNIMRCP_APR_INCLUDES) $(UNIMRCP_APU_INCLUDES)
|
||||
$(UNIMRCP_CLIENTLIB_INCLUDES)
|
||||
|
||||
lib_LTLIBRARIES = libasrclient.la
|
||||
|
||||
include_HEADERS = include/asr_engine.h
|
||||
|
||||
libasrclient_la_SOURCES = src/asr_engine.c
|
||||
|
||||
libasrclient_la_LIBADD = $(top_builddir)/platforms/libunimrcp-client/libunimrcpclient.la
|
||||
|
||||
libasrclient_la_LDFLAGS = $(UNI_LT_VERSION)
|
||||
libasrclient_la_LDFLAGS = $(UNIMRCP_CLIENTLIB_OPTS)
|
||||
|
||||
include $(top_srcdir)/build/rules/uniclientlib.am
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2009-2010 Arsen Chaloyan
|
||||
* Copyright 2009-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: asr_engine.h 1566 2010-03-06 16:45:05Z achaloyan $
|
||||
* $Id: asr_engine.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef ASR_ENGINE_H
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{272FAFA8-2B2F-4716-B95F-3B37CF2E0CB3}</ProjectGuid>
|
||||
<RootNamespace>libasrclient</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>ASR_CLIENT_LIB_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>ASR_CLIENT_LIB_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>ASR_CLIENT_LIB_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>ASR_CLIENT_LIB_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\asr_engine.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\asr_engine.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\libunimrcp-client\libunimrcpclient.vcxproj">
|
||||
<Project>{ee157390-1e85-416c-946e-620e32c9ad33}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="include">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{21e6c16e-f977-468a-9576-0c5981eb7da5}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\asr_engine.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\asr_engine.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2009-2010 Arsen Chaloyan
|
||||
* Copyright 2009-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: asr_engine.c 1785 2010-09-22 06:14:29Z achaloyan $
|
||||
* $Id: asr_engine.c 2204 2014-10-31 01:01:42Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -96,6 +96,7 @@ static const mpf_audio_stream_vtable_t audio_stream_vtable = {
|
||||
asr_stream_read,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -127,7 +128,8 @@ ASR_CLIENT_DECLARE(asr_engine_t*) asr_engine_create(
|
||||
|
||||
if((log_output & APT_LOG_OUTPUT_FILE) == APT_LOG_OUTPUT_FILE) {
|
||||
/* open the log file */
|
||||
apt_log_file_open(dir_layout->log_dir_path,"unimrcpclient",MAX_LOG_FILE_SIZE,MAX_LOG_FILE_COUNT,FALSE,pool);
|
||||
const char *log_dir_path = apt_dir_layout_path_get(dir_layout,APT_LAYOUT_LOG_DIR);
|
||||
apt_log_file_open(log_dir_path,"unimrcpclient",MAX_LOG_FILE_SIZE,MAX_LOG_FILE_COUNT,FALSE,pool);
|
||||
}
|
||||
|
||||
engine = apr_palloc(pool,sizeof(asr_engine_t));
|
||||
@@ -291,17 +293,32 @@ static mrcp_message_t* define_grammar_message_create(asr_session_t *asr_session,
|
||||
apr_pool_t *pool = mrcp_application_session_pool_get(asr_session->mrcp_session);
|
||||
char *grammar_file_path = apt_datadir_filepath_get(dir_layout,grammar_file,pool);
|
||||
if(grammar_file_path) {
|
||||
char text[1024];
|
||||
apr_size_t size;
|
||||
FILE *grammar = fopen(grammar_file_path,"r");
|
||||
if(!grammar) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Cannot Open [%s]",grammar_file_path);
|
||||
apr_finfo_t finfo;
|
||||
apr_file_t *grammar_file;
|
||||
apt_str_t *content = &mrcp_message->body;
|
||||
|
||||
if(apr_file_open(&grammar_file,grammar_file_path,APR_FOPEN_READ|APR_FOPEN_BINARY,0,pool) != APR_SUCCESS) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Open Grammar File %s",grammar_file_path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size = fread(text,1,sizeof(text),grammar);
|
||||
apt_string_assign_n(&mrcp_message->body,text,size,mrcp_message->pool);
|
||||
fclose(grammar);
|
||||
if(apr_file_info_get(&finfo,APR_FINFO_SIZE,grammar_file) != APR_SUCCESS) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Grammar File Info %s",grammar_file_path);
|
||||
apr_file_close(grammar_file);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content->length = (apr_size_t)finfo.size;
|
||||
content->buf = (char*) apr_palloc(pool,content->length+1);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Load Grammar File Content size [%"APR_SIZE_T_FMT" bytes] %s",
|
||||
content->length,grammar_file_path);
|
||||
if(apr_file_read(grammar_file,content->buf,&content->length) != APR_SUCCESS) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Read Grammar File Content %s",grammar_file_path);
|
||||
apr_file_close(grammar_file);
|
||||
return NULL;
|
||||
}
|
||||
content->buf[content->length] = '\0';
|
||||
apr_file_close(grammar_file);
|
||||
}
|
||||
|
||||
/* get/allocate generic header */
|
||||
@@ -369,30 +386,30 @@ static mrcp_message_t* recognize_message_create(asr_session_t *asr_session)
|
||||
return mrcp_message;
|
||||
}
|
||||
|
||||
/** Get NLSML input result */
|
||||
static const char* nlsml_input_get(mrcp_message_t *message)
|
||||
/** Get NLSML result */
|
||||
static const char* nlsml_result_get(mrcp_message_t *message)
|
||||
{
|
||||
apr_xml_elem *interpret;
|
||||
apr_xml_elem *instance;
|
||||
apr_xml_elem *input;
|
||||
apr_xml_doc *doc = nlsml_doc_load(&message->body,message->pool);
|
||||
if(!doc) {
|
||||
nlsml_interpretation_t *interpretation;
|
||||
nlsml_instance_t *instance;
|
||||
nlsml_result_t *result = nlsml_result_parse(message->body.buf, message->body.length, message->pool);
|
||||
if(!result) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* get interpreted result */
|
||||
interpret = nlsml_first_interpret_get(doc);
|
||||
if(!interpret) {
|
||||
return NULL;
|
||||
}
|
||||
/* get instance and input */
|
||||
nlsml_interpret_results_get(interpret,&instance,&input);
|
||||
if(!input || !input->first_cdata.first) {
|
||||
/* get first interpretation */
|
||||
interpretation = nlsml_first_interpretation_get(result);
|
||||
if(!interpretation) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* return input */
|
||||
return input->first_cdata.first->text;
|
||||
/* get first instance */
|
||||
instance = nlsml_interpretation_first_instance_get(interpretation);
|
||||
if(!instance) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nlsml_instance_swi_suppress(instance);
|
||||
return nlsml_instance_content_generate(instance, message->pool);
|
||||
}
|
||||
|
||||
|
||||
@@ -619,7 +636,7 @@ ASR_CLIENT_DECLARE(const char*) asr_session_file_recognize(
|
||||
while(!asr_session->recog_complete);
|
||||
|
||||
/* Get results */
|
||||
return nlsml_input_get(asr_session->recog_complete);
|
||||
return nlsml_result_get(asr_session->recog_complete);
|
||||
}
|
||||
|
||||
/** Initiate recognition based on specified grammar and input stream */
|
||||
@@ -700,7 +717,7 @@ ASR_CLIENT_DECLARE(const char*) asr_session_stream_recognize(
|
||||
while(!asr_session->recog_complete);
|
||||
|
||||
/* Get results */
|
||||
return nlsml_input_get(asr_session->recog_complete);
|
||||
return nlsml_result_get(asr_session->recog_complete);
|
||||
}
|
||||
|
||||
/** Write audio frame to recognize */
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/platforms/libunimrcp-client/include \
|
||||
-I$(unimrcp_srcdir)/modules/mrcp-sofiasip/include \
|
||||
-I$(top_srcdir)/modules/mrcp-unirtsp/include \
|
||||
-I$(top_srcdir)/libs/mrcp-client/include \
|
||||
-I$(top_srcdir)/libs/mrcp-signaling/include \
|
||||
-I$(top_srcdir)/libs/mrcpv2-transport/include \
|
||||
-I$(top_srcdir)/libs/mrcp/include \
|
||||
-I$(top_srcdir)/libs/mrcp/message/include \
|
||||
-I$(top_srcdir)/libs/mrcp/control/include \
|
||||
-I$(top_srcdir)/libs/mrcp/resources/include \
|
||||
-I$(top_srcdir)/libs/mpf/include \
|
||||
-I$(top_srcdir)/libs/apr-toolkit/include \
|
||||
-I$(top_srcdir)/build \
|
||||
$(UNIMRCP_APR_INCLUDES) $(UNIMRCP_APU_INCLUDES)
|
||||
$(UNIMRCP_CLIENTLIB_INCLUDES)
|
||||
|
||||
lib_LTLIBRARIES = libunimrcpclient.la
|
||||
|
||||
include_HEADERS = include/unimrcp_client.h
|
||||
|
||||
libunimrcpclient_la_SOURCES = src/unimrcp_client.c
|
||||
libunimrcpclient_la_LIBADD = $(UNIMRCP_CLIENTLIB_LIBS)
|
||||
libunimrcpclient_la_LDFLAGS = $(UNIMRCP_CLIENTLIB_OPTS)
|
||||
|
||||
libunimrcpclient_la_LIBADD = $(top_builddir)/modules/mrcp-sofiasip/libmrcpsofiasip.la \
|
||||
$(top_builddir)/modules/mrcp-unirtsp/libmrcpunirtsp.la \
|
||||
$(top_builddir)/libs/mrcpv2-transport/libmrcpv2transport.la \
|
||||
$(top_builddir)/libs/mrcp-client/libmrcpclient.la \
|
||||
$(top_builddir)/libs/mrcp-signaling/libmrcpsignaling.la \
|
||||
$(top_builddir)/libs/mrcp/libmrcp.la \
|
||||
$(top_builddir)/libs/mpf/libmpf.la \
|
||||
$(top_builddir)/libs/apr-toolkit/libaprtoolkit.la \
|
||||
$(UNIMRCP_APR_LIBS) $(UNIMRCP_APU_LIBS) $(UNIMRCP_SOFIA_LIBS) -lm
|
||||
|
||||
libunimrcpclient_la_LDFLAGS = $(UNI_LT_VERSION)
|
||||
include $(top_srcdir)/build/rules/uniclientlib.am
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: unimrcp_client.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: unimrcp_client.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef UNIMRCP_CLIENT_H
|
||||
@@ -34,6 +34,12 @@ APT_BEGIN_EXTERN_C
|
||||
*/
|
||||
MRCP_DECLARE(mrcp_client_t*) unimrcp_client_create(apt_dir_layout_t *dir_layout);
|
||||
|
||||
/**
|
||||
* Create UniMRCP client.
|
||||
* @param xmlconfig XML configuration string
|
||||
*/
|
||||
MRCP_DECLARE(mrcp_client_t*) unimrcp_client_create2(const char *xmlconfig);
|
||||
|
||||
|
||||
APT_END_EXTERN_C
|
||||
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="libunimrcpclient"
|
||||
ProjectGUID="{EE157390-1E85-416C-946E-620E32C9AD33}"
|
||||
RootNamespace="libunimrcpclient"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unidebug.vsprops;$(ProjectDir)..\..\build\vsprops\unimrcpclient.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""$(ProjectRootDir)modules\mrcp-sofiasip\include";"$(ProjectRootDir)modules\mrcp-unirtsp\include""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unirelease.vsprops;$(ProjectDir)..\..\build\vsprops\unimrcpclient.vsprops"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""$(ProjectRootDir)modules\mrcp-sofiasip\include";"$(ProjectRootDir)modules\mrcp-unirtsp\include""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="include"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\build\uni_revision.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\build\uni_version.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\unimrcp_client.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="src"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\unimrcp_client.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{EE157390-1E85-416C-946E-620E32C9AD33}</ProjectGuid>
|
||||
<RootNamespace>libunimrcpclient</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unilib.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unilib.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unilib-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unilib-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectRootDir)modules\mrcp-sofiasip\include;$(ProjectRootDir)modules\mrcp-unirtsp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectRootDir)modules\mrcp-sofiasip\include;$(ProjectRootDir)modules\mrcp-unirtsp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectRootDir)modules\mrcp-sofiasip\include;$(ProjectRootDir)modules\mrcp-unirtsp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectRootDir)modules\mrcp-sofiasip\include;$(ProjectRootDir)modules\mrcp-unirtsp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\build\uni_revision.h" />
|
||||
<ClInclude Include="..\..\build\uni_version.h" />
|
||||
<ClInclude Include="include\unimrcp_client.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\unimrcp_client.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\libs\mrcp-client\mrcpclient.vcxproj">
|
||||
<Project>{72782932-37cc-46ae-8c7f-9a7b1a6ee108}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\modules\mrcp-sofiasip\mrcpsofiasip.vcxproj">
|
||||
<Project>{746f3632-5bb2-4570-9453-31d6d58a7d8e}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\modules\mrcp-unirtsp\mrcpunirtsp.vcxproj">
|
||||
<Project>{deb01acb-d65f-4a62-aed9-58c1054499e9}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="include">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{15d2ec58-ba87-4dd8-9f7a-434f9e186e4e}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\build\uni_revision.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\build\uni_version.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\unimrcp_client.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\unimrcp_client.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: unimrcp_client.c 1750 2010-07-23 19:33:34Z achaloyan $
|
||||
* $Id: unimrcp_client.c 2231 2014-11-12 01:32:03Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -21,19 +21,21 @@
|
||||
#include <apr_fnmatch.h>
|
||||
#include <apr_version.h>
|
||||
#include "uni_version.h"
|
||||
#include "uni_revision.h"
|
||||
#include "unimrcp_client.h"
|
||||
#include "mrcp_resource_loader.h"
|
||||
#include "mpf_engine.h"
|
||||
#include "mpf_engine_factory.h"
|
||||
#include "mpf_codec_manager.h"
|
||||
#include "mpf_rtp_termination_factory.h"
|
||||
#include "mrcp_sofiasip_client_agent.h"
|
||||
#include "mrcp_unirtsp_client_agent.h"
|
||||
#include "mrcp_client_connection.h"
|
||||
#include "mrcp_ca_factory.h"
|
||||
#include "apt_net.h"
|
||||
#include "apt_log.h"
|
||||
|
||||
#define CONF_FILE_NAME "unimrcpclient.xml"
|
||||
#define DEFAULT_CONF_DIR_PATH "../conf"
|
||||
|
||||
#define DEFAULT_IP_ADDRESS "127.0.0.1"
|
||||
#define DEFAULT_SIP_PORT 8062
|
||||
@@ -53,6 +55,8 @@ typedef struct unimrcp_client_loader_t unimrcp_client_loader_t;
|
||||
struct unimrcp_client_loader_t {
|
||||
/** MRCP client */
|
||||
mrcp_client_t *client;
|
||||
/** Directory layout */
|
||||
apt_dir_layout_t *dir_layout;
|
||||
/** XML document */
|
||||
apr_xml_doc *doc;
|
||||
/** Pool to allocate memory from */
|
||||
@@ -69,21 +73,17 @@ struct unimrcp_client_loader_t {
|
||||
const char *auto_ip;
|
||||
};
|
||||
|
||||
static apt_bool_t unimrcp_client_load(unimrcp_client_loader_t *loader, const char *dir_path, const char *file_name, apr_pool_t *pool);
|
||||
static apt_bool_t unimrcp_client_load(unimrcp_client_loader_t *loader, const char *dir_path, const char *file_name);
|
||||
static apt_bool_t unimrcp_client_load2(unimrcp_client_loader_t *loader, const char *xmlconfig);
|
||||
|
||||
/** Create and load UniMRCP client */
|
||||
MRCP_DECLARE(mrcp_client_t*) unimrcp_client_create(apt_dir_layout_t *dir_layout)
|
||||
/** Initialize client -- common to unimrcp_client_create and unimrcp_client_create2 */
|
||||
static unimrcp_client_loader_t* unimrcp_client_init(apt_dir_layout_t *dir_layout)
|
||||
{
|
||||
apr_pool_t *pool;
|
||||
mrcp_client_t *client;
|
||||
const char *dir_path;
|
||||
unimrcp_client_loader_t *loader;
|
||||
|
||||
if(!dir_layout) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"UniMRCP Client ["UNI_VERSION_STRING"]");
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"UniMRCP Client ["UNI_VERSION_STRING"] [r"UNI_REVISION_STRING"]");
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"APR ["APR_VERSION_STRING"]");
|
||||
client = mrcp_client_create(dir_layout);
|
||||
if(!client) {
|
||||
@@ -95,6 +95,7 @@ MRCP_DECLARE(mrcp_client_t*) unimrcp_client_create(apt_dir_layout_t *dir_layout)
|
||||
}
|
||||
|
||||
loader = apr_palloc(pool,sizeof(unimrcp_client_loader_t));
|
||||
loader->dir_layout = dir_layout;
|
||||
loader->doc = NULL;
|
||||
loader->client = client;
|
||||
loader->pool = pool;
|
||||
@@ -102,23 +103,52 @@ MRCP_DECLARE(mrcp_client_t*) unimrcp_client_create(apt_dir_layout_t *dir_layout)
|
||||
loader->ext_ip = NULL;
|
||||
loader->server_ip = NULL;
|
||||
loader->auto_ip = NULL;
|
||||
return loader;
|
||||
}
|
||||
|
||||
dir_path = dir_layout->conf_dir_path;
|
||||
if(!dir_path) {
|
||||
dir_path = DEFAULT_CONF_DIR_PATH;
|
||||
/** Create and load UniMRCP client using the directories layout */
|
||||
MRCP_DECLARE(mrcp_client_t*) unimrcp_client_create(apt_dir_layout_t *dir_layout)
|
||||
{
|
||||
const char *dir_path;
|
||||
unimrcp_client_loader_t *loader;
|
||||
|
||||
if(!dir_layout) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(unimrcp_client_load(loader,dir_path,CONF_FILE_NAME,pool) == FALSE) {
|
||||
loader = unimrcp_client_init(dir_layout);
|
||||
if (!loader)
|
||||
return NULL;
|
||||
|
||||
dir_path = apt_dir_layout_path_get(dir_layout,APT_LAYOUT_CONF_DIR);
|
||||
|
||||
if(unimrcp_client_load(loader,dir_path,CONF_FILE_NAME) == FALSE) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Load UniMRCP Client Document");
|
||||
}
|
||||
|
||||
return client;
|
||||
return loader->client;
|
||||
}
|
||||
|
||||
/** Create UniMRCP client from XML string configuration */
|
||||
MRCP_DECLARE(mrcp_client_t*) unimrcp_client_create2(const char *xmlconfig)
|
||||
{
|
||||
unimrcp_client_loader_t *loader;
|
||||
|
||||
loader = unimrcp_client_init(NULL);
|
||||
if (!loader)
|
||||
return NULL;
|
||||
|
||||
if(unimrcp_client_load2(loader,xmlconfig) == FALSE) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Process UniMRCP Client Configuration");
|
||||
}
|
||||
|
||||
return loader->client;
|
||||
}
|
||||
|
||||
/** Check whether specified attribute is valid */
|
||||
static APR_INLINE apt_bool_t is_attr_valid(const apr_xml_attr *attr)
|
||||
{
|
||||
return (attr && attr->value && attr->value != '\0');
|
||||
return (attr && attr->value && *attr->value != '\0');
|
||||
}
|
||||
|
||||
/** Check whether specified attribute is enabled (true) */
|
||||
@@ -172,7 +202,37 @@ static apt_bool_t header_attribs_get(const apr_xml_elem *elem, const apr_xml_att
|
||||
*enable = attr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(is_attr_valid(*id) == FALSE) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Missing Required Attribute <id> in Element <%s>",elem->name);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Get profile attributes such as "id", "enable" and "tag" */
|
||||
static apt_bool_t profile_attribs_get(const apr_xml_elem *elem, const apr_xml_attr **id, const apr_xml_attr **enable, const apr_xml_attr **tag)
|
||||
{
|
||||
const apr_xml_attr *attr;
|
||||
if(!id || !enable || !tag) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*id = NULL;
|
||||
*enable = NULL;
|
||||
*tag = NULL;
|
||||
for(attr = elem->attr; attr; attr = attr->next) {
|
||||
if(strcasecmp(attr->name,"id") == 0) {
|
||||
*id = attr;
|
||||
}
|
||||
else if(strcasecmp(attr->name,"enable") == 0) {
|
||||
*enable = attr;
|
||||
}
|
||||
else if(strcasecmp(attr->name,"tag") == 0) {
|
||||
*tag = attr;
|
||||
}
|
||||
}
|
||||
|
||||
if(is_attr_valid(*id) == FALSE) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Missing Required Attribute <id> in Element <%s>",elem->name);
|
||||
return FALSE;
|
||||
@@ -220,6 +280,16 @@ static char* unimrcp_client_ip_address_get(unimrcp_client_loader_t *loader, cons
|
||||
}
|
||||
return apr_pstrdup(loader->pool,loader->auto_ip);
|
||||
}
|
||||
else if(attr && strcasecmp(attr->value,"iface") == 0) {
|
||||
/* get ip address by network interface name */
|
||||
char *ip_addr = DEFAULT_IP_ADDRESS;
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
const char *iface_name = cdata_text_get(elem);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Get IP Address by Interface [%s]", iface_name);
|
||||
apt_ip_get_by_iface(iface_name,&ip_addr,loader->pool);
|
||||
}
|
||||
return ip_addr;
|
||||
}
|
||||
|
||||
if(is_cdata_valid(elem)) {
|
||||
/* use specified ip address */
|
||||
@@ -243,7 +313,7 @@ static apt_bool_t unimrcp_client_resource_load(mrcp_resource_loader_t *resource_
|
||||
if(header_attribs_get(root,&id_attr,&enable_attr) == FALSE) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if(is_attr_enabled(enable_attr) == FALSE) {
|
||||
return TRUE;
|
||||
}
|
||||
@@ -271,7 +341,7 @@ static apt_bool_t unimrcp_client_resource_factory_load(unimrcp_client_loader_t *
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
resource_factory = mrcp_resource_factory_get(resource_loader);
|
||||
return mrcp_client_resource_factory_register(loader->client,resource_factory);
|
||||
}
|
||||
@@ -309,7 +379,18 @@ static apt_bool_t unimrcp_client_sip_uac_load(unimrcp_client_loader_t *loader, c
|
||||
}
|
||||
else if(strcasecmp(elem->name,"ua-name") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
config->user_agent_name = cdata_copy(elem,loader->pool);
|
||||
const apr_xml_attr *attr = NULL;
|
||||
for(attr = elem->attr; attr; attr = attr->next) {
|
||||
if(strcasecmp(attr->name,"appendversion") == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(is_attr_enabled(attr)) {
|
||||
config->user_agent_name = apr_psprintf(loader->pool,"%s "UNI_VERSION_STRING,cdata_text_get(elem));
|
||||
}
|
||||
else {
|
||||
config->user_agent_name = cdata_copy(elem,loader->pool);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"sdp-origin") == 0) {
|
||||
@@ -337,6 +418,25 @@ static apt_bool_t unimrcp_client_sip_uac_load(unimrcp_client_loader_t *loader, c
|
||||
config->sip_t1x64 = atol(cdata_text_get(elem));
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"sip-message-output") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
config->tport_log = cdata_bool_get(elem);
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"sip-message-dump") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
const char *root_path;
|
||||
const char *path = cdata_text_get(elem);
|
||||
if(loader->dir_layout && apr_filepath_root(&root_path,&path,0,loader->pool) == APR_ERELATIVE)
|
||||
config->tport_dump_file = apt_dir_layout_path_compose(
|
||||
loader->dir_layout,
|
||||
APT_LAYOUT_LOG_DIR,
|
||||
path,
|
||||
loader->pool);
|
||||
else
|
||||
config->tport_dump_file = cdata_copy(elem,loader->pool);
|
||||
}
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
@@ -387,7 +487,7 @@ static apt_bool_t unimrcp_client_rtsp_uac_load(unimrcp_client_loader_t *loader,
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
agent = mrcp_unirtsp_client_agent_create(id,config,loader->pool);
|
||||
return mrcp_client_signaling_agent_register(loader->client,agent);
|
||||
}
|
||||
@@ -413,7 +513,7 @@ static apt_bool_t unimrcp_client_mrcpv2_uac_load(unimrcp_client_loader_t *loader
|
||||
}
|
||||
else if(strcasecmp(elem->name,"offer-new-connection") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
offer_new_connection = atoi(cdata_text_get(elem));
|
||||
offer_new_connection = cdata_bool_get(elem);
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"rx-buffer-size") == 0) {
|
||||
@@ -470,7 +570,7 @@ static apt_bool_t unimrcp_client_media_engine_load(unimrcp_client_loader_t *load
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
media_engine = mpf_engine_create(id,loader->pool);
|
||||
if(media_engine) {
|
||||
mpf_engine_scheduler_rate_set(media_engine,realtime_rate);
|
||||
@@ -513,8 +613,8 @@ static apt_bool_t unimrcp_client_rtp_factory_load(unimrcp_client_loader_t *loade
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(rtp_ip) {
|
||||
apt_string_set(&rtp_config->ip,rtp_ip);
|
||||
}
|
||||
@@ -569,7 +669,7 @@ static apt_bool_t unimrcp_client_sip_settings_load(unimrcp_client_loader_t *load
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!settings->server_ip) {
|
||||
settings->server_ip = apr_pstrdup(loader->pool,loader->server_ip);
|
||||
}
|
||||
@@ -618,13 +718,13 @@ static apt_bool_t unimrcp_client_rtsp_settings_load(unimrcp_client_loader_t *loa
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Loading Param %s:%s",name_attr->value,value_attr->value);
|
||||
apr_table_set(settings->resource_map,name_attr->value,value_attr->value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!settings->server_ip) {
|
||||
settings->server_ip = apr_pstrdup(loader->pool,loader->server_ip);
|
||||
}
|
||||
@@ -655,6 +755,16 @@ static apt_bool_t unimrcp_client_jb_settings_load(unimrcp_client_loader_t *loade
|
||||
jb->max_playout_delay = atol(cdata_text_get(elem));
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"adaptive") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
jb->adaptive = (apr_byte_t) atol(cdata_text_get(elem));
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"time-skew-detection") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
jb->time_skew_detection = (apr_byte_t) atol(cdata_text_get(elem));
|
||||
}
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
@@ -737,19 +847,105 @@ static apt_bool_t unimrcp_client_rtp_settings_load(unimrcp_client_loader_t *load
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mrcp_client_rtp_settings_register(loader->client,rtp_settings,id);
|
||||
}
|
||||
|
||||
/** Create factory of signaling agents */
|
||||
static mrcp_sa_factory_t* unimrcp_client_sa_factory_create(unimrcp_client_loader_t *loader, const apr_xml_elem *elem)
|
||||
{
|
||||
mrcp_sa_factory_t *sa_factory = NULL;
|
||||
mrcp_sig_agent_t *sig_agent;
|
||||
char *uac_name;
|
||||
char *state;
|
||||
char *uac_list_str = apr_pstrdup(loader->pool,cdata_text_get(elem));
|
||||
do {
|
||||
uac_name = apr_strtok(uac_list_str, ",", &state);
|
||||
if(uac_name) {
|
||||
sig_agent = mrcp_client_signaling_agent_get(loader->client,uac_name);
|
||||
if(sig_agent) {
|
||||
if(!sa_factory)
|
||||
sa_factory = mrcp_sa_factory_create(loader->pool);
|
||||
|
||||
mrcp_sa_factory_agent_add(sa_factory,sig_agent);
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown UAC Name <%s>",uac_name);
|
||||
}
|
||||
}
|
||||
uac_list_str = NULL; /* make sure we pass NULL on subsequent calls of apr_strtok() */
|
||||
}
|
||||
while(uac_name);
|
||||
return sa_factory;
|
||||
}
|
||||
|
||||
/** Create factory of MRCPv2 connection agents */
|
||||
static mrcp_ca_factory_t* unimrcp_client_ca_factory_create(unimrcp_client_loader_t *loader, const apr_xml_elem *elem)
|
||||
{
|
||||
mrcp_ca_factory_t *ca_factory = NULL;
|
||||
mrcp_connection_agent_t *agent;
|
||||
char *name;
|
||||
char *state;
|
||||
char *list_str = apr_pstrdup(loader->pool,cdata_text_get(elem));
|
||||
do {
|
||||
name = apr_strtok(list_str, ",", &state);
|
||||
if(name) {
|
||||
agent = mrcp_client_connection_agent_get(loader->client,name);
|
||||
if(agent) {
|
||||
if(!ca_factory)
|
||||
ca_factory = mrcp_ca_factory_create(loader->pool);
|
||||
|
||||
mrcp_ca_factory_agent_add(ca_factory,agent);
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown MRCPv2-UAC Name <%s>",name);
|
||||
}
|
||||
}
|
||||
list_str = NULL; /* make sure we pass NULL on subsequent calls of apr_strtok() */
|
||||
}
|
||||
while(name);
|
||||
return ca_factory;
|
||||
}
|
||||
|
||||
/** Create factory of media engines */
|
||||
static mpf_engine_factory_t* unimrcp_client_mpf_factory_create(unimrcp_client_loader_t *loader, const apr_xml_elem *elem)
|
||||
{
|
||||
mpf_engine_factory_t *mpf_factory = NULL;
|
||||
mpf_engine_t *media_engine;
|
||||
|
||||
char *name;
|
||||
char *state;
|
||||
char *list_str = apr_pstrdup(loader->pool,cdata_text_get(elem));
|
||||
do {
|
||||
name = apr_strtok(list_str, ",", &state);
|
||||
if(name) {
|
||||
media_engine = mrcp_client_media_engine_get(loader->client,name);
|
||||
if(media_engine) {
|
||||
if(!mpf_factory)
|
||||
mpf_factory = mpf_engine_factory_create(loader->pool);
|
||||
|
||||
mpf_engine_factory_engine_add(mpf_factory,media_engine);
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Media Engine Name <%s>",name);
|
||||
}
|
||||
}
|
||||
list_str = NULL; /* make sure we pass NULL on subsequent calls of apr_strtok() */
|
||||
}
|
||||
while(name);
|
||||
|
||||
return mpf_factory;
|
||||
}
|
||||
|
||||
/** Load MRCPv2 profile */
|
||||
static apt_bool_t unimrcp_client_mrcpv2_profile_load(unimrcp_client_loader_t *loader, const apr_xml_elem *root, const char *id)
|
||||
static apt_bool_t unimrcp_client_mrcpv2_profile_load(unimrcp_client_loader_t *loader, const apr_xml_elem *root, const char *id, const char *tag)
|
||||
{
|
||||
const apr_xml_elem *elem;
|
||||
mrcp_profile_t *profile;
|
||||
mrcp_sig_agent_t *sip_agent = NULL;
|
||||
mrcp_connection_agent_t *mrcpv2_agent = NULL;
|
||||
mpf_engine_t *media_engine = NULL;
|
||||
mrcp_sa_factory_t *sa_factory = NULL;
|
||||
mrcp_ca_factory_t *ca_factory = NULL;
|
||||
mpf_engine_factory_t *mpf_factory = NULL;
|
||||
mpf_termination_factory_t *rtp_factory = NULL;
|
||||
mpf_rtp_settings_t *rtp_settings = NULL;
|
||||
mrcp_sig_settings_t *sip_settings = NULL;
|
||||
@@ -763,13 +959,13 @@ static apt_bool_t unimrcp_client_mrcpv2_profile_load(unimrcp_client_loader_t *lo
|
||||
}
|
||||
|
||||
if(strcasecmp(elem->name,"sip-uac") == 0) {
|
||||
sip_agent = mrcp_client_signaling_agent_get(loader->client,cdata_text_get(elem));
|
||||
sa_factory = unimrcp_client_sa_factory_create(loader,elem);
|
||||
}
|
||||
else if(strcasecmp(elem->name,"mrcpv2-uac") == 0) {
|
||||
mrcpv2_agent = mrcp_client_connection_agent_get(loader->client,cdata_text_get(elem));
|
||||
ca_factory = unimrcp_client_ca_factory_create(loader,elem);
|
||||
}
|
||||
else if(strcasecmp(elem->name,"media-engine") == 0) {
|
||||
media_engine = mrcp_client_media_engine_get(loader->client,cdata_text_get(elem));
|
||||
mpf_factory = unimrcp_client_mpf_factory_create(loader,elem);
|
||||
}
|
||||
else if(strcasecmp(elem->name,"rtp-factory") == 0) {
|
||||
rtp_factory = mrcp_client_rtp_factory_get(loader->client,cdata_text_get(elem));
|
||||
@@ -786,21 +982,25 @@ static apt_bool_t unimrcp_client_mrcpv2_profile_load(unimrcp_client_loader_t *lo
|
||||
}
|
||||
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create MRCPv2 Profile [%s]",id);
|
||||
profile = mrcp_client_profile_create(
|
||||
NULL,sip_agent,mrcpv2_agent,
|
||||
media_engine,rtp_factory,
|
||||
profile = mrcp_client_profile_create_ex(
|
||||
MRCP_VERSION_2,NULL,
|
||||
sa_factory,ca_factory,
|
||||
mpf_factory,rtp_factory,
|
||||
rtp_settings,sip_settings,
|
||||
loader->pool);
|
||||
if(tag) {
|
||||
mrcp_client_profile_tag_set(profile,tag);
|
||||
}
|
||||
return mrcp_client_profile_register(loader->client,profile,id);
|
||||
}
|
||||
|
||||
/** Load MRCPv1 profile */
|
||||
static apt_bool_t unimrcp_client_mrcpv1_profile_load(unimrcp_client_loader_t *loader, const apr_xml_elem *root, const char *id)
|
||||
static apt_bool_t unimrcp_client_mrcpv1_profile_load(unimrcp_client_loader_t *loader, const apr_xml_elem *root, const char *id, const char *tag)
|
||||
{
|
||||
const apr_xml_elem *elem;
|
||||
mrcp_profile_t *profile;
|
||||
mrcp_sig_agent_t *rtsp_agent = NULL;
|
||||
mpf_engine_t *media_engine = NULL;
|
||||
mrcp_sa_factory_t *sa_factory = NULL;
|
||||
mpf_engine_factory_t *mpf_factory = NULL;
|
||||
mpf_termination_factory_t *rtp_factory = NULL;
|
||||
mpf_rtp_settings_t *rtp_settings = NULL;
|
||||
mrcp_sig_settings_t *rtsp_settings = NULL;
|
||||
@@ -814,10 +1014,10 @@ static apt_bool_t unimrcp_client_mrcpv1_profile_load(unimrcp_client_loader_t *lo
|
||||
}
|
||||
|
||||
if(strcasecmp(elem->name,"rtsp-uac") == 0) {
|
||||
rtsp_agent = mrcp_client_signaling_agent_get(loader->client,cdata_text_get(elem));
|
||||
sa_factory = unimrcp_client_sa_factory_create(loader,elem);
|
||||
}
|
||||
else if(strcasecmp(elem->name,"media-engine") == 0) {
|
||||
media_engine = mrcp_client_media_engine_get(loader->client,cdata_text_get(elem));
|
||||
mpf_factory = unimrcp_client_mpf_factory_create(loader,elem);
|
||||
}
|
||||
else if(strcasecmp(elem->name,"rtp-factory") == 0) {
|
||||
rtp_factory = mrcp_client_rtp_factory_get(loader->client,cdata_text_get(elem));
|
||||
@@ -834,11 +1034,15 @@ static apt_bool_t unimrcp_client_mrcpv1_profile_load(unimrcp_client_loader_t *lo
|
||||
}
|
||||
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create MRCPv1 Profile [%s]",id);
|
||||
profile = mrcp_client_profile_create(
|
||||
NULL,rtsp_agent,NULL,
|
||||
media_engine,rtp_factory,
|
||||
profile = mrcp_client_profile_create_ex(
|
||||
MRCP_VERSION_1,
|
||||
NULL,sa_factory,NULL,
|
||||
mpf_factory,rtp_factory,
|
||||
rtp_settings,rtsp_settings,
|
||||
loader->pool);
|
||||
if(tag) {
|
||||
mrcp_client_profile_tag_set(profile,tag);
|
||||
}
|
||||
return mrcp_client_profile_register(loader->client,profile,id);
|
||||
}
|
||||
|
||||
@@ -897,7 +1101,7 @@ static apt_bool_t unimrcp_client_components_load(unimrcp_client_loader_t *loader
|
||||
unimrcp_client_resource_factory_load(loader,elem);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* get common "id" and "enable" attributes */
|
||||
if(header_attribs_get(elem,&id_attr,&enable_attr) == FALSE) {
|
||||
/* invalid id */
|
||||
@@ -927,7 +1131,7 @@ static apt_bool_t unimrcp_client_components_load(unimrcp_client_loader_t *loader
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -964,7 +1168,7 @@ static apt_bool_t unimrcp_client_settings_load(unimrcp_client_loader_t *loader,
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -974,12 +1178,14 @@ static apt_bool_t unimrcp_client_profiles_load(unimrcp_client_loader_t *loader,
|
||||
const apr_xml_elem *elem;
|
||||
const apr_xml_attr *id_attr;
|
||||
const apr_xml_attr *enable_attr;
|
||||
const apr_xml_attr *tag_attr;
|
||||
const char *id;
|
||||
const char *tag;
|
||||
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Loading Profiles");
|
||||
for(elem = root->first_child; elem; elem = elem->next) {
|
||||
/* get common "id" and "enable" attributes */
|
||||
if(header_attribs_get(elem,&id_attr,&enable_attr) == FALSE) {
|
||||
if(profile_attribs_get(elem,&id_attr,&enable_attr,&tag_attr) == FALSE) {
|
||||
/* invalid id */
|
||||
continue;
|
||||
}
|
||||
@@ -988,17 +1194,58 @@ static apt_bool_t unimrcp_client_profiles_load(unimrcp_client_loader_t *loader,
|
||||
continue;
|
||||
}
|
||||
id = apr_pstrdup(loader->pool,id_attr->value);
|
||||
tag = tag_attr ? apr_pstrdup(loader->pool,tag_attr->value) : NULL;
|
||||
|
||||
if(strcasecmp(elem->name,"mrcpv2-profile") == 0) {
|
||||
unimrcp_client_mrcpv2_profile_load(loader,elem,id);
|
||||
unimrcp_client_mrcpv2_profile_load(loader,elem,id,tag);
|
||||
}
|
||||
else if(strcasecmp(elem->name,"mrcpv1-profile") == 0) {
|
||||
unimrcp_client_mrcpv1_profile_load(loader,elem,id);
|
||||
unimrcp_client_mrcpv1_profile_load(loader,elem,id,tag);
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Load misc parameters */
|
||||
static apt_bool_t unimrcp_client_misc_load(unimrcp_client_loader_t *loader, const apr_xml_elem *root)
|
||||
{
|
||||
const apr_xml_elem *elem;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Loading Misc Parameters");
|
||||
for(elem = root->first_child; elem; elem = elem->next) {
|
||||
if(strcasecmp(elem->name,"sofiasip-logger") == 0) {
|
||||
char *logger_list_str;
|
||||
char *logger_name;
|
||||
char *state;
|
||||
apr_xml_attr *attr;
|
||||
apt_bool_t redirect = FALSE;
|
||||
const char *loglevel_str = NULL;
|
||||
for(attr = elem->attr; attr; attr = attr->next) {
|
||||
if(strcasecmp(attr->name,"redirect") == 0) {
|
||||
if(attr->value && strcasecmp(attr->value,"true") == 0)
|
||||
redirect = TRUE;
|
||||
}
|
||||
else if(strcasecmp(attr->name,"loglevel") == 0) {
|
||||
loglevel_str = attr->value;
|
||||
}
|
||||
}
|
||||
|
||||
logger_list_str = apr_pstrdup(loader->pool,cdata_text_get(elem));
|
||||
do {
|
||||
logger_name = apr_strtok(logger_list_str, ",", &state);
|
||||
if(logger_name) {
|
||||
mrcp_sofiasip_client_logger_init(logger_name,loglevel_str,redirect);
|
||||
}
|
||||
logger_list_str = NULL; /* make sure we pass NULL on subsequent calls of apr_strtok() */
|
||||
}
|
||||
while(logger_name);
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1027,30 +1274,15 @@ static apr_xml_doc* unimrcp_client_doc_parse(const char *file_path, apr_pool_t *
|
||||
return xml_doc;
|
||||
}
|
||||
|
||||
/** Load UniMRCP client */
|
||||
static apt_bool_t unimrcp_client_load(unimrcp_client_loader_t *loader, const char *dir_path, const char *file_name, apr_pool_t *pool)
|
||||
/** Process parsed XML document */
|
||||
static apt_bool_t unimrcp_client_doc_process(unimrcp_client_loader_t *loader, const char *dir_path, apr_xml_doc *doc, apr_pool_t *pool)
|
||||
{
|
||||
apr_xml_doc *doc;
|
||||
const apr_xml_elem *elem;
|
||||
const apr_xml_elem *root;
|
||||
const apr_xml_attr *attr;
|
||||
const char *file_path;
|
||||
const char *version = NULL;
|
||||
const char *subfolder = NULL;
|
||||
|
||||
if(!dir_path || !file_name) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(*dir_path == '\0') {
|
||||
file_path = file_name;
|
||||
}
|
||||
else {
|
||||
file_path = apr_psprintf(pool,"%s/%s",dir_path,file_name);
|
||||
}
|
||||
|
||||
/* Parse XML document */
|
||||
doc = unimrcp_client_doc_parse(file_path,pool);
|
||||
if(!doc) {
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1059,7 +1291,7 @@ static apt_bool_t unimrcp_client_load(unimrcp_client_loader_t *loader, const cha
|
||||
|
||||
/* Match document name */
|
||||
if(!root || strcasecmp(root->name,"unimrcpclient") != 0) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Document <%s>",root->name);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Document <%s>",root ? root->name : "null");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1095,31 +1327,90 @@ static apt_bool_t unimrcp_client_load(unimrcp_client_loader_t *loader, const cha
|
||||
else if(strcasecmp(elem->name,"profiles") == 0) {
|
||||
unimrcp_client_profiles_load(loader,elem);
|
||||
}
|
||||
else if(strcasecmp(elem->name,"misc") == 0) {
|
||||
unimrcp_client_misc_load(loader,elem);
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
|
||||
if(subfolder && subfolder != '\0') {
|
||||
if(subfolder && *subfolder != '\0') {
|
||||
apr_dir_t *dir;
|
||||
apr_finfo_t finfo;
|
||||
apr_status_t rv;
|
||||
char *subdir_path;
|
||||
|
||||
dir_path = apr_psprintf(pool,"%s/%s",dir_path,subfolder);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Enter Directory [%s]",dir_path);
|
||||
rv = apr_dir_open(&dir,dir_path,pool);
|
||||
if(rv == APR_SUCCESS) {
|
||||
while(apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) {
|
||||
if(apr_fnmatch("*.xml", finfo.name, 0) == APR_SUCCESS) {
|
||||
unimrcp_client_load(loader,dir_path,finfo.name,pool);
|
||||
}
|
||||
}
|
||||
apr_dir_close(dir);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Leave Directory [%s]",dir_path);
|
||||
if (!dir_path) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Attempt to Process Subdirectory when "
|
||||
"Creating from Config String");
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"No Such Directory %s",dir_path);
|
||||
|
||||
if(apr_filepath_merge(&subdir_path,dir_path,subfolder,APR_FILEPATH_NATIVE,pool) == APR_SUCCESS) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Enter Directory [%s]",subdir_path);
|
||||
rv = apr_dir_open(&dir,subdir_path,pool);
|
||||
if(rv == APR_SUCCESS) {
|
||||
while(apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) {
|
||||
if(apr_fnmatch("*.xml", finfo.name, 0) == APR_SUCCESS) {
|
||||
unimrcp_client_load(loader,subdir_path,finfo.name);
|
||||
}
|
||||
}
|
||||
apr_dir_close(dir);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Leave Directory [%s]",dir_path);
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"No Such Directory %s",dir_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Load UniMRCP client from file */
|
||||
static apt_bool_t unimrcp_client_load(unimrcp_client_loader_t *loader, const char *dir_path, const char *file_name)
|
||||
{
|
||||
apr_pool_t *pool = loader->pool;
|
||||
apr_xml_doc *doc;
|
||||
char *file_path;
|
||||
|
||||
if(!dir_path || !file_name) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(apr_filepath_merge(&file_path,dir_path,file_name,APR_FILEPATH_NATIVE,pool) != APR_SUCCESS) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Parse XML document */
|
||||
doc = unimrcp_client_doc_parse(file_path,pool);
|
||||
return unimrcp_client_doc_process(loader, dir_path, doc, pool);
|
||||
}
|
||||
|
||||
/** Read configuration from string */
|
||||
static apt_bool_t unimrcp_client_load2(unimrcp_client_loader_t *loader, const char *xmlconfig)
|
||||
{
|
||||
apr_pool_t *pool = loader->pool;
|
||||
apr_xml_parser *parser;
|
||||
apr_xml_doc *xml_doc;
|
||||
char errbuf[4096];
|
||||
apr_status_t rv;
|
||||
|
||||
parser = apr_xml_parser_create(pool);
|
||||
if (!parser) return FALSE;
|
||||
rv = apr_xml_parser_feed(parser, xmlconfig, strlen(xmlconfig));
|
||||
if (rv != APR_SUCCESS) {
|
||||
apr_xml_parser_geterror(parser, errbuf, sizeof(errbuf));
|
||||
apt_log(APT_LOG_MARK, APT_PRIO_ERROR, "Error parsing XML configuration: %d %pm: %s",
|
||||
rv, &rv, errbuf);
|
||||
return FALSE;
|
||||
}
|
||||
rv = apr_xml_parser_done(parser, &xml_doc);
|
||||
if (rv != APR_SUCCESS) {
|
||||
apr_xml_parser_geterror(parser, errbuf, sizeof(errbuf));
|
||||
apt_log(APT_LOG_MARK, APT_PRIO_ERROR, "Error parsing XML configuration: %d %pm: %s",
|
||||
rv, &rv, errbuf);
|
||||
return FALSE;
|
||||
}
|
||||
return unimrcp_client_doc_process(loader, NULL, xml_doc, pool);
|
||||
}
|
||||
@@ -1,36 +1,11 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/platforms/libunimrcp-server/include \
|
||||
-I$(unimrcp_srcdir)/modules/mrcp-sofiasip/include \
|
||||
-I$(top_srcdir)/modules/mrcp-unirtsp/include \
|
||||
-I$(top_srcdir)/libs/mrcp-server/include \
|
||||
-I$(top_srcdir)/libs/mrcp-engine/include \
|
||||
-I$(top_srcdir)/libs/mrcp-signaling/include \
|
||||
-I$(top_srcdir)/libs/mrcpv2-transport/include \
|
||||
-I$(top_srcdir)/libs/mrcp/include \
|
||||
-I$(top_srcdir)/libs/mrcp/message/include \
|
||||
-I$(top_srcdir)/libs/mrcp/control/include \
|
||||
-I$(top_srcdir)/libs/mrcp/resources/include \
|
||||
-I$(top_srcdir)/libs/mpf/include \
|
||||
-I$(top_srcdir)/libs/apr-toolkit/include \
|
||||
-I$(top_srcdir)/build \
|
||||
$(UNIMRCP_APR_INCLUDES) $(UNIMRCP_APU_INCLUDES)
|
||||
$(UNIMRCP_SERVERLIB_INCLUDES)
|
||||
|
||||
lib_LTLIBRARIES = libunimrcpserver.la
|
||||
|
||||
include_HEADERS = include/unimrcp_server.h
|
||||
|
||||
libunimrcpserver_la_SOURCES = src/unimrcp_server.c
|
||||
libunimrcpserver_la_LIBADD = $(UNIMRCP_SERVERLIB_LIBS)
|
||||
libunimrcpserver_la_LDFLAGS = $(UNIMRCP_SERVERLIB_OPTS)
|
||||
|
||||
libunimrcpserver_la_LIBADD = $(top_builddir)/modules/mrcp-sofiasip/libmrcpsofiasip.la \
|
||||
$(top_builddir)/modules/mrcp-unirtsp/libmrcpunirtsp.la \
|
||||
$(top_builddir)/libs/mrcp-server/libmrcpserver.la \
|
||||
$(top_builddir)/libs/mrcp-signaling/libmrcpsignaling.la \
|
||||
$(top_builddir)/libs/mrcpv2-transport/libmrcpv2transport.la \
|
||||
$(top_builddir)/libs/mrcp-engine/libmrcpengine.la \
|
||||
$(top_builddir)/libs/mrcp/libmrcp.la \
|
||||
$(top_builddir)/libs/mpf/libmpf.la \
|
||||
$(top_builddir)/libs/apr-toolkit/libaprtoolkit.la \
|
||||
$(UNIMRCP_APR_LIBS) $(UNIMRCP_APU_LIBS) $(UNIMRCP_SOFIA_LIBS) -lm
|
||||
|
||||
libunimrcpserver_la_LDFLAGS = $(UNI_LT_VERSION)
|
||||
include $(top_srcdir)/build/rules/uniserverlib.am
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: unimrcp_server.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: unimrcp_server.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef UNIMRCP_SERVER_H
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="libunimrcpserver"
|
||||
ProjectGUID="{C98AF157-352E-4737-BD30-A24E2647F5AE}"
|
||||
RootNamespace="libunimrcpserver"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unidebug.vsprops;$(ProjectDir)..\..\build\vsprops\unimrcpserver.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""$(ProjectRootDir)modules\mrcp-sofiasip\include";"$(ProjectRootDir)modules\mrcp-unirtsp\include""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unirelease.vsprops;$(ProjectDir)..\..\build\vsprops\unimrcpserver.vsprops"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""$(ProjectRootDir)modules\mrcp-sofiasip\include";"$(ProjectRootDir)modules\mrcp-unirtsp\include""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="include"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\build\uni_revision.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\build\uni_version.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\unimrcp_server.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="src"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\unimrcp_server.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{C98AF157-352E-4737-BD30-A24E2647F5AE}</ProjectGuid>
|
||||
<RootNamespace>libunimrcpserver</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unilib.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpserver.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unilib.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpserver.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unilib-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpserver.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unilib-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpserver.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectRootDir)modules\mrcp-sofiasip\include;$(ProjectRootDir)modules\mrcp-unirtsp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectRootDir)modules\mrcp-sofiasip\include;$(ProjectRootDir)modules\mrcp-unirtsp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectRootDir)modules\mrcp-sofiasip\include;$(ProjectRootDir)modules\mrcp-unirtsp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectRootDir)modules\mrcp-sofiasip\include;$(ProjectRootDir)modules\mrcp-unirtsp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\build\uni_revision.h" />
|
||||
<ClInclude Include="..\..\build\uni_version.h" />
|
||||
<ClInclude Include="include\unimrcp_server.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\unimrcp_server.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\libs\mrcp-server\mrcpserver.vcxproj">
|
||||
<Project>{18b1f35a-10f8-4287-9b37-2d10501b0b38}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\modules\mrcp-sofiasip\mrcpsofiasip.vcxproj">
|
||||
<Project>{746f3632-5bb2-4570-9453-31d6d58a7d8e}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\modules\mrcp-unirtsp\mrcpunirtsp.vcxproj">
|
||||
<Project>{deb01acb-d65f-4a62-aed9-58c1054499e9}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="include">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{c164436d-b3de-474f-99bc-6b2ca1a4c879}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\build\uni_revision.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\build\uni_version.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\unimrcp_server.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\unimrcp_server.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,13 +13,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: unimrcp_server.c 1711 2010-05-25 17:54:02Z achaloyan $
|
||||
* $Id: unimrcp_server.c 2231 2014-11-12 01:32:03Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <apr_xml.h>
|
||||
#include <apr_version.h>
|
||||
#include "uni_version.h"
|
||||
#include "uni_revision.h"
|
||||
#include "unimrcp_server.h"
|
||||
#include "mrcp_resource_loader.h"
|
||||
#include "mpf_engine.h"
|
||||
@@ -32,7 +33,6 @@
|
||||
#include "apt_log.h"
|
||||
|
||||
#define CONF_FILE_NAME "unimrcpserver.xml"
|
||||
#define DEFAULT_PLUGIN_DIR_PATH "../plugin"
|
||||
#ifdef WIN32
|
||||
#define DEFAULT_PLUGIN_EXT "dll"
|
||||
#else
|
||||
@@ -86,7 +86,7 @@ MRCP_DECLARE(mrcp_server_t*) unimrcp_server_start(apt_dir_layout_t *dir_layout)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"UniMRCP Server ["UNI_VERSION_STRING"]");
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"UniMRCP Server ["UNI_VERSION_STRING"] [r"UNI_REVISION_STRING"]");
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"APR ["APR_VERSION_STRING"]");
|
||||
server = mrcp_server_create(dir_layout);
|
||||
if(!server) {
|
||||
@@ -118,7 +118,7 @@ MRCP_DECLARE(apt_bool_t) unimrcp_server_shutdown(mrcp_server_t *server)
|
||||
/** Check whether specified attribute is valid */
|
||||
static APR_INLINE apt_bool_t is_attr_valid(const apr_xml_attr *attr)
|
||||
{
|
||||
return (attr && attr->value && attr->value != '\0');
|
||||
return (attr && attr->value && *attr->value != '\0');
|
||||
}
|
||||
|
||||
/** Check whether specified attribute is enabled (true) */
|
||||
@@ -172,7 +172,7 @@ static apt_bool_t header_attribs_get(const apr_xml_elem *elem, const apr_xml_att
|
||||
*enable = attr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(is_attr_valid(*id) == FALSE) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Missing Required Attribute <id> in Element <%s>",elem->name);
|
||||
return FALSE;
|
||||
@@ -220,6 +220,16 @@ static char* unimrcp_server_ip_address_get(unimrcp_server_loader_t *loader, cons
|
||||
}
|
||||
return apr_pstrdup(loader->pool,loader->auto_ip);
|
||||
}
|
||||
else if(attr && strcasecmp(attr->value,"iface") == 0) {
|
||||
/* get ip address by network interface name */
|
||||
char *ip_addr = DEFAULT_IP_ADDRESS;
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
const char *iface_name = cdata_text_get(elem);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Get IP Address by Interface [%s]", iface_name);
|
||||
apt_ip_get_by_iface(iface_name,&ip_addr,loader->pool);
|
||||
}
|
||||
return ip_addr;
|
||||
}
|
||||
|
||||
if(is_cdata_valid(elem)) {
|
||||
/* use provided ip address */
|
||||
@@ -269,7 +279,7 @@ static apt_bool_t unimrcp_server_resource_factory_load(unimrcp_server_loader_t *
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
resource_factory = mrcp_resource_factory_get(resource_loader);
|
||||
return mrcp_server_resource_factory_register(loader->server,resource_factory);
|
||||
}
|
||||
@@ -307,7 +317,18 @@ static apt_bool_t unimrcp_server_sip_uas_load(unimrcp_server_loader_t *loader, c
|
||||
}
|
||||
else if(strcasecmp(elem->name,"ua-name") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
config->user_agent_name = cdata_copy(elem,loader->pool);
|
||||
const apr_xml_attr *attr = NULL;
|
||||
for(attr = elem->attr; attr; attr = attr->next) {
|
||||
if(strcasecmp(attr->name,"appendversion") == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(is_attr_enabled(attr)) {
|
||||
config->user_agent_name = apr_psprintf(loader->pool,"%s "UNI_VERSION_STRING,cdata_text_get(elem));
|
||||
}
|
||||
else {
|
||||
config->user_agent_name = cdata_copy(elem,loader->pool);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"sdp-origin") == 0) {
|
||||
@@ -340,6 +361,25 @@ static apt_bool_t unimrcp_server_sip_uas_load(unimrcp_server_loader_t *loader, c
|
||||
config->sip_t1x64 = atol(cdata_text_get(elem));
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"sip-message-output") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
config->tport_log = cdata_bool_get(elem);
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"sip-message-dump") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
const char *root_path;
|
||||
const char *path = cdata_text_get(elem);
|
||||
if(loader->dir_layout && apr_filepath_root(&root_path,&path,0,loader->pool) == APR_ERELATIVE)
|
||||
config->tport_dump_file = apt_dir_layout_path_compose(
|
||||
loader->dir_layout,
|
||||
APT_LAYOUT_LOG_DIR,
|
||||
path,
|
||||
loader->pool);
|
||||
else
|
||||
config->tport_dump_file = cdata_copy(elem,loader->pool);
|
||||
}
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
@@ -547,8 +587,8 @@ static apt_bool_t unimrcp_server_rtp_factory_load(unimrcp_server_loader_t *loade
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(rtp_ip) {
|
||||
apt_string_set(&rtp_config->ip,rtp_ip);
|
||||
}
|
||||
@@ -571,10 +611,11 @@ static apt_bool_t unimrcp_server_plugin_load(unimrcp_server_loader_t *loader, co
|
||||
{
|
||||
mrcp_engine_t *engine;
|
||||
mrcp_engine_config_t *config;
|
||||
char *plugin_file_name;
|
||||
char *plugin_path;
|
||||
const char *plugin_id = NULL;
|
||||
const char *plugin_name = NULL;
|
||||
const char *plugin_ext = NULL;
|
||||
const char *plugin_path = NULL;
|
||||
apt_bool_t plugin_enabled = TRUE;
|
||||
const apr_xml_attr *attr;
|
||||
for(attr = root->attr; attr; attr = attr->next) {
|
||||
@@ -599,7 +640,7 @@ static apt_bool_t unimrcp_server_plugin_load(unimrcp_server_loader_t *loader, co
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Missing plugin id or name");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if(!plugin_enabled) {
|
||||
/* disabled plugin, just skip it */
|
||||
return TRUE;
|
||||
@@ -609,13 +650,11 @@ static apt_bool_t unimrcp_server_plugin_load(unimrcp_server_loader_t *loader, co
|
||||
plugin_ext = DEFAULT_PLUGIN_EXT;
|
||||
}
|
||||
|
||||
if(*loader->dir_layout->plugin_dir_path == '\0') {
|
||||
plugin_path = apr_psprintf(loader->pool,"%s.%s",
|
||||
plugin_name,plugin_ext);
|
||||
}
|
||||
else {
|
||||
plugin_path = apr_psprintf(loader->pool,"%s/%s.%s",
|
||||
loader->dir_layout->plugin_dir_path,plugin_name,plugin_ext);
|
||||
plugin_file_name = apr_psprintf(loader->pool,"%s.%s",plugin_name,plugin_ext);
|
||||
plugin_path = apt_dir_layout_path_compose(loader->dir_layout,APT_LAYOUT_PLUGIN_DIR,plugin_file_name,loader->pool);
|
||||
if(!plugin_path) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to compose plugin path %s",plugin_file_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
config = mrcp_engine_config_alloc(loader->pool);
|
||||
@@ -651,10 +690,6 @@ static apt_bool_t unimrcp_server_plugin_factory_load(unimrcp_server_loader_t *lo
|
||||
{
|
||||
const apr_xml_elem *elem;
|
||||
|
||||
if(!loader->dir_layout->plugin_dir_path) {
|
||||
loader->dir_layout->plugin_dir_path = DEFAULT_PLUGIN_DIR_PATH;
|
||||
}
|
||||
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Loading Plugin Factory");
|
||||
for(elem = root->first_child; elem; elem = elem->next) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Loading Element <%s>",elem->name);
|
||||
@@ -691,6 +726,16 @@ static apt_bool_t unimrcp_server_jb_settings_load(unimrcp_server_loader_t *loade
|
||||
jb->max_playout_delay = atol(cdata_text_get(elem));
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"adaptive") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
jb->adaptive = (apr_byte_t) atol(cdata_text_get(elem));
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(elem->name,"time-skew-detection") == 0) {
|
||||
if(is_cdata_valid(elem) == TRUE) {
|
||||
jb->time_skew_detection = (apr_byte_t) atol(cdata_text_get(elem));
|
||||
}
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
@@ -780,7 +825,7 @@ static apt_bool_t unimrcp_server_rtp_settings_load(unimrcp_server_loader_t *load
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mrcp_server_rtp_settings_register(loader->server,rtp_settings,id);
|
||||
}
|
||||
@@ -850,6 +895,7 @@ static apt_bool_t unimrcp_server_mrcpv2_profile_load(unimrcp_server_loader_t *lo
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create MRCPv2 Profile [%s]",id);
|
||||
profile = mrcp_server_profile_create(
|
||||
id,
|
||||
MRCP_VERSION_2,
|
||||
NULL,
|
||||
sip_agent,
|
||||
mrcpv2_agent,
|
||||
@@ -902,6 +948,7 @@ static apt_bool_t unimrcp_server_mrcpv1_profile_load(unimrcp_server_loader_t *lo
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create MRCPv1 Profile [%s]",id);
|
||||
profile = mrcp_server_profile_create(
|
||||
id,
|
||||
MRCP_VERSION_1,
|
||||
NULL,
|
||||
rtsp_agent,
|
||||
NULL,
|
||||
@@ -1024,7 +1071,7 @@ static apt_bool_t unimrcp_server_settings_load(unimrcp_server_loader_t *loader,
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1058,7 +1105,47 @@ static apt_bool_t unimrcp_server_profiles_load(unimrcp_server_loader_t *loader,
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Load misc parameters */
|
||||
static apt_bool_t unimrcp_server_misc_load(unimrcp_server_loader_t *loader, const apr_xml_elem *root)
|
||||
{
|
||||
const apr_xml_elem *elem;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Loading Misc Parameters");
|
||||
for(elem = root->first_child; elem; elem = elem->next) {
|
||||
if(strcasecmp(elem->name,"sofiasip-logger") == 0) {
|
||||
char *logger_list_str;
|
||||
char *logger_name;
|
||||
char *state;
|
||||
apr_xml_attr *attr;
|
||||
apt_bool_t redirect = FALSE;
|
||||
const char *loglevel_str = NULL;
|
||||
for(attr = elem->attr; attr; attr = attr->next) {
|
||||
if(strcasecmp(attr->name,"redirect") == 0) {
|
||||
if(attr->value && strcasecmp(attr->value,"true") == 0)
|
||||
redirect = TRUE;
|
||||
}
|
||||
else if(strcasecmp(attr->name,"loglevel") == 0) {
|
||||
loglevel_str = attr->value;
|
||||
}
|
||||
}
|
||||
|
||||
logger_list_str = apr_pstrdup(loader->pool,cdata_text_get(elem));
|
||||
do {
|
||||
logger_name = apr_strtok(logger_list_str, ",", &state);
|
||||
if(logger_name) {
|
||||
mrcp_sofiasip_server_logger_init(logger_name,loglevel_str,redirect);
|
||||
}
|
||||
logger_list_str = NULL; /* make sure we pass NULL on subsequent calls of apr_strtok() */
|
||||
}
|
||||
while(logger_name);
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1082,7 +1169,7 @@ static apr_xml_doc* unimrcp_server_doc_parse(const char *file_path, apr_pool_t *
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Parse Config File [%s]",file_path);
|
||||
xml_doc = NULL;
|
||||
}
|
||||
|
||||
|
||||
apr_file_close(fd);
|
||||
return xml_doc;
|
||||
}
|
||||
@@ -1113,7 +1200,7 @@ static apt_bool_t unimrcp_server_load(mrcp_server_t *mrcp_server, apt_dir_layout
|
||||
|
||||
/* Match document name */
|
||||
if(!root || strcasecmp(root->name,"unimrcpserver") != 0) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Document <%s>",root->name);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Document <%s>",root ? root->name : "null");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1153,6 +1240,9 @@ static apt_bool_t unimrcp_server_load(mrcp_server_t *mrcp_server, apt_dir_layout
|
||||
else if(strcasecmp(elem->name,"profiles") == 0) {
|
||||
unimrcp_server_profiles_load(loader,elem);
|
||||
}
|
||||
else if(strcasecmp(elem->name,"misc") == 0) {
|
||||
unimrcp_server_misc_load(loader,elem);
|
||||
}
|
||||
else {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown Element <%s>",elem->name);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
AM_CPPFLAGS = -Iinclude \
|
||||
-I$(unimrcp_srcdir)/platforms/umc/include \
|
||||
-I$(top_srcdir)/platforms/libunimrcp-client/include \
|
||||
-I$(top_srcdir)/libs/mrcp-client/include \
|
||||
-I$(top_srcdir)/libs/mrcp-signaling/include \
|
||||
-I$(top_srcdir)/libs/mrcpv2-transport/include \
|
||||
-I$(top_srcdir)/libs/mrcp/include \
|
||||
-I$(top_srcdir)/libs/mrcp/message/include \
|
||||
-I$(top_srcdir)/libs/mrcp/control/include \
|
||||
-I$(top_srcdir)/libs/mrcp/resources/include \
|
||||
-I$(top_srcdir)/libs/mpf/include \
|
||||
-I$(top_srcdir)/libs/apr-toolkit/include \
|
||||
$(UNIMRCP_APR_INCLUDES) $(UNIMRCP_APU_INCLUDES)
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/platforms/umc/include \
|
||||
$(UNIMRCP_CLIENTAPP_INCLUDES)
|
||||
|
||||
bin_PROGRAMS = umc
|
||||
|
||||
umc_SOURCES = src/main.cpp \
|
||||
src/umcconsole.cpp \
|
||||
src/umcframework.cpp \
|
||||
@@ -32,9 +20,7 @@ umc_SOURCES = src/main.cpp \
|
||||
src/setparamsession.cpp \
|
||||
src/verifierscenario.cpp \
|
||||
src/verifiersession.cpp
|
||||
|
||||
umc_LDADD = $(top_builddir)/platforms/libunimrcp-client/libunimrcpclient.la
|
||||
umc_LDADD = $(UNIMRCP_CLIENTAPP_LIBS)
|
||||
umc_LDFLAGS = $(UNIMRCP_CLIENTAPP_OPTS)
|
||||
|
||||
if ISMAC
|
||||
umc_LDFLAGS = -framework CoreFoundation -framework SystemConfiguration
|
||||
endif
|
||||
include $(top_srcdir)/build/rules/uniclientapp.am
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: dtmfscenario.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: dtmfscenario.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef DTMF_SCENARIO_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: dtmfsession.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: dtmfsession.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef DTMF_SESSION_H
|
||||
@@ -45,7 +45,7 @@ protected:
|
||||
|
||||
mrcp_message_t* CreateRecognizeRequest(mrcp_channel_t* pMrcpChannel);
|
||||
|
||||
bool ParseNLSMLResult(mrcp_message_t* pMrcpMessage) const;
|
||||
static bool ParseNLSMLResult(mrcp_message_t* pMrcpMessage);
|
||||
|
||||
/* ============================ HANDLERS =================================== */
|
||||
virtual bool OnSessionTerminate(mrcp_sig_status_code_e status);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: recogscenario.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: recogscenario.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef RECOG_SCENARIO_H
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
/* ============================ ACCESSORS ================================== */
|
||||
const char* GetContentType() const;
|
||||
const char* GetContent() const;
|
||||
apr_size_t GetContentLength() const;
|
||||
const char* GetAudioSource() const;
|
||||
|
||||
/* ============================ INQUIRIES ================================== */
|
||||
@@ -58,6 +59,7 @@ protected:
|
||||
bool m_Recognize;
|
||||
const char* m_ContentType;
|
||||
const char* m_Content;
|
||||
apr_size_t m_ContentLength;
|
||||
const char* m_AudioSource;
|
||||
};
|
||||
|
||||
@@ -72,6 +74,11 @@ inline const char* RecogScenario::GetContent() const
|
||||
return m_Content;
|
||||
}
|
||||
|
||||
inline apr_size_t RecogScenario::GetContentLength() const
|
||||
{
|
||||
return m_ContentLength;
|
||||
}
|
||||
|
||||
inline const char* RecogScenario::GetAudioSource() const
|
||||
{
|
||||
return m_AudioSource;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: recogsession.h 1587 2010-03-12 19:40:02Z achaloyan $
|
||||
* $Id: recogsession.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef RECOG_SESSION_H
|
||||
@@ -48,7 +48,7 @@ protected:
|
||||
mrcp_message_t* CreateDefineGrammarRequest(mrcp_channel_t* pMrcpChannel);
|
||||
mrcp_message_t* CreateRecognizeRequest(mrcp_channel_t* pMrcpChannel);
|
||||
|
||||
bool ParseNLSMLResult(mrcp_message_t* pMrcpMessage) const;
|
||||
static bool ParseNLSMLResult(mrcp_message_t* pMrcpMessage);
|
||||
FILE* GetAudioIn(const mpf_codec_descriptor_t* pDescriptor, apr_pool_t* pool) const;
|
||||
|
||||
/* ============================ HANDLERS =================================== */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: recorderscenario.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: recorderscenario.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef RECORDER_SCENARIO_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: recordersession.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: recordersession.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef RECORDER_SESSION_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: setparamscenario.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: setparamscenario.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef SETPARAM_SCENARIO_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: setparamsession.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: setparamsession.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef SETPARAM_SESSION_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: synthscenario.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: synthscenario.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef SYNTH_SCENARIO_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: synthsession.h 1586 2010-03-12 19:39:02Z achaloyan $
|
||||
* $Id: synthsession.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef SYNTH_SESSION_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: umcconsole.h 1525 2010-02-16 14:58:56Z achaloyan $
|
||||
* $Id: umcconsole.h 2197 2014-10-16 01:34:19Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef UMC_CONSOLE_H
|
||||
@@ -42,19 +42,24 @@ protected:
|
||||
bool LoadOptions(int argc, const char * const *argv, apr_pool_t *pool);
|
||||
bool RunCmdLine();
|
||||
bool ProcessCmdLine(char* pCmdLine);
|
||||
void Usage() const;
|
||||
static void Usage();
|
||||
|
||||
private:
|
||||
/* ============================ DATA ======================================= */
|
||||
struct UmcOptions
|
||||
{
|
||||
const char* m_RootDirPath;
|
||||
const char* m_DirLayoutConf;
|
||||
const char* m_LogPriority;
|
||||
const char* m_LogOutput;
|
||||
|
||||
UmcOptions() :
|
||||
m_RootDirPath(NULL), m_DirLayoutConf(NULL),
|
||||
m_LogPriority(NULL), m_LogOutput(NULL) {}
|
||||
};
|
||||
|
||||
UmcOptions m_Options;
|
||||
UmcFramework* m_pFramework;
|
||||
UmcOptions m_Options;
|
||||
UmcFramework* m_pFramework;
|
||||
};
|
||||
|
||||
#endif /* UMC_CONSOLE_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: umcframework.h 1585 2010-03-12 19:12:05Z achaloyan $
|
||||
* $Id: umcframework.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef UMC_FRAMEWORK_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: umcscenario.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: umcscenario.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef UMC_SCENARIO_H
|
||||
@@ -65,11 +65,12 @@ protected:
|
||||
bool LoadCapabilities(const apr_xml_elem* pElem, apr_pool_t* pool);
|
||||
bool LoadRtpTermination(const apr_xml_elem* pElem, apr_pool_t* pool);
|
||||
|
||||
const char* LoadFileContent(const char* pFileName, apr_size_t& size, apr_pool_t* pool) const;
|
||||
const char* LoadFileContent(const char* pFileName, apr_pool_t* pool) const;
|
||||
int ParseRates(const char* pStr, apr_pool_t* pool) const;
|
||||
static int ParseRates(const char* pStr, apr_pool_t* pool);
|
||||
|
||||
/* ============================ INQUIRIES ================================== */
|
||||
bool IsElementEnabled(const apr_xml_elem* pElem) const;
|
||||
static bool IsElementEnabled(const apr_xml_elem* pElem);
|
||||
|
||||
/* ============================ DATA ======================================= */
|
||||
const char* m_pName;
|
||||
@@ -119,4 +120,10 @@ inline bool UmcScenario::IsDiscoveryEnabled() const
|
||||
}
|
||||
|
||||
|
||||
inline const char* UmcScenario::LoadFileContent(const char* pFileName, apr_pool_t* pool) const
|
||||
{
|
||||
apr_size_t dummy;
|
||||
return LoadFileContent(pFileName, dummy, pool);
|
||||
}
|
||||
|
||||
#endif /* UMC_SCENARIO_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: umcsession.h 1585 2010-03-12 19:12:05Z achaloyan $
|
||||
* $Id: umcsession.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef UMC_SESSION_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: verifierscenario.h 1775 2010-08-26 18:23:38Z achaloyan $
|
||||
* $Id: verifierscenario.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef VERIFIER_SCENARIO_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: verifiersession.h 1776 2010-08-27 16:36:38Z achaloyan $
|
||||
* $Id: verifiersession.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef VERIFIER_SESSION_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: dtmfscenario.cpp 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: dtmfscenario.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: dtmfsession.cpp 1780 2010-09-01 05:59:32Z achaloyan $
|
||||
* $Id: dtmfsession.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "dtmfsession.h"
|
||||
@@ -117,6 +117,7 @@ RecogChannel* DtmfSession::CreateRecogChannel()
|
||||
ReadStream,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -267,37 +268,12 @@ mrcp_message_t* DtmfSession::CreateRecognizeRequest(mrcp_channel_t* pMrcpChannel
|
||||
return pMrcpMessage;
|
||||
}
|
||||
|
||||
bool DtmfSession::ParseNLSMLResult(mrcp_message_t* pMrcpMessage) const
|
||||
bool DtmfSession::ParseNLSMLResult(mrcp_message_t* pMrcpMessage)
|
||||
{
|
||||
apr_xml_elem* pInterpret;
|
||||
apr_xml_elem* pInstance;
|
||||
apr_xml_elem* pInput;
|
||||
apr_xml_doc* pDoc = nlsml_doc_load(&pMrcpMessage->body,pMrcpMessage->pool);
|
||||
if(!pDoc)
|
||||
nlsml_result_t *pResult = nlsml_result_parse(pMrcpMessage->body.buf, pMrcpMessage->body.length, pMrcpMessage->pool);
|
||||
if(!pResult)
|
||||
return false;
|
||||
|
||||
/* walk through interpreted results */
|
||||
pInterpret = nlsml_first_interpret_get(pDoc);
|
||||
for(; pInterpret; pInterpret = nlsml_next_interpret_get(pInterpret))
|
||||
{
|
||||
/* get instance and input */
|
||||
nlsml_interpret_results_get(pInterpret,&pInstance,&pInput);
|
||||
if(pInstance)
|
||||
{
|
||||
/* process instance */
|
||||
if(pInstance->first_cdata.first)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Interpreted Instance [%s]",pInstance->first_cdata.first->text);
|
||||
}
|
||||
}
|
||||
if(pInput)
|
||||
{
|
||||
/* process input */
|
||||
if(pInput->first_cdata.first)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Interpreted Input [%s]",pInput->first_cdata.first->text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nlsml_result_trace(pResult, pMrcpMessage->pool);
|
||||
return true;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: main.cpp 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: main.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "umcconsole.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: recogscenario.cpp 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: recogscenario.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -30,6 +30,7 @@ RecogScenario::RecogScenario() :
|
||||
m_Recognize(true),
|
||||
m_ContentType("application/srgs+xml"),
|
||||
m_Content(NULL),
|
||||
m_ContentLength(0),
|
||||
m_AudioSource(NULL)
|
||||
{
|
||||
}
|
||||
@@ -102,7 +103,7 @@ bool RecogScenario::LoadDefineGrammar(const apr_xml_elem* pElem, apr_pool_t* poo
|
||||
}
|
||||
else if(strcasecmp(pAttr->name,"content-location") == 0)
|
||||
{
|
||||
m_Content = LoadFileContent(pAttr->value,pool);
|
||||
m_Content = LoadFileContent(pAttr->value,m_ContentLength,pool);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: recogsession.cpp 1587 2010-03-12 19:40:02Z achaloyan $
|
||||
* $Id: recogsession.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "recogsession.h"
|
||||
@@ -184,6 +184,7 @@ RecogChannel* RecogSession::CreateRecogChannel()
|
||||
ReadStream,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -309,6 +310,13 @@ bool RecogSession::OnDefineGrammar(mrcp_channel_t* pMrcpChannel)
|
||||
|
||||
bool RecogSession::StartRecognition(mrcp_channel_t* pMrcpChannel)
|
||||
{
|
||||
const mpf_codec_descriptor_t* pDescriptor = mrcp_application_source_descriptor_get(pMrcpChannel);
|
||||
if(!pDescriptor)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Media Source Descriptor");
|
||||
return Terminate();
|
||||
}
|
||||
|
||||
RecogChannel* pRecogChannel = (RecogChannel*) mrcp_application_channel_object_get(pMrcpChannel);
|
||||
/* create and send RECOGNIZE request */
|
||||
mrcp_message_t* pMrcpMessage = CreateRecognizeRequest(pMrcpChannel);
|
||||
@@ -317,7 +325,6 @@ bool RecogSession::StartRecognition(mrcp_channel_t* pMrcpChannel)
|
||||
SendMrcpRequest(pRecogChannel->m_pMrcpChannel,pMrcpMessage);
|
||||
}
|
||||
|
||||
const mpf_codec_descriptor_t* pDescriptor = mrcp_application_source_descriptor_get(pMrcpChannel);
|
||||
pRecogChannel->m_pAudioIn = GetAudioIn(pDescriptor,GetSessionPool());
|
||||
if(!pRecogChannel->m_pAudioIn)
|
||||
{
|
||||
@@ -352,7 +359,7 @@ mrcp_message_t* RecogSession::CreateDefineGrammarRequest(mrcp_channel_t* pMrcpCh
|
||||
|
||||
/* set message body */
|
||||
if(pScenario->GetContent())
|
||||
apt_string_assign(&pMrcpMessage->body,pScenario->GetContent(),pMrcpMessage->pool);
|
||||
apt_string_assign_n(&pMrcpMessage->body,pScenario->GetContent(),pScenario->GetContentLength(),pMrcpMessage->pool);
|
||||
return pMrcpMessage;
|
||||
}
|
||||
|
||||
@@ -409,42 +416,19 @@ mrcp_message_t* RecogSession::CreateRecognizeRequest(mrcp_channel_t* pMrcpChanne
|
||||
mrcp_resource_header_property_add(pMrcpMessage,RECOGNIZER_HEADER_START_INPUT_TIMERS);
|
||||
pRecogHeader->confidence_threshold = 0.87f;
|
||||
mrcp_resource_header_property_add(pMrcpMessage,RECOGNIZER_HEADER_CONFIDENCE_THRESHOLD);
|
||||
pRecogHeader->save_waveform = TRUE;
|
||||
mrcp_resource_header_property_add(pMrcpMessage,RECOGNIZER_HEADER_SAVE_WAVEFORM);
|
||||
}
|
||||
return pMrcpMessage;
|
||||
}
|
||||
|
||||
bool RecogSession::ParseNLSMLResult(mrcp_message_t* pMrcpMessage) const
|
||||
bool RecogSession::ParseNLSMLResult(mrcp_message_t* pMrcpMessage)
|
||||
{
|
||||
apr_xml_elem* pInterpret;
|
||||
apr_xml_elem* pInstance;
|
||||
apr_xml_elem* pInput;
|
||||
apr_xml_doc* pDoc = nlsml_doc_load(&pMrcpMessage->body,pMrcpMessage->pool);
|
||||
if(!pDoc)
|
||||
nlsml_result_t *pResult = nlsml_result_parse(pMrcpMessage->body.buf, pMrcpMessage->body.length, pMrcpMessage->pool);
|
||||
if(!pResult)
|
||||
return false;
|
||||
|
||||
/* walk through interpreted results */
|
||||
pInterpret = nlsml_first_interpret_get(pDoc);
|
||||
for(; pInterpret; pInterpret = nlsml_next_interpret_get(pInterpret))
|
||||
{
|
||||
/* get instance and input */
|
||||
nlsml_interpret_results_get(pInterpret,&pInstance,&pInput);
|
||||
if(pInstance)
|
||||
{
|
||||
/* process instance */
|
||||
if(pInstance->first_cdata.first)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Interpreted Instance [%s]",pInstance->first_cdata.first->text);
|
||||
}
|
||||
}
|
||||
if(pInput)
|
||||
{
|
||||
/* process input */
|
||||
if(pInput->first_cdata.first)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Interpreted Input [%s]",pInput->first_cdata.first->text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nlsml_result_trace(pResult, pMrcpMessage->pool);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -453,8 +437,7 @@ FILE* RecogSession::GetAudioIn(const mpf_codec_descriptor_t* pDescriptor, apr_po
|
||||
const char* pFileName = GetScenario()->GetAudioSource();
|
||||
if(!pFileName)
|
||||
{
|
||||
pFileName = apr_psprintf(pool,"one-%dkHz.pcm",
|
||||
pDescriptor ? pDescriptor->sampling_rate/1000 : 8);
|
||||
pFileName = apr_psprintf(pool,"one-%dkHz.pcm",pDescriptor->sampling_rate/1000);
|
||||
}
|
||||
apt_dir_layout_t* pDirLayout = GetScenario()->GetDirLayout();
|
||||
const char* pFilePath = apt_datadir_filepath_get(pDirLayout,pFileName,pool);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: recorderscenario.cpp 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: recorderscenario.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: recordersession.cpp 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: recordersession.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "recordersession.h"
|
||||
@@ -129,6 +129,7 @@ RecorderChannel* RecorderSession::CreateRecorderChannel()
|
||||
ReadStream,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -217,6 +218,13 @@ bool RecorderSession::OnMessageReceive(mrcp_channel_t* pMrcpChannel, mrcp_messag
|
||||
|
||||
bool RecorderSession::StartRecorder(mrcp_channel_t* pMrcpChannel)
|
||||
{
|
||||
const mpf_codec_descriptor_t* pDescriptor = mrcp_application_source_descriptor_get(pMrcpChannel);
|
||||
if(!pDescriptor)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Media Source Descriptor");
|
||||
return Terminate();
|
||||
}
|
||||
|
||||
RecorderChannel* pRecorderChannel = (RecorderChannel*) mrcp_application_channel_object_get(pMrcpChannel);
|
||||
/* create and send RECORD request */
|
||||
mrcp_message_t* pMrcpMessage = CreateRecordRequest(pMrcpChannel);
|
||||
@@ -225,7 +233,6 @@ bool RecorderSession::StartRecorder(mrcp_channel_t* pMrcpChannel)
|
||||
SendMrcpRequest(pRecorderChannel->m_pMrcpChannel,pMrcpMessage);
|
||||
}
|
||||
|
||||
const mpf_codec_descriptor_t* pDescriptor = mrcp_application_source_descriptor_get(pMrcpChannel);
|
||||
pRecorderChannel->m_pAudioIn = GetAudioIn(pDescriptor,GetSessionPool());
|
||||
return true;
|
||||
}
|
||||
@@ -260,8 +267,7 @@ FILE* RecorderSession::GetAudioIn(const mpf_codec_descriptor_t* pDescriptor, apr
|
||||
const char* pFileName = GetScenario()->GetAudioSource();
|
||||
if(!pFileName)
|
||||
{
|
||||
pFileName = apr_psprintf(pool,"demo-%dkHz.pcm",
|
||||
pDescriptor ? pDescriptor->sampling_rate/1000 : 8);
|
||||
pFileName = apr_psprintf(pool,"demo-%dkHz.pcm",pDescriptor->sampling_rate/1000);
|
||||
}
|
||||
apt_dir_layout_t* pDirLayout = GetScenario()->GetDirLayout();
|
||||
const char* pFilePath = apt_datadir_filepath_get(pDirLayout,pFileName,pool);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: setparamscenario.cpp 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: setparamscenario.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "setparamscenario.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: setparamsession.cpp 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: setparamsession.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "setparamsession.h"
|
||||
@@ -97,6 +97,7 @@ RecogChannel* SetParamSession::CreateRecogChannel()
|
||||
ReadStream,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: synthscenario.cpp 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: synthscenario.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: synthsession.cpp 1586 2010-03-12 19:39:02Z achaloyan $
|
||||
* $Id: synthsession.cpp 2193 2014-10-08 03:44:33Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "synthsession.h"
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "mrcp_generic_header.h"
|
||||
#include "mrcp_synth_header.h"
|
||||
#include "mrcp_synth_resource.h"
|
||||
#include "apt_log.h"
|
||||
|
||||
struct SynthChannel
|
||||
{
|
||||
@@ -145,7 +146,8 @@ SynthChannel* SynthSession::CreateSynthChannel()
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
WriteStream
|
||||
WriteStream,
|
||||
NULL
|
||||
};
|
||||
|
||||
pTermination = CreateAudioTermination(
|
||||
@@ -173,6 +175,13 @@ bool SynthSession::OnChannelAdd(mrcp_channel_t* pMrcpChannel, mrcp_sig_status_co
|
||||
if(!UmcSession::OnChannelAdd(pMrcpChannel,status))
|
||||
return false;
|
||||
|
||||
const mpf_codec_descriptor_t* pDescriptor = mrcp_application_sink_descriptor_get(pMrcpChannel);
|
||||
if(!pDescriptor)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Media Sink Descriptor");
|
||||
return Terminate();
|
||||
}
|
||||
|
||||
SynthChannel* pSynthChannel = (SynthChannel*) mrcp_application_channel_object_get(pMrcpChannel);
|
||||
if(status != MRCP_SIG_STATUS_CODE_SUCCESS)
|
||||
{
|
||||
@@ -187,7 +196,6 @@ bool SynthSession::OnChannelAdd(mrcp_channel_t* pMrcpChannel, mrcp_sig_status_co
|
||||
SendMrcpRequest(pSynthChannel->m_pMrcpChannel,pMrcpMessage);
|
||||
}
|
||||
|
||||
const mpf_codec_descriptor_t* pDescriptor = mrcp_application_sink_descriptor_get(pMrcpChannel);
|
||||
pSynthChannel->m_pAudioOut = GetAudioOut(pDescriptor,GetSessionPool());
|
||||
return true;
|
||||
}
|
||||
@@ -273,12 +281,19 @@ mrcp_message_t* SynthSession::CreateSpeakRequest(mrcp_channel_t* pMrcpChannel)
|
||||
|
||||
FILE* SynthSession::GetAudioOut(const mpf_codec_descriptor_t* pDescriptor, apr_pool_t* pool) const
|
||||
{
|
||||
char* pFileName = apr_psprintf(pool,"synth-%dkHz-%s.pcm",
|
||||
pDescriptor ? pDescriptor->sampling_rate/1000 : 8, GetMrcpSessionId());
|
||||
FILE* file;
|
||||
char* pFileName = apr_psprintf(pool,"synth-%dkHz-%s.pcm",pDescriptor->sampling_rate/1000, GetMrcpSessionId());
|
||||
apt_dir_layout_t* pDirLayout = GetScenario()->GetDirLayout();
|
||||
char* pFilePath = apt_datadir_filepath_get(pDirLayout,pFileName,pool);
|
||||
if(!pFilePath)
|
||||
char* pFilePath = apt_vardir_filepath_get(pDirLayout,pFileName,pool);
|
||||
if(!pFilePath)
|
||||
return NULL;
|
||||
|
||||
return fopen(pFilePath,"wb");
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Open Speech Output File [%s] for Writing",pFilePath);
|
||||
file = fopen(pFilePath,"wb");
|
||||
if(!file)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Open Speech Output File [%s] for Writing",pFilePath);
|
||||
return NULL;
|
||||
}
|
||||
return file;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: umcconsole.cpp 1785 2010-09-22 06:14:29Z achaloyan $
|
||||
* $Id: umcconsole.cpp 2204 2014-10-31 01:01:42Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "umcconsole.h"
|
||||
#include "umcframework.h"
|
||||
#include "apt_pool.h"
|
||||
#include "uni_version.h"
|
||||
|
||||
|
||||
UmcConsole::UmcConsole() :
|
||||
@@ -64,8 +65,26 @@ bool UmcConsole::Run(int argc, const char * const *argv)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* create the structure of default directories layout */
|
||||
pDirLayout = apt_default_dir_layout_create(m_Options.m_RootDirPath,pool);
|
||||
if(m_Options.m_DirLayoutConf)
|
||||
{
|
||||
/* create and load directories layout from the configuration file */
|
||||
pDirLayout = apt_dir_layout_create(pool);
|
||||
if(pDirLayout)
|
||||
apt_dir_layout_load(pDirLayout,m_Options.m_DirLayoutConf,pool);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* create default directories layout */
|
||||
pDirLayout = apt_default_dir_layout_create(m_Options.m_RootDirPath,pool);
|
||||
}
|
||||
|
||||
if(!pDirLayout)
|
||||
{
|
||||
printf("Failed to Create Directories Layout\n");
|
||||
apr_pool_destroy(pool);
|
||||
apr_terminate();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* get path to logger configuration file */
|
||||
logConfPath = apt_confdir_filepath_get(pDirLayout,"logger.xml",pool);
|
||||
@@ -86,7 +105,8 @@ bool UmcConsole::Run(int argc, const char * const *argv)
|
||||
if(apt_log_output_mode_check(APT_LOG_OUTPUT_FILE) == TRUE)
|
||||
{
|
||||
/* open the log file */
|
||||
apt_log_file_open(pDirLayout->log_dir_path,"unimrcpclient",MAX_LOG_FILE_SIZE,MAX_LOG_FILE_COUNT,FALSE,pool);
|
||||
const char *logDirPath = apt_dir_layout_path_get(pDirLayout,APT_LAYOUT_LOG_DIR);
|
||||
apt_log_file_open(logDirPath,"unimrcpclient",MAX_LOG_FILE_SIZE,MAX_LOG_FILE_COUNT,FALSE,pool);
|
||||
}
|
||||
|
||||
/* create demo framework */
|
||||
@@ -199,7 +219,7 @@ bool UmcConsole::RunCmdLine()
|
||||
{
|
||||
apt_bool_t running = true;
|
||||
char cmdline[1024];
|
||||
int i;
|
||||
apr_size_t i;
|
||||
do
|
||||
{
|
||||
printf(">");
|
||||
@@ -222,9 +242,13 @@ bool UmcConsole::RunCmdLine()
|
||||
return true;
|
||||
}
|
||||
|
||||
void UmcConsole::Usage() const
|
||||
void UmcConsole::Usage()
|
||||
{
|
||||
printf(
|
||||
"\n"
|
||||
" * "UNI_COPYRIGHT"\n"
|
||||
" *\n"
|
||||
UNI_LICENSE"\n"
|
||||
"\n"
|
||||
"Usage:\n"
|
||||
"\n"
|
||||
@@ -232,7 +256,10 @@ void UmcConsole::Usage() const
|
||||
"\n"
|
||||
" Available options:\n"
|
||||
"\n"
|
||||
" -r [--root-dir] path : Set the project root directory path.\n"
|
||||
" -r [--root-dir] path : Set the path to the project root directory.\n"
|
||||
"\n"
|
||||
" -c [--dir-layout] path : Set the path to the dir layout config file.\n"
|
||||
" (takes the precedence over --root-dir option)\n"
|
||||
"\n"
|
||||
" -l [--log-prio] priority : Set the log priority.\n"
|
||||
" (0-emergency, ..., 7-debug)\n"
|
||||
@@ -240,6 +267,8 @@ void UmcConsole::Usage() const
|
||||
" -o [--log-output] mode : Set the log output mode.\n"
|
||||
" (0-none, 1-console only, 2-file only, 3-both)\n"
|
||||
"\n"
|
||||
" -v [--version] : Show the version.\n"
|
||||
"\n"
|
||||
" -h [--help] : Show the help.\n"
|
||||
"\n");
|
||||
}
|
||||
@@ -254,18 +283,15 @@ bool UmcConsole::LoadOptions(int argc, const char * const *argv, apr_pool_t *poo
|
||||
const apr_getopt_option_t opt_option[] =
|
||||
{
|
||||
/* long-option, short-option, has-arg flag, description */
|
||||
{ "root-dir", 'r', TRUE, "path to root dir" }, /* -r arg or --root-dir arg */
|
||||
{ "log-prio", 'l', TRUE, "log priority" }, /* -l arg or --log-prio arg */
|
||||
{ "log-output", 'o', TRUE, "log output mode" }, /* -o arg or --log-output arg */
|
||||
{ "help", 'h', FALSE, "show help" }, /* -h or --help */
|
||||
{ NULL, 0, 0, NULL }, /* end */
|
||||
{ "root-dir", 'r', TRUE, "path to root dir" }, /* -r arg or --root-dir arg */
|
||||
{ "dir-layout", 'c', TRUE, "path to dir layout conf" }, /* -c arg or --dir-layout arg */
|
||||
{ "log-prio", 'l', TRUE, "log priority" }, /* -l arg or --log-prio arg */
|
||||
{ "log-output", 'o', TRUE, "log output mode" }, /* -o arg or --log-output arg */
|
||||
{ "version", 'v', FALSE, "show version" }, /* -v or --version */
|
||||
{ "help", 'h', FALSE, "show help" }, /* -h or --help */
|
||||
{ NULL, 0, 0, NULL }, /* end */
|
||||
};
|
||||
|
||||
/* set the default options */
|
||||
m_Options.m_RootDirPath = "../";
|
||||
m_Options.m_LogPriority = NULL;
|
||||
m_Options.m_LogOutput = NULL;
|
||||
|
||||
rv = apr_getopt_init(&opt, pool , argc, argv);
|
||||
if(rv != APR_SUCCESS)
|
||||
return false;
|
||||
@@ -277,6 +303,9 @@ bool UmcConsole::LoadOptions(int argc, const char * const *argv, apr_pool_t *poo
|
||||
case 'r':
|
||||
m_Options.m_RootDirPath = optarg;
|
||||
break;
|
||||
case 'c':
|
||||
m_Options.m_DirLayoutConf = optarg;
|
||||
break;
|
||||
case 'l':
|
||||
if(optarg)
|
||||
m_Options.m_LogPriority = optarg;
|
||||
@@ -285,6 +314,9 @@ bool UmcConsole::LoadOptions(int argc, const char * const *argv, apr_pool_t *poo
|
||||
if(optarg)
|
||||
m_Options.m_LogOutput = optarg;
|
||||
break;
|
||||
case 'v':
|
||||
printf(UNI_VERSION_STRING);
|
||||
return FALSE;
|
||||
case 'h':
|
||||
Usage();
|
||||
return FALSE;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: umcframework.cpp 1767 2010-08-23 19:10:22Z achaloyan $
|
||||
* $Id: umcframework.cpp 2204 2014-10-31 01:01:42Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "umcframework.h"
|
||||
@@ -193,7 +193,12 @@ apr_xml_doc* UmcFramework::LoadDocument()
|
||||
apr_status_t rv;
|
||||
const char* pFilePath;
|
||||
|
||||
pFilePath = apr_psprintf(m_pPool,"%s/%s",m_pDirLayout->conf_dir_path,"umcscenarios.xml");
|
||||
pFilePath = apt_dir_layout_path_compose(m_pDirLayout,APT_LAYOUT_CONF_DIR,"umcscenarios.xml",m_pPool);
|
||||
if(!pFilePath)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Compose Config File Path");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Open Config File [%s]",pFilePath);
|
||||
rv = apr_file_open(&pFD,pFilePath,APR_READ|APR_BINARY,0,m_pPool);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: umcscenario.cpp 1571 2010-03-07 20:33:39Z achaloyan $
|
||||
* $Id: umcscenario.cpp 2232 2014-11-12 01:33:37Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -40,7 +40,8 @@ bool UmcScenario::Load(const apr_xml_elem* pElem, apr_pool_t* pool)
|
||||
/* Load Child Elements */
|
||||
for(pChildElem = pElem->first_child; pChildElem; pChildElem = pChildElem->next)
|
||||
{
|
||||
LoadElement(pChildElem,pool);
|
||||
if(!LoadElement(pChildElem,pool))
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Load Child Element %s",pChildElem->name);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -95,7 +96,7 @@ bool UmcScenario::LoadCapabilities(const apr_xml_elem* pElem, apr_pool_t* pool)
|
||||
{
|
||||
const apr_xml_elem* pChildElem;
|
||||
/* Load Child Elements */
|
||||
m_pCapabilities = (mpf_codec_capabilities_t*) apr_palloc(pool,sizeof(mpf_codec_capabilities_t*));
|
||||
m_pCapabilities = (mpf_codec_capabilities_t*) apr_palloc(pool,sizeof(mpf_codec_capabilities_t));
|
||||
mpf_codec_capabilities_init(m_pCapabilities,1,pool);
|
||||
for(pChildElem = pElem->first_child; pChildElem; pChildElem = pChildElem->next)
|
||||
{
|
||||
@@ -126,7 +127,7 @@ bool UmcScenario::LoadCapabilities(const apr_xml_elem* pElem, apr_pool_t* pool)
|
||||
return true;
|
||||
}
|
||||
|
||||
int UmcScenario::ParseRates(const char* pStr, apr_pool_t* pool) const
|
||||
int UmcScenario::ParseRates(const char* pStr, apr_pool_t* pool)
|
||||
{
|
||||
int rates = 0;
|
||||
if(pStr)
|
||||
@@ -181,7 +182,7 @@ bool UmcScenario::InitCapabilities(mpf_stream_capabilities_t* pCapabilities) con
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UmcScenario::IsElementEnabled(const apr_xml_elem* pElem) const
|
||||
bool UmcScenario::IsElementEnabled(const apr_xml_elem* pElem)
|
||||
{
|
||||
const apr_xml_attr* pAttr;
|
||||
for(pAttr = pElem->attr; pAttr; pAttr = pAttr->next)
|
||||
@@ -194,7 +195,7 @@ bool UmcScenario::IsElementEnabled(const apr_xml_elem* pElem) const
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* UmcScenario::LoadFileContent(const char* pFileName, apr_pool_t* pool) const
|
||||
const char* UmcScenario::LoadFileContent(const char* pFileName, apr_size_t& size, apr_pool_t* pool) const
|
||||
{
|
||||
if(!m_pDirLayout || !pFileName)
|
||||
return NULL;
|
||||
@@ -218,7 +219,7 @@ const char* UmcScenario::LoadFileContent(const char* pFileName, apr_pool_t* pool
|
||||
return NULL;
|
||||
}
|
||||
|
||||
apr_size_t size = (apr_size_t)finfo.size;
|
||||
size = (apr_size_t)finfo.size;
|
||||
char* pContent = (char*) apr_palloc(pool,size+1);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Load File Content size [%"APR_SIZE_T_FMT" bytes] %s",size,pFilePath);
|
||||
if(apr_file_read(pFile,pContent,&size) != APR_SUCCESS)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: umcsession.cpp 1695 2010-05-19 18:56:15Z achaloyan $
|
||||
* $Id: umcsession.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "umcsession.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: verifierscenario.cpp 1775 2010-08-26 18:23:38Z achaloyan $
|
||||
* $Id: verifierscenario.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: verifiersession.cpp 1778 2010-08-27 17:34:52Z achaloyan $
|
||||
* $Id: verifiersession.cpp 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "verifiersession.h"
|
||||
@@ -164,6 +164,7 @@ VerifierChannel* VerifierSession::CreateVerifierChannel()
|
||||
ReadStream,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -266,7 +267,7 @@ bool VerifierSession::OnMessageReceive(mrcp_channel_t* pMrcpChannel, mrcp_messag
|
||||
|
||||
/* create and send END-SESSION request */
|
||||
mrcp_message_t* pMrcpMessage = CreateEndSessionRequest(pMrcpChannel);
|
||||
if(pMrcpMessage)
|
||||
if(pVerifierChannel && pMrcpMessage)
|
||||
{
|
||||
SendMrcpRequest(pVerifierChannel->m_pMrcpChannel,pMrcpMessage);
|
||||
}
|
||||
@@ -281,6 +282,13 @@ bool VerifierSession::OnMessageReceive(mrcp_channel_t* pMrcpChannel, mrcp_messag
|
||||
|
||||
bool VerifierSession::StartVerification(mrcp_channel_t* pMrcpChannel)
|
||||
{
|
||||
const mpf_codec_descriptor_t* pDescriptor = mrcp_application_source_descriptor_get(pMrcpChannel);
|
||||
if(!pDescriptor)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Media Source Descriptor");
|
||||
return Terminate();
|
||||
}
|
||||
|
||||
VerifierChannel* pVerifierChannel = (VerifierChannel*) mrcp_application_channel_object_get(pMrcpChannel);
|
||||
/* create and send Verification request */
|
||||
mrcp_message_t* pMrcpMessage = CreateStartSessionRequest(pMrcpChannel);
|
||||
@@ -289,7 +297,6 @@ bool VerifierSession::StartVerification(mrcp_channel_t* pMrcpChannel)
|
||||
SendMrcpRequest(pVerifierChannel->m_pMrcpChannel,pMrcpMessage);
|
||||
}
|
||||
|
||||
const mpf_codec_descriptor_t* pDescriptor = mrcp_application_source_descriptor_get(pMrcpChannel);
|
||||
pVerifierChannel->m_pAudioIn = GetAudioIn(pDescriptor,GetSessionPool());
|
||||
if(!pVerifierChannel->m_pAudioIn)
|
||||
{
|
||||
@@ -371,7 +378,7 @@ FILE* VerifierSession::GetAudioIn(const mpf_codec_descriptor_t* pDescriptor, apr
|
||||
|
||||
const char* pFileName = apr_psprintf(pool,"%s-%dkHz.pcm",
|
||||
pVoiceprintIdentifier,
|
||||
pDescriptor ? pDescriptor->sampling_rate/1000 : 8);
|
||||
pDescriptor->sampling_rate/1000);
|
||||
apt_dir_layout_t* pDirLayout = pScenario->GetDirLayout();
|
||||
const char* pFilePath = apt_datadir_filepath_get(pDirLayout,pFileName,pool);
|
||||
if(!pFilePath)
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
#include "uni_version.h"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION UNI_VERSION_STRING_CSV,0
|
||||
PRODUCTVERSION UNI_VERSION_STRING_CSV,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#if defined(_DEBUG)
|
||||
FILEFLAGS 0x01L
|
||||
#else
|
||||
FILEFLAGS 0x00L
|
||||
#endif
|
||||
#if defined(WINNT) || defined(WIN64)
|
||||
FILEOS 0x40004L
|
||||
#else
|
||||
FILEOS 0x4L
|
||||
#endif
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", UNI_LICENSE "\0"
|
||||
VALUE "CompanyName", "UniMRCP\0"
|
||||
VALUE "FileDescription", "UniMRCP Client Application\0"
|
||||
VALUE "FileVersion", UNI_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "umc" "\0"
|
||||
VALUE "LegalCopyright", UNI_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "umc.exe" "\0"
|
||||
VALUE "ProductName", "UniMRCP Project\0"
|
||||
VALUE "ProductVersion", UNI_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
#include "uni_version.h"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION UNI_VERSION_STRING_CSV,0
|
||||
PRODUCTVERSION UNI_VERSION_STRING_CSV,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#if defined(_DEBUG)
|
||||
FILEFLAGS 0x01L
|
||||
#else
|
||||
FILEFLAGS 0x00L
|
||||
#endif
|
||||
#if defined(WINNT) || defined(WIN64)
|
||||
FILEOS 0x40004L
|
||||
#else
|
||||
FILEOS 0x4L
|
||||
#endif
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", UNI_LICENSE "\0"
|
||||
VALUE "CompanyName", "UniMRCP\0"
|
||||
VALUE "FileDescription", "UniMRCP Client Application\0"
|
||||
VALUE "FileVersion", UNI_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "umc" "\0"
|
||||
VALUE "LegalCopyright", UNI_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "umc.exe" "\0"
|
||||
VALUE "ProductName", "UniMRCP Project\0"
|
||||
VALUE "ProductVersion", UNI_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{CD1C52C1-D8E1-4654-AE65-6CCAB38DE894}</ProjectGuid>
|
||||
<RootNamespace>umc</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\dtmfscenario.cpp" />
|
||||
<ClCompile Include="src\dtmfsession.cpp" />
|
||||
<ClCompile Include="src\main.cpp" />
|
||||
<ClCompile Include="src\recogscenario.cpp" />
|
||||
<ClCompile Include="src\recogsession.cpp" />
|
||||
<ClCompile Include="src\recorderscenario.cpp" />
|
||||
<ClCompile Include="src\recordersession.cpp" />
|
||||
<ClCompile Include="src\setparamscenario.cpp" />
|
||||
<ClCompile Include="src\setparamsession.cpp" />
|
||||
<ClCompile Include="src\synthscenario.cpp" />
|
||||
<ClCompile Include="src\synthsession.cpp" />
|
||||
<ClCompile Include="src\umcconsole.cpp" />
|
||||
<ClCompile Include="src\umcframework.cpp" />
|
||||
<ClCompile Include="src\umcscenario.cpp" />
|
||||
<ClCompile Include="src\umcsession.cpp" />
|
||||
<ClCompile Include="src\verifierscenario.cpp" />
|
||||
<ClCompile Include="src\verifiersession.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\dtmfscenario.h" />
|
||||
<ClInclude Include="include\dtmfsession.h" />
|
||||
<ClInclude Include="include\recogscenario.h" />
|
||||
<ClInclude Include="include\recogsession.h" />
|
||||
<ClInclude Include="include\recorderscenario.h" />
|
||||
<ClInclude Include="include\recordersession.h" />
|
||||
<ClInclude Include="include\setparamscenario.h" />
|
||||
<ClInclude Include="include\setparamsession.h" />
|
||||
<ClInclude Include="include\synthscenario.h" />
|
||||
<ClInclude Include="include\synthsession.h" />
|
||||
<ClInclude Include="include\umcconsole.h" />
|
||||
<ClInclude Include="include\umcframework.h" />
|
||||
<ClInclude Include="include\umcscenario.h" />
|
||||
<ClInclude Include="include\umcsession.h" />
|
||||
<ClInclude Include="include\verifierscenario.h" />
|
||||
<ClInclude Include="include\verifiersession.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="umc.rc">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\libunimrcp-client\libunimrcpclient.vcxproj">
|
||||
<Project>{ee157390-1e85-416c-946e-620e32c9ad33}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="include">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\dtmfscenario.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dtmfsession.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\main.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\recogscenario.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\recogsession.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\recorderscenario.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\recordersession.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\setparamscenario.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\setparamsession.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\synthscenario.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\synthsession.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\umcconsole.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\umcframework.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\umcscenario.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\umcsession.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\verifierscenario.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\verifiersession.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\dtmfscenario.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\dtmfsession.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\recogscenario.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\recogsession.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\recorderscenario.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\recordersession.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\setparamscenario.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\setparamsession.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\synthscenario.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\synthsession.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\umcconsole.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\umcframework.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\umcscenario.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\umcsession.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\verifierscenario.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\verifiersession.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="umc.rc" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,20 +1,8 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
AM_CPPFLAGS = -Iinclude \
|
||||
-I$(unimrcp_srcdir)/platforms/unimrcp-client/include \
|
||||
-I$(top_srcdir)/platforms/libunimrcp-client/include \
|
||||
-I$(top_srcdir)/libs/mrcp-client/include \
|
||||
-I$(top_srcdir)/libs/mrcp-signaling/include \
|
||||
-I$(top_srcdir)/libs/mrcpv2-transport/include \
|
||||
-I$(top_srcdir)/libs/mrcp/include \
|
||||
-I$(top_srcdir)/libs/mrcp/message/include \
|
||||
-I$(top_srcdir)/libs/mrcp/control/include \
|
||||
-I$(top_srcdir)/libs/mrcp/resources/include \
|
||||
-I$(top_srcdir)/libs/mpf/include \
|
||||
-I$(top_srcdir)/libs/apr-toolkit/include \
|
||||
$(UNIMRCP_APR_INCLUDES) $(UNIMRCP_APU_INCLUDES)
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/platforms/unimrcp-client/include \
|
||||
$(UNIMRCP_CLIENTAPP_INCLUDES)
|
||||
|
||||
bin_PROGRAMS = unimrcpclient
|
||||
|
||||
unimrcpclient_SOURCES = src/main.c \
|
||||
src/demo_framework.c \
|
||||
src/demo_synth_application.c \
|
||||
@@ -22,8 +10,7 @@ unimrcpclient_SOURCES = src/main.c \
|
||||
src/demo_bypass_application.c \
|
||||
src/demo_discover_application.c \
|
||||
src/demo_util.c
|
||||
unimrcpclient_LDADD = $(top_builddir)/platforms/libunimrcp-client/libunimrcpclient.la
|
||||
unimrcpclient_LDADD = $(UNIMRCP_CLIENTAPP_LIBS)
|
||||
unimrcpclient_LDFLAGS = $(UNIMRCP_CLIENTAPP_OPTS)
|
||||
|
||||
if ISMAC
|
||||
unimrcpclient_LDFLAGS = -framework CoreFoundation -framework SystemConfiguration
|
||||
endif
|
||||
include $(top_srcdir)/build/rules/uniclientapp.am
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: demo_application.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: demo_application.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef DEMO_APPLICATION_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: demo_framework.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: demo_framework.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef DEMO_FRAMEWORK_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: demo_util.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: demo_util.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef DEMO_UTIL_H
|
||||
@@ -36,9 +36,6 @@ mrcp_message_t* demo_define_grammar_message_create(mrcp_session_t *session, mrcp
|
||||
/** Create demo MRCP message (RECOGNIZE request) */
|
||||
mrcp_message_t* demo_recognize_message_create(mrcp_session_t *session, mrcp_channel_t *channel, const apt_dir_layout_t *dir_layout);
|
||||
|
||||
/** Parse NLSML result */
|
||||
apt_bool_t demo_nlsml_result_parse(mrcp_message_t *message);
|
||||
|
||||
/** Create demo RTP termination descriptor */
|
||||
mpf_rtp_termination_descriptor_t* demo_rtp_descriptor_create(apr_pool_t *pool);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: demo_bypass_application.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: demo_bypass_application.c 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -62,7 +62,9 @@ static const mrcp_app_message_dispatcher_t demo_application_dispatcher = {
|
||||
demo_application_on_session_terminate,
|
||||
demo_application_on_channel_add,
|
||||
demo_application_on_channel_remove,
|
||||
demo_application_on_message_receive
|
||||
demo_application_on_message_receive,
|
||||
NULL /* demo_application_on_terminate_event */,
|
||||
NULL /* demo_application_on_resource_discover */
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: demo_discover_application.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: demo_discover_application.c 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: demo_framework.c 1571 2010-03-07 20:33:39Z achaloyan $
|
||||
* $Id: demo_framework.c 2233 2014-11-12 01:34:59Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <apr_hash.h>
|
||||
@@ -118,9 +118,8 @@ apt_bool_t demo_framework_app_run(demo_framework_t *framework, const char *app_n
|
||||
framework_task_data_t *framework_task_data = (framework_task_data_t*)task_msg->data;
|
||||
task_msg->type = TASK_MSG_USER;
|
||||
task_msg->sub_type = DEMO_CONSOLE_MSG_ID;
|
||||
framework_task_data = (framework_task_data_t*) task_msg->data;
|
||||
strcpy(framework_task_data->app_name,app_name);
|
||||
strcpy(framework_task_data->profile_name,profile_name);
|
||||
strncpy(framework_task_data->app_name,app_name,sizeof(framework_task_data->app_name)-1);
|
||||
strncpy(framework_task_data->profile_name,profile_name,sizeof(framework_task_data->profile_name)-1);
|
||||
framework_task_data->app_message = NULL;
|
||||
framework_task_data->demo_application = NULL;
|
||||
apt_task_msg_signal(task,task_msg);
|
||||
@@ -237,7 +236,6 @@ static apt_bool_t demo_framework_message_handler(const mrcp_app_message_t *app_m
|
||||
framework_task_data_t *framework_task_data = (framework_task_data_t*)task_msg->data;
|
||||
task_msg->type = TASK_MSG_USER;
|
||||
task_msg->sub_type = DEMO_APPLICATION_MSG_ID;
|
||||
framework_task_data = (framework_task_data_t*) task_msg->data;
|
||||
framework_task_data->app_message = app_message;
|
||||
framework_task_data->demo_application = demo_application;
|
||||
apt_task_msg_signal(task,task_msg);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: demo_recog_application.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: demo_recog_application.c 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "mrcp_generic_header.h"
|
||||
#include "mrcp_recog_header.h"
|
||||
#include "mrcp_recog_resource.h"
|
||||
#include "apt_nlsml_doc.h"
|
||||
#include "apt_log.h"
|
||||
|
||||
typedef struct recog_app_channel_t recog_app_channel_t;
|
||||
@@ -71,7 +72,9 @@ static const mrcp_app_message_dispatcher_t recog_application_dispatcher = {
|
||||
recog_application_on_session_terminate,
|
||||
recog_application_on_channel_add,
|
||||
recog_application_on_channel_remove,
|
||||
recog_application_on_message_receive
|
||||
recog_application_on_message_receive,
|
||||
NULL /* recog_application_on_terminate_event */,
|
||||
NULL /* recog_application_on_resource_discover */
|
||||
};
|
||||
|
||||
/** Declaration of recognizer audio stream methods */
|
||||
@@ -87,6 +90,7 @@ static const mpf_audio_stream_vtable_t audio_stream_vtable = {
|
||||
recog_app_stream_read,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -240,19 +244,26 @@ static apt_bool_t recog_application_on_channel_remove(mrcp_application_t *applic
|
||||
/** Handle the DEFINE-GRAMMAR responses */
|
||||
static apt_bool_t recog_application_on_define_grammar(mrcp_application_t *application, mrcp_session_t *session, mrcp_channel_t *channel)
|
||||
{
|
||||
recog_app_channel_t *recog_channel = mrcp_application_channel_object_get(channel);
|
||||
mrcp_message_t *mrcp_message;
|
||||
recog_app_channel_t *recog_channel = mrcp_application_channel_object_get(channel);
|
||||
const apt_dir_layout_t *dir_layout = mrcp_application_dir_layout_get(application);
|
||||
apr_pool_t *pool = mrcp_application_session_pool_get(session);
|
||||
|
||||
const mpf_codec_descriptor_t *descriptor = mrcp_application_source_descriptor_get(channel);
|
||||
if(!descriptor) {
|
||||
/* terminate the demo */
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Media Source Descriptor");
|
||||
return mrcp_application_session_terminate(session);
|
||||
}
|
||||
|
||||
/* create and send RECOGNIZE request */
|
||||
mrcp_message = demo_recognize_message_create(session,channel,dir_layout);
|
||||
if(mrcp_message) {
|
||||
mrcp_application_message_send(session,channel,mrcp_message);
|
||||
}
|
||||
|
||||
if(recog_channel) {
|
||||
const mpf_codec_descriptor_t *descriptor = mrcp_application_source_descriptor_get(channel);
|
||||
char *file_name = apr_psprintf(pool,"one-%dkHz.pcm",
|
||||
descriptor ? descriptor->sampling_rate/1000 : 8);
|
||||
apr_pool_t *pool = mrcp_application_session_pool_get(session);
|
||||
char *file_name = apr_psprintf(pool,"one-%dkHz.pcm",descriptor->sampling_rate/1000);
|
||||
char *file_path = apt_datadir_filepath_get(dir_layout,file_name,pool);
|
||||
if(file_path) {
|
||||
recog_channel->audio_in = fopen(file_path,"rb");
|
||||
@@ -303,7 +314,11 @@ static apt_bool_t recog_application_on_message_receive(mrcp_application_t *appli
|
||||
}
|
||||
else if(message->start_line.message_type == MRCP_MESSAGE_TYPE_EVENT) {
|
||||
if(message->start_line.method_id == RECOGNIZER_RECOGNITION_COMPLETE) {
|
||||
demo_nlsml_result_parse(message);
|
||||
nlsml_result_t *result = nlsml_result_parse(message->body.buf, message->body.length, message->pool);
|
||||
if(result) {
|
||||
nlsml_result_trace(result, message->pool);
|
||||
}
|
||||
|
||||
if(recog_channel) {
|
||||
recog_channel->streaming = FALSE;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: demo_synth_application.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: demo_synth_application.c 2193 2014-10-08 03:44:33Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "mrcp_generic_header.h"
|
||||
#include "mrcp_synth_header.h"
|
||||
#include "mrcp_synth_resource.h"
|
||||
#include "apt_log.h"
|
||||
|
||||
typedef struct synth_app_channel_t synth_app_channel_t;
|
||||
|
||||
@@ -64,7 +65,9 @@ static const mrcp_app_message_dispatcher_t synth_application_dispatcher = {
|
||||
synth_application_on_session_terminate,
|
||||
synth_application_on_channel_add,
|
||||
synth_application_on_channel_remove,
|
||||
synth_application_on_message_receive
|
||||
synth_application_on_message_receive,
|
||||
NULL /* synth_application_on_terminate_event */,
|
||||
NULL /* synth_application_on_resource_discover */
|
||||
};
|
||||
|
||||
/** Declaration of synthesizer audio stream methods */
|
||||
@@ -80,7 +83,8 @@ static const mpf_audio_stream_vtable_t audio_stream_vtable = {
|
||||
NULL,
|
||||
synth_app_stream_open,
|
||||
synth_app_stream_close,
|
||||
synth_app_stream_write
|
||||
synth_app_stream_write,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -196,26 +200,36 @@ static apt_bool_t synth_application_on_session_terminate(mrcp_application_t *app
|
||||
/** Handle the responses sent to channel add requests */
|
||||
static apt_bool_t synth_application_on_channel_add(mrcp_application_t *application, mrcp_session_t *session, mrcp_channel_t *channel, mrcp_sig_status_code_e status)
|
||||
{
|
||||
synth_app_channel_t *synth_channel = mrcp_application_channel_object_get(channel);
|
||||
apr_pool_t *pool = mrcp_application_session_pool_get(session);
|
||||
if(status == MRCP_SIG_STATUS_CODE_SUCCESS) {
|
||||
mrcp_message_t *mrcp_message;
|
||||
synth_app_channel_t *synth_channel = mrcp_application_channel_object_get(channel);
|
||||
apr_pool_t *pool = mrcp_application_session_pool_get(session);
|
||||
const apt_dir_layout_t *dir_layout = mrcp_application_dir_layout_get(application);
|
||||
const mpf_codec_descriptor_t *descriptor = mrcp_application_sink_descriptor_get(channel);
|
||||
if(!descriptor) {
|
||||
/* terminate the demo */
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Media Sink Descriptor");
|
||||
return mrcp_application_session_terminate(session);
|
||||
}
|
||||
|
||||
/* create and send SPEAK request */
|
||||
mrcp_message = demo_speak_message_create(session,channel,dir_layout);
|
||||
if(mrcp_message) {
|
||||
mrcp_application_message_send(session,channel,mrcp_message);
|
||||
}
|
||||
|
||||
if(synth_channel && session) {
|
||||
if(synth_channel) {
|
||||
const apt_str_t *id = mrcp_application_session_id_get(session);
|
||||
const mpf_codec_descriptor_t *descriptor = mrcp_application_sink_descriptor_get(channel);
|
||||
char *file_name = apr_psprintf(pool,"synth-%dkHz-%s.pcm",
|
||||
descriptor ? descriptor->sampling_rate/1000 : 8,
|
||||
id->buf);
|
||||
char *file_path = apt_datadir_filepath_get(dir_layout,file_name,pool);
|
||||
descriptor->sampling_rate/1000,
|
||||
id->buf);
|
||||
char *file_path = apt_vardir_filepath_get(dir_layout,file_name,pool);
|
||||
if(file_path) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Open Speech Output File [%s] for Writing",file_path);
|
||||
synth_channel->audio_out = fopen(file_path,"wb");
|
||||
if(!synth_channel->audio_out) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Open Utterance Output File [%s] for Writing",file_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: demo_util.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: demo_util.c 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include "demo_util.h"
|
||||
@@ -26,8 +26,6 @@
|
||||
/* recognizer includes */
|
||||
#include "mrcp_recog_header.h"
|
||||
#include "mrcp_recog_resource.h"
|
||||
/* NLSML doc include */
|
||||
#include "apt_nlsml_doc.h"
|
||||
/* logger include */
|
||||
#include "apt_log.h"
|
||||
|
||||
@@ -141,38 +139,6 @@ mrcp_message_t* demo_recognize_message_create(mrcp_session_t *session, mrcp_chan
|
||||
return mrcp_message;
|
||||
}
|
||||
|
||||
/** Parse NLSML result */
|
||||
apt_bool_t demo_nlsml_result_parse(mrcp_message_t *message)
|
||||
{
|
||||
apr_xml_elem *interpret;
|
||||
apr_xml_elem *instance;
|
||||
apr_xml_elem *input;
|
||||
apr_xml_doc *doc = nlsml_doc_load(&message->body,message->pool);
|
||||
if(!doc) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* walk through interpreted results */
|
||||
interpret = nlsml_first_interpret_get(doc);
|
||||
for(; interpret; interpret = nlsml_next_interpret_get(interpret)) {
|
||||
/* get instance and input */
|
||||
nlsml_interpret_results_get(interpret,&instance,&input);
|
||||
if(instance) {
|
||||
/* process instance */
|
||||
if(instance->first_cdata.first) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Interpreted Instance [%s]",instance->first_cdata.first->text);
|
||||
}
|
||||
}
|
||||
if(input) {
|
||||
/* process input */
|
||||
if(input->first_cdata.first) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Interpreted Input [%s]",input->first_cdata.first->text);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Create demo RTP termination descriptor */
|
||||
mpf_rtp_termination_descriptor_t* demo_rtp_descriptor_create(apr_pool_t *pool)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,19 +13,20 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: main.c 1785 2010-09-22 06:14:29Z achaloyan $
|
||||
* $Id: main.c 2204 2014-10-31 01:01:42Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <apr_getopt.h>
|
||||
#include <apr_file_info.h>
|
||||
#include "demo_framework.h"
|
||||
#include "apt_pool.h"
|
||||
#include "apt_log.h"
|
||||
#include "uni_version.h"
|
||||
|
||||
typedef struct {
|
||||
const char *root_dir_path;
|
||||
const char *dir_layout_conf;
|
||||
const char *log_priority;
|
||||
const char *log_output;
|
||||
} client_options_t;
|
||||
@@ -79,7 +80,7 @@ static apt_bool_t demo_framework_cmdline_run(demo_framework_t *framework)
|
||||
{
|
||||
apt_bool_t running = TRUE;
|
||||
char cmdline[1024];
|
||||
int i;
|
||||
apr_size_t i;
|
||||
do {
|
||||
printf(">");
|
||||
memset(&cmdline, 0, sizeof(cmdline));
|
||||
@@ -98,9 +99,13 @@ static apt_bool_t demo_framework_cmdline_run(demo_framework_t *framework)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void usage()
|
||||
static void usage(void)
|
||||
{
|
||||
printf(
|
||||
"\n"
|
||||
" * "UNI_COPYRIGHT"\n"
|
||||
" *\n"
|
||||
UNI_LICENSE"\n"
|
||||
"\n"
|
||||
"Usage:\n"
|
||||
"\n"
|
||||
@@ -108,7 +113,10 @@ static void usage()
|
||||
"\n"
|
||||
" Available options:\n"
|
||||
"\n"
|
||||
" -r [--root-dir] path : Set the project root directory path.\n"
|
||||
" -r [--root-dir] path : Set the path to the project root directory.\n"
|
||||
"\n"
|
||||
" -c [--dir-layout] path : Set the path to the dir layout config file.\n"
|
||||
" (takes the precedence over --root-dir option)\n"
|
||||
"\n"
|
||||
" -l [--log-prio] priority : Set the log priority.\n"
|
||||
" (0-emergency, ..., 7-debug)\n"
|
||||
@@ -116,6 +124,8 @@ static void usage()
|
||||
" -o [--log-output] mode : Set the log output mode.\n"
|
||||
" (0-none, 1-console only, 2-file only, 3-both)\n"
|
||||
"\n"
|
||||
" -v [--version] : Show the version.\n"
|
||||
"\n"
|
||||
" -h [--help] : Show the help.\n"
|
||||
"\n");
|
||||
}
|
||||
@@ -129,11 +139,13 @@ static apt_bool_t demo_framework_options_load(client_options_t *options, int arg
|
||||
|
||||
const apr_getopt_option_t opt_option[] = {
|
||||
/* long-option, short-option, has-arg flag, description */
|
||||
{ "root-dir", 'r', TRUE, "path to root dir" }, /* -r arg or --root-dir arg */
|
||||
{ "log-prio", 'l', TRUE, "log priority" }, /* -l arg or --log-prio arg */
|
||||
{ "log-output", 'o', TRUE, "log output mode" }, /* -o arg or --log-output arg */
|
||||
{ "help", 'h', FALSE, "show help" }, /* -h or --help */
|
||||
{ NULL, 0, 0, NULL }, /* end */
|
||||
{ "root-dir", 'r', TRUE, "path to root dir" }, /* -r arg or --root-dir arg */
|
||||
{ "dir-layout", 'c', TRUE, "path to dir layout conf" }, /* -c arg or --dir-layout arg */
|
||||
{ "log-prio", 'l', TRUE, "log priority" }, /* -l arg or --log-prio arg */
|
||||
{ "log-output", 'o', TRUE, "log output mode" }, /* -o arg or --log-output arg */
|
||||
{ "version", 'v', FALSE, "show version" }, /* -v or --version */
|
||||
{ "help", 'h', FALSE, "show help" }, /* -h or --help */
|
||||
{ NULL, 0, 0, NULL }, /* end */
|
||||
};
|
||||
|
||||
rv = apr_getopt_init(&opt, pool , argc, argv);
|
||||
@@ -141,17 +153,29 @@ static apt_bool_t demo_framework_options_load(client_options_t *options, int arg
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* reset the options */
|
||||
options->root_dir_path = NULL;
|
||||
options->dir_layout_conf = NULL;
|
||||
options->log_priority = NULL;
|
||||
options->log_output = NULL;
|
||||
|
||||
while((rv = apr_getopt_long(opt, opt_option, &optch, &optarg)) == APR_SUCCESS) {
|
||||
switch(optch) {
|
||||
case 'r':
|
||||
options->root_dir_path = optarg;
|
||||
break;
|
||||
case 'c':
|
||||
options->dir_layout_conf = optarg;
|
||||
break;
|
||||
case 'l':
|
||||
options->log_priority = optarg;
|
||||
break;
|
||||
case 'o':
|
||||
options->log_output = optarg;
|
||||
break;
|
||||
case 'v':
|
||||
printf(UNI_VERSION_STRING);
|
||||
return FALSE;
|
||||
case 'h':
|
||||
usage();
|
||||
return FALSE;
|
||||
@@ -168,11 +192,11 @@ static apt_bool_t demo_framework_options_load(client_options_t *options, int arg
|
||||
|
||||
int main(int argc, const char * const *argv)
|
||||
{
|
||||
apr_pool_t *pool = NULL;
|
||||
apr_pool_t *pool;
|
||||
client_options_t options;
|
||||
apt_dir_layout_t *dir_layout;
|
||||
const char *log_conf_path;
|
||||
demo_framework_t *framework;
|
||||
apt_dir_layout_t *dir_layout = NULL;
|
||||
|
||||
/* APR global initialization */
|
||||
if(apr_initialize() != APR_SUCCESS) {
|
||||
@@ -187,11 +211,6 @@ int main(int argc, const char * const *argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* set the default options */
|
||||
options.root_dir_path = "../";
|
||||
options.log_priority = NULL;
|
||||
options.log_output = NULL;
|
||||
|
||||
/* load options */
|
||||
if(demo_framework_options_load(&options,argc,argv,pool) != TRUE) {
|
||||
apr_pool_destroy(pool);
|
||||
@@ -199,8 +218,23 @@ int main(int argc, const char * const *argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* create the structure of default directories layout */
|
||||
dir_layout = apt_default_dir_layout_create(options.root_dir_path,pool);
|
||||
if(options.dir_layout_conf) {
|
||||
/* create and load directories layout from the configuration file */
|
||||
dir_layout = apt_dir_layout_create(pool);
|
||||
if(dir_layout)
|
||||
apt_dir_layout_load(dir_layout,options.dir_layout_conf,pool);
|
||||
}
|
||||
else {
|
||||
/* create default directories layout */
|
||||
dir_layout = apt_default_dir_layout_create(options.root_dir_path,pool);
|
||||
}
|
||||
|
||||
if(!dir_layout) {
|
||||
printf("Failed to Create Directories Layout\n");
|
||||
apr_pool_destroy(pool);
|
||||
apr_terminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get path to logger configuration file */
|
||||
log_conf_path = apt_confdir_filepath_get(dir_layout,"logger.xml",pool);
|
||||
@@ -218,7 +252,8 @@ int main(int argc, const char * const *argv)
|
||||
|
||||
if(apt_log_output_mode_check(APT_LOG_OUTPUT_FILE) == TRUE) {
|
||||
/* open the log file */
|
||||
apt_log_file_open(dir_layout->log_dir_path,"unimrcpclient",MAX_LOG_FILE_SIZE,MAX_LOG_FILE_COUNT,FALSE,pool);
|
||||
const char *log_dir_path = apt_dir_layout_path_get(dir_layout,APT_LAYOUT_LOG_DIR);
|
||||
apt_log_file_open(log_dir_path,"unimrcpclient",MAX_LOG_FILE_SIZE,MAX_LOG_FILE_COUNT,FALSE,pool);
|
||||
}
|
||||
|
||||
/* create demo framework */
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="unimrcpclient"
|
||||
ProjectGUID="{57FAF32E-49FD-491F-895D-132D0D5EFE0A}"
|
||||
RootNamespace="unimrcpclient"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unidebug.vsprops;$(ProjectDir)..\..\build\vsprops\unimrcpclient.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="include"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(UniMRCPClientLibs)"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unirelease.vsprops;$(ProjectDir)..\..\build\vsprops\unimrcpclient.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="include"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(UniMRCPClientLibs)"
|
||||
LinkTimeCodeGeneration="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="src"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\demo_bypass_application.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\demo_discover_application.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\demo_framework.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\demo_recog_application.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\demo_synth_application.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\demo_util.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\main.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="include"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\include\demo_application.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\demo_framework.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\demo_util.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,39 +1,39 @@
|
||||
#include "uni_version.h"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION UNI_VERSION_STRING_CSV,0
|
||||
PRODUCTVERSION UNI_VERSION_STRING_CSV,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#if defined(_DEBUG)
|
||||
FILEFLAGS 0x01L
|
||||
#else
|
||||
FILEFLAGS 0x00L
|
||||
#endif
|
||||
#if defined(WINNT) || defined(WIN64)
|
||||
FILEOS 0x40004L
|
||||
#else
|
||||
FILEOS 0x4L
|
||||
#endif
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", UNI_LICENSE "\0"
|
||||
VALUE "CompanyName", "UniMRCP\0"
|
||||
VALUE "FileDescription", "UniMRCP Client Application\0"
|
||||
VALUE "FileVersion", UNI_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "unimrcpclient" "\0"
|
||||
VALUE "LegalCopyright", UNI_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "unimrcpclient.exe" "\0"
|
||||
VALUE "ProductName", "UniMRCP Project\0"
|
||||
VALUE "ProductVersion", UNI_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
#include "uni_version.h"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION UNI_VERSION_STRING_CSV,0
|
||||
PRODUCTVERSION UNI_VERSION_STRING_CSV,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#if defined(_DEBUG)
|
||||
FILEFLAGS 0x01L
|
||||
#else
|
||||
FILEFLAGS 0x00L
|
||||
#endif
|
||||
#if defined(WINNT) || defined(WIN64)
|
||||
FILEOS 0x40004L
|
||||
#else
|
||||
FILEOS 0x4L
|
||||
#endif
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", UNI_LICENSE "\0"
|
||||
VALUE "CompanyName", "UniMRCP\0"
|
||||
VALUE "FileDescription", "UniMRCP Client Application\0"
|
||||
VALUE "FileVersion", UNI_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "unimrcpclient" "\0"
|
||||
VALUE "LegalCopyright", UNI_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "unimrcpclient.exe" "\0"
|
||||
VALUE "ProductName", "UniMRCP Project\0"
|
||||
VALUE "ProductVersion", UNI_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{57FAF32E-49FD-491F-895D-132D0D5EFE0A}</ProjectGuid>
|
||||
<RootNamespace>unimrcpclient</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpclient.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPClientLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\demo_bypass_application.c" />
|
||||
<ClCompile Include="src\demo_discover_application.c" />
|
||||
<ClCompile Include="src\demo_framework.c" />
|
||||
<ClCompile Include="src\demo_recog_application.c" />
|
||||
<ClCompile Include="src\demo_synth_application.c" />
|
||||
<ClCompile Include="src\demo_util.c" />
|
||||
<ClCompile Include="src\main.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\demo_application.h" />
|
||||
<ClInclude Include="include\demo_framework.h" />
|
||||
<ClInclude Include="include\demo_util.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="unimrcpclient.rc">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\libunimrcp-client\libunimrcpclient.vcxproj">
|
||||
<Project>{ee157390-1e85-416c-946e-620e32c9ad33}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="include">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\demo_bypass_application.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\demo_discover_application.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\demo_framework.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\demo_recog_application.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\demo_synth_application.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\demo_util.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\main.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\demo_application.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\demo_framework.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\demo_util.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="unimrcpclient.rc" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,23 +1,9 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
AM_CPPFLAGS = -Iinclude \
|
||||
-I$(top_srcdir)/platforms/libunimrcp-server/include \
|
||||
-I$(top_srcdir)/libs/mrcp-server/include \
|
||||
-I$(top_srcdir)/libs/mrcp-engine/include \
|
||||
-I$(top_srcdir)/libs/mrcp-signaling/include \
|
||||
-I$(top_srcdir)/libs/mrcpv2-transport/include \
|
||||
-I$(top_srcdir)/libs/mrcp/include \
|
||||
-I$(top_srcdir)/libs/mrcp/message/include \
|
||||
-I$(top_srcdir)/libs/mrcp/control/include \
|
||||
-I$(top_srcdir)/libs/mrcp/resources/include \
|
||||
-I$(top_srcdir)/libs/mpf/include \
|
||||
-I$(top_srcdir)/libs/apr-toolkit/include \
|
||||
$(UNIMRCP_APR_INCLUDES) $(UNIMRCP_APU_INCLUDES)
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/platforms/unimrcp-server/include \
|
||||
$(UNIMRCP_SERVERAPP_INCLUDES)
|
||||
|
||||
bin_PROGRAMS = unimrcpserver
|
||||
unimrcpserver_SOURCES = src/main.c src/uni_cmdline.c src/uni_daemon.c
|
||||
unimrcpserver_LDADD = $(top_builddir)/platforms/libunimrcp-server/libunimrcpserver.la
|
||||
unimrcpserver_LDADD = $(UNIMRCP_SERVERAPP_LIBS)
|
||||
unimrcpserver_LDFLAGS = $(UNIMRCP_SERVERAPP_OPTS)
|
||||
|
||||
if ISMAC
|
||||
unimrcpserver_LDFLAGS = -framework CoreFoundation -framework SystemConfiguration
|
||||
endif
|
||||
include $(top_srcdir)/build/rules/uniserverapp.am
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: main.c 1785 2010-09-22 06:14:29Z achaloyan $
|
||||
* $Id: main.c 2204 2014-10-31 01:01:42Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -22,16 +22,21 @@
|
||||
#include "apt_pool.h"
|
||||
#include "apt_dir_layout.h"
|
||||
#include "apt_log.h"
|
||||
#include "uni_version.h"
|
||||
|
||||
typedef struct {
|
||||
const char *root_dir_path;
|
||||
const char *dir_layout_conf;
|
||||
apt_bool_t foreground;
|
||||
const char *log_priority;
|
||||
const char *log_output;
|
||||
#ifdef WIN32
|
||||
const char *svcname;
|
||||
#endif
|
||||
} server_options_t;
|
||||
|
||||
#ifdef WIN32
|
||||
apt_bool_t uni_service_run(apt_dir_layout_t *dir_layout, apr_pool_t *pool);
|
||||
apt_bool_t uni_service_run(const char *name, apt_dir_layout_t *dir_layout, apr_pool_t *pool);
|
||||
#else
|
||||
apt_bool_t uni_daemon_run(apt_dir_layout_t *dir_layout, apr_pool_t *pool);
|
||||
#endif
|
||||
@@ -42,6 +47,10 @@ apt_bool_t uni_cmdline_run(apt_dir_layout_t *dir_layout, apr_pool_t *pool);
|
||||
static void usage()
|
||||
{
|
||||
printf(
|
||||
"\n"
|
||||
" * "UNI_COPYRIGHT"\n"
|
||||
" *\n"
|
||||
UNI_LICENSE"\n"
|
||||
"\n"
|
||||
"Usage:\n"
|
||||
"\n"
|
||||
@@ -49,7 +58,10 @@ static void usage()
|
||||
"\n"
|
||||
" Available options:\n"
|
||||
"\n"
|
||||
" -r [--root-dir] path : Set the project root directory path.\n"
|
||||
" -r [--root-dir] path : Set the path to the project root directory.\n"
|
||||
"\n"
|
||||
" -c [--dir-layout] path : Set the path to the dir layout config file.\n"
|
||||
" (takes the precedence over --root-dir option)\n"
|
||||
"\n"
|
||||
" -l [--log-prio] priority : Set the log priority.\n"
|
||||
" (0-emergency, ..., 7-debug)\n"
|
||||
@@ -58,12 +70,16 @@ static void usage()
|
||||
" (0-none, 1-console only, 2-file only, 3-both)\n"
|
||||
"\n"
|
||||
#ifdef WIN32
|
||||
" -s [--service] : Run as the Windows service.\n"
|
||||
" -s [--service] : Run as a Windows service.\n"
|
||||
"\n"
|
||||
" -n [--name] svcname : Set the service name (default: unimrcp)\n"
|
||||
"\n"
|
||||
#else
|
||||
" -d [--daemon] : Run as the daemon.\n"
|
||||
" -d [--daemon] : Run as a daemon.\n"
|
||||
"\n"
|
||||
#endif
|
||||
" -v [--version] : Show the version.\n"
|
||||
"\n"
|
||||
" -h [--help] : Show the help.\n"
|
||||
"\n");
|
||||
}
|
||||
@@ -77,16 +93,19 @@ static apt_bool_t options_load(server_options_t *options, int argc, const char *
|
||||
|
||||
const apr_getopt_option_t opt_option[] = {
|
||||
/* long-option, short-option, has-arg flag, description */
|
||||
{ "root-dir", 'r', TRUE, "path to root dir" }, /* -r arg or --root-dir arg */
|
||||
{ "log-prio", 'l', TRUE, "log priority" }, /* -l arg or --log-prio arg */
|
||||
{ "log-output", 'o', TRUE, "log output mode" }, /* -o arg or --log-output arg */
|
||||
{ "root-dir", 'r', TRUE, "path to root dir" }, /* -r arg or --root-dir arg */
|
||||
{ "dir-layout", 'c', TRUE, "path to dir layout conf" }, /* -c arg or --dir-layout arg */
|
||||
{ "log-prio", 'l', TRUE, "log priority" }, /* -l arg or --log-prio arg */
|
||||
{ "log-output", 'o', TRUE, "log output mode" }, /* -o arg or --log-output arg */
|
||||
#ifdef WIN32
|
||||
{ "service", 's', FALSE, "run as service" }, /* -s or --service */
|
||||
{ "service", 's', FALSE, "run as service" }, /* -s or --service */
|
||||
{ "name", 'n', TRUE, "service name" }, /* -n or --name arg */
|
||||
#else
|
||||
{ "daemon", 'd', FALSE, "start as daemon" }, /* -d or --daemon */
|
||||
{ "daemon", 'd', FALSE, "start as daemon" }, /* -d or --daemon */
|
||||
#endif
|
||||
{ "help", 'h', FALSE, "show help" }, /* -h or --help */
|
||||
{ NULL, 0, 0, NULL }, /* end */
|
||||
{ "version", 'v', FALSE, "show version" }, /* -v or --version */
|
||||
{ "help", 'h', FALSE, "show help" }, /* -h or --help */
|
||||
{ NULL, 0, 0, NULL }, /* end */
|
||||
};
|
||||
|
||||
rv = apr_getopt_init(&opt, pool , argc, argv);
|
||||
@@ -94,11 +113,24 @@ static apt_bool_t options_load(server_options_t *options, int argc, const char *
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* reset the options */
|
||||
options->root_dir_path = NULL;
|
||||
options->dir_layout_conf = NULL;
|
||||
options->foreground = TRUE;
|
||||
options->log_priority = NULL;
|
||||
options->log_output = NULL;
|
||||
#ifdef WIN32
|
||||
options->svcname = NULL;
|
||||
#endif
|
||||
|
||||
while((rv = apr_getopt_long(opt, opt_option, &optch, &optarg)) == APR_SUCCESS) {
|
||||
switch(optch) {
|
||||
case 'r':
|
||||
options->root_dir_path = optarg;
|
||||
break;
|
||||
case 'c':
|
||||
options->dir_layout_conf = optarg;
|
||||
break;
|
||||
case 'l':
|
||||
options->log_priority = optarg;
|
||||
break;
|
||||
@@ -109,11 +141,17 @@ static apt_bool_t options_load(server_options_t *options, int argc, const char *
|
||||
case 's':
|
||||
options->foreground = FALSE;
|
||||
break;
|
||||
case 'n':
|
||||
options->svcname = optarg;
|
||||
break;
|
||||
#else
|
||||
case 'd':
|
||||
options->foreground = FALSE;
|
||||
break;
|
||||
#endif
|
||||
case 'v':
|
||||
printf(UNI_VERSION_STRING);
|
||||
return FALSE;
|
||||
case 'h':
|
||||
usage();
|
||||
return FALSE;
|
||||
@@ -130,10 +168,10 @@ static apt_bool_t options_load(server_options_t *options, int argc, const char *
|
||||
|
||||
int main(int argc, const char * const *argv)
|
||||
{
|
||||
apr_pool_t *pool = NULL;
|
||||
apr_pool_t *pool;
|
||||
server_options_t options;
|
||||
apt_dir_layout_t *dir_layout;
|
||||
const char *log_conf_path;
|
||||
apt_dir_layout_t *dir_layout = NULL;
|
||||
|
||||
/* APR global initialization */
|
||||
if(apr_initialize() != APR_SUCCESS) {
|
||||
@@ -148,12 +186,6 @@ int main(int argc, const char * const *argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* set the default options */
|
||||
options.root_dir_path = "../";
|
||||
options.foreground = TRUE;
|
||||
options.log_priority = NULL;
|
||||
options.log_output = NULL;
|
||||
|
||||
/* load options */
|
||||
if(options_load(&options,argc,argv,pool) != TRUE) {
|
||||
apr_pool_destroy(pool);
|
||||
@@ -161,9 +193,24 @@ int main(int argc, const char * const *argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* create the structure of default directories layout */
|
||||
dir_layout = apt_default_dir_layout_create(options.root_dir_path,pool);
|
||||
|
||||
if(options.dir_layout_conf) {
|
||||
/* create and load directories layout from the configuration file */
|
||||
dir_layout = apt_dir_layout_create(pool);
|
||||
if(dir_layout)
|
||||
apt_dir_layout_load(dir_layout,options.dir_layout_conf,pool);
|
||||
}
|
||||
else {
|
||||
/* create default directories layout */
|
||||
dir_layout = apt_default_dir_layout_create(options.root_dir_path,pool);
|
||||
}
|
||||
|
||||
if(!dir_layout) {
|
||||
printf("Failed to Create Directories Layout\n");
|
||||
apr_pool_destroy(pool);
|
||||
apr_terminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get path to logger configuration file */
|
||||
log_conf_path = apt_confdir_filepath_get(dir_layout,"logger.xml",pool);
|
||||
/* create and load singleton logger */
|
||||
@@ -180,7 +227,8 @@ int main(int argc, const char * const *argv)
|
||||
|
||||
if(apt_log_output_mode_check(APT_LOG_OUTPUT_FILE) == TRUE) {
|
||||
/* open the log file */
|
||||
apt_log_file_open(dir_layout->log_dir_path,"unimrcpserver",MAX_LOG_FILE_SIZE,MAX_LOG_FILE_COUNT,TRUE,pool);
|
||||
const char *log_dir_path = apt_dir_layout_path_get(dir_layout,APT_LAYOUT_LOG_DIR);
|
||||
apt_log_file_open(log_dir_path,"unimrcpserver",MAX_LOG_FILE_SIZE,MAX_LOG_FILE_COUNT,TRUE,pool);
|
||||
}
|
||||
|
||||
if(options.foreground == TRUE) {
|
||||
@@ -190,7 +238,7 @@ int main(int argc, const char * const *argv)
|
||||
#ifdef WIN32
|
||||
else {
|
||||
/* run as windows service */
|
||||
uni_service_run(dir_layout,pool);
|
||||
uni_service_run(options.svcname,dir_layout,pool);
|
||||
}
|
||||
#else
|
||||
else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: uni_cmdline.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: uni_cmdline.c 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -52,7 +52,7 @@ apt_bool_t uni_cmdline_run(apt_dir_layout_t *dir_layout, apr_pool_t *pool)
|
||||
{
|
||||
apt_bool_t running = TRUE;
|
||||
char cmdline[1024];
|
||||
int i;
|
||||
apr_size_t i;
|
||||
mrcp_server_t *server;
|
||||
|
||||
/* start server */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: uni_daemon.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: uni_daemon.c 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <apr_signal.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
* Copyright 2008-2014 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: uni_service.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
* $Id: uni_service.c 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
@@ -28,11 +28,25 @@ static SERVICE_STATUS win_service_status;
|
||||
|
||||
static mrcp_server_t *server = NULL;
|
||||
static apt_dir_layout_t *service_dir_layout = NULL;
|
||||
static const char *svcname = NULL;
|
||||
|
||||
/** Display error message with Windows error code and description */
|
||||
static void winerror(const char *file, int line, const char *msg)
|
||||
{
|
||||
char buf[128];
|
||||
DWORD err = GetLastError();
|
||||
int ret = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
err,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
buf, sizeof(buf), NULL);
|
||||
apt_log(file, line, APT_PRIO_WARNING, "%s: %lu %.*s\n", msg, err, ret, buf);
|
||||
}
|
||||
|
||||
/** SCM state change handler */
|
||||
static void WINAPI win_service_handler(DWORD control)
|
||||
{
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Service Handler %d",control);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Service Handler 0x%02lx",control);
|
||||
switch (control)
|
||||
{
|
||||
case SERVICE_CONTROL_INTERROGATE:
|
||||
@@ -42,7 +56,7 @@ static void WINAPI win_service_handler(DWORD control)
|
||||
if(server) {
|
||||
win_service_status.dwCurrentState = SERVICE_STOP_PENDING;
|
||||
if(!SetServiceStatus(win_service_status_handle, &win_service_status)) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Set Service Status %d",GetLastError());
|
||||
winerror(APT_LOG_MARK, "Failed to Set Service Status");
|
||||
}
|
||||
|
||||
/* shutdown server */
|
||||
@@ -55,7 +69,7 @@ static void WINAPI win_service_handler(DWORD control)
|
||||
}
|
||||
|
||||
if(!SetServiceStatus(win_service_status_handle, &win_service_status)) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Set Service Status %d",GetLastError());
|
||||
winerror(APT_LOG_MARK, "Failed to Set Service Status");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,15 +83,15 @@ static void WINAPI win_service_main(DWORD argc, LPTSTR *argv)
|
||||
win_service_status.dwCheckPoint = 0;
|
||||
win_service_status.dwWaitHint = 0;
|
||||
|
||||
win_service_status_handle = RegisterServiceCtrlHandler(WIN_SERVICE_NAME, win_service_handler);
|
||||
win_service_status_handle = RegisterServiceCtrlHandler(svcname, win_service_handler);
|
||||
if(win_service_status_handle == (SERVICE_STATUS_HANDLE)0) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Register Service Control Handler %d",GetLastError());
|
||||
winerror(APT_LOG_MARK, "Failed to Register Service Control Handler");
|
||||
return;
|
||||
}
|
||||
|
||||
win_service_status.dwCurrentState = SERVICE_START_PENDING;
|
||||
if(!SetServiceStatus(win_service_status_handle, &win_service_status)) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Set Service Status %d",GetLastError());
|
||||
winerror(APT_LOG_MARK, "Failed to Set Service Status");
|
||||
}
|
||||
|
||||
/* start server */
|
||||
@@ -85,22 +99,23 @@ static void WINAPI win_service_main(DWORD argc, LPTSTR *argv)
|
||||
|
||||
win_service_status.dwCurrentState = server ? SERVICE_RUNNING : SERVICE_STOPPED;
|
||||
if(!SetServiceStatus(win_service_status_handle, &win_service_status)) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Set Service Status %d",GetLastError());
|
||||
winerror(APT_LOG_MARK, "Failed to Set Service Status");
|
||||
}
|
||||
}
|
||||
|
||||
/** Run SCM service */
|
||||
apt_bool_t uni_service_run(apt_dir_layout_t *dir_layout, apr_pool_t *pool)
|
||||
apt_bool_t uni_service_run(const char *name, apt_dir_layout_t *dir_layout, apr_pool_t *pool)
|
||||
{
|
||||
SERVICE_TABLE_ENTRY win_service_table[] = {
|
||||
{ WIN_SERVICE_NAME, win_service_main },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
SERVICE_TABLE_ENTRY win_service_table[2];
|
||||
svcname = name ? name : WIN_SERVICE_NAME;
|
||||
memset(&win_service_table, 0, sizeof(win_service_table));
|
||||
win_service_table->lpServiceName = (char *) svcname;
|
||||
win_service_table->lpServiceProc = win_service_main;
|
||||
|
||||
service_dir_layout = dir_layout;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Run as Service");
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Run as Service %s",svcname);
|
||||
if(!StartServiceCtrlDispatcher(win_service_table)) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Connect to SCM %d",GetLastError());
|
||||
winerror(APT_LOG_MARK, "Failed to Connect to SCM");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="unimrcpserver"
|
||||
ProjectGUID="{592CF22D-3F8F-4A77-A174-130D77B7623B}"
|
||||
RootNamespace="unimrcpserver"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unidebug.vsprops;$(ProjectDir)..\..\build\vsprops\unimrcpserver.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(UniMRCPServerLibs)"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unirelease.vsprops;$(ProjectDir)..\..\build\vsprops\unimrcpserver.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(UniMRCPServerLibs)"
|
||||
LinkTimeCodeGeneration="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="src"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\main.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\uni_cmdline.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\uni_daemon.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\uni_service.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="include"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,39 +1,39 @@
|
||||
#include "uni_version.h"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION UNI_VERSION_STRING_CSV,0
|
||||
PRODUCTVERSION UNI_VERSION_STRING_CSV,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#if defined(_DEBUG)
|
||||
FILEFLAGS 0x01L
|
||||
#else
|
||||
FILEFLAGS 0x00L
|
||||
#endif
|
||||
#if defined(WINNT) || defined(WIN64)
|
||||
FILEOS 0x40004L
|
||||
#else
|
||||
FILEOS 0x4L
|
||||
#endif
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", UNI_LICENSE "\0"
|
||||
VALUE "CompanyName", "UniMRCP\0"
|
||||
VALUE "FileDescription", "UniMRCP Server Application\0"
|
||||
VALUE "FileVersion", UNI_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "unimrcpserver" "\0"
|
||||
VALUE "LegalCopyright", UNI_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "unimrcpserver.exe" "\0"
|
||||
VALUE "ProductName", "UniMRCP Project\0"
|
||||
VALUE "ProductVersion", UNI_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
#include "uni_version.h"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION UNI_VERSION_STRING_CSV,0
|
||||
PRODUCTVERSION UNI_VERSION_STRING_CSV,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#if defined(_DEBUG)
|
||||
FILEFLAGS 0x01L
|
||||
#else
|
||||
FILEFLAGS 0x00L
|
||||
#endif
|
||||
#if defined(WINNT) || defined(WIN64)
|
||||
FILEOS 0x40004L
|
||||
#else
|
||||
FILEOS 0x4L
|
||||
#endif
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", UNI_LICENSE "\0"
|
||||
VALUE "CompanyName", "UniMRCP\0"
|
||||
VALUE "FileDescription", "UniMRCP Server Application\0"
|
||||
VALUE "FileVersion", UNI_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "unimrcpserver" "\0"
|
||||
VALUE "LegalCopyright", UNI_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "unimrcpserver.exe" "\0"
|
||||
VALUE "ProductName", "UniMRCP Project\0"
|
||||
VALUE "ProductVersion", UNI_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{592CF22D-3F8F-4A77-A174-130D77B7623B}</ProjectGuid>
|
||||
<RootNamespace>unimrcpserver</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpserver.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpserver.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpserver.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unibin-x64.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\props\unimrcpserver.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPServerLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPServerLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPServerLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(UniMRCPServerLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\main.c" />
|
||||
<ClCompile Include="src\uni_cmdline.c" />
|
||||
<ClCompile Include="src\uni_daemon.c" />
|
||||
<ClCompile Include="src\uni_service.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="unimrcpserver.rc">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\libunimrcp-server\libunimrcpserver.vcxproj">
|
||||
<Project>{c98af157-352e-4737-bd30-a24e2647f5ae}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="include">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\main.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\uni_cmdline.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\uni_daemon.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\uni_service.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="unimrcpserver.rc" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in new issue
Block a user