aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/a_iface.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-05-29 13:18:44 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-18 17:50:08 +0200
commitdfe085d979ba8b7266a6c66ecb13bf5a11a8d86f (patch)
tree20a343521ce9e91024471c7b4e9728f2ddcf26d5 /openbsc/src/libmsc/a_iface.c
parente818b91729de56db7643c0961f810c1652f65701 (diff)
osmo-msc: Integrate A interface into existing call control
The MSC already has some basic call control handling mechanism, that was primarily used with 3G before. However, the already existing code that handles the 3G calls is also perfectly fine for handling 2G calls. This commit integrates the A interface without breaking it for 3G.
Diffstat (limited to 'openbsc/src/libmsc/a_iface.c')
-rw-r--r--openbsc/src/libmsc/a_iface.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/openbsc/src/libmsc/a_iface.c b/openbsc/src/libmsc/a_iface.c
index 029860300..545cdaada 100644
--- a/openbsc/src/libmsc/a_iface.c
+++ b/openbsc/src/libmsc/a_iface.c
@@ -29,6 +29,8 @@
#include <openbsc/a_iface.h>
#include <openbsc/a_iface_bssap.h>
#include <openbsc/transaction.h>
+#include <openbsc/mgcpgw_client.h>
+#include <osmocom/core/byteswap.h>
/* A pointer to the GSM network we work with. By the current paradigm,
* there can only be one gsm_network per MSC. The pointer is set once
@@ -128,15 +130,14 @@ int a_assign(struct gsm_trans *trans)
{
struct gsm_subscriber_connection *conn;
struct gsm0808_channel_type ct;
- uint16_t cic;
- uint16_t *cic_ptr = NULL;
- struct sockaddr_storage *ss = NULL;
struct gsm0808_speech_codec_list *scl = NULL;
uint32_t *ci_ptr = NULL;
+ struct msgb *msg;
+ struct sockaddr_storage rtp_addr;
+ struct sockaddr_in rtp_addr_in;
conn = trans->conn;
OSMO_ASSERT(conn);
- struct msgb *msg;
/* FIXME: This is still work in progress */
/* Some fake parameters for testing */
@@ -145,14 +146,19 @@ int a_assign(struct gsm_trans *trans)
ct.perm_spch[0] = GSM0808_PERM_FR1;
ct.perm_spch_len = 1;
- cic = 0x0023;
- cic_ptr = &cic;
+ /* Package RTP-Address data */
+ memset(&rtp_addr_in, 0, sizeof(rtp_addr_in));
+ rtp_addr_in.sin_family = AF_INET;
+ rtp_addr_in.sin_port = osmo_htons(conn->iu.mgcp_rtp_port_ue);
+ rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcpgw_client_remote_addr_n(gsm_network->mgcpgw.client));
- msg = gsm0808_create_ass(&ct, cic_ptr, ss, scl, ci_ptr);
+ memset(&rtp_addr, 0, sizeof(rtp_addr));
+ memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in));
+
+ msg = gsm0808_create_ass(&ct, NULL, &rtp_addr, scl, ci_ptr);
LOGP(DMSC, LOGL_DEBUG, "N-DATA.req(%u, %s)\n", conn->a.conn_id, osmo_hexdump(msg->data, msg->len));
return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg);
-
}
/* Callback function, called by the SSCP stack when data arrives */