From 62bfa37eae97fb8eee65a4c3d6a1138999811e75 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 31 Oct 2022 18:51:07 +0100 Subject: rtp_stream: allow multiple codecs / use codec filter from Assignment Allow configuring MGW conns with multiple codecs. The new codecs filter can have multiple results, and MGCP can configure multiple codecs. Get rid of this bottleneck, that so far limits to a single codec to MGW. On Assignment Complete, set codec_filter.assignment to the assigned codec, and use that to set the resulting codec (possibly multiple codecs in the future) to create the CN side MGW endpoint. Related: SYS#5066 Change-Id: If9c67b298b30f893ec661f84c9fc622ad01b5ee5 --- include/osmocom/msc/call_leg.h | 4 +++- include/osmocom/msc/msc_ho.h | 4 ++-- include/osmocom/msc/rtp_stream.h | 11 +++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/osmocom/msc/call_leg.h b/include/osmocom/msc/call_leg.h index a225b6683..c7d3b9739 100644 --- a/include/osmocom/msc/call_leg.h +++ b/include/osmocom/msc/call_leg.h @@ -12,6 +12,7 @@ struct gsm_network; struct gsm_trans; struct rtp_stream; enum rtp_direction; +struct sdp_audio_codecs; extern struct osmo_tdef g_mgw_tdefs[]; @@ -74,7 +75,8 @@ int call_leg_local_bridge(struct call_leg *cl1, uint32_t call_id1, struct gsm_tr int call_leg_ensure_rtp_alloc(struct call_leg *cl, enum rtp_direction dir, uint32_t call_id, struct gsm_trans *for_trans); int call_leg_ensure_ci(struct call_leg *cl, enum rtp_direction dir, uint32_t call_id, struct gsm_trans *for_trans, - const enum mgcp_codecs *codec_if_known, const struct osmo_sockaddr_str *remote_addr_if_known); + const struct sdp_audio_codecs *codecs_if_known, + const struct osmo_sockaddr_str *remote_addr_if_known); struct osmo_sockaddr_str *call_leg_local_ip(struct call_leg *cl, enum rtp_direction dir); void call_leg_rtp_stream_gone(struct call_leg *cl, struct rtp_stream *rtps); diff --git a/include/osmocom/msc/msc_ho.h b/include/osmocom/msc/msc_ho.h index 99956f1e6..a3f60c7f2 100644 --- a/include/osmocom/msc/msc_ho.h +++ b/include/osmocom/msc/msc_ho.h @@ -31,7 +31,7 @@ #include #include #include - +#include struct gsm0808_handover_required; @@ -92,7 +92,7 @@ struct msc_ho_state { struct { /* Saved RTP IP:port and codec in case we need to roll back */ struct osmo_sockaddr_str ran_remote_rtp; - enum mgcp_codecs codec; + struct sdp_audio_codecs codecs; } old_cell; }; diff --git a/include/osmocom/msc/rtp_stream.h b/include/osmocom/msc/rtp_stream.h index c53c4f179..afc5725f9 100644 --- a/include/osmocom/msc/rtp_stream.h +++ b/include/osmocom/msc/rtp_stream.h @@ -5,6 +5,7 @@ #include #include +#include struct gsm_trans; @@ -37,9 +38,9 @@ struct rtp_stream { struct osmo_sockaddr_str remote; bool remote_sent_to_mgw; - bool codec_known; - enum mgcp_codecs codec; - bool codec_sent_to_mgw; + bool codecs_known; + struct sdp_audio_codecs codecs; + bool codecs_sent_to_mgw; struct osmo_mgcpc_ep_ci *ci; @@ -64,7 +65,9 @@ struct rtp_stream *rtp_stream_alloc(struct call_leg *parent_call_leg, enum rtp_d int rtp_stream_ensure_ci(struct rtp_stream *rtps, struct osmo_mgcpc_ep *at_endpoint); int rtp_stream_do_mdcx(struct rtp_stream *rtps); -void rtp_stream_set_codec(struct rtp_stream *rtps, enum mgcp_codecs codec); +bool rtp_stream_set_codecs_from_mgcp_codec(struct rtp_stream *rtps, enum mgcp_codecs codec); +void rtp_stream_set_one_codec(struct rtp_stream *rtps, const struct sdp_audio_codec *codec); +void rtp_stream_set_codecs(struct rtp_stream *rtps, const struct sdp_audio_codecs *codecs); void rtp_stream_set_remote_addr(struct rtp_stream *rtps, const struct osmo_sockaddr_str *r); void rtp_stream_set_remote_osmux_cid(struct rtp_stream *rtps, uint8_t osmux_cid); int rtp_stream_commit(struct rtp_stream *rtps); -- cgit v1.2.3