Commit d461e65b authored by Simon Morlat's avatar Simon Morlat

belle-sip builds with visual studio express 2012, without CUnit for the

moment.
parent b3818f30
......@@ -2,6 +2,7 @@ Dependencies:
libantlr3c-3.2
antlr3-3.2
CUinit-2.x
Newer versions won't compile.
......@@ -11,5 +12,38 @@ replace:
by:
#include <winsock2.h>
Or get the source code from linphone's git (linphone branch):
git clone -b linphone git://git.linphone.org/libantlr3c.git
Prequisites
***********
You must jave 'java' in your PATH.
Build with mingw
****************
* Compile and install libantlr3c, CUnit with ./configure && make && make install
* Compile belle-sip.
Build with Visual Studio
************************
The procedure is tested for Visual Studio Express 2012.
* get libantlr3c from linphone's git server (see above). This version contains up to date visual studio project and solution files.
* put belle-sip next to libantlr3c (in the same directory).
* open belle-sip/build/windows/belle-sip/belle-sip.sln
* cp antlr.jar into belle-sip/build/windows/belle-sip
* Build the solution (antlr3c is built automatically)

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "belle-sip", "belle-sip.vcxproj", "{300E2173-D3DA-48BB-9410-7F4E953CE5D1}"
ProjectSection(ProjectDependencies) = postProject
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40} = {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libantlr3c", "..\..\..\..\libantlr3c\build\vsx\libantlr3c.vcxproj", "{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
DebugDLL|Win32 = DebugDLL|Win32
DebugDLL|x64 = DebugDLL|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseDLL|Win32 = ReleaseDLL|Win32
ReleaseDLL|x64 = ReleaseDLL|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.Debug|Win32.ActiveCfg = DebugDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.Debug|Win32.Build.0 = DebugDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.Debug|x64.ActiveCfg = DebugDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.DebugDLL|x64.ActiveCfg = DebugDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.Release|Win32.ActiveCfg = ReleaseDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.Release|Win32.Build.0 = ReleaseDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.Release|x64.ActiveCfg = ReleaseDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
{300E2173-D3DA-48BB-9410-7F4E953CE5D1}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|Win32
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|Win32.ActiveCfg = Debug|Win32
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|Win32.Build.0 = Debug|Win32
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|x64.ActiveCfg = Debug|x64
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|x64.Build.0 = Debug|x64
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|x64.Build.0 = DebugDLL|x64
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|Win32.ActiveCfg = Release|Win32
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|Win32.Build.0 = Release|Win32
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|x64.ActiveCfg = Release|x64
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|x64.Build.0 = Release|x64
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?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="DebugDLL|Win32">
<Configuration>DebugDLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDLL|Win32">
<Configuration>ReleaseDLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{300E2173-D3DA-48BB-9410-7F4E953CE5D1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>bellesip</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">
<LinkIncremental>true</LinkIncremental>
<CustomBuildBeforeTargets>Compile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildBeforeTargets>Build</CustomBuildBeforeTargets>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BELLESIP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\..\libantlr3c\include;$(ProjectDir)..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ws2_32.lib;libantlr3c_dll.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)\..\..\..\..\libantlr3c\build\vsx\$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>java -jar antlr.jar -make -fo $(SolutionDir)\..\..\..\src\ $(SolutionDir)\..\..\..\src\*.g</Command>
<Message>Generating parser filers from grammar</Message>
<Inputs>..\..\src\belle_sip_message.g;..\..\src\belle_sdp.g;%(Inputs)</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BELLESIP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\..\libantlr3c\include;$(ProjectDir)..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>ws2_32.lib;libantlr3c_dll.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)\..\..\..\..\libantlr3c\build\vsx\$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>java -jar antlr.jar -make -fo $(SolutionDir)\..\..\..\src\ $(SolutionDir)\..\..\..\src\*.g</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating parser filers from grammar</Message>
</CustomBuildStep>
<CustomBuildStep>
<Inputs>..\..\src\belle_sip_message.g;..\..\src\belle_sdp.g;%(Inputs)</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\belle-sip\auth-helper.h" />
<ClInclude Include="..\..\..\include\belle-sip\belle-sdp.h" />
<ClInclude Include="..\..\..\include\belle-sip\belle-sip.h" />
<ClInclude Include="..\..\..\include\belle-sip\dialog.h" />
<ClInclude Include="..\..\..\include\belle-sip\headers.h" />
<ClInclude Include="..\..\..\include\belle-sip\list.h" />
<ClInclude Include="..\..\..\include\belle-sip\listener.h" />
<ClInclude Include="..\..\..\include\belle-sip\listeningpoint.h" />
<ClInclude Include="..\..\..\include\belle-sip\mainloop.h" />
<ClInclude Include="..\..\..\include\belle-sip\message.h" />
<ClInclude Include="..\..\..\include\belle-sip\object.h" />
<ClInclude Include="..\..\..\include\belle-sip\parameters.h" />
<ClInclude Include="..\..\..\include\belle-sip\provider.h" />
<ClInclude Include="..\..\..\include\belle-sip\refresher-helper.h" />
<ClInclude Include="..\..\..\include\belle-sip\sipstack.h" />
<ClInclude Include="..\..\..\include\belle-sip\transaction.h" />
<ClInclude Include="..\..\..\include\belle-sip\uri.h" />
<ClInclude Include="..\..\..\include\belle-sip\utils.h" />
<ClInclude Include="..\..\..\src\belle_sdpLexer.h" />
<ClInclude Include="..\..\..\src\belle_sdpParser.h" />
<ClInclude Include="..\..\..\src\belle_sip_internal.h" />
<ClInclude Include="..\..\..\src\belle_sip_messageLexer.h" />
<ClInclude Include="..\..\..\src\belle_sip_messageParser.h" />
<ClInclude Include="..\..\..\src\belle_sip_resolver.h" />
<ClInclude Include="..\..\..\src\channel.h" />
<ClInclude Include="..\..\..\src\listeningpoint_internal.h" />
<ClInclude Include="..\..\..\src\md5.h" />
<ClInclude Include="..\..\..\src\port.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\auth_event.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\auth_helper.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\belle_sdpLexer.c" />
<ClCompile Include="..\..\..\src\belle_sdpParser.c" />
<ClCompile Include="..\..\..\src\belle_sdp_impl.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\belle_sip_headers_impl.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\belle_sip_loop.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\belle_sip_messageLexer.c" />
<ClCompile Include="..\..\..\src\belle_sip_messageParser.c" />
<ClCompile Include="..\..\..\src\belle_sip_object.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\belle_sip_parameters.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\belle_sip_resolver.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\belle_sip_uri_impl.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\belle_sip_utils.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\channel.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\dialog.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\ict.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\ist.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\listeningpoint.c" />
<ClCompile Include="..\..\..\src\md5.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\message.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\nict.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\nist.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\port.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\provider.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\refresher.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\siplistener.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\sipstack.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\transaction.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">CompileAsC</CompileAs>
</ClCompile>
<ClCompile Include="..\..\..\src\transports\stream_channel.c" />
<ClCompile Include="..\..\..\src\transports\stream_listeningpoint.c" />
<ClCompile Include="..\..\..\src\transports\tls_channel.c" />
<ClCompile Include="..\..\..\src\transports\tls_listeningpoint.c" />
<ClCompile Include="..\..\..\src\transports\udp_channel.c" />
<ClCompile Include="..\..\..\src\transports\udp_listeningpoint.c" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\..\src\belle_sdp.g">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">java -jar $(ProjectDir)\antlr.jar -make -fo $(ProjectDir)\..\..\..\src\ $(ProjectDir)\..\..\..\src\belle_sdp.g</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Generating SDP parser</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">java -jar $(ProjectDir)\antlr.jar -make -fo $(ProjectDir)\..\..\..\src\ $(ProjectDir)\..\..\..\src\belle_sdp.g</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Generating SDP parser</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(ProjectDir)\..\..\..\src\belle_sdpLexer.c;$(ProjectDir)\..\..\..\src\belle_sdpParser.c</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">false</LinkObjects>
<TreatOutputAsContent Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">false</TreatOutputAsContent>
<Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(ProjectDir)\..\..\..\src\belle_sdpLexer.c;$(ProjectDir)\..\..\..\src\belle_sdpParser.c</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">false</LinkObjects>
<TreatOutputAsContent Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">false</TreatOutputAsContent>
</CustomBuild>
<CustomBuild Include="..\..\..\src\belle_sip_message.g">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">java -jar $(ProjectDir)\antlr.jar -make -fo $(ProjectDir)\..\..\..\src\ $(ProjectDir)\..\..\..\src\belle_sip_message.g</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">Generating SIP parser</Message>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">false</LinkObjects>
<Command Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">java -jar $(ProjectDir)\antlr.jar -make -fo $(ProjectDir)\..\..\..\src\ $(ProjectDir)\..\..\..\src\belle_sip_message.g</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">Generating SIP parser</Message>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">false</LinkObjects>
<Outputs Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">$(ProjectDir)\..\..\..\src\belle_sip_messageLexer.c;$(ProjectDir)\..\..\..\src\belle_sip_messageParser.c;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">$(ProjectDir)\..\..\..\src\belle_sip_messageLexer.c;$(ProjectDir)\..\..\..\src\belle_sip_messageParser.c;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
......@@ -28,6 +28,10 @@
#define BELLE_SIP_END_DECLS
#endif
#ifdef _MSC_VER
#define inline __inline
#endif
#include "belle-sip/object.h"
/**
......
......@@ -22,11 +22,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#ifdef WIN32
#include <windows.h>
#endif
/***************/
/* logging api */
......
......@@ -28,7 +28,7 @@ GET_SET_STRING(belle_sip_auth_event,realm)
GET_SET_STRING(belle_sip_auth_event,passwd)
GET_SET_STRING(belle_sip_auth_event,ha1)
belle_sip_auth_event_t* belle_sip_auth_event_create(const char* realm,const char* username) {
belle_sip_auth_event_t* result = belle_sip_malloc(sizeof(belle_sip_auth_event_t));
belle_sip_auth_event_t* result = belle_sip_new(belle_sip_auth_event_t);
memset(result,0,sizeof(belle_sip_auth_event_t));
belle_sip_auth_event_set_realm(result,realm);
belle_sip_auth_event_set_username(result,username);
......
......@@ -120,9 +120,11 @@ int belle_sip_auth_helper_compute_response_qop_auth(const char* ha1
, const char* ha2, char response[33]) {
md5_byte_t out[16];
md5_state_t state;
response[32]='\0';
char nounce_count_as_string[9];
int di;
response[32]='\0';
snprintf(nounce_count_as_string,sizeof(nounce_count_as_string),"%08x",nonce_count);
/*response=MD5(HA1:nonce:nonce_count:cnonce:qop:HA2)*/
......@@ -162,9 +164,10 @@ int belle_sip_auth_helper_fill_authorization(belle_sip_header_authorization_t* a
char* uri;
char ha2[16*2 + 1];
char response[16*2 + 1];
response[32]=ha2[32]='\0';
char cnonce[9];
response[32]=ha2[32]='\0';
if (belle_sip_header_authorization_get_scheme(authorization) != NULL &&
strcmp("Digest",belle_sip_header_authorization_get_scheme(authorization))!=0) {
belle_sip_error("belle_sip_fill_authorization_header, unsupported schema [%s]"
......
......@@ -123,10 +123,11 @@ time_field: {IS_TOKEN(t)}?alpha_num EQUAL
SPACE
stop_time {belle_sdp_time_description_t* time_description =belle_sdp_time_description_new();
belle_sdp_time_t* time_value =belle_sdp_time_new();
belle_sip_list_t* time_description_list;
belle_sdp_time_set_start(time_value,atoi((const char*)$start_time.text->chars));
belle_sdp_time_set_stop(time_value,atoi((const char*)$stop_time.text->chars));
belle_sdp_time_description_set_time(time_description,time_value);
belle_sip_list_t* time_description_list = belle_sip_list_append(NULL,time_description);
time_description_list = belle_sip_list_append(NULL,time_description);
belle_sdp_session_description_set_time_descriptions($session_description::current,time_description_list);};
repeat_time: {IS_TOKEN(r)}?alpha_num EQUAL repeat_interval (SPACE typed_time)+;
......
......@@ -801,6 +801,7 @@ belle_sip_header_extension_t* belle_sip_header_extension_parse (const char* valu
pbelle_sip_messageLexer lex;
pANTLR3_COMMON_TOKEN_STREAM tokens;
pbelle_sip_messageParser parser;
belle_sip_messageParser_header_extension_return l_parsed_object;
input = antlr3NewAsciiStringCopyStream (
(pANTLR3_UINT8)value,
(ANTLR3_UINT32)strlen(value),
......@@ -808,7 +809,7 @@ belle_sip_header_extension_t* belle_sip_header_extension_parse (const char* valu
lex = belle_sip_messageLexerNew (input);
tokens = antlr3CommonTokenStreamSourceNew (1025, lex->pLexer->rec->state->tokSource);
parser = belle_sip_messageParserNew (tokens);
belle_sip_messageParser_header_extension_return l_parsed_object = parser->header_extension(parser,FALSE);
l_parsed_object = parser->header_extension(parser,FALSE);
parser ->free(parser);
tokens ->free(tokens);
lex ->free(lex);
......@@ -852,8 +853,9 @@ GET_SET_STRING(belle_sip_header_extension,value);
#define AUTH_BASE_MARSHAL(header) \
unsigned int current_offset=offset;\
char* border=" ";\
const belle_sip_list_t* list;\
current_offset+=belle_sip_header_marshal(BELLE_SIP_HEADER(header), buff,current_offset, buff_size);\
const belle_sip_list_t* list=belle_sip_parameters_get_parameters(&header->params_list);\
list=belle_sip_parameters_get_parameters(&header->params_list);\
if (header->scheme) { \
current_offset+=snprintf(buff+current_offset,buff_size-current_offset," %s",header->scheme);\
} else { \
......
......@@ -53,6 +53,12 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.0.1"
#endif
#endif
/*etc*/
......@@ -212,9 +218,7 @@ extern "C" {
belle_sip_list_t *belle_sip_list_new(void *data);
belle_sip_list_t* belle_sip_list_append_link(belle_sip_list_t* elem,belle_sip_list_t *new_elem);
belle_sip_list_t *belle_sip_list_find_custom(belle_sip_list_t *list, belle_sip_compare_func compare_func, const void *user_data);
belle_sip_list_t *belle_sip_list_delete_custom(belle_sip_list_t *list, belle_sip_compare_func compare_func, const void *user_data);
belle_sip_list_t * belle_sip_list_free(belle_sip_list_t *list);
#define belle_sip_list_next(elem) ((elem)->next)
......@@ -298,7 +302,7 @@ char *belle_sip_strdup_printf(const char *fmt,...);
#define ATO_(type,value) ATO_##type(value)
#define ATO_int(value) atoi(value)
#define ATO_float(value) strtof(value,NULL)
#define ATO_float(value) (float)strtod(value,NULL)
#define FORMAT_(type) FORMAT_##type
#define FORMAT_int "%i"
#define FORMAT_float "%f"
......@@ -344,6 +348,7 @@ belle_sip_##object_type##_t* belle_sip_##object_type##_parse (const char* value)
pbelle_sip_messageLexer lex; \
pANTLR3_COMMON_TOKEN_STREAM tokens; \
pbelle_sip_messageParser parser; \
belle_sip_##object_type##_t* l_parsed_object; \
input = antlr3NewAsciiStringCopyStream (\
(pANTLR3_UINT8)value,\
(ANTLR3_UINT32)strlen(value),\
......@@ -351,7 +356,7 @@ belle_sip_##object_type##_t* belle_sip_##object_type##_parse (const char* value)
lex = belle_sip_messageLexerNew (input);\
tokens = antlr3CommonTokenStreamSourceNew (ANTLR3_SIZE_HINT, TOKENSOURCE(lex));\
parser = belle_sip_messageParserNew (tokens);\
belle_sip_##object_type##_t* l_parsed_object = parser->object_type(parser);\
l_parsed_object = parser->object_type(parser);\
parser ->free(parser);\
tokens ->free(tokens);\
lex ->free(lex);\
......@@ -701,6 +706,7 @@ belle_sdp_##object_type##_t* belle_sdp_##object_type##_parse (const char* value)
pbelle_sdpLexer lex; \
pANTLR3_COMMON_TOKEN_STREAM tokens; \
pbelle_sdpParser parser; \
belle_sdp_##object_type##_t* l_parsed_object; \
input = antlr3NewAsciiStringCopyStream (\
(pANTLR3_UINT8)value,\
(ANTLR3_UINT32)strlen(value),\
......@@ -708,7 +714,7 @@ belle_sdp_##object_type##_t* belle_sdp_##object_type##_parse (const char* value)
lex = belle_sdpLexerNew (input);\
tokens = antlr3CommonTokenStreamSourceNew (ANTLR3_SIZE_HINT, TOKENSOURCE(lex));\
parser = belle_sdpParserNew (tokens);\
belle_sdp_##object_type##_t* l_parsed_object = parser->object_type(parser).ret;\
l_parsed_object = parser->object_type(parser).ret;\
parser ->free(parser);\
tokens ->free(tokens);\
lex ->free(lex);\
......@@ -790,7 +796,6 @@ struct belle_sip_auth_event {
char* ha1;
};
belle_sip_auth_event_t* belle_sip_auth_event_create(const char* realm,const char* username);
void belle_sip_auth_event_destroy(belle_sip_auth_event_t* event);
/*
* refresher
......
......@@ -336,9 +336,10 @@ void belle_sip_main_loop_iterate(belle_sip_main_loop_t *ml){
}
if (min_time_ms!=(uint64_t)-1 ){
int64_t diff;
/* compute the amount of time to wait for shortest timeout*/
cur=belle_sip_time_ms();
int64_t diff=min_time_ms-cur;
diff=min_time_ms-cur;
if (diff>0)
duration=(int)diff;
else
......
......@@ -439,7 +439,7 @@ scope { belle_sip_header_contact_t* prev;}
@init { if ($header_contact::current == NULL) {
$header_contact::current = belle_sip_header_contact_new();
$header_contact::first = $header_contact::current;
$contact_param::prev==NULL;
$contact_param::prev=NULL;
} else {
$contact_param::prev=$header_contact::current;
belle_sip_header_set_next(BELLE_SIP_HEADER($header_contact::current),(belle_sip_header_t*)belle_sip_header_contact_new());
......@@ -453,7 +453,7 @@ catch [ANTLR3_MISMATCHED_TOKEN_EXCEPTION]
{
belle_sip_message("[\%s] reason [\%s]",(const char*)EXCEPTION->name,(const char*)EXCEPTION->message);
if ( $contact_param::prev == NULL) {
$header_contact::first==NULL;
$header_contact::first=NULL;
} else {
belle_sip_header_set_next(BELLE_SIP_HEADER($contact_param::prev),NULL);
}
......@@ -832,7 +832,7 @@ catch [ANTLR3_MISMATCHED_TOKEN_EXCEPTION]
{
belle_sip_message("[\%s] reason [\%s]",(const char*)EXCEPTION->name,(const char*)EXCEPTION->message);
if ( $srv_route::prev == NULL) {
$header_service_route::first==NULL;
$header_service_route::first=NULL;
} else {
belle_sip_header_set_next(BELLE_SIP_HEADER($srv_route::prev),NULL);
}
......@@ -870,7 +870,7 @@ catch [ANTLR3_MISMATCHED_TOKEN_EXCEPTION]
{
belle_sip_message("[\%s] reason [\%s]",(const char*)EXCEPTION->name,(const char*)EXCEPTION->message);
if ( $rec_route::prev == NULL) {
$header_record_route::first==NULL;
$header_record_route::first=NULL;
} else {
belle_sip_header_set_next(BELLE_SIP_HEADER($rec_route::prev),NULL);
}
......@@ -923,7 +923,7 @@ catch [ANTLR3_MISMATCHED_TOKEN_EXCEPTION]
{
belle_sip_message("[\%s] reason [\%s]",(const char*)EXCEPTION->name,(const char*)EXCEPTION->message);
if ( $route_param::prev == NULL) {
$header_route::first==NULL;
$header_route::first=NULL;
} else {
belle_sip_header_set_next(BELLE_SIP_HEADER($route_param::prev),NULL);
}
......@@ -1008,8 +1008,9 @@ scope { belle_sip_header_via_t* prev;}
$header_via::first = $header_via::current = belle_sip_header_via_new();
$via_parm::prev=NULL;
} else {
belle_sip_header_t* header;
$via_parm::prev=$header_via::current;
belle_sip_header_t* header = BELLE_SIP_HEADER($header_via::current);
header = BELLE_SIP_HEADER($header_via::current);
belle_sip_header_set_next(header,(belle_sip_header_t*)($header_via::current = belle_sip_header_via_new()));
}
}
......@@ -1018,7 +1019,7 @@ catch [ANTLR3_MISMATCHED_TOKEN_EXCEPTION]
{
belle_sip_message("[\%s] reason [\%s]",(const char*)EXCEPTION->name,(const char*)EXCEPTION->message);
if ( $via_parm::prev == NULL) {
$header_via::first==NULL;
$header_via::first=NULL;
} else {
belle_sip_header_set_next(BELLE_SIP_HEADER($via_parm::prev),NULL);
}
......@@ -1279,7 +1280,7 @@ mark : '-' | '_' | '.' | '!' | '~' | STAR | '\'' ;
HEX_CHAR: 'a'..'f' |'A'..'F';
DIGIT : '0'..'9' ;
CRLF : '\r\n' { USER1 = (int)(ctx->pLexer->input->currentLine - ctx->pLexer->input->data); /*GETCHARINDEX()*/;};
CRLF : '\r\n' { USER1 = (int)((char*)ctx->pLexer->input->currentLine - (char*)ctx->pLexer->input->data); /*GETCHARINDEX()*/;};
......
......@@ -72,6 +72,7 @@ unsigned int belle_sip_parameters_is_parameter(const belle_sip_parameters_t* par
}
void belle_sip_parameters_set_parameter(belle_sip_parameters_t* params,const char* name,const char* value) {
/*1 check if present*/
belle_sip_param_pair_t* lNewpair;
belle_sip_list_t * lResult = belle_sip_list_find_custom(params->paramnames_list, (belle_sip_compare_func)strcmp, name);
/* first remove from header names list*/
if (lResult) {
......@@ -84,7 +85,7 @@ void belle_sip_parameters_set_parameter(belle_sip_parameters_t* params,const cha
params->param_list=belle_sip_list_delete_link(params->param_list,lResult);
}
/* 2 insert*/
belle_sip_param_pair_t* lNewpair = belle_sip_param_pair_new(name,value);
lNewpair = belle_sip_param_pair_new(name,value);
params->param_list=belle_sip_list_append(params->param_list,lNewpair);
params->paramnames_list=belle_sip_list_append(params->paramnames_list,lNewpair->name);