From c9f1884efd85052d45add121a8e314bd30fa519b Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Fri, 19 Apr 2013 10:36:11 +0000 Subject: Re #1655: Initial implementation of pjsua CLI app for Windows Mobile (5.x & 6.x). git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4484 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib-util/src/pjlib-util/cli_console.c | 3 +- pjproject-vs8.sln | 80 +++- pjsip-apps/build/pjsua.vcproj | 748 ++++++++++++++++++-------------- pjsip-apps/src/pjsua/pjsua_config.c | 2 + pjsip-apps/src/pjsua/pjsua_legacy.c | 3 +- pjsip-apps/src/pjsua/wm/main_wm.c | 406 +++++++++++++++++ pjsip-apps/src/pjsua/wm/pjsua.bmp | Bin 0 -> 12178 bytes 7 files changed, 894 insertions(+), 348 deletions(-) create mode 100644 pjsip-apps/src/pjsua/wm/main_wm.c create mode 100644 pjsip-apps/src/pjsua/wm/pjsua.bmp diff --git a/pjlib-util/src/pjlib-util/cli_console.c b/pjlib-util/src/pjlib-util/cli_console.c index 76dedb35..934654a2 100644 --- a/pjlib-util/src/pjlib-util/cli_console.c +++ b/pjlib-util/src/pjlib-util/cli_console.c @@ -469,7 +469,8 @@ static int readline_thread(void * p) * If exit is desired end script with q for quit */ /* Reopen stdin/stdout/stderr to /dev/console */ -#if defined(PJ_WIN32) && PJ_WIN32!=0 +#if defined(PJ_WIN32) && PJ_WIN32!=0 && \ + (!defined(PJ_WIN32_WINCE) || PJ_WIN32_WINCE==0) if (freopen ("CONIN$", "r", stdin) == NULL) { #else if (1) { diff --git a/pjproject-vs8.sln b/pjproject-vs8.sln index ebe4abaa..637cebe7 100644 --- a/pjproject-vs8.sln +++ b/pjproject-vs8.sln @@ -1031,53 +1031,114 @@ Global {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release-Static|Windows Mobile 6 Standard SDK (ARMV4I) {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release-Static|Windows Mobile 6 Standard SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Win32.ActiveCfg = Debug|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Win32.Build.0 = Debug|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Pocket PC 2003 (ARMV4).ActiveCfg = Debug-Dynamic|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Pocket PC 2003 (ARMV4).Build.0 = Debug-Dynamic|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Pocket PC 2003 (ARMV4).Deploy.0 = Debug-Dynamic|Pocket PC 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Smartphone 2003 (ARMV4).ActiveCfg = Debug-Dynamic|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Smartphone 2003 (ARMV4).Build.0 = Debug-Dynamic|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Smartphone 2003 (ARMV4).Deploy.0 = Debug-Dynamic|Smartphone 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Pocket PC 2003 (ARMV4).ActiveCfg = Debug-Static|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Pocket PC 2003 (ARMV4).Build.0 = Debug-Static|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Pocket PC 2003 (ARMV4).Deploy.0 = Debug-Static|Pocket PC 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Smartphone 2003 (ARMV4).ActiveCfg = Debug-Static|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Smartphone 2003 (ARMV4).Build.0 = Debug-Static|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Smartphone 2003 (ARMV4).Deploy.0 = Debug-Static|Smartphone 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Win32.ActiveCfg = Release|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Win32.Build.0 = Release|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Pocket PC 2003 (ARMV4).ActiveCfg = Release-Dynamic|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Pocket PC 2003 (ARMV4).Build.0 = Release-Dynamic|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Pocket PC 2003 (ARMV4).Deploy.0 = Release-Dynamic|Pocket PC 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Smartphone 2003 (ARMV4).ActiveCfg = Release-Dynamic|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Smartphone 2003 (ARMV4).Build.0 = Release-Dynamic|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Smartphone 2003 (ARMV4).Deploy.0 = Release-Dynamic|Smartphone 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Pocket PC 2003 (ARMV4).ActiveCfg = Release-Static|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Pocket PC 2003 (ARMV4).Build.0 = Release-Static|Pocket PC 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Pocket PC 2003 (ARMV4).Deploy.0 = Release-Static|Pocket PC 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Smartphone 2003 (ARMV4).ActiveCfg = Release-Static|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Smartphone 2003 (ARMV4).Build.0 = Release-Static|Smartphone 2003 (ARMV4) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Smartphone 2003 (ARMV4).Deploy.0 = Release-Static|Smartphone 2003 (ARMV4) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Win32.Build.0 = Release-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release-Static|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release-Static|Windows Mobile 6 Professional SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release-Static|Windows Mobile 6 Professional SDK (ARMV4I) {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release-Static|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release-Static|Windows Mobile 6 Standard SDK (ARMV4I) + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release-Static|Windows Mobile 6 Standard SDK (ARMV4I) {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) @@ -2367,7 +2428,6 @@ Global {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) @@ -2673,8 +2733,10 @@ Global {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Win32.ActiveCfg = Debug|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Win32.Build.0 = Debug|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Win32 + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Win32 - {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|Pocket PC 2003 (ARMV4).ActiveCfg = Debug-Dynamic|Pocket PC 2003 (ARMV4) {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|Pocket PC 2003 (ARMV4).Build.0 = Debug-Dynamic|Pocket PC 2003 (ARMV4) @@ -2830,7 +2892,6 @@ Global {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4) @@ -2844,13 +2905,10 @@ Global {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Pocket PC 2003 (ARMV4).ActiveCfg = Debug-Dynamic|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Pocket PC 2003 (ARMV4).Build.0 = Debug-Dynamic|Pocket PC 2003 (ARMV4) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Pocket PC 2003 (ARMV4).Deploy.0 = Debug-Dynamic|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Smartphone 2003 (ARMV4).ActiveCfg = Debug-Dynamic|Smartphone 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Smartphone 2003 (ARMV4).Build.0 = Debug-Dynamic|Smartphone 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Smartphone 2003 (ARMV4).Deploy.0 = Debug-Dynamic|Smartphone 2003 (ARMV4) @@ -2864,10 +2922,8 @@ Global {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Pocket PC 2003 (ARMV4).ActiveCfg = Debug-Static|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Pocket PC 2003 (ARMV4).Build.0 = Debug-Static|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Pocket PC 2003 (ARMV4).Deploy.0 = Debug-Static|Pocket PC 2003 (ARMV4) @@ -2884,10 +2940,8 @@ Global {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) @@ -2904,10 +2958,8 @@ Global {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Pocket PC 2003 (ARMV4).ActiveCfg = Release-Dynamic|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Pocket PC 2003 (ARMV4).Build.0 = Release-Dynamic|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Pocket PC 2003 (ARMV4).Deploy.0 = Release-Dynamic|Pocket PC 2003 (ARMV4) @@ -2924,10 +2976,8 @@ Global {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Pocket PC 2003 (ARMV4).ActiveCfg = Release-Static|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Pocket PC 2003 (ARMV4).Build.0 = Release-Static|Pocket PC 2003 (ARMV4) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Pocket PC 2003 (ARMV4).Deploy.0 = Release-Static|Pocket PC 2003 (ARMV4) @@ -2944,10 +2994,8 @@ Global {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release-Static|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release-Static|Windows Mobile 6 Professional SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release-Static|Windows Mobile 6 Professional SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release-Static|Windows Mobile 6 Standard SDK (ARMV4I) {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release-Static|Windows Mobile 6 Standard SDK (ARMV4I) - {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release-Static|Windows Mobile 6 Standard SDK (ARMV4I) {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|Win32.ActiveCfg = Debug|Win32 diff --git a/pjsip-apps/build/pjsua.vcproj b/pjsip-apps/build/pjsua.vcproj index 50370d12..d79126a4 100644 --- a/pjsip-apps/build/pjsua.vcproj +++ b/pjsip-apps/build/pjsua.vcproj @@ -139,7 +139,7 @@ /> @@ -206,7 +206,7 @@ /> - @@ -289,22 +287,24 @@ Name="VCBscMakeTool" /> - - + @@ -421,27 +425,25 @@ Name="VCBscMakeTool" /> - - - @@ -490,20 +490,22 @@ Name="VCBscMakeTool" /> - - - @@ -691,25 +693,27 @@ Name="VCBscMakeTool" /> - - + @@ -756,24 +762,22 @@ Name="VCBscMakeTool" /> - - - @@ -892,22 +894,24 @@ Name="VCBscMakeTool" /> - - + @@ -1426,27 +1436,25 @@ Name="VCBscMakeTool" /> - - + @@ -1761,27 +1773,25 @@ Name="VCBscMakeTool" /> - - - + + + + + + + + + + + + + + + + + + + + @@ -3268,7 +3356,7 @@ /> + +#include +#include +#include +#include +#include "..\pjsua_app.h" + +#define MAINWINDOWCLASS TEXT("PjsuaDlg") +#define MAINWINDOWTITLE TEXT("PJSUA") +#define LOGO_PATH TEXT("\\Program Files\\pjsua\\pjsua.bmp") + +#define WM_APP_INIT WM_USER + 1 +#define WM_APP_DESTROY WM_USER + 2 +#define WM_APP_RESTART WM_USER + 3 + +static HINSTANCE g_hInst; +static HWND g_hWndMenuBar; +static HWND g_hWndMain; +static HWND g_hWndLbl; +static HWND g_hWndImg; +static HBITMAP g_hBmp; + +static int restart_argc = 0; +static char **restart_argv = NULL; + +/* Helper funtions to init/restart/destroy the pjsua */ +static void LibInit(); +static void LibDestroy(); +static void LibRestart(); + +/* pjsua app callbacks */ +static void lib_on_started(pj_status_t status, const char* title); +static pj_bool_t lib_on_stopped(pj_bool_t restart, int argc, char** argv); +static void lib_on_config_init(pjsua_app_config *cfg); + +LRESULT CALLBACK DialogProc(const HWND hWnd, + const UINT Msg, + const WPARAM wParam, + const LPARAM lParam) +{ + LRESULT res = 0; + + switch (Msg) { + case WM_CREATE: + g_hWndMain = hWnd; + break; + + case WM_COMMAND: /* Exit menu */ + case WM_CLOSE: + PostQuitMessage(0); + break; + + case WM_HOTKEY: + /* Exit app when back is pressed. */ + if (VK_TBACK == HIWORD(lParam) && (0 != (MOD_KEYUP & LOWORD(lParam)))) { + PostQuitMessage(0); + } else { + return DefWindowProc(hWnd, Msg, wParam, lParam); + } + break; + + case WM_CTLCOLORSTATIC: + /* Set text and background color for static windows */ + SetTextColor((HDC)wParam, RGB(255, 255, 255)); + SetBkColor((HDC)wParam, RGB(0, 0, 0)); + return (LRESULT)GetStockObject(BLACK_BRUSH); + + case WM_APP_INIT: + LibInit(); + break; + + case WM_APP_DESTROY: + LibDestroy(); + PostQuitMessage(0); + break; + + case WM_APP_RESTART: + LibRestart(); + break; + + default: + return DefWindowProc(hWnd, Msg, wParam, lParam); + } + + return res; +} + + +/* === GUI === */ + +pj_status_t gui_init() +{ + WNDCLASS wc; + HWND hWnd = NULL; + RECT r; + DWORD dwStyle; + enum { LABEL_HEIGHT = 30 }; + enum { MENU_ID_EXIT = 50000 }; + BITMAP bmp; + HMENU hRootMenu; + SHMENUBARINFO mbi; + + pj_status_t status = PJ_SUCCESS; + + /* Check if app is running. If it's running then focus on the window */ + hWnd = FindWindow(MAINWINDOWCLASS, MAINWINDOWTITLE); + + if (NULL != hWnd) { + SetForegroundWindow(hWnd); + return status; + } + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = (WNDPROC)DialogProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = g_hInst; + wc.hIcon = 0; + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); + wc.lpszMenuName = 0; + wc.lpszClassName = MAINWINDOWCLASS; + + if (!RegisterClass(&wc) != 0) { + DWORD err = GetLastError(); + return PJ_RETURN_OS_ERROR(err); + } + + /* Create the app. window */ + g_hWndMain = CreateWindow(MAINWINDOWCLASS, MAINWINDOWTITLE, + WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, + (HWND)NULL, NULL, g_hInst, (LPSTR)NULL); + if (g_hWndMain == NULL) { + DWORD err = GetLastError(); + return PJ_RETURN_OS_ERROR(err); + } + + /* Create exit menu */ + hRootMenu = CreateMenu(); + AppendMenu(hRootMenu, MF_STRING, MENU_ID_EXIT, L"Exit"); + + /* Initialize menubar */ + ZeroMemory(&mbi, sizeof(SHMENUBARINFO)); + mbi.cbSize = sizeof(SHMENUBARINFO); + mbi.hwndParent = g_hWndMain; + mbi.dwFlags = SHCMBF_HIDESIPBUTTON|SHCMBF_HMENU; + mbi.nToolBarId = (UINT)hRootMenu; + mbi.hInstRes = g_hInst; + + if (FALSE == SHCreateMenuBar(&mbi)) { + DWORD err = GetLastError(); + return PJ_RETURN_OS_ERROR(err); + } + + /* Store menu window handle */ + g_hWndMenuBar = mbi.hwndMB; + + /* Show the menu */ + DrawMenuBar(g_hWndMain); + ShowWindow(g_hWndMenuBar, SW_SHOW); + + /* Override back button */ + SendMessage(g_hWndMenuBar, SHCMBM_OVERRIDEKEY, VK_TBACK, + MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, + SHMBOF_NODEFAULT | SHMBOF_NOTIFY)); + + /* Get main window size */ + GetClientRect(g_hWndMain, &r); +#if defined(WIN32_PLATFORM_PSPC) && WIN32_PLATFORM_PSPC != 0 + /* Adjust the height for PocketPC platform */ + r.bottom -= GetSystemMetrics(SM_CYMENU); +#endif + + /* Create logo */ + g_hBmp = SHLoadDIBitmap(LOGO_PATH); // for jpeg, uses SHLoadImageFile() + if (g_hBmp == NULL) { + DWORD err = GetLastError(); + return PJ_RETURN_OS_ERROR(err); + } + GetObject(g_hBmp, sizeof(bmp), &bmp); + + dwStyle = SS_CENTERIMAGE | SS_REALSIZEIMAGE | SS_BITMAP | + WS_CHILD | WS_VISIBLE; + g_hWndImg = CreateWindow(TEXT("STATIC"), NULL, dwStyle, + (r.right-r.left-bmp.bmWidth)/2, + (r.bottom-r.top-bmp.bmHeight)/2, + bmp.bmWidth, bmp.bmHeight, + g_hWndMain, (HMENU)0, g_hInst, NULL); + if (g_hWndImg == NULL) { + DWORD err = GetLastError(); + return PJ_RETURN_OS_ERROR(err); + } + SendMessage(g_hWndImg, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)g_hBmp); + + /* Create label */ + dwStyle = WS_CHILD | WS_VISIBLE | ES_CENTER; + g_hWndLbl = CreateWindow(TEXT("STATIC"), NULL, dwStyle, + 0, r.bottom-LABEL_HEIGHT, r.right-r.left, LABEL_HEIGHT, + g_hWndMain, (HMENU)0, g_hInst, NULL); + if (g_hWndLbl == NULL) { + DWORD err = GetLastError(); + return PJ_RETURN_OS_ERROR(err); + } + SetWindowText(g_hWndLbl, _T("Please wait..")); + + return status; +} + + +pj_status_t gui_start() +{ + MSG msg; + while (GetMessage(&msg, NULL, 0, 0)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + return (msg.wParam); +} + +void gui_destroy(void) +{ + if (g_hWndMain) { + DestroyWindow(g_hWndMain); + g_hWndMain = NULL; + } + if (g_hWndMenuBar) { + DestroyWindow(g_hWndMenuBar); + g_hWndMenuBar = NULL; + } + if (g_hWndLbl) { + DestroyWindow(g_hWndLbl); + g_hWndLbl = NULL; + } + if (g_hWndImg) { + DestroyWindow(g_hWndImg); + g_hWndImg = NULL; + } + if (g_hBmp) { + DeleteObject(g_hBmp); + g_hBmp = NULL; + } + UnregisterClass(MAINWINDOWCLASS, g_hInst); +} + +/* === ENGINE === */ + +/* Called when pjsua is started */ +void lib_on_started(pj_status_t status, const char* title) +{ + wchar_t wtitle[128]; + + PJ_UNUSED_ARG(status); + + pj_ansi_to_unicode(title, strlen(title), wtitle, PJ_ARRAY_SIZE(wtitle)); + SetWindowText(g_hWndLbl, wtitle); +} + +/* Called when pjsua is stopped */ +pj_bool_t lib_on_stopped(pj_bool_t restart, int argc, char** argv) +{ + if (restart) { + restart_argc = argc; + restart_argv = argv; + + // Schedule Lib Restart + PostMessage(g_hWndMain, WM_APP_RESTART, 0, 0); + } else { + /* Destroy & quit GUI, e.g: clean up window, resources */ + PostMessage(g_hWndMain, WM_APP_DESTROY, 0, 0); + } + + return PJ_FALSE; +} + +/* Called before pjsua initializing config. */ +void lib_on_config_init(pjsua_app_config *cfg) +{ + PJ_UNUSED_ARG(cfg); +} + +void LibInit() +{ + char* argv[] = { + "", + "--use-cli", + "--cli-telnet-port=0", + "--no-cli-console" + }; + app_cfg_t app_cfg; + pj_status_t status; + + pj_bzero(&app_cfg, sizeof(app_cfg)); + app_cfg.argc = PJ_ARRAY_SIZE(argv); + app_cfg.argv = argv; + app_cfg.on_started = &lib_on_started; + app_cfg.on_stopped = &lib_on_stopped; + app_cfg.on_config_init = &lib_on_config_init; + + SetWindowText(g_hWndLbl, _T("Initializing..")); + status = app_init(&app_cfg); + if (status != PJ_SUCCESS) + goto on_return; + + SetWindowText(g_hWndLbl, _T("Starting..")); + status = app_run(PJ_FALSE); + if (status != PJ_SUCCESS) + goto on_return; + +on_return: + if (status != PJ_SUCCESS) + SetWindowText(g_hWndLbl, _T("Initialization failed")); +} + +void LibDestroy() +{ + app_destroy(); +} + +void LibRestart() +{ + app_cfg_t app_cfg; + pj_status_t status; + + /* Destroy pjsua app first */ + + app_destroy(); + + /* Reinit pjsua app */ + + pj_bzero(&app_cfg, sizeof(app_cfg)); + app_cfg.argc = restart_argc; + app_cfg.argv = restart_argv; + app_cfg.on_started = &lib_on_started; + app_cfg.on_stopped = &lib_on_stopped; + app_cfg.on_config_init = &lib_on_config_init; + + status = app_init(&app_cfg); + if (status != PJ_SUCCESS) { + SetWindowText(g_hWndLbl, _T("app_init() failed")); + return; + } + + /* Run pjsua app */ + + status = app_run(PJ_FALSE); + if (status != PJ_SUCCESS) { + SetWindowText(g_hWndLbl, _T("app_run() failed")); + return; + } +} + + +/* === MAIN === */ + +int WINAPI WinMain( + HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPWSTR lpCmdLine, + int nShowCmd +) +{ + int status; + + PJ_UNUSED_ARG(hPrevInstance); + PJ_UNUSED_ARG(lpCmdLine); + PJ_UNUSED_ARG(nShowCmd); + + // store the hInstance in global + g_hInst = hInstance; + + status = gui_init(); + if (status != 0) + goto on_return; + + // Start the engine + PostMessage(g_hWndMain, WM_APP_INIT, 0, 0); + + status = gui_start(); + +on_return: + LibDestroy(); + gui_destroy(); + + return status; +} diff --git a/pjsip-apps/src/pjsua/wm/pjsua.bmp b/pjsip-apps/src/pjsua/wm/pjsua.bmp new file mode 100644 index 00000000..6fd0c95b Binary files /dev/null and b/pjsip-apps/src/pjsua/wm/pjsua.bmp differ -- cgit v1.2.3