Prepare support for a second BSC, in order to test OsmoBSCNAT.
* Rename BSC_* variables to BSC0_*
* Rename MGW4BSC_* variables to MGW4BSC0_*
* Rename osmo-bsc.cfg to osmo-bsc-0.cfg
* Rename osmo-mgw-for-bsc.cfg to osmo-mgw-for-bsc-0.cfg
Change-Id: Iaba2e3143b7bb6451a0104042e69d47ee5f48d3c
Don't ask the user to copy config_2g3g and manually keep it in sync with
config_2g3g with each change anymore. Instead, let the user config be a
diff on top of config_2g3g.
This is in preparation to adding new variables for use with OsmoBSCNAT.
Change-Id: I5870d39aee8be84c2024f8a2a71ee4a734a4fc7c
Put each line in a separate, aligned print statement and use f-strings
(Python 3.6 feature, even debian oldstable has > 3.6 by now).
This is in preparation to add a new line about the original config in
the next patch.
Change-Id: Iad39a7889c107ceb8c16325bb545cb426eb9b6e2
This was related to attempting to fix the infinite "q Enter to close"
msgs bug, which has been properly fixed in
Iebb799493f76fd57f24b15c998ded2bd8e284e6b.
Remove fg to get rid of this error:
zsh:fg:1: no job control in this shell.
Change-Id: Iba7a1adbc4f48b0477a53590ffec8af518fdf467
It's hard to distinguish multiple wireshark windows with trace.pcap
files, as only the file name and not the path is shown in the title.
Make it easier to distinguish them by adding the log name to the file
name.
Change-Id: I7007d7c1e74aef46f1942f4f6f675adebb890955
Fix the logic that is supposed to display a "q Enter to close" message
once and wait for user input, in case one of the Osmocom programs
crashed.
Explicitly read from /dev/tty, as it may not be connected as default
stdin anymore at this point. This happens when using the new code paths
with tmux as terminal, but also happened before recent refactorings for
me with all terminals.
Related: https://media.ccc.de/v/osmodevcall-20211210-osmith-osmo-dev-ttcn3#t=801
Change-Id: Iebb799493f76fd57f24b15c998ded2bd8e284e6b
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
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
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
Prepare to add "tmux" as new terminal. As discussed in code review, we
decided to drop support for auto-detection.
Change-Id: I0afb6b0242c399334a2c37f18a5d26d5beeabedc
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
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
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
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
Migrate to the new gprs_ns2_vty configuration introduced in osmo-sgsn
Ie9306ab4d4738c2c57a69987086e22771b30657e.
Change-Id: Ie0a6d4a55f725ebcc6a55b6bd71c52ad72accbd2
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
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
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
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
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
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
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
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
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
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
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
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
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