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 */
        bool                    uplink_release_local;
+       bool                    asci_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,12 @@
 static int gsm48_mm_uplink_req(struct osmocom_ms *ms, struct msgb *msg)
 {
        struct gsm48_mmlayer *mm = &ms->mmlayer;
+       struct gsm_settings *set = &ms->settings;
        struct msgb *nmsg;

+       if (mm->substate != GSM48_MM_SST_RX_VGCS_NORMAL && !set->asci_allow_any)
+               return gsm48_mm_uplink_reject(ms, msg);
+
        LOGP(DMM, LOGL_INFO, "Request for uplink, trying to establish group 
transmit mode.\n");

        /* Go into uplink pending state. */
@@ -4201,6 +4217,12 @@
        {SBIT(GSM48_MM_ST_MM_IDLE), SBIT(GSM48_MM_SST_NO_IMSI),
         GSM48_MMCC_EST_REQ, gsm48_mm_init_mm_no_rr},

+       {SBIT(GSM48_MM_ST_MM_IDLE), SBIT(GSM48_MM_SST_NO_IMSI),
+        GSM48_MMBCC_GROUP_REQ, gsm48_mm_group_req},
+
+       {SBIT(GSM48_MM_ST_MM_IDLE), SBIT(GSM48_MM_SST_NO_IMSI),
+        GSM48_MMGCC_GROUP_REQ, gsm48_mm_group_req},
+
        /* 4.2.2.5 PLMN search, normal service */
        {SBIT(GSM48_MM_ST_MM_IDLE), SBIT(GSM48_MM_SST_PLMN_SEARCH_NORMAL),
         GSM48_MMCC_EST_REQ, gsm48_mm_init_mm_no_rr},
@@ -4254,10 +4276,10 @@
         GSM48_MMBCC_REL_REQ, gsm48_mm_group_rel_req},

        {SBIT(GSM48_MM_ST_MM_IDLE), SBIT(GSM48_MM_SST_RX_VGCS_LIMITED),
-        GSM48_MMGCC_UPLINK_REQ, gsm48_mm_uplink_reject},
+        GSM48_MMGCC_UPLINK_REQ, gsm48_mm_uplink_req},

        {SBIT(GSM48_MM_ST_MM_IDLE), SBIT(GSM48_MM_SST_RX_VGCS_LIMITED),
-        GSM48_MMBCC_UPLINK_REQ, gsm48_mm_uplink_reject},
+        GSM48_MMBCC_UPLINK_REQ, gsm48_mm_uplink_req},

        /* 4.5.1.1 MM Connection (EST) */
        {SBIT(GSM48_MM_ST_RR_CONN_RELEASE_NA), ALL_STATES,
diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index 1766071..7611c0f 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -1327,6 +1327,9 @@
        if (!l23_vty_hide_default || !set->uplink_release_local)
                vty_out(vty, " %suplink-release-local%s",
                        (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);

        vty_out(vty, " audio%s", VTY_NEWLINE);
        vty_out(vty, "  io-handler %s%s",
@@ -1997,6 +2000,28 @@
        return CMD_SUCCESS;
 }

+DEFUN(cfg_ms_asci_allow_any, cfg_ms_asci_allow_any_cmd, "asci-allow-any",
+       "Allow any ASCI related call feature, even if service is limited or SIM 
invalid.")
+{
+       struct osmocom_ms *ms = vty->index;
+       struct gsm_settings *set = &ms->settings;
+
+       set->asci_allow_any = true;
+
+       return CMD_SUCCESS;
+}
+
+DEFUN(cfg_ms_no_asci_allow_any, cfg_ms_no_asci_allow_any_cmd, "no 
asci-allow-any",
+       NO_STR "Do not allow any ASCI related call feature, if service is not 
normal.")
+{
+       struct osmocom_ms *ms = vty->index;
+       struct gsm_settings *set = &ms->settings;
+
+       set->asci_allow_any = false;
+
+       return CMD_SUCCESS;
+}
+
 static int config_write_dummy(struct vty *vty)
 {
        return CMD_SUCCESS;
@@ -2586,6 +2611,8 @@
        install_element(MS_NODE, &cfg_ms_no_sms_store_cmd);
        install_element(MS_NODE, &cfg_ms_uplink_release_local_cmd);
        install_element(MS_NODE, &cfg_ms_no_uplink_release_local_cmd);
+       install_element(MS_NODE, &cfg_ms_asci_allow_any_cmd);
+       install_element(MS_NODE, &cfg_ms_no_asci_allow_any_cmd);
        install_element(MS_NODE, &cfg_ms_support_cmd);
        install_node(&support_node, config_write_dummy);
        install_element(SUPPORT_NODE, &cfg_ms_set_en_cc_dtmf_cmd);

--
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: 2
Gerrit-Owner: jolly <andr...@eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to