Simple Echo Server » History » Version 4
keith, 11/25/2022 08:45 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 | 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. |
||
62 | |||
63 | We only need gsm.so and echo.so |
||
64 | |||
65 | h3. SEMS Config File |
||
66 | |||
67 | This is about the simplest config file I can think of. I'm not sure that all of it is even needed: |
||
68 | |||
69 | save this as sems.conf |
||
70 | |||
71 | <pre> |
||
72 | rtp_low_port=64000 |
||
73 | rtp_high_port=64100 |
||
74 | plugin_path=/usr/local/lib/sems/plug-in/ |
||
75 | load_plugins=gsm;echo |
||
76 | application=echo |
||
77 | plugin_config_path=/usr/local/etc/sems/etc/ |
||
78 | fork=yes |
||
79 | stderr=no |
||
80 | loglevel=2 |
||
81 | </pre> |
||
82 | |||
83 | and run sems -E -D3 -f sems.conf |
||
84 | |||
85 | -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 |
||
86 | |||
87 | h3. Configure osmo-msc and osmo-sip-connector |
||
88 | |||
89 | In osmo-msc, make sure you have the external MNCC socket enabled: |
||
90 | |||
91 | <pre> |
||
92 | msc |
||
93 | mncc external /tmp/msc_mncc |
||
94 | </pre> |
||
95 | |||
96 | This is sufficient osmo-sip-connector.cfg: |
||
97 | |||
98 | <pre> |
||
99 | mncc |
||
100 | socket-path /tmp/msc_mncc |
||
101 | sip |
||
102 | local 0.0.0.0 5050 |
||
103 | remote ip_where_sems_is_running 5060 |
||
104 | 1 | keith | </pre> |