Commit Graph

54 Commits

Author SHA1 Message Date
Oliver Smith f907a6cf73 net: run.sh: support tmux as terminal
Create one tmux session, with each Osmocom program in one window, if
tmux is chosen as "terminal". This allows using osmo-dev's run.sh over
ssh without X forwarding. Also the existing supported terminals
automatically scroll to the bottom as soon as there is new output,
making it hard to read logs.

Change-Id: Iaef08fb3cb3c6f58cd8490a631e177a03af9c974
2022-01-31 17:54:05 +01:00
Oliver Smith c64fc3fb05 net: run.sh: write wrapper command to shell script
Instead of passing a whole script to the terminal via command-line
argument, write it to a file. This is in preparation to use the same
script with tmux, see next patch.

Change-Id: I15760d706b20628421c10a16514120f442d5477f
2022-01-31 17:53:34 +01:00
Oliver Smith eba7d9ed8a net: run.sh: store all spawned pids in files
Replace the previous approach of only storing the PIDs of the spawned
terminals, and then attempting to kill all other processes (the ones
running inside the spawned terminals and tcpdump) with "killall".
Instead, store PIDs of all spawned programs:
* Terminals
* Osmocom programs (new)
* Tcpdump (new)

Kill old processes at the start of run.sh as well, so even if run.sh was
killed before it could clean up, the Osmocom programs don't fail to
start anymore (as it was the case before).

Change-Id: I379ef71de2f1ab0ac4a28064e5cf9e275c4c61e9
2022-01-31 17:53:34 +01:00
Oliver Smith dfca1ff293 net: make terminal configurable in config file
Change-Id: I0afb6b0242c399334a2c37f18a5d26d5beeabedc
2022-01-31 17:53:34 +01:00
Oliver Smith 15efd5cb81 net/templates/.editorconfig: new file
Change-Id: Ieeb67a10c7b7c27a5e0e9dbc8399fe2add9f34d4
2022-01-31 17:53:34 +01:00
Oliver Smith 0a662f4ac5 net/templates/osmo-bsc-nat.cfg: add addressbooks
Add MSC and BSC point-codes, as it is currently needed in the initial
message forwarding implementation.

Related: SYS#5560
Related: osmo-bsc-nat I4af398bb433341a98f818822e6c3af28b6d9dacd
Change-Id: Ia396cc677ceffa3fa86da5460f6c890b5f714059
2022-01-31 17:53:34 +01:00
Oliver Smith a3a1a0d94a net: add osmo-bsc-nat
Make STP_CN_IP and STP_RAN_IP configurable. If they are not set to the
same IP, run a second OsmoSTP and OsmoBSCNAT to connect both OsmoSTP.

Related: OS#2545
Change-Id: I8bfbd00bfeeebc6e1b87a8cd6333212db4380653
2022-01-17 09:11:55 +00:00
Oliver Smith 8fd5098f3f net/templates/run.sh: refactor kill logic
Put the terminal PIDs into a variable instead of running kill %1 %2 etc.
This makes it easier to conditionally spawn some of the programs.

Change-Id: Iaf6c175de2edf720009af13eace2b0ef83b0735b
2022-01-17 09:11:55 +00:00
Neels Hofmeyr 03f42edb2c add osmo-bts.cfg 2021-10-23 20:45:12 +02:00
Neels Hofmeyr 0c83295236 osmo-bsc.cfg: use 'type osmo-bts', not 'sysmobts' 2021-10-23 20:45:12 +02:00
Oliver Smith 4186b95259 net/templates/run.sh: tweak masquerade
Replace the old check with an exact check for the given rule. The old
check doesn't work on my system if docker is running and sets up other
masquerading rules.

Change -A to -I, so it is less likely to be affected by whatever other
rules may already be above in the chain.

Change-Id: I30c22fe4e7683611e8dada329dbf7d51f78b6016
2021-07-12 08:35:49 +00:00
Neels Hofmeyr fc7b8edaab localhost cfg 2021-06-22 00:37:05 +02:00
Oliver Smith 710107a459 net/templates/osmo-gbproxy.cfg: update format
Update to changes in osmo-gbproxy
* Id67592aa7712e5e04e7264b2fb8f26d57eb7e69e
* I2a18dcf035f1fc7304a0c7c7c83b5e8e15429d2b

Change-Id: Ia7008d6d2d26030aa4c35439f1525a53957443a1
2021-03-19 13:13:02 +01:00
Oliver Smith 964539c416 net/templates/osmo-sgsn.cfg: update format
Migrate to the new gprs_ns2_vty configuration introduced in osmo-sgsn
Ie9306ab4d4738c2c57a69987086e22771b30657e.

Change-Id: Ie0a6d4a55f725ebcc6a55b6bd71c52ad72accbd2
2021-03-19 13:12:55 +01:00
Neels Hofmeyr e0570c2a34 fill_config.py: fix expansion of ${_name}
Change-Id: Icece4135fd3b6ff6e091e43f40c6ed423db7fd8f
2020-05-20 22:41:50 +02:00
Neels Hofmeyr 96a12a1681 make freeswitch template configurable
move some freeswitch config files out of the freeswitch/ tree and symlink so
that they become configurable

Apply new PBX_* variable naming

fill_config: enable symlinks;
ignore template function 'strftime' because freeswith cfg uses that.

Change-Id: I97d3db87398c743637f7eb13629e21b149bcc8fa
2019-12-04 04:09:05 +01:00
Neels Hofmeyr ba0a8280a9 clean up naming: s/SIPCON_REMOTE/PBX_SIP etc
Change-Id: Ie66b32466f80d930150ea940d236cfbbe026fc50
2019-12-04 03:58:17 +01:00
Oliver Smith 667f19b199 add freeswitch
Change-Id: If948de9e9e7e288b0a031ab973f453cd91a9e99b
2019-12-04 03:16:59 +01:00
Oliver Smith 87dae195e3 fill_config.py: copy subdirs
Change-Id: I010336d1ab2bb8abb69f38b3b5630ec9c47c77ed
2019-12-04 02:55:34 +01:00
Neels Hofmeyr 1d6a2b3bc3 fix BTS_MAX_POWER_RED
Change-Id: I921b900c55fb9ac962aa4681478eacaaf0da0467
2019-12-04 02:53:53 +01:00
Neels Hofmeyr c65901cf09 fill_config.py: sort foreach items numerically, not alphabetically
Make sure that BTS 11 doesn't get sorted between BTS 1 and 2, because osmo-bsc
requires the BTS to be configured in numerical order.

Also makes sense as foreach loop ordering in general.

Change-Id: Ib06052fd71def3d4c869ee9b3dc4d02ba06267af
2019-08-21 04:07:41 +02:00
Neels Hofmeyr fecf156c11 kamailio: fixes and tweaks
This is what I did to get external MNCC with kamailio to work.

(As before, only change MSC_MNCC from "internal" to "external ..." in config_*
to enable use of kamailio as external MNCC.)

Change-Id: I18c991bf914dedeb69cb8a2fcde117633e51a899
2019-08-08 15:43:54 +02:00
Neels Hofmeyr 768303432f osmo-bsc.cfg: remove 'as' config from cs7
It's not needed and causes confusion with routing-keys when more BSCs show up.

Change-Id: I6b3717a29ae832d61710abc58d922c00ae8f4dc0
2019-08-08 15:43:54 +02:00
Neels Hofmeyr 0dc7326b0f run.sh: drop -M mncc-socket option from osmo-msc cmdline
Since commit [1], the MNCC socket path is configured in the .cfg file. There is
no need to pass the -M option to osmo-msc on the cmdline anymore.

Also, the udtrace example to launch osmo-msc in run.sh includes a '| tee' so
that the -M would be passed as option to tee and breaks that example.

[1] cbdd7180a6 / Ie6352c584c0fce57c617387160c285abf40a5f90

Change-Id: Id5c177a7fe98b752881ddd0d98152a2e30380d0e
2019-08-08 15:43:54 +02:00
Neels Hofmeyr 8e4948421c run.sh: add comment to show how to enable MNCC udtrace
Change-Id: I94fdc87e8adea345ad735449558b75a56953fcc5
2019-08-08 15:20:38 +02:00
Neels Hofmeyr 3cf904ac68 fill_config.py: expand ${FOOn} outside of ${foreach} blocks
Change-Id: Icd724218afac86e04d1c1030ff982d9b7c3ab6cb
2019-03-15 15:35:38 +01:00
Oliver Smith 2490f69804 run.sh: fix $TO_RAN_IP and $TO_RAN_IU_IP usage
Add curly braces around both variables, so they get replaced properly
again.

Change-Id: I1f0f749b74fe5fd3982e045283735151f69c2487
2019-03-13 15:16:16 +01:00
Neels Hofmeyr cbdd7180a6 net/: refactor cfg templates
Adopt "foreach" and "common_" features and generally take in the improved
templates as used at 35c3.

If your config file relies on the tmpl_std that is now removed, you can locally
resurrect it with

  git checkout 2c6a55baa7 -- tmpl_std

but it's probably better to make a new copy of config_2g3g and insert your
local config there.

Change-Id: Ie6352c584c0fce57c617387160c285abf40a5f90
2019-03-07 16:28:06 +01:00
Neels Hofmeyr a61b9223ef drop mgw endpoint-range
Change-Id: Ia662b1a7e1737d6cc522b6b8a5c7d4ebbe419f21
2019-02-12 15:11:41 +01:00
Oliver Smith 24ddf9c941 run.sh: more userfriendly "stale configs" message
Make the message easy to understand at first glance, print what needs to
be done to regenerate the configs. Add an empty line before listing the
stale file that has been found, so it stands out from the (at this
point) less relevant path listings. It looks like the following now:

$ ./run.sh
using config file '/home/user/code/osmo-dev/net/config_2g3g_osmith'
on templates '/home/user/code/osmo-dev/net/tmpl_std'
with NET_DIR '/home/user/code/osmo-dev/net/osmith'

Stale: '/home/user/code/osmo-dev/net/tmpl_std/run.sh' is newer than 'run.sh'

WARNING: STALE CONFIGS - your net configs are older than the templates they should be based on!
 * Hit enter to continue, and use the stale config files
 * Hit ^C and run 'make regen' to regenerate your configs

Change-Id: If225e094619a07a228e0e2f337153ee18cdb420c
2019-01-30 17:56:22 +01:00
Oliver Smith 0a5dd920ad net/tmpl_std: add Makefile for 'make regen'
Allow using "make regen" in the net dir to regenerate the configs, just
like it is possible to type "make regen" in the make dir.

This is a minor usability improvement, so one does not need to remember
to type ../fill_config.py in the net dir.

Change-Id: I8b23f8ae1f1d6ade597a30a222dfc82ea890d207
2019-01-30 16:35:59 +01:00
Oliver Smith 8d86dba01f net: enable saving IMEI in HLR by default
Related: OS#2541
Change-Id: I12ab66b5ff2147918e2cb4e9beab8d6a730fdc5a
2019-01-30 16:35:56 +01:00
Oliver Smith 5467ef979a run.sh: run osmo-hlr with --db-upgrade
Do not stop if the DB needs to be upgraded.

Change-Id: I74dd09698dd508fce047ce086a22a369ad9ee6a4
2018-12-13 13:28:41 +01:00
Neels Hofmeyr e7cb4a591c fill_config: fix multiple command expansions
If there are multiple ${foo()} commands expanded in one iteration, there would
be offset mismatches because the changed string was used with regex offsets
from before the match. Re-run the regex after each change.

Change-Id: I69de60d840ff3ba115c37d1ede7ccbc8879c82eb
2018-11-26 01:20:03 +01:00
Neels Hofmeyr 3c093457d2 fill_config: tweak for_each error message
Change-Id: If2c87e4aabeba91f99a2ec9da2b3d7ac8fa986ba
2018-11-26 01:19:16 +01:00
Neels Hofmeyr 4f0612251c fill_config.py: ignore templates starting with 'common_'
It's useful to include common parts in numerous cfg files, using the
${include(path)} command. So far they were called common_* and stored outside
of the templates dir (e.g. for logging). So far all files in a templates dir
are seen as templates, so the common files had to be stored in a different dir,
which is a bit senseless.

Allow storing them in the same dir with the templates: ignore all files
starting with 'common_'.

Change-Id: I74446dc0a7f51d4f231e8758a691abb675e87483
2018-11-17 00:05:16 +01:00
Neels Hofmeyr 5549ffbde8 fill_config.py: add ${foreach(FOO)}
This patch indicates that we should rather use a proper templating python
library instead of re-inventing this stuff. But now that we're here...

Add a construct

  ${foreach(BTS)}
   bts ${BTSn}
    location_area_code ${BTSn_LAC}
  ${foreach_end}

that repeats for each BTS<nr> variable found, e.g.

  BTS0_LAC=23
  BTS1_LAC=24
  BTS2_LAC=25

would result in three blocks of the above.

I am using this to avoid copy-pasting for configuring N BTSes for 35c3.

Change-Id: Ie1139a017f42cea5bf7ebbbe457bbc3bfe06944c
2018-11-16 18:43:43 +01:00
Oliver Smith d9f3d34443 support osmo-sip-connector with kamailio
Kamailio is a SIP server, that is relatively easy to configure, in
contrary to asterisk it only has one config file. The config file
here is based on the example config provided in the wiki:

<http://osmocom.org/projects/osmo-sip-conector/wiki/Howto>

To enable the osmo-sip-connector, build it, install kamailio and
then set SIPCON_ENABLE=true in your copy of config_2g_3g.

Change-Id: Ia5c4e9992eab390bc6d26ada7564223ff41a01b2
2018-10-31 14:12:28 +01:00
Oliver Smith fd7446fcab fill_config.py: add NET_DIR variable
Allow all config files to use a new NET_DIR variable, which always
points to the network folder with the generated configs. We can use
this to place all temporary files (sockets, pid files, ...) there.

Change-Id: Idbdf478ebb9f0b2fcd860e5eff3c414a0a459561
2018-10-31 13:07:00 +00:00
Neels Hofmeyr eee671b15d add BSC_CODEC_LIST to config 2018-10-29 17:50:17 +01:00
Oliver Smith 4d7072cc2d find the terminal once and abort if missing
Change-Id: Ie823e17ff1e7ad3ba23998233b41a810c90858b3
2018-10-12 11:10:06 +02:00
Oliver Smith d865c97ec4 change default of MGW4BSC_PORT to 2427
That way one can view the MGCP traffic in wireshark without changing
the MGCP port. We are using a different IP for the two MGWs already, so
they won't conflict even if they use the same port.

Change-Id: I2c73df138642bc3fd52eea493fcab5261e5bc5c8
2018-10-05 14:34:34 +02:00
Neels Hofmeyr b045b5366a net/tmpl_std: msc: iu: use X.213 NSAP for nano3G 2018-10-01 17:33:18 +02:00
Neels Hofmeyr cae6585391 add common_bsc_logging for less debug logs 2018-09-26 15:04:20 +02:00
Neels Hofmeyr 9bd6241cb3 common_logging: use 'logging set-all' to not force debug 2018-09-26 15:03:20 +02:00
Neels Hofmeyr e02e0aee7a fill_config: resolve relative include paths recursively 2018-09-26 14:57:57 +02:00
Neels Hofmeyr ede8016f4b tmpl_std: run.sh: make 'ip addr add $ip2' optional 2018-09-16 13:49:54 +02:00
Neels Hofmeyr dd37c72bca tmpl_std: hlr: add *#100#, *#101#
My old Nokia refuses to send *1# as USSD.
2018-09-16 13:49:54 +02:00
Neels Hofmeyr 8051995a96 common_logging: file basename last 2018-09-16 13:49:54 +02:00
Neels Hofmeyr d924e332bb fill_config.py: fix missing config file error msg 2018-09-10 00:05:29 +02:00