aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/msc/transaction.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/osmocom/msc/transaction.h')
-rw-r--r--include/osmocom/msc/transaction.h55
1 files changed, 39 insertions, 16 deletions
diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h
index 7ffcf3b78..99aca55ef 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -6,18 +6,21 @@
#include <osmocom/core/fsm.h>
#include <osmocom/msc/gsm_04_11.h>
#include <osmocom/msc/mncc.h>
+#include <osmocom/msc/msc_a.h>
#include <osmocom/msc/debug.h>
#include <osmocom/gsm/gsm0411_smc.h>
#include <osmocom/gsm/gsm0411_smr.h>
+struct vty;
+
/* Used for late TID assignment */
#define TRANS_ID_UNASSIGNED 0xff
#define LOG_TRANS_CAT(trans, subsys, level, fmt, args...) \
LOGP(subsys, level, \
"trans(%s %s callref-0x%x tid-%u%s) " fmt, \
- (trans) ? gsm48_pdisc_name((trans)->protocol) : "NULL", \
- (trans) ? ((trans)->conn ? (trans)->conn->fi->id : vlr_subscr_name((trans)->vsub)) : "NULL", \
+ (trans) ? trans_type_name((trans)->type) : "NULL", \
+ (trans) ? ((trans)->msc_a ? (trans)->msc_a->c.fi->id : vlr_subscr_name((trans)->vsub)) : "NULL", \
(trans) ? (trans)->callref : 0, \
(trans) ? (trans)->transaction_id : 0, \
(trans) && (trans)->paging_request ? ",PAGING" : "", \
@@ -34,6 +37,19 @@ enum bridge_state {
BRIDGE_STATE_BRIDGE_ESTABLISHED,
};
+enum trans_type {
+ TRANS_CC = GSM48_PDISC_CC,
+ TRANS_SMS = GSM48_PDISC_SMS,
+ TRANS_USSD = GSM48_PDISC_NC_SS,
+ TRANS_SILENT_CALL,
+};
+
+extern const struct value_string trans_type_names[];
+static inline const char *trans_type_name(enum trans_type val)
+{ return get_value_string(trans_type_names, val); }
+
+uint8_t trans_type_to_gsm48_proto(enum trans_type type);
+
/* One transaction */
struct gsm_trans {
/* Entry in list of all transactions */
@@ -42,8 +58,8 @@ struct gsm_trans {
/* Back pointer to the network struct */
struct gsm_network *net;
- /* The protocol within which we live */
- uint8_t protocol;
+ /* What kind of transaction */
+ enum trans_type type;
/* The current transaction ID */
uint8_t transaction_id;
@@ -55,7 +71,7 @@ struct gsm_trans {
struct vlr_subscr *vsub;
/* The associated connection we are using to transmit messages */
- struct ran_conn *conn;
+ struct msc_a *msc_a;
/* reference from MNCC or other application */
uint32_t callref;
@@ -64,7 +80,7 @@ struct gsm_trans {
int tch_recv;
/* is thats one paging? */
- struct subscr_request *paging_request;
+ struct paging_request *paging_request;
/* bearer capabilities (rate and codec) */
struct gsm_mncc_bearer_cap bearer_cap;
@@ -85,7 +101,6 @@ struct gsm_trans {
struct osmo_timer_list timer;
struct osmo_timer_list timer_guard;
struct gsm_mncc msg; /* stores setup/disconnect/release message */
- bool assignment_started;
} cc;
struct {
struct gsm411_smc_inst smc_inst;
@@ -105,6 +120,11 @@ struct gsm_trans {
/* Inactivity timer, triggers transaction release */
struct osmo_timer_list timer_guard;
} ss;
+ struct {
+ struct gsm0808_channel_type ct;
+ struct osmo_sockaddr_str rtp_cn;
+ struct vty *from_vty;
+ } silent_call;
};
struct {
@@ -115,8 +135,9 @@ struct gsm_trans {
-struct gsm_trans *trans_find_by_id(const struct ran_conn *conn,
- uint8_t proto, uint8_t trans_id);
+struct gsm_trans *trans_find_by_type(const struct msc_a *msc_a, enum trans_type type);
+struct gsm_trans *trans_find_by_id(const struct msc_a *msc_a,
+ enum trans_type type, uint8_t trans_id);
struct gsm_trans *trans_find_by_callref(const struct gsm_network *net,
uint32_t callref);
struct gsm_trans *trans_find_by_sm_rp_mr(const struct gsm_network *net,
@@ -125,26 +146,28 @@ struct gsm_trans *trans_find_by_sm_rp_mr(const struct gsm_network *net,
struct gsm_trans *trans_alloc(struct gsm_network *net,
struct vlr_subscr *vsub,
- uint8_t protocol, uint8_t trans_id,
+ enum trans_type type, uint8_t trans_id,
uint32_t callref);
void trans_free(struct gsm_trans *trans);
int trans_assign_trans_id(const struct gsm_network *net, const struct vlr_subscr *vsub,
- uint8_t protocol);
-struct gsm_trans *trans_has_conn(const struct ran_conn *conn);
-void trans_conn_closed(const struct ran_conn *conn);
+ enum trans_type type);
+struct gsm_trans *trans_has_conn(const struct msc_a *msc_a);
+void trans_conn_closed(const struct msc_a *msc_a);
static inline int trans_log_subsys(const struct gsm_trans *trans)
{
if (!trans)
return DMSC;
- switch (trans->protocol) {
- case GSM48_PDISC_CC:
+ switch (trans->type) {
+ case TRANS_CC:
return DCC;
- case GSM48_PDISC_SMS:
+ case TRANS_SMS:
return DLSMS;
default:
break;
}
+ if (trans->msc_a)
+ return trans->msc_a->c.ran->log_subsys;
return DMSC;
}