Module: sip-router
Branch: master
Commit: b3c6ac1339901e83fcec6f689c0f007f69a101b4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b3c6ac1…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Thu Aug 26 21:30:44 2010 +0200
nat_traversal(k): register stats only ifdef STATISTICS
---
modules_k/nat_traversal/nat_traversal.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/modules_k/nat_traversal/nat_traversal.c
b/modules_k/nat_traversal/nat_traversal.c
index 3e90117..559fb49 100644
--- a/modules_k/nat_traversal/nat_traversal.c
+++ b/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, ®istered_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();