Project

General

Profile

Actions

Simple Echo Server » History » Revision 4

« Previous | Revision 4/7 (diff) | Next »
keith, 11/25/2022 08:45 PM


DISCLAIMER

This page is user-contributed information, and not official documentation by the Osmocom project. It might be outdated or inaccurate.
Please help by improving this document, or reporting any issues to the relevant mailing list.

Simple Echo Test Setup for your OsmoCom CNI

Some people want to test the audio setup of their OsmoCom Network with just one phone, by calling a number that will echo back the audio stream.
Even though it is quite some overkill, It turns out that probably the simplest setup for such a thing is using SEMS, the SIP Express Media Server.

SEMS is not included with most Linux distributions, Alpine Linux being an exception (https://pkgs.alpinelinux.org/packages?name=sems) but there are a number of projects that maintain binary repositories. Of course, you can build it yourself, there are a number of forks, all hosted publicly on infrastructure that this author prefers not to link to, so you will have to search it. Anyway, such things as URLs can quickly go out of date and I do not intend to maintain this page with links to current repositories of source or binary packages.

While writing this tutorial, I realise there are no suitable SEMS packages on any of the repos maintained by any of the projects that have SEMS integrated. Either the packages do not include workable config or there are far too many dependencies that you probably do not want to consider installing on your system, given that this document is about a "Simple" solution.

So, lets build it.

  • get the source code (search for it if the below no longer works)
git clone https://gitlab.tic-ac.org/keith/sems.git
apt install libevent-dev libgsm1-dev

Let's disable a bunch of stuff that we don't need to avoid dependencies and speed up compilation considerably.

cd sems
git checkout keith/simple
make

This is the diff on the keith/simple branch:

diff --git a/Makefile.defs b/Makefile.defs
index 5e103be4..ccbabe0d 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -82,8 +82,18 @@ USE_INTERNAL_RESAMPLER = yes
 # exclude some modules from compilation?
 # e.g. python modules:

-exclude_core_modules = g729 silk codec2
+exclude_core_modules = adpcm codec2 g722 g729 ilbc isac l16 \
+                       opus session_timer silk speex stats uac_auth wav
+
 #exclude_app_modules = py_sems ivr mailbox pin_collect conf_auth mp3 examples
+exclude_app_modules =  ann_b2b announcement announce_transfer annrecorder \
+                       callback click2dial conf_auth conference db_reg_agent \
+                       diameter_client dsm early_announce early_dbprompt \
+                       gateway ivr ivr-python2 jsonrpc mailbox \
+                       mobile_push monitoring mp3 msg_storage mwi \
+                       pin_collect precoded_announce py_sems reg_agent \
+                       registrar_client rtmp sbc twit voicebox voicemail \
+                       webconference xmlrpc2di examples

 # build in support for monitoring?
 #

Now you can sudo make install or if you don't want to use sudo, you can give your user permission to write to /usr/local/ or indeed copy the compiled modules somewhere and point the sems config plugin_path to that location, then run from the source tree.

We only need gsm.so and echo.so

SEMS Config File

This is about the simplest config file I can think of. I'm not sure that all of it is even needed:

save this as sems.conf

rtp_low_port=64000
rtp_high_port=64100
plugin_path=/usr/local/lib/sems/plug-in/
load_plugins=gsm;echo
application=echo
plugin_config_path=/usr/local/etc/sems/etc/
fork=yes
stderr=no
loglevel=2

and run sems -E -D3 -f sems.conf

-E stops detaching from the terminal and -D3 will help you with debug output if anything doesn't work. Without -E SEMS does not output to the terminal

Configure osmo-msc and osmo-sip-connector

In osmo-msc, make sure you have the external MNCC socket enabled:

msc
 mncc external /tmp/msc_mncc

This is sufficient osmo-sip-connector.cfg:

mncc
 socket-path /tmp/msc_mncc
sip
 local 0.0.0.0 5050
 remote ip_where_sems_is_running 5060
Files (0)

Updated by keith over 1 year ago · 4 revisions locked

Add picture from clipboard (Maximum size: 48.8 MB)