aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/a_iface_bssap.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-12-07 14:47:34 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-12-10 14:20:59 +0100
commit212c0c9bdaf1166e3bcbab85f3ab31dc17162f5b (patch)
tree4ad74a043d97419657a49d464538fa9c7199bad0 /src/libmsc/a_iface_bssap.c
parent4e0dd536b4e6634eb9d54c76f478766a90c21b4c (diff)
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
Diffstat (limited to 'src/libmsc/a_iface_bssap.c')
-rw-r--r--src/libmsc/a_iface_bssap.c52
1 files changed, 1 insertions, 51 deletions
diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c
index d84a2346b..4e8b1468d 100644
--- a/src/libmsc/a_iface_bssap.c
+++ b/src/libmsc/a_iface_bssap.c
@@ -34,7 +34,6 @@
#include <osmocom/core/byteswap.h>
#include <osmocom/msc/a_reset.h>
#include <osmocom/msc/transaction.h>
-#include <osmocom/msc/msc_mgcp.h>
#include <errno.h>
@@ -498,51 +497,12 @@ static int bssmap_rx_sapi_n_rej(struct ran_conn *conn, struct msgb *msg,
return 0;
}
-/* Use the speech codec info we go with the assignment complete to dtermine
- * which codec we will signal to the MGW */
-static enum mgcp_codecs mgcp_codec_from_sc(struct gsm0808_speech_codec *sc)
-{
- switch (sc->type) {
- case GSM0808_SCT_FR1:
- return CODEC_GSM_8000_1;
- break;
- case GSM0808_SCT_FR2:
- return CODEC_GSMEFR_8000_1;
- break;
- case GSM0808_SCT_FR3:
- return CODEC_AMR_8000_1;
- break;
- case GSM0808_SCT_FR4:
- return CODEC_AMRWB_16000_1;
- break;
- case GSM0808_SCT_FR5:
- return CODEC_AMRWB_16000_1;
- break;
- case GSM0808_SCT_HR1:
- return CODEC_GSMHR_8000_1;
- break;
- case GSM0808_SCT_HR3:
- return CODEC_AMR_8000_1;
- break;
- case GSM0808_SCT_HR4:
- return CODEC_AMRWB_16000_1;
- break;
- case GSM0808_SCT_HR6:
- return CODEC_AMRWB_16000_1;
- break;
- default:
- return CODEC_PCMU_8000_1;
- break;
- }
-}
-
/* Endpoint to handle assignment complete */
static int bssmap_rx_ass_compl(struct ran_conn *conn, struct msgb *msg,
struct tlv_parsed *tp)
{
struct sockaddr_storage rtp_addr;
struct gsm0808_speech_codec sc;
- struct sockaddr_in *rtp_addr_in;
int rc;
LOGPCONN(conn, LOGL_INFO, "Rx BSSMAP ASSIGNMENT COMPLETE message\n");
@@ -567,18 +527,8 @@ static int bssmap_rx_ass_compl(struct ran_conn *conn, struct msgb *msg,
LOGPCONN(conn, LOGL_ERROR, "Unable to decode speech codec (choosen).\n");
return -EINVAL;
}
- conn->rtp.codec_ran = mgcp_codec_from_sc(&sc);
-
- /* use address / port supplied with the AoIP
- * transport address element */
- if (rtp_addr.ss_family == AF_INET) {
- rtp_addr_in = (struct sockaddr_in *)&rtp_addr;
- msc_mgcp_ass_complete(conn, osmo_ntohs(rtp_addr_in->sin_port), inet_ntoa(rtp_addr_in->sin_addr));
- } else {
- LOGPCONN(conn, LOGL_ERROR, "Unsopported addressing scheme. (supports only IPV4)\n");
- return -EINVAL;
- }
+ ran_conn_assign_compl(conn, &sc, &rtp_addr);
return 0;
}