diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..598b606
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,192 @@
+#
+# Copyright 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+David A. Burgess, dburgess@kestrelsp.com:
+ CLI/CLI.cpp
+ CLI/CLI.h
+ CommonLibs/Assert.h
+ CommonLibs/BitVector.cpp
+ CommonLibs/BitVectorTest.cpp
+ CommonLibs/Configuration.cpp
+ CommonLibs/Configuration.h
+ CommonLibs/ConfigurationTest.cpp
+ CommonLibs/Interthread.h
+ CommonLibs/InterthreadTest.cpp
+ CommonLibs/LinkedLists.cpp
+ CommonLibs/LinkedLists.h
+ CommonLibs/Regexp.h
+ CommonLibs/RegexpTest.cpp
+ CommonLibs/Sockets.cpp
+ CommonLibs/Sockets.h
+ CommonLibs/SocketsTest.cpp
+ CommonLibs/Threads.cpp
+ CommonLibs/Threads.h
+ CommonLibs/Timeval.cpp
+ CommonLibs/Timeval.h
+ CommonLibs/TimevalTest.cpp
+ CommonLibs/Vector.h
+ CommonLibs/VectorTest.cpp
+ Control/CallControl.cpp
+ Control/ControlCommon.cpp
+ Control/ControlCommon.h
+ Control/FACCHDispatch.cpp
+ Control/MobilityManagement.cpp
+ Control/PagerTest.cpp
+ Control/RadioResource.cpp
+ Control/SDCCHDispatch.cpp
+ GSM/GSM610Tables.cpp
+ GSM/GSM610Tables.h
+ GSM/GSMCommon.cpp
+ GSM/GSMCommon.h
+ GSM/GSMConfig.h
+ GSM/GSML1FEC.cpp
+ GSM/GSML1FEC.h
+ GSM/GSML2LAPDm.cpp
+ GSM/GSML2LAPDm.h
+ GSM/GSML3CCElements.cpp
+ GSM/GSML3CCElements.h
+ GSM/GSML3CCMessages.cpp
+ GSM/GSML3CCMessages.h
+ GSM/GSML3CommonElements.cpp
+ GSM/GSML3CommonElements.h
+ GSM/GSML3MMElements.cpp
+ GSM/GSML3MMElements.h
+ GSM/GSML3MMMessages.cpp
+ GSM/GSML3MMMessages.h
+ GSM/GSML3Message.cpp
+ GSM/GSML3Message.h
+ GSM/GSML3RRElements.cpp
+ GSM/GSML3RRElements.h
+ GSM/GSML3RRMessages.cpp
+ GSM/GSML3RRMessages.h
+ GSM/GSMLogicalChannel.h
+ GSM/GSMTDMA.cpp
+ GSM/GSMTDMA.h
+ GSM/GSMTransfer.cpp
+ GSM/GSMTransfer.h
+ LICENSEBLOCK
+ SIP/SIPEngine.h
+ SIP/SIPInterface.h
+ SMS/SMSMessages.cpp
+ SMS/SMSMessages.h
+ SMS/SMSTransfer.cpp
+ SMS/SMSTransfer.h
+ TRXManager/TRXManager.cpp
+ Transceiver/Complex.h
+ apps/OpenBTS900.cpp
+ apps/OpenBTS850.cpp
+ apps/OpenBTS25c3.cpp
+ tests/AGCHTest.cpp
+ tests/BeaconTest.cpp
+ tests/CallTest.cpp
+ tests/CallTest2.cpp
+ tests/LAPDmTest.cpp
+ tests/LoopbackTest.cpp
+ tests/RegistrationTest.cpp
+ tests/TRXSimulator.cpp
+
+Harvind S. Samra, hssamra@kestrelsp.com:
+ Control/PagerTest.cpp
+ Control/RadioResource.cpp
+ GSM/GSMConfig.h
+ GSM/GSMTransfer.h
+ LICENSEBLOCK
+ Transceiver/ComplexTest.cpp
+ Transceiver/Transceiver.cpp
+ Transceiver/Transceiver.h
+ Transceiver/USRPDevice.cpp
+ Transceiver/USRPDevice.h
+ Transceiver/USRPping.cpp
+ Transceiver/radioInterface.cpp
+ Transceiver/radioInterface.h
+ Transceiver/rcvLPF_651.h
+ Transceiver/runTransceiver.cpp
+ Transceiver/sendLPF_961.h
+ Transceiver/sigProcLib.cpp
+ Transceiver/sigProcLib.h
+ Transceiver/sigProcLibTest.cpp
+ Transceiver/sweepGenerator.cpp
+ Transceiver/testRadio.cpp
+
+Raffi Sevlian, raffisev@gmail.com:
+ Control/CallControl.cpp
+ Control/ControlCommon.cpp
+ Control/ControlCommon.h
+ Control/FACCHDispatch.cpp
+ Control/MobilityManagement.cpp
+ Control/PagerTest.cpp
+ Control/RadioResource.cpp
+ GSM/GSMCommon.h
+ GSM/GSMConfig.h
+ GSM/GSML1FEC.h
+ GSM/GSML3CCElements.cpp
+ GSM/GSML3CCElements.h
+ GSM/GSML3CCMessages.cpp
+ GSM/GSML3CCMessages.h
+ GSM/GSML3CommonElements.cpp
+ GSM/GSML3CommonElements.h
+ GSM/GSML3MMElements.cpp
+ GSM/GSML3MMElements.h
+ GSM/GSML3MMMessages.cpp
+ GSM/GSML3MMMessages.h
+ GSM/GSML3Message.cpp
+ GSM/GSML3Message.h
+ GSM/GSML3RRElements.cpp
+ GSM/GSML3RRElements.h
+ GSM/GSML3RRMessages.cpp
+ GSM/GSML3RRMessages.h
+ GSM/GSMLogicalChannel.h
+ GSM/GSMSAPMux.cpp
+ GSM/GSMSAPMux.h
+ GSM/GSMTransfer.h
+ LICENSEBLOCK
+ SIP/SIPEngine.cpp
+ SIP/SIPInterface.cpp
+ SIP/SIPInterface.h
+ SIP/SIPMessage.cpp
+ SIP/SIPMessage.h
+ SIP/SIPUtility.cpp
+ SIP/SIPUtility.h
+ SMS/CMMessage.cpp
+ SMS/CMMessage.h
+ SMS/CMProcessor.cpp
+ SMS/CMProcessor.h
+ SMS/CMTest.cpp
+ SMS/RLMessage.cpp
+ SMS/RLMessage.h
+ SMS/RLProcessor.cpp
+ SMS/RLProcessor.h
+ SMS/SMSMessages.cpp
+ SMS/SMSMessages.h
+ SMS/SMSProcessors.cpp
+ SMS/SMSProcessors.h
+ SMS/SMSTransfer.cpp
+ SMS/SMSTransfer.h
+ SMS/TLMessage.cpp
+ SMS/TLMessage.h
+ SMS/TLProcessor.cpp
+ SMS/TLProcessor.h
+ TRXManager/TRXManager.h
+
+Alon Levy, alonlevy1@gmail.com
+ RRLPMessages.cpp
+ RRLPMessages.h
+ RRLPTest.cpp
+
diff --git a/AsteriskConfig/Makefile.am b/AsteriskConfig/Makefile.am
new file mode 100644
index 0000000..09ee477
--- /dev/null
+++ b/AsteriskConfig/Makefile.am
@@ -0,0 +1,33 @@
+#
+# Copyright 2008 Free Software Foundation, Inc.
+#
+# This software is distributed under the terms of the GNU Public License.
+# See the COPYING file in the main directory for details.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+include $(top_srcdir)/Makefile.common
+
+# Install files in this directory
+ourdatadir = $(datadir)/OpenBTS/Asterisk
+
+dist_ourdata_DATA = \
+ cdr.conf \
+ extensions.conf \
+ indications.conf \
+ logger.conf \
+ modules.conf \
+ README.AsteriskConf \
+ sip.conf
diff --git a/AsteriskConfig/Makefile.in b/AsteriskConfig/Makefile.in
new file mode 100644
index 0000000..ad56b05
--- /dev/null
+++ b/AsteriskConfig/Makefile.in
@@ -0,0 +1,450 @@
+# Makefile.in generated by automake 1.9.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# Copyright 2008 Free Software Foundation, Inc.
+#
+# This software is distributed under the terms of the GNU Public License.
+# See the COPYING file in the main directory for details.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+#
+# Copyright 2008 Free Software Foundation, Inc.
+#
+# This software is distributed under the terms of the GNU Public License.
+# See the COPYING file in the main directory for details.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+DIST_COMMON = $(dist_ourdata_DATA) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/Makefile.common
+subdir = AsteriskConfig
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(ourdatadir)"
+dist_ourdataDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_ourdata_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
+LIBUSB_LIBS = @LIBUSB_LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+ORTP_CFLAGS = @ORTP_CFLAGS@
+ORTP_LIBS = @ORTP_LIBS@
+OSIP_CFLAGS = @OSIP_CFLAGS@
+OSIP_LIBS = @OSIP_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+RM_PROG = @RM_PROG@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+COMMON_INCLUDEDIR = $(top_srcdir)/CommonLibs
+CONTROL_INCLUDEDIR = $(top_srcdir)/Control
+GSM_INCLUDEDIR = $(top_srcdir)/GSM
+SIP_INCLUDEDIR = $(top_srcdir)/SIP
+SMS_INCLUDEDIR = $(top_srcdir)/SMS
+TRX_INCLUDEDIR = $(top_srcdir)/TRXManager
+GLOBALS_INCLUDEDIR = $(top_srcdir)/Globals
+CLI_INCLUDEDIR = $(top_srcdir)/CLI
+SQLITE_INCLUDEDIR = $(top_srcdir)/sqlite3
+SR_INCLUDEDIR = $(top_srcdir)/SR
+STD_DEFINES_AND_INCLUDES = \
+ -I$(COMMON_INCLUDEDIR) \
+ -I$(CONTROL_INCLUDEDIR) \
+ -I$(GSM_INCLUDEDIR) \
+ -I$(SIP_INCLUDEDIR) \
+ -I$(SMS_INCLUDEDIR) \
+ -I$(TRX_INCLUDEDIR) \
+ -I$(GLOBALS_INCLUDEDIR) \
+ -I$(CLI_INCLUDEDIR) \
+ -I$(SR_INCLUDEDIR) \
+ -I$(SQLITE_INCLUDEDIR)
+
+COMMON_LA = $(top_builddir)/CommonLibs/libcommon.la
+GSM_LA = $(top_builddir)/GSM/libGSM.la
+SIP_LA = $(top_builddir)/SIP/libSIP.la
+SMS_LA = $(top_builddir)/SMS/libSMS.la
+TRX_LA = $(top_builddir)/TRXManager/libtrxmanager.la
+CONTROL_LA = $(top_builddir)/Control/libcontrol.la
+GLOBALS_LA = $(top_builddir)/Globals/libglobals.la
+CLI_LA = $(top_builddir)/CLI/libcli.la
+SR_LA = $(top_builddir)/SR/libSR.la
+SQLITE_LA = $(top_builddir)/sqlite3/libsqlite.la
+MOSTLYCLEANFILES = *~
+
+# Install files in this directory
+ourdatadir = $(datadir)/OpenBTS/Asterisk
+dist_ourdata_DATA = \
+ cdr.conf \
+ extensions.conf \
+ indications.conf \
+ logger.conf \
+ modules.conf \
+ README.AsteriskConf \
+ sip.conf
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.common $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu AsteriskConfig/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu AsteriskConfig/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-dist_ourdataDATA: $(dist_ourdata_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(ourdatadir)" || $(mkdir_p) "$(DESTDIR)$(ourdatadir)"
+ @list='$(dist_ourdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(dist_ourdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(ourdatadir)/$$f'"; \
+ $(dist_ourdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(ourdatadir)/$$f"; \
+ done
+
+uninstall-dist_ourdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_ourdata_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(ourdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(ourdatadir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ $(mkdir_p) $(distdir)/..
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(ourdatadir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_ourdataDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_ourdataDATA uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dist_ourdataDATA \
+ install-exec install-exec-am install-info install-info-am \
+ install-man install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-dist_ourdataDATA \
+ uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/AsteriskConfig/README.AsteriskConf b/AsteriskConfig/README.AsteriskConf
new file mode 100644
index 0000000..36ee3a0
--- /dev/null
+++ b/AsteriskConfig/README.AsteriskConf
@@ -0,0 +1,4 @@
+This file contains example Asterisk configuration files for the OpenBTS Asterisk server.
+
+This file does not contain REAL configuration files, since those would include real IMSIs.
+
diff --git a/AsteriskConfig/cdr.conf b/AsteriskConfig/cdr.conf
new file mode 100644
index 0000000..c2882c1
--- /dev/null
+++ b/AsteriskConfig/cdr.conf
@@ -0,0 +1,148 @@
+;
+; Asterisk Call Detail Record engine configuration
+;
+; CDR is Call Detail Record, which provides logging services via a variety of
+; pluggable backend modules. Detailed call information can be recorded to
+; databases, files, etc. Useful for billing, fraud prevention, compliance with
+; Sarbanes-Oxley aka The Enron Act, QOS evaluations, and more.
+;
+
+[general]
+
+; Define whether or not to use CDR logging. Setting this to "no" will override
+; any loading of backend CDR modules. Default is "yes".
+;enable=yes
+
+; Define whether or not to log unanswered calls. Setting this to "yes" will
+; report every attempt to ring a phone in dialing attempts, when it was not
+; answered. For example, if you try to dial 3 extensions, and this option is "yes",
+; you will get 3 CDR's, one for each phone that was rung. Default is "no". Some
+; find this information horribly useless. Others find it very valuable. Note, in "yes"
+; mode, you will see one CDR, with one of the call targets on one side, and the originating
+; channel on the other, and then one CDR for each channel attempted. This may seem
+; redundant, but cannot be helped.
+;unanswered = no
+
+; Define the CDR batch mode, where instead of posting the CDR at the end of
+; every call, the data will be stored in a buffer to help alleviate load on the
+; asterisk server. Default is "no".
+;
+; WARNING WARNING WARNING
+; Use of batch mode may result in data loss after unsafe asterisk termination
+; ie. software crash, power failure, kill -9, etc.
+; WARNING WARNING WARNING
+;
+;batch=no
+
+; Define the maximum number of CDRs to accumulate in the buffer before posting
+; them to the backend engines. 'batch' must be set to 'yes'. Default is 100.
+;size=100
+
+; Define the maximum time to accumulate CDRs in the buffer before posting them
+; to the backend engines. If this time limit is reached, then it will post the
+; records, regardless of the value defined for 'size'. 'batch' must be set to
+; 'yes'. Note that time is in seconds. Default is 300 (5 minutes).
+;time=300
+
+; The CDR engine uses the internal asterisk scheduler to determine when to post
+; records. Posting can either occur inside the scheduler thread, or a new
+; thread can be spawned for the submission of every batch. For small batches,
+; it might be acceptable to just use the scheduler thread, so set this to "yes".
+; For large batches, say anything over size=10, a new thread is recommended, so
+; set this to "no". Default is "no".
+;scheduleronly=no
+
+; When shutting down asterisk, you can block until the CDRs are submitted. If
+; you don't, then data will likely be lost. You can always check the size of
+; the CDR batch buffer with the CLI "cdr status" command. To enable blocking on
+; submission of CDR data during asterisk shutdown, set this to "yes". Default
+; is "yes".
+;safeshutdown=yes
+
+; Normally, CDR's are not closed out until after all extensions are finished
+; executing. By enabling this option, the CDR will be ended before executing
+; the "h" extension so that CDR values such as "end" and "billsec" may be
+; retrieved inside of of this extension.
+;endbeforehexten=no
+
+;
+;
+; CHOOSING A CDR "BACKEND" (what kind of output to generate)
+;
+; To choose a backend, you have to make sure either the right category is
+; defined in this file, or that the appropriate config file exists, and has the
+; proper definitions in it. If there are any problems, usually, the entry will
+; silently ignored, and you get no output.
+;
+; Also, please note that you can generate CDR records in as many formats as you
+; wish. If you configure 5 different CDR formats, then each event will be logged
+; in 5 different places! In the example config files, all formats are commented
+; out except for the cdr-csv format.
+;
+; Here are all the possible back ends:
+;
+; csv, custom, manager, odbc, pgsql, radius, sqlite, tds
+; (also, mysql is available via the asterisk-addons, due to licensing
+; requirements)
+; (please note, also, that other backends can be created, by creating
+; a new backend module in the source cdr/ directory!)
+;
+; Some of the modules required to provide these backends will not build or install
+; unless some dependency requirements are met. Examples of this are pgsql, odbc,
+; etc. If you are not getting output as you would expect, the first thing to do
+; is to run the command "make menuselect", and check what modules are available,
+; by looking in the "2. Call Detail Recording" option in the main menu. If your
+; backend is marked with XXX, you know that the "configure" command could not find
+; the required libraries for that option.
+;
+; To get CDRs to be logged to the plain-jane /var/log/asterisk/cdr-csv/Master.csv
+; file, define the [csv] category in this file. No database necessary. The example
+; config files are set up to provide this kind of output by default.
+;
+; To get custom csv CDR records, make sure the cdr_custom.conf file
+; is present, and contains the proper [mappings] section. The advantage to
+; using this backend, is that you can define which fields to output, and in
+; what order. By default, the example configs are set up to mimic the cdr-csv
+; output. If you don't make any changes to the mappings, you are basically generating
+; the same thing as cdr-csv, but expending more CPU cycles to do so!
+;
+; To get manager events generated, make sure the cdr_manager.conf file exists,
+; and the [general] section is defined, with the single variable 'enabled = yes'.
+;
+; For odbc, make sure all the proper libs are installed, that "make menuselect"
+; shows that the modules are available, and the cdr_odbc.conf file exists, and
+; has a [global] section with the proper variables defined.
+;
+; For pgsql, make sure all the proper libs are installed, that "make menuselect"
+; shows that the modules are available, and the cdr_pgsql.conf file exists, and
+; has a [global] section with the proper variables defined.
+;
+; For logging to radius databases, make sure all the proper libs are installed, that
+; "make menuselect" shows that the modules are available, and the [radius]
+; category is defined in this file, and in that section, make sure the 'radiuscfg'
+; variable is properly pointing to an existing radiusclient.conf file.
+;
+; For logging to sqlite databases, make sure the 'cdr.db' file exists in the log directory,
+; which is usually /var/log/asterisk. Of course, the proper libraries should be available
+; during the 'configure' operation.
+;
+; For tds logging, make sure the proper libraries are available during the 'configure'
+; phase, and that cdr_tds.conf exists and is properly set up with a [global] category.
+;
+; Also, remember, that if you wish to log CDR info to a database, you will have to define
+; a specific table in that databse to make things work! See the doc directory for more details
+; on how to create this table in each database.
+;
+
+[csv]
+usegmtime=yes ; log date/time in GMT. Default is "no"
+loguniqueid=yes ; log uniqueid. Default is "no
+loguserfield=yes ; log user field. Default is "no
+
+;[radius]
+;usegmtime=yes ; log date/time in GMT
+;loguniqueid=yes ; log uniqueid
+;loguserfield=yes ; log user field
+; Set this to the location of the radiusclient-ng configuration file
+; The default is /etc/radiusclient-ng/radiusclient.conf
+;radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf
diff --git a/AsteriskConfig/extensions.conf b/AsteriskConfig/extensions.conf
new file mode 100644
index 0000000..7fca0ee
--- /dev/null
+++ b/AsteriskConfig/extensions.conf
@@ -0,0 +1,57 @@
+[globals]
+
+
+[default]
+; This is the context for handsets that are allowed to attached via open registration.
+; Normally, this context is only used for testing.
+
+; These are test extensions that you might want to disable after installation.
+
+; Create an extension, 2600, for evaluating echo latency.
+exten => 2600,1,Answer() ; Do the echo test
+exten => 2600,n,Echo ; Do the echo test
+exten => 2600,n,Hangup
+
+; The 2101 extension is used for factory testing with zoiper.
+exten => 2101,1,Dial(SIP/zoiper)
+
+; The 2100 extension is for factory testing with the test SIM.
+exten => 2100,1,Dial(SIP/IMSI001010000000000)
+
+
+
+[outbound-trunk]
+; If you had an external trunk, you would dial it here.
+exten => _N.,1,Answer()
+
+
+
+
+
+[phones]
+; This is the context for handsets provisioned through the realtime database.
+; This assumes that OpenBTS units all are running their SIP interfaces on port 5062.
+exten => _N.,1,Set(Name=${ODBC_SQL(select dial from dialdata_table where exten = \"${EXTEN}\")})
+exten => _N.,n,GotoIf($["${Name}" = ""] ?outbound-trunk,${EXTEN},1)
+exten => _N.,n,Set(IPAddr=${ODBC_SQL(select ipaddr from sip_buddies where name = \"${Name}\")})
+exten => _N.,n,GotoIf($["${IPAddr}" = ""] ?outbound-trunk,${EXTEN},1)
+exten => _N.,n,Dial(SIP/${Name}@${IPAddr}:5062)
+
+
+
+[sip-local]
+; This context is the union of all of the in-network contexts.
+include => default
+include => phones
+
+
+
+
+[sip-external]
+; This is the top-level context that gives access to out-of-network calling.
+; also includes the in-network calling.
+include => sip-local
+include => outbound-trunk
+
+
+
diff --git a/AsteriskConfig/indications.conf b/AsteriskConfig/indications.conf
new file mode 100644
index 0000000..03a3fad
--- /dev/null
+++ b/AsteriskConfig/indications.conf
@@ -0,0 +1,733 @@
+; indications.conf
+; Configuration file for location specific tone indications
+; used by the pbx_indications module.
+;
+; NOTE:
+; When adding countries to this file, please keep them in alphabetical
+; order according to the 2-character country codes!
+;
+; The [general] category is for certain global variables.
+; All other categories are interpreted as location specific indications
+;
+;
+[general]
+country=us ; default location
+
+
+; [example]
+; description = string
+; The full name of your country, in English.
+; alias = iso[,iso]*
+; List of other countries 2-letter iso codes, which have the same
+; tone indications.
+; ringcadence = num[,num]*
+; List of durations the physical bell rings.
+; dial = tonelist
+; Set of tones to be played when one picks up the hook.
+; busy = tonelist
+; Set of tones played when the receiving end is busy.
+; congestion = tonelist
+; Set of tones played when there is some congestion (on the network?)
+; callwaiting = tonelist
+; Set of tones played when there is a call waiting in the background.
+; dialrecall = tonelist
+; Not well defined; many phone systems play a recall dial tone after hook
+; flash.
+; record = tonelist
+; Set of tones played when call recording is in progress.
+; info = tonelist
+; Set of tones played with special information messages (e.g., "number is
+; out of service")
+; 'name' = tonelist
+; Every other variable will be available as a shortcut for the "PlayList" command
+; but will not be used automatically by Asterisk.
+;
+;
+; The tonelist itself is defined by a comma-separated sequence of elements.
+; Each element consist of a frequency (f) with an optional duration (in ms)
+; attached to it (f/duration). The frequency component may be a mixture of two
+; frequencies (f1+f2) or a frequency modulated by another frequency (f1*f2).
+; The implicit modulation depth is fixed at 90%, though.
+; If the list element starts with a !, that element is NOT repeated,
+; therefore, only if all elements start with !, the tonelist is time-limited,
+; all others will repeat indefinitely.
+;
+; concisely:
+; element = [!]freq[+|*freq2][/duration]
+; tonelist = element[,element]*
+;
+; Please note that SPACES ARE NOT ALLOWED in tone lists!
+;
+
+[at]
+description = Austria
+ringcadence = 1000,5000
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+dial = 420
+busy = 420/400,0/400
+ring = 420/1000,0/5000
+congestion = 420/200,0/200
+callwaiting = 420/40,0/1960
+dialrecall = 420
+; RECORDTONE - not specified
+record = 1400/80,0/14920
+info = 950/330,1450/330,1850/330,0/1000
+stutter = 380+420
+
+[au]
+description = Australia
+; Reference http://www.acif.org.au/__data/page/3303/S002_2001.pdf
+; Normal Ring
+ringcadence = 400,200,400,2000
+; Distinctive Ring 1 - Forwarded Calls
+; 400,400,200,200,400,1400
+; Distinctive Ring 2 - Selective Ring 2 + Operator + Recall
+; 400,400,200,2000
+; Distinctive Ring 3 - Multiple Subscriber Number 1
+; 200,200,400,2200
+; Distinctive Ring 4 - Selective Ring 1 + Centrex
+; 400,2600
+; Distinctive Ring 5 - Selective Ring 3
+; 400,400,200,400,200,1400
+; Distinctive Ring 6 - Multiple Subscriber Number 2
+; 200,400,200,200,400,1600
+; Distinctive Ring 7 - Multiple Subscriber Number 3 + Data Privacy
+; 200,400,200,400,200,1600
+; Tones
+dial = 413+438
+busy = 425/375,0/375
+ring = 413+438/400,0/200,413+438/400,0/2000
+; XXX Congestion: Should reduce by 10 db every other cadence XXX
+congestion = 425/375,0/375,420/375,0/375
+callwaiting = 425/200,0/200,425/200,0/4400
+dialrecall = 413+438
+; Record tone used for Call Intrusion/Recording or Conference
+record = !425/1000,!0/15000,425/360,0/15000
+info = 425/2500,0/500
+; Other Australian Tones
+; The STD "pips" indicate the call is not an untimed local call
+std = !525/100,!0/100,!525/100,!0/100,!525/100,!0/100,!525/100,!0/100,!525/100
+; Facility confirmation tone (eg. Call Forward Activated)
+facility = 425
+; Message Waiting "stutter" dialtone
+stutter = 413+438/100,0/40
+; Ringtone for calls to Telstra mobiles
+ringmobile = 400+450/400,0/200,400+450/400,0/2000
+
+[bg]
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+description = Bulgaria
+ringdance = 1000,4000
+;
+dial = 425
+busy = 425/500,0/500
+ring = 425/1000,0/4000
+congestion = 425/250,0/250
+callwaiting = 425/150,0/150,425/150,0/4000
+dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+record = 1400/425,0/15000
+info = 950/330,1400/330,1800/330,0/1000
+stutter = 425/1500,0/100
+
+[br]
+description = Brazil
+ringcadence = 1000,4000
+dial = 425
+busy = 425/250,0/250
+ring = 425/1000,0/4000
+congestion = 425/250,0/250,425/750,0/250
+callwaiting = 425/50,0/1000
+; Dialrecall not used in Brazil standard (using UK standard)
+dialrecall = 350+440
+; Record tone is not used in Brazil, use busy tone
+record = 425/250,0/250
+; Info not used in Brazil standard (using UK standard)
+info = 950/330,1400/330,1800/330
+stutter = 350+440
+
+[be]
+description = Belgium
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1000,3000
+dial = 425
+busy = 425/500,0/500
+ring = 425/1000,0/3000
+congestion = 425/167,0/167
+callwaiting = 1400/175,0/175,1400/175,0/3500
+; DIALRECALL - not specified
+dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440"
+; RECORDTONE - not specified
+record = 1400/500,0/15000
+info = 900/330,1400/330,1800/330,0/1000
+stutter = 425/1000,0/250
+
+[ch]
+description = Switzerland
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1000,4000
+dial = 425
+busy = 425/500,0/500
+ring = 425/1000,0/4000
+congestion = 425/200,0/200
+callwaiting = 425/200,0/200,425/200,0/4000
+; DIALRECALL - not specified
+dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+; RECORDTONE - not specified
+record = 1400/80,0/15000
+info = 950/330,1400/330,1800/330,0/1000
+stutter = 425+340/1100,0/1100
+
+[cl]
+description = Chile
+; According to specs from Telefonica CTC Chile
+ringcadence = 1000,3000
+dial = 400
+busy = 400/500,0/500
+ring = 400/1000,0/3000
+congestion = 400/200,0/200
+callwaiting = 400/250,0/8750
+dialrecall = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400
+record = 1400/500,0/15000
+info = 950/333,1400/333,1800/333,0/1000
+stutter = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400
+
+[cn]
+description = China
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1000,4000
+dial = 450
+busy = 450/350,0/350
+ring = 450/1000,0/4000
+congestion = 450/700,0/700
+callwaiting = 450/400,0/4000
+dialrecall = 450
+record = 950/400,0/10000
+info = 450/100,0/100,450/100,0/100,450/100,0/100,450/400,0/400
+; STUTTER - not specified
+stutter = 450+425
+
+[cz]
+description = Czech Republic
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1000,4000
+dial = 425/330,0/330,425/660,0/660
+busy = 425/330,0/330
+ring = 425/1000,0/4000
+congestion = 425/165,0/165
+callwaiting = 425/330,0/9000
+; DIALRECALL - not specified
+dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425/330,0/330,425/660,0/660
+; RECORDTONE - not specified
+record = 1400/500,0/14000
+info = 950/330,0/30,1400/330,0/30,1800/330,0/1000
+; STUTTER - not specified
+stutter = 425/450,0/50
+
+[de]
+description = Germany
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1000,4000
+dial = 425
+busy = 425/480,0/480
+ring = 425/1000,0/4000
+congestion = 425/240,0/240
+callwaiting = !425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,0
+; DIALRECALL - not specified
+dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+; RECORDTONE - not specified
+record = 1400/80,0/15000
+info = 950/330,1400/330,1800/330,0/1000
+stutter = 425+400
+
+[dk]
+description = Denmark
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1000,4000
+dial = 425
+busy = 425/500,0/500
+ring = 425/1000,0/4000
+congestion = 425/200,0/200
+callwaiting = !425/200,!0/600,!425/200,!0/3000,!425/200,!0/200,!425/200,0
+; DIALRECALL - not specified
+dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+; RECORDTONE - not specified
+record = 1400/80,0/15000
+info = 950/330,1400/330,1800/330,0/1000
+; STUTTER - not specified
+stutter = 425/450,0/50
+
+[ee]
+description = Estonia
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1000,4000
+dial = 425
+busy = 425/300,0/300
+ring = 425/1000,0/4000
+congestion = 425/200,0/200
+; CALLWAIT not in accordance to ITU
+callwaiting = 950/650,0/325,950/325,0/30,1400/1300,0/2600
+; DIALRECALL - not specified
+dialrecall = 425/650,0/25
+; RECORDTONE - not specified
+record = 1400/500,0/15000
+; INFO not in accordance to ITU
+info = 950/650,0/325,950/325,0/30,1400/1300,0/2600
+; STUTTER not specified
+stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+
+[es]
+description = Spain
+ringcadence = 1500,3000
+dial = 425
+busy = 425/200,0/200
+ring = 425/1500,0/3000
+congestion = 425/200,0/200,425/200,0/200,425/200,0/600
+callwaiting = 425/175,0/175,425/175,0/3500
+dialrecall = !425/200,!0/200,!425/200,!0/200,!425/200,!0/200,425
+record = 1400/500,0/15000
+info = 950/330,0/1000
+dialout = 500
+
+
+[fi]
+description = Finland
+ringcadence = 1000,4000
+dial = 425
+busy = 425/300,0/300
+ring = 425/1000,0/4000
+congestion = 425/200,0/200
+callwaiting = 425/150,0/150,425/150,0/8000
+dialrecall = 425/650,0/25
+record = 1400/500,0/15000
+info = 950/650,0/325,950/325,0/30,1400/1300,0/2600
+stutter = 425/650,0/25
+
+[fr]
+description = France
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1500,3500
+; Dialtone can also be 440+330
+dial = 440
+busy = 440/500,0/500
+ring = 440/1500,0/3500
+; CONGESTION - not specified
+congestion = 440/250,0/250
+callwait = 440/300,0/10000
+; DIALRECALL - not specified
+dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+; RECORDTONE - not specified
+record = 1400/500,0/15000
+info = !950/330,!1400/330,!1800/330
+stutter = !440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,440
+
+[gr]
+description = Greece
+ringcadence = 1000,4000
+dial = 425/200,0/300,425/700,0/800
+busy = 425/300,0/300
+ring = 425/1000,0/4000
+congestion = 425/200,0/200
+callwaiting = 425/150,0/150,425/150,0/8000
+dialrecall = 425/650,0/25
+record = 1400/400,0/15000
+info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
+stutter = 425/650,0/25
+
+[hu]
+description = Hungary
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1250,3750
+dial = 425
+busy = 425/300,0/300
+ring = 425/1250,0/3750
+congestion = 425/300,0/300
+callwaiting = 425/40,0/1960
+dialrecall = 425+450
+; RECORDTONE - not specified
+record = 1400/400,0/15000
+info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
+stutter = 350+375+400
+
+[il]
+description = Israel
+ringcadence = 1000,3000
+dial = 414
+busy = 414/500,0/500
+ring = 414/1000,0/3000
+congestion = 414/250,0/250
+callwaiting = 414/100,0/100,414/100,0/100,414/600,0/3000
+dialrecall = !414/100,!0/100,!414/100,!0/100,!414/100,!0/100,414
+record = 1400/500,0/15000
+info = 1000/330,1400/330,1800/330,0/1000
+stutter = !414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,414
+
+
+[in]
+description = India
+ringcadence = 400,200,400,2000
+dial = 400*25
+busy = 400/750,0/750
+ring = 400*25/400,0/200,400*25/400,0/2000
+congestion = 400/250,0/250
+callwaiting = 400/200,0/100,400/200,0/7500
+dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+record = 1400/500,0/15000
+info = !950/330,!1400/330,!1800/330,0/1000
+stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+
+[it]
+description = Italy
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1000,4000
+dial = 425/200,0/200,425/600,0/1000
+busy = 425/500,0/500
+ring = 425/1000,0/4000
+congestion = 425/200,0/200
+callwaiting = 425/400,0/100,425/250,0/100,425/150,0/14000
+dialrecall = 470/400,425/400
+record = 1400/400,0/15000
+info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
+stutter = 470/400,425/400
+
+[lt]
+description = Lithuania
+ringcadence = 1000,4000
+dial = 425
+busy = 425/350,0/350
+ring = 425/1000,0/4000
+congestion = 425/200,0/200
+callwaiting = 425/150,0/150,425/150,0/4000
+; DIALRECALL - not specified
+dialrecall = 425/500,0/50
+; RECORDTONE - not specified
+record = 1400/500,0/15000
+info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
+; STUTTER - not specified
+stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+
+[jp]
+description = Japan
+ringcadence = 1000,2000
+dial = 400
+busy = 400/500,0/500
+ring = 400+15/1000,0/2000
+congestion = 400/500,0/500
+callwaiting = 400+16/500,0/8000
+dialrecall = !400/200,!0/200,!400/200,!0/200,!400/200,!0/200,400
+record = 1400/500,0/15000
+info = !950/330,!1400/330,!1800/330,0
+stutter = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400
+
+[mx]
+description = Mexico
+ringcadence = 2000,4000
+dial = 425
+busy = 425/250,0/250
+ring = 425/1000,0/4000
+congestion = 425/250,0/250
+callwaiting = 425/200,0/600,425/200,0/10000
+dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+record = 1400/500,0/15000
+info = 950/330,0/30,1400/330,0/30,1800/330,0/1000
+stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+
+[my]
+description = Malaysia
+ringcadence = 2000,4000
+dial = 425
+busy = 425/500,0/500
+ring = 425/400,0/200
+congestion = 425/500,0/500
+
+[nl]
+description = Netherlands
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+ringcadence = 1000,4000
+; Most of these 425's can also be 450's
+dial = 425
+busy = 425/500,0/500
+ring = 425/1000,0/4000
+congestion = 425/250,0/250
+callwaiting = 425/500,0/9500
+; DIALRECALL - not specified
+dialrecall = 425/500,0/50
+; RECORDTONE - not specified
+record = 1400/500,0/15000
+info = 950/330,1400/330,1800/330,0/1000
+stutter = 425/500,0/50
+
+[no]
+description = Norway
+ringcadence = 1000,4000
+dial = 425
+busy = 425/500,0/500
+ring = 425/1000,0/4000
+congestion = 425/200,0/200
+callwaiting = 425/200,0/600,425/200,0/10000
+dialrecall = 470/400,425/400
+record = 1400/400,0/15000
+info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
+stutter = 470/400,425/400
+
+[nz]
+description = New Zealand
+;NOTE - the ITU has different tonesets for NZ, but according to some residents there,
+; this is, indeed, the correct way to do it.
+ringcadence = 400,200,400,2000
+dial = 400
+busy = 400/250,0/250
+ring = 400+450/400,0/200,400+450/400,0/2000
+congestion = 400/375,0/375
+callwaiting = !400/200,!0/3000,!400/200,!0/3000,!400/200,!0/3000,!400/200
+dialrecall = !400/100!0/100,!400/100,!0/100,!400/100,!0/100,400
+record = 1400/425,0/15000
+info = 400/750,0/100,400/750,0/100,400/750,0/100,400/750,0/400
+stutter = !400/100!0/100,!400/100,!0/100,!400/100,!0/100,!400/100!0/100,!400/100,!0/100,!400/100,!0/100,400
+unobtainable = 400/75,0/100,400/75,0/100,400/75,0/100,400/75,0/400
+
+[ph]
+
+; reference http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+
+description = Philippines
+ringcadence = 1000,4000
+dial = 425
+busy = 480+620/500,0/500
+ring = 425+480/1000,0/4000
+congestion = 480+620/250,0/250
+callwaiting = 440/300,0/10000
+; DIALRECALL - not specified
+dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+; RECORDTONE - not specified
+record = 1400/500,0/15000
+; INFO - not specified
+info = !950/330,!1400/330,!1800/330,0
+; STUTTER - not specified
+stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+
+
+[pl]
+description = Poland
+ringcadence = 1000,4000
+dial = 425
+busy = 425/500,0/500
+ring = 425/1000,0/4000
+congestion = 425/500,0/500
+callwaiting = 425/150,0/150,425/150,0/4000
+; DIALRECALL - not specified
+dialrecall = 425/500,0/50
+; RECORDTONE - not specified
+record = 1400/500,0/15000
+; 950/1400/1800 3x0.33 on 1.0 off repeated 3 times
+info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000
+; STUTTER - not specified
+stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+
+[pt]
+description = Portugal
+ringcadence = 1000,5000
+dial = 425
+busy = 425/500,0/500
+ring = 425/1000,0/5000
+congestion = 425/200,0/200
+callwaiting = 440/300,0/10000
+dialrecall = 425/1000,0/200
+record = 1400/500,0/15000
+info = 950/330,1400/330,1800/330,0/1000
+stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+
+[ru]
+; References:
+; http://www.minsvyaz.ru/site.shtml?id=1806
+; http://www.aboutphone.info/lib/gost/45-223-2001.html
+description = Russian Federation / ex Soviet Union
+ringcadence = 1000,4000
+dial = 425
+busy = 425/350,0/350
+ring = 425/1000,0/4000
+congestion = 425/175,0/175
+callwaiting = 425/200,0/5000
+record = 1400/400,0/15000
+info = 950/330,1400/330,1800/330,0/1000
+dialrecall = 425/400,0/40
+stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+
+[se]
+description = Sweden
+ringcadence = 1000,5000
+dial = 425
+busy = 425/250,0/250
+ring = 425/1000,0/5000
+congestion = 425/250,0/750
+callwaiting = 425/200,0/500,425/200,0/9100
+dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+record = 1400/500,0/15000
+info = !950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,0
+stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
+; stutter = 425/320,0/20 ; Real swedish standard, not used for now
+
+[sg]
+description = Singapore
+; Singapore
+; Reference: http://www.ida.gov.sg/idaweb/doc/download/I397/ida_ts_pstn1_i4r2.pdf
+; Frequency specs are: 425 Hz +/- 20Hz; 24 Hz +/- 2Hz; modulation depth 100%; SIT +/- 50Hz
+ringcadence = 400,200,400,2000
+dial = 425
+ring = 425*24/400,0/200,425*24/400,0/2000 ; modulation should be 100%, not 90%
+busy = 425/750,0/750
+congestion = 425/250,0/250
+callwaiting = 425*24/300,0/200,425*24/300,0/3200
+stutter = !425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,425
+info = 950/330,1400/330,1800/330,0/1000 ; not currently in use acc. to reference
+dialrecall = 425*24/500,0/500,425/500,0/2500 ; unspecified in IDA reference, use repeating Holding Tone A,B
+record = 1400/500,0/15000 ; unspecified in IDA reference, use 0.5s tone every 15s
+; additionally defined in reference
+nutone = 425/2500,0/500
+intrusion = 425/250,0/2000
+warning = 425/624,0/4376 ; end of period tone, warning
+acceptance = 425/125,0/125
+holdinga = !425*24/500,!0/500 ; followed by holdingb
+holdingb = !425/500,!0/2500
+
+[th]
+description = Thailand
+ringcadence = 1000,4000
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+dial = 400*50
+busy = 400/500,0/500
+ring = 420/1000,0/5000
+congestion = 400/300,0/300
+callwaiting = 1000/400,10000/400,1000/400
+; DIALRECALL - not specified - use special dial tone instead.
+dialrecall = 400*50/400,0/100,400*50/400,0/100
+; RECORDTONE - not specified
+record = 1400/500,0/15000
+; INFO - specified as an announcement - use special information tones instead
+info = 950/330,1400/330,1800/330
+; STUTTER - not specified
+stutter = !400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,400
+
+[uk]
+description = United Kingdom
+ringcadence = 400,200,400,2000
+; These are the official tones taken from BT SIN350. The actual tones
+; used by BT include some volume differences so sound slightly different
+; from Asterisk-generated ones.
+dial = 350+440
+; Special dial is the intermittent dial tone heard when, for example,
+; you have a divert active on the line
+specialdial = 350+440/750,440/750
+; Busy is also called "Engaged"
+busy = 400/375,0/375
+; "Congestion" is the Beep-bip engaged tone
+congestion = 400/400,0/350,400/225,0/525
+; "Special Congestion" is not used by BT very often if at all
+specialcongestion = 400/200,1004/300
+unobtainable = 400
+ring = 400+450/400,0/200,400+450/400,0/2000
+callwaiting = 400/100,0/4000
+; BT seem to use "Special Call Waiting" rather than just "Call Waiting" tones
+specialcallwaiting = 400/250,0/250,400/250,0/250,400/250,0/5000
+; "Pips" used by BT on payphones. (Sounds wrong, but this is what BT claim it
+; is and I've not used a payphone for years)
+creditexpired = 400/125,0/125
+; These two are used to confirm/reject service requests on exchanges that
+; don't do voice announcements.
+confirm = 1400
+switching = 400/200,0/400,400/2000,0/400
+; This is the three rising tones Doo-dah-dee "Special Information Tone",
+; usually followed by the BT woman saying an appropriate message.
+info = 950/330,0/15,1400/330,0/15,1800/330,0/1000
+; Not listed in SIN350
+record = 1400/500,0/60000
+stutter = 350+440/750,440/750
+
+[us]
+description = United States / North America
+ringcadence = 2000,4000
+dial = 350+440
+busy = 480+620/500,0/500
+ring = 440+480/2000,0/4000
+congestion = 480+620/250,0/250
+callwaiting = 440/300,0/10000
+dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+record = 1400/500,0/15000
+info = !950/330,!1400/330,!1800/330,0
+stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+
+[us-old]
+description = United States Circa 1950/ North America
+ringcadence = 2000,4000
+dial = 600*120
+busy = 500*100/500,0/500
+ring = 420*40/2000,0/4000
+congestion = 500*100/250,0/250
+callwaiting = 440/300,0/10000
+dialrecall = !600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120
+record = 1400/500,0/15000
+info = !950/330,!1400/330,!1800/330,0
+stutter = !600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120
+
+[tw]
+description = Taiwan
+; http://nemesis.lonestar.org/reference/telecom/signaling/dialtone.html
+; http://nemesis.lonestar.org/reference/telecom/signaling/busy.html
+; http://www.iproducts.com.tw/ee/kylink/06ky-1000a.htm
+; http://www.pbx-manufacturer.com/ky120dx.htm
+; http://www.nettwerked.net/tones.txt
+; http://www.cisco.com/univercd/cc/td/doc/product/tel_pswt/vco_prod/taiw_sup/taiw2.htm
+;
+; busy tone 480+620Hz 0.5 sec. on ,0.5 sec. off
+; reorder tone 480+620Hz 0.25 sec. on,0.25 sec. off
+; ringing tone 440+480Hz 1 sec. on ,2 sec. off
+;
+ringcadence = 1000,4000
+dial = 350+440
+busy = 480+620/500,0/500
+ring = 440+480/1000,0/2000
+congestion = 480+620/250,0/250
+callwaiting = 350+440/250,0/250,350+440/250,0/3250
+dialrecall = 300/1500,0/500
+record = 1400/500,0/15000
+info = !950/330,!1400/330,!1800/330,0
+stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
+
+[ve]
+; Tone definition source for ve found on
+; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
+description = Venezuela / South America
+ringcadence = 1000,4000
+dial = 425
+busy = 425/500,0/500
+ring = 425/1000,0/4000
+congestion = 425/250,0/250
+callwaiting = 400+450/300,0/6000
+dialrecall = 425
+record = 1400/500,0/15000
+info = !950/330,!1440/330,!1800/330,0/1000
+
+
+[za]
+description = South Africa
+; http://www.cisco.com/univercd/cc/td/doc/product/tel_pswt/vco_prod/safr_sup/saf02.htm
+; (definitions for other countries can also be found there)
+; Note, though, that South Africa uses two switch types in their network --
+; Alcatel switches -- mainly in the Western Cape, and Siemens elsewhere.
+; The former use 383+417 in dial, ringback etc. The latter use 400*33
+; I've provided both, uncomment the ones you prefer
+ringcadence = 400,200,400,2000
+; dial/ring/callwaiting for the Siemens switches:
+dial = 400*33
+ring = 400*33/400,0/200,400*33/400,0/2000
+callwaiting = 400*33/250,0/250,400*33/250,0/250,400*33/250,0/250,400*33/250,0/250
+; dial/ring/callwaiting for the Alcatel switches:
+; dial = 383+417
+; ring = 383+417/400,0/200,383+417/400,0/2000
+; callwaiting = 383+417/250,0/250,383+417/250,0/250,383+417/250,0/250,383+417/250,0/250
+congestion = 400/250,0/250
+busy = 400/500,0/500
+dialrecall = 350+440
+; XXX Not sure about the RECORDTONE
+record = 1400/500,0/10000
+info = 950/330,1400/330,1800/330,0/330
+stutter = !400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,400*33
diff --git a/AsteriskConfig/logger.conf b/AsteriskConfig/logger.conf
new file mode 100644
index 0000000..0ac424a
--- /dev/null
+++ b/AsteriskConfig/logger.conf
@@ -0,0 +1,69 @@
+;
+; Logging Configuration
+;
+; In this file, you configure logging to files or to
+; the syslog system.
+;
+; "logger reload" at the CLI will reload configuration
+; of the logging system.
+
+[general]
+; Customize the display of debug message time stamps
+; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS)
+; see strftime(3) Linux manual for format specifiers
+;dateformat=%F %T
+;
+; This appends the hostname to the name of the log files.
+;appendhostname = yes
+;
+; This determines whether or not we log queue events to a file
+; (defaults to yes).
+;queue_log = no
+;
+; This determines whether or not we log generic events to a file
+; (defaults to yes).
+;event_log = no
+;
+;
+; For each file, specify what to log.
+;
+; For console logging, you set options at start of
+; Asterisk with -v for verbose and -d for debug
+; See 'asterisk -h' for more information.
+;
+; Directory for log files is configures in asterisk.conf
+; option astlogdir
+;
+[logfiles]
+;
+; Format is "filename" and then "levels" of debugging to be included:
+; debug
+; notice
+; warning
+; error
+; verbose
+; dtmf
+;
+; Special filename "console" represents the system console
+;
+; We highly recommend that you DO NOT turn on debug mode if you are simply
+; running a production system. Debug mode turns on a LOT of extra messages,
+; most of which you are unlikely to understand without an understanding of
+; the underlying code. Do NOT report debug messages as code issues, unless
+; you have a specific issue that you are attempting to debug. They are
+; messages for just that -- debugging -- and do not rise to the level of
+; something that merit your attention as an Asterisk administrator. Debug
+; messages are also very verbose and can and do fill up logfiles quickly;
+; this is another reason not to have debug mode on a production system unless
+; you are in the process of debugging a specific issue.
+;
+;debug => debug
+console => notice,warning,error
+;console => notice,warning,error,debug
+;messages => notice,warning,error
+;full => notice,warning,error,debug,verbose
+
+;syslog keyword : This special keyword logs to syslog facility
+;
+;syslog.local0 => notice,warning,error
+;
diff --git a/AsteriskConfig/modules.conf b/AsteriskConfig/modules.conf
new file mode 100644
index 0000000..c2f2ba7
--- /dev/null
+++ b/AsteriskConfig/modules.conf
@@ -0,0 +1,36 @@
+;
+; Asterisk configuration file
+;
+; Module Loader configuration file
+;
+
+[modules]
+autoload=yes
+;
+; Any modules that need to be loaded before the Asterisk core has been
+; initialized (just after the logger has been initialized) can be loaded
+; using 'preload'. This will frequently be needed if you wish to map all
+; module configuration files into Realtime storage, since the Realtime
+; driver will need to be loaded before the modules using those configuration
+; files are initialized.
+;
+; An example of loading ODBC support would be:
+;preload => res_odbc.so
+;preload => res_config_odbc.so
+;
+; Uncomment the following if you wish to use the Speech Recognition API
+;preload => res_speech.so
+;
+; If you want, load the GTK console right away.
+;
+noload => pbx_gtkconsole.so
+;load => pbx_gtkconsole.so
+;
+noload => res_musiconhold.so
+;load => res_musiconhold.so
+;
+; Load either OSS or ALSA, not both
+; By default, load OSS only (automatically) and do not load ALSA
+;
+noload => chan_alsa.so
+;noload => chan_oss.so
diff --git a/AsteriskConfig/sip.conf b/AsteriskConfig/sip.conf
new file mode 100644
index 0000000..bb7a8b9
--- /dev/null
+++ b/AsteriskConfig/sip.conf
@@ -0,0 +1,91 @@
+[general]
+bindport=5060 ; asterisk 1.6
+ ; UDP Port to bind to (SIP standard port for unencrypted UDP
+ ; and TCP sessions is 5060)
+ ; bindport is the local UDP port that Asterisk will listen on
+bindaddr=0.0.0.0 ; asterisk 1.6
+ ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+ ; You can specify port here too, like 123.123.123.123:5080
+udpbindaddr=0.0.0.0 ; asterisk 1.8
+ ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+ ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
+
+tos_sip=cs3 ; Sets TOS for SIP packets.
+tos_audio=ef ; Sets TOS for RTP audio packets.
+tos_video=af41 ; Sets TOS for RTP video packets.
+tos_text=af41 ; Sets TOS for RTP text packets.
+
+cos_sip=3 ; Sets 802.1p priority for SIP packets.
+cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
+cos_video=4 ; Sets 802.1p priority for RTP video packets.
+cos_text=3 ; Sets 802.1p priority for RTP text packets.
+
+maxexpiry=3600 ; Maximum allowed time of incoming registrations
+ ; and subscriptions (seconds)
+minexpiry=60 ; Minimum length of registrations/subscriptions (default 60)
+defaultexpiry=3600 ; Default length of incoming/outgoing registration
+dynamic_exclude_static=yes ; Disallow all dynamic hosts from registering
+ ; as any IP address used for staticly defined
+ ; hosts. This helps avoid the configuration
+ ; error of allowing your users to register at
+ ; the same address as a SIP provider.
+use_q850_reason=yes ; Set to yes add Reason header and use Reason header if it is available.
+
+;t1min=100 ; Minimum roundtrip time for messages to monitored hosts
+ ; Defaults to 100 ms
+;timert1=500 ; Default T1 timer
+ ; Defaults to 500 ms or the measured round-trip
+ ; time to a peer (qualify=yes).
+;timerb=32000 ; Call setup timer. If a provisional response is not received
+ ; in this amount of time, the call will autocongest
+ ; Defaults to 64*timert1
+rtptimeout=60 ; Terminate call if 60 seconds of no RTP or RTCP activity
+ ; on the audio channel
+ ; when we're not on hold. This is to be able to hangup
+ ; a call in the case of a phone disappearing from the net,
+ ; like a powerloss or grandma tripping over a cable.
+rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP or RTCP activity
+ ; on the audio channel
+ ; when we're on hold (must be > rtptimeout)
+
+;allowguest=no ; Allow or reject guest calls (default is yes)
+autocreatepeer=yes ; The Autocreatepeer option allows,
+ ; if set to Yes, any SIP ua to register with your Asterisk PBX as a peer.
+ ; This peer's settings will be based on global options.
+ ; The peer's name will be based on the user part of the Contact: header field's URL.
+
+context=phones ; Default context for incoming calls
+allowoverlap=no ; Disable overlap dialing support. (Default is yes)
+
+disallow=all ; need to disallow=all before we can use allow=
+allow=gsm ; GSM
+allow=ulaw ; ISDN US
+allow=alaw ; ISDN EU
+
+relaxdtmf=yes ; Relax dtmf handling
+dtmfmode=auto ; Set default dtmfmode for sending DTMF. Default: rfc2833
+ ; Other options:
+ ; info : SIP INFO messages (application/dtmf-relay)
+ ; shortinfo : SIP INFO messages (application/dtmf)
+ ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
+ ; auto : Use rfc2833 if offered, inband otherwise
+
+
+; Zoiper is used as a fixture for factory testing.
+[zoiper]
+secret=3078923984
+callerid=2101
+canreinvite=no
+type=friend
+context=sip-local
+host=dynamic
+dtmfmode=auto
+
+; This is a test SIM provided with the BTS.
+[IMSI001010000000000]
+callerid=2100
+canreinvite=no
+type=friend
+context=sip-local
+host=dynamic
+
diff --git a/CLI/CLI.cpp b/CLI/CLI.cpp
new file mode 100644
index 0000000..0b9b383
--- /dev/null
+++ b/CLI/CLI.cpp
@@ -0,0 +1,768 @@
+/*
+* Copyright 2009, 2010 Free Software Foundation, Inc.
+* Copyright 2010 Kestrel Signal Processing, Inc.
+*
+* This software is distributed under the terms of the GNU Affero Public License.
+* See the COPYING file in the main directory for details.
+*
+* This use of this software may be subject to additional restrictions.
+* See the LEGAL file in the main directory for details.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+// #include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include "CLI.h"
+
+#undef WARNING
+
+using namespace std;
+using namespace CommandLine;
+
+#define SUCCESS 0
+#define BAD_NUM_ARGS 1
+#define BAD_VALUE 2
+#define NOT_FOUND 3
+#define TOO_MANY_ARGS 4
+#define FAILURE 5
+
+extern TransceiverManager gTRX;
+
+/** Standard responses in the CLI, much mach erorrCode enum. */
+static const char* standardResponses[] = {
+ "success", // 0
+ "wrong number of arguments", // 1
+ "bad argument(s)", // 2
+ "command not found", // 3
+ "too many arguments for parser", // 4
+ "command failed", // 5
+};
+
+
+
+
+int Parser::execute(char* line, ostream& os, istream& is) const
+{
+ // escape to the shell?
+ if (line[0]=='!') {
+ os << endl;
+ int retVal = system(line+1);
+ os << endl << "External call returned " << retVal << endl;
+ return SUCCESS;
+ }
+ // tokenize
+ char *argv[mMaxArgs];
+ int argc = 0;
+ char **ap;
+ // This is (almost) straight from the man page for strsep.
+ for (ap=argv; (*ap=strsep(&line," ")) != NULL; ) {
+ if (**ap != '\0') {
+ if (++ap >= &argv[mMaxArgs]) break;
+ else argc++;
+ }
+ }
+ // Blank line?
+ if (!argc) return SUCCESS;
+ // Find the command.
+ ParseTable::const_iterator cfp = mParseTable.find(argv[0]);
+ if (cfp == mParseTable.end()) {
+ return NOT_FOUND;
+ }
+ int (*func)(int,char**,ostream&,istream&);
+ func = cfp->second;
+ // Do it.
+ int retVal = (*func)(argc,argv,os,is);
+ // Give hint on bad # args.
+ if (retVal==BAD_NUM_ARGS) os << help(argv[0]) << endl;
+ return retVal;
+}
+
+
+int Parser::process(const char* line, ostream& os, istream& is) const
+{
+ char *newLine = strdup(line);
+ int retVal = execute(newLine,os,is);
+ free(newLine);
+ if (retVal>0) os << standardResponses[retVal] << endl;
+ return retVal;
+}
+
+
+const char * Parser::help(const string& cmd) const
+{
+ HelpTable::const_iterator hp = mHelpTable.find(cmd);
+ if (hp==mHelpTable.end()) return "no help available";
+ return hp->second.c_str();
+}
+
+
+
+/**@name Commands for the CLI. */
+//@{
+
+// forward refs
+int printStats(int argc, char** argv, ostream& os, istream& is);
+
+/*
+ A CLI command takes the argument in an array.
+ It returns 0 on success.
+*/
+
+/** Display system uptime and current GSM frame number. */
+int uptime(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc!=1) return BAD_NUM_ARGS;
+ os.precision(2);
+ os << "Unix time " << time(NULL) << endl;
+ int seconds = gBTS.uptime();
+ if (seconds<120) {
+ os << "uptime " << seconds << " seconds, frame " << gBTS.time() << endl;
+ return SUCCESS;
+ }
+ float minutes = seconds / 60.0F;
+ if (minutes<120) {
+ os << "uptime " << minutes << " minutes, frame " << gBTS.time() << endl;
+ return SUCCESS;
+ }
+ float hours = minutes / 60.0F;
+ if (hours<48) {
+ os << "uptime " << hours << " hours, frame " << gBTS.time() << endl;
+ return SUCCESS;
+ }
+ float days = hours / 24.0F;
+ os << "uptime " << days << " days, frame " << gBTS.time() << endl;
+ return SUCCESS;
+}
+
+
+/** Give a list of available commands or describe a specific command. */
+int showHelp(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc==2) {
+ os << argv[1] << " " << gParser.help(argv[1]) << endl;
+ return SUCCESS;
+ }
+ if (argc!=1) return BAD_NUM_ARGS;
+ ParseTable::const_iterator cp = gParser.begin();
+ os << endl << "Type \"help\" followed by the command name for help on that command." << endl << endl;
+ int c=0;
+ const int cols = 3;
+ while (cp != gParser.end()) {
+ const string& wd = cp->first;
+ os << wd << '\t';
+ if (wd.size()<8) os << '\t';
+ ++cp;
+ c++;
+ if (c%cols==0) os << endl;
+ }
+ if (c%cols!=0) os << endl;
+ os << endl << "Lines starting with '!' are escaped to the shell." << endl;
+ os << endl << "Use , to detach from \"screen\", *not* ." << endl << endl;
+ return SUCCESS;
+}
+
+
+
+/** A function to return -1, the exit code for the caller. */
+int exit_function(int argc, char** argv, ostream& os, istream& is)
+{
+ unsigned wait =0;
+ if (argc>2) return BAD_NUM_ARGS;
+ if (argc==2) wait = atoi(argv[1]);
+
+ if (wait!=0)
+ os << "waiting up to " << wait << " seconds for clearing of "
+ << gBTS.TCHActive() << " active calls" << endl;
+
+ // Block creation of new channels.
+ gBTS.hold(true);
+ // Wait up to the timeout for active channels to release.
+ time_t finish = time(NULL) + wait;
+ while (time(NULL)0) {
+ LOG(WARNING) << "dropping " << gBTS.SDCCHActive() << " control transactions on exit";
+ loads = true;
+ }
+ if (gBTS.TCHActive()>0) {
+ LOG(WARNING) << "dropping " << gBTS.TCHActive() << " calls on exit";
+ loads = true;
+ }
+ if (loads) {
+ os << endl << "exiting with loads:" << endl;
+ printStats(1,NULL,os,is);
+ }
+ os << endl << "exiting..." << endl;
+ return -1;
+}
+
+
+
+// Forward ref.
+int tmsis(int argc, char** argv, ostream& os, istream& is);
+
+/** Dump TMSI table to a text file. */
+int dumpTMSIs(const char* filename, istream& is)
+{
+ ofstream fileout;
+ fileout.open(filename, ios::out); // erases existing!
+ // FIXME -- Check that the file really opened.
+ // Fake an argument list to call printTMSIs.
+ char* subargv[] = {"tmsis", NULL};
+ int subargc = 1;
+ return tmsis(subargc, subargv, fileout, is);
+}
+
+
+
+
+/** Print or clear the TMSI table. */
+int tmsis(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc>=2) {
+ // Clear?
+ if (strcmp(argv[1],"clear")==0) {
+ if (argc!=2) return BAD_NUM_ARGS;
+ os << "clearing TMSI table" << endl;
+ gTMSITable.clear();
+ return SUCCESS;
+ }
+ // Dump?
+ if (strcmp(argv[1],"dump")==0) {
+ if (argc!=3) return BAD_NUM_ARGS;
+ os << "dumping TMSI table to " << argv[2] << endl;
+ return dumpTMSIs(argv[2],is);
+ }
+ return BAD_VALUE;
+ }
+
+ if (argc!=1) return BAD_NUM_ARGS;
+ os << "TMSI IMSI age used" << endl;
+ gTMSITable.dump(os);
+ return SUCCESS;
+}
+
+
+/** Submit an SMS for delivery to an IMSI. */
+int sendsimple(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc!=3) return BAD_NUM_ARGS;
+
+ os << "enter text to send: ";
+ char txtBuf[161];
+ cin.getline(txtBuf,160,'\n');
+ char *IMSI = argv[1];
+ char *srcAddr = argv[2];
+
+ static UDPSocket sock(0,"127.0.0.1",gConfig.getNum("SIP.Local.Port"));
+
+ static const char form[] =
+ "MESSAGE sip:IMSI%s@127.0.0.1 SIP/2.0\n"
+ "Via: SIP/2.0/TCP 127.0.0.1;branch=%x\n"
+ "Max-Forwards: 2\n"
+ "From: %s ;tag=%d\n"
+ "To: sip:IMSI%s@127.0.0.1\n"
+ "Call-ID: %x@127.0.0.1:%d\n"
+ "CSeq: 1 MESSAGE\n"
+ "Content-Type: text/plain\nContent-Length: %u\n"
+ "\n%s\n";
+ static char buffer[1500];
+ snprintf(buffer,1499,form,
+ IMSI, (unsigned)random(), srcAddr,srcAddr,sock.port(),(unsigned)random(), IMSI, (unsigned)random(),sock.port(), strlen(txtBuf), txtBuf);
+ sock.write(buffer);
+
+
+#if 0
+ int numRead = sock.read(buffer,10000);
+ if (numRead>=0) {
+ buffer[numRead]='\0';
+ os << "response: " << buffer << endl;
+ } else {
+ os << "timed out waiting for response";
+ }
+#endif
+
+ return SUCCESS;
+}
+
+
+/** Submit an SMS for delivery to an IMSI. */
+int sendsms(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc!=3) return BAD_NUM_ARGS;
+
+ os << "enter text to send: ";
+ char txtBuf[161];
+ cin.getline(txtBuf,160,'\n');
+ char *IMSI = argv[1];
+ char *srcAddr = argv[2];
+
+ Control::TransactionEntry *transaction = new Control::TransactionEntry(
+ gConfig.getStr("SIP.Proxy.SMS").c_str(),
+ GSM::L3MobileIdentity(IMSI),
+ NULL,
+ GSM::L3CMServiceType::MobileTerminatedShortMessage,
+ GSM::L3CallingPartyBCDNumber(srcAddr),
+ GSM::Paging,
+ txtBuf);
+ transaction->messageType("text/plain");
+ Control::initiateMTTransaction(transaction,GSM::SDCCHType,30000);
+ os << "message submitted for delivery" << endl;
+ return SUCCESS;
+}
+
+/** DEBUGGING: Sends a special sms that triggers a RRLP message to an IMSI. */
+int sendrrlp(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc!=3) return BAD_NUM_ARGS;
+
+ char *IMSI = argv[1];
+
+ UDPSocket sock(0,"127.0.0.1",gConfig.getNum("SIP.Local.Port"));
+ unsigned port = sock.port();
+ unsigned callID = random();
+
+ // Just fake out a SIP message.
+ const char form[] = "MESSAGE sip:IMSI%s@localhost SIP/2.0\nVia: SIP/2.0/TCP localhost;branch=z9hG4bK776sgdkse\nMax-Forwards: 2\nFrom: RRLP@localhost:%d;tag=49583\nTo: sip:IMSI%s@localhost\nCall-ID: %d@127.0.0.1:5063\nCSeq: 1 MESSAGE\nContent-Type: text/plain\nContent-Length: %lu\n\n%s\n";
+
+ char txtBuf[161];
+ snprintf(txtBuf,160,"RRLP%s",argv[2]);
+ char outbuf[1500];
+ snprintf(outbuf,1499,form,IMSI,port,IMSI,callID,strlen(txtBuf),txtBuf);
+ sock.write(outbuf);
+ sleep(2);
+ sock.write(outbuf);
+ sock.close();
+ os << "RRLP Triggering message submitted for delivery" << endl;
+
+ return SUCCESS;
+}
+
+
+
+/** Print current usage loads. */
+int printStats(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc!=1) return BAD_NUM_ARGS;
+ os << "SDCCH load: " << gBTS.SDCCHActive() << '/' << gBTS.SDCCHTotal() << endl;
+ os << "TCH/F load: " << gBTS.TCHActive() << '/' << gBTS.TCHTotal() << endl;
+ os << "AGCH/PCH load: " << gBTS.AGCHLoad() << ',' << gBTS.PCHLoad() << endl;
+ // paging table size
+ os << "Paging table size: " << gBTS.pager().pagingEntryListSize() << endl;
+ os << "Transactions: " << gTransactionTable.size() << endl;
+ // 3122 timer current value (the number of seconds an MS should hold off the next RACH)
+ os << "T3122: " << gBTS.T3122() << " ms" << endl;
+ return SUCCESS;
+}
+
+
+
+/** Get/Set MCC, MNC, LAC, CI. */
+int cellID(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc==1) {
+ os << "MCC=" << gConfig.getStr("GSM.Identity.MCC")
+ << " MNC=" << gConfig.getStr("GSM.Identity.MNC")
+ << " LAC=" << gConfig.getNum("GSM.Identity.LAC")
+ << " CI=" << gConfig.getNum("GSM.Identity.CI")
+ << endl;
+ return SUCCESS;
+ }
+
+ if (argc!=5) return BAD_NUM_ARGS;
+
+ // Safety check the args!!
+ char* MCC = argv[1];
+ char* MNC = argv[2];
+ if (strlen(MCC)!=3) {
+ os << "MCC must be three digits" << endl;
+ return BAD_VALUE;
+ }
+ int MNCLen = strlen(MNC);
+ if ((MNCLen<2)||(MNCLen>3)) {
+ os << "MNC must be two or three digits" << endl;
+ return BAD_VALUE;
+ }
+ gTMSITable.clear();
+ gConfig.set("GSM.Identity.MCC",MCC);
+ gConfig.set("GSM.Identity.MNC",MNC);
+ gConfig.set("GSM.Identity.LAC",argv[3]);
+ gConfig.set("GSM.Identity.CI",argv[4]);
+ return SUCCESS;
+}
+
+
+
+
+/** Print table of current transactions. */
+int calls(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc!=1) return BAD_NUM_ARGS;
+ size_t count = gTransactionTable.dump(os);
+ os << endl << count << " transactions in table" << endl;
+ return SUCCESS;
+}
+
+
+
+/** Print or modify the global configuration table. */
+int config(int argc, char** argv, ostream& os, istream& is)
+{
+ // no args, just print
+ if (argc==1) {
+ gConfig.find("",os);
+ return SUCCESS;
+ }
+
+ // one arg, pattern match and print
+ if (argc==2) {
+ gConfig.find(argv[1],os);
+ return SUCCESS;
+ }
+
+ // >1 args: set new value
+ string val;
+ for (int i=2; i3) return BAD_NUM_ARGS;
+
+ unsigned newT3212 = strtol(argv[1],NULL,10);
+ if ((newT3212<6)||(newT3212>1530)) {
+ os << "valid T3212 range is 6..1530 minutes" << endl;
+ return BAD_VALUE;
+ }
+
+ // By defuault, make SIP registration period 1.5x the GSM registration period.
+ unsigned SIPRegPeriod = newT3212*90;
+ if (argc==3) {
+ SIPRegPeriod = 60*strtol(argv[2],NULL,10);
+ }
+
+ // Set the values in the table and on the GSM beacon.
+ gConfig.set("SIP.RegistrationPeriod",SIPRegPeriod);
+ gConfig.set("GSM.Timer.T3212",newT3212);
+ // Done.
+ return SUCCESS;
+}
+
+
+/** Print the list of alarms kept by the logger, i.e. the last LOG(ALARM) << */
+int alarms(int argc, char** argv, ostream& os, istream& is)
+{
+ std::ostream_iterator output( os, "\n" );
+ std::list alarms = gGetLoggerAlarms();
+ std::copy( alarms.begin(), alarms.end(), output );
+ return SUCCESS;
+}
+
+
+/** Version string. */
+int version(int argc, char **argv, ostream& os, istream& is)
+{
+ if (argc!=1) return BAD_NUM_ARGS;
+ os << "release " VERSION " built " __DATE__ << endl;
+ return SUCCESS;
+}
+
+/** Show start-up notices. */
+int notices(int argc, char **argv, ostream& os, istream& is)
+{
+ if (argc!=1) return BAD_NUM_ARGS;
+ os << endl << gOpenBTSWelcome << endl;
+ return SUCCESS;
+}
+
+int page(int argc, char **argv, ostream& os, istream& is)
+{
+ if (argc==1) {
+ gBTS.pager().dump(os);
+ return SUCCESS;
+ }
+ if (argc!=3) return BAD_NUM_ARGS;
+ char *IMSI = argv[1];
+ if (strlen(IMSI)>15) {
+ os << IMSI << " is not a valid IMSI" << endl;
+ return BAD_VALUE;
+ }
+ Control::TransactionEntry dummy(
+ gConfig.getStr("SIP.Proxy.SMS").c_str(),
+ GSM::L3MobileIdentity(IMSI),
+ NULL,
+ GSM::L3CMServiceType::UndefinedType,
+ GSM::L3CallingPartyBCDNumber("0"),
+ GSM::Paging);
+ gBTS.pager().addID(GSM::L3MobileIdentity(IMSI),GSM::SDCCHType,dummy,1000*atoi(argv[2]));
+ return SUCCESS;
+}
+
+
+
+int endcall(int argc, char **argv, ostream& os, istream& is)
+{
+ if (argc!=2) return BAD_NUM_ARGS;
+ unsigned transID = atoi(argv[1]);
+ Control::TransactionEntry* target = gTransactionTable.find(transID);
+ if (!target) {
+ os << transID << " not found in table";
+ return BAD_VALUE;
+ }
+ target->terminate();
+ return SUCCESS;
+}
+
+
+
+
+void printChanInfo(unsigned transID, const GSM::LogicalChannel* chan, ostream& os)
+{
+ os << setw(2) << chan->CN() << " " << chan->TN();
+ os << " " << setw(8) << chan->typeAndOffset();
+ os << " " << setw(12) << transID;
+ char buffer[200];
+ snprintf(buffer,199,"%5.2f %4d %5d %4d",
+ 100.0*chan->FER(), (int)round(chan->RSSI()),
+ chan->actualMSPower(), chan->actualMSTiming());
+ os << " " << buffer;
+ const GSM::L3MeasurementResults& meas = chan->SACCH()->measurementResults();
+ if (!meas.MEAS_VALID()) {
+ snprintf(buffer,199,"%5d %5.2f",
+ meas.RXLEV_FULL_SERVING_CELL_dBm(),
+ 100.0*meas.RXQUAL_FULL_SERVING_CELL_BER());
+ os << " " << buffer;
+ } else {
+ os << " ----- ------";
+ }
+ os << endl;
+}
+
+
+
+int chans(int argc, char **argv, ostream& os, istream& is)
+{
+ if (argc!=1) return BAD_NUM_ARGS;
+
+ os << "CN TN chan transaction UPFER RSSI TXPWR TXTA DNLEV DNBER" << endl;
+ os << "CN TN type id pct dB dBm sym dBm pct" << endl;
+
+ //gPhysStatus.dump(os);
+ //os << endl << "Old data reporting: " << endl;
+
+ // SDCCHs
+ GSM::SDCCHList::const_iterator sChanItr = gBTS.SDCCHPool().begin();
+ while (sChanItr != gBTS.SDCCHPool().end()) {
+ const GSM::SDCCHLogicalChannel* sChan = *sChanItr;
+ if (sChan->active()) {
+ Control::TransactionEntry *trans = gTransactionTable.find(sChan);
+ if (trans) printChanInfo(trans->ID(),sChan,os);
+ else printChanInfo(0,sChan,os);
+ }
+ ++sChanItr;
+ }
+
+ // TCHs
+ GSM::TCHList::const_iterator tChanItr = gBTS.TCHPool().begin();
+ while (tChanItr != gBTS.TCHPool().end()) {
+ const GSM::TCHFACCHLogicalChannel* tChan = *tChanItr;
+ if (tChan->active()) {
+ Control::TransactionEntry *trans = gTransactionTable.find(tChan);
+ if (trans) printChanInfo(trans->ID(),tChan,os);
+ else printChanInfo(0,tChan,os);
+ }
+ ++tChanItr;
+ }
+
+ os << endl;
+
+ return SUCCESS;
+}
+
+
+
+
+int power(int argc, char **argv, ostream& os, istream& is)
+{
+ os << "current downlink power " << gBTS.powerManager().power() << " dB wrt full scale" << endl;
+ os << "current attenuation bounds "
+ << gConfig.getNum("GSM.Radio.PowerManager.MinAttenDB")
+ << " to "
+ << gConfig.getNum("GSM.Radio.PowerManager.MaxAttenDB")
+ << " dB" << endl;
+
+ if (argc==1) return SUCCESS;
+ if (argc!=3) return BAD_NUM_ARGS;
+
+ int min = atoi(argv[1]);
+ int max = atoi(argv[2]);
+ if (min>max) return BAD_VALUE;
+
+ gConfig.set("GSM.Radio.PowerManager.MinAttenDB",argv[1]);
+ gConfig.set("GSM.Radio.PowerManager.MaxAttenDB",argv[2]);
+
+ os << "new attenuation bounds "
+ << gConfig.getNum("GSM.Radio.PowerManager.MinAttenDB")
+ << " to "
+ << gConfig.getNum("GSM.Radio.PowerManager.MaxAttenDB")
+ << " dB" << endl;
+
+ return SUCCESS;
+}
+
+
+int rxgain(int argc, char** argv, ostream& os, istream& is)
+{
+ os << "current RX gain is " << gConfig.getNum("GSM.Radio.RxGain") << " dB" << endl;
+ if (argc==1) return SUCCESS;
+ if (argc!=2) return BAD_NUM_ARGS;
+
+ int newGain = gTRX.ARFCN()->setRxGain(atoi(argv[1]));
+ os << "new RX gain is " << newGain << " dB" << endl;
+
+ gConfig.set("GSM.Radio.RxGain",newGain);
+
+ return SUCCESS;
+}
+
+int noise(int argc, char** argv, ostream& os, istream& is)
+{
+ if (argc!=1) return BAD_NUM_ARGS;
+
+ int noise = gTRX.ARFCN()->getNoiseLevel();
+ os << "noise RSSI is -" << noise << " dB wrt full scale" << endl;
+ os << "MS RSSI target is " << gConfig.getNum("GSM.Radio.RSSITarget") << " dB wrt full scale" << endl;
+
+ return SUCCESS;
+}
+
+
+//@} // CLI commands
+
+
+
+Parser::Parser()
+{
+ // The constructor adds the commands.
+ addCommand("uptime", uptime, "-- show BTS uptime and BTS frame number.");
+ addCommand("help", showHelp, "[command] -- list available commands or gets help on a specific command.");
+ addCommand("exit", exit_function, "[wait] -- exit the application, either immediately, or waiting for existing calls to clear with a timeout in seconds");
+ addCommand("tmsis", tmsis, "[\"clear\"] or [\"dump\" filename] -- print/clear the TMSI table or dump it to a file.");
+ addCommand("sendsms", sendsms, " -- send direct SMS to , addressed from , after prompting.");
+ addCommand("sendsimple", sendsimple, " -- send SMS to via SIP interface, addressed from , after prompting.");
+ addCommand("sendrrlp", sendrrlp, " -- send RRLP message to .");
+ addCommand("load", printStats, "-- print the current activity loads.");
+ addCommand("cellid", cellID, "[MCC MNC LAC CI] -- get/set location area identity (MCC, MNC, LAC) and cell ID (CI)");
+ addCommand("calls", calls, "-- print the transaction table");
+ addCommand("config", config, "[] OR [patt] OR [key val(s)] -- print the current configuration, print configuration values matching a pattern, or set/change a configuration value");
+ addCommand("configsave", configsave, " -- write the current configuration to a file");
+ addCommand("regperiod", regperiod, "[GSM] [SIP] -- get/set the registration period (GSM T3212), in MINUTES");
+ addCommand("alarms", alarms, "-- show latest alarms");
+ addCommand("version", version,"-- print the version string");
+ addCommand("page", page, "[IMSI time] -- dump the paging table or page the given IMSI for the given period");
+ addCommand("chans", chans, "-- report PHY status for active channels");
+ addCommand("power", power, "[minAtten maxAtten] -- report current attentuation or set min/max bounds");
+ addCommand("rxgain", rxgain, "[newRxgain] -- get/set the RX gain in dB");
+ addCommand("noise", noise, "-- report receive noise level in RSSI dB");
+ addCommand("unconfig", unconfig, "key -- remove a config value");
+ addCommand("notices", notices, "-- show startup copyright and legal notices");
+ addCommand("endcall", endcall,"trans# -- terminate the given transaction");
+}
+
+
+
+
+// vim: ts=4 sw=4
diff --git a/CLI/CLI.h b/CLI/CLI.h
new file mode 100644
index 0000000..70a6873
--- /dev/null
+++ b/CLI/CLI.h
@@ -0,0 +1,76 @@
+/*
+* Copyright 2009 Free Software Foundation, Inc.
+*
+* This software is distributed under multiple licenses; see the COPYING file in the main directory for licensing information for this specific distribuion.
+*
+* This use of this software may be subject to additional restrictions.
+* See the LEGAL file in the main directory for details.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+*/
+
+
+#ifndef OPENBTSCLI_H
+#define OPENBTSCLI_H
+
+#include
+#include