libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
This change introduces some new rate counters for call-independent SS/USSD connections. As OsmoMSC doesn't handle the messages itself, and only responsible for dispatching messages between both A and GSUP interfaces, the following is taken into account: - MS-initiated and network-initiated requests to establish a NC SS/USSD session (transaction) - "nc_ss:m{o|t}_requests"; - successfully established MS-initiated and network-initiated SS/USSD sessions (transactions) - "nc_ss:m{o|t}_established". Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
This commit is contained in:
parent
fcc24ed553
commit
8e25cc5298
|
@ -200,6 +200,10 @@ enum {
|
||||||
MSC_CTR_CALL_ACTIVE,
|
MSC_CTR_CALL_ACTIVE,
|
||||||
MSC_CTR_CALL_COMPLETE,
|
MSC_CTR_CALL_COMPLETE,
|
||||||
MSC_CTR_CALL_INCOMPLETE,
|
MSC_CTR_CALL_INCOMPLETE,
|
||||||
|
MSC_CTR_NC_SS_MO_REQUESTS,
|
||||||
|
MSC_CTR_NC_SS_MO_ESTABLISHED,
|
||||||
|
MSC_CTR_NC_SS_MT_REQUESTS,
|
||||||
|
MSC_CTR_NC_SS_MT_ESTABLISHED,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct rate_ctr_desc msc_ctr_description[] = {
|
static const struct rate_ctr_desc msc_ctr_description[] = {
|
||||||
|
@ -227,6 +231,10 @@ static const struct rate_ctr_desc msc_ctr_description[] = {
|
||||||
[MSC_CTR_CALL_ACTIVE] = {"call:active", "Count total amount of calls that ever reached active state."},
|
[MSC_CTR_CALL_ACTIVE] = {"call:active", "Count total amount of calls that ever reached active state."},
|
||||||
[MSC_CTR_CALL_COMPLETE] = {"call:complete", "Count total amount of calls which got terminated by disconnect req or ind after reaching active state."},
|
[MSC_CTR_CALL_COMPLETE] = {"call:complete", "Count total amount of calls which got terminated by disconnect req or ind after reaching active state."},
|
||||||
[MSC_CTR_CALL_INCOMPLETE] = {"call:incomplete", "Count total amount of call which got terminated by any other reason after reaching active state."},
|
[MSC_CTR_CALL_INCOMPLETE] = {"call:incomplete", "Count total amount of call which got terminated by any other reason after reaching active state."},
|
||||||
|
[MSC_CTR_NC_SS_MO_REQUESTS] = {"nc_ss:mo_requests", "Received MS-initiated call independent SS/USSD requests."},
|
||||||
|
[MSC_CTR_NC_SS_MO_ESTABLISHED] = {"nc_ss:mo_established", "Established MS-initiated call independent SS/USSD sessions."},
|
||||||
|
[MSC_CTR_NC_SS_MT_REQUESTS] = {"nc_ss:mt_requests", "Received network-initiated call independent SS/USSD requests."},
|
||||||
|
[MSC_CTR_NC_SS_MT_ESTABLISHED] = {"nc_ss:mt_established", "Established network-initiated call independent SS/USSD sessions."},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct rate_ctr_group_desc msc_ctrg_desc = {
|
static const struct rate_ctr_group_desc msc_ctrg_desc = {
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include <osmocom/core/linuxlist.h>
|
#include <osmocom/core/linuxlist.h>
|
||||||
|
#include <osmocom/core/rate_ctr.h>
|
||||||
#include <osmocom/core/utils.h>
|
#include <osmocom/core/utils.h>
|
||||||
#include <osmocom/core/msgb.h>
|
#include <osmocom/core/msgb.h>
|
||||||
#include <osmocom/gsm/tlv.h>
|
#include <osmocom/gsm/tlv.h>
|
||||||
|
@ -74,6 +75,9 @@ int gsm0911_rcv_nc_ss(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
||||||
/* Reuse existing transaction, or create a new one */
|
/* Reuse existing transaction, or create a new one */
|
||||||
trans = trans_find_by_id(conn, pdisc, tid);
|
trans = trans_find_by_id(conn, pdisc, tid);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
|
/* Count MS-initiated attempts to establish a NC SS/USSD session */
|
||||||
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* According to GSM TS 04.80, section 2.4.2 "Register
|
* According to GSM TS 04.80, section 2.4.2 "Register
|
||||||
* (mobile station to network direction)", the REGISTER
|
* (mobile station to network direction)", the REGISTER
|
||||||
|
@ -185,6 +189,10 @@ int gsm0911_rcv_nc_ss(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
||||||
else
|
else
|
||||||
msc_subscr_conn_communicating(conn);
|
msc_subscr_conn_communicating(conn);
|
||||||
|
|
||||||
|
/* Count established MS-initiated NC SS/USSD sessions */
|
||||||
|
if (msg_type == GSM0480_MTYPE_REGISTER)
|
||||||
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -233,6 +241,9 @@ static int handle_paging_event(unsigned int hooknum, unsigned int event,
|
||||||
/* Sent to the MS, give ownership of ss_msg */
|
/* Sent to the MS, give ownership of ss_msg */
|
||||||
msc_tx_dtap(transt->conn, ss_msg);
|
msc_tx_dtap(transt->conn, ss_msg);
|
||||||
transt->ss.msg = NULL;
|
transt->ss.msg = NULL;
|
||||||
|
|
||||||
|
/* Count established network-initiated NC SS/USSD sessions */
|
||||||
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]);
|
||||||
break;
|
break;
|
||||||
case GSM_PAGING_EXPIRED:
|
case GSM_PAGING_EXPIRED:
|
||||||
case GSM_PAGING_BUSY:
|
case GSM_PAGING_BUSY:
|
||||||
|
@ -386,6 +397,9 @@ int gsm0911_gsup_handler(struct vlr_subscr *vsub,
|
||||||
/* Attempt to find DTAP-transaction */
|
/* Attempt to find DTAP-transaction */
|
||||||
trans = trans_find_by_callref(net, gsup_msg->session_id);
|
trans = trans_find_by_callref(net, gsup_msg->session_id);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
|
/* Count network-initiated attempts to establish a NC SS/USSD session */
|
||||||
|
rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS]);
|
||||||
|
|
||||||
/* Attempt to establish a new transaction */
|
/* Attempt to establish a new transaction */
|
||||||
trans = establish_nc_ss_trans(net, vsub, gsup_msg);
|
trans = establish_nc_ss_trans(net, vsub, gsup_msg);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
|
@ -464,5 +478,9 @@ int gsm0911_gsup_handler(struct vlr_subscr *vsub,
|
||||||
if (trans_end)
|
if (trans_end)
|
||||||
trans_free(trans);
|
trans_free(trans);
|
||||||
|
|
||||||
|
/* Count established network-initiated NC SS/USSD sessions */
|
||||||
|
if (gsup_msg->session_state == OSMO_GSUP_SESSION_STATE_BEGIN)
|
||||||
|
rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1217,6 +1217,18 @@ DEFUN(show_stats,
|
||||||
gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MT_SETUP].current,
|
gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MT_SETUP].current,
|
||||||
gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MT_CONNECT].current,
|
gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MT_CONNECT].current,
|
||||||
VTY_NEWLINE);
|
VTY_NEWLINE);
|
||||||
|
vty_out(vty, "MO NC SS/USSD : %lu requests, %lu established, %lu rejected%s",
|
||||||
|
gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS].current,
|
||||||
|
gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED].current,
|
||||||
|
gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS].current
|
||||||
|
- gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED].current,
|
||||||
|
VTY_NEWLINE);
|
||||||
|
vty_out(vty, "MT NC SS/USSD : %lu requests, %lu established, %lu rejected%s",
|
||||||
|
gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS].current,
|
||||||
|
gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED].current,
|
||||||
|
gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS].current
|
||||||
|
- gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED].current,
|
||||||
|
VTY_NEWLINE);
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue