Project

General

Profile

Simple Echo Server » History » Version 7

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