aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-05-09 16:23:11 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-10 07:13:53 +0000
commitf50d13045e89ee395b29d436572c921a25e9477d (patch)
tree933761eb7c45d5103ae822383d2c8e060e0ef9e7
parent265a4c7489ed295a11a46aeb88319f211dc8989a (diff)
call_leg: document the parent_event_* items
-rw-r--r--include/osmocom/msc/call_leg.h1
-rw-r--r--src/libmsc/call_leg.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/include/osmocom/msc/call_leg.h b/include/osmocom/msc/call_leg.h
index 61107ee2a..d8380f52b 100644
--- a/include/osmocom/msc/call_leg.h
+++ b/include/osmocom/msc/call_leg.h
@@ -34,6 +34,7 @@ struct call_leg {
/* Array indexed by enum rtp_direction. */
enum mgcp_connection_mode crcx_conn_mode[2];
+ /* Events dispatched to the parent fi, see call_leg_alloc() doc. */
uint32_t parent_event_rtp_addr_available;
uint32_t parent_event_rtp_complete;
diff --git a/src/libmsc/call_leg.c b/src/libmsc/call_leg.c
index 1b7db2bbc..46405bcaa 100644
--- a/src/libmsc/call_leg.c
+++ b/src/libmsc/call_leg.c
@@ -64,6 +64,14 @@ void call_leg_init(struct gsm_network *net)
OSMO_ASSERT( osmo_fsm_register(&call_leg_fsm) == 0 );
}
+/* Allocate a call leg FSM instance as child of an arbitrary other FSM instance.
+ * The call leg FSM dispatches events to its parent FSM instance on specific events:
+ * - parent_event_term: dispatch this to the parent FI when the call leg terminates (call ended, either planned or by
+ * failure).
+ * - parent_event_rtp_addr_available: one of the rtp_stream instances managed by the call leg has received an RTP
+ * address from the MGW. The struct rtp_stream instance is passed as data argument for the event dispatch.
+ * - parent_event_rtp_complete: one of the rtp_stream instances entered the RTP_STREAM_ST_ESTABLISHED state.
+ */
struct call_leg *call_leg_alloc(struct osmo_fsm_inst *parent_fi,
uint32_t parent_event_term,
uint32_t parent_event_rtp_addr_available,