net/templates: support running MS

New config variables:
* MS_RUN_IN_OSMO_DEV
* MS_SUBSCR_ID
* MS_IMSI
* MS_KI
* MS_MSISDN

Change-Id: I377ca41d18ee6b057559cadb0f0bb44f85643eb6
This commit is contained in:
Oliver Smith 2022-02-23 10:36:23 +01:00
parent 5705a69c16
commit d264ec6310
4 changed files with 85 additions and 0 deletions

View File

@ -142,6 +142,13 @@ BSCNAT_CN_IP="127.0.0.3"
BSCNAT_RAN_PC="${MSC_PC}"
BSCNAT_RAN_IP="127.0.0.4"
# Set to 1 to have osmo-dev run mobile and virtphy from osmocom-bb
MS_RUN_IN_OSMO_DEV=0
MS_SUBSCR_ID="1337"
MS_IMSI="001010000000000"
MS_KI="00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
MS_MSISDN="555"
# PBX_SERVER:
# "kamailio" -- launch kamailio
# "freeswitch" -- launch freeswitch

View File

@ -0,0 +1,10 @@
/* Use this file to add the subscriber for MS_RUN_IN_OSMO_DEV=1 to your hlr.db:
* sqlite3 -batch hlr.db < hlr_db_add_ms.sql
*/
INSERT INTO subscriber (id, imsi, msisdn)
VALUES (${MS_SUBSCR_ID}, "${MS_IMSI}", "${MS_MSISDN}");
INSERT INTO auc_2g (subscriber_id, algo_id_2g, ki)
VALUES (${MS_SUBSCR_ID}, 1 /* OSMO_AUTH_ALG_COMP128v1 */,
REPLACE("${MS_KI}", " ", ""));

62
net/templates/mobile.cfg Normal file
View File

@ -0,0 +1,62 @@
${include(common_template_warning)}
line vty
no login
no gps enable
no hide-default
ms 1
layer2-socket /tmp/osmocom_l2
sap-socket /tmp/osmocom_sap
sim test
network-selection-mode auto
imei 000000000000000 0
imei-fixed
no emergency-imsi
no sms-service-center
no call-waiting
auto-answer
no force-rekey
no clip
no clir
tx-power auto
no simulated-delay
no stick
location-updating
neighbour-measurement
codec full-speed prefer
no abbrev
support
sms
a5/1
a5/2
p-gsm
e-gsm
r-gsm
no gsm-850
dcs
no pcs
class-900 4
class-850 4
class-dcs 1
class-pcs 1
channel-capability sdcch+tchf+tchh
full-speech-v1
full-speech-v2
min-rxlev -106
dsc-max 90
no skip-max-per-band
test-sim
imsi ${MS_IMSI}
ki comp128 ${MS_KI}
no barred-access
rplmn ${MCC} ${MNC}
audio
io-handler loopback
no shutdown
${foreach(LOG_OUTPUT)}
log ${LOG_OUTPUTn_TYPE}
${include(common_logging)}
${foreach_end}

View File

@ -183,6 +183,8 @@ stp4ran="osmo-stp -c osmo-stp-ran.cfg"
bsc="LD_LIBRARY_PATH=/usr/local/lib gdb -ex run --args osmo-bsc"
bscnat="osmo-bsc-nat"
bts="osmo-bts-virtual"
virtphy="virtphy"
ms="mobile -c mobile.cfg"
if [ "x${MSC_MNCC}" != "xinternal" ]; then
sipcon="osmo-sip-connector -c osmo-sip-connector.cfg"
@ -258,6 +260,10 @@ if [ "${BTSn_RUN_IN_OSMO_DEV}" = 1 ]; then
fi
${foreach_end}
if [ "${MS_RUN_IN_OSMO_DEV}" = 1 ]; then
term "$virtphy" VIRTPHY
term "$ms" MS
fi
if [ "x${MSC_MNCC}" != "xinternal" ]; then
term "$sipcon" SIPCON