Add LAC swapping for osmo-msc

Make LAC config availble to the shell.
Run a script on MSC restart to change the lac and write a state flag to disk.

Due to the fact that osmo-msc may restart due to crash or power outage
hence loosing all VLR state, force all UE to send a LUR by changing the LAC
on all BTS via CTRL commands to osmo-bsc.
This commit is contained in:
Keith Whyte 2021-06-09 01:29:01 +02:00
parent c5809a00ca
commit e5971a2375
3 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#!/bin/bash
. /home/rhizomatica/bin/vars.sh
_ALT_LAC=""
if [ -f /etc/osmocom/alt_lac ]; then
_ALT_LAC=$(cat /etc/osmocom/alt_lac)
fi
if [ "$_ALT_LAC" == "" ]; then
_ALT_LAC=1
else
_ALT_LAC=""
fi
echo $_ALT_LAC > /etc/osmocom/alt_lac
/bin/sync
for bts in "${!BTS[@]}" ; do
echo "BTS $bts:"
/usr/bin/osmo_ctrl.py -d 127.0.0.1 -p 4249 -s bts.$bts.location-area-code $_ALT_LAC${LAC[$bts]}
/usr/bin/osmo_ctrl.py -d 0 -p 4249 -s bts.$bts.send-new-system-informations 1
done

View file

@ -1,3 +1,4 @@
[Service]
ExecStart=
ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg -l /var/lib/osmocom/sms.db
ExecStartPost=/home/rhizomatica/bin/swap_lac.sh

View file

@ -14,10 +14,12 @@ DID[<%= index %>]=<%= did %>
#BTSs IP addresses (for amps etc)
declare -a BTS
declare -a LAC
declare -a BTS_MASTER
<% @bts.each_with_index do |bts, index| -%>
BTS[<%= index %>]=<%= bts["ip"] %>
LAC[<%= index %>]=<%= bts["lac"] %>
<% if bts ["model"] == '2050M' -%>
BTS_MASTER[<%= index %>]=<%= bts["ip"] %>
<% end -%>