Refactoring tone and anouncement gerneration
Move all tones and anouncements into libtones. Each application can name the tone set (american, german, uk, ect.) during initializaton. The tones are converted to samples of the target codec. These samples can then be streamed by the application. The application of osmocom-analog is the call control of libmobile.
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@@ -48,15 +48,13 @@ src/libserial/libserial.a
|
||||
src/libv27/libv27.a
|
||||
src/libmtp/libmtp.a
|
||||
src/libaaimage/libaaimage.a
|
||||
src/anetz/libgermanton.a
|
||||
src/libtones/libtones.a
|
||||
src/anetz/anetz
|
||||
src/bnetz/bnetz
|
||||
src/bnetz/bnetz-dialer
|
||||
src/cnetz/libcnetztones.a
|
||||
src/cnetz/cnetz
|
||||
src/nmt/libdmssms.a
|
||||
src/nmt/nmt
|
||||
src/amps/libusatone.a
|
||||
src/amps/libamps.a
|
||||
src/amps/amps
|
||||
src/amps/tacs
|
||||
@@ -92,3 +90,8 @@ src/test/test_sms
|
||||
src/test/test_performance
|
||||
src/test/test_hagelbarger
|
||||
src/test/test_v27scrambler
|
||||
|
||||
installiere_es.sh
|
||||
jolly.sh
|
||||
layout/kicad/magnetkarte-backups/
|
||||
make-test.sh
|
||||
|
@@ -93,6 +93,7 @@ AC_CONFIG_FILES([src/liblogging/Makefile
|
||||
src/libv27/Makefile
|
||||
src/libmtp/Makefile
|
||||
src/libaaimage/Makefile
|
||||
src/libtones/Makefile
|
||||
src/anetz/Makefile
|
||||
src/bnetz/Makefile
|
||||
src/cnetz/Makefile
|
||||
|
@@ -27,7 +27,8 @@ SUBDIRS = \
|
||||
libserial \
|
||||
libv27 \
|
||||
libmtp \
|
||||
libaaimage
|
||||
libaaimage \
|
||||
libtones
|
||||
|
||||
if HAVE_ALSA
|
||||
SUBDIRS += \
|
||||
|
@@ -3,7 +3,7 @@ AM_CPPFLAGS = -Wall -Wextra -Wmissing-prototypes -g $(all_includes)
|
||||
bin_PROGRAMS = \
|
||||
amps tacs jtacs
|
||||
|
||||
noinst_LIBRARIES = libamps.a libusatone.a
|
||||
noinst_LIBRARIES = libamps.a
|
||||
|
||||
libamps_a_SOURCES = \
|
||||
main_common.c \
|
||||
@@ -14,13 +14,6 @@ libamps_a_SOURCES = \
|
||||
sysinfo.c \
|
||||
esn.c
|
||||
|
||||
libusatone_a_SOURCES = \
|
||||
usa_tones.c \
|
||||
usa_noanswer.c \
|
||||
usa_outoforder.c \
|
||||
usa_invalidnumber.c \
|
||||
usa_congestion.c
|
||||
|
||||
amps_SOURCES = \
|
||||
amps_stations.c \
|
||||
amps_image.c \
|
||||
@@ -29,9 +22,9 @@ amps_SOURCES = \
|
||||
amps_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
libamps.a \
|
||||
libusatone.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libcompandor/libcompandor.a \
|
||||
$(top_builddir)/src/libgoertzel/libgoertzel.a \
|
||||
@@ -64,8 +57,6 @@ amps_LDADD += \
|
||||
endif
|
||||
|
||||
tacs_SOURCES = \
|
||||
tacs_tones.c \
|
||||
tacs_outoforder.c \
|
||||
tacs_stations.c \
|
||||
tacs_image.c \
|
||||
tacs_main.c
|
||||
@@ -75,6 +66,7 @@ tacs_LDADD = \
|
||||
libamps.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libcompandor/libcompandor.a \
|
||||
$(top_builddir)/src/libgoertzel/libgoertzel.a \
|
||||
@@ -107,7 +99,6 @@ tacs_LDADD += \
|
||||
endif
|
||||
|
||||
jtacs_SOURCES = \
|
||||
jtacs_tones.c \
|
||||
jtacs_stations.c \
|
||||
jtacs_image.c \
|
||||
jtacs_main.c
|
||||
@@ -117,6 +108,7 @@ jtacs_LDADD = \
|
||||
libamps.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libcompandor/libcompandor.a \
|
||||
$(top_builddir)/src/libgoertzel/libgoertzel.a \
|
||||
|
@@ -1,10 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include "main.h"
|
||||
#include "tones.h"
|
||||
#include "noanswer.h"
|
||||
#include "outoforder.h"
|
||||
#include "invalidnumber.h"
|
||||
#include "congestion.h"
|
||||
#include "../libmobile/main_mobile.h"
|
||||
|
||||
const int tacs = 0;
|
||||
@@ -23,12 +18,5 @@ const char *number_prefixes[] = {
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
/* init common tones */
|
||||
init_tones();
|
||||
init_outoforder();
|
||||
init_noanswer();
|
||||
init_invalidnumber();
|
||||
init_congestion();
|
||||
|
||||
return main_amps_tacs("amps", argc, argv);
|
||||
return main_amps_tacs("amps", argc, argv, "american");
|
||||
}
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_congestion(void);
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_invalidnumber(void);
|
||||
|
@@ -1,7 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include "../amps/main.h"
|
||||
#include "../amps/tones.h"
|
||||
#include "../amps/outoforder.h"
|
||||
#include "../libmobile/main_mobile.h"
|
||||
|
||||
const int tacs = 1;
|
||||
@@ -16,8 +14,5 @@ const char *number_prefixes[] = { NULL };
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
/* init common tones */
|
||||
init_tones();
|
||||
|
||||
return main_amps_tacs("jtacs", argc, argv);
|
||||
return main_amps_tacs("jtacs", argc, argv, "japan");
|
||||
}
|
||||
|
@@ -4,5 +4,5 @@ extern const int jtacs;
|
||||
|
||||
extern const char *number_prefixes[];
|
||||
|
||||
int main_amps_tacs(const char *name, int argc, char *argv[]);
|
||||
int main_amps_tacs(const char *name, int argc, char *argv[], const char *toneset);
|
||||
|
||||
|
@@ -254,7 +254,7 @@ static int handle_options(int short_option, int argi, char **argv)
|
||||
|
||||
extern const struct number_lengths number_lengths[];
|
||||
|
||||
int main_amps_tacs(const char *name, int argc, char *argv[])
|
||||
int main_amps_tacs(const char *name, int argc, char *argv[], const char *toneset)
|
||||
{
|
||||
int rc, argi;
|
||||
const char *station_id = "";
|
||||
@@ -268,7 +268,7 @@ int main_amps_tacs(const char *name, int argc, char *argv[])
|
||||
/* override default */
|
||||
dsp_samplerate = 96000;
|
||||
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, NULL);
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, NULL, toneset);
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_noanswer(void);
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_outoforder(void);
|
||||
|
@@ -1,7 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include "../amps/main.h"
|
||||
#include "../amps/tones.h"
|
||||
#include "../amps/outoforder.h"
|
||||
#include "../libmobile/main_mobile.h"
|
||||
|
||||
const int tacs = 1;
|
||||
@@ -20,9 +18,5 @@ const char *number_prefixes[] = {
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
/* init common tones */
|
||||
init_tones();
|
||||
init_outoforder();
|
||||
|
||||
return main_amps_tacs("tacs", argc, argv);
|
||||
return main_amps_tacs("tacs", argc, argv, "uk");
|
||||
}
|
||||
|
10719
src/amps/tacs_tones.c
10719
src/amps/tacs_tones.c
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_tones(void);
|
||||
|
1791
src/amps/usa_tones.c
1791
src/amps/usa_tones.c
File diff suppressed because it is too large
Load Diff
@@ -3,12 +3,6 @@ AM_CPPFLAGS = -Wall -Wextra -Wmissing-prototypes -g $(all_includes)
|
||||
bin_PROGRAMS = \
|
||||
anetz
|
||||
|
||||
noinst_LIBRARIES = libgermanton.a
|
||||
|
||||
libgermanton_a_SOURCES = \
|
||||
freiton.c\
|
||||
besetztton.c
|
||||
|
||||
anetz_SOURCES = \
|
||||
anetz.c \
|
||||
dsp.c \
|
||||
@@ -17,9 +11,9 @@ anetz_SOURCES = \
|
||||
main.c
|
||||
anetz_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
libgermanton.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libgoertzel/libgoertzel.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
|
@@ -1,196 +0,0 @@
|
||||
#include <stdint.h>
|
||||
#include "besetztton.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
0x0004, 0xffe9, 0xffc9, 0xffac, 0xff92, 0xff83, 0xff75, 0xff56,
|
||||
0xff40, 0xff2b, 0xff25, 0xff2b, 0xff1f, 0xff1b, 0xff32, 0xff6a,
|
||||
0xffcb, 0x00a2, 0x01cb, 0x02e2, 0x0373, 0x0369, 0x030a, 0x0268,
|
||||
0x01a9, 0x00d9, 0xffc2, 0xfeb4, 0xfddc, 0xfd4f, 0xfce3, 0xfc8d,
|
||||
0xfc6c, 0xfcb2, 0xfd1c, 0xfd99, 0xfe2b, 0xff27, 0x000a, 0x013e,
|
||||
0x030f, 0x036f, 0x0341, 0x0374, 0x03c1, 0x03c7, 0x02f2, 0x01b9,
|
||||
0x00e3, 0x004f, 0xff8f, 0xfe87, 0xfda0, 0xfd40, 0xfd32, 0xfd49,
|
||||
0xfd2a, 0xfd3d, 0xfda1, 0xfe3a, 0xfee4, 0xff6d, 0x0002, 0x00b9,
|
||||
0x0145, 0x01db, 0x0241, 0x025b, 0x0262, 0x025f, 0x01bf, 0x0169,
|
||||
0x0134, 0x0085, 0x0028, 0xffd7, 0xfef3, 0xfe9c, 0xfec7, 0xfe45,
|
||||
0xfe45, 0xfe59, 0xfe55, 0xfec3, 0xff2a, 0xffc8, 0xffe0, 0x006a,
|
||||
0x0162, 0x00c2, 0x010b, 0x0179, 0x015e, 0x00f2, 0x007f, 0x009e,
|
||||
0x0072, 0x00ab, 0xffb6, 0xff70, 0x003a, 0xff02, 0xfedf, 0xff4c,
|
||||
0xff22, 0xff0e, 0xfeb9, 0xff3d, 0xff62, 0xff8c, 0x00ce, 0xffd2,
|
||||
0xff9f, 0x017b, 0x013d, 0x00f3, 0x012e, 0x004e, 0x0081, 0x0077,
|
||||
0xffba, 0xffe5, 0x002b, 0x008c, 0xffc9, 0xff4d, 0xffc5, 0x0022,
|
||||
0x00d0, 0xfff4, 0xff82, 0xff9e, 0xff50, 0xff50, 0xfeb7, 0xff82,
|
||||
0x0051, 0xffcb, 0xffa0, 0xfff2, 0x0050, 0xffc1, 0x004a, 0x023c,
|
||||
0x012d, 0x0018, 0x0161, 0x0095, 0x0135, 0x0014, 0xff45, 0x0011,
|
||||
0x0117, 0x0072, 0xfc89, 0x0370, 0x03a0, 0x05a0, 0x01f7, 0x0967,
|
||||
0x1822, 0xf2cb, 0xe4e2, 0xe57f, 0xd776, 0xe9f6, 0xf5bb, 0xfc27,
|
||||
0x1595, 0x23e7, 0x21f5, 0x1753, 0x1a08, 0x26eb, 0x1a72, 0x0c7c,
|
||||
0x001e, 0xe797, 0xd9df, 0xda14, 0xdd93, 0xd899, 0xd4c1, 0xe25e,
|
||||
0xe7ba, 0xf67b, 0x1d50, 0x2cbd, 0x2940, 0x24e7, 0x277f, 0x2ba5,
|
||||
0x2361, 0x2053, 0x0e46, 0xe7d1, 0xd654, 0xd9fa, 0xdda9, 0xd6b0,
|
||||
0xd1d3, 0xdaa2, 0xde9e, 0xeed9, 0x1663, 0x2855, 0x2644, 0x2489,
|
||||
0x2303, 0x2583, 0x2102, 0x1de4, 0x0c20, 0xea89, 0xdd31, 0xe287,
|
||||
0xe743, 0xdaf7, 0xd314, 0xde3c, 0xe481, 0xf661, 0x1c52, 0x288b,
|
||||
0x1b7a, 0x1844, 0x23b5, 0x2a05, 0x2239, 0x169f, 0x04a7, 0xea9d,
|
||||
0xdb4c, 0xdcca, 0xe12d, 0xdb72, 0xd4d4, 0xdea4, 0xe6d7, 0xf747,
|
||||
0x1ae7, 0x2b19, 0x2582, 0x2091, 0x273c, 0x2a1e, 0x1d7e, 0x17df,
|
||||
0x0837, 0xe881, 0xdb4e, 0xdf81, 0xdf33, 0xd6c6, 0xd54e, 0xdcb5,
|
||||
0xe1f3, 0xf890, 0x1bbe, 0x2868, 0x227e, 0x1c92, 0x260d, 0x2b62,
|
||||
0x2082, 0x1a91, 0x0864, 0xe75f, 0xd979, 0xdf72, 0xe1f7, 0xd799,
|
||||
0xd499, 0xdd37, 0xe310, 0xfc1c, 0x2085, 0x2966, 0x1f41, 0x1b8d,
|
||||
0x259a, 0x2a43, 0x22d9, 0x192a, 0xffe0, 0xe26e, 0xdaad, 0xe16d,
|
||||
0xe1bb, 0xd62c, 0xd3d4, 0xddcf, 0xe53c, 0x008a, 0x2315, 0x28ae,
|
||||
0x219d, 0x1f99, 0x2835, 0x28bf, 0x2124, 0x1baa, 0xffe2, 0xde80,
|
||||
0xd886, 0xe110, 0xdf02, 0xd453, 0xd50b, 0xdbea, 0xe5a8, 0x064d,
|
||||
0x242b, 0x2902, 0x2376, 0x200d, 0x2819, 0x282d, 0x21ad, 0x1879,
|
||||
0xf9d0, 0xdcc7, 0xd869, 0xdfc9, 0xde60, 0xd496, 0xd62e, 0xdc40,
|
||||
0xe92b, 0x0bb1, 0x2631, 0x2704, 0x20b7, 0x21fe, 0x286d, 0x25fc,
|
||||
0x20a7, 0x1461, 0xf346, 0xda0b, 0xdbb7, 0xe190, 0xdaf5, 0xd396,
|
||||
0xdbd2, 0xdf54, 0xeba7, 0x1426, 0x29ee, 0x26ed, 0x2160, 0x2335,
|
||||
0x297c, 0x25a5, 0x1eaf, 0x0ce9, 0xec69, 0xd750, 0xd9ca, 0xe073,
|
||||
0xd9ac, 0xd345, 0xd994, 0xe07d, 0xf5ce, 0x1a91, 0x2a2b, 0x25bf,
|
||||
0x20a4, 0x2596, 0x29c6, 0x2377, 0x1c64, 0x064d, 0xe5e6, 0xd8bf,
|
||||
0xde68, 0xe1b8, 0xd81f, 0xd360, 0xda7f, 0xe288, 0xfc65, 0x1f51,
|
||||
0x294f, 0x2256, 0x1eea, 0x2641, 0x28fe, 0x24dd, 0x1b81, 0xfe12,
|
||||
0xe0ca, 0xda89, 0xe0a1, 0xe057, 0xd67e, 0xd5c4, 0xdba1, 0xe31a,
|
||||
0x0556, 0x266b, 0x28f2, 0x218b, 0x1f44, 0x2717, 0x27c7, 0x21d9,
|
||||
0x15c9, 0xf747, 0xdd97, 0xda9b, 0xe23c, 0xdf46, 0xd419, 0xd634,
|
||||
0xdd0d, 0xe9eb, 0x0c96, 0x25e2, 0x2644, 0x1fea, 0x2041, 0x28d1,
|
||||
0x26c1, 0x20e0, 0x164b, 0xf5db, 0xdba5, 0xdafe, 0xe1c5, 0xddad,
|
||||
0xd3c4, 0xd6ee, 0xdb8c, 0xeb0b, 0x1395, 0x294b, 0x24c4, 0x1ee4,
|
||||
0x228c, 0x29a9, 0x2581, 0x2093, 0x0fad, 0xed42, 0xdad5, 0xddeb,
|
||||
0xe34b, 0xdc1a, 0xd323, 0xd912, 0xdde6, 0xf057, 0x1964, 0x2aea,
|
||||
0x234d, 0x1bfe, 0x2106, 0x29f9, 0x25e5, 0x20eb, 0x0e12, 0xe980,
|
||||
0xd698, 0xdcad, 0xe4c9, 0xdb65, 0xd2a4, 0xd913, 0xde59, 0xf3b4,
|
||||
0x1a85, 0x29cb, 0x24bc, 0x1fab, 0x2359, 0x29a8, 0x244a, 0x1e3e,
|
||||
0x0bac, 0xe9bf, 0xd8b8, 0xdc3e, 0xe1a6, 0xda33, 0xd318, 0xd8ac,
|
||||
0xdd33, 0xf4ec, 0x1d03, 0x2a42, 0x2527, 0x1fac, 0x2303, 0x2a52,
|
||||
0x25db, 0x2117, 0x0bf0, 0xe6e8, 0xd6d7, 0xdd56, 0xe3e0, 0xda45,
|
||||
0xd268, 0xd8aa, 0xdcb1, 0xf2f1, 0x1bac, 0x2a58, 0x24ed, 0x1f57,
|
||||
0x22fb, 0x2a21, 0x2582, 0x2095, 0x0bbc, 0xe7b8, 0xd84e, 0xdd09,
|
||||
0xe20c, 0xdaea, 0xd3a3, 0xd9fe, 0xdef1, 0xf1fb, 0x1996, 0x29f6,
|
||||
0x250b, 0x1f6c, 0x228c, 0x2a58, 0x263e, 0x20f1, 0x0d9f, 0xe85d,
|
||||
0xd74b, 0xdd4e, 0xe27f, 0xdb5f, 0xd335, 0xd7e2, 0xdd4f, 0xf294,
|
||||
0x1a85, 0x2978, 0x24e8, 0x2044, 0x22bd, 0x2a07, 0x2698, 0x20da,
|
||||
0x0b78, 0xe654, 0xd795, 0xde86, 0xe30d, 0xdbd1, 0xd447, 0xd9c3,
|
||||
0xe030, 0xf3d3, 0x18e2, 0x28c7, 0x2497, 0x1f3a, 0x2259, 0x28fa,
|
||||
0x2565, 0x1f47, 0x09e5, 0xe7ef, 0xd93b, 0xdd93, 0xe2cd, 0xdb76,
|
||||
0xd2a9, 0xd8eb, 0xdfe5, 0xf38a, 0x1a10, 0x29f4, 0x2439, 0x1e81,
|
||||
0x22ff, 0x2a74, 0x25eb, 0x20c6, 0x0bd4, 0xe7ba, 0xd781, 0xdcf1,
|
||||
0xe451, 0xdc04, 0xd2a4, 0xda99, 0xe0ff, 0xf41a, 0x1999, 0x28b7,
|
||||
0x2477, 0x1d6e, 0x20f7, 0x2a37, 0x2552, 0x1f54, 0x0ab8, 0xe772,
|
||||
0xd8a3, 0xdd16, 0xe1a4, 0xd9bd, 0xd2e9, 0xda7c, 0xe02a, 0xf636,
|
||||
0x1d2e, 0x2a1a, 0x24c8, 0x1f54, 0x237b, 0x2a4c, 0x24f2, 0x1e74,
|
||||
0x07b6, 0xe5a7, 0xd903, 0xddb4, 0xe0fa, 0xd993, 0xd42a, 0xdb0b,
|
||||
0xe0db, 0xf862, 0x1e38, 0x292b, 0x22f0, 0x1eb2, 0x244f, 0x299d,
|
||||
0x24b2, 0x1e8b, 0x061b, 0xe3a7, 0xd7d0, 0xddc3, 0xe133, 0xd8b8,
|
||||
0xd486, 0xda97, 0xe027, 0xfd4c, 0x21e4, 0x28be, 0x224f, 0x1e61,
|
||||
0x25ab, 0x2a10, 0x24a1, 0x1c33, 0xffb1, 0xe073, 0xda34, 0xe103,
|
||||
0xe143, 0xd6b3, 0xd4d6, 0xdabf, 0xe278, 0x050a, 0x2559, 0x2724,
|
||||
0x206c, 0x1d8a, 0x2623, 0x28db, 0x222f, 0x1869, 0xfb0c, 0xdebe,
|
||||
0xda88, 0xe128, 0xdfc6, 0xd4e6, 0xd695, 0xde27, 0xe839, 0x0b4a,
|
||||
0x26b5, 0x25f1, 0x1f74, 0x2018, 0x28ea, 0x270e, 0x1fb1, 0x14a9,
|
||||
0xf54d, 0xda7d, 0xda17, 0xe1c9, 0xde39, 0xd508, 0xd7f5, 0xddaa,
|
||||
0xec1c, 0x1297, 0x2932, 0x2584, 0x1fa5, 0x215e, 0x298f, 0x2724,
|
||||
0x20c7, 0x109e, 0xed5e, 0xd7c0, 0xdb2f, 0xe1bb, 0xdb69, 0xd2df,
|
||||
0xd833, 0xdec4, 0xf22c, 0x18dc, 0x2a35, 0x251b, 0x1f3f, 0x22a6,
|
||||
0x2a07, 0x2615, 0x1feb, 0x0d08, 0xe995, 0xd820, 0xdd3a, 0xe150,
|
||||
0xd98f, 0xd300, 0xda0b, 0xdfb7, 0xf414, 0x1b1b, 0x295b, 0x2333,
|
||||
0x1e69, 0x23db, 0x2a7e, 0x2537, 0x1fd9, 0x09db, 0xe659, 0xd871,
|
||||
0xdede, 0xe3c8, 0xd989, 0xd253, 0xd979, 0xdf1c, 0xf7d6, 0x1ec3,
|
||||
0x2a2e, 0x21e5, 0x1c2f, 0x2436, 0x2a4f, 0x241a, 0x1d05, 0x0548,
|
||||
0xe44d, 0xd8ae, 0xe0d5, 0xe4c8, 0xd84f, 0xd298, 0xdb09, 0xe0bc,
|
||||
0xfc25, 0x22aa, 0x2a75, 0x2218, 0x1e12, 0x2681, 0x2aa6, 0x2457,
|
||||
0x1d91, 0x0159, 0xdf33, 0xd67b, 0xdf48, 0xe226, 0xd631, 0xd376,
|
||||
0xdb34, 0xe091, 0xfe8f, 0x241d, 0x2a87, 0x2332, 0x1f86, 0x2611,
|
||||
0x28fe, 0x23d2, 0x1ef8, 0x02cd, 0xdefa, 0xd5ef, 0xddf6, 0xe12f,
|
||||
0xd735, 0xd3f5, 0xdb0c, 0xdfb9, 0xfd66, 0x248b, 0x2bca, 0x241a,
|
||||
0x1ef6, 0x25b8, 0x2a2a, 0x246a, 0x1eaa, 0x0248, 0xdf8e, 0xd747,
|
||||
0xde8f, 0xe1e0, 0xd827, 0xd3cf, 0xda8e, 0xe007, 0xfb3b, 0x219f,
|
||||
0x2ac7, 0x231d, 0x1ea4, 0x255e, 0x2a2e, 0x2489, 0x1eeb, 0x05a9,
|
||||
0xe2e8, 0xd805, 0xdeb4, 0xe283, 0xd8b3, 0xd2f3, 0xd9dd, 0xdf63,
|
||||
0xf8d6, 0x1fce, 0x2a7b, 0x237f, 0x1f85, 0x2509, 0x29a5, 0x24ec,
|
||||
0x1f8d, 0x06e5, 0xe2c8, 0xd692, 0xddac, 0xe1d4, 0xd909, 0xd37a,
|
||||
0xd98a, 0xdf3f, 0xf7fd, 0x1eac, 0x2ac7, 0x2486, 0x1ff2, 0x24a9,
|
||||
0x2a5f, 0x256b, 0x1ebc, 0x075f, 0xe45a, 0xd75e, 0xde5a, 0xe284,
|
||||
0xd97f, 0xd3be, 0xd9c8, 0xdf75, 0xf6cd, 0x1c9d, 0x2996, 0x23e3,
|
||||
0x1f19, 0x24a0, 0x2a81, 0x25aa, 0x1fd7, 0x0766, 0xe44d, 0xd870,
|
||||
0xdf09, 0xe30d, 0xd922, 0xd249, 0xd985, 0xdf20, 0xf54d, 0x1c2b,
|
||||
0x29cb, 0x2445, 0x1f54, 0x241e, 0x2aa5, 0x25c2, 0x1ff3, 0x093b,
|
||||
0xe5e2, 0xd837, 0xde46, 0xe316, 0xda28, 0xd2d7, 0xd90b, 0xdecc,
|
||||
0xf4d6, 0x1bff, 0x2ae4, 0x24c1, 0x1ed5, 0x237a, 0x2a79, 0x25e4,
|
||||
0x1f1b, 0x08a0, 0xe65e, 0xd8c0, 0xde21, 0xe22f, 0xd9ce, 0xd2fa,
|
||||
0xd8e6, 0xdf57, 0xf53f, 0x1c1f, 0x2a52, 0x2463, 0x204f, 0x2433,
|
||||
0x2a69, 0x2613, 0x1f9c, 0x0920, 0xe4b9, 0xd761, 0xde2f, 0xe19a,
|
||||
0xd93c, 0xd275, 0xd912, 0xdfbc, 0xf698, 0x1dbe, 0x2a7f, 0x248e,
|
||||
0x20dd, 0x253c, 0x2a69, 0x2548, 0x1ef1, 0x07b5, 0xe3c2, 0xd798,
|
||||
0xdda0, 0xdf93, 0xd788, 0xd3d0, 0xdbfd, 0xe14e, 0xf8b2, 0x1ec1,
|
||||
0x2a28, 0x22bf, 0x1f01, 0x25ff, 0x29be, 0x23e3, 0x1c79, 0x035e,
|
||||
0xe2e4, 0xd967, 0xdfab, 0xe0b6, 0xd72f, 0xd40b, 0xdb3c, 0xe221,
|
||||
0xfebc, 0x2357, 0x29b3, 0x215e, 0x1f1a, 0x2713, 0x2984, 0x2351,
|
||||
0x1b42, 0xfecf, 0xde84, 0xd924, 0xe111, 0xe055, 0xd556, 0xd45e,
|
||||
0xdc5f, 0xe47f, 0x04ac, 0x2566, 0x2835, 0x2184, 0x2118, 0x2895,
|
||||
0x28ad, 0x22d1, 0x17ec, 0xf7d3, 0xdc2b, 0xdaa9, 0xe14f, 0xde61,
|
||||
0xd468, 0xd5c2, 0xdca4, 0xe7da, 0x0b3d, 0x27bf, 0x2744, 0x211e,
|
||||
0x21d8, 0x2890, 0x26a2, 0x216a, 0x136c, 0xf187, 0xd894, 0xdca4,
|
||||
0xe06d, 0xde67, 0xdf37, 0xd7a6, 0xda60, 0xeb63, 0x0fcd, 0x2907,
|
||||
0x25e0, 0x1fb7, 0x20d5, 0x29a4, 0x26be, 0x207d, 0x1143, 0xeecc,
|
||||
0xd932, 0xdb55, 0xe1fc, 0xdcc3, 0xd396, 0xd79d, 0xde85, 0xeec3,
|
||||
0x1396, 0x2913, 0x25da, 0x1fe6, 0x2297, 0x2a00, 0x262c, 0x1f8f,
|
||||
0x0ed2, 0xed2b, 0xd99d, 0xdcca, 0xe269, 0xdbbc, 0xd288, 0xd7ab,
|
||||
0xdeb8, 0xf0ac, 0x178c, 0x29fa, 0x249a, 0x1e38, 0x2246, 0x2abe,
|
||||
0x258f, 0x1dee, 0x0a53, 0xe9a5, 0xda49, 0xde75, 0xe440, 0xdc8d,
|
||||
0xd2fd, 0xd93e, 0xe1aa, 0xf49a, 0x19c7, 0x2989, 0x23c5, 0x1f8b,
|
||||
0x22b2, 0x2901, 0x2421, 0x1cf0, 0x099c, 0xe7f4, 0xd968, 0xde88,
|
||||
0xe307, 0xdb95, 0xd2cf, 0xd945, 0xe0e2, 0xf583, 0x1c2e, 0x2a3a,
|
||||
0x23c5, 0x1dac, 0x216a, 0x2a2d, 0x2614, 0x1ea8, 0x08a7, 0xe64c,
|
||||
0xd801, 0xdeec, 0xe5b9, 0xdd89, 0xd1a0, 0xd4b1, 0xdbc0, 0xe7dc,
|
||||
0x0d71, 0x28a8, 0x2779, 0x238a, 0x232b, 0x290c, 0x2975, 0x23b3,
|
||||
0x160e, 0xf5a1, 0xd923, 0xd7ba, 0xe01a, 0xddc9, 0xd493, 0xd64a,
|
||||
0xe11e, 0xe5fe, 0x0b8d, 0x296e, 0x23b4, 0x2cbc, 0x250a, 0x0cd4,
|
||||
0x0257, 0x0762, 0x0e5f, 0x0a2a, 0xfb3d, 0xf1ea, 0xf764, 0xf951,
|
||||
0xf4be, 0xee32, 0xed9c, 0xf596, 0xf92e, 0xf969, 0xf9ee, 0xfc48,
|
||||
0x01a3, 0x057f, 0x05cb, 0x04a3, 0x06c8, 0x0a5d, 0x0ae3, 0x0932,
|
||||
0x06a8, 0x03f7, 0x039e, 0x028a, 0xffd3, 0xfeeb, 0xfdcb, 0xfb6c,
|
||||
0xfa68, 0xfa7b, 0xfaf0, 0xfbfb, 0xfc13, 0xfb6b, 0xfb93, 0xfc5a,
|
||||
0xfd8a, 0x008d, 0x0256, 0x0152, 0x013b, 0x025e, 0x0359, 0x0474,
|
||||
0x0505, 0x0495, 0x0441, 0x0288, 0x0092, 0x00f9, 0x011c, 0xff6b,
|
||||
0xfe78, 0xfe18, 0xfc7f, 0xfb42, 0xfca7, 0xfd32, 0xfb8c, 0xfbeb,
|
||||
0xfd9c, 0xff71, 0x0130, 0x020d, 0x02b3, 0x028c, 0x01d8, 0x033a,
|
||||
0x0476, 0x03e1, 0x029b, 0x01cb, 0x0119, 0x00d2, 0x0165, 0x0025,
|
||||
0xfe8a, 0xfc11, 0xf9f2, 0xfab0, 0xfaa0, 0xfa9a, 0xfce0, 0xfe08,
|
||||
0xfe75, 0x0105, 0x0337, 0x03ea, 0x0434, 0x03ef, 0x03b0, 0x0404,
|
||||
0x042f, 0x03c3, 0x0305, 0x00ef, 0xff59, 0xfeee, 0xfe4a, 0xfdb8,
|
||||
0xfc9e, 0xfc3c, 0xfc73, 0xfcc2, 0xfd07, 0xfcb8, 0xfd99, 0xff0c,
|
||||
0xffbe, 0x0064, 0x00f3, 0x012d, 0x0277, 0x034f, 0x028f, 0x028b,
|
||||
0x02e7, 0x0231, 0x01b5, 0x0148, 0x0138, 0x00fc, 0x0033, 0x0007,
|
||||
0xfe94, 0xfd82, 0xfda5, 0xfd78, 0xfd0f, 0xfd61, 0xfdfa, 0xfe98,
|
||||
0xff23, 0xff85, 0x0009, 0x00b8, 0x0156, 0x0102, 0x0258, 0x0278,
|
||||
0x01ba, 0x023a, 0x00fd, 0x00d5, 0x009d, 0xff5b, 0xff67, 0xff49,
|
||||
0xff35, 0xffdb, 0xff7a, 0xff15, 0xff30, 0xfee0, 0xfe9a, 0xfebe,
|
||||
0xff20, 0xff76, 0x0071, 0x00a5, 0xffef, 0x0034, 0x00c3, 0x01ce,
|
||||
0x0174, 0x0035, 0x0078, 0x007c, 0x00aa, 0x0081, 0xfffd, 0xfff1,
|
||||
0xff44, 0xfec8, 0xff2b, 0xff81, 0xffa6, 0x002a, 0x0010, 0xff90,
|
||||
0xff80, 0x0044, 0x0012, 0xffa7, 0x0060, 0x0007, 0xffd9, 0x0079,
|
||||
0x008f, 0x0099, 0x001c, 0xffa8, 0xff93, 0xff52, 0xff9a, 0x0060,
|
||||
};
|
||||
|
||||
extern int16_t *busy_spl;
|
||||
extern int busy_size;
|
||||
extern int busy_max;
|
||||
|
||||
extern int16_t *congestion_spl;
|
||||
extern int congestion_size;
|
||||
extern int congestion_max;
|
||||
|
||||
void init_besetzton(void)
|
||||
{
|
||||
busy_spl = pattern;
|
||||
busy_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
busy_max = 8 * 750;
|
||||
|
||||
congestion_spl = pattern;
|
||||
congestion_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
congestion_max = 8 * 750;
|
||||
}
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_besetzton(void);
|
||||
|
1076
src/anetz/freiton.c
1076
src/anetz/freiton.c
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_freiton(void);
|
||||
|
@@ -30,8 +30,6 @@
|
||||
#include "../libmobile/call.h"
|
||||
#include "../liboptions/options.h"
|
||||
#include "../libfm/fm.h"
|
||||
#include "freiton.h"
|
||||
#include "besetztton.h"
|
||||
#include "anetz.h"
|
||||
#include "dsp.h"
|
||||
#include "stations.h"
|
||||
@@ -135,11 +133,7 @@ int main(int argc, char *argv[])
|
||||
/* a-netz does not use emphasis, so disable it */
|
||||
uses_emphasis = 0;
|
||||
|
||||
/* init common tones */
|
||||
init_freiton();
|
||||
init_besetzton();
|
||||
|
||||
main_mobile_init("0123456789", number_lengths, NULL, anetz_number_valid);
|
||||
main_mobile_init("0123456789", number_lengths, NULL, anetz_number_valid, "oldgerman");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -10,13 +10,12 @@ bnetz_SOURCES = \
|
||||
dsp.c \
|
||||
stations.c \
|
||||
image.c \
|
||||
ansage.c \
|
||||
main.c
|
||||
bnetz_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../anetz/libgermanton.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
$(top_builddir)/src/libsquelch/libsquelch.a \
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_ansage(void);
|
||||
|
@@ -27,13 +27,10 @@
|
||||
#include "../liblogging/logging.h"
|
||||
#include "../libmobile/call.h"
|
||||
#include "../libmobile/main_mobile.h"
|
||||
#include "../anetz/freiton.h"
|
||||
#include "../anetz/besetztton.h"
|
||||
#include "../liboptions/options.h"
|
||||
#include "bnetz.h"
|
||||
#include "dsp.h"
|
||||
#include "stations.h"
|
||||
#include "ansage.h"
|
||||
|
||||
int gfs = 2;
|
||||
int metering = 20;
|
||||
@@ -141,12 +138,7 @@ int main(int argc, char *argv[])
|
||||
const char *station_id = "";
|
||||
int i;
|
||||
|
||||
/* init common tones */
|
||||
init_freiton();
|
||||
init_besetzton();
|
||||
init_ansage();
|
||||
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, NULL);
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, NULL, "oldgerman");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -3,11 +3,6 @@ AM_CPPFLAGS = -Wall -Wextra -Wmissing-prototypes -g $(all_includes)
|
||||
bin_PROGRAMS = \
|
||||
cnetz
|
||||
|
||||
noinst_LIBRARIES = libcnetztones.a
|
||||
|
||||
libcnetztones_a_SOURCES = \
|
||||
ansage.c
|
||||
|
||||
cnetz_SOURCES = \
|
||||
cnetz.c \
|
||||
transaction.c \
|
||||
@@ -21,10 +16,9 @@ cnetz_SOURCES = \
|
||||
main.c
|
||||
cnetz_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../anetz/libgermanton.a \
|
||||
libcnetztones.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libcompandor/libcompandor.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_ansage(void);
|
||||
|
@@ -26,8 +26,6 @@
|
||||
#include "../libmobile/main_mobile.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include "../libmobile/call.h"
|
||||
#include "../anetz/freiton.h"
|
||||
#include "../anetz/besetztton.h"
|
||||
#include "../liboptions/options.h"
|
||||
#include "../libfm/fm.h"
|
||||
#include "cnetz.h"
|
||||
@@ -35,7 +33,6 @@
|
||||
#include "sysinfo.h"
|
||||
#include "dsp.h"
|
||||
#include "telegramm.h"
|
||||
#include "ansage.h"
|
||||
#include "stations.h"
|
||||
|
||||
/* settings */
|
||||
@@ -510,14 +507,9 @@ int main(int argc, char *argv[])
|
||||
int anzahl_gesperrter_teilnehmergruppen = 0;
|
||||
int i;
|
||||
|
||||
/* init common tones */
|
||||
init_freiton();
|
||||
init_besetzton();
|
||||
init_ansage();
|
||||
|
||||
init_station();
|
||||
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, cnetz_number_valid);
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, cnetz_number_valid, "german");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -14,9 +14,9 @@ eurosignal_SOURCES = \
|
||||
main.c
|
||||
eurosignal_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../anetz/libgermanton.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
$(top_builddir)/src/libsamplerate/libsamplerate.a \
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#include "../liboptions/options.h"
|
||||
#include "eurosignal.h"
|
||||
#include "dsp.h"
|
||||
#include "../anetz/besetztton.h"
|
||||
#include "es_mitte.h"
|
||||
#include "es_ges.h"
|
||||
#include "es_teilges.h"
|
||||
@@ -166,9 +165,6 @@ int main(int argc, char *argv[])
|
||||
/* eurosignal does not use emphasis, so disable it */
|
||||
uses_emphasis = 0;
|
||||
|
||||
/* init common tones */
|
||||
init_besetzton();
|
||||
|
||||
/* init system specific tones */
|
||||
init_es_mitte();
|
||||
init_es_ges();
|
||||
@@ -176,7 +172,7 @@ int main(int argc, char *argv[])
|
||||
init_es_kaudn();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789ABCDEabcde", number_lengths, number_prefixes, NULL);
|
||||
main_mobile_init("0123456789ABCDEabcde", number_lengths, number_prefixes, NULL, "oldgerman");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -10,9 +10,9 @@ bin_PROGRAMS = \
|
||||
main.c
|
||||
5_ton_folge_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../anetz/libgermanton.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libgoertzel/libgoertzel.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include "../libmobile/call.h"
|
||||
#include "../libmobile/main_mobile.h"
|
||||
#include "../liboptions/options.h"
|
||||
#include "../anetz/besetztton.h"
|
||||
#include "fuenf.h"
|
||||
#include "dsp.h"
|
||||
|
||||
@@ -179,11 +178,8 @@ int main(int argc, char *argv[])
|
||||
/* BOS does not use emphasis, so disable it */
|
||||
uses_emphasis = 0;
|
||||
|
||||
/* init common tones */
|
||||
init_besetzton();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789", number_lengths, NULL, bos_number_valid);
|
||||
main_mobile_init("0123456789", number_lengths, NULL, bos_number_valid, "german");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -12,10 +12,9 @@ fuvst_SOURCES = \
|
||||
main.c
|
||||
fuvst_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../anetz/libgermanton.a \
|
||||
../cnetz/libcnetztones.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libcompandor/libcompandor.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
@@ -41,6 +40,7 @@ fuvst_sniffer_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libcompandor/libcompandor.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
|
@@ -29,9 +29,6 @@
|
||||
#include <osmocom/core/timer.h>
|
||||
#include "../liboptions/options.h"
|
||||
#include "../libfm/fm.h"
|
||||
#include "../anetz/freiton.h"
|
||||
#include "../anetz/besetztton.h"
|
||||
#include "../cnetz/ansage.h"
|
||||
#include "fuvst.h"
|
||||
|
||||
static int num_chan_type = 0;
|
||||
@@ -176,16 +173,11 @@ int main(int argc, char *argv[])
|
||||
int i = 0;
|
||||
int any_zzk = 0, any_spk = 0;
|
||||
|
||||
/* init system specific tones */
|
||||
init_freiton();
|
||||
init_besetzton();
|
||||
init_ansage();
|
||||
|
||||
/* init mobile interface */
|
||||
allow_sdr = 0;
|
||||
uses_emphasis = 0;
|
||||
check_channel = 0;
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, cnetz_number_valid);
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, cnetz_number_valid, "german");
|
||||
|
||||
config_init();
|
||||
|
||||
|
@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
|
||||
allow_sdr = 0;
|
||||
uses_emphasis = 0;
|
||||
check_channel = 0;
|
||||
main_mobile_init(NULL, NULL, NULL, NULL);
|
||||
main_mobile_init(NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -10,9 +10,9 @@ golay_SOURCES = \
|
||||
main.c
|
||||
golay_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../amps/libusatone.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
$(top_builddir)/src/libsamplerate/libsamplerate.a \
|
||||
|
@@ -32,11 +32,6 @@
|
||||
#include "../libmobile/main_mobile.h"
|
||||
#include "../liboptions/options.h"
|
||||
#include "../libfm/fm.h"
|
||||
#include "../amps/tones.h"
|
||||
#include "../amps/noanswer.h"
|
||||
#include "../amps/outoforder.h"
|
||||
#include "../amps/invalidnumber.h"
|
||||
#include "../amps/congestion.h"
|
||||
#include "golay.h"
|
||||
|
||||
#define MSG_SEND "/tmp/golay_msg_send"
|
||||
@@ -192,19 +187,12 @@ int main(int argc, char *argv[])
|
||||
/* GSC does not use emphasis, so disable it */
|
||||
uses_emphasis = 0;
|
||||
|
||||
/* init common tones */
|
||||
init_tones();
|
||||
init_outoforder();
|
||||
init_noanswer();
|
||||
init_invalidnumber();
|
||||
init_congestion();
|
||||
|
||||
/* init coding tables */
|
||||
init_golay();
|
||||
init_bch();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789", number_lengths, NULL, NULL);
|
||||
main_mobile_init("0123456789", number_lengths, NULL, NULL, "american");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -11,9 +11,9 @@ imts_SOURCES = \
|
||||
main.c
|
||||
imts_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../amps/libusatone.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
$(top_builddir)/src/libsquelch/libsquelch.a \
|
||||
|
@@ -29,11 +29,6 @@
|
||||
#include <osmocom/core/timer.h>
|
||||
#include "../libmobile/call.h"
|
||||
#include "../liboptions/options.h"
|
||||
#include "../amps/tones.h"
|
||||
#include "../amps/outoforder.h"
|
||||
#include "../amps/noanswer.h"
|
||||
#include "../amps/invalidnumber.h"
|
||||
#include "../amps/congestion.h"
|
||||
#include "imts.h"
|
||||
#include "dsp.h"
|
||||
|
||||
@@ -156,15 +151,8 @@ int main(int argc, char *argv[])
|
||||
const char *station_id = "";
|
||||
int i;
|
||||
|
||||
/* init common tones */
|
||||
init_tones();
|
||||
init_outoforder();
|
||||
init_noanswer();
|
||||
init_invalidnumber();
|
||||
init_congestion();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, NULL);
|
||||
main_mobile_init("0123456789", number_lengths, number_prefixes, NULL, "oldamerican");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -10,9 +10,9 @@ jollycom_SOURCES = \
|
||||
main.c
|
||||
jollycom_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../anetz/libgermanton.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
$(top_builddir)/src/libsquelch/libsquelch.a \
|
||||
|
@@ -31,8 +31,6 @@
|
||||
#include "../libmobile/main_mobile.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include <osmocom/core/timer.h>
|
||||
#include "../anetz/freiton.h"
|
||||
#include "../anetz/besetztton.h"
|
||||
#include "../liboptions/options.h"
|
||||
#include "jolly.h"
|
||||
#include "dsp.h"
|
||||
@@ -129,13 +127,8 @@ int main(int argc, char *argv[])
|
||||
int mandatory = 0;
|
||||
int i;
|
||||
|
||||
/* init tones */
|
||||
init_freiton();
|
||||
init_besetzton();
|
||||
// init_ansage();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789", number_lengths, NULL, NULL);
|
||||
main_mobile_init("0123456789", number_lengths, NULL, NULL, "german");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include "../libsample/sample.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include "../libtones/tones.h"
|
||||
#include <osmocom/core/timer.h>
|
||||
#include <osmocom/core/select.h>
|
||||
#include <osmocom/cc/endpoint.h>
|
||||
@@ -62,6 +63,8 @@ static int release_on_disconnect; /* release towards mobile phone, if OSMO-CC ca
|
||||
|
||||
osmo_cc_endpoint_t endpoint, *ep;
|
||||
|
||||
static tones_data_t call_tones;
|
||||
|
||||
void encode_l16(uint8_t *src_data, int src_len, uint8_t **dst_data, int *dst_len, void __attribute__((unused)) *arg)
|
||||
{
|
||||
uint16_t *src = (uint16_t *)src_data, *dst;
|
||||
@@ -99,142 +102,6 @@ static struct osmo_cc_helper_audio_codecs codecs[] = {
|
||||
|
||||
static int no_l16 = 0;
|
||||
|
||||
/* stream patterns/announcements */
|
||||
int16_t *ringback_spl = NULL;
|
||||
int ringback_size = 0;
|
||||
int ringback_max = 0;
|
||||
int16_t *hangup_spl = NULL;
|
||||
int hangup_size = 0;
|
||||
int hangup_max = 0;
|
||||
int16_t *busy_spl = NULL;
|
||||
int busy_size = 0;
|
||||
int busy_max = 0;
|
||||
int16_t *noanswer_spl = NULL;
|
||||
int noanswer_size = 0;
|
||||
int noanswer_max = 0;
|
||||
int16_t *outoforder_spl = NULL;
|
||||
int outoforder_size = 0;
|
||||
int outoforder_max = 0;
|
||||
int16_t *invalidnumber_spl = NULL;
|
||||
int invalidnumber_size = 0;
|
||||
int invalidnumber_max = 0;
|
||||
int16_t *congestion_spl = NULL;
|
||||
int congestion_size = 0;
|
||||
int congestion_max = 0;
|
||||
int16_t *recall_spl = NULL;
|
||||
int recall_size = 0;
|
||||
int recall_max = 0;
|
||||
|
||||
enum audio_pattern {
|
||||
PATTERN_NONE = 0,
|
||||
PATTERN_TEST,
|
||||
PATTERN_RINGBACK,
|
||||
PATTERN_HANGUP,
|
||||
PATTERN_BUSY,
|
||||
PATTERN_NOANSWER,
|
||||
PATTERN_OUTOFORDER,
|
||||
PATTERN_INVALIDNUMBER,
|
||||
PATTERN_CONGESTION,
|
||||
PATTERN_RECALL,
|
||||
};
|
||||
|
||||
static void get_pattern(const int16_t **spl, int *size, int *max, enum audio_pattern pattern)
|
||||
{
|
||||
*spl = NULL;
|
||||
*size = 0;
|
||||
*max = 0;
|
||||
|
||||
switch (pattern) {
|
||||
case PATTERN_RINGBACK:
|
||||
no_recall:
|
||||
*spl = ringback_spl;
|
||||
*size = ringback_size;
|
||||
*max = ringback_max;
|
||||
break;
|
||||
case PATTERN_HANGUP:
|
||||
if (!hangup_spl)
|
||||
goto no_hangup;
|
||||
*spl = hangup_spl;
|
||||
*size = hangup_size;
|
||||
*max = hangup_max;
|
||||
break;
|
||||
case PATTERN_BUSY:
|
||||
no_hangup:
|
||||
no_noanswer:
|
||||
*spl = busy_spl;
|
||||
*size = busy_size;
|
||||
*max = busy_max;
|
||||
break;
|
||||
case PATTERN_NOANSWER:
|
||||
if (!noanswer_spl)
|
||||
goto no_noanswer;
|
||||
*spl = noanswer_spl;
|
||||
*size = noanswer_size;
|
||||
*max = noanswer_max;
|
||||
break;
|
||||
case PATTERN_OUTOFORDER:
|
||||
if (!outoforder_spl)
|
||||
goto no_outoforder;
|
||||
*spl = outoforder_spl;
|
||||
*size = outoforder_size;
|
||||
*max = outoforder_max;
|
||||
break;
|
||||
case PATTERN_INVALIDNUMBER:
|
||||
if (!invalidnumber_spl)
|
||||
goto no_invalidnumber;
|
||||
*spl = invalidnumber_spl;
|
||||
*size = invalidnumber_size;
|
||||
*max = invalidnumber_max;
|
||||
break;
|
||||
case PATTERN_CONGESTION:
|
||||
no_outoforder:
|
||||
no_invalidnumber:
|
||||
*spl = congestion_spl;
|
||||
*size = congestion_size;
|
||||
*max = congestion_max;
|
||||
break;
|
||||
case PATTERN_RECALL:
|
||||
if (!recall_spl)
|
||||
goto no_recall;
|
||||
*spl = recall_spl;
|
||||
*size = recall_size;
|
||||
*max = recall_max;
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
static enum audio_pattern cause2pattern(int cause)
|
||||
{
|
||||
int pattern;
|
||||
|
||||
switch (cause) {
|
||||
case CAUSE_NORMAL:
|
||||
pattern = PATTERN_HANGUP;
|
||||
break;
|
||||
case CAUSE_BUSY:
|
||||
pattern = PATTERN_BUSY;
|
||||
break;
|
||||
case CAUSE_NOANSWER:
|
||||
pattern = PATTERN_NOANSWER;
|
||||
break;
|
||||
case CAUSE_OUTOFORDER:
|
||||
pattern = PATTERN_OUTOFORDER;
|
||||
break;
|
||||
case CAUSE_INVALNUMBER:
|
||||
pattern = PATTERN_INVALIDNUMBER;
|
||||
break;
|
||||
case CAUSE_NOCHANNEL:
|
||||
pattern = PATTERN_CONGESTION;
|
||||
break;
|
||||
default:
|
||||
pattern = PATTERN_HANGUP;
|
||||
}
|
||||
|
||||
return pattern;
|
||||
}
|
||||
|
||||
enum process_state {
|
||||
PROCESS_IDLE = 0, /* IDLE */
|
||||
PROCESS_SETUP_RO, /* call from radio to OSMO-CC */
|
||||
@@ -251,8 +118,7 @@ typedef struct process {
|
||||
int callref;
|
||||
enum process_state state;
|
||||
int audio_disconnected; /* if not associated with transceiver anymore */
|
||||
enum audio_pattern pattern;
|
||||
int audio_pos;
|
||||
tones_t tones;
|
||||
uint8_t cause;
|
||||
struct osmo_timer_list timer;
|
||||
osmo_cc_session_t *session;
|
||||
@@ -279,6 +145,7 @@ static process_t *create_process(int callref, enum process_state state)
|
||||
|
||||
process->callref = callref;
|
||||
process->state = state;
|
||||
tones_set_tone(&call_tones, &process->tones, TONES_TONE_OFF);
|
||||
|
||||
return process;
|
||||
}
|
||||
@@ -327,7 +194,7 @@ static void new_state_process(int callref, enum process_state state)
|
||||
process->state = state;
|
||||
}
|
||||
|
||||
static void set_pattern_process(int callref, enum audio_pattern pattern)
|
||||
static void set_tone_process(int callref, enum tones_tone tone)
|
||||
{
|
||||
process_t *process = get_process(callref);
|
||||
|
||||
@@ -335,11 +202,9 @@ static void set_pattern_process(int callref, enum audio_pattern pattern)
|
||||
LOGP(DCALL, LOGL_ERROR, "Process with callref %d not found!\n", callref);
|
||||
return;
|
||||
}
|
||||
process->pattern = pattern;
|
||||
process->audio_pos = 0;
|
||||
tones_set_tone(&call_tones, &process->tones, tone);
|
||||
}
|
||||
|
||||
/* disconnect audio, now send audio directly from pattern/announcement, not from transceiver */
|
||||
static void disconnect_process(int callref, int cause)
|
||||
{
|
||||
process_t *process = get_process(callref);
|
||||
@@ -348,33 +213,12 @@ static void disconnect_process(int callref, int cause)
|
||||
LOGP(DCALL, LOGL_ERROR, "Process with callref %d not found!\n", callref);
|
||||
return;
|
||||
}
|
||||
process->pattern = cause2pattern(cause);
|
||||
tones_set_tone(&call_tones, &process->tones, cause);
|
||||
process->audio_disconnected = 1;
|
||||
process->audio_pos = 0;
|
||||
process->cause = cause;
|
||||
osmo_timer_schedule(&process->timer, DISC_TIMEOUT);
|
||||
}
|
||||
|
||||
static void get_process_patterns(process_t *process, int16_t *samples, int length)
|
||||
{
|
||||
const int16_t *spl;
|
||||
int size, max, pos;
|
||||
|
||||
get_pattern(&spl, &size, &max, process->pattern);
|
||||
|
||||
/* stream sample */
|
||||
pos = process->audio_pos;
|
||||
while(length--) {
|
||||
if (pos >= size)
|
||||
*samples++ = 0;
|
||||
else
|
||||
*samples++ = spl[pos] >> 2;
|
||||
if (++pos == max)
|
||||
pos = 0;
|
||||
}
|
||||
process->audio_pos = pos;
|
||||
}
|
||||
|
||||
static void process_timeout(void *data)
|
||||
{
|
||||
process_t *process = data;
|
||||
@@ -395,8 +239,8 @@ static void down_audio(struct osmo_cc_session_codec *codec, uint8_t marker, uint
|
||||
process_t *process = codec->media->session->priv;
|
||||
// sample_t samples[len / 2];
|
||||
|
||||
/* if we are disconnected, ignore audio */
|
||||
if (!process || process->pattern != PATTERN_NONE)
|
||||
/* if we are disconnected or if a tone is played, ignore audio */
|
||||
if (!process || process->tones.tone != TONES_TONE_OFF)
|
||||
return;
|
||||
#if 0
|
||||
int16_to_samples_speech(samples, (int16_t *)data, len / 2);
|
||||
@@ -532,14 +376,14 @@ void call_up_alerting(int callref)
|
||||
|
||||
if (!connect_on_setup)
|
||||
indicate_alerting(callref);
|
||||
set_pattern_process(callref, PATTERN_RINGBACK);
|
||||
set_tone_process(callref, TONES_TONE_RINGBACK);
|
||||
new_state_process(callref, PROCESS_ALERTING_RT);
|
||||
}
|
||||
|
||||
/* Transceiver indicates early audio */
|
||||
void call_up_early(int callref)
|
||||
{
|
||||
set_pattern_process(callref, PATTERN_NONE);
|
||||
set_tone_process(callref, TONES_TONE_OFF);
|
||||
}
|
||||
|
||||
/* Transceiver indicates answer. */
|
||||
@@ -554,7 +398,7 @@ void call_up_answer(int callref, const char *connect_id)
|
||||
|
||||
if (!connect_on_setup)
|
||||
indicate_answer(callref, NULL, connect_id);
|
||||
set_pattern_process(callref, PATTERN_NONE);
|
||||
set_tone_process(callref, TONES_TONE_OFF);
|
||||
new_state_process(callref, PROCESS_CONNECT);
|
||||
}
|
||||
|
||||
@@ -600,7 +444,7 @@ void call_up_release(int callref, int cause)
|
||||
/* turn recall tone on or off */
|
||||
void call_tone_recall(int callref, int on)
|
||||
{
|
||||
set_pattern_process(callref, (on) ? PATTERN_RECALL : PATTERN_NONE);
|
||||
set_tone_process(callref, (on) ? TONES_TONE_RECALL : TONES_TONE_OFF);
|
||||
}
|
||||
|
||||
/* forward audio to OSMO-CC or call instance */
|
||||
@@ -618,9 +462,9 @@ void call_up_audio(int callref, sample_t *samples, int len)
|
||||
if (!callref)
|
||||
return;
|
||||
|
||||
/* if we are disconnected, ignore audio */
|
||||
/* if we are disconnected or if a tone is played, ignore audio */
|
||||
process = get_process(callref);
|
||||
if (!process || process->pattern != PATTERN_NONE)
|
||||
if (!process || process->tones.tone != TONES_TONE_OFF)
|
||||
return;
|
||||
|
||||
/* no codec negotiated (yet) */
|
||||
@@ -649,12 +493,12 @@ void call_clock(void)
|
||||
call_down_clock();
|
||||
|
||||
while(process) {
|
||||
if (process->pattern != PATTERN_NONE) {
|
||||
if (process->tones.tone != TONES_TONE_OFF) {
|
||||
int16_t spl[160];
|
||||
uint8_t *payload;
|
||||
int payload_len;
|
||||
/* try to get patterns, else copy the samples we got */
|
||||
get_process_patterns(process, spl, 160);
|
||||
tones_read_tone(&process->tones, spl, 160);
|
||||
#ifdef DEBUG_LEVEL
|
||||
sample_t samples[160];
|
||||
int16_to_samples(samples, (int16_t *)spl->data, 160);
|
||||
@@ -921,7 +765,7 @@ static void ll_msg_cb(osmo_cc_endpoint_t __attribute__((unused)) *ep, uint32_t c
|
||||
osmo_cc_free_msg(msg);
|
||||
}
|
||||
|
||||
int call_init(const char *name, int _send_patterns, int _release_on_disconnect, int use_socket, int argc, const char *argv[], int _no_l16)
|
||||
int call_init(const char *name, int _send_patterns, int _release_on_disconnect, int use_socket, int argc, const char *argv[], int _no_l16, const char *toneset)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -929,6 +773,11 @@ int call_init(const char *name, int _send_patterns, int _release_on_disconnect,
|
||||
release_on_disconnect = _release_on_disconnect;
|
||||
|
||||
g711_init();
|
||||
rc = tones_init(&call_tones, toneset, TONES_TDATA_SLIN16HOST);
|
||||
if (rc > 0) {
|
||||
LOGP(DCALL, LOGL_INFO, "Failed to initialize tone set '%s'. Please fix!\n", toneset);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
no_l16 = !!_no_l16;
|
||||
ep = &endpoint;
|
||||
@@ -943,6 +792,7 @@ int call_init(const char *name, int _send_patterns, int _release_on_disconnect,
|
||||
|
||||
void call_exit(void)
|
||||
{
|
||||
tones_exit(&call_tones);
|
||||
if (ep) {
|
||||
osmo_cc_delete(ep);
|
||||
ep = NULL;
|
||||
|
@@ -12,7 +12,7 @@ enum number_type {
|
||||
void encode_l16(uint8_t *src_data, int src_len, uint8_t **dst_data, int *dst_len, void __attribute__((unused)) *arg);
|
||||
void decode_l16(uint8_t *src_data, int src_len, uint8_t **dst_data, int *dst_len, void __attribute__((unused)) *arg);
|
||||
|
||||
int call_init(const char *name, int _send_patterns, int _release_on_disconnect, int use_socket, int argc, const char *argv[], int no_l16);
|
||||
int call_init(const char *name, int _send_patterns, int _release_on_disconnect, int use_socket, int argc, const char *argv[], int no_l16, const char *toneset);
|
||||
void call_exit(void);
|
||||
int call_handle(void);
|
||||
void call_media_handle(void);
|
||||
|
@@ -73,6 +73,7 @@ static int use_osmocc_sock = 0;
|
||||
static int cc_argc = 0;
|
||||
static const char *cc_argv[MAX_CC_ARGS];
|
||||
int no_l16 = 0;
|
||||
static const char *call_toneset = NULL;
|
||||
int send_patterns = 1;
|
||||
static int release_on_disconnect = 1;
|
||||
int loopback = 0;
|
||||
@@ -165,7 +166,7 @@ const char *mobile_number_check_digits(const char *number)
|
||||
|
||||
const char *(*mobile_number_check_valid)(const char *);
|
||||
|
||||
void main_mobile_init(const char *digits, const struct number_lengths lengths[], const char *prefixes[], const char *(*check_valid)(const char *))
|
||||
void main_mobile_init(const char *digits, const struct number_lengths lengths[], const char *prefixes[], const char *(*check_valid)(const char *), const char *toneset)
|
||||
{
|
||||
logging_init();
|
||||
|
||||
@@ -175,6 +176,7 @@ void main_mobile_init(const char *digits, const struct number_lengths lengths[],
|
||||
number_lengths = lengths;
|
||||
number_prefixes = prefixes;
|
||||
mobile_number_check_valid = check_valid;
|
||||
call_toneset = toneset;
|
||||
|
||||
got_init = 1;
|
||||
#ifdef HAVE_SDR
|
||||
@@ -677,7 +679,7 @@ void main_mobile_loop(const char *name, int *quit, void (*myhandler)(void), cons
|
||||
console_init(call_device, call_samplerate, call_buffer, loopback, echo_test, number_digits, number_lengths, station_id);
|
||||
|
||||
/* init call control instance */
|
||||
rc = call_init(name, (use_osmocc_sock) ? send_patterns : 0, release_on_disconnect, use_osmocc_sock, cc_argc, cc_argv, no_l16);
|
||||
rc = call_init(name, (use_osmocc_sock) ? send_patterns : 0, release_on_disconnect, use_osmocc_sock, cc_argc, cc_argv, no_l16, call_toneset);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "Failed to create call control instance. Quitting!\n");
|
||||
return;
|
||||
|
@@ -36,7 +36,7 @@ const char *mobile_number_check_digits(const char *number);
|
||||
extern const char *(*mobile_number_check_valid)(const char *);
|
||||
int main_mobile_number_ask(const char *number, const char *what);
|
||||
|
||||
void main_mobile_init(const char *digits, const struct number_lengths lengths[], const char *prefixes[], const char *(*check_valid)(const char *));
|
||||
void main_mobile_init(const char *digits, const struct number_lengths lengths[], const char *prefixes[], const char *(*check_valid)(const char *), const char *toneset);
|
||||
void main_mobile_exit(void);
|
||||
void main_mobile_set_number_check_valid(const char *(*check_valid)(const char *));
|
||||
void main_mobile_print_help(const char *arg0, const char *ext_usage);
|
||||
|
16
src/libtones/Makefile.am
Normal file
16
src/libtones/Makefile.am
Normal file
@@ -0,0 +1,16 @@
|
||||
AM_CPPFLAGS = -Wall -Wextra -Wmissing-prototypes -g $(all_includes)
|
||||
|
||||
noinst_LIBRARIES = libtones.a
|
||||
|
||||
libtones_a_SOURCES = \
|
||||
tones.c \
|
||||
patterns.c \
|
||||
german_outoforder.c \
|
||||
oldgerman_outoforder.c \
|
||||
american_congestion.c \
|
||||
american_outoforder.c \
|
||||
american_invalidnumber.c \
|
||||
american_noanswer.c \
|
||||
denmark_outoforder.c \
|
||||
uk_outoforder.c \
|
||||
france_outoforder.c
|
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include "congestion.h"
|
||||
#include <stdlib.h>
|
||||
#include "tones.h"
|
||||
#include "american_congestion.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
static uint16_t slin16_congestion[] = {
|
||||
0xfffd, 0x0004, 0xfffb, 0x0004, 0xfffe, 0x0001, 0x0001, 0xfffe,
|
||||
0x0001, 0xfffe, 0x0002, 0xfffe, 0xffff, 0x0001, 0xfffd, 0x0001,
|
||||
0xffff, 0x0000, 0x0001, 0x0001, 0xfffe, 0xffff, 0x0000, 0xfffe,
|
||||
@@ -6632,15 +6634,8 @@ static int16_t pattern[] = {
|
||||
0xfee3, 0xff0f, 0x0007, 0xff7b, 0xfee5, 0xfefe, 0xff93, 0x0033,
|
||||
};
|
||||
|
||||
extern int16_t *congestion_spl;
|
||||
extern int congestion_size;
|
||||
extern int congestion_max;
|
||||
|
||||
void init_congestion(void)
|
||||
{
|
||||
congestion_spl = pattern;
|
||||
congestion_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
congestion_max = congestion_size;
|
||||
}
|
||||
|
||||
tones_seq_t seq_american_congestion[] = {
|
||||
{ TONES_TDATA_SLIN16HOST, TONES_DURATION_AUTO, slin16_congestion, sizeof(slin16_congestion), -6.0 },
|
||||
{ TONES_TDATA_EOL, 0, NULL, 0, 0.0 }
|
||||
};
|
||||
|
3
src/libtones/american_congestion.h
Normal file
3
src/libtones/american_congestion.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
extern tones_seq_t seq_american_congestion[];
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include "invalidnumber.h"
|
||||
#include <stdlib.h>
|
||||
#include "tones.h"
|
||||
#include "american_invalidnumber.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
static uint16_t slin16_invalidnumber[] = {
|
||||
0xfffe, 0x0001, 0xffff, 0x0001, 0xffff, 0x0002, 0xfffe, 0x0002,
|
||||
0xfffd, 0x0002, 0xffff, 0xfffe, 0x0002, 0xfffc, 0x0003, 0xfffc,
|
||||
0x0002, 0xfffe, 0x0003, 0xffff, 0x0001, 0xfffc, 0x0002, 0xfffd,
|
||||
@@ -7209,15 +7211,8 @@ static int16_t pattern[] = {
|
||||
0xfffc, 0x00c0, 0x005c, 0xff41, 0xff90, 0x0021, 0xff10, 0xff27,
|
||||
};
|
||||
|
||||
extern int16_t *invalidnumber_spl;
|
||||
extern int invalidnumber_size;
|
||||
extern int invalidnumber_max;
|
||||
|
||||
void init_invalidnumber(void)
|
||||
{
|
||||
invalidnumber_spl = pattern;
|
||||
invalidnumber_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
invalidnumber_max = invalidnumber_size;
|
||||
}
|
||||
|
||||
tones_seq_t seq_american_invalidnumber[] = {
|
||||
{ TONES_TDATA_SLIN16HOST, TONES_DURATION_AUTO, slin16_invalidnumber, sizeof(slin16_invalidnumber), -6.0 },
|
||||
{ TONES_TDATA_EOL, 0, NULL, 0, 0.0 }
|
||||
};
|
||||
|
3
src/libtones/american_invalidnumber.h
Normal file
3
src/libtones/american_invalidnumber.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
extern tones_seq_t seq_american_invalidnumber[];
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include "noanswer.h"
|
||||
#include <stdlib.h>
|
||||
#include "tones.h"
|
||||
#include "american_congestion.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
static uint16_t slin16_noanswer[] = {
|
||||
0xfe24, 0xfd20, 0xfd2c, 0xfdb5, 0xfeba, 0xfe20, 0xfd41, 0xfe32,
|
||||
0xfea5, 0xfddf, 0xfde3, 0xfdda, 0xfd0c, 0xfe04, 0xff6d, 0xfec7,
|
||||
0xfca2, 0xfcb7, 0xfe65, 0xfe99, 0xfe9c, 0xfe2e, 0xfd18, 0xfd7a,
|
||||
@@ -5092,15 +5094,8 @@ static int16_t pattern[] = {
|
||||
0xfe6a, 0xfe18, 0xff14, 0xff4e, 0xfe2d, 0xfdd9, 0xfde3, 0xfdd8,
|
||||
};
|
||||
|
||||
extern int16_t *noanswer_spl;
|
||||
extern int noanswer_size;
|
||||
extern int noanswer_max;
|
||||
|
||||
void init_noanswer(void)
|
||||
{
|
||||
noanswer_spl = pattern;
|
||||
noanswer_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
noanswer_max = noanswer_size;
|
||||
}
|
||||
|
||||
tones_seq_t seq_american_noanswer[] = {
|
||||
{ TONES_TDATA_SLIN16HOST, TONES_DURATION_AUTO, slin16_noanswer, sizeof(slin16_noanswer), -6.0 },
|
||||
{ TONES_TDATA_EOL, 0, NULL, 0, 0.0 }
|
||||
};
|
||||
|
3
src/libtones/american_noanswer.h
Normal file
3
src/libtones/american_noanswer.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
extern tones_seq_t seq_american_noanswer[];
|
||||
|
8178
src/libtones/american_outoforder.c
Normal file
8178
src/libtones/american_outoforder.c
Normal file
File diff suppressed because it is too large
Load Diff
3
src/libtones/american_outoforder.h
Normal file
3
src/libtones/american_outoforder.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
extern tones_seq_t seq_american_outoforder[];
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include "announcement.h"
|
||||
#include <stdlib.h>
|
||||
#include "tones.h"
|
||||
#include "denmark_outoforder.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
static uint16_t slin16_outoforder[] = {
|
||||
0x0007, 0x0008, 0x0008, 0x0009, 0x0006, 0x000b, 0x0004, 0x000a,
|
||||
0x0008, 0x0006, 0x000a, 0x0005, 0x0007, 0x0009, 0x0006, 0x0009,
|
||||
0x0006, 0x0008, 0x000a, 0x0005, 0x000b, 0x0004, 0x0009, 0x000a,
|
||||
@@ -7147,15 +7149,8 @@ static int16_t pattern[] = {
|
||||
0xff85, 0xff83, 0xff8e, 0xff82, 0xff82, 0xff8a, 0xff87, 0xff93,
|
||||
};
|
||||
|
||||
extern int16_t *outoforder_spl;
|
||||
extern int outoforder_size;
|
||||
extern int outoforder_max;
|
||||
|
||||
void init_announcement(void)
|
||||
{
|
||||
outoforder_spl = pattern;
|
||||
outoforder_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
outoforder_max = outoforder_size;
|
||||
}
|
||||
|
||||
tones_seq_t seq_denmark_outoforder[] = {
|
||||
{ TONES_TDATA_SLIN16HOST, TONES_DURATION_AUTO, slin16_outoforder, sizeof(slin16_outoforder), -6.0 },
|
||||
{ TONES_TDATA_EOL, 0, NULL, 0, 0.0 }
|
||||
};
|
||||
|
3
src/libtones/denmark_outoforder.h
Normal file
3
src/libtones/denmark_outoforder.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
extern tones_seq_t seq_denmark_outoforder[];
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include "outoforder.h"
|
||||
#include <stdlib.h>
|
||||
#include "tones.h"
|
||||
#include "france_outoforder.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
static uint16_t slin16_outoforder[] = {
|
||||
0x0000, 0x0000, 0x0003, 0xfff8, 0xfff6, 0xfff2, 0xfffd, 0xfffc,
|
||||
0xfffd, 0x0004, 0xfffb, 0xfffb, 0xffff, 0x0001, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0xfffa, 0xfffa, 0xfffd, 0xffff, 0x0002, 0xffff,
|
||||
@@ -6801,14 +6803,8 @@ static int16_t pattern[] = {
|
||||
0xfff8, 0xfff1, 0xfff8, 0xfff3, 0xfff5, 0xfff5, 0xfff5, 0xfff4,
|
||||
};
|
||||
|
||||
extern int16_t *outoforder_spl;
|
||||
extern int outoforder_size;
|
||||
extern int outoforder_max;
|
||||
|
||||
void init_outoforder(void)
|
||||
{
|
||||
outoforder_spl = pattern;
|
||||
outoforder_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
outoforder_max = outoforder_size;
|
||||
}
|
||||
tones_seq_t seq_france_outoforder[] = {
|
||||
{ TONES_TDATA_SLIN16HOST, TONES_DURATION_AUTO, slin16_outoforder, sizeof(slin16_outoforder), -6.0 },
|
||||
{ TONES_TDATA_EOL, 0, NULL, 0, 0.0 }
|
||||
};
|
||||
|
3
src/libtones/france_outoforder.h
Normal file
3
src/libtones/france_outoforder.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
extern tones_seq_t seq_france_outoforder[];
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include "ansage.h"
|
||||
#include <stdlib.h>
|
||||
#include "tones.h"
|
||||
#include "german_outoforder.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
static uint16_t slin16_outoforder[] = {
|
||||
0x0012, 0x0019, 0x0016, 0x0019, 0x0015, 0x0008, 0xfffd, 0x0005,
|
||||
0x000e, 0x0018, 0x000d, 0xfff4, 0xfffa, 0x0004, 0x0004, 0x0011,
|
||||
0x0007, 0x0003, 0xffff, 0xffff, 0x0009, 0x000d, 0x001c, 0x0015,
|
||||
@@ -5415,14 +5417,9 @@ static int16_t pattern[] = {
|
||||
0xfff6, 0xfff7, 0x0007, 0x000e, 0x0015, 0x0005, 0x0002, 0xfff5,
|
||||
0xfff8, 0x0003, 0x0002, 0x001c, 0x000d, 0x0004, 0xfff0, 0xfff6,
|
||||
};
|
||||
extern int16_t *outoforder_spl;
|
||||
extern int outoforder_size;
|
||||
extern int outoforder_max;
|
||||
|
||||
void init_ansage(void)
|
||||
{
|
||||
outoforder_spl = pattern;
|
||||
outoforder_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
outoforder_max = outoforder_size;
|
||||
}
|
||||
tones_seq_t seq_german_outoforder[] = {
|
||||
{ TONES_TDATA_SLIN16HOST, TONES_DURATION_AUTO, slin16_outoforder, sizeof(slin16_outoforder), -6.0 },
|
||||
{ TONES_TDATA_EOL, 0, NULL, 0, 0.0 }
|
||||
};
|
||||
|
3
src/libtones/german_outoforder.h
Normal file
3
src/libtones/german_outoforder.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
extern tones_seq_t seq_german_outoforder[];
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include "ansage.h"
|
||||
#include <stdlib.h>
|
||||
#include "tones.h"
|
||||
#include "oldgerman_outoforder.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
static uint16_t slin16_outoforder[] = {
|
||||
0xffd1, 0x0011, 0x0031, 0x002d, 0x0016, 0x000d, 0x002f, 0xffea,
|
||||
0xfffc, 0x001e, 0xffe2, 0xffd3, 0xfff8, 0x0021, 0x0001, 0xffed,
|
||||
0xfff4, 0xffe7, 0xfff1, 0x0008, 0x001d, 0xffe4, 0xfffa, 0x0007,
|
||||
@@ -4991,15 +4993,8 @@ static int16_t pattern[] = {
|
||||
0x0006, 0x000e, 0xfffd, 0x000b, 0xfffc, 0x000b, 0x000e, 0xfffb,
|
||||
};
|
||||
|
||||
extern int16_t *outoforder_spl;
|
||||
extern int outoforder_size;
|
||||
extern int outoforder_max;
|
||||
|
||||
void init_ansage(void)
|
||||
{
|
||||
outoforder_spl = pattern;
|
||||
outoforder_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
outoforder_max = outoforder_size;
|
||||
}
|
||||
|
||||
tones_seq_t seq_oldgerman_outoforder[] = {
|
||||
{ TONES_TDATA_SLIN16HOST, TONES_DURATION_AUTO, slin16_outoforder, sizeof(slin16_outoforder), -6.0 },
|
||||
{ TONES_TDATA_EOL, 0, NULL, 0, 0.0 }
|
||||
};
|
||||
|
3
src/libtones/oldgerman_outoforder.h
Normal file
3
src/libtones/oldgerman_outoforder.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
extern tones_seq_t seq_oldgerman_outoforder[];
|
||||
|
1013
src/libtones/patterns.c
Normal file
1013
src/libtones/patterns.c
Normal file
File diff suppressed because it is too large
Load Diff
11
src/libtones/patterns.h
Normal file
11
src/libtones/patterns.h
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
extern tones_seq_t seq_silence[];
|
||||
extern tones_set_t set_german[];
|
||||
extern tones_set_t set_oldgerman[];
|
||||
extern tones_set_t set_morsegerman[];
|
||||
extern tones_set_t set_american[];
|
||||
extern tones_set_t set_oldamerican[];
|
||||
extern tones_set_t set_denmark[];
|
||||
extern tones_set_t set_japan[];
|
||||
extern tones_set_t set_france[];
|
||||
|
449
src/libtones/tones.c
Normal file
449
src/libtones/tones.c
Normal file
@@ -0,0 +1,449 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include "tones.h"
|
||||
#include "patterns.h"
|
||||
#include <osmocom/cc/g711.h>
|
||||
|
||||
struct tones_sets_t {
|
||||
bool listed;
|
||||
const char *name;
|
||||
const char *description;
|
||||
tones_set_t *set;
|
||||
} tones_sets[] = {
|
||||
{ true, "german", "German ISDN tones used back in the 90's and 2000's", set_german },
|
||||
{ true, "oldgerman", "German analog tones used back in the 80's and 90's", set_oldgerman },
|
||||
{ true, "morsegerman", "German analog tones used until the end of the 70's", set_morsegerman },
|
||||
{ true, "american", "American tones", set_american },
|
||||
{ true, "oldamerican", "Old American tones", set_oldamerican },
|
||||
{ true, "denmark", "Danish tones", set_denmark },
|
||||
{ true, "japan", "Japanese tones", set_japan },
|
||||
{ true, "france", "French tones", set_france },
|
||||
{ false, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
void tones_list_tonesets(void)
|
||||
{
|
||||
size_t max_name_length = 0;
|
||||
size_t max_description_length = 0;
|
||||
static char spaces[256];
|
||||
static char dashes[256];
|
||||
int i;
|
||||
|
||||
memset(spaces, ' ', sizeof(spaces));
|
||||
memset(dashes, '-', sizeof(dashes));
|
||||
|
||||
for (i = 0; tones_sets[i].name; i++) {
|
||||
if (!tones_sets[i].listed)
|
||||
continue;
|
||||
if (strlen(tones_sets[i].name) > max_name_length)
|
||||
max_name_length = strlen(tones_sets[i].name);
|
||||
if (strlen(tones_sets[i].description) > max_description_length)
|
||||
max_description_length = strlen(tones_sets[i].description);
|
||||
}
|
||||
|
||||
printf("Tones%.*s|Description\n", (int)max_name_length - 5, spaces);
|
||||
printf("%.*s\n", (int)max_name_length + 1 + (int)max_description_length, dashes);
|
||||
for (i = 0; tones_sets[i].name; i++) {
|
||||
printf("%s%.*s|%s\n", tones_sets[i].name, (int)max_name_length - (int)strlen(tones_sets[i].name), spaces, tones_sets[i].description);
|
||||
}
|
||||
}
|
||||
|
||||
static size_t sizeof_coding(enum tones_tdata coding)
|
||||
{
|
||||
switch (coding) {
|
||||
case TONES_TDATA_SLIN16HOST:
|
||||
return 2;
|
||||
case TONES_TDATA_ALAW:
|
||||
case TONES_TDATA_ULAW:
|
||||
case TONES_TDATA_ALAWFLIPPED:
|
||||
case TONES_TDATA_ULAWFLIPPED:
|
||||
return 1;
|
||||
case TONES_TDATA_EOL:
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Illegal coding, please fix!\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
static int render_chunk(void *out_spl, enum tones_tdata out_coding, void *in_spl, enum tones_tdata in_coding, int duration, double db)
|
||||
{
|
||||
uint8_t *temp = NULL, *temp2 = NULL;
|
||||
uint16_t *new_in_spl = NULL;
|
||||
int temp_size, temp_size2;
|
||||
double level, value;
|
||||
int s;
|
||||
|
||||
/* Change level for linear samples */
|
||||
if (in_coding == TONES_TDATA_SLIN16HOST && db) {
|
||||
level = pow(10.0, db / 20.0);
|
||||
new_in_spl = malloc(duration * 2);
|
||||
for (s = 0; s < duration; s++) {
|
||||
value = (double)(((int16_t *)in_spl)[s]) * level;
|
||||
if (value > 32767)
|
||||
value = 32767;
|
||||
if (value < -32767)
|
||||
value = -32767;
|
||||
new_in_spl[s] = (int16_t)value;
|
||||
}
|
||||
in_spl = new_in_spl;
|
||||
}
|
||||
|
||||
switch (out_coding) {
|
||||
case TONES_TDATA_SLIN16HOST:
|
||||
switch (in_coding) {
|
||||
case TONES_TDATA_SLIN16HOST:
|
||||
memcpy(out_spl, in_spl, duration * 2);
|
||||
break;
|
||||
case TONES_TDATA_ALAW:
|
||||
g711_decode_alaw(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration * 2);
|
||||
break;
|
||||
case TONES_TDATA_ULAW:
|
||||
g711_decode_ulaw(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration * 2);
|
||||
break;
|
||||
case TONES_TDATA_ALAWFLIPPED:
|
||||
g711_decode_alaw_flipped(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration * 2);
|
||||
break;
|
||||
case TONES_TDATA_ULAWFLIPPED:
|
||||
g711_decode_ulaw_flipped(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration * 2);
|
||||
break;
|
||||
case TONES_TDATA_EOL:
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
case TONES_TDATA_ALAW:
|
||||
switch (in_coding) {
|
||||
case TONES_TDATA_SLIN16HOST:
|
||||
g711_encode_alaw(in_spl, duration * 2, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ALAW:
|
||||
memcpy(out_spl, in_spl, duration);
|
||||
break;
|
||||
case TONES_TDATA_ULAW:
|
||||
g711_transcode_ulaw_to_alaw(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ALAWFLIPPED:
|
||||
g711_transcode_flipped(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ULAWFLIPPED:
|
||||
g711_transcode_ulaw_flipped_to_alaw(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_EOL:
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
case TONES_TDATA_ULAW:
|
||||
switch (in_coding) {
|
||||
case TONES_TDATA_SLIN16HOST:
|
||||
g711_encode_ulaw(in_spl, duration * 2, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ALAW:
|
||||
g711_transcode_alaw_to_ulaw(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ULAW:
|
||||
memcpy(out_spl, in_spl, duration);
|
||||
break;
|
||||
case TONES_TDATA_ALAWFLIPPED:
|
||||
g711_transcode_alaw_flipped_to_ulaw(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ULAWFLIPPED:
|
||||
g711_transcode_flipped(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_EOL:
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
case TONES_TDATA_ALAWFLIPPED:
|
||||
switch (in_coding) {
|
||||
case TONES_TDATA_SLIN16HOST:
|
||||
g711_encode_alaw_flipped(in_spl, duration * 2, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ALAW:
|
||||
g711_transcode_flipped(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ULAW:
|
||||
g711_transcode_ulaw_to_alaw_flipped(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ALAWFLIPPED:
|
||||
memcpy(out_spl, in_spl, duration);
|
||||
break;
|
||||
case TONES_TDATA_ULAWFLIPPED:
|
||||
g711_transcode_ulaw_flipped_to_alaw(in_spl, duration, &temp, &temp_size, NULL);
|
||||
g711_transcode_flipped(temp, temp_size, &temp2, &temp_size2, NULL);
|
||||
memcpy(out_spl, temp2, duration);
|
||||
break;
|
||||
case TONES_TDATA_EOL:
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
case TONES_TDATA_ULAWFLIPPED:
|
||||
switch (in_coding) {
|
||||
case TONES_TDATA_SLIN16HOST:
|
||||
g711_encode_ulaw_flipped(in_spl, duration * 2, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ALAW:
|
||||
g711_transcode_alaw_to_ulaw_flipped(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ULAW:
|
||||
g711_transcode_flipped(in_spl, duration, &temp, &temp_size, NULL);
|
||||
memcpy(out_spl, temp, duration);
|
||||
break;
|
||||
case TONES_TDATA_ALAWFLIPPED:
|
||||
g711_transcode_alaw_flipped_to_ulaw(in_spl, duration, &temp, &temp_size, NULL);
|
||||
g711_transcode_flipped(temp, temp_size, &temp2, &temp_size2, NULL);
|
||||
memcpy(out_spl, temp2, duration);
|
||||
break;
|
||||
case TONES_TDATA_ULAWFLIPPED:
|
||||
memcpy(out_spl, in_spl, duration);
|
||||
break;
|
||||
case TONES_TDATA_EOL:
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
case TONES_TDATA_EOL:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
free(temp);
|
||||
free(temp2);
|
||||
free(new_in_spl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void render_tone(tones_data_t *data, uint8_t tone, tones_seq_t *seq, enum tones_tdata coding)
|
||||
{
|
||||
int duration, i, s, torender;
|
||||
size_t in_spl_size, out_spl_size;
|
||||
int rc;
|
||||
|
||||
out_spl_size = sizeof_coding(coding);
|
||||
|
||||
/* Get total duration (without tone off duration) to allocate memory. */
|
||||
duration = 0;
|
||||
for (i = 0; seq[i].tdata; i++) {
|
||||
in_spl_size = sizeof_coding(seq[i].tdata);
|
||||
if (seq[i].duration == TONES_DURATION_AUTO)
|
||||
duration += seq[i].spl_data_size / in_spl_size;
|
||||
else
|
||||
duration += seq[i].duration;
|
||||
}
|
||||
data->spl_data[tone] = malloc(duration * data->spl_size);
|
||||
|
||||
/* Render each tone chunk. */
|
||||
duration = 0;
|
||||
for (i = 0; seq[i].tdata; i++) {
|
||||
in_spl_size = sizeof_coding(seq[i].tdata);
|
||||
if (seq[i].duration == TONES_DURATION_AUTO) {
|
||||
torender = seq[i].spl_data_size / in_spl_size;
|
||||
rc = render_chunk(data->spl_data[tone] + duration * out_spl_size, coding, seq[i].spl_data, seq[i].tdata, torender, seq[i].db);
|
||||
if (rc)
|
||||
abort();
|
||||
duration += torender;
|
||||
} else for (s = 0; s < seq[i].duration; s += torender) {
|
||||
torender = seq[i].spl_data_size / in_spl_size;
|
||||
if (seq[i].duration - s < torender)
|
||||
torender = seq[i].duration - s;
|
||||
rc = render_chunk(data->spl_data[tone] + duration * out_spl_size, coding, seq[i].spl_data, seq[i].tdata, torender, seq[i].db);
|
||||
if (rc)
|
||||
abort();
|
||||
duration += torender;
|
||||
}
|
||||
}
|
||||
/* Store total duration of tone. */
|
||||
data->spl_duration[tone] = duration;
|
||||
/* Store silence interval until repeat. Use duration of TONES_TDATA_EOL. */
|
||||
duration += seq[i].duration;
|
||||
data->spl_repeat[tone] = duration;
|
||||
}
|
||||
|
||||
int tones_init(tones_data_t *data, const char *toneset, enum tones_tdata coding)
|
||||
{
|
||||
tones_set_t *set;
|
||||
int i;
|
||||
|
||||
memset(data, 0, sizeof(*data));
|
||||
|
||||
if (!toneset)
|
||||
return 0;
|
||||
|
||||
for (i = 0; tones_sets[i].name; i++) {
|
||||
if (!strcasecmp(tones_sets[i].name, toneset))
|
||||
break;
|
||||
}
|
||||
if (!tones_sets[i].name)
|
||||
return -EINVAL;
|
||||
set = tones_sets[i].set;
|
||||
|
||||
data->spl_size = sizeof_coding(coding);
|
||||
|
||||
for (i = 0; set[i].tone; i++) {
|
||||
render_tone(data, set[i].tone, set[i].seq, coding);
|
||||
int peak = 0;
|
||||
for (int s = 0; s < data->spl_duration[set[i].tone]; s++) {
|
||||
if (((int16_t *)data->spl_data[set[i].tone])[s] > peak)
|
||||
peak = ((int16_t *)data->spl_data[set[i].tone])[s];
|
||||
}
|
||||
}
|
||||
render_tone(data, TONES_TONE_SILENCE, seq_silence, coding);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void tones_exit(tones_data_t *data)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
free(data->spl_data[i]);
|
||||
memset(data, 0, sizeof(*data));
|
||||
}
|
||||
|
||||
/* This function is used to substitute missing tones/anouncements. */
|
||||
static enum tones_tone substitute_tone(tones_data_t *data, enum tones_tone tone)
|
||||
{
|
||||
/* If no tone is given, keep this decision. */
|
||||
if (!tone)
|
||||
return tone;
|
||||
|
||||
/* If no 'recall', use 'ringback'. If none of them, turn off tone. */
|
||||
if (tone == TONES_TONE_RECALL && !data->spl_data[tone])
|
||||
tone = TONES_TONE_RINGBACK;
|
||||
if (tone == TONES_TONE_RINGBACK && !data->spl_data[tone])
|
||||
tone = TONES_TONE_RECALL;
|
||||
if (tone == TONES_TONE_RECALL && !data->spl_data[tone]) {
|
||||
tone = TONES_TONE_SILENCE;
|
||||
return tone;
|
||||
}
|
||||
|
||||
/* Turn 'dialtonespecial' into 'dialtone'. If no dialtone exists, turn off tone. */
|
||||
if (tone == TONES_TONE_DIALTONE_SPECIAL && !data->spl_data[tone])
|
||||
tone = TONES_TONE_DIALTONE;
|
||||
if (tone == TONES_TONE_DIALTONE && !data->spl_data[tone]) {
|
||||
tone = TONES_TONE_SILENCE;
|
||||
return tone;
|
||||
}
|
||||
|
||||
/* If no CW exists, turn off tone. */
|
||||
if (tone == TONES_TONE_CW && !data->spl_data[tone]) {
|
||||
tone = TONES_TONE_OFF;
|
||||
return tone;
|
||||
}
|
||||
|
||||
/* If no interception exists, turn off tone. */
|
||||
if (tone == TONES_TONE_AUFSCHALTTON && !data->spl_data[tone]) {
|
||||
tone = TONES_TONE_OFF;
|
||||
return tone;
|
||||
}
|
||||
|
||||
/* Turn 'congestion' into 'busy'. */
|
||||
if (tone == TONES_TONE_CONGESTION && !data->spl_data[tone])
|
||||
tone = TONES_TONE_BUSY;
|
||||
|
||||
/* Turn 'noanswer' into 'busy'. */
|
||||
if (tone == TONES_TONE_NOANSWER && !data->spl_data[tone])
|
||||
tone = TONES_TONE_BUSY;
|
||||
|
||||
/* Turn 'hangup' into 'busy' and vice versa. If none of them, use 'SIT'. */
|
||||
if (tone == TONES_TONE_HANGUP && !data->spl_data[tone])
|
||||
tone = TONES_TONE_BUSY;
|
||||
if (tone == TONES_TONE_BUSY && !data->spl_data[tone])
|
||||
tone = TONES_TONE_HANGUP;
|
||||
if (tone == TONES_TONE_HANGUP && !data->spl_data[tone])
|
||||
tone = TONES_TONE_SIT;
|
||||
|
||||
/* Turn any other non-existing tone into 'SIT' */
|
||||
if (!data->spl_data[tone])
|
||||
tone = TONES_TONE_SIT;
|
||||
|
||||
/* If no 'SIT', try to use congestion, busy or hangup. */
|
||||
if (tone == TONES_TONE_SIT && !data->spl_data[tone])
|
||||
tone = TONES_TONE_CONGESTION;
|
||||
if (tone == TONES_TONE_CONGESTION && !data->spl_data[tone])
|
||||
tone = TONES_TONE_BUSY;
|
||||
if (tone == TONES_TONE_BUSY && !data->spl_data[tone])
|
||||
tone = TONES_TONE_HANGUP;
|
||||
|
||||
/* If no tone at all, turn off tone.*/
|
||||
if (!data->spl_data[tone])
|
||||
tone = TONES_TONE_SILENCE;
|
||||
|
||||
return tone;
|
||||
}
|
||||
|
||||
void tones_set_tone(tones_data_t *data, tones_t *t, enum tones_tone tone)
|
||||
{
|
||||
t->data = data;
|
||||
t->tone = substitute_tone(data, tone);
|
||||
t->spl_pos = 0;
|
||||
}
|
||||
|
||||
void tones_read_tone(tones_t *t, void *out_data, int out_duration)
|
||||
{
|
||||
void *in_data;
|
||||
int in_duration, in_repeat, in_pos, tosend;
|
||||
size_t spl_size;
|
||||
|
||||
/* No tone was set, so nothing to play. */
|
||||
if (!t->data)
|
||||
return;
|
||||
|
||||
in_data = t->data->spl_data[t->tone];
|
||||
in_duration = t->data->spl_duration[t->tone];
|
||||
in_repeat = t->data->spl_repeat[t->tone];
|
||||
spl_size = t->data->spl_size;
|
||||
in_pos = t->spl_pos;
|
||||
|
||||
/* No sample to play. */
|
||||
if (!in_data || !in_duration || !in_repeat || !spl_size)
|
||||
return;
|
||||
|
||||
/* Copy sample to output stream. */
|
||||
while(out_duration) {
|
||||
/* Wrap around if repeat count is reached. */
|
||||
if (in_pos == in_repeat)
|
||||
in_pos = 0;
|
||||
/* Skip tone until repeat count is reached. */
|
||||
if (in_pos >= in_duration) {
|
||||
/* Do not overwrite output stream. */
|
||||
tosend = in_repeat - in_pos;
|
||||
if (out_duration < tosend)
|
||||
tosend = out_duration;
|
||||
} else {
|
||||
/* Overwrite output stream. */
|
||||
tosend = in_duration - in_pos;
|
||||
if (out_duration < tosend)
|
||||
tosend = out_duration;
|
||||
memcpy(out_data, in_data + in_pos * spl_size, tosend * spl_size);
|
||||
}
|
||||
out_data += tosend * spl_size;
|
||||
out_duration -= tosend;
|
||||
in_pos += tosend;
|
||||
}
|
||||
|
||||
t->spl_pos = in_pos;
|
||||
}
|
||||
|
69
src/libtones/tones.h
Normal file
69
src/libtones/tones.h
Normal file
@@ -0,0 +1,69 @@
|
||||
|
||||
/* definition of a tone */
|
||||
enum tones_tone {
|
||||
TONES_TONE_OFF = 0, /* disable tone, output stream is not changed */
|
||||
TONES_TONE_HANGUP = 16,
|
||||
TONES_TONE_BUSY = 17,
|
||||
TONES_TONE_NOANSWER = 19,
|
||||
TONES_TONE_OUTOFORDER = 27,
|
||||
TONES_TONE_INVALIDNUMBER = 28,
|
||||
TONES_TONE_CONGESTION = 34,
|
||||
TONES_TONE_SIT = 128,
|
||||
TONES_TONE_DIALTONE = 129,
|
||||
TONES_TONE_DIALTONE_SPECIAL = 130,
|
||||
TONES_TONE_RINGBACK = 131,
|
||||
TONES_TONE_RECALL = 132, /* Off-the-air call received, waiting for mobile subscriber to answer. */
|
||||
TONES_TONE_CW = 133, /* call waiting tone */
|
||||
TONES_TONE_AUFSCHALTTON = 134, /* old German tone to indicate that operator joined the call */
|
||||
TONES_TONE_SPECIAL = 192, /* multiple special tones 192..254 */
|
||||
TONES_TONE_SILENCE = 255, /* just silent audio data */
|
||||
};
|
||||
|
||||
/* type of tone data */
|
||||
enum tones_tdata {
|
||||
TONES_TDATA_EOL = 0, /* end of list */
|
||||
TONES_TDATA_SLIN16HOST, /* tone is linear audio, host format */
|
||||
TONES_TDATA_ALAW, /* tone is a-law coded */
|
||||
TONES_TDATA_ULAW, /* tone is mu-law coded */
|
||||
TONES_TDATA_ALAWFLIPPED, /* tone is a-law coded */
|
||||
TONES_TDATA_ULAWFLIPPED, /* tone is mu-law coded */
|
||||
};
|
||||
|
||||
#define TONES_DURATION_AUTO 0
|
||||
|
||||
/* Array: tone sequence */
|
||||
typedef struct tones_seq {
|
||||
enum tones_tdata tdata;
|
||||
int duration;
|
||||
void *spl_data;
|
||||
size_t spl_data_size;
|
||||
double db;
|
||||
} tones_seq_t;
|
||||
|
||||
/* Array: tone set for one country/epoche */
|
||||
typedef struct tones_set {
|
||||
enum tones_tone tone;
|
||||
tones_seq_t *seq;
|
||||
} tones_set_t;
|
||||
|
||||
/* Rendered tones from tone set after init */
|
||||
typedef struct tones_data {
|
||||
void *spl_data[256]; /* sample data of all tones */
|
||||
int spl_duration[256]; /* duration in sample */
|
||||
int spl_repeat[256]; /* length of sample data in memory */
|
||||
size_t spl_size; /* size of one encoded sample */
|
||||
} tones_data_t;
|
||||
|
||||
/* Rendered tones from tone set after init */
|
||||
typedef struct tones {
|
||||
tones_data_t *data; /* current data set */
|
||||
enum tones_tone tone; /* current tone */
|
||||
int spl_pos; /* current read position in sample */
|
||||
} tones_t;
|
||||
|
||||
void tones_list_tonesets(void);
|
||||
int tones_init(tones_data_t *data, const char *toneset, enum tones_tdata coding);
|
||||
void tones_exit(tones_data_t *data);
|
||||
void tones_set_tone(tones_data_t *data, tones_t *t, enum tones_tone tone);
|
||||
void tones_read_tone(tones_t *t, void *spl, int spl_count);
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include "outoforder.h"
|
||||
#include <stdlib.h>
|
||||
#include "tones.h"
|
||||
#include "uk_outoforder.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
static uint16_t slin16_outoforder[] = {
|
||||
0x0000, 0x0000, 0xffff, 0x0002, 0xfffe, 0x0003, 0xfffd, 0x0001,
|
||||
0x0001, 0xfffd, 0x0004, 0xfffb, 0x0004, 0xfffe, 0x0000, 0x0002,
|
||||
0xfffc, 0x0003, 0xfffd, 0x0001, 0x0000, 0x0000, 0x0002, 0x0001,
|
||||
@@ -8187,14 +8189,8 @@ static int16_t pattern[] = {
|
||||
0xff69, 0xff9f, 0xffbe, 0xffb2, 0xffe9, 0x0003, 0x0062, 0x0111,
|
||||
};
|
||||
|
||||
extern int16_t *outoforder_spl;
|
||||
extern int outoforder_size;
|
||||
extern int outoforder_max;
|
||||
|
||||
void init_outoforder(void)
|
||||
{
|
||||
outoforder_spl = pattern;
|
||||
outoforder_size = sizeof(pattern) / sizeof(pattern[0]);
|
||||
outoforder_max = outoforder_size;
|
||||
}
|
||||
tones_seq_t seq_uk_outoforder[] = {
|
||||
{ TONES_TDATA_SLIN16HOST, TONES_DURATION_AUTO, slin16_outoforder, sizeof(slin16_outoforder), -6.0 },
|
||||
{ TONES_TDATA_EOL, 0, NULL, 0, 0.0 }
|
||||
};
|
||||
|
3
src/libtones/uk_outoforder.h
Normal file
3
src/libtones/uk_outoforder.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
extern tones_seq_t seq_uk_outoforder[];
|
||||
|
@@ -10,9 +10,9 @@ mpt1327_SOURCES = \
|
||||
main.c
|
||||
mpt1327_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../anetz/libgermanton.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
$(top_builddir)/src/libsquelch/libsquelch.a \
|
||||
|
@@ -31,8 +31,6 @@
|
||||
#include "../libmobile/main_mobile.h"
|
||||
#include "../liblogging/logging.h"
|
||||
#include <osmocom/core/timer.h>
|
||||
#include "../anetz/freiton.h"
|
||||
#include "../anetz/besetztton.h"
|
||||
#include "../liboptions/options.h"
|
||||
#include "mpt1327.h"
|
||||
#include "dsp.h"
|
||||
@@ -262,13 +260,8 @@ int main(int argc, char *argv[])
|
||||
int mandatory = 0;
|
||||
int i;
|
||||
|
||||
/* init tones */
|
||||
init_freiton();
|
||||
init_besetzton();
|
||||
// init_ansage();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789", number_lengths, NULL, mpt1327_number_valid);
|
||||
main_mobile_init("0123456789", number_lengths, NULL, mpt1327_number_valid, "oldgerman");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -16,14 +16,13 @@ nmt_SOURCES = \
|
||||
dsp.c \
|
||||
frame.c \
|
||||
image.c \
|
||||
tones.c \
|
||||
announcement.c \
|
||||
main.c
|
||||
nmt_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
libdmssms.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libcompandor/libcompandor.a \
|
||||
$(top_builddir)/src/libgoertzel/libgoertzel.a \
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_announcement(void);
|
||||
|
@@ -33,8 +33,6 @@
|
||||
#include "nmt.h"
|
||||
#include "frame.h"
|
||||
#include "dsp.h"
|
||||
#include "tones.h"
|
||||
#include "announcement.h"
|
||||
#include "countries.h"
|
||||
|
||||
#define SMS_DELIVER "/tmp/nmt_sms_deliver"
|
||||
@@ -277,12 +275,8 @@ int main(int argc, char *argv[])
|
||||
int mandatory = 0;
|
||||
int i;
|
||||
|
||||
/* init common tones */
|
||||
init_nmt_tones();
|
||||
init_announcement();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789", number_lengths, NULL, NULL);
|
||||
main_mobile_init("0123456789", number_lengths, NULL, NULL, "denmark");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -1,44 +0,0 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "tones.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
0, 5320, 10063, 13716, 15883, 16328, 15004, 12054, 7798, 2697, -2697, -7798, -12054, -15004, -16328, -15883, -13716, -10063, -5320,
|
||||
//0, 2660, 5032, 6858, 7941, 8164, 7502, 6027, 3899, 1348, -1348, -3899, -6027, -7502, -8164, -7941, -6858, -5032, -2660,
|
||||
};
|
||||
|
||||
static int16_t tone[7999];
|
||||
|
||||
extern int16_t *ringback_spl;
|
||||
extern int ringback_size;
|
||||
extern int ringback_max;
|
||||
extern int16_t *busy_spl;
|
||||
extern int busy_size;
|
||||
extern int busy_max;
|
||||
extern int16_t *congestion_spl;
|
||||
extern int congestion_size;
|
||||
extern int congestion_max;
|
||||
|
||||
void init_nmt_tones(void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0, j = 0; i < 7999; i++) {
|
||||
tone[i] = pattern[j++];
|
||||
if (j == 19)
|
||||
j = 0;
|
||||
}
|
||||
|
||||
ringback_spl = tone;
|
||||
ringback_size = 7999;
|
||||
ringback_max = 8 * 5000; /* 1000 / 4000 */
|
||||
|
||||
busy_spl = tone;
|
||||
busy_size = 1995;
|
||||
busy_max = 8 * 500; /* 250 / 250 */
|
||||
|
||||
congestion_spl = tone;
|
||||
congestion_size = 1995;
|
||||
congestion_max = 8 * 500; /* 250 / 250 */
|
||||
}
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_nmt_tones(void);
|
||||
|
@@ -11,9 +11,9 @@ pocsag_SOURCES = \
|
||||
main.c
|
||||
pocsag_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
../anetz/libgermanton.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
$(top_builddir)/src/libsamplerate/libsamplerate.a \
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include "../libmobile/main_mobile.h"
|
||||
#include "../liboptions/options.h"
|
||||
#include "../libfm/fm.h"
|
||||
#include "../anetz/besetztton.h"
|
||||
#include "pocsag.h"
|
||||
#include "dsp.h"
|
||||
|
||||
@@ -274,11 +273,8 @@ int main(int argc, char *argv[])
|
||||
/* pocsag does not use emphasis, so disable it */
|
||||
uses_emphasis = 0;
|
||||
|
||||
/* init common tones */
|
||||
init_besetzton();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789ABCD", number_lengths, NULL, pocsag_number_valid);
|
||||
main_mobile_init("0123456789ABCD", number_lengths, NULL, pocsag_number_valid, "german");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -7,14 +7,13 @@ radiocom2000_SOURCES = \
|
||||
r2000.c \
|
||||
dsp.c \
|
||||
frame.c \
|
||||
tones.c \
|
||||
outoforder.c \
|
||||
image.c \
|
||||
main.c
|
||||
radiocom2000_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libcompandor/libcompandor.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
|
@@ -33,8 +33,6 @@
|
||||
#include "r2000.h"
|
||||
#include "dsp.h"
|
||||
#include "frame.h"
|
||||
#include "tones.h"
|
||||
#include "outoforder.h"
|
||||
|
||||
/* settings */
|
||||
static int band = 1;
|
||||
@@ -260,12 +258,8 @@ int main(int argc, char *argv[])
|
||||
int mandatory = 0;
|
||||
int i;
|
||||
|
||||
/* init tones */
|
||||
init_radiocom_tones();
|
||||
init_outoforder();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789", number_lengths, NULL, r2000_number_valid);
|
||||
main_mobile_init("0123456789", number_lengths, NULL, r2000_number_valid, "france");
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_outoforder(void);
|
||||
|
@@ -1,69 +0,0 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "tones.h"
|
||||
|
||||
static int16_t pattern[] = {
|
||||
0x0000, 0x1483,
|
||||
0x269d, 0x3420, 0x3b7d, 0x3bd3, 0x3510, 0x280f, 0x164c, 0x01e5,
|
||||
0xed4c, 0xdadd, 0xcce2, 0xc4e1, 0xc3ee, 0xca06, 0xd68e, 0xe7f0,
|
||||
0xfc34, 0x10e4, 0x239a, 0x3217, 0x3aab, 0x3c48, 0x36d1, 0x2ace,
|
||||
0x19ce, 0x05b0, 0xf0f2, 0xddf4, 0xcf02, 0xc5d6, 0xc390, 0xc86a,
|
||||
0xd3da, 0xe481, 0xf869, 0x0d36, 0x2074, 0x2fdb, 0x3999, 0x3c89,
|
||||
0x384f, 0x2d6e, 0x1d2d, 0x097a, 0xf4a7, 0xe12c, 0xd154, 0xc706,
|
||||
0xc36e, 0xc707, 0xd154, 0xe12c, 0xf4a7, 0x0979, 0x1d2e, 0x2d6d,
|
||||
0x3850, 0x3c88, 0x399a, 0x2fdb, 0x2072, 0x0d39, 0xf865, 0xe486,
|
||||
0xd3d4, 0xc871, 0xc389, 0xc5dd, 0xcefb, 0xddfa, 0xf0ee, 0x05b3,
|
||||
0x19cc, 0x2acf, 0x36d0, 0x3c4a, 0x3aaa, 0x3216, 0x239b, 0x10e3,
|
||||
0xfc35, 0xe7f1, 0xd68c, 0xca08, 0xc3ec, 0xc4e3, 0xccdf, 0xdae1,
|
||||
0xed49, 0x01e7, 0x164b, 0x280e, 0x3511, 0x3bd4, 0x3b7b, 0x3422,
|
||||
0x269c, 0x1481, 0x0003, 0xeb7b, 0xd964, 0xcbe2, 0xc47e, 0xc433,
|
||||
0xcaea, 0xd7f6, 0xe9b2, 0xfe1a, 0x12b8, 0x251d, 0x3324, 0x3b1a,
|
||||
0x3c16, 0x35f7, 0x2975, 0x180d, 0x03cf, 0xef18, 0xdc69, 0xcde7,
|
||||
0xc559, 0xc3b3, 0xc935, 0xd52b, 0xe637, 0xfa4e, 0x0f0f, 0x220b,
|
||||
0x30ff, 0x3a28, 0x3c73, 0x3793, 0x2c28, 0x1b7d, 0x0799, 0xf2c8,
|
||||
0xdf8e, 0xd023, 0xc66a, 0xc375, 0xc7b2, 0xd291, 0xe2d2, 0xf689,
|
||||
0x0b57, 0x1ed7, 0x2ea8, 0x38fc, 0x3c90, 0x38fd, 0x2ea8, 0x1ed7,
|
||||
0x0b56, 0xf68a, 0xe2d1, 0xd293, 0xc7af, 0xc379, 0xc665, 0xd028,
|
||||
0xdf8a, 0xf2cc, 0x0795, 0x1b80, 0x2c26, 0x3795, 0x3c71, 0x3a2a,
|
||||
0x30fd, 0x220d, 0x0f0e, 0xfa4e, 0xe636, 0xd52d, 0xc934, 0xc3b3,
|
||||
0xc559, 0xcde7, 0xdc69, 0xef18, 0x03d0, 0x180a, 0x297a, 0x35f2,
|
||||
0x3c1a, 0x3b17, 0x3326, 0x251c, 0x12b9, 0xfe17, 0xe9b6, 0xd7f2,
|
||||
0xcaef, 0xc42d, 0xc483, 0xcbde, 0xd967, 0xeb7b,
|
||||
};
|
||||
|
||||
static int16_t tone[12000];
|
||||
|
||||
extern int16_t *ringback_spl;
|
||||
extern int ringback_size;
|
||||
extern int ringback_max;
|
||||
extern int16_t *busy_spl;
|
||||
extern int busy_size;
|
||||
extern int busy_max;
|
||||
extern int16_t *congestion_spl;
|
||||
extern int congestion_size;
|
||||
extern int congestion_max;
|
||||
|
||||
void init_radiocom_tones(void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
|
||||
for (i = 0, j = 0; i < 12000; i++) {
|
||||
tone[i] = pattern[j++];
|
||||
if (j == 200)
|
||||
j = 0;
|
||||
}
|
||||
|
||||
ringback_spl = tone;
|
||||
ringback_size = 12000;
|
||||
ringback_max = 8 * 5000; /* 1500 / 3500 */
|
||||
|
||||
busy_spl = tone;
|
||||
busy_size = 4000;
|
||||
busy_max = 8 * 1000; /* 500 / 500 */
|
||||
|
||||
congestion_spl = tone;
|
||||
congestion_size = 4000;
|
||||
congestion_max = 8 * 1000; /* 500 / 500 */
|
||||
}
|
||||
|
@@ -1,3 +0,0 @@
|
||||
|
||||
void init_radiocom_tones(void);
|
||||
|
@@ -64,6 +64,7 @@ test_dms_SOURCES = test_dms.c dummy.c
|
||||
test_dms_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/nmt/libdmssms.a \
|
||||
@@ -100,6 +101,7 @@ test_sms_SOURCES = dummy.c test_sms.c
|
||||
test_sms_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/nmt/libdmssms.a \
|
||||
|
@@ -12,6 +12,7 @@ zeitansage_LDADD = \
|
||||
$(COMMON_LA) \
|
||||
$(top_builddir)/src/liboptions/liboptions.a \
|
||||
$(top_builddir)/src/libmobile/libmobile.a \
|
||||
$(top_builddir)/src/libtones/libtones.a \
|
||||
$(top_builddir)/src/libdisplay/libdisplay.a \
|
||||
$(top_builddir)/src/libjitter/libjitter.a \
|
||||
$(top_builddir)/src/libsamplerate/libsamplerate.a \
|
||||
|
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
|
||||
init_samples();
|
||||
|
||||
/* init mobile interface */
|
||||
main_mobile_init("0123456789", number_lengths, NULL, NULL);
|
||||
main_mobile_init("0123456789", number_lengths, NULL, NULL, NULL);
|
||||
|
||||
/* handle options / config file */
|
||||
add_options();
|
||||
|
Reference in New Issue
Block a user