nat_traversal(k): register stats only ifdef STATISTICS
authorAndrei Pelinescu-Onciul <andrei@iptel.org>
Thu, 26 Aug 2010 19:30:44 +0000 (21:30 +0200)
committerAndrei Pelinescu-Onciul <andrei@iptel.org>
Thu, 26 Aug 2010 20:00:01 +0000 (22:00 +0200)
modules_k/nat_traversal/nat_traversal.c

index 3e90117..559fb49 100644 (file)
@@ -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();