Add roaming type toggle via command line (#4211)

* add TODOs for lbo_roaming_allowed function

* complete lbo_roaming_allowed method

* edit help text

* fix variable name
This commit is contained in:
Jasmine Fan 2025-12-22 23:53:53 -05:00 committed by GitHub
parent 465273d13b
commit 678abdeacf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,6 +26,7 @@ display_help() {
echo " showfiltered: shows {imsi key opc apn ip} information of subscriber"
echo " ambr_speed {imsi dl_value dl_unit ul_value ul_unit}: Change AMBR speed from a specific user and the unit values are \"[0=bps 1=Kbps 2=Mbps 3=Gbps 4=Tbps ]\""
echo " subscriber_status {imsi subscriber_status_val={0,1} operator_determined_barring={0..8}}: Change TS 29.272 values for Subscriber-Status (7.3.29) and Operator-Determined-Barring (7.3.30)"
echo " lbo_roaming_allowed {imsi lbo_roaming_allowed={0,1}}: Change roaming type for a specific subscriber: 0 = LBO roaming (default), 1 = HR roaming"
}
@ -800,6 +801,24 @@ if [ "$1" = "subscriber_status" ]; then
echo "open5gs-dbctl: incorrect number of args, format is \"open5gs-dbctl subscriber_status imsi subscriber_status_val={0,1} operator_determined_barring={0..8}"
exit 1
fi
if [ "$1" = "lbo_roaming_allowed" ]; then
if [ "$#" -eq 3 ]; then
IMSI=$2
LBO_ALLOWED=$3
if [ $LBO_ALLOWED = "1" ]; then
LBO_ALLOWED_BOOL=true
else
LBO_ALLOWED_BOOL=false
fi
mongosh --eval "db.subscribers.updateOne({ \"imsi\": \"$IMSI\"},
{\$set: { \"slice.0.session.0.lbo_roaming_allowed\": $LBO_ALLOWED_BOOL
}
});" $DB_URI
exit $?
fi
echo "open5gs-dbctl: incorrect number of args, format is \"open5gs-dbctl lbo_roaming_allowed imsi lbo_roaming_allowed={0,1}"
exit 1
fi
if [ "$1" = "showall" ]; then
mongosh --eval "db.subscribers.find()" $DB_URI
exit $?