Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,119 +0,0 @@
1
-/*
2
- * $Id$
3
- *
4
- * Copyright (C) 2012 Smile Communications, jason.penton@smilecoms.com
5
- * Copyright (C) 2012 Smile Communications, richard.good@smilecoms.com
6
- * 
7
- * The initial version of this code was written by Dragos Vingarzan
8
- * (dragos(dot)vingarzan(at)fokus(dot)fraunhofer(dot)de and the
9
- * Fruanhofer Institute. It was and still is maintained in a separate
10
- * branch of the original SER. We are therefore migrating it to
11
- * Kamailio/SR and look forward to maintaining it from here on out.
12
- * 2011/2012 Smile Communications, Pty. Ltd.
13
- * ported/maintained/improved by 
14
- * Jason Penton (jason(dot)penton(at)smilecoms.com and
15
- * Richard Good (richard(dot)good(at)smilecoms.com) as part of an 
16
- * effort to add full IMS support to Kamailio/SR using a new and
17
- * improved architecture
18
- * 
19
- * NB: Alot of this code was originally part of OpenIMSCore,
20
- * FhG Fokus. 
21
- * Copyright (C) 2004-2006 FhG Fokus
22
- * Thanks for great work! This is an effort to 
23
- * break apart the various CSCF functions into logically separate
24
- * components. We hope this will drive wider use. We also feel
25
- * that in this way the architecture is more complete and thereby easier
26
- * to manage in the Kamailio/SR environment
27
- *
28
- * This file is part of Kamailio, a free SIP server.
29
- *
30
- * Kamailio is free software; you can redistribute it and/or modify
31
- * it under the terms of the GNU General Public License as published by
32
- * the Free Software Foundation; either version 2 of the License, or
33
- * (at your option) any later version
34
- *
35
- * Kamailio is distributed in the hope that it will be useful,
36
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
37
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
38
- * GNU General Public License for more details.
39
- *
40
- * You should have received a copy of the GNU General Public License 
41
- * along with this program; if not, write to the Free Software 
42
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
43
- * 
44
- *
45
- *
46
- *
47
- * History:
48
- * --------
49
- *  2011-02-02  initial version (jason.penton)
50
- */
51
-
52
-
53
-#include "ims_qos_stats.h"
54
-
55
-struct ims_qos_counters_h ims_qos_cnts_h;
56
-enum sctp_info_req { IMS_QOS_REGISTRATION_AAR_AVG_RSP, IMS_QOS_MEDIA_AAR_AVG_RSP };
57
-
58
-static counter_val_t ims_qos_internal_stats(counter_handle_t h, void* what);
59
-
60
-counter_def_t ims_qos_cnt_defs[] = {
61
-    {&ims_qos_cnts_h.active_registration_rx_sessions,	    "active_registration_rx_sessions",		0, 0, 0,	    "number of currently active registration Rx sessions"},
62
-    {&ims_qos_cnts_h.registration_aar_avg_response_time,    "registration_aar_avg_response_time",	0, ims_qos_internal_stats, (void*) (long) IMS_QOS_REGISTRATION_AAR_AVG_RSP,	"avg response time for registration AARs"},
63
-    {&ims_qos_cnts_h.registration_aar_timeouts,		    "registration_aar_timeouts",		0, 0, 0,	    "total number of registration AAR timeouts"},
64
-    {&ims_qos_cnts_h.failed_registration_aars,		    "failed_registration_aars",			0, 0, 0,	    "total number of failed registration AARs"},
65
-    {&ims_qos_cnts_h.registration_aars,			    "registration_aars",			0, 0, 0,	    "total number of registration AARs"},
66
-    {&ims_qos_cnts_h.asrs,				    "asrs",					0, 0, 0,	    "total number of registration ASRs"},
67
-    {&ims_qos_cnts_h.successful_registration_aars,	    "successful_registration_aars",		0, 0, 0,	    "total number of successful registration AARs"},
68
-    {&ims_qos_cnts_h.registration_aar_response_time,	    "registration_aar_response_time",		0, 0, 0,	    "total number of seconds waiting for registration AAR responses"},
69
-    {&ims_qos_cnts_h.registration_aar_replies_received,	    "registration_aar_replies_received",	0, 0, 0,            "total number of registration AAR replies received"},
70
-
71
-    {&ims_qos_cnts_h.active_media_rx_sessions,		    "active_media_rx_sessions",		0, 0, 0,		    "number of currently active media Rx sessions"},
72
-	{&ims_qos_cnts_h.media_rx_sessions,		    "media_rx_sessions",		0, 0, 0,		    "Total number of media Rx sessions"},
73
-    {&ims_qos_cnts_h.media_aar_avg_response_time,	    "media_aar_avg_response_time",	0, ims_qos_internal_stats, (void*) (long) IMS_QOS_MEDIA_AAR_AVG_RSP,	"avg response time for media AARs"},
74
-    {&ims_qos_cnts_h.media_aar_timeouts,		    "media_aar_timeouts",		0, 0, 0,		    "total number of media AAR timeouts"},
75
-    {&ims_qos_cnts_h.failed_media_aars,			    "failed_media_aars",		0, 0, 0,		    "total number of failed media AARs"},
76
-    {&ims_qos_cnts_h.media_aars,			    "media_aars",			0, 0, 0,		    "total number of media AARs"},
77
-    {&ims_qos_cnts_h.successful_media_aars,		    "successful_media_aars",		0, 0, 0,		    "total number of successful media AARs"},
78
-    {&ims_qos_cnts_h.media_aar_response_time,		    "media_aar_response_time",		0, 0, 0,		    "total number of seconds waiting for media AAR responses"},
79
-    {&ims_qos_cnts_h.media_aar_replies_received,	    "media_aar_replies_received",	0, 0, 0,                    "total number of media AAR replies received"},
80
-    {0, 0, 0, 0, 0, 0}
81
-};
82
-
83
-
84
-int ims_qos_init_counters() {
85
-    if (counter_register_array("ims_qos", ims_qos_cnt_defs) < 0)
86
-	goto error;
87
-    return 0;
88
-error:
89
-    return -1;
90
-}
91
-
92
-void ims_qos_destroy_counters() {
93
-    
94
-}
95
-
96
-/** helper function for some stats (which are kept internally).
97
- */
98
-static counter_val_t ims_qos_internal_stats(counter_handle_t h, void* what) {
99
-    enum sctp_info_req w;
100
-
101
-    w = (int) (long) what;
102
-    switch (w) {
103
-	case IMS_QOS_REGISTRATION_AAR_AVG_RSP:
104
-	    if (counter_get_val(ims_qos_cnts_h.registration_aars) == 0) 
105
-		return 0;
106
-	    else
107
-		return counter_get_val(ims_qos_cnts_h.registration_aar_response_time)/counter_get_val(ims_qos_cnts_h.registration_aars);
108
-	    break;
109
-	case IMS_QOS_MEDIA_AAR_AVG_RSP:
110
-	    if (counter_get_val(ims_qos_cnts_h.media_aars) == 0) 
111
-		return 0;
112
-	    else
113
-		return counter_get_val(ims_qos_cnts_h.media_aar_response_time)/counter_get_val(ims_qos_cnts_h.media_aars);
114
-	    break;
115
-	default:
116
-	    return 0;
117
-    };
118
-    return 0;
119
-}
Browse code

modules/ims_qos: added additional stat for total number of rx media sessions

Richard Good authored on 21/09/2016 07:57:09
Showing 1 changed files
... ...
@@ -69,6 +69,7 @@ counter_def_t ims_qos_cnt_defs[] = {
69 69
     {&ims_qos_cnts_h.registration_aar_replies_received,	    "registration_aar_replies_received",	0, 0, 0,            "total number of registration AAR replies received"},
70 70
 
71 71
     {&ims_qos_cnts_h.active_media_rx_sessions,		    "active_media_rx_sessions",		0, 0, 0,		    "number of currently active media Rx sessions"},
72
+	{&ims_qos_cnts_h.media_rx_sessions,		    "media_rx_sessions",		0, 0, 0,		    "Total number of media Rx sessions"},
72 73
     {&ims_qos_cnts_h.media_aar_avg_response_time,	    "media_aar_avg_response_time",	0, ims_qos_internal_stats, (void*) (long) IMS_QOS_MEDIA_AAR_AVG_RSP,	"avg response time for media AARs"},
73 74
     {&ims_qos_cnts_h.media_aar_timeouts,		    "media_aar_timeouts",		0, 0, 0,		    "total number of media AAR timeouts"},
74 75
     {&ims_qos_cnts_h.failed_media_aars,			    "failed_media_aars",		0, 0, 0,		    "total number of failed media AARs"},
Browse code

modules/ims_qos: fixed stat typo

Richard Good authored on 14/04/2015 08:03:21
Showing 1 changed files
... ...
@@ -66,7 +66,7 @@ counter_def_t ims_qos_cnt_defs[] = {
66 66
     {&ims_qos_cnts_h.asrs,				    "asrs",					0, 0, 0,	    "total number of registration ASRs"},
67 67
     {&ims_qos_cnts_h.successful_registration_aars,	    "successful_registration_aars",		0, 0, 0,	    "total number of successful registration AARs"},
68 68
     {&ims_qos_cnts_h.registration_aar_response_time,	    "registration_aar_response_time",		0, 0, 0,	    "total number of seconds waiting for registration AAR responses"},
69
-    {&ims_qos_cnts_h.registration_aar_replies_received,	    "registration_aar_replies_received",	0, 0, 0,                    "total number of media AAR replies received"},
69
+    {&ims_qos_cnts_h.registration_aar_replies_received,	    "registration_aar_replies_received",	0, 0, 0,            "total number of registration AAR replies received"},
70 70
 
71 71
     {&ims_qos_cnts_h.active_media_rx_sessions,		    "active_media_rx_sessions",		0, 0, 0,		    "number of currently active media Rx sessions"},
72 72
     {&ims_qos_cnts_h.media_aar_avg_response_time,	    "media_aar_avg_response_time",	0, ims_qos_internal_stats, (void*) (long) IMS_QOS_MEDIA_AAR_AVG_RSP,	"avg response time for media AARs"},
Browse code

modules:ims_qos: separated stat aar_replies_received into media_aar_replies_received and registration_aar_replies_received

Richard Good authored on 14/04/2015 08:01:02
Showing 1 changed files
... ...
@@ -66,6 +66,7 @@ counter_def_t ims_qos_cnt_defs[] = {
66 66
     {&ims_qos_cnts_h.asrs,				    "asrs",					0, 0, 0,	    "total number of registration ASRs"},
67 67
     {&ims_qos_cnts_h.successful_registration_aars,	    "successful_registration_aars",		0, 0, 0,	    "total number of successful registration AARs"},
68 68
     {&ims_qos_cnts_h.registration_aar_response_time,	    "registration_aar_response_time",		0, 0, 0,	    "total number of seconds waiting for registration AAR responses"},
69
+    {&ims_qos_cnts_h.registration_aar_replies_received,	    "registration_aar_replies_received",	0, 0, 0,                    "total number of media AAR replies received"},
69 70
 
70 71
     {&ims_qos_cnts_h.active_media_rx_sessions,		    "active_media_rx_sessions",		0, 0, 0,		    "number of currently active media Rx sessions"},
71 72
     {&ims_qos_cnts_h.media_aar_avg_response_time,	    "media_aar_avg_response_time",	0, ims_qos_internal_stats, (void*) (long) IMS_QOS_MEDIA_AAR_AVG_RSP,	"avg response time for media AARs"},
... ...
@@ -74,7 +75,7 @@ counter_def_t ims_qos_cnt_defs[] = {
74 75
     {&ims_qos_cnts_h.media_aars,			    "media_aars",			0, 0, 0,		    "total number of media AARs"},
75 76
     {&ims_qos_cnts_h.successful_media_aars,		    "successful_media_aars",		0, 0, 0,		    "total number of successful media AARs"},
76 77
     {&ims_qos_cnts_h.media_aar_response_time,		    "media_aar_response_time",		0, 0, 0,		    "total number of seconds waiting for media AAR responses"},
77
-    {&ims_qos_cnts_h.aar_replies_received,		    "aar_replies_received",		0, 0, 0,                    "total number of AAR replies received"},
78
+    {&ims_qos_cnts_h.media_aar_replies_received,	    "media_aar_replies_received",	0, 0, 0,                    "total number of media AAR replies received"},
78 79
     {0, 0, 0, 0, 0, 0}
79 80
 };
80 81
 
Browse code

modules:ims_qos: Added new stat aar_replies_received

Richard Good authored on 14/04/2015 07:37:43
Showing 1 changed files
... ...
@@ -74,6 +74,7 @@ counter_def_t ims_qos_cnt_defs[] = {
74 74
     {&ims_qos_cnts_h.media_aars,			    "media_aars",			0, 0, 0,		    "total number of media AARs"},
75 75
     {&ims_qos_cnts_h.successful_media_aars,		    "successful_media_aars",		0, 0, 0,		    "total number of successful media AARs"},
76 76
     {&ims_qos_cnts_h.media_aar_response_time,		    "media_aar_response_time",		0, 0, 0,		    "total number of seconds waiting for media AAR responses"},
77
+    {&ims_qos_cnts_h.aar_replies_received,		    "aar_replies_received",		0, 0, 0,                    "total number of AAR replies received"},
77 78
     {0, 0, 0, 0, 0, 0}
78 79
 };
79 80
 
Browse code

modules/ims_qos: Added stats framework and basic stats

Richard Good authored on 26/02/2015 08:57:29
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,116 @@
1
+/*
2
+ * $Id$
3
+ *
4
+ * Copyright (C) 2012 Smile Communications, jason.penton@smilecoms.com
5
+ * Copyright (C) 2012 Smile Communications, richard.good@smilecoms.com
6
+ * 
7
+ * The initial version of this code was written by Dragos Vingarzan
8
+ * (dragos(dot)vingarzan(at)fokus(dot)fraunhofer(dot)de and the
9
+ * Fruanhofer Institute. It was and still is maintained in a separate
10
+ * branch of the original SER. We are therefore migrating it to
11
+ * Kamailio/SR and look forward to maintaining it from here on out.
12
+ * 2011/2012 Smile Communications, Pty. Ltd.
13
+ * ported/maintained/improved by 
14
+ * Jason Penton (jason(dot)penton(at)smilecoms.com and
15
+ * Richard Good (richard(dot)good(at)smilecoms.com) as part of an 
16
+ * effort to add full IMS support to Kamailio/SR using a new and
17
+ * improved architecture
18
+ * 
19
+ * NB: Alot of this code was originally part of OpenIMSCore,
20
+ * FhG Fokus. 
21
+ * Copyright (C) 2004-2006 FhG Fokus
22
+ * Thanks for great work! This is an effort to 
23
+ * break apart the various CSCF functions into logically separate
24
+ * components. We hope this will drive wider use. We also feel
25
+ * that in this way the architecture is more complete and thereby easier
26
+ * to manage in the Kamailio/SR environment
27
+ *
28
+ * This file is part of Kamailio, a free SIP server.
29
+ *
30
+ * Kamailio is free software; you can redistribute it and/or modify
31
+ * it under the terms of the GNU General Public License as published by
32
+ * the Free Software Foundation; either version 2 of the License, or
33
+ * (at your option) any later version
34
+ *
35
+ * Kamailio is distributed in the hope that it will be useful,
36
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
37
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
38
+ * GNU General Public License for more details.
39
+ *
40
+ * You should have received a copy of the GNU General Public License 
41
+ * along with this program; if not, write to the Free Software 
42
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
43
+ * 
44
+ *
45
+ *
46
+ *
47
+ * History:
48
+ * --------
49
+ *  2011-02-02  initial version (jason.penton)
50
+ */
51
+
52
+
53
+#include "ims_qos_stats.h"
54
+
55
+struct ims_qos_counters_h ims_qos_cnts_h;
56
+enum sctp_info_req { IMS_QOS_REGISTRATION_AAR_AVG_RSP, IMS_QOS_MEDIA_AAR_AVG_RSP };
57
+
58
+static counter_val_t ims_qos_internal_stats(counter_handle_t h, void* what);
59
+
60
+counter_def_t ims_qos_cnt_defs[] = {
61
+    {&ims_qos_cnts_h.active_registration_rx_sessions,	    "active_registration_rx_sessions",		0, 0, 0,	    "number of currently active registration Rx sessions"},
62
+    {&ims_qos_cnts_h.registration_aar_avg_response_time,    "registration_aar_avg_response_time",	0, ims_qos_internal_stats, (void*) (long) IMS_QOS_REGISTRATION_AAR_AVG_RSP,	"avg response time for registration AARs"},
63
+    {&ims_qos_cnts_h.registration_aar_timeouts,		    "registration_aar_timeouts",		0, 0, 0,	    "total number of registration AAR timeouts"},
64
+    {&ims_qos_cnts_h.failed_registration_aars,		    "failed_registration_aars",			0, 0, 0,	    "total number of failed registration AARs"},
65
+    {&ims_qos_cnts_h.registration_aars,			    "registration_aars",			0, 0, 0,	    "total number of registration AARs"},
66
+    {&ims_qos_cnts_h.asrs,				    "asrs",					0, 0, 0,	    "total number of registration ASRs"},
67
+    {&ims_qos_cnts_h.successful_registration_aars,	    "successful_registration_aars",		0, 0, 0,	    "total number of successful registration AARs"},
68
+    {&ims_qos_cnts_h.registration_aar_response_time,	    "registration_aar_response_time",		0, 0, 0,	    "total number of seconds waiting for registration AAR responses"},
69
+
70
+    {&ims_qos_cnts_h.active_media_rx_sessions,		    "active_media_rx_sessions",		0, 0, 0,		    "number of currently active media Rx sessions"},
71
+    {&ims_qos_cnts_h.media_aar_avg_response_time,	    "media_aar_avg_response_time",	0, ims_qos_internal_stats, (void*) (long) IMS_QOS_MEDIA_AAR_AVG_RSP,	"avg response time for media AARs"},
72
+    {&ims_qos_cnts_h.media_aar_timeouts,		    "media_aar_timeouts",		0, 0, 0,		    "total number of media AAR timeouts"},
73
+    {&ims_qos_cnts_h.failed_media_aars,			    "failed_media_aars",		0, 0, 0,		    "total number of failed media AARs"},
74
+    {&ims_qos_cnts_h.media_aars,			    "media_aars",			0, 0, 0,		    "total number of media AARs"},
75
+    {&ims_qos_cnts_h.successful_media_aars,		    "successful_media_aars",		0, 0, 0,		    "total number of successful media AARs"},
76
+    {&ims_qos_cnts_h.media_aar_response_time,		    "media_aar_response_time",		0, 0, 0,		    "total number of seconds waiting for media AAR responses"},
77
+    {0, 0, 0, 0, 0, 0}
78
+};
79
+
80
+
81
+int ims_qos_init_counters() {
82
+    if (counter_register_array("ims_qos", ims_qos_cnt_defs) < 0)
83
+	goto error;
84
+    return 0;
85
+error:
86
+    return -1;
87
+}
88
+
89
+void ims_qos_destroy_counters() {
90
+    
91
+}
92
+
93
+/** helper function for some stats (which are kept internally).
94
+ */
95
+static counter_val_t ims_qos_internal_stats(counter_handle_t h, void* what) {
96
+    enum sctp_info_req w;
97
+
98
+    w = (int) (long) what;
99
+    switch (w) {
100
+	case IMS_QOS_REGISTRATION_AAR_AVG_RSP:
101
+	    if (counter_get_val(ims_qos_cnts_h.registration_aars) == 0) 
102
+		return 0;
103
+	    else
104
+		return counter_get_val(ims_qos_cnts_h.registration_aar_response_time)/counter_get_val(ims_qos_cnts_h.registration_aars);
105
+	    break;
106
+	case IMS_QOS_MEDIA_AAR_AVG_RSP:
107
+	    if (counter_get_val(ims_qos_cnts_h.media_aars) == 0) 
108
+		return 0;
109
+	    else
110
+		return counter_get_val(ims_qos_cnts_h.media_aar_response_time)/counter_get_val(ims_qos_cnts_h.media_aars);
111
+	    break;
112
+	default:
113
+	    return 0;
114
+    };
115
+    return 0;
116
+}