Commit 14c2d596 authored by johan's avatar johan
Browse files

Merge remote-tracking branch 'origin' into bctoolbox

parents f46c1b1b 77d350a9
......@@ -57,6 +57,7 @@ BELLESIP_EXPORT belle_sip_dialog_t *belle_sip_request_event_get_dialog(const bel
/*Dialog terminated event*/
BELLESIP_EXPORT belle_sip_dialog_t* belle_sip_dialog_terminated_event_get_dialog(const belle_sip_dialog_terminated_event_t *event);
BELLESIP_EXPORT int belle_sip_dialog_terminated_event_is_expired(const belle_sip_dialog_terminated_event_t *event);
/**
* Timeout Event
......
......@@ -18,6 +18,7 @@
#ifndef REFRESHER_HELPER_H_
#define REFRESHER_HELPER_H_
#define BELLE_SIP_REFRESHER_REUSE_EXPIRES -1
BELLE_SIP_BEGIN_DECLS
......
......@@ -809,11 +809,12 @@ struct belle_sip_dialog{
belle_sip_transaction_t* last_transaction;
belle_sip_header_privacy_t* privacy;
belle_sip_list_t *queued_ct;/* queued client transactions*/
unsigned int remote_invite_cseq; /*needed because multiple trans can be handled whithin invite transaction (I.E UPDATE, PRACK,etc*/
unsigned char is_server;
unsigned char is_secure;
unsigned char terminate_on_bye;
unsigned char needs_ack;
unsigned int remote_invite_cseq; /*needed because multiple trans can be handled whithin invite transaction (I.E UPDATE, PRACK,etc*/
unsigned char is_expired;
unsigned char pending_trans_checking_enabled; /*use to disabled pending transaction check at request creation (testing)*/
};
......@@ -887,6 +888,7 @@ belle_sdp_##object_type##_t* belle_sdp_##object_type##_parse (const char* value)
struct belle_sip_dialog_terminated_event{
belle_sip_provider_t *source;
belle_sip_dialog_t *dialog;
int is_expired;
};
struct belle_sip_io_error_event{
......
......@@ -205,6 +205,7 @@ static int belle_sip_dialog_init_as_uac(belle_sip_dialog_t *obj, belle_sip_reque
static int belle_sip_dialog_expired(belle_sip_dialog_t *dialog){
belle_sip_message("Dialog [%p] expired", dialog);
dialog->is_expired = TRUE;
belle_sip_dialog_delete(dialog);
return BELLE_SIP_STOP;
}
......@@ -751,7 +752,7 @@ void belle_sip_dialog_delete(belle_sip_dialog_t *obj){
belle_sip_object_unref(obj->expiration_timer);
obj->expiration_timer = NULL;
}
belle_sip_message("dialog [%p] deleted.",obj);
belle_sip_message("Dialog [%p] deleted (is_expired=%i)",obj, obj->is_expired);
belle_sip_dialog_stop_200Ok_retrans(obj); /*if any*/
set_state(obj,BELLE_SIP_DIALOG_TERMINATED);
dropped_transactions=belle_sip_list_size(obj->queued_ct);
......
......@@ -689,10 +689,11 @@ void belle_sip_provider_remove_dialog(belle_sip_provider_t *prov, belle_sip_dial
belle_sip_dialog_terminated_event_t* ev=belle_sip_malloc(sizeof(belle_sip_dialog_terminated_event_t));
ev->source=prov;
ev->dialog=dialog;
ev->is_expired=dialog->is_expired;
prov->dialogs=belle_sip_list_remove(prov->dialogs,dialog);
belle_sip_main_loop_do_later(belle_sip_stack_get_main_loop(prov->stack)
,(belle_sip_callback_t) notify_dialog_terminated
, ev);
,(belle_sip_callback_t) notify_dialog_terminated
, ev);
}
......
......@@ -94,8 +94,14 @@ static void schedule_timer(belle_sip_refresher_t* refresher) {
}
static void process_dialog_terminated(belle_sip_listener_t *user_ctx, const belle_sip_dialog_terminated_event_t *event){
/*nop*/
belle_sip_refresher_t* refresher=(belle_sip_refresher_t*)user_ctx;
if (event->is_expired){
belle_sip_warning("Refresher [%p]: forced to stop because dialog has expired.", refresher);
belle_sip_refresher_stop_internal(refresher, 0);
}
}
static void process_io_error(belle_sip_listener_t *user_ctx, const belle_sip_io_error_event_t *event){
belle_sip_refresher_t* refresher=(belle_sip_refresher_t*)user_ctx;
belle_sip_client_transaction_t*client_transaction;
......
......@@ -46,6 +46,10 @@ belle_sip_dialog_t* belle_sip_dialog_terminated_event_get_dialog(const belle_sip
return event->dialog;
}
int belle_sip_dialog_terminated_event_is_expired(const belle_sip_dialog_terminated_event_t *event){
return event->is_expired;
}
const char* belle_sip_io_error_event_get_host(const belle_sip_io_error_event_t* event) {
return event->host;
}
......
......@@ -60,6 +60,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
target_include_directories(belle_sip_tester_runtime PRIVATE common)
target_link_libraries(belle_sip_tester_runtime belle_sip_tester_static)
set_target_properties(belle_sip_tester_runtime PROPERTIES VS_WINRT_COMPONENT TRUE)
set_target_properties(belle_sip_tester_runtime PROPERTIES LIBRARY_OUTPUT_NAME "BelledonneCommunications.BelleSip.Tester")
set_target_properties(belle_sip_tester_runtime PROPERTIES LINK_FLAGS "/WINMDFILE:BelledonneCommunications.BelleSip.Tester.winmd")
install(TARGETS belle_sip_tester_runtime
RUNTIME DESTINATION bin
......@@ -67,7 +69,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
ARCHIVE DESTINATION lib
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/belle_sip_tester_runtime.winmd" DESTINATION bin)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/BelledonneCommunications.BelleSip.Tester.winmd" DESTINATION lib)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/BelledonneCommunications.BelleSip.Tester.pdb
DESTINATION lib
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
else()
......
......@@ -2,7 +2,7 @@
#include "belle_sip_tester_windows.h"
using namespace belle_sip_tester_runtime;
using namespace BelledonneCommunications::BelleSip::Tester;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Storage;
......@@ -15,7 +15,7 @@ using namespace Windows::System::Threading;
static OutputTraceListener^ sTraceListener;
static belle_sip_object_pool_t *pool;
BelleSipTester^ BelleSipTester::_instance = ref new BelleSipTester();
NativeTester^ NativeTester::_instance = ref new NativeTester();
static void nativeOutputTraceHandler(int lev, const char *fmt, va_list args)
{
......@@ -52,23 +52,23 @@ static void belleSipNativeOutputTraceHandler(belle_sip_log_level lev, const char
}
BelleSipTester::BelleSipTester()
NativeTester::NativeTester()
{
belle_sip_tester_init(nativeOutputTraceHandler);
bc_tester_set_resource_dir_prefix("Assets");
}
BelleSipTester::~BelleSipTester()
NativeTester::~NativeTester()
{
belle_sip_tester_uninit();
}
void BelleSipTester::setOutputTraceListener(OutputTraceListener^ traceListener)
void NativeTester::setOutputTraceListener(OutputTraceListener^ traceListener)
{
sTraceListener = traceListener;
}
void BelleSipTester::initialize(StorageFolder^ writableDirectory, Platform::Boolean ui)
void NativeTester::initialize(StorageFolder^ writableDirectory, Platform::Boolean ui)
{
if (ui) {
belle_sip_tester_init(nativeOutputTraceHandler);
......@@ -98,7 +98,7 @@ void BelleSipTester::initialize(StorageFolder^ writableDirectory, Platform::Bool
}
}
bool BelleSipTester::run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose)
bool NativeTester::run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose)
{
std::wstring all(L"ALL");
std::wstring wssuitename = suiteName->Data();
......@@ -118,7 +118,7 @@ bool BelleSipTester::run(Platform::String^ suiteName, Platform::String^ caseName
return bc_tester_run_tests(wssuitename == all ? 0 : csuitename, wscasename == all ? 0 : ccasename) != 0;
}
void BelleSipTester::runAllToXml()
void NativeTester::runAllToXml()
{
auto workItem = ref new WorkItemHandler([this](IAsyncAction ^workItem) {
bc_tester_start(NULL);
......@@ -127,12 +127,12 @@ void BelleSipTester::runAllToXml()
_asyncAction = ThreadPool::RunAsync(workItem);
}
unsigned int BelleSipTester::nbTestSuites()
unsigned int NativeTester::nbTestSuites()
{
return bc_tester_nb_suites();
}
unsigned int BelleSipTester::nbTests(Platform::String^ suiteName)
unsigned int NativeTester::nbTests(Platform::String^ suiteName)
{
std::wstring suitename = suiteName->Data();
char cname[MAX_SUITE_NAME_SIZE] = { 0 };
......@@ -140,7 +140,7 @@ unsigned int BelleSipTester::nbTests(Platform::String^ suiteName)
return bc_tester_nb_tests(cname);
}
Platform::String^ BelleSipTester::testSuiteName(int index)
Platform::String^ NativeTester::testSuiteName(int index)
{
const char *cname = bc_tester_suite_name(index);
wchar_t wcname[MAX_SUITE_NAME_SIZE];
......@@ -148,7 +148,7 @@ Platform::String^ BelleSipTester::testSuiteName(int index)
return ref new String(wcname);
}
Platform::String^ BelleSipTester::testName(Platform::String^ suiteName, int testIndex)
Platform::String^ NativeTester::testName(Platform::String^ suiteName, int testIndex)
{
std::wstring suitename = suiteName->Data();
char csuitename[MAX_SUITE_NAME_SIZE] = { 0 };
......
......@@ -3,39 +3,45 @@
#include "belle-sip/belle-sip.h"
#include "belle_sip_tester.h"
namespace belle_sip_tester_runtime
namespace BelledonneCommunications
{
public interface class OutputTraceListener
namespace BelleSip
{
public:
void outputTrace(Platform::String^ lev, Platform::String^ msg);
};
namespace Tester
{
public interface class OutputTraceListener
{
public:
void outputTrace(Platform::String^ lev, Platform::String^ msg);
};
public ref class BelleSipTester sealed
{
public:
void setOutputTraceListener(OutputTraceListener^ traceListener);
unsigned int nbTestSuites();
unsigned int nbTests(Platform::String^ suiteName);
Platform::String^ testSuiteName(int index);
Platform::String^ testName(Platform::String^ suiteName, int testIndex);
void initialize(Windows::Storage::StorageFolder^ writableDirectory, Platform::Boolean ui);
bool run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose);
void runAllToXml();
public ref class NativeTester sealed
{
public:
void setOutputTraceListener(OutputTraceListener^ traceListener);
unsigned int nbTestSuites();
unsigned int nbTests(Platform::String^ suiteName);
Platform::String^ testSuiteName(int index);
Platform::String^ testName(Platform::String^ suiteName, int testIndex);
void initialize(Windows::Storage::StorageFolder^ writableDirectory, Platform::Boolean ui);
bool run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose);
void runAllToXml();
static property BelleSipTester^ Instance
{
BelleSipTester^ get() { return _instance; }
}
property Windows::Foundation::IAsyncAction^ AsyncAction
{
Windows::Foundation::IAsyncAction^ get() { return _asyncAction; }
}
private:
BelleSipTester();
~BelleSipTester();
static property NativeTester^ Instance
{
NativeTester^ get() { return _instance; }
}
property Windows::Foundation::IAsyncAction^ AsyncAction
{
Windows::Foundation::IAsyncAction^ get() { return _asyncAction; }
}
private:
NativeTester();
~NativeTester();
static BelleSipTester^ _instance;
Windows::Foundation::IAsyncAction^ _asyncAction;
};
static NativeTester^ _instance;
Windows::Foundation::IAsyncAction^ _asyncAction;
};
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment