From 212c0c9bdaf1166e3bcbab85f3ab31dc17162f5b Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 7 Dec 2018 14:47:34 +0100 Subject: move ASS-COMPL MGCP handling out of a_iface_bssap.c BSSMAP Assignment Complete: sort MGCP handling upon Assignment Complete to the proper locations. a_iface_bssap.c is not the right place to invoke the MGCP related procedures. - in a_iface_bssap.c only decode the IEs. - call ran_conn_assign_compl() and pass decoded values. - drop msc_assign_compl(), it was dead code; instead: - add ran_conn_assign_compl() - pass on all MGCP related info to msc_mgcp_ass_complete() - move all MGCP ctx related handling from a_iface_bssap.c to msc_mgcp.c. I'm dropping some comments to save some time, because if I adjust them IMHO they would still anyway restate the obvious. ran_conn_assign_compl() is now quite a thin shim, but it makes sense to have it: - This is the place that should tear down the ran_conn in case assignment failed, left for a future patch. - In the light of upcoming inter-MSC handover, ran_conn_assign_compl() will be the place where the Assignment Complete message might be relayed to a remote MSC. Change-Id: I8137215c443239bddf3e69b5715839a365b73b6c --- include/osmocom/msc/msc_mgcp.h | 5 ++++- include/osmocom/msc/ran_conn.h | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/osmocom/msc/msc_mgcp.h b/include/osmocom/msc/msc_mgcp.h index 9d8b01dd1..db8dff24c 100644 --- a/include/osmocom/msc/msc_mgcp.h +++ b/include/osmocom/msc/msc_mgcp.h @@ -24,6 +24,8 @@ #include struct ran_conn; +struct gsm0808_speech_codec; +struct sockaddr_storage; /* MGCP state handler context. This context information stores all information * to handle the direction of the RTP streams via MGCP. There is one instance @@ -58,6 +60,7 @@ struct mgcp_ctx { }; int msc_mgcp_call_assignment(struct gsm_trans *trans); -int msc_mgcp_ass_complete(struct ran_conn *conn, uint16_t port, char *addr); +int msc_mgcp_ass_complete(struct ran_conn *conn, const struct gsm0808_speech_codec *speech_codec_chosen, + const struct sockaddr_storage *aoip_transport_addr); int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr); int msc_mgcp_call_release(struct gsm_trans *trans); diff --git a/include/osmocom/msc/ran_conn.h b/include/osmocom/msc/ran_conn.h index d71872e8e..3716f865d 100644 --- a/include/osmocom/msc/ran_conn.h +++ b/include/osmocom/msc/ran_conn.h @@ -7,6 +7,9 @@ #include #include +struct gsm0808_speech_codec; +struct sockaddr_storage; + enum ran_type { RAN_UNKNOWN, RAN_GERAN_A, /* 2G / A-interface */ @@ -197,6 +200,8 @@ void ran_conn_rx_sec_mode_compl(struct ran_conn *conn); void ran_conn_classmark_chg(struct ran_conn *conn, const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len); +void ran_conn_assign_compl(struct ran_conn *conn, const struct gsm0808_speech_codec *speech_codec_chosen, + const struct sockaddr_storage *aoip_transport_addr); void ran_conn_assign_fail(struct ran_conn *conn, uint8_t cause, uint8_t *rr_cause); void ran_conn_init(void); -- cgit v1.2.3