Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (2/2)

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Apr 10 17:56:33 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13585


Change subject: fix inter-BSC-HO-incoming for AoIP (2/2)
......................................................................

fix inter-BSC-HO-incoming for AoIP (2/2)

For AoIP, the AoIP Transport Layer Address IE must be included in the Handover
Request Acknowledge message, so the MSC can send RTP to the right place. Add
this IE for AoIP.

Depends: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576 (libosmocore)
Depends: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 (libosmocore)
Change-Id: Ia05e37da125eb6e7b7be9b974b73261bd72de1f4
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 32 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/85/13585/1

diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 65618fd..4849b1d 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -40,8 +40,10 @@
 #include <osmocom/bsc/osmo_bsc_lcls.h>
 #include <osmocom/bsc/a_reset.h>
 #include <osmocom/bsc/handover.h>
+#include <osmocom/bsc/mgw_endpoint_fsm.h>
 #include <osmocom/core/fsm.h>
 #include <osmocom/core/socket.h>
+#include <osmocom/core/sockaddr_str.h>
 
 #define IP_V4_ADDR_LEN 4
 
@@ -1185,14 +1187,38 @@
 {
 	struct msgb *msg;
 	struct gsm_lchan *new_lchan = conn->ho.new_lchan;
+	struct sockaddr_storage ss;
+	struct gsm0808_handover_request_ack params = {
+		.l3_info = rr_ho_command->data,
+		.l3_info_len = rr_ho_command->len,
+		.chosen_channel_present = true,
+		.chosen_channel = gsm0808_chosen_channel(new_lchan->type, new_lchan->tch_mode),
+		.chosen_encr_alg = new_lchan->encr.alg_id,
+		.chosen_speech_version = gsm0808_permitted_speech(new_lchan->type, new_lchan->tch_mode),
+	};
+
+	if (gscon_is_aoip(conn)) {
+		struct osmo_sockaddr_str to_msc_rtp;
+		const struct mgcp_conn_peer *rtp_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc);
+		if (!rtp_info) {
+			LOG_HO(conn, LOGL_ERROR,
+			       "Handover Request Acknowledge: no RTP address known to send as"
+			       " AoIP Transport Layer Address\n");
+			return -EINVAL;
+		}
+		if (osmo_sockaddr_str_from_str(&to_msc_rtp, rtp_info->addr, rtp_info->port)) {
+			LOG_HO(conn, LOGL_ERROR, "Handover Request Acknowledge: cannot encode AoIP Transport Layer\n");
+			return -EINVAL;
+		}
+		if (osmo_sockaddr_str_to_sockaddr(&to_msc_rtp, &ss)) {
+			LOG_HO(conn, LOGL_ERROR, "Handover Request Acknowledge: cannot encode AoIP Transport Layer\n");
+			return -EINVAL;
+		}
+		params.aoip_transport_layer = &ss;
+	}
 
 	LOG_HO(conn, LOGL_DEBUG, "Sending BSSMAP Handover Request Acknowledge\n");
-	msg = gsm0808_create_handover_request_ack(rr_ho_command->data, rr_ho_command->len,
-						  gsm0808_chosen_channel(new_lchan->type,
-									 new_lchan->tch_mode),
-						  new_lchan->encr.alg_id,
-						  gsm0808_permitted_speech(new_lchan->type,
-									   new_lchan->tch_mode));
+	msg = gsm0808_create_handover_request_ack2(&params);
 	msgb_free(rr_ho_command);
 	if (!msg)
 		return -ENOMEM;

-- 
To view, visit https://gerrit.osmocom.org/13585
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia05e37da125eb6e7b7be9b974b73261bd72de1f4
Gerrit-Change-Number: 13585
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190410/e63159f1/attachment.html>


More information about the gerrit-log mailing list