Merge remote branch 'origin/sr_3.0'
[sip-router] / events.c
index 5fc5028..6b29fa2 100644 (file)
--- a/events.c
+++ b/events.c
@@ -55,6 +55,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;
        }
@@ -98,6 +103,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;
        }