Simple Echo Server » History » Revision 4
Revision 3 (keith, 11/24/2022 08:58 PM) → Revision 4/7 (keith, 11/25/2022 08:45 PM)
{{include(Disclaimer-user-content)}} {{>toc}} h1. 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*. 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 For the purposes of this tutorial, I realise there are no suitable lets pull SEMS packages on any of package from the repos repo maintained by any folks at sipwise, If this information, written in November 2022, is out of the projects that date, then you will 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 search for a "Simple" more current solution. So, lets build it. * get the source code (search for it if the below no longer works) Run (as root): <pre> git clone https://gitlab.tic-ac.org/keith/sems.git echo "deb [arch=amd64] https://deb.sipwise.com/spce/mr10.2.1/ bullseye main" > /etc/apt/sources.list.d/sipwise.list apt install libevent-dev libgsm1-dev </pre> Let's disable a bunch of stuff that we don't need to avoid dependencies and speed up compilation considerably. <pre> cd sems /tmp git checkout keith/simple wget https://deb.sipwise.com/spce/keyring/ngcp-archive-keyring_mr10.2.1.deb make dpkg -i ./ngcp-archive-keyring_mr10.2.1.deb </pre> This is the diff on the keith/simple branch: <pre> apt update 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? # </pre> Now you can sudo make apt 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 h3. 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 <pre> ngcp-sems 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 </pre> 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 h3. Configure osmo-msc and osmo-sip-connector In osmo-msc, make sure you have the external MNCC socket enabled: <pre> msc mncc external /tmp/msc_mncc </pre> This is sufficient osmo-sip-connector.cfg: <pre> mncc socket-path /tmp/msc_mncc sip local 0.0.0.0 5050 remote ip_where_sems_is_running 5060 </pre>