blob: 3bf079bd6bc7760140ce0fc5235942aef7e3a6ab [file] [log] [blame]
Philipp Maierc66ab2c2020-06-02 20:55:34 +02001/* A Media Gateway Control Protocol Media Gateway: RFC 3435 */
2/* rate-counter implementation */
3
4/*
5 * (C) 2009-2012 by Holger Hans Peter Freyther <zecke@selfish.org>
6 * (C) 2009-2012 by On-Waves
7 * (C) 2017-2020 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
8 * All Rights Reserved
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
19 *
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 */
24
25#include <errno.h>
26#include <osmocom/core/stats.h>
Philipp Maier124a3e02021-07-26 11:17:15 +020027#include <osmocom/core/stat_item.h>
Philipp Maier993ea6b2020-08-04 18:26:50 +020028#include <osmocom/mgcp/mgcp_conn.h>
Philipp Maiera065e632021-07-09 13:22:42 +020029#include <osmocom/mgcp/mgcp_trunk.h>
Philipp Maier124a3e02021-07-26 11:17:15 +020030#include <osmocom/mgcp/mgcp_protocol.h>
31#include <osmocom/mgcp/mgcp_endp.h>
Philipp Maierc66ab2c2020-06-02 20:55:34 +020032#include <osmocom/mgcp/mgcp_ratectr.h>
33
34static const struct rate_ctr_desc mgcp_general_ctr_desc[] = {
35 /* rx_msgs = rx_msgs_retransmitted + rx_msgs_handled + rx_msgs_unhandled + err_rx_msg_parse + err_rx_no_endpoint */
36 [MGCP_GENERAL_RX_MSGS_TOTAL] = { "mgcp:rx_msgs", "total number of MGCP messages received." },
37 [MGCP_GENERAL_RX_MSGS_RETRANSMITTED] = { "mgcp:rx_msgs_retransmitted", "number of received retransmissions." },
38 [MGCP_GENERAL_RX_MSGS_HANDLED] = { "mgcp:rx_msgs_handled", "number of handled MGCP messages." },
39 [MGCP_GENERAL_RX_MSGS_UNHANDLED] = { "mgcp:rx_msgs_unhandled", "number of unhandled MGCP messages." },
40 [MGCP_GENERAL_RX_FAIL_MSG_PARSE] = { "mgcp:err_rx_msg_parse", "error parsing MGCP message." },
41 [MGCP_GENERAL_RX_FAIL_NO_ENDPOINT] =
42 { "mgcp:err_rx_no_endpoint", "can't find MGCP endpoint, probably we've used all allocated endpoints." },
43};
44
45const static struct rate_ctr_group_desc mgcp_general_ctr_group_desc = {
46 .group_name_prefix = "mgcp",
47 .group_description = "mgcp general statistics",
48 .class_id = OSMO_STATS_CLASS_GLOBAL,
49 .num_ctr = ARRAY_SIZE(mgcp_general_ctr_desc),
50 .ctr_desc = mgcp_general_ctr_desc
51};
52
53static const struct rate_ctr_desc mgcp_crcx_ctr_desc[] = {
54 [MGCP_CRCX_SUCCESS] = { "crcx:success", "CRCX command processed successfully." },
55 [MGCP_CRCX_FAIL_BAD_ACTION] = { "crcx:bad_action", "bad action in CRCX command." },
56 [MGCP_CRCX_FAIL_UNHANDLED_PARAM] = { "crcx:unhandled_param", "unhandled parameter in CRCX command." },
57 [MGCP_CRCX_FAIL_MISSING_CALLID] = { "crcx:missing_callid", "missing CallId in CRCX command." },
58 [MGCP_CRCX_FAIL_INVALID_MODE] = { "crcx:invalid_mode", "invalid connection mode in CRCX command." },
59 [MGCP_CRCX_FAIL_LIMIT_EXCEEDED] = { "crcx:limit_exceeded", "limit of concurrent connections was reached." },
60 [MGCP_CRCX_FAIL_UNKNOWN_CALLID] = { "crcx:unkown_callid", "unknown CallId in CRCX command." },
61 [MGCP_CRCX_FAIL_ALLOC_CONN] = { "crcx:alloc_conn_fail", "connection allocation failure." },
62 [MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC] =
63 { "crcx:no_remote_conn_desc", "no opposite end specified for connection." },
64 [MGCP_CRCX_FAIL_START_RTP] = { "crcx:start_rtp_failure", "failure to start RTP processing." },
65 [MGCP_CRCX_FAIL_REJECTED_BY_POLICY] = { "crcx:conn_rejected", "connection rejected by policy." },
66 [MGCP_CRCX_FAIL_NO_OSMUX] = { "crcx:no_osmux", "no osmux offered by peer." },
67 [MGCP_CRCX_FAIL_INVALID_CONN_OPTIONS] = { "crcx:conn_opt", "connection options invalid." },
68 [MGCP_CRCX_FAIL_CODEC_NEGOTIATION] = { "crcx:codec_nego", "codec negotiation failure." },
69 [MGCP_CRCX_FAIL_BIND_PORT] = { "crcx:bind_port", "port bind failure." },
Philipp Maier8d6a1932020-06-18 12:19:31 +020070 [MGCP_CRCX_FAIL_AVAIL] = { "crcx:unavailable", "endpoint unavailable." },
Philipp Maier889fe7f2020-07-06 17:44:12 +020071 [MGCP_CRCX_FAIL_CLAIM] = { "crcx:claim", "endpoint can not be claimed." },
Philipp Maierc66ab2c2020-06-02 20:55:34 +020072};
73
74const static struct rate_ctr_group_desc mgcp_crcx_ctr_group_desc = {
75 .group_name_prefix = "crcx",
76 .group_description = "crxc statistics",
77 .class_id = OSMO_STATS_CLASS_GLOBAL,
78 .num_ctr = ARRAY_SIZE(mgcp_crcx_ctr_desc),
79 .ctr_desc = mgcp_crcx_ctr_desc
80};
81
82static const struct rate_ctr_desc mgcp_mdcx_ctr_desc[] = {
83 [MGCP_MDCX_SUCCESS] = { "mdcx:success", "MDCX command processed successfully." },
84 [MGCP_MDCX_FAIL_WILDCARD] = { "mdcx:wildcard", "wildcard endpoint names in MDCX commands are unsupported." },
85 [MGCP_MDCX_FAIL_NO_CONN] = { "mdcx:no_conn", "endpoint specified in MDCX command has no active connections." },
86 [MGCP_MDCX_FAIL_INVALID_CALLID] = { "mdcx:callid", "invalid CallId specified in MDCX command." },
87 [MGCP_MDCX_FAIL_INVALID_CONNID] = { "mdcx:connid", "invalid connection ID specified in MDCX command." },
88 [MGCP_MDCX_FAIL_UNHANDLED_PARAM] = { "crcx:unhandled_param", "unhandled parameter in MDCX command." },
89 [MGCP_MDCX_FAIL_NO_CONNID] = { "mdcx:no_connid", "no connection ID specified in MDCX command." },
90 [MGCP_MDCX_FAIL_CONN_NOT_FOUND] =
91 { "mdcx:conn_not_found", "connection specified in MDCX command does not exist." },
92 [MGCP_MDCX_FAIL_INVALID_MODE] = { "mdcx:invalid_mode", "invalid connection mode in MDCX command." },
93 [MGCP_MDCX_FAIL_INVALID_CONN_OPTIONS] = { "mdcx:conn_opt", "connection options invalid." },
94 [MGCP_MDCX_FAIL_NO_REMOTE_CONN_DESC] =
95 { "mdcx:no_remote_conn_desc", "no opposite end specified for connection." },
96 [MGCP_MDCX_FAIL_START_RTP] = { "mdcx:start_rtp_failure", "failure to start RTP processing." },
97 [MGCP_MDCX_FAIL_REJECTED_BY_POLICY] = { "mdcx:conn_rejected", "connection rejected by policy." },
98 [MGCP_MDCX_DEFERRED_BY_POLICY] = { "mdcx:conn_deferred", "connection deferred by policy." },
Philipp Maier8d6a1932020-06-18 12:19:31 +020099 [MGCP_MDCX_FAIL_AVAIL] = { "mdcx:unavailable", "endpoint unavailable." },
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200100};
101
102const static struct rate_ctr_group_desc mgcp_mdcx_ctr_group_desc = {
103 .group_name_prefix = "mdcx",
104 .group_description = "mdcx statistics",
105 .class_id = OSMO_STATS_CLASS_GLOBAL,
106 .num_ctr = ARRAY_SIZE(mgcp_mdcx_ctr_desc),
107 .ctr_desc = mgcp_mdcx_ctr_desc
108};
109
110static const struct rate_ctr_desc mgcp_dlcx_ctr_desc[] = {
111 [MGCP_DLCX_SUCCESS] = { "dlcx:success", "DLCX command processed successfully." },
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200112 [MGCP_DLCX_FAIL_NO_CONN] = { "dlcx:no_conn", "endpoint specified in DLCX command has no active connections." },
113 [MGCP_DLCX_FAIL_INVALID_CALLID] =
114 { "dlcx:callid", "CallId specified in DLCX command mismatches endpoint's CallId ." },
115 [MGCP_DLCX_FAIL_INVALID_CONNID] =
116 { "dlcx:connid", "connection ID specified in DLCX command does not exist on endpoint." },
117 [MGCP_DLCX_FAIL_UNHANDLED_PARAM] = { "dlcx:unhandled_param", "unhandled parameter in DLCX command." },
118 [MGCP_DLCX_FAIL_REJECTED_BY_POLICY] = { "dlcx:rejected", "connection deletion rejected by policy." },
119 [MGCP_DLCX_DEFERRED_BY_POLICY] = { "dlcx:deferred", "connection deletion deferred by policy." },
Philipp Maier8d6a1932020-06-18 12:19:31 +0200120 [MGCP_DLCX_FAIL_AVAIL] = { "dlcx:unavailable", "endpoint unavailable." },
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200121};
122
123const static struct rate_ctr_group_desc mgcp_dlcx_ctr_group_desc = {
124 .group_name_prefix = "dlcx",
125 .group_description = "dlcx statistics",
126 .class_id = OSMO_STATS_CLASS_GLOBAL,
127 .num_ctr = ARRAY_SIZE(mgcp_dlcx_ctr_desc),
128 .ctr_desc = mgcp_dlcx_ctr_desc
129};
130
Philipp Maier889fe7f2020-07-06 17:44:12 +0200131static const struct rate_ctr_desc e1_rate_ctr_desc[] = {
Philipp Maier97cae472021-07-09 13:26:47 +0200132 [E1_I460_TRAU_RX_FAIL_CTR] = { "e1:rx_fail", "Inbound I.460 TRAU failures." },
133 [E1_I460_TRAU_TX_FAIL_CTR] = { "e1:tx_fail", "Outbound I.460 TRAU failures." },
134 [E1_I460_TRAU_MUX_EMPTY_CTR] = { "e1:i460", "Outbound I.460 MUX queue empty." }
Philipp Maier889fe7f2020-07-06 17:44:12 +0200135};
136
137const static struct rate_ctr_group_desc e1_rate_ctr_group_desc = {
138 .group_name_prefix = "e1",
139 .group_description = "e1 statistics",
140 .class_id = OSMO_STATS_CLASS_GLOBAL,
141 .num_ctr = ARRAY_SIZE(e1_rate_ctr_desc),
142 .ctr_desc = e1_rate_ctr_desc
143};
144
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200145const static struct rate_ctr_group_desc all_rtp_conn_rate_ctr_group_desc = {
146 .group_name_prefix = "all_rtp_conn",
147 .group_description = "aggregated statistics for all rtp connections",
148 .class_id = 1,
149 .num_ctr = ARRAY_SIZE(all_rtp_conn_rate_ctr_desc),
150 .ctr_desc = all_rtp_conn_rate_ctr_desc
151};
152
Philipp Maiera065e632021-07-09 13:22:42 +0200153/*! allocate global rate counters
154 * (called once at startup).
155 * \param[in] cfg mgw configuration for which the rate counters are allocated.
156 * \returns 0 on success, -EINVAL on failure. */
157int mgcp_ratectr_global_alloc(struct mgcp_config *cfg)
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200158{
Philipp Maiera065e632021-07-09 13:22:42 +0200159 struct mgcp_ratectr_global *ratectr = &cfg->ratectr;
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200160 static unsigned int general_rate_ctr_index = 0;
Philipp Maiera065e632021-07-09 13:22:42 +0200161 char ctr_name[512];
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200162
163 if (ratectr->mgcp_general_ctr_group == NULL) {
164 ratectr->mgcp_general_ctr_group =
Philipp Maiera065e632021-07-09 13:22:42 +0200165 rate_ctr_group_alloc(cfg, &mgcp_general_ctr_group_desc, general_rate_ctr_index);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200166 if (!ratectr->mgcp_general_ctr_group)
167 return -EINVAL;
Philipp Maiera065e632021-07-09 13:22:42 +0200168 snprintf(ctr_name, sizeof(ctr_name), "%s:general", cfg->domain);
169 rate_ctr_group_set_name(ratectr->mgcp_general_ctr_group, ctr_name);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200170 general_rate_ctr_index++;
171 }
172 return 0;
173}
174
Philipp Maier38533ba2021-07-29 17:38:34 +0200175/*! free global rate counters
176 * (called once at process shutdown).
177 * \param[in] cfg mgw configuration for which the rate counters are allocated. */
178void mgcp_ratectr_global_free(struct mgcp_config *cfg)
179{
180 struct mgcp_ratectr_global *ratectr = &cfg->ratectr;
181
182 if (ratectr->mgcp_general_ctr_group) {
183 rate_ctr_group_free(ratectr->mgcp_general_ctr_group);
184 ratectr->mgcp_general_ctr_group = NULL;
185 }
186}
187
Philipp Maiera065e632021-07-09 13:22:42 +0200188/*! allocate trunk specific rate counters
189 * (called once on trunk initialization).
190 * \param[in] trunk mgw trunk for which the rate counters are allocated.
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200191 * \returns 0 on success, -EINVAL on failure */
Philipp Maiera065e632021-07-09 13:22:42 +0200192int mgcp_ratectr_trunk_alloc(struct mgcp_trunk *trunk)
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200193{
Philipp Maiera065e632021-07-09 13:22:42 +0200194 struct mgcp_ratectr_trunk *ratectr = &trunk->ratectr;
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200195 static unsigned int crcx_rate_ctr_index = 0;
196 static unsigned int mdcx_rate_ctr_index = 0;
197 static unsigned int dlcx_rate_ctr_index = 0;
198 static unsigned int all_rtp_conn_rate_ctr_index = 0;
Philipp Maiera065e632021-07-09 13:22:42 +0200199 char ctr_name[256];
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200200
201 if (ratectr->mgcp_crcx_ctr_group == NULL) {
Philipp Maiera065e632021-07-09 13:22:42 +0200202 ratectr->mgcp_crcx_ctr_group =
203 rate_ctr_group_alloc(trunk, &mgcp_crcx_ctr_group_desc, crcx_rate_ctr_index);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200204 if (!ratectr->mgcp_crcx_ctr_group)
205 return -EINVAL;
Philipp Maierd70eef62021-07-19 13:53:28 +0200206 snprintf(ctr_name, sizeof(ctr_name), "%s-%u:crcx", mgcp_trunk_type_strs_str(trunk->trunk_type),
Philipp Maiera065e632021-07-09 13:22:42 +0200207 trunk->trunk_nr);
208 rate_ctr_group_set_name(ratectr->mgcp_crcx_ctr_group, ctr_name);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200209 crcx_rate_ctr_index++;
210 }
211 if (ratectr->mgcp_mdcx_ctr_group == NULL) {
Philipp Maiera065e632021-07-09 13:22:42 +0200212 ratectr->mgcp_mdcx_ctr_group =
213 rate_ctr_group_alloc(trunk, &mgcp_mdcx_ctr_group_desc, mdcx_rate_ctr_index);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200214 if (!ratectr->mgcp_mdcx_ctr_group)
215 return -EINVAL;
Philipp Maierd70eef62021-07-19 13:53:28 +0200216 snprintf(ctr_name, sizeof(ctr_name), "%s-%u:mdcx", mgcp_trunk_type_strs_str(trunk->trunk_type),
Philipp Maiera065e632021-07-09 13:22:42 +0200217 trunk->trunk_nr);
218 rate_ctr_group_set_name(ratectr->mgcp_mdcx_ctr_group, ctr_name);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200219 mdcx_rate_ctr_index++;
220 }
221 if (ratectr->mgcp_dlcx_ctr_group == NULL) {
Philipp Maiera065e632021-07-09 13:22:42 +0200222 ratectr->mgcp_dlcx_ctr_group =
223 rate_ctr_group_alloc(trunk, &mgcp_dlcx_ctr_group_desc, dlcx_rate_ctr_index);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200224 if (!ratectr->mgcp_dlcx_ctr_group)
225 return -EINVAL;
Philipp Maierd70eef62021-07-19 13:53:28 +0200226 snprintf(ctr_name, sizeof(ctr_name), "%s-%u:dlcx", mgcp_trunk_type_strs_str(trunk->trunk_type),
Philipp Maiera065e632021-07-09 13:22:42 +0200227 trunk->trunk_nr);
228 rate_ctr_group_set_name(ratectr->mgcp_dlcx_ctr_group, ctr_name);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200229 dlcx_rate_ctr_index++;
230 }
231 if (ratectr->all_rtp_conn_stats == NULL) {
Philipp Maiera065e632021-07-09 13:22:42 +0200232 ratectr->all_rtp_conn_stats = rate_ctr_group_alloc(trunk, &all_rtp_conn_rate_ctr_group_desc,
233 all_rtp_conn_rate_ctr_index);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200234 if (!ratectr->all_rtp_conn_stats)
235 return -EINVAL;
Philipp Maierd70eef62021-07-19 13:53:28 +0200236 snprintf(ctr_name, sizeof(ctr_name), "%s-%u:rtp_conn", mgcp_trunk_type_strs_str(trunk->trunk_type),
Philipp Maiera065e632021-07-09 13:22:42 +0200237 trunk->trunk_nr);
238 rate_ctr_group_set_name(ratectr->all_rtp_conn_stats, ctr_name);
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200239 all_rtp_conn_rate_ctr_index++;
240 }
Philipp Maiera065e632021-07-09 13:22:42 +0200241
242 /* E1 specific */
243 if (trunk->trunk_type == MGCP_TRUNK_E1 && ratectr->e1_stats == NULL) {
244 ratectr->e1_stats = rate_ctr_group_alloc(trunk, &e1_rate_ctr_group_desc, mdcx_rate_ctr_index);
Philipp Maier889fe7f2020-07-06 17:44:12 +0200245 if (!ratectr->e1_stats)
246 return -EINVAL;
Philipp Maierd70eef62021-07-19 13:53:28 +0200247 snprintf(ctr_name, sizeof(ctr_name), "%s-%u:e1", mgcp_trunk_type_strs_str(trunk->trunk_type),
Philipp Maiera065e632021-07-09 13:22:42 +0200248 trunk->trunk_nr);
249 rate_ctr_group_set_name(ratectr->e1_stats, ctr_name);
Philipp Maier889fe7f2020-07-06 17:44:12 +0200250 mdcx_rate_ctr_index++;
251 }
Philipp Maierc66ab2c2020-06-02 20:55:34 +0200252 return 0;
253}
Philipp Maier124a3e02021-07-26 11:17:15 +0200254
Philipp Maier38533ba2021-07-29 17:38:34 +0200255/*! free trunk specific rate counters
256 * (called once when trunk is freed).
257 * \param[in] trunk mgw trunk on which the rate counters are allocated. */
258void mgcp_ratectr_trunk_free(struct mgcp_trunk *trunk)
259{
260 struct mgcp_ratectr_trunk *ratectr = &trunk->ratectr;
261
262 if (ratectr->mgcp_crcx_ctr_group) {
263 rate_ctr_group_free(ratectr->mgcp_crcx_ctr_group);
264 ratectr->mgcp_crcx_ctr_group = NULL;
265 }
266 if (ratectr->mgcp_mdcx_ctr_group) {
267 rate_ctr_group_free(ratectr->mgcp_mdcx_ctr_group);
268 ratectr->mgcp_mdcx_ctr_group = NULL;
269 }
270 if (ratectr->mgcp_dlcx_ctr_group) {
271 rate_ctr_group_free(ratectr->mgcp_dlcx_ctr_group);
272 ratectr->mgcp_dlcx_ctr_group = NULL;
273 }
274 if (ratectr->all_rtp_conn_stats) {
275 rate_ctr_group_free(ratectr->all_rtp_conn_stats);
276 ratectr->all_rtp_conn_stats = NULL;
277 }
278
279 /* E1 specific */
280 if (ratectr->e1_stats) {
281 rate_ctr_group_free(ratectr->e1_stats);
282 ratectr->e1_stats = NULL;
283 }
284}
285
Philipp Maier124a3e02021-07-26 11:17:15 +0200286const struct osmo_stat_item_desc trunk_stat_desc[] = {
287 [TRUNK_STAT_ENDPOINTS_TOTAL] = { "endpoints:total",
288 "Number of endpoints that exist on the trunk",
289 "", 60, 0 },
290 [TRUNK_STAT_ENDPOINTS_USED] = { "endpoints:used",
291 "Number of endpoints in use",
292 "", 60, 0 },
293};
294
295const struct osmo_stat_item_group_desc trunk_statg_desc = {
296 .group_name_prefix = "trunk",
297 .group_description = "mgw trunk",
298 .class_id = OSMO_STATS_CLASS_GLOBAL,
299 .num_items = ARRAY_SIZE(trunk_stat_desc),
300 .item_desc = trunk_stat_desc,
301};
302
Philipp Maier124a3e02021-07-26 11:17:15 +0200303/*! allocate trunk specific stat items
304 * (called once on trunk initialization).
305 * \param[in] trunk for which the stat items are allocated.
306 * \returns 0 on success, -EINVAL on failure. */
307int mgcp_stat_trunk_alloc(struct mgcp_trunk *trunk)
308{
309 struct mgcp_stat_trunk *stats = &trunk->stats;
310 static unsigned int common_stat_index = 0;
311 char stat_name[256];
312
313 stats->common = osmo_stat_item_group_alloc(trunk, &trunk_statg_desc, common_stat_index);
314 if (!stats->common)
315 return -EINVAL;
316 snprintf(stat_name, sizeof(stat_name), "%s-%u:common", mgcp_trunk_type_strs_str(trunk->trunk_type),
317 trunk->trunk_nr);
318 osmo_stat_item_group_set_name(stats->common, stat_name);
Philipp Maier124a3e02021-07-26 11:17:15 +0200319 common_stat_index++;
320
321 return 0;
322}
Philipp Maier38533ba2021-07-29 17:38:34 +0200323
324/*! free trunk specific stat items
325 * (called once when trunk is freed).
326 * \param[in] trunk on which the stat items are allocated. */
327void mgcp_stat_trunk_free(struct mgcp_trunk *trunk)
328{
329 struct mgcp_stat_trunk *stats = &trunk->stats;
330
331 if (stats->common) {
332 osmo_stat_item_group_free(stats->common);
333 stats->common = NULL;
334 }
335}