Explorar el Código

nat_traversal(k): register stats only ifdef STATISTICS

Andrei Pelinescu-Onciul hace 15 años
padre
commit
b3c6ac1339
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      modules_k/nat_traversal/nat_traversal.c

+ 4 - 0
modules_k/nat_traversal/nat_traversal.c

@@ -260,6 +260,7 @@ static pv_export_t pvars[] = {
     {{0, 0}, 0, 0, 0, 0, 0, 0, 0}
 };
 
+#ifdef STATISTICS
 static stat_export_t statistics[] = {
     {"keepalive_endpoints",  STAT_NO_RESET, &keepalive_endpoints},
     {"registered_endpoints", STAT_NO_RESET, &registered_endpoints},
@@ -267,6 +268,7 @@ static stat_export_t statistics[] = {
     {"dialog_endpoints",     STAT_NO_RESET, &dialog_endpoints},
     {0, 0, 0}
 };
+#endif
 
 struct module_exports exports = {
     "nat_traversal", // module name
@@ -1785,11 +1787,13 @@ mod_init(void)
     keepalive_params.callid_counter = rand();
     keepalive_params.from_tag = rand();
 
+#ifdef STATISTICS
     // we need the statistics initialized before restoring the keepalive state
     if (register_module_stats(exports.name, statistics) < 0) {
         LM_ERR("failed to initialize module statistics\n");
         return -1;
     }
+#endif /*STATISTICS*/
 
     // create hash table to hold NAT contacts
     nat_table = HashTable_new();