SWITCH_DECLARE_DATA switch_directories SWITCH_GLOBAL_dirs = { 0 };
/* The main runtime obj we keep this hidden for ourselves */
-struct switch_runtime runtime;
+struct switch_runtime runtime = { 0 };
static void switch_load_core_config(const char *file);
static void send_heartbeat(void)
struct in_addr in;
char hostname[256] = "";
- memset(&runtime, 0, sizeof(runtime));
-
+ if (runtime.runlevel > 0) {
+ /* one per customer */
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ runtime.runlevel++;
+
runtime.dummy_cng_frame.data = runtime.dummy_data;
runtime.dummy_cng_frame.datalen = sizeof(runtime.dummy_data);
runtime.dummy_cng_frame.buflen = sizeof(runtime.dummy_data);
return SWITCH_STATUS_GENERR;
}
+ if (runtime.runlevel > 1) {
+ /* one per customer */
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ runtime.runlevel++;
+
/* set signal handlers */
signal(SIGINT, SIG_IGN);
#ifdef SIGPIPE