Project

General

Profile

Simple Echo Server » History » Version 5

keith, 11/25/2022 09:06 PM

1 2 keith
{{include(Disclaimer-user-content)}}
2
3
{{>toc}}
4
5
h1. Simple Echo Test Setup for your OsmoCom CNI
6 3 keith
7
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.
8 4 keith
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*.
9 3 keith
10
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.
11
12 4 keith
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.
13 1 keith
14 4 keith
So, lets build it. 
15
16
* get the source code (search for it if the below no longer works)
17
18 1 keith
<pre>
19 4 keith
git clone https://gitlab.tic-ac.org/keith/sems.git
20
apt install libevent-dev libgsm1-dev
21
</pre>
22
23
Let's disable a bunch of stuff that we don't need to avoid dependencies and speed up compilation considerably.
24
25
<pre>
26
cd sems
27
git checkout keith/simple
28
make
29
</pre>
30
31
This is the diff on the keith/simple branch:
32
33
<pre>
34
diff --git a/Makefile.defs b/Makefile.defs
35
index 5e103be4..ccbabe0d 100644
36
--- a/Makefile.defs
37
+++ b/Makefile.defs
38
@@ -82,8 +82,18 @@ USE_INTERNAL_RESAMPLER = yes
39
 # exclude some modules from compilation?
40
 # e.g. python modules:
41
 
42
-exclude_core_modules = g729 silk codec2
43
+exclude_core_modules = adpcm codec2 g722 g729 ilbc isac l16 \
44
+                       opus session_timer silk speex stats uac_auth wav
45
+
46
 #exclude_app_modules = py_sems ivr mailbox pin_collect conf_auth mp3 examples
47
+exclude_app_modules =  ann_b2b announcement announce_transfer annrecorder \
48
+                       callback click2dial conf_auth conference db_reg_agent \
49
+                       diameter_client dsm early_announce early_dbprompt \
50
+                       gateway ivr ivr-python2 jsonrpc mailbox \
51
+                       mobile_push monitoring mp3 msg_storage mwi \
52
+                       pin_collect precoded_announce py_sems reg_agent \
53
+                       registrar_client rtmp sbc twit voicebox voicemail \
54
+                       webconference xmlrpc2di examples
55
 
56
 # build in support for monitoring?
57
 #
58
59
</pre>
60
61 5 keith
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 just run from the source tree with the simplified configuration below:
62 4 keith
63
64 1 keith
h3. SEMS Config File
65
66 5 keith
This is about the simplest config file I can think of:
67 1 keith
68 5 keith
Save this as sems.conf 
69 1 keith
70 4 keith
<pre>
71 5 keith
plugin_path=core/lib
72 4 keith
load_plugins=gsm;echo
73
application=echo
74 5 keith
fork=no
75
stderr=yes
76
loglevel=3
77 4 keith
</pre>
78
79 5 keith
and run ./core/sems -f sems.conf
80 4 keith
81
h3. Configure osmo-msc and osmo-sip-connector
82
83 1 keith
In osmo-msc, make sure you have the external MNCC socket enabled:
84 4 keith
85 1 keith
<pre>
86
msc
87
 mncc external /tmp/msc_mncc
88
</pre>
89 4 keith
90
This is sufficient osmo-sip-connector.cfg:
91
92
<pre>
93
mncc
94
 socket-path /tmp/msc_mncc
95
sip
96
 local 0.0.0.0 5050
97 5 keith
 remote [ip_where_sems_is_running] 5060
98 4 keith
</pre>
99 5 keith
100
h3. Call any number from your Phone and have your audio echoed back.
101
102
SEMS doesn't care what the number is, It runs the echo app for all calls.
103
Of course there are all kinds of other apps in SEMS, file playback might be something else useful in the context of the HOWTO, It is left as an exercise to the reader to compile and configure that.
Add picture from clipboard (Maximum size: 48.8 MB)