Changeset 4489 for pjproject/trunk
- Timestamp:
- Apr 23, 2013 7:53:25 AM (12 years ago)
- Location:
- pjproject/trunk/pjsip-apps
- Files:
-
- 5 added
- 5 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/build/Makefile
r4476 r4489 34 34 export PJSUA_SRCDIR = ../src/pjsua 35 35 export PJSUA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 36 main.o pjsua_app.o pjsua_ cli.o pjsua_common.o \37 pjsua_ config.o pjsua_legacy.o36 main.o pjsua_app.o pjsua_app_cli.o pjsua_app_common.o \ 37 pjsua_app_config.o pjsua_app_legacy.o 38 38 export PJSUA_CFLAGS += $(_CFLAGS) 39 39 export PJSUA_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) -
pjproject/trunk/pjsip-apps/build/pjsua.vcproj
r4484 r4489 3709 3709 </File> 3710 3710 <File 3711 RelativePath="..\src\pjsua\pjsua_ cli.c"3711 RelativePath="..\src\pjsua\pjsua_app_cli.c" 3712 3712 > 3713 3713 </File> 3714 3714 <File 3715 RelativePath="..\src\pjsua\pjsua_ common.c"3715 RelativePath="..\src\pjsua\pjsua_app_common.c" 3716 3716 > 3717 3717 </File> 3718 3718 <File 3719 RelativePath="..\src\pjsua\pjsua_ config.c"3719 RelativePath="..\src\pjsua\pjsua_app_config.c" 3720 3720 > 3721 3721 </File> 3722 3722 <File 3723 RelativePath="..\src\pjsua\pjsua_ legacy.c"3723 RelativePath="..\src\pjsua\pjsua_app_legacy.c" 3724 3724 > 3725 3725 </File> … … 3734 3734 </File> 3735 3735 <File 3736 RelativePath="..\src\pjsua\pjsua_ common.h"3736 RelativePath="..\src\pjsua\pjsua_app_common.h" 3737 3737 > 3738 3738 </File> -
pjproject/trunk/pjsip-apps/src/pjsua/main.c
r4476 r4489 25 25 static pj_status_t receive_end_sig; 26 26 static pj_thread_t *sig_thread; 27 static app_cfg_t cfg;27 static pjsua_app_cfg_t cfg; 28 28 29 29 /* Called when CLI (re)started */ … … 33 33 } 34 34 35 pj_bool_ton_app_stopped(pj_bool_t restart, int argc, char** argv)35 void on_app_stopped(pj_bool_t restart, int argc, char** argv) 36 36 { 37 37 cfg.argc = argc; … … 39 39 40 40 running = restart; 41 return PJ_TRUE;42 41 } 43 42 … … 61 60 PJ_LOG(3,(THIS_FILE, "Ctrl-C detected, quitting..")); 62 61 receive_end_sig = PJ_TRUE; 63 app_destroy();62 pjsua_app_destroy(); 64 63 ExitProcess(1); 65 64 PJ_UNREACHED(return TRUE;) … … 105 104 106 105 while (running) { 107 status = app_init(&cfg);106 status = pjsua_app_init(&cfg); 108 107 if (status == PJ_SUCCESS) { 109 status = app_run(PJ_TRUE);108 status = pjsua_app_run(PJ_TRUE); 110 109 } else { 111 110 pj_perror(3, THIS_FILE, status, "Failed init"); … … 114 113 115 114 if (!receive_end_sig) { 116 app_destroy();115 pjsua_app_destroy(); 117 116 118 117 /* This is on purpose */ 119 app_destroy();118 pjsua_app_destroy(); 120 119 } else { 121 120 pj_thread_join(sig_thread); -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r4485 r4489 47 47 #endif 48 48 49 pj_status_t app_destroy(void);50 51 49 static void ringback_start(pjsua_call_id call_id); 52 50 static void ring_start(pjsua_call_id call_id); 53 51 static void ring_stop(pjsua_call_id call_id); 54 static pj_status_t pjsua_app_init();55 static pj_status_t pjsua_app_destroy();56 57 static app_cfg_t app_cfg;52 static pj_status_t app_init(); 53 static pj_status_t app_destroy(); 54 55 static pjsua_app_cfg_t app_cfg; 58 56 pj_str_t uri_arg; 59 57 pj_bool_t app_running = PJ_FALSE; … … 1217 1215 1218 1216 /* Called on CLI (re)started, e.g: initial start, after iOS bg */ 1219 PJ_DEF(void)cli_on_started(pj_status_t status)1217 void cli_on_started(pj_status_t status) 1220 1218 { 1221 1219 /* Notify app */ … … 1236 1234 1237 1235 /* Called on CLI quit */ 1238 PJ_DEF(pj_bool_t)cli_on_stopped(pj_bool_t restart, int argc, char* argv[])1236 void cli_on_stopped(pj_bool_t restart, int argc, char* argv[]) 1239 1237 { 1240 1238 /* Notify app */ 1241 1239 if (app_cfg.on_stopped) 1242 return (*app_cfg.on_stopped)(restart, argc, argv); 1243 1244 return PJ_SUCCESS; 1240 (*app_cfg.on_stopped)(restart, argc, argv); 1245 1241 } 1246 1242 1247 1243 1248 1244 /* Called on pjsua legacy quit */ 1249 PJ_DEF(pj_bool_t)legacy_on_stopped(pj_bool_t restart)1245 void legacy_on_stopped(pj_bool_t restart) 1250 1246 { 1251 1247 /* Notify app */ 1252 1248 if (app_cfg.on_stopped) 1253 return (*app_cfg.on_stopped)(restart, 0, NULL); 1254 1255 return PJ_SUCCESS; 1256 } 1257 1258 1249 (*app_cfg.on_stopped)(restart, 1, NULL); 1250 } 1259 1251 1260 1252 /***************************************************************************** … … 1283 1275 } 1284 1276 1285 static pj_status_t pjsua_app_init()1277 static pj_status_t app_init() 1286 1278 { 1287 1279 pjsua_transport_id transport_id = -1; … … 1845 1837 } 1846 1838 1847 PJ_DEF(pj_status_t) app_init(constapp_cfg_t *cfg)1839 pj_status_t pjsua_app_init(const pjsua_app_cfg_t *cfg) 1848 1840 { 1849 1841 pj_status_t status; 1850 1842 pj_memcpy(&app_cfg, cfg, sizeof(app_cfg)); 1851 1843 1852 status = pjsua_app_init();1844 status = app_init(); 1853 1845 if (status != PJ_SUCCESS) 1854 1846 return status; … … 1861 1853 } 1862 1854 1863 pj_status_t app_run(pj_bool_t wait_telnet_cli)1855 pj_status_t pjsua_app_run(pj_bool_t wait_telnet_cli) 1864 1856 { 1865 1857 pj_thread_t *stdout_refresh_thread = NULL; … … 1917 1909 } 1918 1910 1919 static pj_status_t pjsua_app_destroy()1911 static pj_status_t app_destroy() 1920 1912 { 1921 1913 pj_status_t status = PJ_SUCCESS; … … 1982 1974 } 1983 1975 1984 pj_status_t app_destroy()1976 pj_status_t pjsua_app_destroy() 1985 1977 { 1986 1978 pj_status_t status; 1987 1979 1988 status = pjsua_app_destroy();1980 status = app_destroy(); 1989 1981 1990 1982 if (app_config.use_cli) { -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.h
r4476 r4489 25 25 */ 26 26 27 #include "pjsua_ common.h"27 #include "pjsua_app_common.h" 28 28 29 29 PJ_BEGIN_DECL … … 32 32 * This structure contains the configuration of application. 33 33 */ 34 typedef struct app_cfg_t34 typedef struct pjsua_app_cfg_t 35 35 { 36 36 /** … … 56 56 * cleanup procedure. 57 57 */ 58 pj_bool_t(*on_stopped)(pj_bool_t restart, int argc, char** argv);58 void (*on_stopped)(pj_bool_t restart, int argc, char** argv); 59 59 60 60 /** … … 63 63 */ 64 64 void (*on_config_init)(pjsua_app_config *cfg); 65 } app_cfg_t;65 } pjsua_app_cfg_t; 66 66 67 67 /** … … 69 69 * the provided configuration. 70 70 */ 71 PJ_DECL(pj_status_t) app_init(constapp_cfg_t *app_cfg);71 pj_status_t pjsua_app_init(const pjsua_app_cfg_t *app_cfg); 72 72 73 73 /** … … 77 77 * should define this param as PJ_FALSE. 78 78 */ 79 PJ_DECL(pj_status_t)app_run(pj_bool_t wait_telnet_cli);79 pj_status_t pjsua_app_run(pj_bool_t wait_telnet_cli); 80 80 81 81 /** 82 82 * This will destroy/cleanup the application library. 83 83 */ 84 PJ_DECL(pj_status_t)app_destroy();84 pj_status_t pjsua_app_destroy(); 85 85 86 86 PJ_END_DECL
Note: See TracChangeset
for help on using the changeset viewer.