[S] Change in osmocom-bb[master]: ASCI: Correctly set and store 'uplink-release-local' flag

2023-10-28 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34867?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: Correctly set and store 'uplink-release-local' flag
..

ASCI: Correctly set and store 'uplink-release-local' flag

Also this option is enabled by default and show in the VTY if it is
disabled.

Change-Id: I6af44f0dd7ff842de633587fb0dcbe78126d30e1
Related: OS#5364
---
M src/host/layer23/src/common/settings.c
M src/host/layer23/src/mobile/vty_interface.c
2 files changed, 16 insertions(+), 1 deletion(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/host/layer23/src/common/settings.c 
b/src/host/layer23/src/common/settings.c
index 395d239..e79a6a1 100644
--- a/src/host/layer23/src/common/settings.c
+++ b/src/host/layer23/src/common/settings.c
@@ -116,6 +116,8 @@

INIT_LLIST_HEAD(&set->abbrev);

+   set->uplink_release_local = true;
+
return 0;
 }

diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index 7611c0f..aaf01bd 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -1326,7 +1326,7 @@
set->any_timeout, VTY_NEWLINE);
if (!l23_vty_hide_default || !set->uplink_release_local)
vty_out(vty, " %suplink-release-local%s",
-   (set->uplink_release_local) ? "no " : "", VTY_NEWLINE);
+   (!set->uplink_release_local) ? "no " : "", VTY_NEWLINE);
if (!l23_vty_hide_default || set->asci_allow_any)
vty_out(vty, " %sasci-allow-any%s",
(set->asci_allow_any) ? "" : "no ", VTY_NEWLINE);

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34867?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: I6af44f0dd7ff842de633587fb0dcbe78126d30e1
Gerrit-Change-Number: 34867
Gerrit-PatchSet: 2
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


[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 = &ms->mmlayer;
+   struct gsm_settings *set = &ms->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 = &ms->mmlayer;
+   struct gsm_subscriber *subscr = &ms->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 = &ms->mmlayer;
+   struct gsm_subscriber *subscr = &ms->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

[M] Change in osmocom-bb[master]: ASCI: Handle rejection of voice group/broadcast call correctly

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

Change subject: ASCI: Handle rejection of voice group/broadcast call correctly
..

ASCI: Handle rejection of voice group/broadcast call correctly

If joining a call gets rejected, the call must not be released, instead
it must return to U3 state (incoming call), because the call still
exists in the cell and it might possible to join it later.

If a call notification is gone, a new event is used in the state machine
to release incoming call.

Change-Id: I605387c6be409ef0e67caf7b9e2a83e1032b45f1
Related: OS#5364
---
M src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
1 file changed, 43 insertions(+), 12 deletions(-)

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




diff --git a/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c 
b/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
index 0cef1c3..4fe0b82 100644
--- a/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
+++ b/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
@@ -138,10 +138,11 @@
VGCS_GCC_EV_DI_CONNECT, /* network indicates connect */
VGCS_GCC_EV_TIMEOUT,/* several timeout events */
VGCS_GCC_EV_SETUP_IND,  /* notification of ongoing call 
received */
+   VGCS_GCC_EV_REL_IND,/* notification of call being 
gone */
VGCS_GCC_EV_JOIN_GC_REQ,/* user wants to join ongoing 
call */
VGCS_GCC_EV_JOIN_GC_CNF,/* MM confirms joining ongoing 
call */
VGCS_GCC_EV_ABORT_REQ,  /* user rejects or leaves call 
*/
-   VGCS_GCC_EV_ABORT_IND,  /* MM indicates call gone / 
channel released or failed */
+   VGCS_GCC_EV_ABORT_IND,  /* MM indicates channel 
released or failed */
VGCS_GCC_EV_TALK_REQ,   /* user wants to talk */
VGCS_GCC_EV_TALK_CNF,   /* MM confirms talk */
VGCS_GCC_EV_TALK_REJ,   /* MM rejects talk */
@@ -162,6 +163,7 @@
OSMO_VALUE_STRING(VGCS_GCC_EV_DI_CONNECT),
OSMO_VALUE_STRING(VGCS_GCC_EV_TIMEOUT),
OSMO_VALUE_STRING(VGCS_GCC_EV_SETUP_IND),
+   OSMO_VALUE_STRING(VGCS_GCC_EV_REL_IND),
OSMO_VALUE_STRING(VGCS_GCC_EV_JOIN_GC_REQ),
OSMO_VALUE_STRING(VGCS_GCC_EV_JOIN_GC_CNF),
OSMO_VALUE_STRING(VGCS_GCC_EV_ABORT_REQ),
@@ -1104,7 +1106,7 @@
/* Change to GROUP CALL PRESENT state. */
osmo_fsm_inst_state_chg(fi, VGCS_GCC_ST_U3_GROUP_CALL_PRESENT, 
0, 0);
break;
-   case VGCS_GCC_EV_ABORT_IND:
+   case VGCS_GCC_EV_REL_IND:
/* The MM layer indicates that group channel is gone. */
LOG_GCC(trans, LOGL_INFO, "Group call notification is gone.\n");
/* Change to NULL state. */
@@ -1165,12 +1167,12 @@
/* Free transaction. */
trans_free(trans);
break;
-   case VGCS_GCC_EV_ABORT_IND:
+   case VGCS_GCC_EV_REL_IND:
/* The notified call is gone. */
LOG_GCC(trans, LOGL_INFO, "Received call from network is 
gone.\n");
/* Change to NULL state. */
osmo_fsm_inst_state_chg(fi, VGCS_GCC_ST_U0_NULL, 0, 0);
-   /* Notify termination at VTY. (No cause, because notification 
is gone.) */
+   /* Notify termination at VTY. */
vgcs_vty_notify(trans, "Released\n");
/* Free transaction. */
trans_free(trans);
@@ -1193,6 +1195,7 @@
 static void vgcs_gcc_fsm_u4_action(struct osmo_fsm_inst *fi, uint32_t event, 
void *data)
 {
struct gsm_trans *trans = fi->priv;
+   uint8_t *cause = data;

switch (event) {
case VGCS_GCC_EV_JOIN_GC_CNF:
@@ -1209,16 +1212,24 @@
/* Free transaction. */
trans_free(trans);
break;
-   case VGCS_GCC_EV_ABORT_IND:
+   case VGCS_GCC_EV_REL_IND:
/* The notified call is gone. */
LOG_GCC(trans, LOGL_INFO, "Received call from network is 
gone.\n");
/* Change to NULL state. */
osmo_fsm_inst_state_chg(fi, VGCS_GCC_ST_U0_NULL, 0, 0);
-   /* Notify termination at VTY. (No cause, because notification 
is gone.) */
+   /* Notify termination at VTY. */
vgcs_vty_notify(trans, "Released\n");
/* Free transaction. */
trans_free(trans);
break;
+   case VGCS_GCC_EV_ABORT_IND:
+   /* The notified call is gone. */
+   LOG_GCC(trans, LOGL_INFO, "Call rejected.\n");
+   /* Change back to U3 state, so that call may be joined later. */
+   osmo_fsm_inst_stat

[S] Change in osmocom-bb[master]: ASCI: Use correct mobile identiy in TALKER INDICATION message

2023-10-28 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34865?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: Use correct mobile identiy in TALKER INDICATION message
..

ASCI: Use correct mobile identiy in TALKER INDICATION message

Use TMSI only if valid in the current location area. If the MS moves to
a different location area and joins a group call before location update,
TMSI is not valid. Then use IMSI instead. If no IMSI/TSMI is available,
send mobile identity without IMSI/TMSI.

Change-Id: I299604a0e12d91e9133b70757826ac9637da0e3e
Related: OS#5364
---
M src/host/layer23/src/mobile/gsm48_rr.c
1 file changed, 29 insertions(+), 2 deletions(-)

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




diff --git a/src/host/layer23/src/mobile/gsm48_rr.c 
b/src/host/layer23/src/mobile/gsm48_rr.c
index 3200412..b898090 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -2085,6 +2085,8 @@
 static int gsm48_rr_tx_talker_indication(struct osmocom_ms *ms)
 {
struct gsm48_rrlayer *rr = &ms->rrlayer;
+   struct gsm_subscriber *subscr = &ms->subscr;
+   struct gsm322_cellsel *cs = &ms->cellsel;
struct msgb *nmsg;
struct gsm48_hdr *gh;
struct gsm48_talker_indication *ti;
@@ -2103,8 +2105,18 @@
/* classmark 2 */
ti->cm2_len = sizeof(ti->cm2);
gsm48_rr_enc_cm2(ms, &ti->cm2, rr->cd_now.arfcn);
-   /* mobile identity (Use TMSI if available.) */
-   gsm48_encode_mi_lv(ms, nmsg, GSM_MI_TYPE_TMSI, false);
+
+   /* mobile identity */
+   if (ms->subscr.tmsi != GSM_RESERVED_TMSI && (osmo_lai_cmp(&subscr->lai, 
&cs->sel_cgi.lai) == 0)) {
+   gsm48_encode_mi_lv(ms, nmsg, GSM_MI_TYPE_TMSI, false);
+   LOGP(DRR, LOGL_INFO, "Sending TALKER INDICATION with TMSI.\n");
+   } else if (subscr->imsi[0]) {
+   gsm48_encode_mi_lv(ms, nmsg, GSM_MI_TYPE_IMSI, false);
+   LOGP(DRR, LOGL_INFO, "Sending TALKER INDICATION with IMSI.\n");
+   } else {
+   gsm48_encode_mi_lv(ms, nmsg, GSM_MI_TYPE_NONE, false);
+   LOGP(DRR, LOGL_INFO, "Sending TALKER INDICATION without 
TMSI/IMSI.\n");
+   }

/* start establishmnet */
return gsm48_send_rsl(ms, RSL_MT_EST_REQ, nmsg, 0);

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34865?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: I299604a0e12d91e9133b70757826ac9637da0e3e
Gerrit-Change-Number: 34865
Gerrit-PatchSet: 2
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged