void pjsuaDestroy() { pjsua_app_destroy(); /** This is on purpose **/ pjsua_app_destroy(); }
void PjsuaInit() { pjsua_app_cfg_t app_cfg; pj_status_t status; /* Destroy pjsua app first */ pjsua_app_destroy(); /* Init pjsua app */ pj_bzero(&app_cfg, sizeof(app_cfg)); app_cfg.argc = start_argc; app_cfg.argv = start_argv; app_cfg.on_started = &PjsuaOnStarted; app_cfg.on_stopped = &PjsuaOnStopped; app_cfg.on_config_init = &PjsuaOnConfig; SetWindowText(g_hWndLbl, _T("Initializing..")); status = pjsua_app_init(&app_cfg); if (status != PJ_SUCCESS) goto on_return; SetWindowText(g_hWndLbl, _T("Starting..")); status = pjsua_app_run(PJ_FALSE); if (status != PJ_SUCCESS) goto on_return; on_return: if (status != PJ_SUCCESS) SetWindowText(g_hWndLbl, _T("Initialization failed")); }
static int initMain(int argc, char **argv) { pj_status_t status; android_app_config.argc = argc; android_app_config.argv = argv; status = pjsua_app_init(&android_app_config); if (status == PJ_SUCCESS) { status = pjsua_app_run(PJ_FALSE); } else { pjsua_app_destroy(); } return status; }
static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) { switch (fdwCtrlType) { // Handle the CTRL+C signal. case CTRL_C_EVENT: case CTRL_CLOSE_EVENT: case CTRL_BREAK_EVENT: case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: pj_thread_register("ctrlhandler", handler_desc, &sig_thread); PJ_LOG(3,(THIS_FILE, "Ctrl-C detected, quitting..")); receive_end_sig = PJ_TRUE; pjsua_app_destroy(); ExitProcess(1); PJ_UNREACHED(return TRUE;) default: return FALSE; }
void PjsuaDestroy() { pjsua_app_destroy(); }