- Add Support for Early IMS

- Add support for IMPI/IMPU
This commit is contained in:
imsframework 2009-11-03 01:01:29 +00:00
parent 57ef214d84
commit c29f498b28
69 changed files with 9255 additions and 1364 deletions

View File

@ -0,0 +1,33 @@
========================================================================
CONSOLE APPLICATION : test Project Overview
========================================================================
AppWizard has created this test application for you.
This file contains a summary of what you will find in each of the files that
make up your test application.
test.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
test.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named test.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// test.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

View File

@ -0,0 +1,15 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here

View File

@ -0,0 +1,13 @@
#pragma once
// The following macros define the minimum required platform. The minimum required platform
// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif

View File

@ -0,0 +1,82 @@
// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <assert.h>
#include <api_engine.h>
#include <api_stack.h>
#define STACK_ID 1234
#ifdef WIN32
# include <windows.h>
#endif
/* Event listening using a static method */
void OnRegistrationStateChanged(int stack_id, dgo::sip_state_registration_t state, int sipcode, const char* sipdesc)
{
/* check if it's our stack */
if(stack_id != STACK_ID) return;
switch(state)
{
case dgo::srs_none: printf("Test_OnRegistrationStateChanged: %s(%s)\n", "srs_none", sipdesc); break;
case dgo::srs_trying: printf("Test_OnRegistrationStateChanged: %s(%s)\n", "srs_trying", sipdesc); break;
case dgo::srs_authentifying: printf("Test_OnRegistrationStateChanged: %s(%s)\n", "srs_authentifying", sipdesc); break;
case dgo::srs_unregistered: printf("Test_OnRegistrationStateChanged: %s(%s)\n", "srs_unregistered", sipdesc); break;
case dgo::srs_registered: printf("Test_OnRegistrationStateChanged: %s(%s)\n", "srs_registered", sipdesc); break;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
/* MUST call this function to initialize the engine befor using the first stack */
assert( ERR_SUCCEED(dgo::engine_initialize()) );
/* create the stack */
dgo::stack* stack = new dgo::stack(STACK_ID);
/* Events registration */
stack->registrationStateChanged.connect(&OnRegistrationStateChanged);
/* check that the stack has been successfuly initialized */
assert(stack->get_initialized());
/* MUST: Initialize mandatory parameters */
stack->set_public_id("sip:doubango@example.com");
stack->set_private_id("doubango@example.com");
stack->set_pcscf("192.168.0.14");
stack->set_pcscf_port(5060);
stack->set_realm("example.com");
/* run stack */
assert( ERR_SUCCEED(stack->run()) );
/* set other optional parameters */
stack->set_displayname("Doubango");
stack->set_privacy("none");
stack->set_early_ims(false);
stack->set_expires(10);
/* register */
stack->sip_register();
/* wait */
#ifdef WIN32
Sleep(50000);
#else
getchar();
#endif
/* Now it's time to unregister */
stack->sip_unregister();
/* wait */
getchar();
/* destroy the engine and unregister all identities*/
assert( ERR_SUCCEED(dgo::engine_deinitialize()) );
return 0;
}

View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test.vcproj", "{EB6DC417-98BF-45FD-90D0-F5C72F945316}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EB6DC417-98BF-45FD-90D0-F5C72F945316}.Debug|Win32.ActiveCfg = Debug|Win32
{EB6DC417-98BF-45FD-90D0-F5C72F945316}.Debug|Win32.Build.0 = Debug|Win32
{EB6DC417-98BF-45FD-90D0-F5C72F945316}.Release|Win32.ActiveCfg = Release|Win32
{EB6DC417-98BF-45FD-90D0-F5C72F945316}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,211 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="test"
ProjectGUID="{EB6DC417-98BF-45FD-90D0-F5C72F945316}"
RootNamespace="test"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(DOUBANGO_HOME)\doubango\src&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\win32&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\su&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\ipt&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\sresolv&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\bnf&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\url&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\msg&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\sip&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\nta&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\nua&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\iptsec&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\http&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\nth&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\nea&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\sdp&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\soa&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\stun&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\tport&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="$(OutDir)\doubango.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<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"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<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="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\stdafx.cpp"
>
</File>
<File
RelativePath=".\test.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\stdafx.h"
>
</File>
<File
RelativePath=".\targetver.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,99 @@
Home page for downloading: http://www.gtk.org/download-windows.html
## Preparation ##
mkdir /c/tmp
export PREFIX=/usr/local/win32
export CFLAGS="-mthreads -D_WIN32_WINNT=0x0501 -DWINVER=0x0501"
## Glib ##
cd /c/tmp
wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.22/glib_2.22.2-1_win32.zip
wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.22/glib-dev_2.22.2-1_win32.zip
mkdir glib
cd glib
unzip ../glib_2.22.2-1_win32.zip
unzip ../glib-dev_2.22.2-1_win32.zip
mv glib/* $PREFIX
## Iconv ##
cd /c/tmp
wget ftp://ftp.uni-hannover.de/pub/mirror/gnu/old-gnu/libiconv/libiconv-1.9.1.bin.woe32.zip
unzip libiconv-1.9.1.bin.woe32.zip -d $PREFIX
## Gettext ##
cd /c/tmp
wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip
wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-dev-0.17-1.zip
unzip gettext-runtime-0.17-1.zip -d $PREFIX
unzip gettext-runtime-dev-0.17-1.zip -d $PREFIX
## DirectX Headers ##
cd /c/tmp
wget http://www.lysator.liu.se/~peda/directx-headers/directx-headers-0.03.tar.gz
tar -zxvf directx-headers-0.03.tar.gz
cd directx-headers-0.03/include
patch -p1 < ../patch/dsound.patch
patch -p1 < ../patch/ddraw.patch
patch -p1 < ../patch/dinput.patch
mv /c/tmp/directx-headers-0.03/* $PREFIX
## Liboil ##
cd /c/tmp
wget http://liboil.freedesktop.org/download/liboil-0.3.16.tar.gz
tar -zxvf liboil-0.3.16.tar.gz
cd liboil-0.3.16
./configure --prefix=$PREFIX --host=i586-mingw32msvc
make -k
make -k install
## libxml2 ##
cd /c/tmp
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.6.tar.gz
tar -zxvf libxml2-2.7.6.tar.gz
cd libxml2-2.7.6
./configure --prefix=$PREFIX --host=i586-mingw32msvc
make
make install
## zlib ##
cd /c/tmp
wget http://www.gzip.org/zlib/zlib-1.2.3.tar.gz
tar -zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=$PREFIX
make
make install
## Libpng ##
cd /c/tmp
wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.2.39-1_win32.zip
unzip libpng_1.2.39-1_win32.zip -d $PREFIX
## Libogg ##
cd /c/tmp
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz
tar -zxvf libogg-1.1.4.tar.gz
cd libogg-1.1.4
./configure --prefix=$PREFIX --host=i586-mingw32msvc
make
make install
## Libvorbis ##
cd /c/tmp
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.gz
tar -zxvf libvorbis-1.2.3.tar.gz
cd libvorbis-1.2.3
./configure --prefix=$PREFIX --host=i586-mingw32msvc
make
make install
## Gstreamer ##
cd /c/tmp
wget http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-0.10.25.tar.gz
wget http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-0.10.25.tar.gz
wget http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-0.10.16.tar.gz
#wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-0.10.16.tar.gz
#wget http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-0.10.13.tar.gz
tar -zxvf gstreamer-0.10.25.tar.gz
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
./configure --prefix=$PREFIX --host=i586-mingw32msvc

View File

@ -5,7 +5,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doubango", "doubango\douban
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua", "sofia-sip-1.12.10\win32\libsofia-sip-ua\libsofia_sip_ua.vcproj", "{0D85D39A-C7FB-4C52-A541-73665FB478E6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcproj", "{D38BEAF4-2B25-49F4-97BC-3DC10440DC6D}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "Samples\C++\REGISTER\test\test.vcproj", "{EB6DC417-98BF-45FD-90D0-F5C72F945316}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -21,10 +21,10 @@ Global
{0D85D39A-C7FB-4C52-A541-73665FB478E6}.Debug|Win32.Build.0 = Debug|Win32
{0D85D39A-C7FB-4C52-A541-73665FB478E6}.Release|Win32.ActiveCfg = Release|Win32
{0D85D39A-C7FB-4C52-A541-73665FB478E6}.Release|Win32.Build.0 = Release|Win32
{D38BEAF4-2B25-49F4-97BC-3DC10440DC6D}.Debug|Win32.ActiveCfg = Debug|Win32
{D38BEAF4-2B25-49F4-97BC-3DC10440DC6D}.Debug|Win32.Build.0 = Debug|Win32
{D38BEAF4-2B25-49F4-97BC-3DC10440DC6D}.Release|Win32.ActiveCfg = Release|Win32
{D38BEAF4-2B25-49F4-97BC-3DC10440DC6D}.Release|Win32.Build.0 = Release|Win32
{EB6DC417-98BF-45FD-90D0-F5C72F945316}.Debug|Win32.ActiveCfg = Debug|Win32
{EB6DC417-98BF-45FD-90D0-F5C72F945316}.Debug|Win32.Build.0 = Debug|Win32
{EB6DC417-98BF-45FD-90D0-F5C72F945316}.Release|Win32.ActiveCfg = Release|Win32
{EB6DC417-98BF-45FD-90D0-F5C72F945316}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="./src;&quot;$(SolutionDir)sofia-sip-1.12.10\win32&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\su&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\ipt&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\sresolv&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\bnf&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\url&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\msg&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\sip&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\nta&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\nua&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\iptsec&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\http&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\nth&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\nea&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\sdp&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\soa&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\stun&quot;;&quot;$(SolutionDir)sofia-sip-1.12.10\libsofia-sip-ua\tport&quot;"
AdditionalIncludeDirectories="&quot;$(DOUBANGO_HOME)\thirdparties\include\win32&quot;;./src;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\win32&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\su&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\ipt&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\sresolv&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\bnf&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\url&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\msg&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\sip&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\nta&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\nua&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\iptsec&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\http&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\nth&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\nea&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\sdp&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\soa&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\stun&quot;;&quot;$(DOUBANGO_HOME)\sofia-sip-1.12.10\libsofia-sip-ua\tport&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DOUBANGO_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -266,6 +266,26 @@
</File>
</Filter>
</Filter>
<Filter
Name="FastDelegate"
>
<File
RelativePath=".\src\fastdelegate.h"
>
</File>
<File
RelativePath=".\src\fastdelegate2.h"
>
</File>
</Filter>
<Filter
Name="utils"
>
<File
RelativePath=".\src\strutils.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="include"
@ -382,6 +402,14 @@
</File>
</Filter>
</Filter>
<Filter
Name="utils"
>
<File
RelativePath=".\src\strutils.cxx"
>
</File>
</Filter>
</Filter>
<Filter
Name="sm"

View File

@ -1,30 +1,31 @@
%{
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
%}
%class sip_dialog_info

View File

@ -1,30 +1,31 @@
%{
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
%}
%class sip_dialog_invite

View File

@ -1,30 +1,31 @@
%{
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
%}
%class sip_dialog_message

View File

@ -1,30 +1,31 @@
%{
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
%}
%class sip_dialog_publish

View File

@ -38,12 +38,12 @@
//-------------------------------------------------------------------------------------
// Initialized
//-------------------------------------------------------------------------------------
Initialized Entry { OnStateChanged(SS_REGISTER_INITIALIZED); }
Initialized Entry { OnStateChanged(srs_none); }
{
sm_registerSent() Trying { }
}
Trying Entry { OnStateChanged(SS_REGISTER_TRYING); }
Trying Entry { OnStateChanged(srs_trying); }
{
sm_1xx_response() nil {}
sm_2xx_response(unreg: bool) [unreg == true] Terminated {}
@ -58,7 +58,7 @@ Trying Entry { OnStateChanged(SS_REGISTER_TRYING); }
Default nil {}
}
Established Entry { OnStateChanged(SS_REGISTER_ESTABLISHED); }
Established Entry { OnStateChanged(srs_registered); }
{
sm_1xx_response() nil {}
sm_2xx_response(unreg: bool) [unreg == true] Terminated {}
@ -69,7 +69,7 @@ Established Entry { OnStateChanged(SS_REGISTER_ESTABLISHED); }
Default nil {}
}
Authentifying Entry { OnStateChanged(SS_REGISTER_AUTHENTIFYING); }
Authentifying Entry { OnStateChanged(srs_authentifying); }
{
sm_1xx_response() nil {}
sm_2xx_response(unreg: bool) [unreg == true] Terminated {}
@ -79,12 +79,12 @@ Authentifying Entry { OnStateChanged(SS_REGISTER_AUTHENTIFYING); }
Default nil {}
}
Terminated Entry { OnStateChanged(SS_REGISTER_TERMINATED); }
Terminated Entry { OnStateChanged(srs_unregistered); }
{
Default nil {}
}
Default Entry { OnStateChanged(SS_REGISTER_UNKNOWN); }
Default Entry { OnStateChanged(srs_none); }
{
sm_401_407_421_494_response() Authentifying {}
sm_3xx_response() nil {}

View File

@ -1,30 +1,31 @@
%{
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
%{
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
%}
%class sip_dialog_subscribe

View File

@ -1,29 +1,30 @@
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "api_engine.h"
#include "api_stack.h"
@ -34,30 +35,23 @@
#include <list>
#include <assert.h>
#include <sofia-sip/su.h>
#define PSTACK stack*
PREF_NAMESPACE_START
/* engine callback declaration */
static void engine_callback(nua_event_t event,
int status,
char const *phrase,
nua_t *nua,
nua_magic_t *magic,
nua_handle_t *nh,
nua_hmagic_t *hmagic,
sip_t const *sip,
tagi_t tags[]);
/* global variable holding engine initialization state */
/**
global variable holding engine initialization state
*/
static bool __initialized = false;
/* global variable holding all stacks */
/**
global variable holding all stacks
*/
static std::list<PSTACK> __stacks;
/* predicate: find stack by id */
/**
STL predicate to find stack by id
*/
struct pred_stack_find_by_id: public std::binary_function< PSTACK, int, bool > {
bool operator () ( const PSTACK s, const int &id ) const {
return s->get_id() == id;
@ -107,7 +101,7 @@ ERR engine_stack_create(int stack_id)
{
return ERR_STACK_ALREADY_EXIST;
}
stack* stk = new stack(stack_id, engine_callback);
stack* stk = new stack(stack_id);
if(stk->get_initialized())
{
__stacks.push_back(stk);
@ -175,13 +169,20 @@ void* engine_stack_find(int stack_id)
return NULL;
}
/* engine callback*/
void engine_callback(nua_event_t event, int status, char const *phrase,
nua_t *nua, nua_magic_t *magic, nua_handle_t *nh,
nua_hmagic_t *hmagic, sip_t const *sip, tagi_t tags[])
/* put a stck */
ERR engine_push_stack(void* stack_ptr)
{
((stack*)magic)->callback_handle(event, status, phrase, nua, magic,
nh, hmagic, sip, tags);
if(!__initialized) return ERR_ENGINE_NOT_INITIALIZED;
if(!stack_ptr) return ERR_STACK_IS_INVALID;
stack* stk = (stack*)stack_ptr; // FIXME
if(!stk) return ERR_STACK_IS_INVALID;
if(engine_stack_find(stk->get_id())){
return ERR_STACK_ALREADY_EXIST;
}else{
__stacks.push_back(stk);
return ERR_SUCCESS;
}
}
#undef PSTACK

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef _DOUBANGO_API_ENGINE_H_
#define _DOUBANGO_API_ENGINE_H_
@ -41,6 +42,7 @@ DOUBANGO_API_C ERR engine_stack_shutdown(int stack_id);
DOUBANGO_API_C ERR engine_stack_shutdown_all(void);
void* engine_stack_find(int stack_id);
ERR engine_push_stack(void* stack_ptr);
PREF_NAMESPACE_END

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef _DOUBANGO_ERRORS_H_
#define _DOUBANGO_ERRORS_H_
@ -42,6 +43,12 @@ typedef enum tag_ERR
ERR_NOT_IMPLEMENTED,
ERR_FUNC_OBSOLETE,
/* PARAMS */
ERR_PARAMS_INVALID_PCSCF,
ERR_PARAMS_INVALID_REALM,
ERR_PARAMS_INVALID_PUBLIC_ID,
ERR_PARAMS_INVALID_PRIVATE_ID,
/* ENGINE errors */
ERR_ENGINE_NOT_INITIALIZED, /* engine not initialized or initialization failed*/
ERR_ENGINE_ALREADY_INITIALIZED, /* engine have been already initialized */

View File

@ -1,36 +1,37 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "api_sip.h"
#include "api_engine.h"
#include "api_stack.h"
#include <sofia-sip/auth_module.h>
#include <sofia-sip/su_tag.h> // FIXME: remove
#include <sofia-sip/sip_tag.h> // FIXME: remove
//#include <sofia-sip/auth_module.h>
//#include <sofia-sip/su_tag.h> // FIXME: remove
//#include <sofia-sip/sip_tag.h> // FIXME: remove
PREF_NAMESPACE_START
@ -39,8 +40,6 @@ PREF_NAMESPACE_START
if(!stk) return ERR_STACK_NOT_FOUND; \
if(!stk->get_initialized()) return ERR_STACK_NOT_INITIALIZED; \
if(!stk->get_running()) return ERR_STACK_NOT_RUNNING;
#define SAFE_FREE_HOME_PTR(home, ptr) { if(ptr){ su_free(home, ptr); } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -124,27 +123,24 @@ ERR auth_set(int stack_id, const char* public_id, const char* private_id, const
ERR auth_set_displayname(int stack_id, const char* displayname)
{
GET_STACK(stack_id, stk);
SAFE_FREE_HOME_PTR(stk->get_home(), stk->get_displayname());
stk->set_displayname( su_strdup(stk->get_home(), displayname) );
nua_set_params(stk->get_nua(),
stk->set_displayname( displayname );
/*nua_set_params(stk->get_nua(),
NUTAG_M_DISPLAY(displayname),
TAG_NULL());
TAG_NULL());*/
return ERR_SUCCESS;
}
ERR auth_set_public_id(int stack_id, const char* public_id)
{
GET_STACK(stack_id, stk);
SAFE_FREE_HOME_PTR(stk->get_home(), stk->get_public_id());
stk->set_public_id( su_strdup(stk->get_home(), public_id) );
stk->set_public_id( public_id );
return ERR_SUCCESS;
}
ERR auth_set_private_id(int stack_id, const char* private_id)
{
GET_STACK(stack_id, stk);
SAFE_FREE_HOME_PTR(stk->get_home(), stk->get_private_id());
stk->set_private_id( su_strdup(stk->get_home(), private_id) );
stk->set_private_id( private_id );
return ERR_SUCCESS;
}
@ -156,19 +152,17 @@ ERR auth_set_preferred_id(int stack_id, const char* preferred_id)
ERR auth_set_password(int stack_id, const char* password)
{
GET_STACK(stack_id, stk);
SAFE_FREE_HOME_PTR(stk->get_home(), stk->get_password());
stk->set_password( su_strdup(stk->get_home(), password) );
stk->set_password( password );
return ERR_SUCCESS;
}
ERR auth_set_realm(int stack_id, const char* realm)
{
GET_STACK(stack_id, stk);
SAFE_FREE_HOME_PTR(stk->get_home(), stk->get_realm());
stk->set_realm( su_strdup(stk->get_home(), realm) );
nua_set_params(stk->get_nua(),
stk->set_realm( realm );
/*nua_set_params(stk->get_nua(),
AUTHTAG_REALM(realm),
TAG_NULL());
TAG_NULL());*/
return ERR_SUCCESS;
}
@ -185,8 +179,7 @@ ERR auth_set_amf(int stack_id, const char* amf)
ERR auth_set_privacy(int stack_id, const char* privacy)
{
GET_STACK(stack_id, stk);
SAFE_FREE_HOME_PTR(stk->get_home(), stk->get_privacy());
stk->set_privacy( su_strdup(stk->get_home(), privacy) );
stk->set_privacy( privacy );
return ERR_SUCCESS;
}
@ -213,13 +206,15 @@ ERR network_set(int stack_id, const char* pcscf, int pcscf_port, const char* tra
ERR network_set_pcscf(int stack_id, const char* pcscf, int pcscf_port)
{
GET_STACK(stack_id, stk);
char* pcscf_ip_port = su_sprintf(NULL, "sip:%s:%d", pcscf, pcscf_port);
stk->set_pcscf(pcscf);
stk->set_pcscf_port(pcscf_port);
/*char* pcscf_ip_port = su_sprintf(NULL, "sip:%s:%d", pcscf, pcscf_port);
nua_set_params(stk->get_nua(),
NUTAG_PROXY(pcscf_ip_port),
NUTAG_OUTBOUND("no-validate"),
TAG_NULL());
su_free(NULL, pcscf_ip_port);
su_free(NULL, pcscf_ip_port);*/
return ERR_SUCCESS;
}

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef _DOUBANGO_API_SIP_REGISTRATION_H_
#define _DOUBANGO_API_SIP_REGISTRATION_H_
@ -117,4 +118,5 @@ DOUBANGO_API_C ERR sigcomp_set_cpb(int stack_id, int cpb);
PREF_NAMESPACE_END
#endif /* _DOUBANGO_API_SIP_REGISTRATION_H_ */

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef _DOUBANGO_SIP_STATES_H_
#define _DOUBANGO_SIP_STATES_H_
@ -31,6 +32,19 @@
PREF_NAMESPACE_START
/**
SIP registration states
*/
typedef enum sip_state_registration_e
{
srs_none,
srs_trying,
srs_authentifying,
srs_unregistered,
srs_registered
}
sip_state_registration_t;
typedef enum tag_SIP_STATE
{
SS_UNKNOWN_UNKNOWN,

View File

@ -1,43 +1,73 @@
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include <assert.h>
#include "api_stack.h"
#include "api_engine.h"
#include <sofia-sip/auth_module.h>
#include <sofia-sip/su.h>
#define DEFAULT_USER_AGENT "IM-client/OMA1.0"
PREF_NAMESPACE_START
/* stack constructor */
stack::stack(int _id, nua_callback_f _callback)
/* global callback shared between all stacks*/
static void shared_callback(nua_event_t $event, int status, char const *phrase,
nua_t *nua, nua_magic_t *magic, nua_handle_t *nh,
nua_hmagic_t *hmagic, sip_t const *sip, tagi_t tags[])
{
if(!_callback) return;
GET_DIALOG_BY_HANDLE(((stack*)magic), dlg, nh);
if(dlg)
{
dlg->dialog_callback($event, status, phrase, nua, magic,
nh, hmagic, sip, tags);
}
else
{
}
//((stack*)magic)->callback_handle(event, status, phrase, nua, magic,
// nh, hmagic, sip, tags);
}
/**
Stack constructor
@param stack_id stack identifier
@param stack_callback stack callback function
*/
stack::stack(int stack_id)
{
/* check that no stack has the same id */
assert(!engine_stack_find(stack_id));
// initialize
this->id = _id;
this->callback = _callback;
this->id = stack_id;
this->initialized = false;
this->thread = NULL;
@ -55,45 +85,92 @@ stack::stack(int _id, nua_callback_f _callback)
/* Features */
smsip = true, oma_large_msg = true, oma_sip_im = true, gsma_is = true, gsma_vs = true;
/* Params */
expires = IMS_DEFAULT_EXIPRES;
// initialize memory handling
if( su_home_init(this->home) ) return;
/* add stack to the engine list */
if(!ERR_SUCCEED(engine_push_stack(this))) return;
this->initialized = true;
}
/* stack destructor */
/**
stack destructor
*/
stack::~stack()
{
if(this->thread) CloseHandle(this->thread);
}
/* run main loop for processing of messages */
/**
Runs main loop for processing of messages
@return returns ERR_SUCCESS if succeed and stack error code otherwise
*/
inline ERR stack::run()
{
ERR error = ERR_SUCCESS;
if(this->initialized && !this->running && !this->thread)
{
#ifdef WIN32
#ifdef WIN32 // FIXME: use pthread_cond + pthread_create
DWORD threadId;
this->thread = CreateThread(NULL, 0, ThreadRunner, this, 0, &threadId);
for(int i=0; i<5; i++)
{
if(this->running)
{
return ERR_SUCCESS;
}
if(this->running) break;
Sleep(1000);
}
return ERR_STACK_NOT_RUNNING;
}
#else
# error "must be implemented"
#endif
}
return (!this->initialized ? ERR_STACK_NOT_INITIALIZED : (this->running? ERR_STACK_ALREADY_EXIST : ERR_GLOBAL_FAILURE));
if(this->initialized && this->running)
{
/*
According to 3GPP TS 24.229 subcluse 5.1.1.1B when using an UE without ISIM or USIM we shall
assume that public identity, private identity and realm are provisioned.
I added the P-CSCF because without this information it's impossible to register
*/
error =
!this->public_id ? ERR_PARAMS_INVALID_PUBLIC_ID :
(!this->private_id ? ERR_PARAMS_INVALID_PRIVATE_ID :
((!this->pcscf || !this->pcscf_port) ? ERR_PARAMS_INVALID_PCSCF:
(!this->realm ? ERR_PARAMS_INVALID_REALM : error)));
if(!ERR_SUCCEED(error)) goto bail;
/* Proxy-CSCF */
char* pcscf_ip_port = su_sprintf(NULL, "sip:%s:%d", this->pcscf, this->pcscf_port);
nua_set_params(nua, NUTAG_PROXY(pcscf_ip_port), NUTAG_OUTBOUND("no-validate"), TAG_NULL());
su_free(NULL, pcscf_ip_port);
/* Public id */
nua_set_params(nua, NUTAG_IMPU(this->public_id), TAG_NULL());
/* Private id */
nua_set_params(nua, NUTAG_IMPI(this->private_id), TAG_NULL());
/* Realm: a home network domain name to address the SIP REGISTER request to */
nua_set_params(this->nua, NUTAG_REALM(this->realm), TAG_NULL());
}
bail:
if(!ERR_SUCCEED(error) && this->running)
{
this->shutdown();
}
return error;
}
/* shutdown the stack */
/**
shutdown the stack
@return
*/
inline ERR stack::shutdown()
{
if(this->running)
@ -114,7 +191,9 @@ inline ERR stack::shutdown()
}
}
/* event loop processing */
/**
event loop processing
*/
void stack::loop()
{
// initialize root object
@ -126,7 +205,7 @@ void stack::loop()
}
// create NUA stack
this->nua = nua_create(this->root, this->callback, this,
this->nua = nua_create(this->root, shared_callback, this,
NUTAG_USER_AGENT(DEFAULT_USER_AGENT),
NUTAG_PROXY("sip:127.0.0.1:5060"),
/* tags as necessary ...*/
@ -162,7 +241,9 @@ void stack::loop()
}
#ifdef WIN32
/* static threads runner*/
/**
static threads runner
*/
DWORD WINAPI stack::ThreadRunner( void* magic ) {
((stack*)magic)->loop();
@ -170,23 +251,5 @@ DWORD WINAPI stack::ThreadRunner( void* magic ) {
}
#endif
/* handle callback event*/
void stack::callback_handle(nua_event_t _event,
int status, char const *phrase,
nua_t *nua, nua_magic_t *magic,
nua_handle_t *nh, nua_hmagic_t *hmagic,
sip_t const *sip,
tagi_t tags[])
{
GET_DIALOG_BY_HANDLE(dlg, nh);
if(dlg)
{
dlg->dialog_callback(_event, status, phrase, nua, magic,
nh, hmagic, sip, tags);
}
else
{
}
}
PREF_NAMESPACE_END

View File

@ -1,47 +1,56 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_STACK_H__
#define __DOUBANGO_STACK_H__
#include "pref.h"
#include "api_errors.h"
#include "sip_dialog.h"
#include "fastdelegate2.h"
#include <sofia-sip/nua.h>
#include <list>
#include <algorithm>
PREF_NAMESPACE_START
/* generate setter and getter methods*/
#define DEFINE_GET_SET(type, member)\
#define DEFINE_GET_SET_STR(member)\
inline char* &get_##member(){ return this->##member; } \
inline void set_##member(const char* val){ \
if(this->##member) su_free(this->home, this->##member); \
this->##member = su_strdup(this->home, val); \
}
#define DEFINE_GET_SET_VAL(type, member)\
inline type &get_##member(){ return this->##member; } \
inline void set_##member(type val){ this->##member = val; }
/* predicate: find dialog by id */
struct pred_dialog_find_by_id: public std::binary_function< sip_dialog*, unsigned int, bool > {
bool operator () ( const sip_dialog* dlg, unsigned int dialog_id ) const {
@ -55,7 +64,7 @@ struct pred_dialog_find_by_handle: public std::binary_function< sip_dialog*, nua
}
};
/* predicate: find dialog by sipmethod */
struct pred_dialog_find_by_sipmethod: public std::binary_function< sip_dialog*, const char*, bool > {
struct pred_dialog_find_by_sipmethod: public std::binary_function< const sip_dialog*, const char*, bool > {
bool operator () ( const sip_dialog* dlg, const char* sipmethod ) const {
return !stricmp(dlg->get_sipmethod(), sipmethod);
}
@ -68,24 +77,27 @@ struct pred_dialog_find_by_sipmethod: public std::binary_function< sip_dialog*,
if(iter != this->dialogs.end()) dlg = *iter;
/* get dialog by xxx */
#define GET_DIALOG_BY_XXX(dlg, predicate, xxx) \
#define GET_DIALOG_BY_XXX(stk, dlg, predicate, xxx) \
sip_dialog* dlg = NULL; \
std::list<sip_dialog*>::iterator iter = std::find_if( this->dialogs.begin(), this->dialogs.end(), std::bind2nd( predicate(), xxx ) ); \
if(iter != this->dialogs.end()) dlg = *iter;
std::list<sip_dialog*>::iterator iter = std::find_if( stk->get_dialogs().begin(), stk->get_dialogs().end(), std::bind2nd( predicate(), xxx ) ); \
if(iter != stk->get_dialogs().end()) dlg = *iter;
/* get dialog by sipmethod*/
#define GET_DIALOG_BY_SIPMETHOD(dlg, sipmethod) GET_DIALOG_BY_XXX(dlg, pred_dialog_find_by_sipmethod, sipmethod)
#define GET_DIALOG_BY_SIPMETHOD(stk, dlg, sipmethod) GET_DIALOG_BY_XXX(stk, dlg, pred_dialog_find_by_sipmethod, sipmethod)
/* get dialog by handle */
#define GET_DIALOG_BY_HANDLE(dlg, handle) GET_DIALOG_BY_XXX(dlg, pred_dialog_find_by_handle, handle)
#define GET_DIALOG_BY_HANDLE(stk, dlg, handle) GET_DIALOG_BY_XXX(stk, dlg, pred_dialog_find_by_handle, handle)
/* get dialog by id */
#define GET_DIALOG_BY_ID(dlg, dialog_id) GET_DIALOG_BY_XXX(dlg, pred_dialog_find_by_id, dialog_id)
#define GET_DIALOG_BY_ID(stk, dlg, dialog_id) GET_DIALOG_BY_XXX(stk, dlg, pred_dialog_find_by_id, dialog_id)
class DOUBANGO_API stack
{
public:
stack(int id, nua_callback_f callback);
stack(int id);
~stack();
static ERR initialize();
static ERR deinitialize();
inline ERR run();
inline ERR shutdown();
@ -94,6 +106,7 @@ public:
inline bool get_initialized() const { return this->initialized; }
inline su_home_t* get_home() { return this->home; }
inline nua_t* get_nua() { return this->nua; }
inline std::list<sip_dialog*>& get_dialogs() { return this->dialogs; }
//
// SIP
@ -112,35 +125,39 @@ public:
//
// Authentication
//
DEFINE_GET_SET(char*, displayname);
DEFINE_GET_SET(char*, public_id);
DEFINE_GET_SET(char*, private_id);
DEFINE_GET_SET(char*, realm);
DEFINE_GET_SET(char*, password);
DEFINE_GET_SET(char*, privacy);
DEFINE_GET_SET(bool, early_ims);
DEFINE_GET_SET_STR(displayname);
DEFINE_GET_SET_STR(public_id);
DEFINE_GET_SET_STR(private_id);
DEFINE_GET_SET_STR(realm);
DEFINE_GET_SET_STR(password);
DEFINE_GET_SET_STR(privacy);
DEFINE_GET_SET_VAL(bool, early_ims);
//
// Network
//
DEFINE_GET_SET(char*, pcscf);
DEFINE_GET_SET(int, pcscf_port);
DEFINE_GET_SET_STR(pcscf);
DEFINE_GET_SET_VAL(int, pcscf_port);
//
// Features
//
DEFINE_GET_SET(bool, smsip);
DEFINE_GET_SET(bool, oma_large_msg);
DEFINE_GET_SET(bool, oma_sip_im);
DEFINE_GET_SET(bool, gsma_is);
DEFINE_GET_SET(bool, gsma_vs);
DEFINE_GET_SET_VAL(bool, smsip);
DEFINE_GET_SET_VAL(bool, oma_large_msg);
DEFINE_GET_SET_VAL(bool, oma_sip_im);
DEFINE_GET_SET_VAL(bool, gsma_is);
DEFINE_GET_SET_VAL(bool, gsma_vs);
void callback_handle(nua_event_t event,
int status, char const *phrase,
nua_t *nua, nua_magic_t *magic,
nua_handle_t *nh, nua_hmagic_t *hmagic,
sip_t const *sip,
tagi_t tags[]);
//
// Parameters
//
DEFINE_GET_SET_VAL(int, expires);
//
// Delegates
//
fastdelegate2::delegate<void (int stack_id, sip_state_registration_t state, int sipcode, const char* sipdesc)>registrationStateChanged;
private:
#ifdef WIN32
static DWORD WINAPI ThreadRunner( void* magic );
@ -152,7 +169,6 @@ private:
bool initialized;
bool running;
nua_callback_f callback;
void* thread;
std::list<sip_dialog*>dialogs;
@ -186,9 +202,14 @@ private:
bool oma_sip_im;
bool gsma_is;
bool gsma_vs;
//
// Parameters
//
int expires;
};
#undef DEFINE_GET_SET
#undef DEFINE_GET_SET_VAL
PREF_NAMESPACE_END

View File

@ -1,29 +1,30 @@
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "api_stack.h"
#include "sip_dialog_register.h"
#include "sip_dialog_message.h"
@ -32,10 +33,11 @@
PREF_NAMESPACE_START
/* SIP REGISTER*/
ERR stack::sip_register()
{
GET_DIALOG_BY_SIPMETHOD(dlg, "REGISTER");
GET_DIALOG_BY_SIPMETHOD(this, dlg, "REGISTER");
if(dlg){
return dlg->Start();
}
@ -49,7 +51,7 @@ ERR stack::sip_register()
/* SIP UNREGISTER */
ERR stack::sip_unregister()
{
GET_DIALOG_BY_SIPMETHOD(dlg, "REGISTER");
GET_DIALOG_BY_SIPMETHOD(this, dlg, "REGISTER");
if(dlg){
return dlg->Stop();
}
@ -67,7 +69,7 @@ ERR stack::sip_message(const char* dest_address, const char* content_type, const
/* SIP PUBLISH */
ERR stack::sip_publish()
{
GET_DIALOG_BY_SIPMETHOD(dlg, "PUBLISH");
GET_DIALOG_BY_SIPMETHOD(this, dlg, "PUBLISH");
if(dlg){
return dlg->Start();
}
@ -81,7 +83,7 @@ ERR stack::sip_publish()
/* SIP UNPUBLISH*/
ERR stack::sip_unpublish()
{
GET_DIALOG_BY_SIPMETHOD(dlg, "PUBLISH");
GET_DIALOG_BY_SIPMETHOD(this, dlg, "PUBLISH");
if(dlg){
return dlg->Stop();
}
@ -100,7 +102,7 @@ ERR stack::sip_subscribe(const char* dest_address, const char* eventpackg, const
/* SIP UNSUBSCRIBE*/
ERR stack::sip_unsubscribe(unsigned int dialog_id)
{
GET_DIALOG_BY_ID(dlg, dialog_id);
GET_DIALOG_BY_ID(this, dlg, dialog_id);
if(dlg){
return dlg->Stop();
}

View File

@ -1,26 +1,27 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_DOUBANGO_H__
#define __DOUBANGO_DOUBANGO_H__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,684 @@
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
/*
This code comes from http://www.rsdn.ru/forum/src/1712949.1.aspx
* I have made some changes for MinGW (GCC 4.4.0)
*/
#ifndef MULTICATDELEGATE_H
#define MULTICATDELEGATE_H
#include "FastDelegate.h"
#include <vector>
#include <algorithm>
#define DEFAULT_CRITICAL_SECTION fastdelegate2::dummy_section
using namespace fastdelegate;
namespace fastdelegate2
{
namespace detail
{
typedef fastdelegate::detail::DefaultVoid DefaultVoid;
}
class dummy_section
{
public:
void lock() const {}
void unlock() const {}
};
template<typename T>
class auto_cs_t
{
public:
auto_cs_t(const T& refcs) : m_refcs(refcs) { m_refcs.lock(); }
~auto_cs_t() { m_refcs.unlock(); }
private:
const T& m_refcs;
};
template<class RetType>
class default_slot
{
public:
template <typename F>
void operator() (const F& func)
{
vec_results.push_back(func());
}
const std::vector<RetType>& get_results() const
{
return vec_results;
}
private:
std::vector<RetType> vec_results;
};
template <>
class default_slot<detail::DefaultVoid>
{
public:
template <typename F>
void operator() (const F& func)
{
func();
}
};
namespace detail
{
template<class CritSect, class DelegateT>
class delegate_base
{
public:
typedef DelegateT holder_type;
delegate_base() {}
protected:
void connect_delegate(const holder_type& dlghld)
{
auto_cs_t<CritSect> lock(cs);
if (std::find(vec_subscribers.begin(), vec_subscribers.end(), dlghld) == vec_subscribers.end())
vec_subscribers.push_back(dlghld);
}
bool disconnect_delegate(const holder_type& dlghld)
{
auto_cs_t<CritSect> lock(cs);
typename std::vector<holder_type>::iterator iter = std::find(vec_subscribers.begin(), vec_subscribers.end(), dlghld);
if (iter != vec_subscribers.end())
{
vec_subscribers.erase(iter);
return true;
}
return false;
}
CritSect cs;
std::vector<holder_type> vec_subscribers;
};
template<class Param1, class RetType, class DelegateT>
struct caller1
{
caller1(const DelegateT& holder, Param1 param1) : dlgh(holder), p1(param1) {}
RetType operator() () const { return dlgh(p1); }
Param1 p1;
const DelegateT& dlgh;
};
template<class Param1, class Param2, class RetType, class DelegateT>
struct caller2
{
caller2(const DelegateT& holder, Param1 param1, Param2 param2) : dlgh(holder), p1(param1), p2(param2) {}
RetType operator() () const { return dlgh(p1, p2); }
Param1 p1; Param2 p2;
const DelegateT& dlgh;
};
template<class Param1, class Param2, class Param3, class RetType, class DelegateT>
struct caller3
{
caller3(const DelegateT& holder, Param1 param1, Param2 param2, Param3 param3) : dlgh(holder), p1(param1), p2(param2), p3(param3) {}
RetType operator() () const { return dlgh(p1, p2, p3); }
Param1 p1; Param2 p2; Param3 p3;
const DelegateT& dlgh;
};
template<class Param1, class Param2, class Param3, class Param4, class RetType, class DelegateT>
struct caller4
{
caller4(const DelegateT& holder, Param1 param1, Param2 param2, Param3 param3, Param4 param4) : dlgh(holder), p1(param1), p2(param2), p3(param3), p4(param4) {}
RetType operator() () const { return dlgh(p1, p2, p3, p4); }
Param1 p1; Param2 p2; Param3 p3; Param4 p4;
const DelegateT& dlgh;
};
template<class Param1, class Param2, class Param3, class Param4, class Param5, class RetType, class DelegateT>
struct caller5
{
caller5(const DelegateT& holder, Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5) : dlgh(holder), p1(param1), p2(param2), p3(param3), p4(param4), p5(param5) {}
RetType operator() () const { return dlgh(p1, p2, p3, p4, p5); }
Param1 p1; Param2 p2; Param3 p3; Param4 p4; Param5 p5;
const DelegateT& dlgh;
};
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class RetType, class DelegateT>
struct caller6
{
caller6(const DelegateT& holder, Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5, Param6 param6) : dlgh(holder), p1(param1), p2(param2), p3(param3), p4(param4), p5(param5), p6(param6) {}
RetType operator() () const { return dlgh(p1, p2, p3, p4, p5, p6); }
Param1 p1; Param2 p2; Param3 p3; Param4 p4; Param5 p5; Param6 p6;
const DelegateT& dlgh;
};
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class RetType, class DelegateT>
struct caller7
{
caller7(const DelegateT& holder, Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5, Param6 param6, Param7 param7) : dlgh(holder), p1(param1), p2(param2), p3(param3), p4(param4), p5(param5), p6(param6), p7(param7) {}
RetType operator() () const { return dlgh(p1, p2, p3, p4, p5, p6, p7); }
Param1 p1; Param2 p2; Param3 p3; Param4 p4; Param5 p5; Param6 p6; Param7 p7;
const DelegateT& dlgh;
};
} //detail namespace
template< class RetType=detail::DefaultVoid,
class CritSect = DEFAULT_CRITICAL_SECTION,
class SlotT=default_slot<RetType> >
class delegate0 :
detail::delegate_base< CritSect, FastDelegate0<RetType> >
{
public:
delegate0() {}
template < class X, class Y >
delegate0(const Y *pthis, RetType (X::* fn)() const)
{ connect_delegate(holder_type(pthis, fn)); }
template < class X, class Y >
delegate0(Y *pthis, RetType (X::* fn)())
{ connect_delegate(holder_type(pthis, fn)); }
delegate0(RetType (*fn)())
{ connect_delegate(holder_type(fn)); }
template < class X, class Y >
void connect(const Y *pthis, RetType (X::* fn)() const)
{ connect_delegate(holder_type(pthis, fn)); }
template < class X, class Y >
void connect(Y *pthis, RetType (X::* fn)())
{ connect_delegate(holder_type(pthis, fn)); }
void connect(RetType (*fn)())
{ connect_delegate(holder_type(fn)); }
template < class X, class Y >
bool disconnect(const Y *pthis, RetType (X::* fn)() const)
{ return disconnect_delegate(holder_type(pthis, fn)); }
template < class X, class Y >
bool disconnect(Y *pthis, RetType (X::* fn)())
{ return disconnect_delegate(holder_type(pthis, fn)); }
bool disconnect(RetType (*fn)())
{ return disconnect_delegate(holder_type(fn)); }
void operator() () const
{
auto_cs_t<CritSect> lock(this->cs);
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate0<RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) (*iter)();
}
SlotT invoke() const
{
auto_cs_t<CritSect> lock(this->cs);
SlotT slot;
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate0<RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) slot(*iter);
return slot;
}
};
template< class Param1,
class RetType=detail::DefaultVoid,
class CritSect = DEFAULT_CRITICAL_SECTION,
class SlotT=default_slot<RetType> >
class delegate1 :
detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >
{
public:
delegate1() {}
template < class X, class Y >
delegate1(const Y *pthis, RetType (X::* fn)(Param1 p1) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
delegate1(Y *pthis, RetType (X::* fn)(Param1 p1))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type(pthis, fn)); }
delegate1(RetType (*fn)(Param1 p1))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type(fn)); }
template < class X, class Y >
void connect(const Y *pthis, RetType (X::* fn)(Param1 p1) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
void connect(Y *pthis, RetType (X::* fn)(Param1 p1))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type(pthis, fn)); }
void connect(RetType (*fn)(Param1 p1))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type(fn)); }
template < class X, class Y >
bool disconnect(const Y *pthis, RetType (X::* fn)(Param1 p1) const)
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
bool disconnect(Y *pthis, RetType (X::* fn)(Param1 p1))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type(pthis, fn)); }
bool disconnect(RetType (*fn)(Param1 p1))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type(fn)); }
void operator() (Param1 p1) const
{
auto_cs_t<CritSect> lock(this->cs);
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) (*iter)(p1);
}
SlotT invoke(Param1 p1) const
{
auto_cs_t<CritSect> lock(this->cs);
SlotT slot;
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) slot(detail::caller1<Param1, RetType, typename detail::delegate_base< CritSect, FastDelegate1<Param1, RetType> >::holder_type>((*iter), p1));
return slot;
}
};
template< class Param1, class Param2,
class RetType=detail::DefaultVoid,
class CritSect = DEFAULT_CRITICAL_SECTION,
class SlotT=default_slot<RetType> >
class delegate2 :
detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >
{
public:
delegate2() {}
template < class X, class Y >
delegate2(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
delegate2(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type(pthis, fn)); }
delegate2(RetType (*fn)(Param1 p1, Param2 p2))
{ connect_delegate(holder_type(fn)); }
template < class X, class Y >
void connect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
void connect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type(pthis, fn)); }
void connect(RetType (*fn)(Param1 p1, Param2 p2))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type(fn)); }
template < class X, class Y >
bool disconnect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2) const)
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
bool disconnect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type(pthis, fn)); }
bool disconnect(RetType (*fn)(Param1 p1, Param2 p2))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type(fn)); }
void operator() (Param1 p1, Param2 p2) const
{
auto_cs_t<CritSect> lock(this->cs);
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) (*iter)(p1, p2);
}
SlotT invoke(Param1 p1, Param2 p2) const
{
auto_cs_t<CritSect> lock(this->cs);
SlotT slot;
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) slot(detail::caller2<Param1, Param2, RetType, typename detail::delegate_base< CritSect, FastDelegate2<Param1, Param2, RetType> >::holder_type>((*iter), p1, p2));
return slot;
}
};
template< class Param1, class Param2, class Param3,
class RetType=detail::DefaultVoid,
class CritSect = DEFAULT_CRITICAL_SECTION,
class SlotT=default_slot<RetType> >
class delegate3 :
detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >
{
public:
delegate3() {}
template < class X, class Y >
delegate3(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
delegate3(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type(pthis, fn)); }
delegate3(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type(fn)); }
template < class X, class Y >
void connect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
void connect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type(pthis, fn)); }
void connect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type(fn)); }
template < class X, class Y >
bool disconnect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3) const)
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
bool disconnect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type(pthis, fn)); }
bool disconnect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type(fn)); }
void operator() (Param1 p1, Param2 p2, Param3 p3) const
{
auto_cs_t<CritSect> lock(this->cs);
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) (*iter)(p1, p2, p3);
}
SlotT invoke(Param1 p1, Param2 p2, Param3 p3) const
{
auto_cs_t<CritSect> lock(this->cs);
SlotT slot;
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) slot(detail::caller3<Param1, Param2, Param3, RetType, typename detail::delegate_base< CritSect, FastDelegate3<Param1, Param2, Param3, RetType> >::holder_type>((*iter), p1, p2, p3));
return slot;
}
};
template< class Param1, class Param2, class Param3, class Param4,
class RetType=detail::DefaultVoid,
class CritSect = DEFAULT_CRITICAL_SECTION,
class SlotT=default_slot<RetType> >
class delegate4 :
detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >
{
public:
delegate4() {}
template < class X, class Y >
delegate4(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
delegate4(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type(pthis, fn)); }
delegate4(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type(fn)); }
template < class X, class Y >
void connect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
void connect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type(pthis, fn)); }
void connect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4))
{ connect_delegate(holder_type(fn)); }
template < class X, class Y >
bool disconnect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const)
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
bool disconnect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type(pthis, fn)); }
bool disconnect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type(fn)); }
void operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4) const
{
auto_cs_t<CritSect> lock(this->cs);
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) (*iter)(p1, p2, p3, p4);
}
SlotT invoke(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const
{
auto_cs_t<CritSect> lock(this->cs);
SlotT slot;
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) slot(detail::caller4<Param1, Param2, Param3, Param4, RetType, typename detail::delegate_base< CritSect, FastDelegate4<Param1, Param2, Param3, Param4, RetType> >::holder_type>((*iter), p1, p2, p3, p4));
return slot;
}
};
template< class Param1, class Param2, class Param3, class Param4, class Param5,
class RetType=detail::DefaultVoid,
class CritSect = DEFAULT_CRITICAL_SECTION,
class SlotT=default_slot<RetType> >
class delegate5 :
detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >
{
public:
delegate5() {}
template < class X, class Y >
delegate5(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
delegate5(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type(pthis, fn)); }
delegate5(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5))
{ connect_delegate(holder_type(fn)); }
template < class X, class Y >
void connect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
void connect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type(pthis, fn)); }
void connect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5))
{ connect_delegate(holder_type(fn)); }
template < class X, class Y >
bool disconnect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const)
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
bool disconnect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type(pthis, fn)); }
bool disconnect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type(fn)); }
void operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const
{
auto_cs_t<CritSect> lock(this->cs);
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) (*iter)(p1, p2, p3, p4, p5);
}
SlotT invoke(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const
{
auto_cs_t<CritSect> lock(this->cs);
SlotT slot;
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) slot(detail::caller5<Param1, Param2, Param3, Param4, Param5, RetType, typename detail::delegate_base< CritSect, FastDelegate5<Param1, Param2, Param3, Param4, Param5, RetType> >::holder_type>((*iter), p1, p2, p3, p4, p5));
return slot;
}
};
template< class Param1, class Param2, class Param3, class Param4, class Param5, class Param6,
class RetType=detail::DefaultVoid,
class CritSect = DEFAULT_CRITICAL_SECTION,
class SlotT=default_slot<RetType> >
class delegate6 :
detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >
{
public:
delegate6() {}
template < class X, class Y >
delegate6(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
delegate6(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type(pthis, fn)); }
delegate6(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type(fn)); }
template < class X, class Y >
void connect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
void connect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type(pthis, fn)); }
void connect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type(fn)); }
template < class X, class Y >
bool disconnect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const)
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
bool disconnect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type(pthis, fn)); }
bool disconnect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type(fn)); }
void operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const
{
auto_cs_t<CritSect> lock(this->cs);
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) (*iter)(p1, p2, p3, p4, p5, p6);
}
SlotT invoke(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const
{
auto_cs_t<CritSect> lock(this->cs);
SlotT slot;
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) slot(detail::caller6<Param1, Param2, Param3, Param4, Param5, Param6, RetType, typename detail::delegate_base< CritSect, FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, RetType> >::holder_type>((*iter), p1, p2, p3, p4, p5, p6));
return slot;
}
};
template< class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7,
class RetType=detail::DefaultVoid,
class CritSect = DEFAULT_CRITICAL_SECTION,
class SlotT=default_slot<RetType> >
class delegate7 :
detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >
{
public:
delegate7() {}
template < class X, class Y >
delegate7(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
delegate7(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type(pthis, fn)); }
delegate7(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7))
{ connect_delegate(holder_type(fn)); }
template < class X, class Y >
void connect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const)
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
void connect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type(pthis, fn)); }
void connect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7))
{ connect_delegate(typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type(fn)); }
template < class X, class Y >
bool disconnect(const Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const)
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type(pthis, fn)); }
template < class X, class Y >
bool disconnect(Y *pthis, RetType (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type(pthis, fn)); }
bool disconnect(RetType (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7))
{ return disconnect_delegate(typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type(fn)); }
void operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const
{
auto_cs_t<CritSect> lock(this->cs);
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) (*iter)(p1, p2, p3, p4, p5, p6, p7);
}
SlotT invoke(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const
{
auto_cs_t<CritSect> lock(this->cs);
SlotT slot;
typename std::vector<typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type>::const_iterator iter = this->vec_subscribers.begin();
for (;iter != this->vec_subscribers.end();++iter) slot(detail::caller7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType, typename detail::delegate_base< CritSect, FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, RetType> >::holder_type>((*iter), p1, p2, p3, p4, p5, p6, p7));
return slot;
}
};
template <typename Function> class delegate;
template <typename R>
class delegate< R () >
: public delegate0<R>
{
public:
typedef delegate0<R> base_type;
delegate() : base_type() {}
template < class X, class Y >
delegate(const Y *pthis, R (X::* fn)() const) : base_type(pthis, fn) {}
template < class X, class Y >
delegate(Y *pthis, R (X::* fn)()) : base_type(pthis, fn) {}
delegate(R (*fn)()) : base_type(fn) {}
};
template <typename R, class Param1>
class delegate< R (Param1) >
: public delegate1<Param1, R>
{
public:
typedef delegate1<Param1, R> base_type;
delegate() : base_type() {}
template < class X, class Y >
delegate(const Y *pthis, R (X::* fn)(Param1 p1) const) : base_type(pthis, fn) {}
template < class X, class Y >
delegate(Y *pthis, R (X::* fn)(Param1 p1)) : base_type(pthis, fn) {}
delegate(R (*fn)(Param1 p1)) : base_type(fn) {}
};
template <typename R, class Param1, class Param2>
class delegate< R (Param1, Param2) >
: public delegate2<Param1, Param2, R>
{
public:
typedef delegate2<Param1, Param2, R> base_type;
delegate() : base_type() {}
template < class X, class Y >
delegate(const Y *pthis, R (X::* fn)(Param1 p1, Param2 p2) const) : base_type(pthis, fn) {}
template < class X, class Y >
delegate(Y *pthis, R (X::* fn)(Param1 p1, Param2 p2)) : base_type(pthis, fn) {}
delegate(R (*fn)(Param1 p1, Param2 p2)) : base_type(fn) {}
};
template <typename R, class Param1, class Param2, class Param3>
class delegate< R (Param1, Param2, Param3) >
: public delegate3<Param1, Param2, Param3, R>
{
public:
typedef delegate3<Param1, Param2, Param3, R> base_type;
delegate() : base_type() {}
template < class X, class Y >
delegate(const Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3) const) : base_type(pthis, fn) {}
template < class X, class Y >
delegate(Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3)) : base_type(pthis, fn) {}
delegate(R (*fn)(Param1 p1, Param2 p2, Param3 p3)) : base_type(fn) {}
};
template <typename R, class Param1, class Param2, class Param3, class Param4>
class delegate< R (Param1, Param2, Param3, Param4) >
: public delegate4<Param1, Param2, Param3, Param4, R>
{
public:
typedef delegate4<Param1, Param2, Param3, Param4, R> base_type;
delegate() : base_type() {}
template < class X, class Y >
delegate(const Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const) : base_type(pthis, fn) {}
template < class X, class Y >
delegate(Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) : base_type(pthis, fn) {}
delegate(R (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) : base_type(fn) {}
};
template <typename R, class Param1, class Param2, class Param3, class Param4, class Param5>
class delegate< R (Param1, Param2, Param3, Param4, Param5) >
: public delegate5<Param1, Param2, Param3, Param4, Param5, R>
{
public:
typedef delegate5<Param1, Param2, Param3, Param4, Param5, R> base_type;
delegate() : base_type() {}
template < class X, class Y >
delegate(const Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const) : base_type(pthis, fn) {}
template < class X, class Y >
delegate(Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) : base_type(pthis, fn) {}
delegate(R (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) : base_type(fn) {}
};
template <typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6>
class delegate< R (Param1, Param2, Param3, Param4, Param5, Param6) >
: public delegate6<Param1, Param2, Param3, Param4, Param5, Param6, R>
{
public:
typedef delegate6<Param1, Param2, Param3, Param4, Param5, Param6, R> base_type;
delegate() : base_type() {}
template < class X, class Y >
delegate(const Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const) : base_type(pthis, fn) {}
template < class X, class Y >
delegate(Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) : base_type(pthis, fn) {}
delegate(R (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) : base_type(fn) {}
};
template <typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7>
class delegate< R (Param1, Param2, Param3, Param4, Param5, Param6, Param7) >
: public delegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, R>
{
public:
typedef delegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, R> base_type;
delegate() : base_type() {}
template < class X, class Y >
delegate(const Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const) : base_type(pthis, fn) {}
template < class X, class Y >
delegate(Y *pthis, R (X::* fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) : base_type(pthis, fn) {}
delegate(R (*fn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) : base_type(fn) {}
};
}
#endif /* MULTICATDELEGATE_H */

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_PREF_H__
#define __DOUBANGO_PREF_H__
@ -31,18 +32,23 @@
#define PREF_NAMESPACE_USE 1
#define PREF_NAMESPACE_VALUE dgo
/* doubango api funtions export */
/**
doubango api funtions export
*/
#if defined(WIN32) || defined(__SYMBIAN32__)
# ifdef DOUBANGO_EXPORTS
# define DOUBANGO_API __declspec(dllexport)
# define DOUBANGO_API_C extern "C" DOUBANGO_API
# else
# define DOUBANGO_API __declspec(dllimport)
# define DOUBANGO_API_C
# endif
#else
# define DOUBANGO_API
# define DOUBANGO_API_C
#endif
#ifdef __cplusplus
# define DOUBANGO_API_C extern "C" DOUBANGO_API
#else
# define DOUBANGO_API_C extern
#endif
/* disable warnings */
@ -51,7 +57,7 @@
#endif
/* namespace definition*/
#if PREF_NAMESPACE_USE
#if PREF_NAMESPACE_USE && defined(__cplusplus)
# define PREF_NAMESPACE_START namespace PREF_NAMESPACE_VALUE {
# define PREF_NAMESPACE_END }
#else
@ -59,4 +65,7 @@
# define PREF_NAMESPACE_END
#endif
/* 3GPP TS 24.229 subclause 5.1.1.2 e) */
#define IMS_DEFAULT_EXIPRES 600000
#endif /* __DOUBANGO_PREF_H__ */

View File

@ -1,29 +1,30 @@
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "sip_dialog.h"
#include "api_stack.h"
@ -49,11 +50,11 @@ sip_dialog::~sip_dialog()
}
/* called when dialog state change*/
void sip_dialog::OnStateChanged(SIP_STATE state)
/*void sip_dialog::OnStateChanged(SIP_STATE state)
{
this->state_current = state;
SU_DEBUG_3(("%s::OnStateChanged ==> %d\n", this->get_sipmethod(), state));
}
}*/
/* authenticate the supplied request*/
void sip_dialog::authenticate(nua_handle_t *nh, sip_t const *sip)

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_DIALOG_SM_H__
#define __DOUBANGO_DIALOG_SM_H__
@ -48,14 +49,14 @@ public:
inline nua_handle_t* get_handle() const{ return this->handle; }
inline void set_handle(nua_handle_t* h) { this->handle = h; }
inline SIP_STATE get_state_current() const{ return this->state_current; }
inline void set_state_current(SIP_STATE s) { this->state_current = s; }
//inline SIP_STATE get_state_current() const{ return this->state_current; }
//inline void set_state_current(SIP_STATE s) { this->state_current = s; }
inline unsigned int get_dialog_id() const{ return this->dialog_id; }
virtual ERR Start() = 0;
virtual ERR Stop() = 0;
virtual void OnStateChanged(SIP_STATE state);
//virtual void OnStateChanged(SIP_STATE state);
virtual inline const char* get_sipmethod()const = 0;
virtual inline bool get_terminated()const = 0;
virtual void dialog_callback(nua_event_t event,
@ -72,7 +73,7 @@ protected:
protected:
nua_handle_t* handle;
stack* stk;
SIP_STATE state_current;
//SIP_STATE state_current;
unsigned int dialog_id;
private:

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "sip_dialog_info.h"
PREF_NAMESPACE_START

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_DIALOG_INFO_SM_H__
#define __DOUBANGO_DIALOG_INFO_SM_H__

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "sip_dialog_invite.h"
PREF_NAMESPACE_START

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_DIALOG_INVITE_SM_H__
#define __DOUBANGO_DIALOG_INVITE_SM_H__

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "sip_dialog_message.h"
#include "api_stack.h"
@ -71,7 +72,7 @@ ERR sip_dialog_message::Stop()
/* dialog state changed */
void sip_dialog_message::OnStateChanged(SIP_STATE state)
{
sip_dialog::OnStateChanged(state);
//sip_dialog::OnStateChanged(state);
}
/* get sip method */
@ -100,7 +101,8 @@ ERR sip_dialog_message::sendMessage()
/* returns true if terminated and false otherwise*/
inline bool sip_dialog_message::get_terminated()const
{
return (this->state_current == SS_MESSAGE_TERMINATED);
return false;
//return (this->state_current == SS_MESSAGE_TERMINATED);
}
/* dialog callback */

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_DIALOG_MESSAGE_SM_H__
#define __DOUBANGO_DIALOG_MESSAGE_SM_H__

View File

@ -1,29 +1,30 @@
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "sip_dialog_options.h"
PREF_NAMESPACE_START

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_DIALOG_OPTIONS_SM_H__
#define __DOUBANGO_DIALOG_OPTIONS_SM_H__

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "sip_dialog_publish.h"
#include "api_stack.h"
@ -62,15 +63,16 @@ ERR sip_dialog_publish::Start()
/* stop */
ERR sip_dialog_publish::Stop()
{
ERR err = (this->state_current == SS_PUBLISH_ESTABLISHED) ?
this->sendUnpublish() : this->sendCancel();
return err;
//ERR err = (this->state_current == SS_PUBLISH_ESTABLISHED) ?
// this->sendUnpublish() : this->sendCancel();
//return err;
return ERR_NOT_IMPLEMENTED;
}
/* state changed */
void sip_dialog_publish::OnStateChanged(SIP_STATE state)
{
sip_dialog::OnStateChanged(state);
//sip_dialog::OnStateChanged(state);
#if 1
if(this->get_terminated())
{
@ -88,7 +90,8 @@ inline const char* sip_dialog_publish::get_sipmethod()const
/* returns true if terminated and false otherwise*/
inline bool sip_dialog_publish::get_terminated()const
{
return (this->state_current == SS_PUBLISH_TERMINATED);
//return (this->state_current == SS_PUBLISH_TERMINATED);
return false;
}
/* send SIP PUBLISH request */

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_DIALOG_PUBLISH_SM_H__
#define __DOUBANGO_DIALOG_PUBLISH_SM_H__

View File

@ -1,37 +1,39 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "sip_dialog_register.h"
#include "api_stack.h"
#include "strutils.h"
PREF_NAMESPACE_START
/* sip_dialog_register constructor*/
sip_dialog_register::sip_dialog_register(stack* stk)
:sip_dialog(stk),sm_ctx(*this)
:sip_dialog(stk),sm_ctx(*this), state_current(srs_none)
{
}
@ -42,13 +44,40 @@ sip_dialog_register::~sip_dialog_register()
// FIXME: destroy handle
}
/* start */
/**
Initialize default parameters for initial REGISTER request according to
3GPP TS 24.229 subclause 5.1.1.2.
*/
ERR sip_dialog_register::Start()
{
this->sm_ctx.enterStartState();
this->handle = nua_handle(this->stk->get_nua(), this->stk->get_home(),
SIPTAG_TO_STR(this->stk->get_realm()), TAG_END());
SIPTAG_FROM_STR(this->stk->get_public_id()),
SIPTAG_TO_STR(this->stk->get_public_id()),
//SIPTAG_TO_STR(this->stk->get_realm()),
NUTAG_M_DISPLAY(this->stk->get_displayname()),
SIPTAG_PRIVACY_STR(this->stk->get_privacy()),
SIPTAG_EXPIRES_STR(itoa(this->stk->get_expires()).c_str()),
NUTAG_OUTBOUND("no-options-keepalive"),
NUTAG_OUTBOUND("no-validate"),
NUTAG_EARLY_IMS(this->stk->get_early_ims()?1:0),
//NUTAG_KEEPALIVE(0),
//NUTAG_M_FEATURES("audio;expires=20;+g.3gpp.cs-voice"),
//NUTAG_M_USERNAME("FIXME"),
NUTAG_CALLEE_CAPS(0),
SIPTAG_SUPPORTED_STR("timer, precondition, path, replaces, 100rel, gruu, outbound"),
SIPTAG_EVENT_STR("registration"),
SIPTAG_ALLOW_EVENTS_STR("presence"),
//NUTAG_M_FEATURES("+g.3gpp.smsip;+g.3gpp.cs-voice"),
//TAG_IF(this->gsma_vs, NUTAG_M_FEATURES("+g.3gpp.cs-voice")),
TAG_END());
//su_free(NULL, features);
if(!this->handle)
{
@ -61,19 +90,23 @@ ERR sip_dialog_register::Start()
/* stop */
ERR sip_dialog_register::Stop()
{
ERR err = (this->state_current == SS_REGISTER_ESTABLISHED) ?
ERR err = (this->state_current == srs_registered) ?
this->sendUnregister() : this->sendCancel();
return err;
}
/* state changed */
void sip_dialog_register::OnStateChanged(SIP_STATE state)
void sip_dialog_register::OnStateChanged(sip_state_registration_t state)
{
sip_dialog::OnStateChanged(state);
this->state_current = state;
#if 0
if(this->get_terminated())
switch(state)
{
printf("REGISTER terminated\n");
case srs_none: printf("sip_dialog_register: %s\n", "srs_none"); break;
case srs_trying: printf("sip_dialog_register: %s\n", "srs_trying"); break;
case srs_authentifying: printf("sip_dialog_register: %s\n", "srs_authentifying"); break;
case srs_unregistered: printf("sip_dialog_register: %s\n", "srs_unregistered"); break;
case srs_registered: printf("sip_dialog_register: %s\n", "srs_registered"); break;
}
#endif
}
@ -87,41 +120,20 @@ inline const char* sip_dialog_register::get_sipmethod()const
/* returns true if terminated and false otherwise*/
inline bool sip_dialog_register::get_terminated()const
{
return (this->state_current == SS_REGISTER_TERMINATED);
return (this->state_current == srs_unregistered);
}
/* send SIP REGISTER request */
ERR sip_dialog_register::sendRegister()
{
if(!this->handle) return ERR_SIP_DIALOG_UNKNOWN;
/* register */
nua_register(this->handle, TAG_END());
// FIXME: secure
bool secure = false;
char* ims_default_auth = su_sprintf(NULL, "Digest username=\"%s\",realm=\"%s\",nonce=\"\",uri=\"%s:%s\",response=\"\"",
this->stk->get_private_id(), this->stk->get_realm(), secure?"sips":"sip",this->stk->get_realm());
nua_register(this->handle,
SIPTAG_PRIVACY_STR(this->stk->get_privacy()),
NUTAG_OUTBOUND("no-options-keepalive"),
NUTAG_OUTBOUND("no-validate"),
NUTAG_KEEPALIVE(0),
NUTAG_M_FEATURES("audio;expires=200;+g.3gpp.cs-voice"),// FIXME
NUTAG_M_USERNAME("FIXME"),
SIPTAG_FROM_STR(this->stk->get_public_id()),
SIPTAG_TO_STR(this->stk->get_public_id()),
NUTAG_CALLEE_CAPS(0),
SIPTAG_SUPPORTED_STR("timer, precondition, path, replaces, 100rel, gruu"),
SIPTAG_EVENT_STR("registration"),
SIPTAG_ALLOW_EVENTS_STR("presence"),
TAG_IF(!this->stk->get_early_ims(), SIPTAG_AUTHORIZATION_STR(ims_default_auth)), /* 3GPP TS 24.229. See section 5.1.1 */
//NUTAG_M_FEATURES("+g.3gpp.smsip;+g.3gpp.cs-voice"),
//TAG_IF(this->gsma_vs, NUTAG_M_FEATURES("+g.3gpp.cs-voice")),
TAG_END());
/* alert state machine */
this->sm_ctx.sm_registerSent();
su_free(NULL, ims_default_auth);
return ERR_SUCCESS;
}
@ -177,11 +189,19 @@ void sip_dialog_register::dialog_callback(nua_event_t _event,
else if(status<600) this->sm_ctx.sm_5xx_response();
else if(status<700) this->sm_ctx.sm_6xx_response();
else this->sm_ctx.sm_xxx_response();
//
// Alert all subscriber that the registration state has changed
//
this->stk->registrationStateChanged(this->stk->get_id(), this->state_current, status, phrase);
break;
}
default:
{
this->sm_ctx.sm_xxx_response();
this->stk->registrationStateChanged(this->stk->get_id(), this->state_current, status, phrase);
break;
}
}

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_DIALOG_REGISTER_SM_H__
#define __DOUBANGO_DIALOG_REGISTER_SM_H__
@ -44,7 +45,6 @@ public:
/* sip_dialog override*/
ERR Start();
ERR Stop();
void OnStateChanged(SIP_STATE state);
inline const char* get_sipmethod()const;
inline bool get_terminated()const;
void dialog_callback(nua_event_t event,
@ -53,12 +53,17 @@ public:
nua_handle_t *nh, nua_hmagic_t *hmagic,
sip_t const *sip,
tagi_t tags[]);
/* public methods */
inline void OnStateChanged(sip_state_registration_t state);
private:
ERR sendRegister();
ERR sendUnregister();
ERR sendCancel();
private:
sip_state_registration_t state_current;
sip_dialog_registerContext sm_ctx;
};

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "sip_dialog_subscribe.h"
#include "api_stack.h"
@ -67,15 +68,16 @@ ERR sip_dialog_subscribe::Start()
/* stop */
ERR sip_dialog_subscribe::Stop()
{
ERR err = (this->state_current == SS_SUBSCRIBE_ESTABLISHED) ?
this->sendUnsubscribe() : this->sendCancel();
return err;
//ERR err = (this->state_current == SS_SUBSCRIBE_ESTABLISHED) ?
// this->sendUnsubscribe() : this->sendCancel();
//return err;
return ERR_NOT_IMPLEMENTED;
}
/* state changed */
void sip_dialog_subscribe::OnStateChanged(SIP_STATE state)
{
sip_dialog::OnStateChanged(state);
//sip_dialog::OnStateChanged(state);
#if 1
if(this->get_terminated())
{
@ -93,7 +95,8 @@ inline const char* sip_dialog_subscribe::get_sipmethod()const
/* returns true if terminated and false otherwise*/
inline bool sip_dialog_subscribe::get_terminated()const
{
return (this->state_current == SS_SUBSCRIBE_TERMINATED);
return false;
//return (this->state_current == SS_SUBSCRIBE_TERMINATED);
}
/* send SIP SUBSCRIBE request */

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_DIALOG_SUBSCRIBE_SM_H__
#define __DOUBANGO_DIALOG_SUBSCRIBE_SM_H__

View File

@ -6,32 +6,33 @@
*/
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
#include "sip_dialog_info.h"

View File

@ -6,32 +6,33 @@
*/
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
#include "sip_dialog_invite.h"

View File

@ -6,32 +6,33 @@
*/
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
#include "sip_dialog_message.h"

View File

@ -6,32 +6,33 @@
*/
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
#include "sip_dialog_publish.h"

View File

@ -184,7 +184,7 @@ namespace dgo
{
sip_dialog_register& ctxt(context.getOwner());
ctxt.OnStateChanged(SS_REGISTER_INITIALIZED);
ctxt.OnStateChanged(srs_none);
return;
}
@ -203,7 +203,7 @@ namespace dgo
{
sip_dialog_register& ctxt(context.getOwner());
ctxt.OnStateChanged(SS_REGISTER_TRYING);
ctxt.OnStateChanged(srs_trying);
return;
}
@ -321,7 +321,7 @@ namespace dgo
{
sip_dialog_register& ctxt(context.getOwner());
ctxt.OnStateChanged(SS_REGISTER_ESTABLISHED);
ctxt.OnStateChanged(srs_registered);
return;
}
@ -396,7 +396,7 @@ namespace dgo
{
sip_dialog_register& ctxt(context.getOwner());
ctxt.OnStateChanged(SS_REGISTER_AUTHENTIFYING);
ctxt.OnStateChanged(srs_authentifying);
return;
}
@ -464,7 +464,7 @@ namespace dgo
{
sip_dialog_register& ctxt(context.getOwner());
ctxt.OnStateChanged(SS_REGISTER_TERMINATED);
ctxt.OnStateChanged(srs_unregistered);
return;
}

View File

@ -5,33 +5,34 @@
* from file : sm_dialog_subscribe.sm
*/
///****************************************************************************
// _ _
// | | | |
// _ | | ___ _ _| | _ ____ ____ ____ ___
// / || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
// ( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
// \____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
// (_____|
//
// Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
//
// This file is part of Open Source Doubango IMS Client Framework project.
//
// DOUBANGO is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOUBANGO is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DOUBANGO.
//****************************************************************************/
///**
//* @file
//* @author xxxyyyzzz <imsframework(at)gmail.com>
//* @version 1.0
//*
//* @section LICENSE
//*
//*
//* This file is part of Open Source Doubango IMS Client Framework project.
//*
//* DOUBANGO is free software: you can redistribute it and/or modify
//* it under the terms of the GNU General Public License as published by
//* the Free Software Foundation, either version 3 of the License, or
//* (at your option) any later version.
//*
//* DOUBANGO is distributed in the hope that it will be useful,
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//* GNU Lesser General Public License for more details.
//*
//* You should have received a copy of the GNU General Public License
//* along with DOUBANGO.
//*
//* @section DESCRIPTION
//*
//*
//*/
#include "sip_dialog_subscribe.h"

View File

@ -3,12 +3,12 @@ set SMC_HOME=%ROOT_DIR%\SMC_6_0_0
set SM_DIR=%ROOT_DIR%\doubango\sm
set SRC_DIR=%ROOT_DIR%\doubango\src
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_info.sm
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_invite.sm
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_message.sm
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_options.sm
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_publish.sm
rem java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_info.sm
rem java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_invite.sm
rem java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_message.sm
rem java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_options.sm
rem java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_publish.sm
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_register.sm
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_subscribe.sm
rem java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_subscribe.sm
pause

View File

@ -0,0 +1,39 @@
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "strutils.h"
#ifdef WIN32
# define snprintf _snprintf
#endif
std::string itoa(int64_t i){
char buffer[30]; memset(buffer, '\0', 30);
snprintf(buffer, 30, "%lld",i);
return std::string(buffer);
}

View File

@ -0,0 +1,39 @@
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#ifndef __DOUBANGO_STRUTILS_H__
#define __DOUBANGO_STRUTILS_H__
#include "pref.h"
#include <string>
#include <iostream>
#include <sofia-sip/su_types.h>
std::string itoa(int64_t i);
#endif /* __DOUBANGO_STRUTILS_H__ */

View File

@ -0,0 +1,418 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="robots" content="index,nofollow">
<title>gstreamer Wiki - GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment</title>
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="/moin/freedesktop/css/common.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" href="/moin/freedesktop/css/screen.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" href="/moin/freedesktop/css/print.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="projection" href="/moin/freedesktop/css/projection.css">
<!-- css only for MSIE browsers -->
<!--[if IE]>
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="/moin/freedesktop/css/msie.css">
<![endif]-->
<script type="text/javascript" src="/moin/common/js/common.js"></script>
<script type="text/javascript">
<!--
var search_hint = "Search";
//-->
</script>
<link rel="Start" href="/wiki/FrontPage">
<link rel="Alternate" title="Wiki Markup" href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=raw">
<link rel="Alternate" media="print" title="Print View" href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=print">
<link rel="Search" href="/wiki/FindPage">
<link rel="Index" href="/wiki/TitleIndex">
<link rel="Glossary" href="/wiki/WordIndex">
<link rel="Help" href="/wiki/HelpOnFormatting">
</head>
<body lang="en" dir="ltr">
<ul id="username"><li><a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=login" id="login" rel="nofollow">Login</a></li></ul>
<div id="logo"><a href="/wiki/FrontPage">gstreamer Wiki</a></div>
<table id="navtable" align=center border=0 cellpadding=0 cellspacing=0>
<tr height=12>
<td width=12 style="background-image: url(/png/ul.png); background-repeat: none; border: none;">
</td>
<td style="background-image: url(/png/t.png); background-repeat: repeat-x; border: none;">
</td>
<td width=12 style="background-image: url(/png/ur.png); background-repeat: none; border: none;">
</td>
</tr>
<tr>
<td width=12 style="background-image: url(/png/l.png); background-repeat: repeat-y; border: none;">
</td>
<td style="background-image: url(/png/bg.png); border: none;">
<a href="RecentChanges"><a href="/wiki/RecentChanges">RecentChanges</a></a>
<a href="FindPage"><a href="/wiki/FindPage">FindPage</a></a>
<a href="HelpContents"><a href="/wiki/HelpContents">HelpContents</a></a>
</td>
<td width=12 style="background-image: url(/png/r.png); background-repeat: repeat-y; border: none;">
</td>
</tr>
<tr height=12 style="font-size: 1pt">
<td width=12 style="border: none;"><img src="/png/ll.png"></td>
<td style="background-image: url(/png/b.png); background-repeat: repeat-x; border: none;">
</td>
<td width=12 style="border: none;"><img src="/png/lr.png"></td>
</tr>
</table>
<form id="searchform" method="get" action="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment">
<div>
<input type="hidden" name="action" value="fullsearch">
<input type="hidden" name="context" value="180">
<label for="searchinput">Search:</label>
<input id="searchinput" type="text" name="value" value="" size="20"
onfocus="searchFocus(this)" onblur="searchBlur(this)"
onkeyup="searchChange(this)" onchange="searchChange(this)" alt="Search">
<input id="titlesearch" name="titlesearch" type="submit"
value="Titles" alt="Search Titles">
<input id="fullsearch" name="fullsearch" type="submit"
value="Text" alt="Search Full Text">
</div>
</form>
<script type="text/javascript">
<!--// Initialize search form
var f = document.getElementById('searchform');
f.getElementsByTagName('label')[0].style.display = 'none';
var e = document.getElementById('searchinput');
searchChange(e);
searchBlur(e);
//-->
</script>
<div id="title"><h1>GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment</h1></div>
<ul id="iconbar">
<li><a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=edit" rel="nofollow" title="Edit"><img alt="Edit" height="12" src="/moin/freedesktop/img/moin-edit.png" title="Edit" width="12" /></a></li>
<li><a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment" rel="nofollow" title="View"><img alt="View" height="13" src="/moin/freedesktop/img/moin-show.png" title="View" width="12" /></a></li>
<li><a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=diff" rel="nofollow" title="Diffs"><img alt="Diffs" height="11" src="/moin/freedesktop/img/moin-diff.png" title="Diffs" width="15" /></a></li>
<li><a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=info" rel="nofollow" title="Info"><img alt="Info" height="11" src="/moin/freedesktop/img/moin-info.png" title="Info" width="12" /></a></li>
<li><a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=subscribe" rel="nofollow" title="Subscribe"><img alt="Subscribe" height="10" src="/moin/freedesktop/img/moin-subscribe.png" title="Subscribe" width="14" /></a></li>
<li><a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=raw" rel="nofollow" title="Raw"><img alt="Raw" height="13" src="/moin/freedesktop/img/moin-raw.png" title="Raw" width="12" /></a></li>
<li><a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=print" rel="nofollow" title="Print"><img alt="Print" height="14" src="/moin/freedesktop/img/moin-print.png" title="Print" width="16" /></a></li>
</ul>
<p style="clear: both;">
<div dir="ltr" id="content" lang="en"><span class="anchor" id="top"></span>
<span class="anchor" id="line-2"></span><span class="anchor" id="line-3"></span><p class="line867"><img alt="&lt;!&gt;" height="15" src="/moin/freedesktop/img/attention.png" title="&lt;!&gt;" width="15" /> A simpler method for cross compiling is described in <a href="/wiki/Win32_Cross_Compiling_With_Mingw">Win32_Cross_Compiling_With_Mingw</a>. <span class="anchor" id="line-4"></span><span class="anchor" id="line-5"></span><p class="line862">This document provides instructions for building native win32 gstreamer binaries. Specifically, it describes a method of using the MinGW cross compiler in chroot environment under debian linux<sup><a href="#fnref-593d3505d2c410341aa2efc9124339e5dd99528e" id="fndef-593d3505d2c410341aa2efc9124339e5dd99528e-0">1</a></sup>. <span class="anchor" id="line-6"></span><span class="anchor" id="line-7"></span><span class="anchor" id="line-8"></span><p class="line867"><div class="table-of-contents"><p class="table-of-contents-heading">Contents<ol><li><a href="#head-4c894c20e7645f000bc31244455c72b9231befb4">Motivation</a></li><li><a href="#head-10ec2aebef002de3f3bd024a75b577b1e8021693">Creating a chroot environment</a><ol><li><a href="#head-d37e14abb565e482c6f7e2f99b41e34eaa40f198">Create the Debian system</a></li><li><a href="#head-2da1e31cbb76e461640b91fb41274d32c82ed388">Install required packages on chroot system</a></li><li><a href="#head-e42e388662acf8a2a0559b33a6f7361a8094b95b">Move standard headers, libs, binutils out of the way</a></li><li><a href="#head-1f885de30af0404c0d98adabd0f9bff484a01afd">Setup normal user environment inside chroot</a></li></ol><li><a href="#head-605fd1ffd401a297bf7132ee12d04feb48622b78">Building 3rd party win32 repository</a><ol><li><a href="#head-5304168c588883f802534ff87a1260c76246898b">Initializing stow repository</a></li><li><a href="#head-2d8201d6345a44978aaaccf1a81c82e0f3dc4f0c">Install precompiled Win32 binaries</a><ol><li><a href="#head-2fe3eca5f96d66d1de50d3d05aeefd5ab0d653a9">Glib</a></li><li><a href="#head-64c466f0b40ef5c3b7241106ae6b1b7421644b4a">Iconv</a></li><li><a href="#head-ccf9c2a0c7443654ab9476fb07cf3e1b3be7a9b2">Gettext</a></li><li><a href="#head-26b6697d2793b23e2757bab0a1c65efb4a3e42e2">Directx headers</a></li></ol><li><a href="#head-0019b8a75bd2174dec7412393cb27c4ea48c71ec">Compile other 3rd party packages</a><ol><li><a href="#head-30541ffad6710aa6bc8ccf088bbc099cbc895b5a">Liboil</a></li><li><a href="#head-b23107886b0354c965d63529da8a8f51685886c6">Libxml2</a></li><li><a href="#head-91dce9cfef0393a6db213d48238bab6bd3a9b54e">Zlib</a></li><li><a href="#head-9e540b4a9a4fbf4093ba90a01ccba7730914f189">Libpng</a></li><li><a href="#head-4ef67d74f8103393d5c6b4b682e1f7a8690c8a7c">Libogg</a></li><li><a href="#head-c26ae587115b6ceea6b39531d9145b9e24dba8ae">Libvorbis</a></li><li><a href="#head-fb2d91eba7415b5f2e7085e8524ed44f8c30fb35">a52dec</a></li><li><a href="#head-d6629fd786b4fd33b7d7882b39a3190b59ed876e">mpeg2dec</a></li><li><a href="#head-c38daf1f7c16495e27de0cb6e30f8919d2a2b918">Libdvdread/Libdvdnav</a></li><li><a href="#head-eca21948694de3d0615f466d4977797851d6f7db">Libdvdcss</a></li></ol></li></ol><li><a href="#head-b7f33f3e30f49f6c283e79ae9163e482e2146177">Building gstreamer</a><ol><li><a href="#head-3a017b373282f6eba40ceafd8e3ef415ece71677">gstreamer</a></li><li><a href="#head-5f82ce01d674c98e07bec46732eb19a3e33cef8a">gst-plugins-base</a></li><li><a href="#head-af94b8930d738d42889cd975bb08ded55779fd7d">gst-plugins-good</a></li><li><a href="#head-2c3fa59b719602d055ac67c40e5aadded47386a1">gst-plugins-bad</a></li><li><a href="#head-ce3edf2b6fdb73e84e85a511a40b542ae734b340">gst-plugins-ugly</a></li></ol><li><a href="#head-978bffe7fb071833f835dac65b97b3a1fe63a1dd">Plugin specific build problems</a><ol><li><a href="#head-9f66975cce090098afd9d96362134e7b0d2a3ed5">directdraw, directsound</a></li><li><a href="#head-d618b5b4c1c045f08b0a28c91a8ec74fb3c551c0">dvdread</a></li><li><a href="#head-9b4e473a0b6f9fde7ac14f51ae9268c9040bee6c">a52</a></li></ol><li><a href="#head-464ce281dadea1a3fd833c8ec15345559267b69c">Testing</a><ol><li><a href="#head-a926d6a380722101b14eae8d023c55f8d312d657">Using wine</a></li><li><a href="#head-dd06d6a10420ca0a56d44a1f30edd582a433a061">On a real MS Windows machine</a></li></ol></li></ol></div> <span class="anchor" id="line-9"></span><span class="anchor" id="line-10"></span><p class="line867">
<h2 id="head-4c894c20e7645f000bc31244455c72b9231befb4">1. Motivation</h2>
<span class="anchor" id="line-11"></span><p class="line874">Building native win32 binaries can be acheived from the comfort of your Linux box by using the mingw cross compiler. I've found, however, that some of the autoconf macros will pick-up native Linux headers/libraries installed under /usr/local or /usr. By creating a gstreamer-cross-build chroot environment it is possible to prevent this kind of mix-up and obliterate the need to pass lots of --disable-xxx to the configure script for Here are instructions on how to cross-compile gstreamer on a Debian/Linux using the MinGW cross-compiler to create win32 binaries. <span class="anchor" id="line-12"></span>
<h2 id="head-10ec2aebef002de3f3bd024a75b577b1e8021693">2. Creating a chroot environment</h2>
<span class="anchor" id="line-13"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> You need to decide either to install mingw 3.4.5 compatible (such as debian <em>etch</em>) or the newer mingw32 4.2.1 (Ubuntu <em>hardy</em>) based system. You may also want to install both. See below. <span class="anchor" id="line-14"></span><span class="anchor" id="line-15"></span><p class="line867"><img alt="/!\" height="15" src="/moin/freedesktop/img/alert.png" title="/!\" width="15" /> The dvdreadsrc plugin compiled with mingw32 4.2.1 did not work for me (<a class="nonexistent" href="/wiki/TalShalif">TalShalif</a>), while the same compiled with mingw 3.4.5 worked fine (you can even copy the one you compiled on 3.4.5 to 4.2.1 and see either it will work for you too). <span class="anchor" id="line-16"></span>
<h3 id="head-d37e14abb565e482c6f7e2f99b41e34eaa40f198">2.1. Create the Debian system</h3>
<span class="anchor" id="line-17"></span><ol type="1"><li>Install debootstrap <span class="anchor" id="line-18"></span><span class="anchor" id="line-19"></span><pre>tanaka@linux&gt; sudo apt-get install debootstrap</pre><span class="anchor" id="line-20"></span><span class="anchor" id="line-21"></span></li><li class="gap">Create root file system <span class="anchor" id="line-22"></span><ul><li><p class="line862">Ubuntu <em>hardy</em> (mingw32 4.2.1) <span class="anchor" id="line-23"></span><span class="anchor" id="line-24"></span><pre>tanaka@linux&gt; sudo debootstrap hardy mingw-chroot</pre><span class="anchor" id="line-25"></span></li><li><p class="line862">Debian <em>etch</em> (mingw32 3.4.5) <span class="anchor" id="line-26"></span><span class="anchor" id="line-27"></span><pre>tanaka@linux&gt; sudo debootstrap etch mingw-chroot</pre><span class="anchor" id="line-28"></span></li></ul></li><li>(optional) Add shell chroot ID to avoid confusion <span class="anchor" id="line-29"></span><span class="anchor" id="line-30"></span><span class="anchor" id="line-31"></span><span class="anchor" id="line-32"></span><pre>root@linux&gt; sudo chroot mingw-chroot
root@linux# echo "gstreamer-mingw" &gt; /etc/debian_chroot
root@linux# exit</pre><span class="anchor" id="line-33"></span></li></ol><p class="line867">
<h3 id="head-2da1e31cbb76e461640b91fb41274d32c82ed388">2.2. Install required packages on chroot system</h3>
<span class="anchor" id="line-34"></span><p class="line867"><span class="anchor" id="line-35"></span><span class="anchor" id="line-36"></span><pre>tanaka@linux&gt; sudo chroot mingw-chroot</pre><span class="anchor" id="line-37"></span><ol type="1"><li>Update /etc/apt/source.list <span class="anchor" id="line-38"></span><ul><li><p class="line862">Ubuntu <em>hardy</em>: <span class="anchor" id="line-39"></span><span class="anchor" id="line-40"></span><span class="anchor" id="line-41"></span><span class="anchor" id="line-42"></span><span class="anchor" id="line-43"></span><span class="anchor" id="line-44"></span><pre># Binary
deb hardy main restricted universe multiverse
deb hardy-updates main restricted universe multiverse
deb hardy-security main restricted universe multiverse</pre><span class="anchor" id="line-45"></span></li><li><p class="line862">Debian <em>etch</em>: <span class="anchor" id="line-46"></span>{{{deb <a class="http" href="http://ftp.us.debian.org/debian">http://ftp.us.debian.org/debian</a> etch main contrib non-free <span class="anchor" id="line-47"></span></li></ul></li></ol><p class="line862">deb <a class="http" href="http://ftp.us.debian.org/debian">http://ftp.us.debian.org/debian</a> etch-proposed-updates main contrib non-free <span class="anchor" id="line-48"></span>}}} <span class="anchor" id="line-49"></span><ul><li style="list-style-type:none"><span class="anchor" id="line-50"></span><pre>(gstreamer-mingw)root@linux# apt-get update </pre><span class="anchor" id="line-51"></span><span class="anchor" id="line-52"></span></li><li class="gap">Install packages <span class="anchor" id="line-53"></span><ul><li><p class="line862">Ubuntu <em>hardy</em>: <span class="anchor" id="line-54"></span><span class="anchor" id="line-55"></span><pre>(gstreamer-mingw)root@linux# apt-get install mingw32 dpkg-dev pkg-config wget libglib2.0-dev language-pack-en tzdata unzip libtool automake autoconf m4 gettext cvs flex bison stow wine git-core subversion</pre><span class="anchor" id="line-56"></span></li><li><p class="line862">Debian <em>etch</em>: <span class="anchor" id="line-57"></span><span class="anchor" id="line-58"></span><span class="anchor" id="line-59"></span><pre>(gstreamer-mingw)root@linux# apt-get install mingw32 mingw32-binutils dpkg-dev pkg-config wget libglib2.0-dev bzip2 less tzdata unzip libtool automake autoconf m4 gettext cvs flex bison stow wine git-core subversion locales-all</pre><span class="anchor" id="line-60"></span><span class="anchor" id="line-61"></span></li></ul></li></ul><p class="line867"><img alt="&lt;!&gt;" height="15" src="/moin/freedesktop/img/attention.png" title="&lt;!&gt;" width="15" /> After completing the above steps, you may find it simpler to continue your compilation using David Schleef's script, as described in <a href="/wiki/Win32_Cross_Compiling_With_Mingw">Win32_Cross_Compiling_With_Mingw</a>. <span class="anchor" id="line-62"></span><span class="anchor" id="line-63"></span><p class="line867">
<h3 id="head-e42e388662acf8a2a0559b33a6f7361a8094b95b">2.3. Move standard headers, libs, binutils out of the way</h3>
<span class="anchor" id="line-64"></span><p class="line874">You don't want any of gstreamer's autoconfig macros to pick-up libraries nor headers installed on the system (i.e. /usr/lib, /usr/include): <span class="anchor" id="line-65"></span><span class="anchor" id="line-66"></span><ol type="1"><li>Move headers out of the way <span class="anchor" id="line-67"></span><span class="anchor" id="line-68"></span><pre>(gstreamer-mingw)root@linux# mkdir /usr/include/tmp &amp;&amp; mv /usr/include/* /usr/include/tmp</pre><span class="anchor" id="line-69"></span><span class="anchor" id="line-70"></span></li><li class="gap">Move away link libraries <span class="anchor" id="line-71"></span><span class="anchor" id="line-72"></span><pre>(gstreamer-mingw)root@linux# mkdir /usr/lib/tmp &amp;&amp; mv /usr/lib/*.{a,so} /usr/lib/tmp</pre><span class="anchor" id="line-73"></span>Against the standard practice of libxx.so.n, some runtime libraries are named libxx-n.n.so. Put them back: <span class="anchor" id="line-74"></span><span class="anchor" id="line-75"></span><span class="anchor" id="line-76"></span><pre>(gstreamer-mingw)root@linux# mv /usr/lib/tmp/*[0-9]*.so /usr/lib</pre><span class="anchor" id="line-77"></span>But, but.. except for glib libraries named libgxxx-2.0.so, which need to be moved away again: <span class="anchor" id="line-78"></span><span class="anchor" id="line-79"></span><pre>(gstreamer-mingw)root@linux# mv /usr/lib/libg*-2.0.so /usr/lib/tmp</pre><span class="anchor" id="line-80"></span></li><li>Replace native binutils executables with links to mingw tools <span class="anchor" id="line-81"></span><span class="anchor" id="line-82"></span><span class="anchor" id="line-83"></span><span class="anchor" id="line-84"></span><span class="anchor" id="line-85"></span><span class="anchor" id="line-86"></span><span class="anchor" id="line-87"></span><span class="anchor" id="line-88"></span><span class="anchor" id="line-89"></span><span class="anchor" id="line-90"></span><pre>cd /usr/bin
mkdir tmp
mv gcc ar ranlib as ld cc cpp tmp
for i in gcc ar ranlib as ld cc cpp; do \
ln -s i586-mingw32msvc-$i $i; \
done
ln -s i586-mingw32msvc-dlltool dlltool
ln -s i586-mingw32msvc-dllwrap dllwrap</pre><span class="anchor" id="line-91"></span><span class="anchor" id="line-92"></span></li></ol><p class="line867">
<h3 id="head-1f885de30af0404c0d98adabd0f9bff484a01afd">2.4. Setup normal user environment inside chroot</h3>
<span class="anchor" id="line-93"></span><p class="line874">Now you would want to be able to access your gstreamer development tree and/or home directory as a normal user from inside the chroot environment: <span class="anchor" id="line-94"></span><span class="anchor" id="line-95"></span><ol type="1"><li>Mount host home directory <span class="anchor" id="line-96"></span><span class="anchor" id="line-97"></span><pre>tanaka@linux&gt; sudo mount --bind /home mingw-chroot/home </pre><span class="anchor" id="line-98"></span><span class="anchor" id="line-99"></span></li><li class="gap"><p class="line862">Add/Synchronize linux host =&gt; chroot host user ID Assuming your real user name is 'tanaka' and your uid on the Linux host is 1000: <span class="anchor" id="line-100"></span><span class="anchor" id="line-101"></span><pre>(gstreamer-mingw)root@linux# useradd -d /home/tanaka -s /bin/bash -u 1000 tanaka</pre><span class="anchor" id="line-102"></span>Now you can log into your chroot system as user 'tanaka' thusly: <span class="anchor" id="line-103"></span><span class="anchor" id="line-104"></span><span class="anchor" id="line-105"></span><span class="anchor" id="line-106"></span><pre>tanaka@linux&gt; sudo chroot mingw-chroot su - tanaka
(gstreamer-mingw)tanaka@linux:~$ id
=&gt; uid=1000(tanaka) gid=1000(tanaka) groups=1000(tanaka)</pre><span class="anchor" id="line-107"></span></li></ol><p class="line867">
<h2 id="head-605fd1ffd401a297bf7132ee12d04feb48622b78">3. Building 3rd party win32 repository</h2>
<span class="anchor" id="line-108"></span><p class="line867">
<h3 id="head-5304168c588883f802534ff87a1260c76246898b">3.1. Initializing stow repository</h3>
<span class="anchor" id="line-109"></span><p class="line867"><span class="anchor" id="line-110"></span><pre>mkdir -p ~/win32/stow </pre><span class="anchor" id="line-111"></span><p class="line874">Make win32 repo available as /x on both the chroot environment as well as the real host. This will enable mapping ~tanaka/win32 to drive x: on a real windows machine. <span class="anchor" id="line-112"></span><span class="anchor" id="line-113"></span><span class="anchor" id="line-114"></span><span class="anchor" id="line-115"></span><pre>tanaka@linux&gt; sudo ln -s ~/win32 /x
(gstreamer-mingw)root@linux# ln -s ~tanaka/win32 /x</pre><span class="anchor" id="line-116"></span><p class="line867">
<h3 id="head-2d8201d6345a44978aaaccf1a81c82e0f3dc4f0c">3.2. Install precompiled Win32 binaries</h3>
<span class="anchor" id="line-117"></span><p class="line867"><span class="anchor" id="line-118"></span><span class="anchor" id="line-119"></span><pre>tanaka@linux&gt; cd /x/stow</pre><span class="anchor" id="line-120"></span><p class="line874">Download fromhttp://www.gtk.org/download-windows.htmland install the following: <span class="anchor" id="line-121"></span><span class="anchor" id="line-122"></span><p class="line867">
<h4 id="head-2fe3eca5f96d66d1de50d3d05aeefd5ab0d653a9">3.2.1. Glib</h4>
<span class="anchor" id="line-123"></span><p class="line867"><span class="anchor" id="line-124"></span><span class="anchor" id="line-125"></span><span class="anchor" id="line-126"></span><span class="anchor" id="line-127"></span><span class="anchor" id="line-128"></span><span class="anchor" id="line-129"></span><span class="anchor" id="line-130"></span><span class="anchor" id="line-131"></span><span class="anchor" id="line-132"></span><span class="anchor" id="line-133"></span><pre>cd /tmp
wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.16/glib-2.16.5.zip
wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.16/glib-dev-2.16.5.zip
mkdir -p /x/stow/glib-2.16.5
cd /x/stow/glib-2.16.5
unzip /tmp/glib-2.16.5.zip
unzip /tmp/glib-dev-2.16.5.zip
find -name "*\.pc" | xargs sed -i 's,^prefix=.*$,prefix=/x,'
cd /x/stow
stow glib-2.16.5</pre><span class="anchor" id="line-134"></span><p class="line867">
<h4 id="head-64c466f0b40ef5c3b7241106ae6b1b7421644b4a">3.2.2. Iconv</h4>
<span class="anchor" id="line-135"></span><p class="line867"><span class="anchor" id="line-136"></span><span class="anchor" id="line-137"></span><span class="anchor" id="line-138"></span><span class="anchor" id="line-139"></span><span class="anchor" id="line-140"></span><span class="anchor" id="line-141"></span><span class="anchor" id="line-142"></span><pre>cd /tmp
wget http://www.gimp.org/~tml/gimp/win32/libiconv-1.9.1.bin.woe32.zip
mkdir -p /x/stow/libiconv-1.9.1
cd /x/stow/libiconv-1.9.1
unzip /tmp/libiconv-1.9.1.bin.woe32.zip
cd /x/stow
stow libiconv-1.9.1</pre><span class="anchor" id="line-143"></span><p class="line867">
<h4 id="head-ccf9c2a0c7443654ab9476fb07cf3e1b3be7a9b2">3.2.3. Gettext</h4>
<span class="anchor" id="line-144"></span><p class="line867"><span class="anchor" id="line-145"></span><span class="anchor" id="line-146"></span><span class="anchor" id="line-147"></span><span class="anchor" id="line-148"></span><span class="anchor" id="line-149"></span><span class="anchor" id="line-150"></span><span class="anchor" id="line-151"></span><span class="anchor" id="line-152"></span><span class="anchor" id="line-153"></span><span class="anchor" id="line-154"></span><pre>cd /tmp/
wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip
wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-dev-0.17-1.zip
mkdir /x/stow/gettext-runtime-0.17-1
cd /x/stow/gettext-runtime-0.17-1
unzip /tmp/gettext-runtime-0.17-1.zip
unzip /tmp/gettext-runtime-dev-0.17-1.zip
cd /x/stow
stow gettext-runtime-0.17-1</pre><span class="anchor" id="line-155"></span><p class="line867">
<h4 id="head-26b6697d2793b23e2757bab0a1c65efb4a3e42e2">3.2.4. Directx headers</h4>
<span class="anchor" id="line-156"></span><ul><li>Install headers <span class="anchor" id="line-157"></span><span class="anchor" id="line-158"></span><span class="anchor" id="line-159"></span><span class="anchor" id="line-160"></span><span class="anchor" id="line-161"></span><span class="anchor" id="line-162"></span><pre>cd /tmp
wget http://www.lysator.liu.se/~peda/directx-headers/directx-headers-0.03.tar.gz
tar -C /x/stow -zxvf /tmp/directx-headers-0.03.tar.gz
cd /x/stow
stow directx-headers-0.03</pre><span class="anchor" id="line-163"></span></li><li>Fix small header compilation error <span class="anchor" id="line-164"></span><span class="anchor" id="line-165"></span><p class="line891"><img alt="&lt;!&gt;" height="15" src="/moin/freedesktop/img/attention.png" title="&lt;!&gt;" width="15" /> Patch will fail unless the following is copied as-is. <span class="anchor" id="line-166"></span><span class="anchor" id="line-167"></span><p class="line891"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> This change is trivial enough to modify by hand <span class="anchor" id="line-168"></span><span class="anchor" id="line-169"></span><span class="anchor" id="line-170"></span><span class="anchor" id="line-171"></span><span class="anchor" id="line-172"></span><span class="anchor" id="line-173"></span><span class="anchor" id="line-174"></span><span class="anchor" id="line-175"></span><span class="anchor" id="line-176"></span><span class="anchor" id="line-177"></span><span class="anchor" id="line-178"></span><span class="anchor" id="line-179"></span><span class="anchor" id="line-180"></span><span class="anchor" id="line-181"></span><span class="anchor" id="line-182"></span><span class="anchor" id="line-183"></span><span class="anchor" id="line-184"></span><pre>cd /x/stow/directx-headers-0.03/include
patch &lt;&lt;EOF
--- dsound.h 2008-07-31 17:43:23.000000000 +0300
+++ dsound.h 2008-07-31 16:51:58.000000000 +0300
@@ -1138,7 +1138,7 @@
#ifndef _IKsPropertySet_
#define _IKsPropertySet_
-typedef struct IKsPropertySet IKsPropertySet,*LPKSPROPERTYSET;
+typedef struct IKsPropertySet *LPKSPROPERTYSET;
DEFINE_GUID(IID_IKsPropertySet,0x31EFAC30,0x515C,0x11D0,0xA9,0xAA,0x00,0xAA,0x00,0x61,0xBE,0x93);
EOF</pre><span class="anchor" id="line-185"></span></li></ul><p class="line867">
<h3 id="head-0019b8a75bd2174dec7412393cb27c4ea48c71ec">3.3. Compile other 3rd party packages</h3>
<span class="anchor" id="line-186"></span><p class="line867"><img alt="{i}" height="16" src="/moin/freedesktop/img/icon-info.png" title="{i}" width="16" /> It probably won't hurt (?) to add -mthreads to CFLAGS of all compilations. Also, some net functions (e.g. <em>getaddrinfo()</em>) are only available if you set WindowsXP compilation compatibility: <span class="anchor" id="line-187"></span><span class="anchor" id="line-188"></span><span class="anchor" id="line-189"></span><pre>export CFLAGS='-mthreads -D_WIN32_WINNT=0x0501 -DWINVER=0x0501'</pre><span class="anchor" id="line-190"></span><p class="line867">
<h4 id="head-30541ffad6710aa6bc8ccf088bbc099cbc895b5a">3.3.1. Liboil</h4>
<span class="anchor" id="line-191"></span><p class="line867"><img alt="&lt;!&gt;" height="15" src="/moin/freedesktop/img/attention.png" title="&lt;!&gt;" width="15" /> There is a linking error compiling one of the examples. Use the '-k' flag to force compilation <span class="anchor" id="line-192"></span><span class="anchor" id="line-193"></span><span class="anchor" id="line-194"></span><span class="anchor" id="line-195"></span><span class="anchor" id="line-196"></span><span class="anchor" id="line-197"></span><span class="anchor" id="line-198"></span><span class="anchor" id="line-199"></span><span class="anchor" id="line-200"></span><span class="anchor" id="line-201"></span><span class="anchor" id="line-202"></span><span class="anchor" id="line-203"></span><span class="anchor" id="line-204"></span><span class="anchor" id="line-205"></span><pre>cd /tmp
wget http://liboil.freedesktop.org/download/liboil-0.3.15.tar.gz
tar zxvf liboil-0.3.15.tar.gz
cd liboil-0.3.15
./configure --prefix=/x --host=i586-mingw32msvc
make -k
rm -rf /tmp/liboil-0.3.15-dist
make -k install DESTDIR=/tmp/liboil-0.3.15-dist
(cd /x/stow &amp;&amp; stow -D liboil-0.3.15)
rm -rf /x/stow/liboil-0.3.15
mv /tmp/liboil-0.3.15-dist/x /x/stow/liboil-0.3.15
cd /x/stow
stow liboil-0.3.15</pre><span class="anchor" id="line-206"></span><p class="line867">
<h4 id="head-b23107886b0354c965d63529da8a8f51685886c6">3.3.2. Libxml2</h4>
<span class="anchor" id="line-207"></span><p class="line867"><span class="anchor" id="line-208"></span><span class="anchor" id="line-209"></span><span class="anchor" id="line-210"></span><span class="anchor" id="line-211"></span><span class="anchor" id="line-212"></span><span class="anchor" id="line-213"></span><span class="anchor" id="line-214"></span><span class="anchor" id="line-215"></span><span class="anchor" id="line-216"></span><span class="anchor" id="line-217"></span><pre>cd /tmp
wget ftp://xmlsoft.org/libxml2/libxml2-2.6.31.tar.gz
tar zxvf libxml2-2.6.31.tar.gz
cd libxml-2.6.31
./configure --prefix=/x --host=i586-mingw32msvc
make
make install DESTDIR=/tmp/libxml2-2.6.31-dist
mv /tmp/libxml2-2.6.31-dist/x /x/stow/libxml2-2.6.31
cd /x/stow/
stow libxml2-2.6.31</pre><span class="anchor" id="line-218"></span><p class="line867">
<h4 id="head-91dce9cfef0393a6db213d48238bab6bd3a9b54e">3.3.3. Zlib</h4>
<span class="anchor" id="line-219"></span><ol type="1"><li>Get source <span class="anchor" id="line-220"></span><span class="anchor" id="line-221"></span><span class="anchor" id="line-222"></span><span class="anchor" id="line-223"></span><span class="anchor" id="line-224"></span><span class="anchor" id="line-225"></span><pre>cd /tmp
wget http://www.gzip.org/zlib/zlib-1.2.3.tar.gz
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3</pre><span class="anchor" id="line-226"></span></li><li>Configure <span class="anchor" id="line-227"></span><p class="line891"><img alt="{i}" height="16" src="/moin/freedesktop/img/icon-info.png" title="{i}" width="16" /> Zlib does not use automake/libtool <span class="anchor" id="line-228"></span><span class="anchor" id="line-229"></span><p class="line891"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> We can create and use a cross-compile libtool script doing the following: <span class="anchor" id="line-230"></span><span class="anchor" id="line-231"></span><span class="anchor" id="line-232"></span><span class="anchor" id="line-233"></span><span class="anchor" id="line-234"></span><span class="anchor" id="line-235"></span><span class="anchor" id="line-236"></span><span class="anchor" id="line-237"></span><span class="anchor" id="line-238"></span><span class="anchor" id="line-239"></span><span class="anchor" id="line-240"></span><span class="anchor" id="line-241"></span><span class="anchor" id="line-242"></span><pre>cat &gt; configure.ac &lt;&lt;EOF
AC_INIT(zlib, 1.2.3)
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
EOF
libtoolize
aclocal
autoconf
touch install.sh
./configure --prefix=/x --host=i586-mingw32msvc</pre><span class="anchor" id="line-243"></span></li><li>build <span class="anchor" id="line-244"></span><p class="line862">The above would have craeted a <em>libtool</em> script which we will use to build zlib: <span class="anchor" id="line-245"></span><span class="anchor" id="line-246"></span><span class="anchor" id="line-247"></span><span class="anchor" id="line-248"></span><span class="anchor" id="line-249"></span><span class="anchor" id="line-250"></span><pre>for i in adler32 compress crc32 deflate gzio infback inffast inflate inftrees trees uncompr zutil; do \
./libtool --mode=compile --tag=CC i586-mingw32msvc-gcc -O3 -Wall -mthreads -c -o $i.lo $i.c; \
done
./libtool --tag=CC --mode=link i586-mingw32msvc-gcc -version-info 1 -mthreads -o libz.la -rpath /x/lib -module -no-undefined *.lo</pre><span class="anchor" id="line-251"></span></li><li>install <span class="anchor" id="line-252"></span>Manually install required files: <span class="anchor" id="line-253"></span><span class="anchor" id="line-254"></span><span class="anchor" id="line-255"></span><span class="anchor" id="line-256"></span><span class="anchor" id="line-257"></span><span class="anchor" id="line-258"></span><span class="anchor" id="line-259"></span><span class="anchor" id="line-260"></span><pre>mkdir -p /x/stow/zlib-1.2.3/{bin,lib,include}
./libtool --mode=install /usr/bin/install -c libz.la /x/stow/zlib-1.2.3/lib/libz.la
(cd /x/stow/zlib-1.2.3/bin &amp;&amp; ln -s ../lib/*.dll .)
cp zlib.h zconf.h /x/stow/zlib-1.2.3/include
cd /x/stow
stow zlib-1.2.3</pre><span class="anchor" id="line-261"></span></li></ol><p class="line867">
<h4 id="head-9e540b4a9a4fbf4093ba90a01ccba7730914f189">3.3.4. Libpng</h4>
<span class="anchor" id="line-262"></span><p class="line867"><span class="anchor" id="line-263"></span><span class="anchor" id="line-264"></span><span class="anchor" id="line-265"></span><span class="anchor" id="line-266"></span><span class="anchor" id="line-267"></span><span class="anchor" id="line-268"></span><span class="anchor" id="line-269"></span><span class="anchor" id="line-270"></span><span class="anchor" id="line-271"></span><span class="anchor" id="line-272"></span><span class="anchor" id="line-273"></span><pre>cd /tmp
wget http://prdownloads.sourceforge.net/libpng/libpng-1.2.29.tar.bz2
tar jxvf libpng-1.2.29.tar.bz2
cd libpng-1.2.29
LDFLAGS=-L/x/lib CFLAGS=-I/x/include PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc
make
make -k install DESTDIR=/tmp/libpng-1.2.29-dist
mv /tmp/libpng-1.2.29-dist/x/ /x/stow/libpng-1.2.29
cd /x/stow/
stow libpng-1.2.29</pre><span class="anchor" id="line-274"></span><p class="line867">
<h4 id="head-4ef67d74f8103393d5c6b4b682e1f7a8690c8a7c">3.3.5. Libogg</h4>
<span class="anchor" id="line-275"></span><p class="line867"><img alt="/!\" height="15" src="/moin/freedesktop/img/alert.png" title="/!\" width="15" /> Could not compile under mingw 3.4.5 <span class="anchor" id="line-276"></span><span class="anchor" id="line-277"></span><span class="anchor" id="line-278"></span><span class="anchor" id="line-279"></span><span class="anchor" id="line-280"></span><span class="anchor" id="line-281"></span><span class="anchor" id="line-282"></span><span class="anchor" id="line-283"></span><span class="anchor" id="line-284"></span><span class="anchor" id="line-285"></span><span class="anchor" id="line-286"></span><pre>cd /tmp
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar zxvf libogg-1.1.3.tar.gz
cd libogg-1.1.3
./configure --prefix=/x --host=i586-mingw32msvc
make
make install DESTDIR=/tmp/libogg-1.1.3-dist
mv /tmp/libogg-1.1.3-dist/x /x/stow/libogg-1.1.3
cd /x/stow
stow libogg-1.1.3</pre><span class="anchor" id="line-287"></span><p class="line867">
<h4 id="head-c26ae587115b6ceea6b39531d9145b9e24dba8ae">3.3.6. Libvorbis</h4>
<span class="anchor" id="line-288"></span><p class="line867"><span class="anchor" id="line-289"></span><span class="anchor" id="line-290"></span><span class="anchor" id="line-291"></span><span class="anchor" id="line-292"></span><span class="anchor" id="line-293"></span><span class="anchor" id="line-294"></span><span class="anchor" id="line-295"></span><span class="anchor" id="line-296"></span><span class="anchor" id="line-297"></span><pre>cd /tmp
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
cd libvorbis-1.2.0
PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc
make LDFLAGS='-L/x/lib -logg' -k
make LDFLAGS='-L/x/lib -logg' -k install DESTDIR=/tmp/libvorbis-1.2.0-dist
mv /tmp/libvorbis-1.2.0-dist/x /x/stow/libvorbis-1.2.0
cd /x/stow
stow libvorbis-1.2.0</pre><span class="anchor" id="line-298"></span><p class="line867">
<h4 id="head-fb2d91eba7415b5f2e7085e8524ed44f8c30fb35">3.3.7. a52dec</h4>
<span class="anchor" id="line-299"></span><ul><li>Get source <span class="anchor" id="line-300"></span><span class="anchor" id="line-301"></span><span class="anchor" id="line-302"></span><span class="anchor" id="line-303"></span><span class="anchor" id="line-304"></span><pre>cd /tmp
wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
tar zxvf a52dec-0.7.4.tar.gz
cd a52dec-0.7.4</pre><span class="anchor" id="line-305"></span></li><li>To create a shared DLL you need to update configure using the latest autotools <span class="anchor" id="line-306"></span><span class="anchor" id="line-307"></span><span class="anchor" id="line-308"></span><span class="anchor" id="line-309"></span><span class="anchor" id="line-310"></span><span class="anchor" id="line-311"></span><pre>autoheader
aclocal
libtoolize --force
autoconf
automake --add-missing</pre><span class="anchor" id="line-312"></span></li><li>Then run configure as usual: <span class="anchor" id="line-313"></span><span class="anchor" id="line-314"></span><span class="anchor" id="line-315"></span><span class="anchor" id="line-316"></span><span class="anchor" id="line-317"></span><span class="anchor" id="line-318"></span><span class="anchor" id="line-319"></span><pre>PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc --enable-shared
make
make install DESTDIR=/tmp/a52dec-0.7.4-dist
mv /tmp/a52dec-0.7.4-dist/x /x/stow/a52dec-0.7.4
cd /x/stow
stow a52dec-0.7.4 </pre><span class="anchor" id="line-320"></span></li></ul><p class="line867">
<h4 id="head-d6629fd786b4fd33b7d7882b39a3190b59ed876e">3.3.8. mpeg2dec</h4>
<span class="anchor" id="line-321"></span><p class="line867"><span class="anchor" id="line-322"></span><span class="anchor" id="line-323"></span><span class="anchor" id="line-324"></span><span class="anchor" id="line-325"></span><span class="anchor" id="line-326"></span><span class="anchor" id="line-327"></span><span class="anchor" id="line-328"></span><span class="anchor" id="line-329"></span><span class="anchor" id="line-330"></span><span class="anchor" id="line-331"></span><span class="anchor" id="line-332"></span><pre>cd /tmp/
wget http://libmpeg2.sourceforge.net/files/libmpeg2-0.5.1.tar.gz
tar zxvf libmpeg2-0.5.1.tar.gz
cd libmpeg2-0.5.1
PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc --enable-shared
make
make install DESTDIR=/tmp/libmpeg2-0.5.1-dist
mv /tmp/libmpeg2-0.5.1-dist/x /x/stow/libmpeg2-0.5.1
cd /x/stow/
stow libmpeg2-0.5.1</pre><span class="anchor" id="line-333"></span><p class="line867">
<h4 id="head-c38daf1f7c16495e27de0cb6e30f8919d2a2b918">3.3.9. Libdvdread/Libdvdnav</h4>
<span class="anchor" id="line-334"></span><p class="line867"><img alt="/!\" height="15" src="/moin/freedesktop/img/alert.png" title="/!\" width="15" /> There are some problems compiling/linking against libdvdread on mingw32 4.2.1 (<a class="nonexistent" href="/wiki/TalShalif">TalShalif</a>). <span class="anchor" id="line-335"></span><span class="anchor" id="line-336"></span><p class="line867"><img alt="{i}" height="16" src="/moin/freedesktop/img/icon-info.png" title="{i}" width="16" /> libdvdnav contains a copy of libdvdread. The latest libdvdnav from mplayer seems to include also all the latest dvdread patches. It also does not hard-code dependancy on libdvdcss. <span class="anchor" id="line-337"></span><span class="anchor" id="line-338"></span><p class="line867"><img alt="&lt;!&gt;" height="15" src="/moin/freedesktop/img/attention.png" title="&lt;!&gt;" width="15" /> use <em>make -k</em> due to link error in an unused library <span class="anchor" id="line-339"></span><span class="anchor" id="line-340"></span><span class="anchor" id="line-341"></span><span class="anchor" id="line-342"></span><span class="anchor" id="line-343"></span><span class="anchor" id="line-344"></span><span class="anchor" id="line-345"></span><span class="anchor" id="line-346"></span><span class="anchor" id="line-347"></span><span class="anchor" id="line-348"></span><span class="anchor" id="line-349"></span><span class="anchor" id="line-350"></span><span class="anchor" id="line-351"></span><pre>cd /tmp
wget http://www7.mplayerhq.hu/MPlayer/releases/dvdnav/libdvdnav-4.1.2.tar.gz
tar zxvf libdvdnav-4.1.2.tar.gz
cd libdvdnav-4.1.2
./autogen.sh noconfig
PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc
make -k
make -k install DESTDIR=/tmp/libdvdnav-4.1.2-dist
mv /tmp/libdvdnav-4.1.2-dist/x /x/stow/libdvdnav-4.1.2
cd /x/stow
stow libdvdnav-4.1.2</pre><span class="anchor" id="line-352"></span><p class="line867">
<h4 id="head-eca21948694de3d0615f466d4977797851d6f7db">3.3.10. Libdvdcss</h4>
<span class="anchor" id="line-353"></span><p class="line867"><img alt="{i}" height="16" src="/moin/freedesktop/img/icon-info.png" title="{i}" width="16" /> There is no compilation-time dependancy on libdvdcss. However, libdvdread looks for a runtime DLL <em>libdvdcss.dll</em> in order to read encrypted DVDs <span class="anchor" id="line-354"></span><ol type="1"><li>Download and upack code <span class="anchor" id="line-355"></span><span class="anchor" id="line-356"></span><span class="anchor" id="line-357"></span><span class="anchor" id="line-358"></span><span class="anchor" id="line-359"></span><pre>cd /tmp
wget http://download.videolan.org/pub/libdvdcss/1.2.9/libdvdcss-1.2.9.tar.bz2
tar jxvf libdvdcss-1.2.9.tar.bz2</pre><span class="anchor" id="line-360"></span></li><li>Configure <span class="anchor" id="line-361"></span><span class="anchor" id="line-362"></span><span class="anchor" id="line-363"></span><span class="anchor" id="line-364"></span><pre>cd libdvdcss-1.2.9
PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc --enable-shared</pre><span class="anchor" id="line-365"></span></li><li>Force creation of a DLL using our libtool hack <span class="anchor" id="line-366"></span><span class="anchor" id="line-367"></span><span class="anchor" id="line-368"></span><span class="anchor" id="line-369"></span><pre>sed -i 's,build_libtool_libs=no,build_libtool_libs=yes,' libtool
make</pre><span class="anchor" id="line-370"></span></li><li>Install <span class="anchor" id="line-371"></span><span class="anchor" id="line-372"></span><span class="anchor" id="line-373"></span><span class="anchor" id="line-374"></span><pre>make install DESTDIR=/tmp/libdvdcss-1.2.9-dist
mv /tmp/libdvdcss-1.2.9-dist/x /x/stow/libdvdcss-1.2.9</pre><span class="anchor" id="line-375"></span></li><li><p class="line862">crete <em>libdvdcss.dll</em>: <span class="anchor" id="line-376"></span><span class="anchor" id="line-377"></span><span class="anchor" id="line-378"></span><span class="anchor" id="line-379"></span><pre>cd /x/stow/libdvdcss-1.2.9/bin
ln -s libdvdcss-2.dll libdvdcss.dll</pre><span class="anchor" id="line-380"></span></li><li>stow <span class="anchor" id="line-381"></span><span class="anchor" id="line-382"></span><span class="anchor" id="line-383"></span><span class="anchor" id="line-384"></span><pre>cd /x/stow
stow libdvdcss-1.2.9</pre><span class="anchor" id="line-385"></span></li></ol><p class="line867">
<h2 id="head-b7f33f3e30f49f6c283e79ae9163e482e2146177">4. Building gstreamer</h2>
<span class="anchor" id="line-386"></span><p class="line867"><img alt="{i}" height="16" src="/moin/freedesktop/img/icon-info.png" title="{i}" width="16" /> If you want gstreamer's net features, you would need to set WindowsXP compilation compatibility. Put: <span class="anchor" id="line-387"></span><ul><li style="list-style-type:none"><span class="anchor" id="line-388"></span><span class="anchor" id="line-389"></span><pre>export CFLAGS='-mthreads -D_WIN32_WINNT=0x0501 -DWINVER=0x0501'</pre><span class="anchor" id="line-390"></span><p class="line862">before running the <em>configure</em> script under the chroot environment <span class="anchor" id="line-391"></span><span class="anchor" id="line-392"></span></li></ul><p class="line867"><img alt="&lt;!&gt;" height="15" src="/moin/freedesktop/img/attention.png" title="&lt;!&gt;" width="15" /> The chroot environment should really be used only to cross-compile gstreamer. Develop and manage your gstreamer sources under your home directory and chroot into 'gstreamer-mingw' only to run 'configure' and 'make' to build and install. If you have not done so already, on the <strong>linux host</strong>, get the gstreamer source and generate the configuration script under each component. For example: <span class="anchor" id="line-393"></span><span class="anchor" id="line-394"></span><ul><li>Get source <span class="anchor" id="line-395"></span><span class="anchor" id="line-396"></span><span class="anchor" id="line-397"></span><span class="anchor" id="line-398"></span><span class="anchor" id="line-399"></span><span class="anchor" id="line-400"></span><span class="anchor" id="line-401"></span><span class="anchor" id="line-402"></span><span class="anchor" id="line-403"></span><pre>mkdir -p ~/src/gstreamer-dev
cd ~/src/gstreamer-dev
cvs -d :pserver:anoncvs@anoncvs.freedesktop.org:/cvs/gstreamer co gstreamer
cvs -d :pserver:anoncvs@anoncvs.freedesktop.org:/cvs/gstreamer co gst-plugins-base
cvs -d :pserver:anoncvs@anoncvs.freedesktop.org:/cvs/gstreamer co gst-plugins-good
cvs -d :pserver:anoncvs@anoncvs.freedesktop.org:/cvs/gstreamer co gst-plugins-bad
cvs -d :pserver:anoncvs@anoncvs.freedesktop.org:/cvs/gstreamer co gst-plugins-ugly</pre><span class="anchor" id="line-404"></span></li><li>Generate the configure script <span class="anchor" id="line-405"></span><span class="anchor" id="line-406"></span><span class="anchor" id="line-407"></span><span class="anchor" id="line-408"></span><span class="anchor" id="line-409"></span><span class="anchor" id="line-410"></span><span class="anchor" id="line-411"></span><pre>cd ~/src/gstreamer-dev/
(cd gstreamer &amp;&amp; NOCONFIGURE=1 ./autogen.sh)
(cd gst-plugins-base &amp;&amp; NOCONFIGURE=1 ./autogen.sh)
(cd gst-plugins-good &amp;&amp; NOCONFIGURE=1 ./autogen.sh)
(cd gst-plugins-bad &amp;&amp; NOCONFIGURE=1 ./autogen.sh)
(cd gst-plugins-ugly &amp;&amp; NOCONFIGURE=1 ./autogen.sh)</pre><span class="anchor" id="line-412"></span></li></ul><p class="line867">
<h3 id="head-3a017b373282f6eba40ceafd8e3ef415ece71677">4.1. gstreamer</h3>
<span class="anchor" id="line-413"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> gstreamer and gst-* have <em>-Werror</em> in CFLAGS, so some win32-specific compilation warnings will cause make to fail. You can try running <em>make ERROR_CFLAGS="-Wall -Wdeclaration-after-statement -fno-strict-aliasing"</em> to ignore such warnings. <span class="anchor" id="line-414"></span><span class="anchor" id="line-415"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> Under 'gstreamer-mingw' chroot: <span class="anchor" id="line-416"></span><span class="anchor" id="line-417"></span><ul><li>configure <span class="anchor" id="line-418"></span><span class="anchor" id="line-419"></span><span class="anchor" id="line-420"></span><span class="anchor" id="line-421"></span><pre>cd ~/src/gstreamer-dev/gstreamer
PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc</pre><span class="anchor" id="line-422"></span></li><li>build <span class="anchor" id="line-423"></span><span class="anchor" id="line-424"></span><span class="anchor" id="line-425"></span><pre>make</pre><span class="anchor" id="line-426"></span></li><li>install <span class="anchor" id="line-427"></span><span class="anchor" id="line-428"></span><span class="anchor" id="line-429"></span><span class="anchor" id="line-430"></span><span class="anchor" id="line-431"></span><span class="anchor" id="line-432"></span><span class="anchor" id="line-433"></span><span class="anchor" id="line-434"></span><span class="anchor" id="line-435"></span><span class="anchor" id="line-436"></span><span class="anchor" id="line-437"></span><pre>ver=`date +%Y%m%d`
name=gstreamer
rm -rf /tmp/${name}-${ver}-dist
make DESTDIR=/tmp/${name}-${ver}-dist install
(cd /x/stow &amp;&amp; stow -D ${name}-*)
rm -rf /x/stow/${name}-${ver}
mv /tmp/${name}-${ver}-dist/x /x/stow/${name}-${ver}
cd /x/stow/
stow ${name}-${ver}</pre><span class="anchor" id="line-438"></span></li></ul><p class="line867">
<h3 id="head-5f82ce01d674c98e07bec46732eb19a3e33cef8a">4.2. gst-plugins-base</h3>
<span class="anchor" id="line-439"></span><p class="line867"><img alt="{i}" height="16" src="/moin/freedesktop/img/icon-info.png" title="{i}" width="16" /> compile and install 3rd party libogg, libvorbis if you want these plugins to be installed. <span class="anchor" id="line-440"></span><span class="anchor" id="line-441"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> Under 'gstreamer-mingw' chroot: <span class="anchor" id="line-442"></span><ul><li>configure <span class="anchor" id="line-443"></span><span class="anchor" id="line-444"></span><span class="anchor" id="line-445"></span><span class="anchor" id="line-446"></span><pre>cd ~/src/gstreamer-dev/gst-plugins-base
PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc</pre><span class="anchor" id="line-447"></span></li><li>build <span class="anchor" id="line-448"></span><span class="anchor" id="line-449"></span><span class="anchor" id="line-450"></span><pre>make</pre><span class="anchor" id="line-451"></span></li><li>install <span class="anchor" id="line-452"></span><span class="anchor" id="line-453"></span><span class="anchor" id="line-454"></span><span class="anchor" id="line-455"></span><span class="anchor" id="line-456"></span><span class="anchor" id="line-457"></span><span class="anchor" id="line-458"></span><pre>ver=`date +%Y%m%d`
make install DESTDIR=/tmp/gst-plugins-base-${ver}-dist
mv /tmp/gst-plugins-base-${ver}-dist/x /x/stow/gst-plugins-base-${ver}
cd /x/stow/
stow gst-plugins-base-${ver}</pre><span class="anchor" id="line-459"></span></li></ul><p class="line867">
<h3 id="head-af94b8930d738d42889cd975bb08ded55779fd7d">4.3. gst-plugins-good</h3>
<span class="anchor" id="line-460"></span><p class="line867"><img alt="{i}" height="16" src="/moin/freedesktop/img/icon-info.png" title="{i}" width="16" /> you will need to install the directx headers to compile the directvideosink and directaudiosink. <span class="anchor" id="line-461"></span><span class="anchor" id="line-462"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> Under 'gstreamer-mingw' chroot: <span class="anchor" id="line-463"></span><span class="anchor" id="line-464"></span><ul><li>configure <span class="anchor" id="line-465"></span><span class="anchor" id="line-466"></span><span class="anchor" id="line-467"></span><span class="anchor" id="line-468"></span><pre>cd ~/src/gstreamer-dev/gst-plugins-good
PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc</pre><span class="anchor" id="line-469"></span></li><li>build <span class="anchor" id="line-470"></span><span class="anchor" id="line-471"></span><span class="anchor" id="line-472"></span><pre>make ERROR_CFLAGS='-Wall -Wdeclaration-after-statement -fno-strict-aliasing'</pre><span class="anchor" id="line-473"></span></li><li>install <span class="anchor" id="line-474"></span><span class="anchor" id="line-475"></span><span class="anchor" id="line-476"></span><span class="anchor" id="line-477"></span><span class="anchor" id="line-478"></span><span class="anchor" id="line-479"></span><span class="anchor" id="line-480"></span><pre>ver=`date +%Y%m%d`
make ERROR_CFLAGS='-Wall -Wdeclaration-after-statement -fno-strict-aliasing' install DESTDIR=/tmp/gst-plugins-good-${ver}-dist
mv /tmp/gst-plugins-good-${ver}-dist/x /x/stow/gst-plugins-good-${ver}
cd /x/stow/
stow gst-plugins-good-${ver}</pre><span class="anchor" id="line-481"></span></li></ul><p class="line867">
<h3 id="head-2c3fa59b719602d055ac67c40e5aadded47386a1">4.4. gst-plugins-bad</h3>
<span class="anchor" id="line-482"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> Under 'gstreamer-mingw' chroot: <span class="anchor" id="line-483"></span><span class="anchor" id="line-484"></span><ul><li>configure <span class="anchor" id="line-485"></span><span class="anchor" id="line-486"></span><span class="anchor" id="line-487"></span><span class="anchor" id="line-488"></span><pre>cd ~/src/gstreamer-dev/gst-plugins-bad
PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc</pre><span class="anchor" id="line-489"></span></li><li>build <span class="anchor" id="line-490"></span><span class="anchor" id="line-491"></span><pre>make ERROR_CFLAGS='-Wall -Wdeclaration-after-statement -fno-strict-aliasing'</pre><span class="anchor" id="line-492"></span></li><li>instal <span class="anchor" id="line-493"></span><span class="anchor" id="line-494"></span><span class="anchor" id="line-495"></span><span class="anchor" id="line-496"></span><span class="anchor" id="line-497"></span><span class="anchor" id="line-498"></span><span class="anchor" id="line-499"></span><pre>ver=`date +%Y%m%d`
make ERROR_CFLAGS='-Wall -Wdeclaration-after-statement -fno-strict-aliasing' install DESTDIR=/tmp/gst-plugins-bad-${ver}-dist
mv /tmp/gst-plugins-bad-${ver}-dist/x /x/stow/gst-plugins-bad-${ver}
cd /x/stow/
stow gst-plugins-bad-${ver}</pre><span class="anchor" id="line-500"></span></li></ul><p class="line867">
<h3 id="head-ce3edf2b6fdb73e84e85a511a40b542ae734b340">4.5. gst-plugins-ugly</h3>
<span class="anchor" id="line-501"></span><p class="line867"><img alt="/!\" height="15" src="/moin/freedesktop/img/alert.png" title="/!\" width="15" /> The dvdreadsrc plugin compiled with mingw32 4.2.1 did not work for me (<a class="nonexistent" href="/wiki/TalShalif">TalShalif</a>), while the same compiled with mingw 3.4.5 worked fine (you can even copy the one you compiled on 3.4.5 to 4.2.1 and see either it will work for you too). <span class="anchor" id="line-502"></span><span class="anchor" id="line-503"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> Under 'gstreamer-mingw' chroot: <span class="anchor" id="line-504"></span><span class="anchor" id="line-505"></span><ul><li>configure <span class="anchor" id="line-506"></span><span class="anchor" id="line-507"></span><span class="anchor" id="line-508"></span><span class="anchor" id="line-509"></span><pre>cd ~/src/gstreamer-dev/gst-plugins-ugly
PKG_CONFIG_PATH=/x/lib/pkgconfig ./configure --prefix=/x --host=i586-mingw32msvc</pre><span class="anchor" id="line-510"></span></li><li>build <span class="anchor" id="line-511"></span><span class="anchor" id="line-512"></span><pre>make ERROR_CFLAGS='-Wall -Wdeclaration-after-statement -fno-strict-aliasing'</pre><span class="anchor" id="line-513"></span></li><li>install <span class="anchor" id="line-514"></span><span class="anchor" id="line-515"></span><span class="anchor" id="line-516"></span><span class="anchor" id="line-517"></span><span class="anchor" id="line-518"></span><span class="anchor" id="line-519"></span><span class="anchor" id="line-520"></span><pre>ver=`date +%Y%m%d`
make ERROR_CFLAGS='-Wall -Wdeclaration-after-statement -fno-strict-aliasing' install DESTDIR=/tmp/gst-plugins-ugly-${ver}-dist
mv /tmp/gst-plugins-ugly-${ver}-dist/x /x/stow/gst-plugins-ugly-${ver}
cd /x/stow/
stow gst-plugins-ugly-${ver}</pre><span class="anchor" id="line-521"></span></li></ul><p class="line867">
<h2 id="head-978bffe7fb071833f835dac65b97b3a1fe63a1dd">5. Plugin specific build problems</h2>
<span class="anchor" id="line-522"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> You can try to disable plugins which break your build with <em>--disable-xx</em> - run ./configure --help for more details <span class="anchor" id="line-523"></span><span class="anchor" id="line-524"></span><p class="line867"><img alt="{i}" height="16" src="/moin/freedesktop/img/icon-info.png" title="{i}" width="16" /> Some plugins will not be built for reasons such as faulty shared library dependancy detection. You can always go directly to the plugin sub-directory and run <em>make</em> there to build that particular plugin. You will need to manually copy the result DLL file to /x/stow/gst-plugins-xxx-vvv/lib/gstreamer-0.10 and run <em>stow --restow</em> on gst-plugins-xxx-vvv. Look at the directdraw/directsound example below - you may or may not need to use the <em>forcedll-libtool</em> hack. <span class="anchor" id="line-525"></span>
<h3 id="head-9f66975cce090098afd9d96362134e7b0d2a3ed5">5.1. directdraw, directsound</h3>
<span class="anchor" id="line-526"></span><p class="line874">libtool refuses to create the plugin DLLs for directdraw and directsound - both under gst-plugins-good. I have managed to force-create those using the following (the following example is for directdraw, but the same methodology applies to directsound): <span class="anchor" id="line-527"></span><ol type="1"><li>The following changes to ltmain.sh will force libtool to at least go through the steps of making the DLLs: <span class="anchor" id="line-528"></span><span class="anchor" id="line-529"></span><span class="anchor" id="line-530"></span><span class="anchor" id="line-531"></span><pre>cd ~/src/gstreamer-dev/gst-plugins-good
sed 's,build_libtool_libs=no,build_libtool_libs=yes,' &lt; libtool &gt; forcedll-libtool</pre><span class="anchor" id="line-532"></span></li><li>rebuild directdraw usgin forcedll-libtool <span class="anchor" id="line-533"></span><span class="anchor" id="line-534"></span><span class="anchor" id="line-535"></span><span class="anchor" id="line-536"></span><span class="anchor" id="line-537"></span><pre>cd ~/src/gstreamer-dev/gst-plugins-good/sys/directdraw
make clean
make ERROR_CFLAGS='-Wall -Wdeclaration-after-statement -fno-strict-aliasing'</pre><span class="anchor" id="line-538"></span></li><li>re-ran manually the last libtool link phase replacing ../../libtool with ../../forcedll-libtool: <span class="anchor" id="line-539"></span><span class="anchor" id="line-540"></span>e.g. <span class="anchor" id="line-541"></span><span class="anchor" id="line-542"></span><span class="anchor" id="line-543"></span><span class="anchor" id="line-544"></span><pre>/bin/bash ../../libtool --tag=CC --mode=link i586-mingw32msvc-gcc -g -O2 -o libgstdirectdrawsink.la -rpath /x/lib/gstreamer-0.10 -module -avoid-version -export-symbols-regex '^_*gst_plugin_desc$' -no-undefined libgstdirectdrawsink_la-gstdirectdrawsink.lo libgstdirectdrawsink_la-gstdirectdrawplugin.lo -lddraw -ldxguid -lgdi32 -L/x/lib -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lxml2 -lglib-2.0 -lintl -L/x/lib -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lxml2 -lglib-2.0 -lintl -lgstvideo-0.10 -lgstinterfaces-0.10</pre><span class="anchor" id="line-545"></span><span class="anchor" id="line-546"></span>with: <span class="anchor" id="line-547"></span><span class="anchor" id="line-548"></span><span class="anchor" id="line-549"></span><span class="anchor" id="line-550"></span><pre>/bin/bash ../../forcedll-libtool --tag=CC --mode=link i586-mingw32msvc-gcc -g -O2 -o libgstdirectdrawsink.la -rpath /x/lib/gstreamer-0.10 -module -avoid-version -export-symbols-regex '^_*gst_plugin_desc$' -no-undefined libgstdirectdrawsink_la-gstdirectdrawsink.lo libgstdirectdrawsink_la-gstdirectdrawplugin.lo -lddraw -ldxguid -lgdi32 -L/x/lib -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lxml2 -lglib-2.0 -lintl -L/x/lib -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lxml2 -lglib-2.0 -lintl -lgstvideo-0.10 -lgstinterfaces-0.10</pre><span class="anchor" id="line-551"></span><span class="anchor" id="line-552"></span></li><li class="gap">Ran manually the final from the above output gcc link command appending the missing library libtool complains it can not find (-ldxguid in directdraw's case): <span class="anchor" id="line-553"></span><span class="anchor" id="line-554"></span>e.g. replace: <span class="anchor" id="line-555"></span><span class="anchor" id="line-556"></span><span class="anchor" id="line-557"></span><span class="anchor" id="line-558"></span><pre>i586-mingw32msvc-gcc -shared .libs/libgstdirectdrawsink.dll.def .libs/libgstdirectdrawsink_la-gstdirectdrawsink.o .libs/libgstdirectdrawsink_la-gstdirectdrawplugin.o -lddraw -lgdi32 -L/x/lib /x/lib/libgstbase-0.10.dll.a /x/lib/libgstreamer-0.10.dll.a -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 /x/lib/libxml2.dll.a -lglib-2.0 -lintl /x/lib/libgstvideo-0.10.dll.a /x/lib/libgstinterfaces-0.10.dll.a -o .libs/libgstdirectdrawsink.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libgstdirectdrawsink.dll.a</pre><span class="anchor" id="line-559"></span><span class="anchor" id="line-560"></span>with: <span class="anchor" id="line-561"></span><span class="anchor" id="line-562"></span><span class="anchor" id="line-563"></span><span class="anchor" id="line-564"></span><pre>i586-mingw32msvc-gcc -shared .libs/libgstdirectdrawsink.dll.def .libs/libgstdirectdrawsink_la-gstdirectdrawsink.o .libs/libgstdirectdrawsink_la-gstdirectdrawplugin.o -lddraw -lgdi32 -L/x/lib /x/lib/libgstbase-0.10.dll.a /x/lib/libgstreamer-0.10.dll.a -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 /x/lib/libxml2.dll.a -lglib-2.0 -lintl /x/lib/libgstvideo-0.10.dll.a /x/lib/libgstinterfaces-0.10.dll.a -o .libs/libgstdirectdrawsink.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libgstdirectdrawsink.dll.a -ldxguid</pre><span class="anchor" id="line-565"></span></li><li>Copy DLL to plugin directory <span class="anchor" id="line-566"></span><span class="anchor" id="line-567"></span><span class="anchor" id="line-568"></span><span class="anchor" id="line-569"></span><span class="anchor" id="line-570"></span><pre>cp .libs/*.dll /x/stow/gst-plugins-good-${ver}/lib/gstreamer-0.10
cd /x/stow
stow --restow gst-plugins-good-${ver}</pre><span class="anchor" id="line-571"></span></li></ol><p class="line867">
<h3 id="head-d618b5b4c1c045f08b0a28c91a8ec74fb3c551c0">5.2. dvdread</h3>
<span class="anchor" id="line-572"></span><p class="line862">configure disabled this plugin due to libdvdread detection failure. When manually compiling this plugin I had to re-ran manually the last <em>libtool --tag=CC --mode=link</em> command with <em>-dvdread</em> appended. <span class="anchor" id="line-573"></span>
<h3 id="head-9b4e473a0b6f9fde7ac14f51ae9268c9040bee6c">5.3. a52</h3>
<span class="anchor" id="line-574"></span><p class="line862">I had to re-ran manually the last <em>libtool --tag=CC --mode=link</em> command with <em>-a52</em> appended. <span class="anchor" id="line-575"></span>
<h2 id="head-464ce281dadea1a3fd833c8ec15345559267b69c">6. Testing</h2>
<span class="anchor" id="line-576"></span><p class="line867">
<h3 id="head-a926d6a380722101b14eae8d023c55f8d312d657">6.1. Using wine</h3>
<span class="anchor" id="line-577"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> Do this on your real linux machine. <span class="anchor" id="line-578"></span><span class="anchor" id="line-579"></span><p class="line874">Install wine and try to run some simple pipelines: <span class="anchor" id="line-580"></span><ul><li>Install the wine package <span class="anchor" id="line-581"></span><span class="anchor" id="line-582"></span><span class="anchor" id="line-583"></span><pre>sudo apt-get install wine</pre><span class="anchor" id="line-584"></span></li><li>Run a pipeline <span class="anchor" id="line-585"></span><span class="anchor" id="line-586"></span><span class="anchor" id="line-587"></span><span class="anchor" id="line-588"></span><span class="anchor" id="line-589"></span><span class="anchor" id="line-590"></span><pre>cd /x/bin
wine ./gst-launch-0.10.exe fakesrc ! fakesink
wine ./gst-launch-0.10.exe audiotestsrc ! directsoundsink
wine ./gst-launch-0.10.exe videotestsrc ! directdrawsink</pre><span class="anchor" id="line-591"></span></li></ul><p class="line867">
<h3 id="head-dd06d6a10420ca0a56d44a1f30edd582a433a061">6.2. On a real MS Windows machine</h3>
<span class="anchor" id="line-592"></span><p class="line867"><img alt="(!)" height="15" src="/moin/freedesktop/img/idea.png" title="(!)" width="15" /> you need to configure samba with user home directory accsess on your linux machine. <span class="anchor" id="line-593"></span><span class="anchor" id="line-594"></span><p class="line874">Suposing your Linux machine IP address is 10.0.0.1: <span class="anchor" id="line-595"></span><ul><li>log onto your windows machine: <span class="anchor" id="line-596"></span><ul><li style="list-style-type:none">Map \\10.0.0.1\tanaka to drive X: <span class="anchor" id="line-597"></span></li></ul></li><li>Run a command shell: <span class="anchor" id="line-598"></span><span class="anchor" id="line-599"></span><span class="anchor" id="line-600"></span><span class="anchor" id="line-601"></span><span class="anchor" id="line-602"></span><pre>C:\&gt; X:
X:\bin&gt;gst-launch-0.10.exe --gst-plugin-path=x:/lib/gstreamer-0.10 fakesrc ! fakesink
X:\bin&gt;gst-launch-0.10.exe --gst-plugin-path=x:/lib/gstreamer-0.10 videotestsrc ! directdrawsink</pre><span class="anchor" id="line-603"></span>Or if you have MSYS: <span class="anchor" id="line-604"></span><span class="anchor" id="line-605"></span><span class="anchor" id="line-606"></span><span class="anchor" id="line-607"></span><pre>$ cd /x/bin
$ gst-launch-0.10.exe --gst-plugin-path=x:/lib/gstreamer-0.10 fakesrc ! fakesink</pre><span class="anchor" id="line-608"></span><span class="anchor" id="line-609"></span></li></ul><p class="line874">Other pipelines to try: <span class="anchor" id="line-610"></span><span class="anchor" id="line-611"></span><span class="anchor" id="line-612"></span><pre>x:/bin/gst-launch-0.10.exe --gst-plugin-path=x:/lib/gstreamer-0.10 dvdreadsrc device=e: ! queue ! dvddemux name=demux .current_video ! queue ! mpeg2dec ! ffmpegcolorspace ! directdrawsink demux.current_audio ! queue ! a52dec ! audioconvert ! directsoundsink</pre><span class="anchor" id="line-613"></span><div class="footnotes"><ol><li><p><a id="fnref-593d3505d2c410341aa2efc9124339e5dd99528e"></a><span class="anchor" id="line-1"></span>I am running Ubuntu 8.04.1 (<a href="#fndef-593d3505d2c410341aa2efc9124339e5dd99528e-0">1</a>)</li></ol></div><span class="anchor" id="bottom"></span></div><div id="pagebottom"></div>
</div>
<div id="footer">
<p id="pageinfo" class="info" lang="en" dir="ltr">GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment (last edited 2009-01-13 11:33:33 by <span title="??? @ localhost[127.0.0.1]">localhost</span>)</p>
<ul class="editbar"><li><span class="disabled">Immutable Page</span></li></ul><p><a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=refresh" rel="nofollow">DeleteCache</a> (cached 2009-10-20 19:32:34)</p><p>Or try one of these actions: <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=AttachFile" rel="nofollow">Attachments</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=CopyPage" rel="nofollow">CopyPage</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=Despam" rel="nofollow">Despam</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=LikePages" rel="nofollow">LikePages</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=Load" rel="nofollow">Load</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=LocalSiteMap" rel="nofollow">LocalSiteMap</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=MyPages" rel="nofollow">MyPages</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=PackagePages" rel="nofollow">PackagePages</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=RenderAsDocbook" rel="nofollow">RenderAsDocbook</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=Save" rel="nofollow">Save</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=SpellCheck" rel="nofollow">SpellCheck</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=SubscribeUser" rel="nofollow">SubscribeUser</a>, <a href="/wiki/GStreamer_Cross_Compile_With_MinGW_In_Chroot_Environment?action=SyncPages" rel="nofollow">SyncPages</a></p>
</div>
<ul id="credits">
<li><a href="http://moinmo.in/" title="This site uses the MoinMoin Wiki software.">MoinMoin Powered</a></li><li><a href="http://moinmo.in/Python" title="MoinMoin is written in Python.">Python Powered</a></li><li><a href="http://moinmo.in/GPL" title="MoinMoin is GPL licensed.">GPL licensed</a></li><li><a href="http://validator.w3.org/check?uri=referer" title="Click here to validate this page.">Valid HTML 4.01</a></li>
</ul>
</body>
</html>

View File

@ -26,6 +26,7 @@
* @brief REGISTER and registrations
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
* @author xxxyyyzzz <imsframework(at)gmail.com>
*
* @date Created: Wed Mar 8 11:48:49 EET 2006 ppessi
*/
@ -140,6 +141,7 @@ int nua_stack_set_defaults(nua_handle_t *nh,
NHP_SET(nhp, invite_enable, 1);
NHP_SET(nhp, auto_alert, 0);
NHP_SET(nhp, early_media, 0);
NHP_SET(nhp, early_ims, 0);
NHP_SET(nhp, only183_100rel, 0);
NHP_SET(nhp, auto_answer, 0);
NHP_SET(nhp, auto_ack, 1);
@ -277,10 +279,13 @@ int nua_stack_init_instance(nua_handle_t *nh, tagi_t const *tags)
* NUTAG_CALLEE_CAPS() \n
* NUTAG_DETECT_NETWORK_UPDATES() \n
* NUTAG_EARLY_ANSWER() \n
* NUTAG_EARLY_IMS() \n
* NUTAG_EARLY_MEDIA() \n
* NUTAG_ENABLEINVITE() \n
* NUTAG_ENABLEMESSAGE() \n
* NUTAG_ENABLEMESSENGER() \n
* NUTAG_IMPI() \n
* NUTAG_IMPU() \n
* NUTAG_INITIAL_ROUTE() \n
* NUTAG_INITIAL_ROUTE_STR() \n
* NUTAG_INSTANCE() \n
@ -593,7 +598,7 @@ int nua_stack_set_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
}
/** Parse parameters from tags to @a nhp or @a ngp.
/** Parse parameters from @a tags to @a nhp or @a ngp.
*
* @param home allocate new values from @a home
* @param nhp structure to store handle preferences
@ -701,6 +706,23 @@ static int nhp_set_tags(su_home_t *home,
if (tag == NULL)
break;
/* NUTAG_EARLY_IMS(early_ims) */
else if (tag == nutag_early_ims) {
NHP_SET(nhp, early_ims, value != 0);
}
/* NUTAG_IMPI(impi) */
else if (tag == nutag_impi) {
NHP_SET_STR(nhp, impi, value);
}
/* NUTAG_IMPU() */
else if (tag == nutag_impu) {
NHP_SET_STR_BY_URL(nhp, url_string_t, impu, value);
}
/* NUTAG_REALM(realm) */
else if (tag == nutag_realm) {
NHP_SET_STR(nhp, realm, value);
}
/* NUTAG_RETRY_COUNT(retry_count) */
else if (tag == nutag_retry_count) {
NHP_SET(nhp, retry_count, (unsigned)value);
@ -1462,6 +1484,7 @@ int nua_stack_set_smime_params(nua_t *nua, tagi_t const *tags)
* NUTAG_DETECT_NETWORK_UPDATES() \n
* NUTAG_EARLY_ANSWER() \n
* NUTAG_EARLY_MEDIA() \n
* NUTAG_EARLY_IMS() \n
* NUTAG_ENABLEINVITE() \n
* NUTAG_ENABLEMESSAGE() \n
* NUTAG_ENABLEMESSENGER() \n
@ -1637,6 +1660,7 @@ int nua_stack_get_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
TIF(NUTAG_AUTOALERT, auto_alert),
TIF(NUTAG_EARLY_ANSWER, early_answer),
TIF(NUTAG_EARLY_MEDIA, early_media),
TIF(NUTAG_EARLY_IMS, early_ims),
TIF(NUTAG_ONLY183_100REL, only183_100rel),
TIF(NUTAG_AUTOANSWER, auto_answer),
TIF(NUTAG_AUTOACK, auto_ack),

View File

@ -31,6 +31,7 @@
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
* @author Kai Vehmanen <Kai.Vehmanen@nokia.com>
* @author xxxyyyzzz <imsframework(at)gmail.com>
*
* @date Created: Wed Mar 8 11:38:18 EET 2006 ppessi
*/
@ -96,6 +97,8 @@ struct nua_handle_preferences
/* Preferences for registration (and dialog establishment) */
unsigned nhp_callee_caps:1; /**< Add callee caps to contact */
unsigned nhp_media_features:1;/**< Add media features to caps*/
/** Enable Early IMS security */
unsigned nhp_early_ims:1;
/** Enable Service-Route */
unsigned nhp_service_route_enable:1;
/** Enable Path */
@ -141,6 +144,15 @@ struct nua_handle_preferences
/** Next hop URI (used instead of route). */
url_string_t *nhp_proxy;
/** IMS Private Identifier */
char const *nhp_impi;
/** IMS Public Identifier */
url_string_t *nhp_impu;
/** Default realm (IMS initial register) */
char const *nhp_realm;
union { struct {
/* A bit for each feature set by application */
/* NOTE:
@ -173,6 +185,7 @@ struct nua_handle_preferences
unsigned nhb_message_auto_respond:1;
unsigned nhb_callee_caps:1;
unsigned nhb_media_features:1;
unsigned nhb_early_ims:1;
unsigned nhb_service_route_enable:1;
unsigned nhb_path_enable:1;
unsigned nhb_auth_cache:1;
@ -185,6 +198,10 @@ struct nua_handle_preferences
unsigned nhb_registrar:1;
unsigned :0; /* at most 32 bits before this point */
unsigned nhb_impi:1;
unsigned nhb_impu:1;
unsigned nhb_realm:1;
unsigned nhb_allow:1;
unsigned nhb_supported:1;
@ -201,7 +218,7 @@ struct nua_handle_preferences
unsigned nhb_appl_method:1;
unsigned nhb_initial_route:1;
unsigned nhb_proxy:1;
unsigned :0;
unsigned :0; /* padding */
} set_bits;
unsigned set_unsigned[2];
} nhp_set_;

View File

@ -2720,6 +2720,16 @@ int nua_client_request_sendmsg(nua_client_request_t *cr, msg_t *msg, sip_t *sip)
return -1;
}
/**For Initial REGISTER we must add default authentication if no erlyIMS as per
3GPP TS 24.229 subclause 5.1.1.2.2. We must add tags for privateid and publicid
*/
if(cr->cr_method == sip_method_register && !NH_PGET(nh, early_ims))
{
char* auth = su_sprintf(0,"Digest username=\"%s\", realm=\"%s\", nonce=\"\", response=\"\", uri=\""URL_FORMAT_STRING"\"",
NH_PGET(nh, impi), NH_PGET(nh, realm), URL_PRINT_ARGS(sip->sip_request->rq_url));
sip_add_make(msg, sip, sip_authorization_class, auth);
su_free(0, auth);
}
cr->cr_wait_for_cred = 0;
if (cr->cr_methods->crm_send)

View File

@ -26,6 +26,7 @@
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
* @author Martti Mela <Martti.Mela@nokia.com>
* @author xxxyyyzzz <imsframework(at)gmail.com>
*
* @date Created: Wed Feb 21 10:13:29 2001 ppessi
*/
@ -414,6 +415,96 @@ tag_typedef_t nutag_callee_caps = BOOLTAG_TYPEDEF(callee_caps);
* Reference tag for NUTAG_CALLEE_CAPS().
*/
/**@def NUTAG_IMPU(x)
* Set the IP Multimedia Public Identity (sip or tel uri). This uri is publicly published and can be
* seen as your sip adress.
*
*@par Used with
* -nua_set_params(), nua_create(), nua_get_params()
*
*@par parameter type
*
* url_string_t const * (either char const * or url_t *)
*
* @par Values
* - SIP URI
* - TEL URI
*
* Corresponding tag taking reference parameter is NUTAG_IMPU_REF().
*/
tag_typedef_t nutag_impu = URLTAG_TYPEDEF(impu);
/**@def NUTAG_IMPU_REF(x)
* Reference tag for NUTAG_IMPU().
*/
/**@def NUTAG_IMPI(x)
* Set the IP Multimedia Private Identity. This private user identity associated to the user's IMPUs.
* For basic sip clients (no IMS) you should fill this field with your authentication user name.
*
*@par Used with
* -nua_set_params(), nua_create(), nua_get_params()
*
*@par parameter type
*
* char const *
*
* @par Values
* - Any
*
* Corresponding tag taking reference parameter is NUTAG_IMPI_REF().
*/
tag_typedef_t nutag_impi = STRTAG_TYPEDEF(impi);
/**@def NUTAG_IMPI_REF(x)
* Reference tag for NUTAG_IMPI().
*/
/**@def NUTAG_REALM(x)
* In IMS context we must set the realm in the initial first REGISTER request as per
* 3GPP TS 24.229 subclause 5.1.1.2. This mean that we don't wait for the 401/407 response to provide credentials.
*
*@par Used with
* -nua_set_params(), nua_create(), nua_get_params()
*
*@par parameter type
*
* char const *
*
* @par Values
* - Any
*
* Corresponding tag taking reference parameter is NUTAG_REALM_REF().
*/
tag_typedef_t nutag_realm = STRTAG_TYPEDEF(realm);
/**@def NUTAG_REALM_REF(x)
* Reference tag for NUTAG_REALM().
*/
/**@def NUTAG_EARLY_IMS(x)
* Activate/deactivate early IMS security as per 3GPP TS 33.978.
* You may activate this option if you are using the stack as basic sip engine without IMS
* security features.
*
*@par Used with
* -nua_register(), nua_create(), nua_set_params(), nua_get_params()
*
*@par Parameter type
*
* int (boolean: nonzero is true, zero is false)
*
* @par Values
* - 0 (false) - use normal IMS security mechanisms as per 3GPP TS 33.203
* - 1 (true) - try to use early IMS as per 3GPP TS 33.978 instead of default IMS security (3GPP TS 33.203)
*
* Corresponding tag taking reference parameter is NUTAG_EARLY_IMS_REF().
*/
tag_typedef_t nutag_early_ims = BOOLTAG_TYPEDEF(early_ims);
/**@def NUTAG_EARLY_IMS_REF(x)
* Reference tag for NUTAG_EARLY_IMS().
*/
/**@def NUTAG_EARLY_MEDIA(x)
*

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,6 @@
#define EXPORT
#endif
#include <stddef.h>
#undef TAG_NAMESPACE
#define TAG_NAMESPACE "nua"
@ -38,6 +37,18 @@ EXPORT tag_typedef_t nutag_media_features_ref =
extern tag_typedef_t nutag_callee_caps;
EXPORT tag_typedef_t nutag_callee_caps_ref =
REFTAG_TYPEDEF(nutag_callee_caps);
extern tag_typedef_t nutag_impu;
EXPORT tag_typedef_t nutag_impu_ref =
REFTAG_TYPEDEF(nutag_impu);
extern tag_typedef_t nutag_impi;
EXPORT tag_typedef_t nutag_impi_ref =
REFTAG_TYPEDEF(nutag_impi);
extern tag_typedef_t nutag_realm;
EXPORT tag_typedef_t nutag_realm_ref =
REFTAG_TYPEDEF(nutag_realm);
extern tag_typedef_t nutag_early_ims;
EXPORT tag_typedef_t nutag_early_ims_ref =
REFTAG_TYPEDEF(nutag_early_ims);
extern tag_typedef_t nutag_early_media;
EXPORT tag_typedef_t nutag_early_media_ref =
REFTAG_TYPEDEF(nutag_early_media);
@ -281,94 +292,3 @@ EXPORT tag_typedef_t nutag_hold_ref =
extern tag_typedef_t nutag_address;
EXPORT tag_typedef_t nutag_address_ref =
REFTAG_TYPEDEF(nutag_address);
EXPORT tag_type_t nua_tag_list[] =
{
nutag_retry_count,
nutag_uicc,
nutag_smime_opt,
nutag_sips_url,
nutag_soa_session,
nutag_keepalive_stream,
nutag_enablemessenger,
nutag_path_enable,
nutag_initial_route_str,
nutag_certificate_dir,
nutag_authtime,
nutag_smime_signature,
nutag_enableinvite,
nutag_answer_sent,
nutag_smime_message_encryption,
nutag_keepalive,
nutag_auth,
nutag_min_se,
nutag_url,
nutag_identity,
nutag_notify_refer,
nutag_initial_route,
nutag_early_media,
nutag_service_route_enable,
nutag_allow_events,
nutag_smime_message_digest,
nutag_only183_100rel,
nutag_use_dialog,
nutag_outbound,
nutag_outbound_set1,
nutag_invite_timer,
nutag_outbound_set2,
nutag_session_timer,
nutag_outbound_set3,
nutag_phrase,
nutag_outbound_set4,
nutag_detect_network_updates,
nutag_offer_recv,
nutag_m_username,
nutag_max_subscriptions,
nutag_smime_enable,
nutag_answer_recv,
nutag_shutdown_events,
nutag_session_refresher,
nutag_user_agent,
nutag_soa_name,
nutag_update_refresh,
nutag_dialog,
nutag_substate,
nutag_m_display,
nutag_address,
nutag_refer_with_id,
nutag_include_extra_sdp,
nutag_media_features,
nutag_certificate_phrase,
nutag_m_features,
nutag_refer_event,
nutag_refer_expires,
nutag_autoanswer,
nutag_enablemessage,
nutag_registrar,
nutag_m_params,
nutag_status,
nutag_refer_pause,
nutag_appl_method,
nutag_allow,
nutag_handle,
nutag_newsub,
nutag_callee_caps,
nutag_hold,
nutag_smime_key_encryption,
nutag_auth_cache,
nutag_with,
nutag_supported,
nutag_method,
nutag_smime_protection_mode,
nutag_early_answer,
nutag_event,
nutag_media_enable,
nutag_instance,
nutag_callstate,
nutag_autoack,
nutag_offer_sent,
nutag_refresh_without_sdp,
nutag_sub_expires,
nutag_autoalert,
NULL
};

View File

@ -31,6 +31,7 @@
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
* @author Martti Mela <Martti.Mela@nokia.com>
* @author xxxyyyzzz <imsframework(at)gmail.com>
*
* @date Created: Mon Feb 19 18:54:26 EET 2001 ppessi
*/
@ -114,6 +115,27 @@ SOFIAPUBVAR tag_typedef_t nutag_use_dialog;
#define NUTAG_USE_DIALOG_REF(x) nutag_use_dialog_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_use_dialog_ref;
/* Parameters added for 3GPP IMS
*/
#define NUTAG_EARLY_IMS(x) nutag_early_ims, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t nutag_early_ims;
#define NUTAG_EARLY_IMS_REF(x) nutag_early_ims_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_early_ims_ref;
#define NUTAG_IMPU(x) nutag_impu, urltag_url_v(x)
SOFIAPUBVAR tag_typedef_t nutag_impu;
#define NUTAG_IMPU_REF(x) nutag_impu_ref, urltag_url_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_impu_ref;
#define NUTAG_IMPI(x) nutag_impi, tag_str_v(x)
SOFIAPUBVAR tag_typedef_t nutag_impi;
#define NUTAG_IMPI_REF(x) nutag_impi_ref, tag_str_vr((&x))
SOFIAPUBVAR tag_typedef_t nutag_impi_ref;
#define NUTAG_REALM(x) nutag_realm, tag_str_v(x)
SOFIAPUBVAR tag_typedef_t nutag_realm;
#define NUTAG_realm_REF(x) nutag_realm_ref, tag_str_vr((&x))
SOFIAPUBVAR tag_typedef_t nutag_realm_ref;
/* Protocol engine parameters,
* set by nua_set_params(), get by nua_get_params() */

View File

@ -0,0 +1 @@
awk -v BINMODE="rw" -f ../su/tag_dll.awk nua_tag.c

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "stdafx.h"

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "targetver.h"

View File

@ -1,29 +1,30 @@
/****************************************************************************
_ _
| | | |
_ | | ___ _ _| | _ ____ ____ ____ ___
/ || |/ _ \| | | | || \ / _ | _ \ / _ |/ _ \
( (_| | |_| | |_| | |_) | ( | | | | ( ( | | |_| |
\____|\___/ \____|____/ \_||_|_| |_|\_|| |\___/
(_____|
Copyright (C) 2009 xxxyyyzzz <imsframework(at)gmail.com>
This file is part of Open Source Doubango IMS Client Framework project.
DOUBANGO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DOUBANGO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with DOUBANGO.
****************************************************************************/
/**
* @file
* @author xxxyyyzzz <imsframework(at)gmail.com>
* @version 1.0
*
* @section LICENSE
*
*
* This file is part of Open Source Doubango IMS Client Framework project.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
* @section DESCRIPTION
*
*
*/
#include "stdafx.h"
#include <doubango.h>

View File

@ -0,0 +1,252 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="pthread"
ProjectGUID="{C155E03E-B2F9-405C-9804-D99B7244B465}"
RootNamespace="pthread"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PTHREAD_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<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"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PTHREAD_EXPORTS"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="STATIC_RELEASE|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PTHREAD_EXPORTS"
UsePrecompiledHeader="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="$(OutDir)\$(ProjectName).a"
SubSystem="2"
TargetMachine="1"
/>
<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>
<File
RelativePath=".\implement.h"
>
</File>
<File
RelativePath=".\pthread.c"
>
</File>
<File
RelativePath=".\pthread.h"
>
</File>
<File
RelativePath=".\sched.h"
>
</File>
<File
RelativePath=".\semaphore.h"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>