[M] Change in osmocom-bb[master]: ASCI: Add option to join voice group/broadcast calls without valid SIM

2023-10-28 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34866?usp=email )

 (

1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: ASCI: Add option to join voice group/broadcast calls without 
valid SIM
..

ASCI: Add option to join voice group/broadcast calls without valid SIM

This option must be enabled in the VTY and is disabled by default.

Calls can be joined when service is limited or normal. With that option
enabled, calls can be joined even with invalid SIM.

Talking is allowed when service is normal. With that option enabled,
talking is always allowed. It depends on the network, if it accepts the
talker.

Change-Id: I6ea851a8cb015ff685b985335968c6184beca816
Related: OS#5364
---
M src/host/layer23/include/osmocom/bb/common/settings.h
M src/host/layer23/src/mobile/gsm48_mm.c
M src/host/layer23/src/mobile/vty_interface.c
3 files changed, 75 insertions(+), 6 deletions(-)

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve




diff --git a/src/host/layer23/include/osmocom/bb/common/settings.h 
b/src/host/layer23/include/osmocom/bb/common/settings.h
index 884578b..3b9473f 100644
--- a/src/host/layer23/include/osmocom/bb/common/settings.h
+++ b/src/host/layer23/include/osmocom/bb/common/settings.h
@@ -191,6 +191,7 @@

/* ASCI settings */
booluplink_release_local;
+   boolasci_allow_any;
 };

 struct gsm_settings_abbrev {
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c 
b/src/host/layer23/src/mobile/gsm48_mm.c
index 5e02659..378cd2d 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -61,7 +61,9 @@
 static int gsm48_mm_loc_upd_normal(struct osmocom_ms *ms, struct msgb *msg);
 static int gsm48_mm_loc_upd_periodic(struct osmocom_ms *ms, struct msgb *msg);
 static int gsm48_mm_loc_upd(struct osmocom_ms *ms, struct msgb *msg);
+static int gsm48_mm_group_reject(struct osmocom_ms *ms, struct msgb *msg);
 static int gsm48_mm_group_rel_req(struct osmocom_ms *ms, struct msgb *msg);
+static int gsm48_mm_uplink_reject(struct osmocom_ms *ms, struct msgb *msg);

 /*
  * notes
@@ -3805,9 +3807,13 @@
 static int gsm48_mm_group_req(struct osmocom_ms *ms, struct msgb *msg)
 {
struct gsm48_mmlayer *mm = >mmlayer;
+   struct gsm_settings *set = >settings;
struct gsm48_mmxx_hdr *mmh = (struct gsm48_mmxx_hdr *)msg->data;
struct msgb *nmsg;

+   if (mm->substate == GSM48_MM_SST_NO_IMSI && !set->asci_allow_any)
+   return gsm48_mm_group_reject(ms, msg);
+
LOGP(DMM, LOGL_INFO, "Request for joining a group call, trying to 
establish group receive mode.\n");

/* Store infos about group/broadcast call. */
@@ -3881,6 +3887,7 @@
 static int gsm48_mm_group_rel_ind(struct osmocom_ms *ms, struct msgb *msg)
 {
struct gsm48_mmlayer *mm = >mmlayer;
+   struct gsm_subscriber *subscr = >subscr;
struct gsm48_rr_hdr *rrh = (struct gsm48_rr_hdr *)msg->data;
uint16_t msg_type;
struct msgb *nmsg;
@@ -3892,8 +3899,10 @@
mm->vgcs.enabled = false;

/* Change mode back to normal or limited service. */
-   if (mm->substate == GSM48_MM_SST_RX_VGCS_LIMITED)
-   new_mm_state(mm, GSM48_MM_ST_MM_IDLE, 
GSM48_MM_SST_LIMITED_SERVICE);
+   if (mm->substate == GSM48_MM_SST_RX_VGCS_LIMITED) {
+   new_mm_state(mm, GSM48_MM_ST_MM_IDLE, (subscr->sim_valid) ? 
GSM48_MM_SST_LIMITED_SERVICE
+ : 
GSM48_MM_SST_NO_IMSI);
+   }
if (mm->substate == GSM48_MM_SST_RX_VGCS_NORMAL)
new_mm_state(mm, GSM48_MM_ST_MM_IDLE, 
GSM48_MM_SST_NORMAL_SERVICE);

@@ -3932,6 +3941,7 @@
 static int gsm48_mm_group_rel_req(struct osmocom_ms *ms, struct msgb *msg)
 {
struct gsm48_mmlayer *mm = >mmlayer;
+   struct gsm_subscriber *subscr = >subscr;
struct msgb *nmsg;

LOGP(DMM, LOGL_INFO, "Request to release group call in receive or 
transmit mode.\n");
@@ -3940,8 +3950,10 @@
mm->vgcs.enabled = false;

/* Change mode back to normal or limited service. */
-   if (mm->substate == GSM48_MM_SST_RX_VGCS_LIMITED)
-   new_mm_state(mm, GSM48_MM_ST_MM_IDLE, 
GSM48_MM_SST_LIMITED_SERVICE);
+   if (mm->substate == GSM48_MM_SST_RX_VGCS_LIMITED) {
+   new_mm_state(mm, GSM48_MM_ST_MM_IDLE, (subscr->sim_valid) ? 
GSM48_MM_SST_LIMITED_SERVICE
+ : 
GSM48_MM_SST_NO_IMSI);
+   }
if (mm->substate == GSM48_MM_SST_RX_VGCS_NORMAL)
new_mm_state(mm, GSM48_MM_ST_MM_IDLE, 
GSM48_MM_SST_NORMAL_SERVICE);

@@ -3960,8 +3972,12 @@
 static int 

[M] Change in osmocom-bb[master]: ASCI: Add option to join voice group/broadcast calls without valid SIM

2023-10-23 Thread pespin
Attention is currently required from: jolly.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34866?usp=email )

Change subject: ASCI: Add option to join voice group/broadcast calls without 
valid SIM
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34866?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I6ea851a8cb015ff685b985335968c6184beca816
Gerrit-Change-Number: 34866
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Mon, 23 Oct 2023 14:44:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: ASCI: Add option to join voice group/broadcast calls without valid SIM

2023-10-23 Thread fixeria
Attention is currently required from: jolly.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34866?usp=email )

Change subject: ASCI: Add option to join voice group/broadcast calls without 
valid SIM
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34866?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I6ea851a8cb015ff685b985335968c6184beca816
Gerrit-Change-Number: 34866
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Mon, 23 Oct 2023 13:14:56 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: ASCI: Add option to join voice group/broadcast calls without valid SIM

2023-10-23 Thread jolly
jolly has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34866?usp=email )


Change subject: ASCI: Add option to join voice group/broadcast calls without 
valid SIM
..

ASCI: Add option to join voice group/broadcast calls without valid SIM

This option must be enabled in the VTY and is disabled by default.

Calls can be joined when service is limited or normal. With that option
enabled, calls can be joined even with invalid SIM.

Talking is allowed when service is normal. With that option enabled,
talking is always allowed. It depends on the network, if it accepts the
talker.

Change-Id: I6ea851a8cb015ff685b985335968c6184beca816
Related: OS#5364
---
M src/host/layer23/include/osmocom/bb/common/settings.h
M src/host/layer23/src/mobile/gsm48_mm.c
M src/host/layer23/src/mobile/vty_interface.c
3 files changed, 75 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/66/34866/1

diff --git a/src/host/layer23/include/osmocom/bb/common/settings.h 
b/src/host/layer23/include/osmocom/bb/common/settings.h
index 884578b..3b9473f 100644
--- a/src/host/layer23/include/osmocom/bb/common/settings.h
+++ b/src/host/layer23/include/osmocom/bb/common/settings.h
@@ -191,6 +191,7 @@

/* ASCI settings */
booluplink_release_local;
+   boolasci_allow_any;
 };

 struct gsm_settings_abbrev {
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c 
b/src/host/layer23/src/mobile/gsm48_mm.c
index 5e02659..378cd2d 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -61,7 +61,9 @@
 static int gsm48_mm_loc_upd_normal(struct osmocom_ms *ms, struct msgb *msg);
 static int gsm48_mm_loc_upd_periodic(struct osmocom_ms *ms, struct msgb *msg);
 static int gsm48_mm_loc_upd(struct osmocom_ms *ms, struct msgb *msg);
+static int gsm48_mm_group_reject(struct osmocom_ms *ms, struct msgb *msg);
 static int gsm48_mm_group_rel_req(struct osmocom_ms *ms, struct msgb *msg);
+static int gsm48_mm_uplink_reject(struct osmocom_ms *ms, struct msgb *msg);
 
 /*
  * notes
@@ -3805,9 +3807,13 @@
 static int gsm48_mm_group_req(struct osmocom_ms *ms, struct msgb *msg)
 {
struct gsm48_mmlayer *mm = >mmlayer;
+   struct gsm_settings *set = >settings;
struct gsm48_mmxx_hdr *mmh = (struct gsm48_mmxx_hdr *)msg->data;
struct msgb *nmsg;

+   if (mm->substate == GSM48_MM_SST_NO_IMSI && !set->asci_allow_any)
+   return gsm48_mm_group_reject(ms, msg);
+
LOGP(DMM, LOGL_INFO, "Request for joining a group call, trying to 
establish group receive mode.\n");

/* Store infos about group/broadcast call. */
@@ -3881,6 +3887,7 @@
 static int gsm48_mm_group_rel_ind(struct osmocom_ms *ms, struct msgb *msg)
 {
struct gsm48_mmlayer *mm = >mmlayer;
+   struct gsm_subscriber *subscr = >subscr;
struct gsm48_rr_hdr *rrh = (struct gsm48_rr_hdr *)msg->data;
uint16_t msg_type;
struct msgb *nmsg;
@@ -3892,8 +3899,10 @@
mm->vgcs.enabled = false;

/* Change mode back to normal or limited service. */
-   if (mm->substate == GSM48_MM_SST_RX_VGCS_LIMITED)
-   new_mm_state(mm, GSM48_MM_ST_MM_IDLE, 
GSM48_MM_SST_LIMITED_SERVICE);
+   if (mm->substate == GSM48_MM_SST_RX_VGCS_LIMITED) {
+   new_mm_state(mm, GSM48_MM_ST_MM_IDLE, (subscr->sim_valid) ? 
GSM48_MM_SST_LIMITED_SERVICE
+ : 
GSM48_MM_SST_NO_IMSI);
+   }
if (mm->substate == GSM48_MM_SST_RX_VGCS_NORMAL)
new_mm_state(mm, GSM48_MM_ST_MM_IDLE, 
GSM48_MM_SST_NORMAL_SERVICE);

@@ -3932,6 +3941,7 @@
 static int gsm48_mm_group_rel_req(struct osmocom_ms *ms, struct msgb *msg)
 {
struct gsm48_mmlayer *mm = >mmlayer;
+   struct gsm_subscriber *subscr = >subscr;
struct msgb *nmsg;

LOGP(DMM, LOGL_INFO, "Request to release group call in receive or 
transmit mode.\n");
@@ -3940,8 +3950,10 @@
mm->vgcs.enabled = false;

/* Change mode back to normal or limited service. */
-   if (mm->substate == GSM48_MM_SST_RX_VGCS_LIMITED)
-   new_mm_state(mm, GSM48_MM_ST_MM_IDLE, 
GSM48_MM_SST_LIMITED_SERVICE);
+   if (mm->substate == GSM48_MM_SST_RX_VGCS_LIMITED) {
+   new_mm_state(mm, GSM48_MM_ST_MM_IDLE, (subscr->sim_valid) ? 
GSM48_MM_SST_LIMITED_SERVICE
+ : 
GSM48_MM_SST_NO_IMSI);
+   }
if (mm->substate == GSM48_MM_SST_RX_VGCS_NORMAL)
new_mm_state(mm, GSM48_MM_ST_MM_IDLE, 
GSM48_MM_SST_NORMAL_SERVICE);

@@ -3960,8 +3972,12 @@
 static int gsm48_mm_uplink_req(struct osmocom_ms *ms, struct msgb *msg)
 {
struct gsm48_mmlayer *mm = >mmlayer;
+   struct gsm_settings *set = >settings;
struct msgb