mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-09 21:14:02 +00:00
Update to latest UniMRCP version. MRCP requests can no timeout if there is no server response.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Arsen Chaloyan
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -12,10 +12,12 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_sdp.h 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
*/
|
||||
|
||||
#ifndef __MRCP_SDP_H__
|
||||
#define __MRCP_SDP_H__
|
||||
#ifndef MRCP_SDP_H
|
||||
#define MRCP_SDP_H
|
||||
|
||||
/**
|
||||
* @file mrcp_sdp.h
|
||||
@@ -37,4 +39,4 @@ MRCP_DECLARE(apr_size_t) sdp_resource_discovery_string_generate(const char *ip,
|
||||
|
||||
APT_END_EXTERN_C
|
||||
|
||||
#endif /*__MRCP_SDP_H__*/
|
||||
#endif /* MRCP_SDP_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Arsen Chaloyan
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -12,10 +12,12 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_sofiasip_client_agent.h 1700 2010-05-21 18:56:06Z achaloyan $
|
||||
*/
|
||||
|
||||
#ifndef __MRCP_SOFIASIP_CLIENT_AGENT_H__
|
||||
#define __MRCP_SOFIASIP_CLIENT_AGENT_H__
|
||||
#ifndef MRCP_SOFIASIP_CLIENT_AGENT_H
|
||||
#define MRCP_SOFIASIP_CLIENT_AGENT_H
|
||||
|
||||
/**
|
||||
* @file mrcp_sofiasip_client_agent.h
|
||||
@@ -40,30 +42,26 @@ struct mrcp_sofia_client_config_t {
|
||||
apr_port_t local_port;
|
||||
/** Local SIP user name */
|
||||
char *local_user_name;
|
||||
|
||||
/** Remote IP address */
|
||||
char *remote_ip;
|
||||
/** Remote SIP port */
|
||||
apr_port_t remote_port;
|
||||
/** Remote SIP user name */
|
||||
char *remote_user_name;
|
||||
|
||||
/** Force destination ip address. Should be used only in case
|
||||
SDP contains incorrect connection address (local IP address behind NAT) */
|
||||
apt_bool_t force_destination;
|
||||
|
||||
/** User agent name */
|
||||
char *user_agent_name;
|
||||
/** SDP origin */
|
||||
char *origin;
|
||||
/** SIP transport */
|
||||
char *transport;
|
||||
/** SIP T1 timer */
|
||||
apr_size_t sip_t1;
|
||||
/** SIP T2 timer */
|
||||
apr_size_t sip_t2;
|
||||
/** SIP T4 timer */
|
||||
apr_size_t sip_t4;
|
||||
/** SIP T1x64 timer */
|
||||
apr_size_t sip_t1x64;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create Sofia-SIP signaling agent.
|
||||
*/
|
||||
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_client_agent_create(mrcp_sofia_client_config_t *config, apr_pool_t *pool);
|
||||
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_client_agent_create(const char *id, mrcp_sofia_client_config_t *config, apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Allocate Sofia-SIP config.
|
||||
@@ -72,4 +70,4 @@ MRCP_DECLARE(mrcp_sofia_client_config_t*) mrcp_sofiasip_client_config_alloc(apr_
|
||||
|
||||
APT_END_EXTERN_C
|
||||
|
||||
#endif /*__MRCP_SOFIASIP_CLIENT_AGENT_H__*/
|
||||
#endif /* MRCP_SOFIASIP_CLIENT_AGENT_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Arsen Chaloyan
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -12,10 +12,12 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_sofiasip_server_agent.h 1700 2010-05-21 18:56:06Z achaloyan $
|
||||
*/
|
||||
|
||||
#ifndef __MRCP_SOFIASIP_SERVER_AGENT_H__
|
||||
#define __MRCP_SOFIASIP_SERVER_AGENT_H__
|
||||
#ifndef MRCP_SOFIASIP_SERVER_AGENT_H
|
||||
#define MRCP_SOFIASIP_SERVER_AGENT_H
|
||||
|
||||
/**
|
||||
* @file mrcp_sofiasip_server_agent.h
|
||||
@@ -38,7 +40,6 @@ struct mrcp_sofia_server_config_t {
|
||||
char *ext_ip;
|
||||
/** Local port to bind to */
|
||||
apr_port_t local_port;
|
||||
|
||||
/** SIP user name */
|
||||
char *user_name;
|
||||
/** User agent name */
|
||||
@@ -47,16 +48,23 @@ struct mrcp_sofia_server_config_t {
|
||||
char *origin;
|
||||
/** SIP transport */
|
||||
char *transport;
|
||||
|
||||
/** Force destination ip address. Should be used only in case
|
||||
SDP contains incorrect connection address (local IP address behind NAT) */
|
||||
apt_bool_t force_destination;
|
||||
/** SIP T1 timer */
|
||||
apr_size_t sip_t1;
|
||||
/** SIP T2 timer */
|
||||
apr_size_t sip_t2;
|
||||
/** SIP T4 timer */
|
||||
apr_size_t sip_t4;
|
||||
/** SIP T1x64 timer */
|
||||
apr_size_t sip_t1x64;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create Sofia-SIP signaling agent.
|
||||
*/
|
||||
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_server_agent_create(mrcp_sofia_server_config_t *config, apr_pool_t *pool);
|
||||
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_server_agent_create(const char *id, mrcp_sofia_server_config_t *config, apr_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Allocate Sofia-SIP config.
|
||||
@@ -65,4 +73,4 @@ MRCP_DECLARE(mrcp_sofia_server_config_t*) mrcp_sofiasip_server_config_alloc(apr_
|
||||
|
||||
APT_END_EXTERN_C
|
||||
|
||||
#endif /*__MRCP_SOFIASIP_SERVER_AGENT_H__*/
|
||||
#endif /* MRCP_SOFIASIP_SERVER_AGENT_H */
|
||||
|
||||
@@ -1,293 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="mrcpsofiasip"
|
||||
ProjectGUID="{746F3632-5BB2-4570-9453-31D6D58A7D8E}"
|
||||
RootNamespace="mrcpsofiasip"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unidebug.vsprops;$(ProjectDir)..\..\build\vsprops\sofiasip.vsprops;$(ProjectDir)..\..\build\vsprops\mrcpv2transport.vsprops;$(ProjectDir)..\..\build\vsprops\mrcpsignaling.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="include"
|
||||
PreprocessorDefinitions="APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC"
|
||||
/>
|
||||
<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="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unidebug.vsprops;$(ProjectDir)..\..\build\vsprops\sofiasip.vsprops;$(ProjectDir)..\..\build\vsprops\mrcpv2transport.vsprops;$(ProjectDir)..\..\build\vsprops\mrcpsignaling.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="include"
|
||||
PreprocessorDefinitions="APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<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"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unirelease.vsprops;$(ProjectDir)..\..\build\vsprops\sofiasip.vsprops;$(ProjectDir)..\..\build\vsprops\mrcpv2transport.vsprops;$(ProjectDir)..\..\build\vsprops\mrcpsignaling.vsprops"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="include"
|
||||
PreprocessorDefinitions="APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC"
|
||||
/>
|
||||
<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|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unirelease.vsprops;$(ProjectDir)..\..\build\vsprops\sofiasip.vsprops;$(ProjectDir)..\..\build\vsprops\mrcpv2transport.vsprops;$(ProjectDir)..\..\build\vsprops\mrcpsignaling.vsprops"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="include"
|
||||
PreprocessorDefinitions="APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC"
|
||||
/>
|
||||
<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=".\include\mrcp_sdp.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\mrcp_sofiasip_client_agent.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\mrcp_sofiasip_server_agent.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="src"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\mrcp_sdp.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\mrcp_sofiasip_client_agent.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\mrcp_sofiasip_server_agent.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,138 +0,0 @@
|
||||
<?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">
|
||||
<ProjectName>mrcpsofiasip</ProjectName>
|
||||
<ProjectGuid>{746F3632-5BB2-4570-9453-31D6D58A7D8E}</ProjectGuid>
|
||||
<RootNamespace>mrcpsofiasip</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\vsprops\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\sofiasip.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\mrcpv2transport.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\mrcpsignaling.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\vsprops\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\sofiasip.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\mrcpv2transport.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\mrcpsignaling.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\vsprops\unirelease.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\sofiasip.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\mrcpv2transport.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\mrcpsignaling.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\vsprops\unidebug.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\sofiasip.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\mrcpv2transport.props" />
|
||||
<Import Project="$(ProjectDir)..\..\build\vsprops\mrcpsignaling.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(PlatformName)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(PlatformName)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(PlatformName)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(PlatformName)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(PlatformName)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(PlatformName)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(PlatformName)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(PlatformName)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\mrcp_sdp.h" />
|
||||
<ClInclude Include="include\mrcp_sofiasip_client_agent.h" />
|
||||
<ClInclude Include="include\mrcp_sofiasip_server_agent.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\mrcp_sdp.c" />
|
||||
<ClCompile Include="src\mrcp_sofiasip_client_agent.c" />
|
||||
<ClCompile Include="src\mrcp_sofiasip_server_agent.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\win32\sofia\libsofia_sip_ua_static.2010.vcxproj">
|
||||
<Project>{70a49bc2-7500-41d0-b75d-edcc5be987a0}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?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>{6e92b598-880e-4fe5-88fb-f69df8e06a57}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\mrcp_sdp.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\mrcp_sofiasip_client_agent.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\mrcp_sofiasip_server_agent.h">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\mrcp_sdp.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\mrcp_sofiasip_client_agent.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\mrcp_sofiasip_server_agent.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Arsen Chaloyan
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -12,6 +12,8 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_sdp.c 1647 2010-04-12 19:34:53Z achaloyan $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -331,7 +333,7 @@ static apt_bool_t mrcp_control_media_generate(mrcp_control_descriptor_t *control
|
||||
apt_string_set(&name,sdp_media->m_proto_name);
|
||||
control_media->proto = mrcp_proto_find(&name);
|
||||
if(control_media->proto != MRCP_PROTO_TCP) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Not supported SDP Proto [%s], expected [%s]",sdp_media->m_proto_name,mrcp_proto_get(MRCP_PROTO_TCP));
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Not supported SDP Proto [%s], expected [%s]",sdp_media->m_proto_name,mrcp_proto_get(MRCP_PROTO_TCP)->buf);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Arsen Chaloyan
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -12,6 +12,8 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_sofiasip_client_agent.c 1799 2011-05-12 02:32:32Z achaloyan $
|
||||
*/
|
||||
|
||||
typedef struct mrcp_sofia_agent_t mrcp_sofia_agent_t;
|
||||
@@ -35,14 +37,11 @@ typedef struct mrcp_sofia_session_t mrcp_sofia_session_t;
|
||||
#include "mrcp_sdp.h"
|
||||
#include "apt_log.h"
|
||||
|
||||
#define SOFIA_TASK_NAME "SofiaSIP Agent"
|
||||
|
||||
struct mrcp_sofia_agent_t {
|
||||
mrcp_sig_agent_t *sig_agent;
|
||||
|
||||
mrcp_sofia_client_config_t *config;
|
||||
char *sip_contact_str;
|
||||
char *sip_to_str;
|
||||
char *sip_from_str;
|
||||
char *sip_bind_str;
|
||||
|
||||
@@ -51,12 +50,16 @@ struct mrcp_sofia_agent_t {
|
||||
};
|
||||
|
||||
struct mrcp_sofia_session_t {
|
||||
mrcp_session_t *session;
|
||||
su_home_t *home;
|
||||
nua_handle_t *nh;
|
||||
mrcp_session_t *session;
|
||||
mrcp_sig_settings_t *sip_settings;
|
||||
char *sip_to_str;
|
||||
|
||||
apt_bool_t terminate_requested;
|
||||
apr_thread_mutex_t *mutex;
|
||||
su_home_t *home;
|
||||
nua_handle_t *nh;
|
||||
|
||||
apt_bool_t terminate_requested;
|
||||
mrcp_session_descriptor_t *descriptor;
|
||||
apr_thread_mutex_t *mutex;
|
||||
};
|
||||
|
||||
/* Task Interface */
|
||||
@@ -77,7 +80,7 @@ static const mrcp_session_request_vtable_t session_request_vtable = {
|
||||
};
|
||||
|
||||
static apt_bool_t mrcp_sofia_config_validate(mrcp_sofia_agent_t *sofia_agent, mrcp_sofia_client_config_t *config, apr_pool_t *pool);
|
||||
static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session);
|
||||
static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session, mrcp_sig_settings_t *settings);
|
||||
|
||||
static void mrcp_sofia_event_callback( nua_event_t nua_event,
|
||||
int status,
|
||||
@@ -91,13 +94,13 @@ static void mrcp_sofia_event_callback( nua_event_t nua_event,
|
||||
|
||||
|
||||
/** Create Sofia-SIP Signaling Agent */
|
||||
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_client_agent_create(mrcp_sofia_client_config_t *config, apr_pool_t *pool)
|
||||
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_client_agent_create(const char *id, mrcp_sofia_client_config_t *config, apr_pool_t *pool)
|
||||
{
|
||||
apt_task_t *task;
|
||||
apt_task_vtable_t *vtable;
|
||||
mrcp_sofia_agent_t *sofia_agent;
|
||||
sofia_agent = apr_palloc(pool,sizeof(mrcp_sofia_agent_t));
|
||||
sofia_agent->sig_agent = mrcp_signaling_agent_create(sofia_agent,MRCP_VERSION_2,pool);
|
||||
sofia_agent->sig_agent = mrcp_signaling_agent_create(id,sofia_agent,MRCP_VERSION_2,pool);
|
||||
sofia_agent->sig_agent->create_client_session = mrcp_sofia_session_create;
|
||||
sofia_agent->root = NULL;
|
||||
sofia_agent->nua = NULL;
|
||||
@@ -110,7 +113,7 @@ MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_client_agent_create(mrcp_sofia_cli
|
||||
if(!task) {
|
||||
return NULL;
|
||||
}
|
||||
apt_task_name_set(task,SOFIA_TASK_NAME);
|
||||
apt_task_name_set(task,id);
|
||||
vtable = apt_task_vtable_get(task);
|
||||
if(vtable) {
|
||||
vtable->on_pre_run = mrcp_sofia_task_initialize;
|
||||
@@ -118,10 +121,8 @@ MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_client_agent_create(mrcp_sofia_cli
|
||||
vtable->terminate = mrcp_sofia_task_terminate;
|
||||
}
|
||||
sofia_agent->sig_agent->task = task;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create "SOFIA_TASK_NAME" ["SOFIA_SIP_VERSION"] %s:%hu -> %s:%hu %s",
|
||||
config->local_ip,config->local_port,
|
||||
config->remote_ip,config->remote_port,
|
||||
config->transport ? config->transport : "");
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create SofiaSIP Agent [%s] ["SOFIA_SIP_VERSION"] %s",
|
||||
id,sofia_agent->sip_bind_str);
|
||||
return sofia_agent->sig_agent;
|
||||
}
|
||||
|
||||
@@ -133,48 +134,37 @@ MRCP_DECLARE(mrcp_sofia_client_config_t*) mrcp_sofiasip_client_config_alloc(apr_
|
||||
config->ext_ip = NULL;
|
||||
config->local_port = 0;
|
||||
config->local_user_name = NULL;
|
||||
config->remote_ip = NULL;
|
||||
config->remote_port = 0;
|
||||
config->remote_user_name = NULL;
|
||||
|
||||
config->force_destination = FALSE;
|
||||
|
||||
config->user_agent_name = NULL;
|
||||
config->origin = NULL;
|
||||
config->transport = NULL;
|
||||
|
||||
config->sip_t1 = 0;
|
||||
config->sip_t2 = 0;
|
||||
config->sip_t4 = 0;
|
||||
config->sip_t1x64 = 0;
|
||||
return config;
|
||||
}
|
||||
|
||||
static apt_bool_t mrcp_sofia_config_validate(mrcp_sofia_agent_t *sofia_agent, mrcp_sofia_client_config_t *config, apr_pool_t *pool)
|
||||
{
|
||||
const char *local_ip = config->ext_ip ? config->ext_ip : config->local_ip;
|
||||
if(!config->local_ip || !config->remote_ip) {
|
||||
if(!config->local_ip) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
sofia_agent->config = config;
|
||||
sofia_agent->sip_contact_str = apr_psprintf(pool,"sip:%s:%d", local_ip, config->local_port);
|
||||
sofia_agent->sip_from_str = apr_psprintf(pool,"sip:%s:%d", local_ip, config->local_port);
|
||||
sofia_agent->sip_contact_str = apr_psprintf(pool,"sip:%s:%hu", local_ip, config->local_port);
|
||||
sofia_agent->sip_from_str = apr_psprintf(pool,"sip:%s:%hu", local_ip, config->local_port);
|
||||
|
||||
if(config->remote_user_name && config->remote_user_name != '\0') {
|
||||
sofia_agent->sip_to_str = apr_psprintf(pool,"sip:%s@%s:%d",
|
||||
config->remote_user_name,
|
||||
config->remote_ip,
|
||||
config->remote_port);
|
||||
}
|
||||
else {
|
||||
sofia_agent->sip_to_str = apr_psprintf(pool,"sip:%s:%d",
|
||||
config->remote_ip,
|
||||
config->remote_port);
|
||||
}
|
||||
if(config->transport) {
|
||||
sofia_agent->sip_bind_str = apr_psprintf(pool,"sip:%s:%d;transport=%s",
|
||||
sofia_agent->sip_bind_str = apr_psprintf(pool,"sip:%s:%hu;transport=%s",
|
||||
config->local_ip,
|
||||
config->local_port,
|
||||
config->transport);
|
||||
}
|
||||
else {
|
||||
sofia_agent->sip_bind_str = apr_psprintf(pool,"sip:%s:%d",
|
||||
sofia_agent->sip_bind_str = apr_psprintf(pool,"sip:%s:%hu",
|
||||
config->local_ip,
|
||||
config->local_port);
|
||||
}
|
||||
@@ -184,6 +174,7 @@ static apt_bool_t mrcp_sofia_config_validate(mrcp_sofia_agent_t *sofia_agent, mr
|
||||
static void mrcp_sofia_task_initialize(apt_task_t *task)
|
||||
{
|
||||
mrcp_sofia_agent_t *sofia_agent = apt_task_object_get(task);
|
||||
mrcp_sofia_client_config_t *sofia_config = sofia_agent->config;
|
||||
|
||||
/* Initialize Sofia-SIP library and create event loop */
|
||||
su_init();
|
||||
@@ -204,7 +195,11 @@ static void mrcp_sofia_task_initialize(apt_task_t *task)
|
||||
sofia_agent->nua,
|
||||
NUTAG_AUTOANSWER(0),
|
||||
NUTAG_APPL_METHOD("OPTIONS"),
|
||||
SIPTAG_USER_AGENT_STR(sofia_agent->config->user_agent_name),
|
||||
TAG_IF(sofia_config->sip_t1,NTATAG_SIP_T1(sofia_config->sip_t1)),
|
||||
TAG_IF(sofia_config->sip_t2,NTATAG_SIP_T2(sofia_config->sip_t2)),
|
||||
TAG_IF(sofia_config->sip_t4,NTATAG_SIP_T4(sofia_config->sip_t4)),
|
||||
TAG_IF(sofia_config->sip_t1x64,NTATAG_SIP_T1X64(sofia_config->sip_t1x64)),
|
||||
SIPTAG_USER_AGENT_STR(sofia_config->user_agent_name),
|
||||
TAG_END());
|
||||
}
|
||||
}
|
||||
@@ -244,7 +239,7 @@ static APR_INLINE mrcp_sofia_agent_t* mrcp_sofia_agent_get(mrcp_session_t *sessi
|
||||
return session->signaling_agent->obj;
|
||||
}
|
||||
|
||||
static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session)
|
||||
static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session, mrcp_sig_settings_t *settings)
|
||||
{
|
||||
mrcp_sofia_agent_t *sofia_agent = mrcp_sofia_agent_get(session);
|
||||
mrcp_sofia_session_t *sofia_session;
|
||||
@@ -254,15 +249,30 @@ static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session)
|
||||
sofia_session->mutex = NULL;
|
||||
sofia_session->home = su_home_new(sizeof(*sofia_session->home));
|
||||
sofia_session->session = session;
|
||||
sofia_session->sip_settings = settings;
|
||||
sofia_session->terminate_requested = FALSE;
|
||||
sofia_session->descriptor = NULL;
|
||||
session->obj = sofia_session;
|
||||
|
||||
|
||||
if(settings->user_name && settings->user_name != '\0') {
|
||||
sofia_session->sip_to_str = apr_psprintf(session->pool,"sip:%s@%s:%hu",
|
||||
settings->user_name,
|
||||
settings->server_ip,
|
||||
settings->server_port);
|
||||
}
|
||||
else {
|
||||
sofia_session->sip_to_str = apr_psprintf(session->pool,"sip:%s:%hu",
|
||||
settings->server_ip,
|
||||
settings->server_port);
|
||||
}
|
||||
|
||||
sofia_session->nh = nua_handle(
|
||||
sofia_agent->nua,
|
||||
sofia_session,
|
||||
SIPTAG_TO_STR(sofia_agent->sip_to_str),
|
||||
SIPTAG_TO_STR(sofia_session->sip_to_str),
|
||||
SIPTAG_FROM_STR(sofia_agent->sip_from_str),
|
||||
SIPTAG_CONTACT_STR(sofia_agent->sip_contact_str),
|
||||
TAG_IF(settings->feature_tags,SIPTAG_ACCEPT_CONTACT_STR(settings->feature_tags)),
|
||||
TAG_END());
|
||||
|
||||
apr_thread_mutex_create(&sofia_session->mutex,APR_THREAD_MUTEX_DEFAULT,session->pool);
|
||||
@@ -313,8 +323,10 @@ static apt_bool_t mrcp_sofia_session_offer(mrcp_session_t *session, mrcp_session
|
||||
}
|
||||
if(sdp_string_generate_by_mrcp_descriptor(sdp_str,sizeof(sdp_str),descriptor,TRUE) > 0) {
|
||||
local_sdp_str = sdp_str;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Local SDP "APT_PTRSID_FMT"\n%s",
|
||||
MRCP_SESSION_PTRSID(session),
|
||||
sofia_session->descriptor = descriptor;
|
||||
apt_obj_log(APT_LOG_MARK,APT_PRIO_INFO,session->log_obj,"Local SDP "APT_NAMESID_FMT"\n%s",
|
||||
session->name,
|
||||
MRCP_SESSION_SID(session),
|
||||
local_sdp_str);
|
||||
}
|
||||
|
||||
@@ -392,14 +404,15 @@ static void mrcp_sofia_on_session_ready(
|
||||
sdp_parser_t *parser = NULL;
|
||||
sdp_session_t *sdp = NULL;
|
||||
const char *force_destination_ip = NULL;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Remote SDP "APT_PTRSID_FMT"\n%s",
|
||||
MRCP_SESSION_PTRSID(session),
|
||||
apt_obj_log(APT_LOG_MARK,APT_PRIO_INFO,session->log_obj,"Remote SDP "APT_NAMESID_FMT"\n%s",
|
||||
session->name,
|
||||
MRCP_SESSION_SID(session),
|
||||
remote_sdp_str);
|
||||
|
||||
parser = sdp_parse(sofia_session->home,remote_sdp_str,(int)strlen(remote_sdp_str),0);
|
||||
sdp = sdp_session(parser);
|
||||
if(sofia_agent && sofia_agent->config->force_destination == TRUE) {
|
||||
force_destination_ip = sofia_agent->config->remote_ip;
|
||||
if(sofia_session->sip_settings->force_destination == TRUE) {
|
||||
force_destination_ip = sofia_session->sip_settings->server_ip;
|
||||
}
|
||||
descriptor = mrcp_descriptor_generate_by_sdp_session(sdp,force_destination_ip,session->pool);
|
||||
sdp_parser_free(parser);
|
||||
@@ -409,6 +422,62 @@ static void mrcp_sofia_on_session_ready(
|
||||
}
|
||||
}
|
||||
|
||||
static void mrcp_sofia_on_session_redirect(
|
||||
int status,
|
||||
mrcp_sofia_agent_t *sofia_agent,
|
||||
nua_handle_t *nh,
|
||||
mrcp_sofia_session_t *sofia_session,
|
||||
sip_t const *sip,
|
||||
tagi_t tags[])
|
||||
{
|
||||
mrcp_session_t *session = sofia_session->session;
|
||||
sip_contact_t *sip_contact;
|
||||
if(!sip) {
|
||||
return;
|
||||
}
|
||||
sip_contact = sip->sip_contact;
|
||||
if(!sip_contact || !sip_contact->m_url) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(sip_contact->m_url->url_user && sip_contact->m_url->url_user != '\0') {
|
||||
sofia_session->sip_to_str = apr_psprintf(session->pool,"sip:%s@%s:%s",
|
||||
sip_contact->m_url->url_user,
|
||||
sip_contact->m_url->url_host,
|
||||
sip_contact->m_url->url_port);
|
||||
}
|
||||
else {
|
||||
sofia_session->sip_to_str = apr_psprintf(session->pool,"sip:%s:%s",
|
||||
sip_contact->m_url->url_host,
|
||||
sip_contact->m_url->url_port);
|
||||
}
|
||||
|
||||
apr_thread_mutex_lock(sofia_session->mutex);
|
||||
|
||||
apt_obj_log(APT_LOG_MARK,APT_PRIO_INFO,session->log_obj,"Redirect "APT_NAMESID_FMT" to %s",
|
||||
session->name,
|
||||
MRCP_SESSION_SID(session),
|
||||
sofia_session->sip_to_str);
|
||||
|
||||
if(sofia_session->nh) {
|
||||
nua_handle_bind(sofia_session->nh, NULL);
|
||||
nua_handle_destroy(sofia_session->nh);
|
||||
sofia_session->nh = NULL;
|
||||
}
|
||||
|
||||
sofia_session->nh = nua_handle(
|
||||
sofia_agent->nua,
|
||||
sofia_session,
|
||||
SIPTAG_TO_STR(sofia_session->sip_to_str),
|
||||
SIPTAG_FROM_STR(sofia_agent->sip_from_str),
|
||||
SIPTAG_CONTACT_STR(sofia_agent->sip_contact_str),
|
||||
TAG_END());
|
||||
|
||||
apr_thread_mutex_unlock(sofia_session->mutex);
|
||||
|
||||
mrcp_sofia_session_offer(sofia_session->session,sofia_session->descriptor);
|
||||
}
|
||||
|
||||
static void mrcp_sofia_on_session_terminate(
|
||||
int status,
|
||||
mrcp_sofia_agent_t *sofia_agent,
|
||||
@@ -450,8 +519,8 @@ static void mrcp_sofia_on_state_change(
|
||||
NUTAG_CALLSTATE_REF(ss_state),
|
||||
TAG_END());
|
||||
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"SIP Call State "APT_PTR_FMT" [%s]",
|
||||
sofia_session ? MRCP_SESSION_PTR(sofia_session->session) : NULL,
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"SIP Call State %s [%s]",
|
||||
sofia_session ? sofia_session->session->name : "",
|
||||
nua_callstate_name(ss_state));
|
||||
|
||||
switch(ss_state) {
|
||||
@@ -477,15 +546,15 @@ static void mrcp_sofia_on_resource_discover(
|
||||
const char *remote_sdp_str = NULL;
|
||||
mrcp_session_descriptor_t *descriptor = NULL;
|
||||
|
||||
tl_gets(tags,
|
||||
SOATAG_REMOTE_SDP_STR_REF(remote_sdp_str),
|
||||
TAG_END());
|
||||
|
||||
if(sip->sip_payload) {
|
||||
remote_sdp_str = sip->sip_payload->pl_data;
|
||||
}
|
||||
|
||||
if(remote_sdp_str) {
|
||||
sdp_parser_t *parser = NULL;
|
||||
sdp_session_t *sdp = NULL;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Resource Discovery SDP "APT_PTR_FMT"\n%s",
|
||||
MRCP_SESSION_PTR(session),
|
||||
apt_obj_log(APT_LOG_MARK,APT_PRIO_INFO,session->obj,"Resource Discovery SDP %s\n%s",
|
||||
session->name,
|
||||
remote_sdp_str);
|
||||
|
||||
parser = sdp_parse(sofia_session->home,remote_sdp_str,(int)strlen(remote_sdp_str),0);
|
||||
@@ -517,6 +586,11 @@ static void mrcp_sofia_event_callback(
|
||||
case nua_i_state:
|
||||
mrcp_sofia_on_state_change(status,sofia_agent,nh,sofia_session,sip,tags);
|
||||
break;
|
||||
case nua_r_invite:
|
||||
if(status >= 300 && status < 400) {
|
||||
mrcp_sofia_on_session_redirect(status,sofia_agent,nh,sofia_session,sip,tags);
|
||||
}
|
||||
break;
|
||||
case nua_r_options:
|
||||
mrcp_sofia_on_resource_discover(status,sofia_agent,nh,sofia_session,sip,tags);
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Arsen Chaloyan
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -12,6 +12,8 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_sofiasip_server_agent.c 1700 2010-05-21 18:56:06Z achaloyan $
|
||||
*/
|
||||
|
||||
typedef struct mrcp_sofia_agent_t mrcp_sofia_agent_t;
|
||||
@@ -35,8 +37,6 @@ typedef struct mrcp_sofia_session_t mrcp_sofia_session_t;
|
||||
#include "mrcp_sdp.h"
|
||||
#include "apt_log.h"
|
||||
|
||||
#define SOFIA_TASK_NAME "SofiaSIP Agent"
|
||||
|
||||
struct mrcp_sofia_agent_t {
|
||||
mrcp_sig_agent_t *sig_agent;
|
||||
|
||||
@@ -82,13 +82,13 @@ static void mrcp_sofia_event_callback( nua_event_t nua_event,
|
||||
|
||||
|
||||
/** Create Sofia-SIP Signaling Agent */
|
||||
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_server_agent_create(mrcp_sofia_server_config_t *config, apr_pool_t *pool)
|
||||
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_server_agent_create(const char *id, mrcp_sofia_server_config_t *config, apr_pool_t *pool)
|
||||
{
|
||||
apt_task_t *task;
|
||||
apt_task_vtable_t *vtable;
|
||||
mrcp_sofia_agent_t *sofia_agent;
|
||||
sofia_agent = apr_palloc(pool,sizeof(mrcp_sofia_agent_t));
|
||||
sofia_agent->sig_agent = mrcp_signaling_agent_create(sofia_agent,MRCP_VERSION_2,pool);
|
||||
sofia_agent->sig_agent = mrcp_signaling_agent_create(id,sofia_agent,MRCP_VERSION_2,pool);
|
||||
sofia_agent->config = config;
|
||||
sofia_agent->root = NULL;
|
||||
sofia_agent->nua = NULL;
|
||||
@@ -101,7 +101,7 @@ MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_server_agent_create(mrcp_sofia_ser
|
||||
if(!task) {
|
||||
return NULL;
|
||||
}
|
||||
apt_task_name_set(task,SOFIA_TASK_NAME);
|
||||
apt_task_name_set(task,id);
|
||||
vtable = apt_task_vtable_get(task);
|
||||
if(vtable) {
|
||||
vtable->on_pre_run = mrcp_sofia_task_initialize;
|
||||
@@ -109,10 +109,8 @@ MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_server_agent_create(mrcp_sofia_ser
|
||||
vtable->terminate = mrcp_sofia_task_terminate;
|
||||
}
|
||||
sofia_agent->sig_agent->task = task;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create "SOFIA_TASK_NAME" ["SOFIA_SIP_VERSION"] %s:%hu %s",
|
||||
config->local_ip,
|
||||
config->local_port,
|
||||
config->transport ? config->transport : "");
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create SofiaSIP Agent [%s] ["SOFIA_SIP_VERSION"] %s",
|
||||
id,sofia_agent->sip_bind_str);
|
||||
return sofia_agent->sig_agent;
|
||||
}
|
||||
|
||||
@@ -128,6 +126,10 @@ MRCP_DECLARE(mrcp_sofia_server_config_t*) mrcp_sofiasip_server_config_alloc(apr_
|
||||
config->origin = NULL;
|
||||
config->transport = NULL;
|
||||
config->force_destination = FALSE;
|
||||
config->sip_t1 = 0;
|
||||
config->sip_t2 = 0;
|
||||
config->sip_t4 = 0;
|
||||
config->sip_t1x64 = 0;
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -135,15 +137,15 @@ static apt_bool_t mrcp_sofia_config_validate(mrcp_sofia_agent_t *sofia_agent, mr
|
||||
{
|
||||
const char *local_ip = config->ext_ip ? config->ext_ip : config->local_ip;
|
||||
sofia_agent->config = config;
|
||||
sofia_agent->sip_contact_str = apr_psprintf(pool,"sip:%s:%d",local_ip,config->local_port);
|
||||
sofia_agent->sip_contact_str = apr_psprintf(pool,"sip:%s:%hu",local_ip,config->local_port);
|
||||
if(config->transport) {
|
||||
sofia_agent->sip_bind_str = apr_psprintf(pool,"sip:%s:%d;transport=%s",
|
||||
sofia_agent->sip_bind_str = apr_psprintf(pool,"sip:%s:%hu;transport=%s",
|
||||
config->local_ip,
|
||||
config->local_port,
|
||||
config->transport);
|
||||
}
|
||||
else {
|
||||
sofia_agent->sip_bind_str = apr_psprintf(pool,"sip:%s:%d",
|
||||
sofia_agent->sip_bind_str = apr_psprintf(pool,"sip:%s:%hu",
|
||||
config->local_ip,
|
||||
config->local_port);
|
||||
}
|
||||
@@ -153,6 +155,7 @@ static apt_bool_t mrcp_sofia_config_validate(mrcp_sofia_agent_t *sofia_agent, mr
|
||||
static void mrcp_sofia_task_initialize(apt_task_t *task)
|
||||
{
|
||||
mrcp_sofia_agent_t *sofia_agent = apt_task_object_get(task);
|
||||
mrcp_sofia_server_config_t *sofia_config = sofia_agent->config;
|
||||
|
||||
/* Initialize Sofia-SIP library and create event loop */
|
||||
su_init();
|
||||
@@ -173,7 +176,11 @@ static void mrcp_sofia_task_initialize(apt_task_t *task)
|
||||
sofia_agent->nua,
|
||||
NUTAG_AUTOANSWER(0),
|
||||
NUTAG_APPL_METHOD("OPTIONS"),
|
||||
SIPTAG_USER_AGENT_STR(sofia_agent->config->user_agent_name),
|
||||
TAG_IF(sofia_config->sip_t1,NTATAG_SIP_T1(sofia_config->sip_t1)),
|
||||
TAG_IF(sofia_config->sip_t2,NTATAG_SIP_T2(sofia_config->sip_t2)),
|
||||
TAG_IF(sofia_config->sip_t4,NTATAG_SIP_T4(sofia_config->sip_t4)),
|
||||
TAG_IF(sofia_config->sip_t1x64,NTATAG_SIP_T1X64(sofia_config->sip_t1x64)),
|
||||
SIPTAG_USER_AGENT_STR(sofia_config->user_agent_name),
|
||||
TAG_END());
|
||||
}
|
||||
}
|
||||
@@ -270,7 +277,10 @@ static apt_bool_t mrcp_sofia_on_session_answer(mrcp_session_t *session, mrcp_ses
|
||||
|
||||
if(sdp_string_generate_by_mrcp_descriptor(sdp_str,sizeof(sdp_str),descriptor,FALSE) > 0) {
|
||||
local_sdp_str = sdp_str;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Local SDP\n%s", local_sdp_str);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Local SDP "APT_NAMESID_FMT"\n%s",
|
||||
session->name,
|
||||
MRCP_SESSION_SID(session),
|
||||
local_sdp_str);
|
||||
}
|
||||
|
||||
nua_respond(sofia_session->nh, SIP_200_OK,
|
||||
@@ -333,7 +343,10 @@ static void mrcp_sofia_on_call_receive(mrcp_sofia_agent_t *sofia_agent,
|
||||
if(remote_sdp_str) {
|
||||
sdp_parser_t *parser = NULL;
|
||||
sdp_session_t *sdp = NULL;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Remote SDP\n%s", remote_sdp_str);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Remote SDP "APT_NAMESID_FMT"\n%s",
|
||||
sofia_session->session->name,
|
||||
MRCP_SESSION_SID(sofia_session->session),
|
||||
remote_sdp_str);
|
||||
|
||||
parser = sdp_parse(sofia_session->home,remote_sdp_str,(int)strlen(remote_sdp_str),0);
|
||||
sdp = sdp_session(parser);
|
||||
@@ -371,7 +384,9 @@ static void mrcp_sofia_on_state_change(mrcp_sofia_agent_t *sofia_agent,
|
||||
NUTAG_CALLSTATE_REF(ss_state),
|
||||
TAG_END());
|
||||
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"SIP Call State [%s]", nua_callstate_name(ss_state));
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"SIP Call State %s [%s]",
|
||||
sofia_session ? sofia_session->session->name : "",
|
||||
nua_callstate_name(ss_state));
|
||||
|
||||
switch(ss_state) {
|
||||
case nua_callstate_received:
|
||||
@@ -397,7 +412,8 @@ static void mrcp_sofia_on_resource_discover(mrcp_sofia_agent_t *sofia_agent,
|
||||
|
||||
if(sdp_resource_discovery_string_generate(ip,sofia_agent->config->origin,sdp_str,sizeof(sdp_str)) > 0) {
|
||||
local_sdp_str = sdp_str;
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Resource Discovery SDP\n[%s]\n", local_sdp_str);
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Resource Discovery SDP\n[%s]\n",
|
||||
local_sdp_str);
|
||||
}
|
||||
|
||||
nua_respond(nh, SIP_200_OK,
|
||||
|
||||
Reference in New Issue
Block a user