From 9350baf5a3444cc035bd5eedcded04b1fe823228 Mon Sep 17 00:00:00 2001 From: bossiel Date: Wed, 10 Aug 2011 22:59:15 +0000 Subject: Move deprecated v1.0 from trunk to branches --- branches/1.0/Samples/C++/REGISTER/test/ReadMe.txt | 33 ++++ branches/1.0/Samples/C++/REGISTER/test/stdafx.cpp | 8 + branches/1.0/Samples/C++/REGISTER/test/stdafx.h | 15 ++ branches/1.0/Samples/C++/REGISTER/test/targetver.h | 13 ++ branches/1.0/Samples/C++/REGISTER/test/test.cpp | 86 +++++++++ branches/1.0/Samples/C++/REGISTER/test/test.sln | 20 ++ branches/1.0/Samples/C++/REGISTER/test/test.vcproj | 211 +++++++++++++++++++++ 7 files changed, 386 insertions(+) create mode 100644 branches/1.0/Samples/C++/REGISTER/test/ReadMe.txt create mode 100644 branches/1.0/Samples/C++/REGISTER/test/stdafx.cpp create mode 100644 branches/1.0/Samples/C++/REGISTER/test/stdafx.h create mode 100644 branches/1.0/Samples/C++/REGISTER/test/targetver.h create mode 100644 branches/1.0/Samples/C++/REGISTER/test/test.cpp create mode 100644 branches/1.0/Samples/C++/REGISTER/test/test.sln create mode 100644 branches/1.0/Samples/C++/REGISTER/test/test.vcproj (limited to 'branches/1.0/Samples/C++') diff --git a/branches/1.0/Samples/C++/REGISTER/test/ReadMe.txt b/branches/1.0/Samples/C++/REGISTER/test/ReadMe.txt new file mode 100644 index 0000000..784510c --- /dev/null +++ b/branches/1.0/Samples/C++/REGISTER/test/ReadMe.txt @@ -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. + +///////////////////////////////////////////////////////////////////////////// diff --git a/branches/1.0/Samples/C++/REGISTER/test/stdafx.cpp b/branches/1.0/Samples/C++/REGISTER/test/stdafx.cpp new file mode 100644 index 0000000..96da927 --- /dev/null +++ b/branches/1.0/Samples/C++/REGISTER/test/stdafx.cpp @@ -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 diff --git a/branches/1.0/Samples/C++/REGISTER/test/stdafx.h b/branches/1.0/Samples/C++/REGISTER/test/stdafx.h new file mode 100644 index 0000000..47a0d02 --- /dev/null +++ b/branches/1.0/Samples/C++/REGISTER/test/stdafx.h @@ -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 +#include + + + +// TODO: reference additional headers your program requires here diff --git a/branches/1.0/Samples/C++/REGISTER/test/targetver.h b/branches/1.0/Samples/C++/REGISTER/test/targetver.h new file mode 100644 index 0000000..a38195a --- /dev/null +++ b/branches/1.0/Samples/C++/REGISTER/test/targetver.h @@ -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 + diff --git a/branches/1.0/Samples/C++/REGISTER/test/test.cpp b/branches/1.0/Samples/C++/REGISTER/test/test.cpp new file mode 100644 index 0000000..6ea59fc --- /dev/null +++ b/branches/1.0/Samples/C++/REGISTER/test/test.cpp @@ -0,0 +1,86 @@ +// test.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" +#include +#include +#include + +#define STACK_ID 1234 + +#ifdef WIN32 +# include +#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:bob@ims.inexbee.com"); + stack->set_private_id("bob@ims.inexbee.com"); + + stack->set_pcscf("192.168.0.14"); + stack->set_pcscf_port(4060); + stack->set_realm("ims.inexbee.com"); + + /* Not mandatory but must be set before starting */ + stack->set_sigcomp(true); + + /* run stack */ + assert( ERR_SUCCEED(stack->run()) ); + + /* set other optional parameters */ + stack->set_displayname("Doubango"); + stack->set_privacy("none"); + stack->set_password("bob"); + stack->set_early_ims(false); + stack->set_expires(10); + + /* register */ + stack->sip_register(); + + /* wait */ +#ifdef WIN32 + Sleep(500000); +#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; +} \ No newline at end of file diff --git a/branches/1.0/Samples/C++/REGISTER/test/test.sln b/branches/1.0/Samples/C++/REGISTER/test/test.sln new file mode 100644 index 0000000..d9cef3f --- /dev/null +++ b/branches/1.0/Samples/C++/REGISTER/test/test.sln @@ -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 diff --git a/branches/1.0/Samples/C++/REGISTER/test/test.vcproj b/branches/1.0/Samples/C++/REGISTER/test/test.vcproj new file mode 100644 index 0000000..08682c0 --- /dev/null +++ b/branches/1.0/Samples/C++/REGISTER/test/test.vcproj @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.1