Module: sip-router
Branch: kamailio_3.0
Commit: 47c89177ce276cdf8f6a2d06fdd3359ba283fe4c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=47c8917…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Oct 13 20:47:35 2009 +0200
core: added new event SREV_CORE_STATS
- to be used by Kamailio core statistics not included in stock SR core
---
events.c | 12 ++++++++++++
events.h | 2 ++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/events.c b/events.c
index 0d07395..be98221 100644
--- a/events.c
+++ b/events.c
@@ -48,6 +48,11 @@ int sr_event_register_cb(int type, sr_event_cb_f f)
_sr_events_list.net_data_out = f;
else return -1;
break;
+ case SREV_CORE_STATS:
+ if(_sr_events_list.core_stats==0)
+ _sr_events_list.core_stats = f;
+ else return -1;
+ break;
default:
return -1;
}
@@ -91,6 +96,13 @@ int sr_event_exec(int type, void *data)
return ret;
} else return 1;
break;
+ case SREV_CORE_STATS:
+ if(unlikely(_sr_events_list.core_stats!=0))
+ {
+ ret = _sr_events_list.core_stats(data);
+ return ret;
+ } else return 1;
+ break;
default:
return -1;
}
diff --git a/events.h b/events.h
index 9fda619..9af0d71 100644
--- a/events.h
+++ b/events.h
@@ -25,12 +25,14 @@
#define SREV_NET_DATA_IN 1
#define SREV_NET_DATA_OUT 2
+#define SREV_CORE_STATS 3
typedef int (*sr_event_cb_f)(void *data);
typedef struct sr_event_cb {
sr_event_cb_f net_data_in;
sr_event_cb_f net_data_out;
+ sr_event_cb_f core_stats;
} sr_event_cb_t;
void sr_event_cb_init(void);