libmsc/gsm_09_11.c: introduce counter for active sessions
Change-Id: Ia17e7c747fffb5267d3ca5bc4193c1be4a57ef3a
This commit is contained in:
parent
2b2829fa70
commit
6afef893e1
|
@ -276,6 +276,7 @@ struct gsm_network {
|
||||||
|
|
||||||
struct rate_ctr_group *msc_ctrs;
|
struct rate_ctr_group *msc_ctrs;
|
||||||
struct osmo_counter *active_calls;
|
struct osmo_counter *active_calls;
|
||||||
|
struct osmo_counter *active_nc_ss;
|
||||||
|
|
||||||
/* layer 4 */
|
/* layer 4 */
|
||||||
struct mncc_sock_state *mncc_state;
|
struct mncc_sock_state *mncc_state;
|
||||||
|
|
|
@ -107,6 +107,9 @@ int gsm0911_rcv_nc_ss(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Count active NC SS/USSD sessions */
|
||||||
|
osmo_counter_inc(conn->network->active_nc_ss);
|
||||||
|
|
||||||
trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_NC_SS);
|
trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_NC_SS);
|
||||||
trans->dlci = OMSC_LINKID_CB(msg);
|
trans->dlci = OMSC_LINKID_CB(msg);
|
||||||
cm_service_request_concludes(conn, msg);
|
cm_service_request_concludes(conn, msg);
|
||||||
|
@ -300,6 +303,9 @@ static struct gsm_trans *establish_nc_ss_trans(struct gsm_network *net,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Count active NC SS/USSD sessions */
|
||||||
|
osmo_counter_inc(net->active_nc_ss);
|
||||||
|
|
||||||
/* Assign transaction ID */
|
/* Assign transaction ID */
|
||||||
tid = trans_assign_trans_id(trans->net,
|
tid = trans_assign_trans_id(trans->net,
|
||||||
trans->vsub, GSM48_PDISC_NC_SS, 0);
|
trans->vsub, GSM48_PDISC_NC_SS, 0);
|
||||||
|
@ -365,6 +371,9 @@ void _gsm911_nc_ss_trans_free(struct gsm_trans *trans)
|
||||||
*/
|
*/
|
||||||
if (trans->ss.msg != NULL)
|
if (trans->ss.msg != NULL)
|
||||||
msgb_free(trans->ss.msg);
|
msgb_free(trans->ss.msg);
|
||||||
|
|
||||||
|
/* One session less */
|
||||||
|
osmo_counter_dec(trans->net->active_nc_ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
int gsm0911_gsup_handler(struct vlr_subscr *vsub,
|
int gsm0911_gsup_handler(struct vlr_subscr *vsub,
|
||||||
|
|
|
@ -67,6 +67,7 @@ struct gsm_network *gsm_network_init(void *ctx, mncc_recv_cb_t mncc_recv)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
net->active_calls = osmo_counter_alloc("msc.active_calls");
|
net->active_calls = osmo_counter_alloc("msc.active_calls");
|
||||||
|
net->active_nc_ss = osmo_counter_alloc("msc.active_nc_ss");
|
||||||
|
|
||||||
net->mncc_recv = mncc_recv;
|
net->mncc_recv = mncc_recv;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue