osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27704 )
Change subject: bssap: forward paging from MSC to all BSCs
......................................................................
bssap: forward paging from MSC to all BSCs
I've considered only forwarding to specific BSCs based on the cell
identifier list inside the paging. For that, the cell identifier would
need to be stored beforehand (read it from location update? or put it in
vty config?) and I'm not sure if it is required, so don't do this for
now and extend it later if needed.
Related: SYS#5560
Related:
https://osmocom.org/projects/osmo-bscnat/wiki/AoIP_OsmoBSCNAT#PAGING-BSC
Change-Id: I2532d94aab82d136b932d57fa53c8ecf2d8d1fd9
---
M src/osmo-bsc-nat/bssap.c
1 file changed, 38 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc-nat refs/changes/04/27704/1
diff --git a/src/osmo-bsc-nat/bssap.c b/src/osmo-bsc-nat/bssap.c
index 94a450a..8e73a50 100644
--- a/src/osmo-bsc-nat/bssap.c
+++ b/src/osmo-bsc-nat/bssap.c
@@ -38,6 +38,41 @@
return osmo_sccp_tx_unitdata_msg(sccp_inst->scu, &sccp_inst->addr, addr,
msg);
}
+static int bssmap_cn_handle_paging(struct osmo_sccp_addr *addr, struct msgb *msg,
unsigned int length)
+{
+ struct bsc_nat_sccp_inst *sccp_inst = g_bsc_nat->ran.sccp_inst;
+ struct msc *msc = msc_get();
+ struct bsc *bsc;
+ int ret = 0;
+ int rc;
+
+ if (msc->addr.pc != addr->pc) {
+ LOGP(DMAIN, LOGL_ERROR, "Unexpected Rx PAGING in CN from %s, which is not
%s\n",
+ osmo_ss7_pointcode_print(NULL, addr->pc), talloc_get_name(msc));
+ return -1;
+ }
+
+ LOGP(DMAIN, LOGL_DEBUG, "Rx PAGING from %s\n", talloc_get_name(msc));
+
+ msgb_pull_to_l2(msg);
+
+ /* Page all BSCs */
+ llist_for_each_entry(bsc, &g_bsc_nat->ran.bscs, list) {
+ LOGP(DMAIN, LOGL_DEBUG, "Fwd to %s\n", talloc_get_name(bsc));
+ rc = osmo_sccp_tx_unitdata(sccp_inst->scu,
+ &sccp_inst->addr,
+ &bsc->addr,
+ msg->data,
+ msgb_length(msg));
+ if (rc < 0) {
+ LOGP(DMAIN, LOGL_ERROR, "Fwd to %s failed\n", talloc_get_name(bsc));
+ ret = rc;
+ }
+ }
+
+ return ret;
+}
+
static int bssmap_cn_handle_reset_ack(struct osmo_sccp_addr *addr, struct msgb *msg,
unsigned int length)
{
struct msc *msc = msc_get();
@@ -59,6 +94,9 @@
int ret = 0;
switch (msg->l3h[0]) {
+ case BSS_MAP_MSG_PAGING:
+ ret = bssmap_cn_handle_paging(addr, msg, length);
+ break;
case BSS_MAP_MSG_RESET_ACKNOWLEDGE:
ret = bssmap_cn_handle_reset_ack(addr, msg, length);
break;
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27704
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I2532d94aab82d136b932d57fa53c8ecf2d8d1fd9
Gerrit-Change-Number: 27704
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange