aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile.am2
-rw-r--r--src/amps/Makefile.am1
-rw-r--r--src/amps/amps.c2
-rw-r--r--src/amps/amps_tacs_main.c1
-rw-r--r--src/amps/transaction.c2
-rw-r--r--src/anetz/Makefile.am1
-rw-r--r--src/anetz/anetz.c2
-rw-r--r--src/anetz/main.c1
-rw-r--r--src/bnetz/Makefile.am1
-rw-r--r--src/bnetz/bnetz.c2
-rw-r--r--src/bnetz/main.c1
-rw-r--r--src/cnetz/Makefile.am1
-rw-r--r--src/cnetz/cnetz.c2
-rw-r--r--src/cnetz/main.c1
-rw-r--r--src/cnetz/transaction.c2
-rw-r--r--src/common/Makefile.am5
-rw-r--r--src/common/call.c4
-rw-r--r--src/common/debug.c2
-rw-r--r--src/common/main_mobile.c6
-rw-r--r--src/jtacs/Makefile.am1
-rw-r--r--src/libmncc/Makefile.am10
-rw-r--r--src/libmncc/cause.c (renamed from src/common/cause.c)0
-rw-r--r--src/libmncc/cause.h (renamed from src/common/cause.h)0
-rw-r--r--src/libmncc/mncc.h (renamed from src/common/mncc.h)0
-rw-r--r--src/libmncc/mncc_console.c (renamed from src/common/mncc_console.c)27
-rw-r--r--src/libmncc/mncc_console.h (renamed from src/common/mncc_console.h)0
-rw-r--r--src/libmncc/mncc_cross.c (renamed from src/common/mncc_cross.c)6
-rw-r--r--src/libmncc/mncc_cross.h (renamed from src/common/mncc_cross.h)0
-rw-r--r--src/libmncc/mncc_sock.c (renamed from src/common/mncc_sock.c)6
-rw-r--r--src/libmncc/mncc_sock.h (renamed from src/common/mncc_sock.h)0
-rw-r--r--src/libmncc/testton.c (renamed from src/common/testton.c)0
-rw-r--r--src/libmncc/testton.h (renamed from src/common/testton.h)0
-rw-r--r--src/nmt/Makefile.am1
-rw-r--r--src/nmt/main.c1
-rw-r--r--src/nmt/nmt.c2
-rw-r--r--src/r2000/Makefile.am1
-rw-r--r--src/r2000/main.c1
-rw-r--r--src/r2000/r2000.c2
-rw-r--r--src/tacs/Makefile.am1
-rw-r--r--src/test/Makefile.am4
42 files changed, 66 insertions, 38 deletions
diff --git a/.gitignore b/.gitignore
index b570c2d..d3bb270 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,7 @@ src/libfm/libfm.a
src/libfilter/libfilter.a
src/libwave/libwave.a
src/libfft/libfft.a
+src/libmncc/libmncc.a
src/common/libcommon.a
src/common/libmobile.a
src/common/libimage.a
diff --git a/configure.ac b/configure.ac
index 1b9a604..f99dd03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,6 +90,7 @@ AC_OUTPUT(
src/libfilter/Makefile
src/libwave/Makefile
src/libfft/Makefile
+ src/libmncc/Makefile
src/common/Makefile
src/anetz/Makefile
src/bnetz/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index f14df22..cb2f18b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,3 @@
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = libcompandor libgoertzel libjitter libsquelch libhagelbarger libdtmf libtimer libsamplerate libscrambler libemphasis libfsk libfm libfilter libwave libfft common anetz bnetz cnetz nmt amps tacs jtacs r2000 tv test
+SUBDIRS = libcompandor libgoertzel libjitter libsquelch libhagelbarger libdtmf libtimer libsamplerate libscrambler libemphasis libfsk libfm libfilter libwave libfft libmncc common anetz bnetz cnetz nmt amps tacs jtacs r2000 tv test
diff --git a/src/amps/Makefile.am b/src/amps/Makefile.am
index a3b40b7..ed9e455 100644
--- a/src/amps/Makefile.am
+++ b/src/amps/Makefile.am
@@ -38,6 +38,7 @@ amps_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
diff --git a/src/amps/amps.c b/src/amps/amps.c
index 358163f..a103b02 100644
--- a/src/amps/amps.c
+++ b/src/amps/amps.c
@@ -45,7 +45,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
-#include "../common/cause.h"
+#include "../libmncc/cause.h"
#include "amps.h"
#include "dsp.h"
#include "frame.h"
diff --git a/src/amps/amps_tacs_main.c b/src/amps/amps_tacs_main.c
index 2104d25..4d3a77d 100644
--- a/src/amps/amps_tacs_main.c
+++ b/src/amps/amps_tacs_main.c
@@ -26,7 +26,6 @@
#include "../common/main_mobile.h"
#include "../common/debug.h"
#include "../common/call.h"
-#include "../common/mncc_sock.h"
#include "amps.h"
#include "dsp.h"
#include "frame.h"
diff --git a/src/amps/transaction.c b/src/amps/transaction.c
index 5491d88..d3d0781 100644
--- a/src/amps/transaction.c
+++ b/src/amps/transaction.c
@@ -23,7 +23,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
-#include "../common/cause.h"
+#include "../libmncc/cause.h"
#include "amps.h"
//#include "database.h"
diff --git a/src/anetz/Makefile.am b/src/anetz/Makefile.am
index 29b7f36..e4f1dcd 100644
--- a/src/anetz/Makefile.am
+++ b/src/anetz/Makefile.am
@@ -30,6 +30,7 @@ anetz_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
diff --git a/src/anetz/anetz.c b/src/anetz/anetz.c
index cf77ba6..109c053 100644
--- a/src/anetz/anetz.c
+++ b/src/anetz/anetz.c
@@ -28,7 +28,7 @@
#include "../common/debug.h"
#include "../libtimer/timer.h"
#include "../common/call.h"
-#include "../common/cause.h"
+#include "../libmncc/cause.h"
#include "anetz.h"
#include "dsp.h"
diff --git a/src/anetz/main.c b/src/anetz/main.c
index 9e235a7..d698245 100644
--- a/src/anetz/main.c
+++ b/src/anetz/main.c
@@ -28,7 +28,6 @@
#include "../common/debug.h"
#include "../libtimer/timer.h"
#include "../common/call.h"
-#include "../common/mncc_sock.h"
#include "freiton.h"
#include "besetztton.h"
#include "anetz.h"
diff --git a/src/bnetz/Makefile.am b/src/bnetz/Makefile.am
index 663517b..5c89f08 100644
--- a/src/bnetz/Makefile.am
+++ b/src/bnetz/Makefile.am
@@ -26,6 +26,7 @@ bnetz_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
diff --git a/src/bnetz/bnetz.c b/src/bnetz/bnetz.c
index 284b484..1d3d608 100644
--- a/src/bnetz/bnetz.c
+++ b/src/bnetz/bnetz.c
@@ -27,7 +27,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
-#include "../common/cause.h"
+#include "../libmncc/cause.h"
#include "bnetz.h"
#include "telegramm.h"
#include "dsp.h"
diff --git a/src/bnetz/main.c b/src/bnetz/main.c
index 64ae93f..9b48f98 100644
--- a/src/bnetz/main.c
+++ b/src/bnetz/main.c
@@ -26,7 +26,6 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
-#include "../common/mncc_sock.h"
#include "../common/main_mobile.h"
#include "../anetz/freiton.h"
#include "../anetz/besetztton.h"
diff --git a/src/cnetz/Makefile.am b/src/cnetz/Makefile.am
index 5d2cf2f..53ef378 100644
--- a/src/cnetz/Makefile.am
+++ b/src/cnetz/Makefile.am
@@ -29,6 +29,7 @@ cnetz_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
diff --git a/src/cnetz/cnetz.c b/src/cnetz/cnetz.c
index c21c2d1..d708827 100644
--- a/src/cnetz/cnetz.c
+++ b/src/cnetz/cnetz.c
@@ -145,7 +145,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
-#include "../common/cause.h"
+#include "../libmncc/cause.h"
#include "cnetz.h"
#include "database.h"
#include "sysinfo.h"
diff --git a/src/cnetz/main.c b/src/cnetz/main.c
index e54490d..0a458de 100644
--- a/src/cnetz/main.c
+++ b/src/cnetz/main.c
@@ -26,7 +26,6 @@
#include "../common/main_mobile.h"
#include "../common/debug.h"
#include "../common/call.h"
-#include "../common/mncc_sock.h"
#include "../anetz/freiton.h"
#include "../anetz/besetztton.h"
#include "cnetz.h"
diff --git a/src/cnetz/transaction.c b/src/cnetz/transaction.c
index cc9aba4..1c30c54 100644
--- a/src/cnetz/transaction.c
+++ b/src/cnetz/transaction.c
@@ -23,7 +23,7 @@
#include "../common/sample.h"
#include "../common/debug.h"
#include "../common/call.h"
-#include "../common/cause.h"
+#include "../libmncc/cause.h"
#include "cnetz.h"
#include "telegramm.h"
#include "database.h"
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 3af2a7d..8607cb2 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -11,12 +11,7 @@ libcommon_a_SOURCES = \
libmobile_a_SOURCES = \
sender.c \
- cause.c \
call.c \
- testton.c \
- mncc_console.c \
- mncc_cross.c \
- mncc_sock.c \
display_status.c \
main_mobile.c
diff --git a/src/common/call.c b/src/common/call.c
index e493607..87a6683 100644
--- a/src/common/call.c
+++ b/src/common/call.c
@@ -27,10 +27,10 @@
#include "sample.h"
#include "debug.h"
#include "sender.h"
-#include "cause.h"
#include "call.h"
#include "../libtimer/timer.h"
-#include "mncc.h"
+#include "../libmncc/mncc.h"
+#include "../libmncc/cause.h"
#define DISC_TIMEOUT 30
diff --git a/src/common/debug.c b/src/common/debug.c
index 2bf48d1..f03a6d3 100644
--- a/src/common/debug.c
+++ b/src/common/debug.c
@@ -27,7 +27,7 @@
#include "sample.h"
#include "debug.h"
#include "display.h"
-#include "mncc_console.h"
+#include "../libmncc/mncc_console.h"
const char *debug_level[] = {
"debug ",
diff --git a/src/common/main_mobile.c b/src/common/main_mobile.c
index 6607f63..7516bba 100644
--- a/src/common/main_mobile.c
+++ b/src/common/main_mobile.c
@@ -35,9 +35,9 @@
#include "sender.h"
#include "../libtimer/timer.h"
#include "call.h"
-#include "mncc_console.h"
-#include "mncc_sock.h"
-#include "mncc_cross.h"
+#include "../libmncc/mncc_console.h"
+#include "../libmncc/mncc_sock.h"
+#include "../libmncc/mncc_cross.h"
#ifdef HAVE_SDR
#include "sdr.h"
#include "sdr_config.h"
diff --git a/src/jtacs/Makefile.am b/src/jtacs/Makefile.am
index 1128133..d440d8b 100644
--- a/src/jtacs/Makefile.am
+++ b/src/jtacs/Makefile.am
@@ -24,6 +24,7 @@ jtacs_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
diff --git a/src/libmncc/Makefile.am b/src/libmncc/Makefile.am
new file mode 100644
index 0000000..7881872
--- /dev/null
+++ b/src/libmncc/Makefile.am
@@ -0,0 +1,10 @@
+AM_CPPFLAGS = -Wall -Wextra -g $(all_includes)
+
+noinst_LIBRARIES = libmncc.a
+
+libmncc_a_SOURCES = \
+ mncc_console.c \
+ mncc_cross.c \
+ mncc_sock.c \
+ testton.c \
+ cause.c
diff --git a/src/common/cause.c b/src/libmncc/cause.c
index 3dc6b1c..3dc6b1c 100644
--- a/src/common/cause.c
+++ b/src/libmncc/cause.c
diff --git a/src/common/cause.h b/src/libmncc/cause.h
index d7781a1..d7781a1 100644
--- a/src/common/cause.h
+++ b/src/libmncc/cause.h
diff --git a/src/common/mncc.h b/src/libmncc/mncc.h
index 32d906f..32d906f 100644
--- a/src/common/mncc.h
+++ b/src/libmncc/mncc.h
diff --git a/src/common/mncc_console.c b/src/libmncc/mncc_console.c
index 77d820c..41682aa 100644
--- a/src/common/mncc_console.c
+++ b/src/libmncc/mncc_console.c
@@ -24,16 +24,16 @@
#include <stdlib.h>
#include <errno.h>
#include <sys/time.h>
-#include "sample.h"
+#include "../common/sample.h"
#include "../libsamplerate/samplerate.h"
#include "../libjitter/jitter.h"
-#include "debug.h"
+#include "../common/debug.h"
#include "testton.h"
#include "mncc.h"
-#include "call.h"
-#include "cause.h"
#include "mncc_console.h"
-#include "sound.h"
+#include "cause.h"
+#include "../common/call.h"
+#include "../common/sound.h"
static int new_callref = 0; /* toward mobile */
@@ -162,8 +162,23 @@ static int console_mncc_up(uint8_t *buf, int length)
case MNCC_SETUP_IND:
PDEBUG(DMNCC, DEBUG_INFO, "Incoming call from '%s'\n", mncc->calling.number);
/* setup is also allowed on disconnected call */
- if (console.state == CONSOLE_DISCONNECT)
+ if (console.state == CONSOLE_DISCONNECT) {
+ PDEBUG(DMNCC, DEBUG_INFO, "Releasing pending disconnected call\n");
+ if (console.callref) {
+ uint8_t buf[sizeof(struct gsm_mncc)];
+ struct gsm_mncc *mncc = (struct gsm_mncc *)buf;
+
+ memset(buf, 0, sizeof(buf));
+ mncc->msg_type = MNCC_REL_REQ;
+ mncc->callref = console.callref;
+ mncc->fields |= MNCC_F_CAUSE;
+ mncc->cause.location = LOCATION_USER;
+ mncc->cause.value = CAUSE_NORMAL;
+ mncc_down(buf, sizeof(struct gsm_mncc));
+ console.callref = 0;
+ }
console_new_state(CONSOLE_IDLE);
+ }
if (console.state != CONSOLE_IDLE) {
PDEBUG(DMNCC, DEBUG_NOTICE, "We are busy, rejecting.\n");
return -CAUSE_BUSY;
diff --git a/src/common/mncc_console.h b/src/libmncc/mncc_console.h
index f61c8a4..f61c8a4 100644
--- a/src/common/mncc_console.h
+++ b/src/libmncc/mncc_console.h
diff --git a/src/common/mncc_cross.c b/src/libmncc/mncc_cross.c
index 5ca51ac..ea2c04f 100644
--- a/src/common/mncc_cross.c
+++ b/src/libmncc/mncc_cross.c
@@ -22,9 +22,9 @@
#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include "sample.h"
-#include "debug.h"
-#include "call.h"
+#include "../common/sample.h"
+#include "../common/debug.h"
+#include "../common/call.h"
#include "cause.h"
#include "mncc.h"
#include "mncc_cross.h"
diff --git a/src/common/mncc_cross.h b/src/libmncc/mncc_cross.h
index 10f2b0d..10f2b0d 100644
--- a/src/common/mncc_cross.h
+++ b/src/libmncc/mncc_cross.h
diff --git a/src/common/mncc_sock.c b/src/libmncc/mncc_sock.c
index 4e97c52..33c2732 100644
--- a/src/common/mncc_sock.c
+++ b/src/libmncc/mncc_sock.c
@@ -26,9 +26,9 @@
#include <sys/un.h>
#include <stddef.h>
#include <unistd.h>
-#include "sample.h"
-#include "debug.h"
-#include "call.h"
+#include "../common/sample.h"
+#include "../common/debug.h"
+#include "../common/call.h"
#include "cause.h"
#include "mncc_sock.h"
diff --git a/src/common/mncc_sock.h b/src/libmncc/mncc_sock.h
index 7406dbe..7406dbe 100644
--- a/src/common/mncc_sock.h
+++ b/src/libmncc/mncc_sock.h
diff --git a/src/common/testton.c b/src/libmncc/testton.c
index 87f866f..87f866f 100644
--- a/src/common/testton.c
+++ b/src/libmncc/testton.c
diff --git a/src/common/testton.h b/src/libmncc/testton.h
index 344cee9..344cee9 100644
--- a/src/common/testton.h
+++ b/src/libmncc/testton.h
diff --git a/src/nmt/Makefile.am b/src/nmt/Makefile.am
index 6429c77..80d0026 100644
--- a/src/nmt/Makefile.am
+++ b/src/nmt/Makefile.am
@@ -37,6 +37,7 @@ nmt_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
diff --git a/src/nmt/main.c b/src/nmt/main.c
index a28e10a..684daa8 100644
--- a/src/nmt/main.c
+++ b/src/nmt/main.c
@@ -29,7 +29,6 @@
#include "../common/sample.h"
#include "../common/main_mobile.h"
#include "../common/debug.h"
-#include "../common/mncc_sock.h"
#include "nmt.h"
#include "frame.h"
#include "dsp.h"
diff --git a/src/nmt/nmt.c b/src/nmt/nmt.c
index 0287292..65d9f92 100644
--- a/src/nmt/nmt.c
+++ b/src/nmt/nmt.c
@@ -27,7 +27,7 @@
#include <time.h>
#include "../common/sample.h"
#include "../common/debug.h"
-#include "../common/cause.h"
+#include "../libmncc/cause.h"
#include "nmt.h"
#include "transaction.h"
#include "dsp.h"
diff --git a/src/r2000/Makefile.am b/src/r2000/Makefile.am
index 7a8b61b..3a3b059 100644
--- a/src/r2000/Makefile.am
+++ b/src/r2000/Makefile.am
@@ -25,6 +25,7 @@ radiocom2000_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
diff --git a/src/r2000/main.c b/src/r2000/main.c
index bcac829..066916c 100644
--- a/src/r2000/main.c
+++ b/src/r2000/main.c
@@ -29,7 +29,6 @@
#include "../common/sample.h"
#include "../common/main_mobile.h"
#include "../common/debug.h"
-#include "../common/mncc_sock.h"
#include "r2000.h"
#include "dsp.h"
#include "frame.h"
diff --git a/src/r2000/r2000.c b/src/r2000/r2000.c
index bf1bee4..0784f8b 100644
--- a/src/r2000/r2000.c
+++ b/src/r2000/r2000.c
@@ -27,7 +27,7 @@
#include <time.h>
#include "../common/sample.h"
#include "../common/debug.h"
-#include "../common/cause.h"
+#include "../libmncc/cause.h"
#include "r2000.h"
//#include "transaction.h"
#include "frame.h"
diff --git a/src/tacs/Makefile.am b/src/tacs/Makefile.am
index 2bca149..a79bf8e 100644
--- a/src/tacs/Makefile.am
+++ b/src/tacs/Makefile.am
@@ -25,6 +25,7 @@ tacs_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
diff --git a/src/test/Makefile.am b/src/test/Makefile.am
index 6e86ce7..d0507fa 100644
--- a/src/test/Makefile.am
+++ b/src/test/Makefile.am
@@ -23,6 +23,7 @@ test_filter_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
@@ -54,6 +55,7 @@ test_emphasis_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
@@ -74,6 +76,7 @@ test_dms_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
@@ -94,6 +97,7 @@ test_sms_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libmncc/libmncc.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \