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