diff --git a/Makefile b/Makefile index db62557..2ade19b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,11 @@ ASTSRC?=../asterisk +OPENBSCSRC?=../openbsc + + +OPENBSC_SRC = bsc_init.c vty_interface.c vty_interface_layer3.c +OPENBSC_LIBS = libmsc.a libbsc.a libmsc.a libvty.a +OPENBSC_INCLUDES = -I$(OPENBSCSRC)/include +OPENBSC_LDFLAGS = -ldl -ldbi -lcrypt ASTTOPDIR=$(ASTSRC) @@ -45,4 +52,8 @@ all: _all include $(ASTTOPDIR)/Makefile.moddir_rules +# Add OpenBSC stuff in the mix +chan_openbsc.o:: _ASTCFLAGS+=$(OPENBSC_INCLUDES) +chan_openbsc.so: $(addprefix $(OPENBSCSRC)/src/,$(patsubst %.c,%.o,$(OPENBSC_SRC))) $(addprefix $(OPENBSCSRC)/src/,$(OPENBSC_LIBS)) +chan_openbsc.so:: _ASTLDFLAGS+=$(OPENBSC_LDFLAGS) diff --git a/chan_openbsc.c b/chan_openbsc.c index 343d0a0..0b59a2a 100644 --- a/chan_openbsc.c +++ b/chan_openbsc.c @@ -17,6 +17,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: $") #include #include +#include + #include "asterisk/channel.h" #include "asterisk/logger.h" #include "asterisk/module.h" @@ -27,6 +29,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: $") /* ---------------------------------------------------------------------{{{ */ +struct gsm_network *bsc_gsmnet = 0; + + /* Main thread */ static int g_done; static pthread_t g_main_tid;