sync of openbts

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6168 19bc5d8c-e614-43d4-8b26-e1612bc8e597
This commit is contained in:
Kurtis Heimerl
2013-08-14 00:52:14 +00:00
parent 1baba59e14
commit 5289a229d9
219 changed files with 42413 additions and 4213 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -21,21 +21,26 @@
include $(top_srcdir)/Makefile.common
AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES) $(OPENBTS_CPPFLAGS)
AM_CXXFLAGS = -Wall -pthread -ldl $(OPENBTS_CXXFLAGS)
DESTDIR :=
DESTDIR =
# These variables are defined in ../Makefile.common
# AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES)
# AM_CXXFLAGS = -Wall -ldl -pthread
noinst_PROGRAMS = \
OpenBTS \
OpenBTSDo \
OpenBTSCLI
OpenBTS_SOURCES = OpenBTS.cpp
OpenBTS_LDADD = \
OpenBTS_SOURCES = OpenBTS.cpp GetConfigurationKeys.cpp
OpenBTS_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES)
ourlibs = \
$(CLI_LA) \
$(SIP_LA) \
$(GSM_LA) \
$(GPRS_LA) \
$(SGSNGGSN_LA) \
$(TRX_LA) \
$(GLOBALS_LA) \
$(CONTROL_LA) \
@@ -43,14 +48,25 @@ OpenBTS_LDADD = \
$(COMMON_LA) \
$(SQLITE_LA) \
$(SMS_LA) \
$(PEERING_LA) \
$(OSIP_LIBS) \
$(ORTP_LIBS)
OpenBTS_LDADD = $(ourlibs) -ldl -losipparser2 -losip2 -lortp -la53
OpenBTSCLI_SOURCES = OpenBTSCLI.cpp
# RedHat RHEL5 needs to have ncurses included
OpenBTSCLI_LDADD = -lreadline -lncurses
OpenBTSDo_SOURCES = OpenBTSDo.cpp
EXTRA_DIST = \
OpenBTS.example.sql
OpenBTS.example.sql \
setUpFiles.sh \
generateConfigTable.sh \
exportConfigTable.sh \
importConfigTable.sh \
generateKeys.sh \
verifyKey.sh
install: OpenBTS OpenBTSCLI OpenBTSDo
mkdir -p "$(DESTDIR)/OpenBTS/"
@@ -58,4 +74,13 @@ install: OpenBTS OpenBTSCLI OpenBTSDo
install OpenBTSCLI "$(DESTDIR)/OpenBTS/"
install OpenBTSDo "$(DESTDIR)/OpenBTS/"
mkdir -p "$(DESTDIR)/etc/OpenBTS/"
install iptables.rules "$(DESTDIR)/etc/OpenBTS/"
install OpenBTS.example.sql "$(DESTDIR)/etc/OpenBTS/"
mkdir -p "$(DESTDIR)/etc/rsyslog.d/"
mkdir -p "$(DESTDIR)/etc/logrotate.d/"
install rsyslogd.OpenBTS.conf "$(DESTDIR)/etc/rsyslog.d/OpenBTS.conf"
install OpenBTS.logrotate "$(DESTDIR)/etc/logrotate.d/OpenBTS"
mkdir -p "$(DESTDIR)/home/openbts/"
install CLI "$(DESTDIR)/home/openbts/"
install openbtsconfig "$(DESTDIR)/home/openbts/"

View File

@@ -1,35 +1,33 @@
/*
* Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
* Copyright 2010 Kestrel Signal Processing, Inc.
* Copyright 2011,2012 Range Networks, Inc.
* Copyright 2011, 2012 Range Networks, 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 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 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 <http://www.gnu.org/licenses/>.
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.
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <Configuration.h>
std::vector<std::string> configurationCrossCheck(const std::string& key);
static const char *cOpenBTSConfigEnv = "OpenBTSConfigFile";
// Load configuration from a file.
ConfigurationTable gConfig("/etc/OpenBTS/OpenBTS.db");
ConfigurationTable gConfig(getenv(cOpenBTSConfigEnv)?getenv(cOpenBTSConfigEnv):"/etc/OpenBTS/OpenBTS.db","OpenBTS", getConfigurationKeys());
#include <Logger.h>
Log dummy("openbts",gConfig.getStr("Log.Level").c_str(),LOG_LOCAL7);
// Set up the performance reporter.
#include <Reporting.h>
@@ -48,12 +46,13 @@ ReportingTable gReports(gConfig.getStr("Control.Reporting.StatsTable").c_str());
#include <SIPInterface.h>
#include <Globals.h>
#include <Logger.h>
#include <CLI.h>
#include <PowerManager.h>
#include <Configuration.h>
#include <PhysicalStatus.h>
#include <SubscriberRegistry.h>
#include "NeighborTable.h"
#include <Peering.h>
#include <sys/wait.h>
@@ -62,9 +61,16 @@ ReportingTable gReports(gConfig.getStr("Control.Reporting.StatsTable").c_str());
#include <string.h>
#include <signal.h>
// (pat) mcheck.h is for mtrace, which permits memory leak detection.
// Set env MALLOC_TRACE=logfilename
// Call mtrace() in the program.
// post-process the logfilename with mtrace (a perl script.)
// #include <mcheck.h>
using namespace std;
using namespace GSM;
int gBtsXg = 0; // Enable gprs
const char* gDateTime = __DATE__ " " __TIME__;
@@ -88,12 +94,24 @@ SIP::SIPInterface gSIPInterface;
// So don't create this until AFTER loading the config file.
GSMConfig gBTS;
// Note to all from pat:
// It is inadvisable to statically initialize any non-trivial entity here because
// the underlying dependencies may not yet have undergone their static initialization.
// For example, if any of these throw an alarm, the system will crash because
// the Logger may not have been initialized yet.
// Our interface to the software-defined radio.
TransceiverManager gTRX(gConfig.getNum("GSM.Radio.ARFCNs"), gConfig.getStr("TRX.IP").c_str(), gConfig.getNum("TRX.Port"));
// Subscriber registry
// Subscriber registry and http authentication
SubscriberRegistry gSubscriberRegistry;
/** The global peering interface. */
Peering::PeerInterface gPeerInterface;
/** The global neighbor table. */
Peering::NeighborTable gNeighborTable;
/** Define a function to call any time the configuration database changes. */
void purgeConfig(void*,int,char const*, char const*, sqlite3_int64)
@@ -101,6 +119,7 @@ void purgeConfig(void*,int,char const*, char const*, sqlite3_int64)
LOG(INFO) << "purging configuration cache";
gConfig.purge();
gBTS.regenerateBeacon();
gResetWatchdog();
}
@@ -116,14 +135,14 @@ void startTransceiver()
// Start the transceiver binary, if the path is defined.
// If the path is not defined, the transceiver must be started by some other process.
char TRXnumARFCN[16];
sprintf(TRXnumARFCN,"%1d", static_cast<int>(gConfig.getNum("GSM.Radio.ARFCNs")));
char TRXnumARFCN[4];
sprintf(TRXnumARFCN,"%1d",(int)gConfig.getNum("GSM.Radio.ARFCNs"));
LOG(NOTICE) << "starting transceiver " << transceiverPath << " " << TRXnumARFCN;
gTransceiverPid = vfork();
LOG_ASSERT(gTransceiverPid>=0);
if (gTransceiverPid==0) {
// Pid==0 means this is the process that starts the transceiver.
execlp(transceiverPath,transceiverPath,TRXnumARFCN,NULL);
execlp(transceiverPath,transceiverPath,TRXnumARFCN,(void*)NULL);
LOG(EMERG) << "cannot find " << transceiverPath;
_exit(1);
} else {
@@ -142,8 +161,6 @@ void createStats()
// count of OpenBTS start events
gReports.create("OpenBTS.Starts");
// count of exit events driven from the CLI
gReports.create("OpenBTS.Exit.Normal.CLI");
// count of watchdog restarts
gReports.create("OpenBTS.Exit.Error.Watchdog");
// count of aborts due to problems with CLI socket
@@ -218,8 +235,6 @@ void createStats()
//gReports.create("OpenBTS.GSM.MM.TMSI.Unknown");
// count of CM Service requests for MOC
gReports.create("OpenBTS.GSM.MM.CMServiceRequest.MOC");
// count of CM Service requests for emergency calls
gReports.create("OpenBTS.GSM.MM.CMServiceRequest.SOS");
// count of CM Service requests for MOSMS
gReports.create("OpenBTS.GSM.MM.CMServiceRequest.MOSMS");
// count of CM Service requests for services we don't support
@@ -244,6 +259,8 @@ void createStats()
gReports.create("OpenBTS.GSM.CC.MOD.Disconnect");
// total number of minutes of carried calls
gReports.create("OpenBTS.GSM.CC.CallMinutes");
// count of dropped calls
gReports.create("OpenBTS.GSM.CC.DroppedCalls");
// count of CS (non-GPRS) channel assignments
gReports.create("OpenBTS.GSM.RR.ChannelAssignment");
@@ -270,6 +287,14 @@ void createStats()
//gReports.create("OpenBTS.TRX.Command.Failed");
//gReports.create("OpenBTS.TRX.FailedStart");
//gReports.create("OpenBTS.TRX.LostLink");
// GPRS
// number of RACH bursts processed for GPRS
gReports.create("GPRS.RACH");
// number of TBFs assigned
gReports.create("GPRS.TBF");
// number of MSInfo records generated
gReports.create("GPRS.MSInfo");
}
@@ -277,22 +302,58 @@ void createStats()
int main(int argc, char *argv[])
{
// mtrace(); // Enable memory leak detection. Unfortunately, huge amounts of code have been started in the constructors above.
// TODO: Properly parse and handle any arguments
if (argc > 1) {
for (int argi = 0; argi < argc; argi++) {
for (int argi = 1; argi < argc; argi++) { // Skip argv[0] which is the program name.
if (!strcmp(argv[argi], "--version") ||
!strcmp(argv[argi], "-v")) {
cout << gVersionString << endl;
continue;
}
if (!strcmp(argv[argi], "--gensql")) {
cout << gConfig.getDefaultSQL(string(argv[0]), gVersionString) << endl;
continue;
}
if (!strcmp(argv[argi], "--gentex")) {
cout << gConfig.getTeX(string(argv[0]), gVersionString) << endl;
continue;
}
// (pat) Adding support for specified sql file.
// Unfortunately, the Config table was inited quite some time ago,
// so stick this arg in the environment, whence the ConfigurationTable can find it, and then reboot.
if (!strcmp(argv[argi],"--config")) {
if (++argi == argc) {
LOG(ALERT) <<"Missing argument to -sql option";
exit(2);
}
setenv(cOpenBTSConfigEnv,argv[argi],1);
execl(argv[0],"OpenBTS",NULL);
LOG(ALERT) <<"execl failed? Exiting...";
exit(0);
}
if (!strcmp(argv[argi],"--help")) {
printf("OpenBTS [--version --gensql --genex] [--config file.db]\n");
printf("OpenBTS exiting...\n");
exit(0);
}
printf("OpenBTS: unrecognized argument: %s\nexiting...\n",argv[argi]);
}
return 0;
}
createStats();
gConfig.setCrossCheckHook(&configurationCrossCheck);
gReports.incr("OpenBTS.Starts");
gNeighborTable.NeighborTableInit(
gConfig.getStr("Peering.NeighborTable.Path").c_str());
int sock = socket(AF_UNIX,SOCK_DGRAM,0);
if (sock<0) {
perror("creating CLI datagram socket");
@@ -306,8 +367,7 @@ int main(int argc, char *argv[])
srandom(time(NULL));
gConfig.setUpdateHook(purgeConfig);
gLogInit("openbts",gConfig.getStr("Log.Level").c_str());
LOG(ALERT) << "OpenBTS starting, ver " << VERSION << " build date " << __DATE__;
LOG(ALERT) << "OpenBTS (re)starting, ver " << VERSION << " build date " << __DATE__;
COUT("\n\n" << gOpenBTSWelcome << "\n");
gTMSITable.open(gConfig.getStr("Control.Reporting.TMSITable").c_str());
@@ -323,7 +383,7 @@ int main(int argc, char *argv[])
// Start the transceiver interface.
LOG(INFO) << "checking transceiver";
//gTRX.ARFCN(0)->powerOn();
//sleep(gConfig.getNum("TRX.Timeout.Start",2));
//sleep(gConfig.getNum("TRX.Timeout.Start"));
bool haveTRX = gTRX.ARFCN(0)->powerOn(false);
Thread transceiverThread;
@@ -339,6 +399,34 @@ int main(int argc, char *argv[])
// Start the SIP interface.
gSIPInterface.start();
// Start the peer interface
gPeerInterface.start();
// Sync factory calibration as defaults from radio EEPROM
signed sdrsn = gTRX.ARFCN(0)->getFactoryCalibration("sdrsn");
if (sdrsn != 0 && sdrsn != 65535) {
signed val;
val = gTRX.ARFCN(0)->getFactoryCalibration("band");
if (gConfig.isValidValue("GSM.Radio.Band", val)) {
gConfig.mSchema["GSM.Radio.Band"].updateDefaultValue(val);
}
val = gTRX.ARFCN(0)->getFactoryCalibration("freq");
if (gConfig.isValidValue("TRX.RadioFrequencyOffset", val)) {
gConfig.mSchema["TRX.RadioFrequencyOffset"].updateDefaultValue(val);
}
val = gTRX.ARFCN(0)->getFactoryCalibration("rxgain");
if (gConfig.isValidValue("GSM.Radio.RxGain", val)) {
gConfig.mSchema["GSM.Radio.RxGain"].updateDefaultValue(val);
}
val = gTRX.ARFCN(0)->getFactoryCalibration("txgain");
if (gConfig.isValidValue("TRX.TxAttenOffset", val)) {
gConfig.mSchema["TRX.TxAttenOffset"].updateDefaultValue(val);
}
}
//
// Configure the radio.
@@ -428,12 +516,25 @@ int main(int argc, char *argv[])
SDCCHLogicalChannel(0,0,gSDCCH_4_3),
};
Thread C0T0SDCCHControlThread[4];
// Subchannel 2 used for CBCH if SMSCB enabled.
bool SMSCB = (gConfig.getStr("Control.SMSCB.Table").length() != 0);
CBCHLogicalChannel CBCH(gSDCCH_4_2);
Thread CBCHControlThread;
for (int i=0; i<4; i++) {
if (SMSCB && (i==2)) continue;
C0T0SDCCH[i].downstream(C0radio);
C0T0SDCCHControlThread[i].start((void*(*)(void*))Control::DCCHDispatcher,&C0T0SDCCH[i]);
C0T0SDCCH[i].open();
gBTS.addSDCCH(&C0T0SDCCH[i]);
}
// Install CBCH if used.
if (SMSCB) {
LOG(INFO) << "creating CBCH for SMSCB";
CBCH.downstream(C0radio);
CBCH.open();
gBTS.addCBCH(&CBCH);
CBCHControlThread.start((void*(*)(void*))Control::SMSCBSender,NULL);
}
//
@@ -443,7 +544,19 @@ int main(int argc, char *argv[])
// Count configured slots.
unsigned sCount = 1;
if (gConfig.defines("GSM.Channels.C1sFirst")) {
if (!gConfig.defines("GSM.Channels.NumC1s")) {
int numChan = numARFCNs*7;
LOG(CRIT) << "GSM.Channels.NumC1s not defined. Defaulting to " << numChan << ".";
gConfig.set("GSM.Channels.NumC1s",numChan);
}
if (!gConfig.defines("GSM.Channels.NumC7s")) {
int numChan = numARFCNs-1;
LOG(CRIT) << "GSM.Channels.NumC7s not defined. Defaulting to " << numChan << ".";
gConfig.set("GSM.Channels.NumC7s",numChan);
}
if (gConfig.getBool("GSM.Channels.C1sFirst")) {
// Create C-I slots.
for (int i=0; i<gConfig.getNum("GSM.Channels.NumC1s"); i++) {
gBTS.createCombinationI(gTRX,sCount/8,sCount%8);
@@ -457,7 +570,7 @@ int main(int argc, char *argv[])
sCount++;
}
if (!gConfig.defines("GSM.Channels.C1sFirst")) {
if (!gConfig.getBool("GSM.Channels.C1sFirst")) {
// Create C-I slots.
for (int i=0; i<gConfig.getNum("GSM.Channels.NumC1s"); i++) {
gBTS.createCombinationI(gTRX,sCount/8,sCount%8);
@@ -465,14 +578,17 @@ int main(int argc, char *argv[])
}
}
if (sCount<(numARFCNs*8)) {
LOG(CRIT) << "Only " << sCount << " timeslots configured in an " << numARFCNs << "-ARFCN system.";
}
// Set up idle filling on C0 as needed.
// Set up idle filling on C0 as needed for unconfigured slots..
while (sCount<8) {
gBTS.createCombination0(gTRX,sCount);
sCount++;
}
/*
/* (pat) See GSM 05.02 6.5.2 and 3.3.2.3
Note: The number of different paging subchannels on
the CCCH is:
@@ -499,17 +615,14 @@ int main(int argc, char *argv[])
gBTS.start();
cout << "\nsystem ready\n";
cout << "\nuse the OpenBTSCLI utility to access CLI\n";
LOG(INFO) << "system ready";
struct sockaddr_un cmdSockName;
cmdSockName.sun_family = AF_UNIX;
const char* sockpath = gConfig.getStr("CLI.SocketPath").c_str();
char rmcmd[strlen(sockpath)+5];
sprintf(rmcmd,"rm %s",sockpath);
sprintf(rmcmd,"rm -f %s",sockpath);
system(rmcmd);
strcpy(cmdSockName.sun_path,sockpath);
LOG(INFO) "binding CLI datagram socket at " << sockpath;
if (bind(sock, (struct sockaddr *) &cmdSockName, sizeof(struct sockaddr_un))) {
perror("binding name to cmd datagram socket");
LOG(ALERT) << "cannot bind socket for CLI at " << sockpath;
@@ -517,6 +630,10 @@ int main(int argc, char *argv[])
exit(1);
}
COUT("\nsystem ready\n");
COUT("\nuse the OpenBTSCLI utility to access CLI\n");
LOG(INFO) << "system ready";
while (1) {
char cmdbuf[1000];
struct sockaddr_un source;
@@ -536,7 +653,6 @@ int main(int argc, char *argv[])
}
// res<0 means to exit the application
if (res<0) break;
gReports.incr("OpenBTS.Exit.Normal.CLI");
}
} // try
@@ -551,4 +667,153 @@ int main(int argc, char *argv[])
}
/** Return warning strings about a potential conflicting value */
vector<string> configurationCrossCheck(const string& key) {
vector<string> warnings;
ostringstream warning;
// GSM.Timer.T3113 should equal SIP.Timer.B
if (key.compare("GSM.Timer.T3113") == 0 || key.compare("SIP.Timer.B") == 0) {
string gsm = gConfig.getStr("GSM.Timer.T3113");
string sip = gConfig.getStr("SIP.Timer.B");
if (gsm.compare(sip) != 0) {
warning << "GSM.Timer.T3113 (" << gsm << ") and SIP.Timer.B (" << sip << ") should usually have the same value";
warnings.push_back(warning.str());
warning.str(std::string());
}
// Control.VEA depends on GSM.CellSelection.NECI
} else if (key.compare("Control.VEA") == 0 || key.compare("GSM.CellSelection.NECI") == 0) {
if (gConfig.getBool("Control.VEA") && gConfig.getStr("GSM.CellSelection.NECI").compare("1") != 0) {
warning << "Control.VEA is enabled but will not be functional until GSM.CellSelection.NECI is set to \"1\"";
warnings.push_back(warning.str());
warning.str(std::string());
}
// GSM.Timer.T3212 should be a factor of six and shorter than SIP.RegistrationPeriod
} else if (key.compare("GSM.Timer.T3212") == 0 || key.compare("SIP.RegistrationPeriod") == 0) {
int gsm = gConfig.getNum("GSM.Timer.T3212");
int sip = gConfig.getNum("SIP.RegistrationPeriod");
if (key.compare("GSM.Timer.T3212") == 0 && gsm % 6) {
warning << "GSM.Timer.T3212 should be a factor of 6";
warnings.push_back(warning.str());
warning.str(std::string());
}
if (gsm >= sip) {
warning << "GSM.Timer.T3212 (" << gsm << ") should be shorter than SIP.RegistrationPeriod (" << sip << ")";
warnings.push_back(warning.str());
warning.str(std::string());
}
// GPRS.ChannelCodingControl.RSSI should normally be 10db more than GSM.Radio.RSSITarget
} else if (key.compare("GPRS.ChannelCodingControl.RSSI") == 0 || key.compare("GSM.Radio.RSSITarget") == 0) {
int gprs = gConfig.getNum("GPRS.ChannelCodingControl.RSSI");
int gsm = gConfig.getNum("GSM.Radio.RSSITarget");
if ((gprs - gsm) != 10) {
warning << "GPRS.ChannelCodingControl.RSSI (" << gprs << ") should normally be 10db higher than GSM.Radio.RSSITarget (" << gsm << ")";
warnings.push_back(warning.str());
warning.str(std::string());
}
// TODO : This NEEDS to be an error not a warning. OpenBTS will fail to start because of an assert if an invalid value is used.
// GSM.Radio.C0 needs to be inside the valid range of ARFCNs for GSM.Radio.Band
} else if (key.compare("GSM.Radio.C0") == 0 || key.compare("GSM.Radio.Band") == 0) {
int c0 = gConfig.getNum("GSM.Radio.C0");
string band = gConfig.getStr("GSM.Radio.Band");
string range;
if (band.compare("850") == 0 && (c0 < 128 || 251 < c0)) {
range = "128-251";
} else if (band.compare("900") == 0 && (c0 < 1 || 124 < c0)) {
range = "1-124";
} else if (band.compare("1800") == 0 && (c0 < 512 || 885 < c0)) {
range = "512-885";
} else if (band.compare("1900") == 0 && (c0 < 512 || 810 < c0)) {
range = "512-810";
}
if (range.length()) {
warning << "GSM.Radio.C0 (" << c0 << ") falls outside the valid range of ARFCNs " << range << " for GSM.Radio.Band (" << band << ")";
warnings.push_back(warning.str());
warning.str(std::string());
}
// SGSN.Timer.ImplicitDetach should be at least 240 seconds greater than SGSN.Timer.RAUpdate"
} else if (key.compare("SGSN.Timer.ImplicitDetach") == 0 || key.compare("SGSN.Timer.RAUpdate") == 0) {
int detach = gConfig.getNum("SGSN.Timer.ImplicitDetach");
int update = gConfig.getNum("SGSN.Timer.RAUpdate");
if ((detach - update) < 240) {
warning << "SGSN.Timer.ImplicitDetach (" << detach << ") should be at least 240 seconds greater than SGSN.Timer.RAUpdate (" << update << ")";
warnings.push_back(warning.str());
warning.str(std::string());
}
// Control.LUR.WhiteList depends on Control.WhiteListing.Message, Control.LUR.WhiteListing.RejectCause and Control.WhiteListing.ShortCode
} else if (key.compare("Control.LUR.WhiteList") == 0 || key.compare("Control.WhiteListing.Message") == 0 ||
key.compare("Control.LUR.WhiteListing.RejectCause") == 0 || key.compare("Control.WhiteListing.ShortCode") == 0) {
if (gConfig.getBool("Control.LUR.WhiteList")) {
if (!gConfig.getStr("Control.WhiteListing.Message").length()) {
warning << "Control.LUR.WhiteList is enabled but will not be functional until Control.WhiteListing.Message is set";
warnings.push_back(warning.str());
warning.str(std::string());
} else if (!gConfig.getStr("Control.LUR.WhiteListing.RejectCause").length()) {
warning << "Control.LUR.WhiteList is enabled but will not be functional until Control.WhiteListing.RejectCause is set";
warnings.push_back(warning.str());
warning.str(std::string());
} else if (!gConfig.getStr("Control.WhiteListing.ShortCode").length()) {
warning << "Control.LUR.WhiteList is enabled but will not be functional until Control.WhiteListing.ShortCode is set";
warnings.push_back(warning.str());
warning.str(std::string());
}
}
// GSM.CellSelection.NCCsPermitted needs to contain our own GSM.Identity.BSIC.NCC
} else if (key.compare("GSM.CellSelection.NCCsPermitted") == 0 || key.compare("GSM.Identity.BSIC.NCC") == 0) {
int ourNCCMask = gConfig.getNum("GSM.CellSelection.NCCsPermitted");
int NCCMaskBit = 1 << gConfig.getNum("GSM.Identity.BSIC.NCC");
if ((NCCMaskBit & ourNCCMask) == 0) {
warning << "GSM.CellSelection.NCCsPermitted is not set to a mask which contains the local network color code defined in GSM.Identity.BSIC.NCC. ";
warning << "Set GSM.CellSelection.NCCsPermitted to " << NCCMaskBit;
warnings.push_back(warning.str());
warning.str(std::string());
}
// Control.LUR.FailedRegistration.Message depends on Control.LUR.FailedRegistration.ShortCode
} else if (key.compare("Control.LUR.FailedRegistration.Message") == 0 || key.compare("Control.LUR.FailedRegistration.ShortCode") == 0) {
if (gConfig.getStr("Control.LUR.FailedRegistration.Message").length() && !gConfig.getStr("Control.LUR.FailedRegistration.ShortCode").length()) {
warning << "Control.LUR.FailedRegistration.Message is enabled but will not be functional until Control.LUR.FailedRegistration.ShortCode is set";
warnings.push_back(warning.str());
warning.str(std::string());
}
// Control.LUR.NormalRegistration.Message depends on Control.LUR.NormalRegistration.ShortCode
} else if (key.compare("Control.LUR.NormalRegistration.Message") == 0 || key.compare("Control.LUR.NormalRegistration.ShortCode") == 0) {
if (gConfig.getStr("Control.LUR.NormalRegistration.Message").length() && !gConfig.getStr("Control.LUR.NormalRegistration.ShortCode").length()) {
warning << "Control.LUR.NormalRegistration.Message is enabled but will not be functional until Control.LUR.NormalRegistration.ShortCode is set";
warnings.push_back(warning.str());
warning.str(std::string());
}
// Control.LUR.OpenRegistration depends on Control.LUR.OpenRegistration.ShortCode
} else if (key.compare("Control.LUR.OpenRegistration") == 0 || key.compare("Control.LUR.OpenRegistration.ShortCode") == 0) {
if (gConfig.getStr("Control.LUR.OpenRegistration").length() && !gConfig.getStr("Control.LUR.OpenRegistration.ShortCode").length()) {
warning << "Control.LUR.OpenRegistration is enabled but will not be functional until Control.LUR.OpenRegistration.ShortCode is set";
warnings.push_back(warning.str());
warning.str(std::string());
}
// TODO : SIP.SMSC is actually broken with the verification bits, no way to set value as null
// SIP.SMSC should normally be NULL if SMS.MIMIEType is "text/plain" and "smsc" if SMS.MIMEType is "application/vnd.3gpp".
} else if (key.compare("SMS.MIMEType") == 0 || key.compare("SIP.SMSC") == 0) {
string sms = gConfig.getStr("SMS.MIMEType");
string sip = gConfig.getStr("SIP.SMSC");
if (sms.compare("application/vnd.3gpp.sms") == 0 && sip.compare("smsc") != 0) {
warning << "SMS.MIMEType is set to \"application/vnc.3gpp.sms\", SIP.SMSC should usually be set to \"smsc\"";
warnings.push_back(warning.str());
warning.str(std::string());
}
}
return warnings;
}
// vim: ts=4 sw=4

View File

@@ -1,134 +1,234 @@
--
-- This file was generated using: ./OpenBTS --gensql
-- binary version: release TRUNK C built Jul 1 2013 rev5843
--
-- Future changes should not be put in this file directly but
-- rather in the program's ConfigurationKey schema.
--
PRAGMA foreign_keys=OFF;
PRAGMA journal_mode=WAL;
BEGIN TRANSACTION;
CREATE TABLE CONFIG ( KEYSTRING TEXT UNIQUE NOT NULL, VALUESTRING TEXT, STATIC INTEGER DEFAULT 0, OPTIONAL INTEGER DEFAULT 0, COMMENTS TEXT DEFAULT '');
CREATE TABLE IF NOT EXISTS CONFIG ( KEYSTRING TEXT UNIQUE NOT NULL, VALUESTRING TEXT, STATIC INTEGER DEFAULT 0, OPTIONAL INTEGER DEFAULT 0, COMMENTS TEXT DEFAULT '');
INSERT OR IGNORE INTO "CONFIG" VALUES('CLI.SocketPath','/var/run/command',0,0,'Path for Unix domain datagram socket used for the OpenBTS console interface.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Reporting.PhysStatusTable','/var/run/OpenBTSChannelTable.db',1,0,'File path for channel status reporting database. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Reporting.TransactionTable','/var/run/TransactionTable.db',1,0,'File path for transaction table database. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Reporting.StatsTable','/var/log/OpenBTSStats.db',1,0,'File path for statistics reporting database. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Reporting.TMSITable','/var/run/OpenBTSTMSITable.db',1,0,'File path for TMSITable database. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Call.QueryRRLP.Early',NULL,0,1,'If not NULL, query every MS for its location via RRLP during the setup of a call.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Call.QueryRRLP.Late',NULL,0,1,'If not NULL, query every MS for its location via RRLP during the teardown of a call.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.GSMTAP.TargetIP',NULL,0,1,'Target IP address for GSMTAP packets; the IP address of Wireshark, if you use it for GSM.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.AttachDetach',1,0,0,'Attach/detach flag. Set to 1 to use attach/detach procedure, 0 otherwise. This will make initial LUR more prompt. It will also cause an un-regstration if the handset powers off and really heavy LUR loads in areas with spotty coverage.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.FailedRegistration.Message','Your handset is not provisioned for this network. ',0,1,'If defined, send this text message, followed by the IMSI, to unprovisioned handsets that are denied registration.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.FailedRegistration.ShortCode','1000',0,1,'The return address for the failed registration message. If the message is defined, this must also be defined.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.NormalRegistration.Message',NULL,0,1,'If defined, send this text message, followed by the IMSI, to provisioned handsets when they attach on Um.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.NormalRegistration.ShortCode','0000',0,1,'The return address for the normal registration message. If the message is defined, this must also be defined.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.OpenRegistration',NULL,0,1,'If not NULL, allow unprovisioned handsets to attach in Um.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.OpenRegistration.Message','Welcome to the GSM test network. Your IMSI is ',0,1,'If defined, send this text message, followed by the IMSI, to unprovisioned handsets when they attach on Um due to open registration.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.OpenRegistration.ShortCode','101',0,1,'The return address for the open registration message. If the message is defined, this must also be defined.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.QueryClassmark',NULL,0,1,'If not NULL, query every MS for classmark during LUR.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.QueryIMEI',NULL,0,1,'If not NULL, query every MS for IMSI during LUR.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.QueryRRLP',NULL,0,1,'If not NULL, query every MS for its location via RRLP during LUR.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.SendTMSIs',NULL,0,1,'If not NULL, send new TMSI assignments to handsets that are allowed to attach.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Call.QueryRRLP.Early','0',0,0,'1=enabled, 0=disabled - Query every MS for its location via RRLP during the setup of a call.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Call.QueryRRLP.Late','0',0,0,'1=enabled, 0=disabled - Query every MS for its location via RRLP during the teardown of a call.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.GSMTAP.GPRS','0',0,0,'1=enabled, 0=disabled - Capture GPRS signaling and traffic at L1/L2 interface via GSMTAP.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.GSMTAP.GSM','0',0,0,'1=enabled, 0=disabled - Capture GSM signaling at L1/L2 interface via GSMTAP.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.GSMTAP.TargetIP','127.0.0.1',0,0,'Target IP address for GSMTAP packets; the IP address of Wireshark, if you use it for real time traces.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.AttachDetach','1',0,0,'1=enabled, 0=disabled - Use attach/detach procedure. This will make initial LUR more prompt. It will also cause an un-regstration if the handset powers off and really heavy LUR loads in areas with spotty coverage.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.FailedRegistration.Message','Your handset is not provisioned for this network. ',0,0,'Send this text message, followed by the IMSI, to unprovisioned handsets that are denied registration.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.FailedRegistration.ShortCode','1000',0,0,'The return address for the failed registration message.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.NormalRegistration.Message','',0,0,'The text message (followed by the IMSI) to be sent to provisioned handsets when they attach on Um. By default, no message is sent. To have a message sent, specify one. To stop sending messages again, execute "unconfig Control.LUR.NormalRegistration.Message".');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.NormalRegistration.ShortCode','0000',0,0,'The return address for the normal registration message.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.OpenRegistration','',0,0,'This is value is a regular expression. Any handset with an IMSI matching the regular expression is allowed to register, even if it is not provisioned. By default, this feature is disabled. To enable open registration, specify a regular expression e.g. ^460 (which matches any IMSI starting with 460, the MCC for China). To disable open registration again, execute "unconfig Control.LUR.OpenRegistration".');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.OpenRegistration.Message','Welcome to the test network. Your IMSI is ',0,0,'Send this text message, followed by the IMSI, to unprovisioned handsets when they attach on Um due to open registration.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.OpenRegistration.Reject','',0,0,'This is value is a regular expression. Any unprovisioned handset with an IMSI matching the regular expression is rejected for registration, even if it matches Control.LUR.OpenRegistration. By default, this feature is disabled. To enable this filter, specify a regular expression e.g. ^460 (which matches any IMSI starting with 460, the MCC for China). To disable this filter again, execute "unconfig Control.LUR.OpenRegistration.Reject". If Control.LUR.OpenRegistration is disabled, this parameter has no effect.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.OpenRegistration.ShortCode','101',0,0,'The return address for the open registration message.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.QueryClassmark','0',0,0,'1=enabled, 0=disabled - Query every MS for classmark during LUR.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.QueryIMEI','0',0,0,'1=enabled, 0=disabled - Query every MS for IMEI during LUR.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.QueryRRLP','0',0,0,'1=enabled, 0=disabled - Query every MS for its location via RRLP during LUR.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.SendTMSIs','0',0,0,'1=enabled, 0=disabled - Send new TMSI assignments to handsets that are allowed to attach.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.UnprovisionedRejectCause','0x04',0,0,'Reject cause for location updating failures for unprovisioned phones. Reject causes come from GSM 04.08 10.5.3.6. Reject cause 0x04, IMSI not in VLR, is usually the right one.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.WhiteList','0',0,0,'1=enabled, 0=disabled - Whitelist checking is performed.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.WhiteListing.Message','Your handset needs to be added to the whitelist.',0,0,'The whitelisting notification message.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.WhiteListing.RejectCause','0x04',0,0,'Reject cause for handset not in the whitelist, when whitelisting is enforced. Reject causes come from GSM 04.08 10.5.3.6. Reject cause 0x04, IMSI not in VLR, is usually the right one.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.LUR.WhiteListing.ShortCode','1000',0,0,'The return address for the whitelisting notificiation message.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.NumSQLTries','3',0,0,'Number of times to retry SQL queries before declaring a database access failure.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.SMS.QueryRRLP',NULL,0,1,'If not NULL, query every MS for its location via RRLP during an SMS.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.TMSITable.MaxAge','72',0,0,'Maximum allowed age for a TMSI in hours.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.TMSITable.MaxSize','100000',0,0,'Maximum size of TMSI table before oldest TMSIs are discarded.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.VEA',1,0,1,'If not NULL, user very early assignment for speech call establishment. See GSM 04.08 Section 7.3.2 for a detailed explanation of assignment types. If VEA is selected, GSM.CellSelection.NECI should be set to 1. See GSM 04.08 Sections 9.1.8 and 10.5.2.4 for an explanation of the NECI bit.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CCCH.AGCH.QMax','5',0,0,'Maximum number of access grants to be queued for transmission on AGCH before declaring congrestion.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CCCH.CCCH-CONF','1',0,0,'CCCH configuration type. See GSM 10.5.2.11 for encoding. Value of 1 means we are using a C-V beacon. Any other value selects a C-IV beacon.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Channels.SDCCHReserve','0',0,0,'Number of SDCCHs to reserve for non-LUR operations. This can be used to force LUR transactions into a lower priority.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Reporting.PhysStatusTable','/var/run/ChannelTable.db',1,0,'File path for channel status reporting database. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Reporting.StatsTable','/var/log/OpenBTSStats.db',1,0,'File path for statistics reporting database. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Reporting.TMSITable','/var/run/TMSITable.db',1,0,'File path for TMSITable database. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.Reporting.TransactionTable','/var/run/TransactionTable.db',1,0,'File path for transaction table database. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.SACCHTimeout.BumpDown','1',0,0,'Decrease the RSSI by this amount to induce more power in the MS each time we fail to receive a response from it.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.SMS.QueryRRLP','0',0,0,'1=enabled, 0=disabled - Query every MS for its location via RRLP during an SMS.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.SMSCB.Table','',1,0,'File path for SMSCB scheduling database. By default, this feature is disabled. To enable, specify a file path for the database e.g. /var/run/SMSCB.db. To disable again, execute "unconfig Control.SMSCB.Table". Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.TestCall.AutomaticModeChange','0',0,0,'1=enabled, 0=disabled - Automatically change the channel mode of a TCH/FACCH from signaling-only to speech-V1 before starting the fuzzing interface.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.TestCall.LocalPort','24020',0,0,'Port number part of source for L3 payloads received from the handset in fuzzing interface.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.TestCall.PollTime','100',0,0,'Polling time of the fuzzing interface in milliseconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.TestCall.RemoteHost','127.0.0.1',0,0,'Host part of destination for L3 payloads received from the handset in fuzzing interface.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.TestCall.RemotePort','24021',0,0,'Port number part of destination for L3 payloads received from the handset in fuzzing interface.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.VEA','0',0,0,'1=enabled, 0=disabled - Use very early assignment for speech call establishment. See GSM 04.08 Section 7.3.2 for a detailed explanation of assignment types. If VEA is selected, GSM.CellSelection.NECI should be set to 1. See GSM 04.08 Sections 9.1.8 and 10.5.2.4 for an explanation of the NECI bit. Note that some handset models exhibit bugs when VEA is used and these bugs may affect performance.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Control.WatchdogMinutes','60',0,0,'Number of minutes before the radio watchdog expires and OpenBTS is restarted.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.DNS','',1,0,'The list of DNS servers to be used by downstream clients. By default, DNS servers are taken from the host system. To override, specify a space-separated list of the DNS servers, in IP dotted notation, eg: 1.2.3.4 5.6.7.8. To use the host system DNS servers again, execute "unconfig GGSN.DNS". Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.Firewall.Enable','1',1,0,'0=no firewall; 1=block MS attempted access to OpenBTS or other MS; 2=block all private IP addresses. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.IP.MaxPacketSize','1520',1,0,'Maximum size of an IP packet. Should normally be 1520. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.IP.ReuseTimeout','180',1,0,'How long IP addresses are reserved after a session ends. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.IP.TossDuplicatePackets','0',1,0,'1=enabled, 0=disabled - Toss duplicate TCP/IP packets to prevent unnecessary traffic on the radio. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.Logfile.Name','/var/log/openbts-ggsn.log',1,0,'If specified, internet traffic is logged to this file e.g. ggsn.log Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.MS.IP.Base','192.168.99.1',1,0,'Base IP address assigned to MS. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.MS.IP.MaxCount','254',1,0,'Number of IP addresses to use for MS. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.MS.IP.Route','',1,0,'A route address to be used for downstream clients. By default, OpenBTS manufactures this value from the GGSN.MS.IP.Base assuming a 24 bit mask. To override, specify a route address in the form xxx.xxx.xxx.xxx/yy. The address must encompass all MS IP addresses. To use the auto-generated value again, execute "unconfig GGSN.MS.IP.Route". Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.ShellScript','',0,0,'A shell script to be invoked when MS devices attach or create IP connections. By default, this feature is disabled. To enable, specify an absolute path to the script you wish to execute e.g. /usr/bin/ms-attach.sh. To disable again, execute "unconfig GGSN.ShellScript".');
INSERT OR IGNORE INTO "CONFIG" VALUES('GGSN.TunName','sgsntun',1,0,'Tunnel device name for GGSN. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.CellOptions.T3168Code','5',1,0,'Timer 3168 in the MS controls the wait time after sending a Packet Resource Request to initiate a TBF before giving up or reattempting a Packet Access Procedure, which may imply sending a new RACH. This code is broadcast to the MS in the C0T0 beacon in the GPRS Cell Options IE. See GSM 04.60 12.24. Range 0..7 to represent 0.5sec to 4sec in 0.5sec steps. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.CellOptions.T3192Code','0',1,0,'Timer 3192 in the MS specifies the time MS continues to listen on PDCH after all downlink TBFs are finished, and is used to reduce unnecessary RACH traffic. This code is broadcast to the MS in the C0T0 beacon in the GPRS Cell Options IE. The value must be one of the codes described in GSM 04.60 12.24. Value 0 implies 500msec; 2 implies 1500msec; 3 imples 0msec. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.ChannelCodingControl.RSSI','-40',0,0,'If the initial unlink signal strength is less than this amount in DB GPRS uses a lower bandwidth but more robust encoding CS-1. This value should normally be GSM.Radio.RSSITarget + 10 dB.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Channels.Congestion.Threshold','200',0,0,'The GPRS channel is considered congested if the desired bandwidth exceeds available bandwidth by this amount, specified in percent.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Channels.Congestion.Timer','60',0,0,'How long in seconds GPRS congestion exceeds the Congestion.Threshold before we attempt to allocate another channel for GPRS.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Channels.Min.C0','2',0,0,'Minimum number of channels allocated for GPRS service on ARFCN C0.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Channels.Min.CN','0',0,0,'Minimum number of channels allocated for GPRS service on ARFCNs other than C0.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Codecs.Downlink','14',0,0,'List of allowed GPRS downlink codecs 1..4 for CS-1..CS-4. Currently, only 1 and 4 are supported e.g. 14.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Codecs.Uplink','14',0,0,'List of allowed GPRS uplink codecs 1..4 for CS-1..CS-4. Currently, only 1 and 4 are supported e.g. 14.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Counters.Assign','10',0,0,'Maximum number of assign messages sent');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Counters.N3101','20',0,0,'Counts unused USF responses to detect nonresponsive MS. Should be > 8. See GSM04.60 sec 13.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Counters.N3103','8',0,0,'Counts ACK/NACK attempts to detect nonresponsive MS. See GSM04.60 sec 13.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Counters.N3105','12',0,0,'Counts unused RRBP responses to detect nonresponsive MS. See GSM04.60 sec 13.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Counters.Reassign','6',0,0,'Maximum number of reassign messages sent');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Counters.TbfRelease','5',0,0,'Maximum number of TBF release messages sent');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Debug','0',0,0,'1=enabled, 0=disabled - Toggle GPRS debugging.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Downlink.KeepAlive','300',0,0,'How often to send keep-alive messages for persistent TBFs in milliseconds; must be long enough to avoid simultaneous in-flight duplicates, and short enough that MS gets one every 5 seconds. GSM 5.08 10.2.2 indicates MS must get a block every 360ms');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Downlink.Persist','0',0,0,'After completion, downlink TBFs are held open for this time in milliseconds. If non-zero, must be greater than GPRS.Downlink.KeepAlive.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Enable','0',0,0,'1=enabled, 0=disabled - If enabled, GPRS service is advertised in the C0T0 beacon, and GPRS service may be started on demand. See also GPRS.Channels.*.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.LocalTLLI.Enable','1',0,0,'1=enabled, 0=disabled - Enable recognition of local TLLI');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.MS.KeepExpiredCount','20',0,0,'How many expired MS structs to retain; they can be viewed with gprs list ms -x');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.MS.Power.Alpha','10',0,0,'MS power control parameter, unitless, in steps of 0.1, so a parameter of 5 is an alpha value of 0.5. Determines sensitivity of handset to variations in downlink RSSI. Valid range is 0...10 for alpha values of 0...1.0. See GSM 05.08 10.2.1.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.MS.Power.Gamma','31',0,0,'MS power control parameter, in 2 dB steps. Determines baseline of handset uplink power relative to downlink RSSI. The optimum value will tend to be lower for BTS units with higher power output. This default assumes a balanced link with a BTS output of 2-4 W/ARFCN. Valid range is 0...31 for gamma values of 0...62 dB. See GSM 05.08 10.2.1.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.MS.Power.T_AVG_T','15',1,0,'MS power control parameter; see GSM 05.08 10.2.1. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.MS.Power.T_AVG_W','15',1,0,'MS power control parameter; see GSM 05.08 10.2.1. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Multislot.Max.Downlink','3',0,0,'Maximum number of channels used for a single MS in downlink.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Multislot.Max.Uplink','2',0,0,'Maximum number of channels used for a single MS in uplink.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.NC.NetworkControlOrder','2',1,0,'Controls measurement reports and cell reselection mode (MS autonomous or under network control); should not be changed. See GSM 5.08 10.1.4. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.NMO','2',0,0,'Network Mode of Operation. See GSM 03.60 Section 6.3.3.1 and 24.008 4.7.1.6. Allowed values are 1, 2, 3 for modes I, II, III. Mode II (2) is recommended. Mode I implies combined routing updating procedures.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.PRIORITY-ACCESS-THR','6',1,0,'Code contols GPRS packet access priorities allowed. See GSM04.08 table 10.5.76. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.RAC','0',1,0,'GPRS Routing Area Code, advertised in the C0T0 beacon. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.RA_COLOUR','0',0,0,'GPRS Routing Area Color as advertised in the C0T0 beacon.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.RRBP.Min','0',0,0,'Minimum value for RRBP reservations, range 0..3. Should normally be 0. A non-zero value gives the MS more time to respond to the RRBP request.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Reassign.Enable','1',0,0,'1=enabled, 0=disabled - Enable TBF Reassignment');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.SGSN.port','1920',0,0,'Port number of the SGSN required for GPRS service. This must match the port specified in the SGSN config file, currently osmo_sgsn.cfg.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.SendIdleFrames','0',0,0,'1=enabled, 0=disabled - Should be 0 for current transceiver or 1 for deprecated version of transceiver.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.TBF.Downlink.Poll1','10',0,0,'When the first poll is sent for a downlink tbf, measured in blocks sent.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.TBF.EST','1',0,0,'1=enabled, 0=disabled - Allow MS to request another uplink assignment at end up of uplink TBF. See GSM 4.60 9.2.3.4');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.TBF.Expire','30000',0,0,'How long to try before giving up on a TBF.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.TBF.KeepExpiredCount','20',0,0,'How many expired TBF structs to retain; they can be viewed with gprs list tbf -x');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.TBF.Retry','1',0,0,'If 0, no tbf retry, otherwise if a tbf fails it will be retried with this codec, numbered 1..4');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Timers.Channels.Idle','6000',0,0,'How long in milliseconds a GPRS channel is idle before being returned to the pool of channels. Also depends on Channels.Min. Currently the channel cannot be returned to the pool while there is any GPRS activity on any channel.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Timers.MS.Idle','600',0,0,'How long in seconds an MS is idle before the BTS forgets about it.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Timers.MS.NonResponsive','6000',0,0,'How long in milliseconds a TBF is non-responsive before the BTS kills it.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Timers.T3169','5000',0,0,'Nonresponsive uplink TBF resource release timer, in milliseconds. See GSM04.60 sec 13.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Timers.T3191','5000',0,0,'Nonresponsive downlink TBF resource release timer, in milliseconds. See GSM04.60 Section 13.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Timers.T3193','0',0,0,'Timer T3193 (in milliseconds) in the base station corresponds to T3192 in the MS, which is set by GPRS.CellOptions.T3192Code. The T3193 value should be slightly longer than that specified by the T3192Code. If 0, the BTS will fill in a default value based on T3192Code.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Timers.T3195','5000',0,0,'Nonresponsive downlink TBF resource release timer, in milliseconds. See GSM04.60 Section 13.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Uplink.KeepAlive','300',0,0,'How often to send keep-alive messages for persistent TBFs in milliseconds; must be long enough to avoid simultaneous in-flight duplicates, and short enough that MS gets one every 5 seconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.Uplink.Persist','4000',1,0,'After completion, uplink TBFs are held open for this time in milliseconds. If non-zero, must be greater than GPRS.Uplink.KeepAlive. This is broadcast in the beacon and it cannot be changed once BTS is started. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GPRS.advanceblocks','10',0,0,'Number of advance blocks to use in the CCCH reservation.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CCCH.AGCH.QMax','5',0,0,'Maximum number of access grants to be queued for transmission on AGCH before declaring congestion.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CCCH.CCCH-CONF','1',1,0,'CCCH configuration type. See GSM 10.5.2.11 for encoding. Value of 1 means we are using a C-V beacon. Any other value selects a C-IV beacon. In C2.9 and earlier, the only allowed value is 1. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CellOptions.RADIO-LINK-TIMEOUT','15',1,0,'Seconds before declaring a physical link dead. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CellSelection.CELL-RESELECT-HYSTERESIS','3',0,0,'Cell Reselection Hysteresis. See GSM 04.08 10.5.2.4, Table 10.5.23 for encoding. Encoding is $2N$ dB, values of $N$ are 0...7 for 0...14 dB.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CellSelection.MS-TXPWR-MAX-CCH','0',0,0,'Cell selection parameters. See GSM 04.08 10.5.2.4.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CellSelection.NCCsPermitted','1',0,0,'NCCs Permitted. An 8-bit mask of allowed NCCs. Unless you are coordinating with another carrier, this should probably just select your own NCC.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CellSelection.NECI','1',0,0,'NECI, New Establishment Causes. This must be set to "1" if you want to support very early assignment (VEA). It can be set to "1" even if you do not use VEA, so you might as well leave it as "1". See GSM 04.08 10.5.2.4, Table 10.5.23 and 04.08 9.1.8, Table 9.9 and the Control.VEA parameter.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CellSelection.Neighbors','39 41 43',0,0,'ARFCNs of neighboring cells.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CellSelection.NECI','1',0,0,'NECI, New Establishment Causes. This must be set to 1 if you want to support very early assignment (VEA). It can be set to 1 even if you do not use VEA, so you might as well leave it as 1. See GSM 04.08 10.5.2.4, Table 10.5.23 and 04.08 9.1.8, Table 9.9 and the Control.VEA parameter.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.CellSelection.RXLEV-ACCESS-MIN','0',0,0,'Cell selection parameters. See GSM 04.08 10.5.2.4.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Channels.C1sFirst',NULL,1,0,'If not NULL, allocate C-I slots first, starting at C0T1. Otherwise, allocate C-VII slots first. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Channels.C1sFirst','0',1,0,'1=enabled, 0=disabled - Allocate C-I slots first, starting at C0T1. Otherwise, allocate C-VII slots first. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Channels.NumC1s','7',1,0,'Number of Combination-I timeslots to configure. The C-I slot carries a single full-rate TCH, used for speech calling. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Channels.NumC7s','0',1,0,'Number of Combination-VII timeslots to configure. The C-VII slot carries 8 SDCCHs, useful to handle high registration loads or SMS. If C0T0 is C-IV, you must have at least one C-VII also. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Control.GPRSMaxIgnore','5',0,1,'The maximum number of suspension requests to ignore before aborting a transaction.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Channels.NumC7s','0',1,0,'Number of Combination-VII timeslots to configure. The C-VII slot carries 8 SDCCHs, useful to handle high registration loads or SMS. If C0T0 is C-IV, which it always is in C2.9 and earlier,, you must have at least one C-VII also. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Channels.SDCCHReserve','0',0,0,'Number of SDCCHs to reserve for non-LUR operations. This can be used to force LUR transactions into a lower priority.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Cipher.CCHBER','0',0,0,'Probability of a bit getting toggled in a control channel burst for cracking protection.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Cipher.Encrypt','0',0,0,'1=enabled, 0=disabled - Encrypt traffic between phone and OpenBTS.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Cipher.RandomNeighbor','0',0,0,'Probability of a random neighbor being added to SI5 for cracking protection.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Cipher.ScrambleFiller','0',0,0,'1=enabled, 0=disabled - Scramble filler in layer 2 for cracking protection.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Control.GPRSMaxIgnore','5',0,0,'Ignore GPRS messages on GSM control channels. Value is number of consecutive messages to ignore.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Handover.FailureHoldoff','5',0,0,'The number of seconds to wait before attempting another handover with a given neighbor BTS.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Handover.LocalRSSIMin','-80',0,0,'Do not handover if downlink RSSI is above this level (in dBm), regardless of power difference.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Handover.ThresholdDelta','10',0,0,'A neighbor downlink signal must be this much stronger (in dB) than this downlink signal for handover to occur.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.BSIC.BCC','2',0,0,'GSM basestation color code; lower 3 bits of the BSIC. BCC values in a multi-BTS network should be assigned so that BTS units with overlapping coverage do not share a BCC. This value will also select the training sequence used for all slots on this unit.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.BSIC.NCC','0',0,0,'GSM network color code; upper 3 bits of the BSIC. Assigned by your national regulator. Must be distinct from NCCs of other GSM operators in your area.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.CI','10',0,0,'Cell ID, 16 bits. Should be unique.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.LAC','1000',0,0,'Location area code, 16 bits, values 0xFFxx are reserved. For multi-BTS networks, assign a unique LAC to each BTS unit. (That is not the normal procedure in conventional GSM networks, but is the correct procedure in OpenBTS networks.)');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.MCC','001',0,0,'Mobile country code, 2 or 3 digits. Defined in ITU-T E.212.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.MNC','01',0,0,'Mobile network code; Must be 3 dgits. Assigned by your national regulator.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.ShortName','Range',0,1,'Network short name, displayed on some phones. Optional but must be defined if you also want the network to send time-of-day.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.ShowCountry',1,0,0,'If not NULL, tell the phone to show the country name based on the MCC.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.MCC','001',0,0,'Mobile country code; must be three digits. Defined in ITU-T E.212. 001 for test networks.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.MNC','01',0,0,'Mobile network code, two or three digits. Assigned by your national regulator. 01 for test networks.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Identity.ShortName','Range',0,0,'Network short name, displayed on some phones. Optional but must be defined if you also want the network to send time-of-day.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.MS.Power.Damping','50',0,0,'Damping value for MS power control loop.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.MS.Power.Max','33',0,0,'Maximum commanded MS power level in dBm.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.MS.Power.Min','5',0,0,'Minimum commanded MS power level in dBm.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.MS.TA.Damping','50',0,0,'Damping value for timing advance control loop.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.MS.TA.Max','5',0,0,'Maximum allowed timing advance in symbol periods. Ignore RACH bursts with delays greater than this. Can be used to limit service range.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.MaxSpeechLatency','2',0,0,'Maximum allowed speech buffering latency, in 20 ms frames. If the jitter is larger than this delay, frames will be lost.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RACH.AC','1024',0,0,'Access class flags. This is the raw parameter sent on the BCCH. See GSM 04.08 10.5.2.29 for encoding. Set to 0 to allow full access. If you do not have proper PSAP integration, set to 0x0400 to indicate no support for emergency calls.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.MS.TA.Max','62',0,0,'Maximum allowed timing advance in symbol periods. One symbol period of round-trip delay is about 0.55 km of distance. Ignore RACH bursts with delays greater than this. Can be used to limit service range. Valid range is 1..62.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.MaxSpeechLatency','2',0,0,'Maximum allowed speech buffering latency, in 20 millisecond frames. If the jitter is larger than this delay, frames will be lost.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Neighbors','',0,0,'A list of IP addresses of neighbor BTSs available for handover. By default, this feature is disabled. To enable, specify a space-separated list of the BTS IP addresses, in IP dotted notation, eg: 1.2.3.4 5.6.7.8. To disable again, execute "unconfig GSM.Neighbors".');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Neighbors.NumToSend','8',0,0,'Maximum number of neighbors to send to handset in a neighbor list.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Ny1','5',1,0,'Maximum number of repeats of the Physical Information Message during handover procedure, GSM 04.08 11.1.3. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RACH.MaxRetrans','1',0,0,'Maximum RACH retransmission attempts. This is the raw parameter sent on the BCCH. See GSM 04.08 10.5.2.29 for encoding.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RACH.TxInteger','14',0,0,'Parameter to spread RACH busts over time. This is the raw parameter sent on the BCCH. See GSM 04.08 10.5.2.29 for encoding.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.ARFCNs','1 ',1,0,'The number of ARFCNs to use. The ARFCN set will be C0, C0+2, C0+4, etc. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RADIO-LINK-TIMEOUT','15',0,0,' L1 radio link timeout. This is the raw parameter sent on the BCCH; see GSM 10.5.2.3 for encoding. Should be coordinated with T3109.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.ACCURACY','40',0,0,'Requested accuracy of location request. K in 10(1.1**K-1). See 3GPP 03.32, sect 6.2');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.ACCURACY','40',0,0,'Requested accuracy of location request. K in r=10(1.1**K-1), where r is the accuracy in meters. See 3GPP 03.32, sect 6.2');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.ALMANAC.ASSIST.PRESENT','0',0,0,'1=enabled, 0=disabled - Send almanac info to mobile');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.ALMANAC.REFRESH.TIME','24.0',0,0,'How often the almanac is refreshed, in hours');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.ALMANAC.URL','http://www.navcen.uscg.gov/?pageName=currentAlmanac&format=yuma',0,0,'URL of almanac source.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.EPHEMERIS.ASSIST.COUNT','9',0,0,'number of satellites to include in navigation model');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.EPHEMERIS.REFRESH.TIME','1.0',0,0,'How often the ephemeris is refreshed, in hours.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.EPHEMERIS.URL','ftp://ftp.trimble.com/pub/eph/CurRnxN.nav',0,0,'URL of ephemeris source.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.RESPONSETIME','4',0,0,'Mobile timeout. (OpenBTS timeout is 130 sec = max response time + 2.) N in 2**N. See 3GPP 04.31 sect A.2.2.1');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.SEED.ALTITUDE','0',0,0,'Seed altitude in meters wrt geoidal surface.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.SEED.LATITUDE','37.8720708',0,0,'Seed latitude in degrees. -90 (south pole) .. +90 (north pole)');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.SEED.LONGITUDE','-122.2578337',0,0,'Seed longitude in degrees. -180 (west of greenwich) .. 180 (east)');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.SERVER.URL','http://localhost/cgi-bin/rrlpserver.cgi',0,0,'URL of RRLP server.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.ALMANAC.ASSIST.PRESENT','0',0,0,'1=send almanac info to mobile; 0=do not');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.EPHEMERIS.ASSIST.COUNT','9',0,0,'number of satellites to include in navigation model');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.Band','900',1,0,'The GSM operating band. Valid values are 850 (GSM850), 900 (PGSM900), 1800 (DCS1800) and 1900 (PCS1900). For most Range models, this value is dictated by the hardware and should not be changed. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.C0','51 ',1,0,'The C0 ARFCN. Also the base ARFCN for a multi-ARFCN configuration. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.MaxExpectedDelaySpread','1 ',0,0,'Expected worst-case delay spread in symbol periods, roughly 3.7 us or 1.1 km per unit.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.SEED.LATITUDE','37.777423',0,0,'Seed latitude in degrees. -90 (south pole) .. +90 (north pole)');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.SEED.LONGITUDE','-122.39807',0,0,'Seed longitude in degrees. -180 (west of greenwich) .. 180 (east)');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.RRLP.SERVER.URL','',0,0,'URL of RRLP server. By default, this feature is disabled. To enable, specify a server URL eg: http://localhost/cgi/rrlpserver.cgi. To disable again, execute "unconfig GSM.RRLP.SERVER.URL".');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.ARFCNs','1',1,0,'The number of ARFCNs to use. The ARFCN set will be C0, C0+2, C0+4, etc. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.Band','900',1,0,'The GSM operating band. Valid values are 850 (GSM850), 900 (PGSM900), 1800 (DCS1800) and 1900 (PCS1900). For non-multiband units, this value is dictated by the hardware and should not be changed. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.C0','51',1,0,'The C0 ARFCN. Also the base ARFCN for a multi-ARFCN configuration. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.MaxExpectedDelaySpread','4',0,0,'Expected worst-case delay spread in symbol periods, roughly 3.7 us or 1.1 km per unit. This parameter is dependent on the terrain type in the installation area. Typical values are 1 for open terrain and small coverage areas. For large coverage areas, a value of 4 is strongly recommended. This parameter has a large effect on computational requirements of the software radio; values greater than 4 should be avoided.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.NeedBSIC','0',0,0,'1=enabled, 0=disabled - Does the Radio type require the full BSIC');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.PowerManager.MaxAttenDB','10',0,0,'Maximum transmitter attenuation level, in dB wrt full scale on the D/A output. This sets the minimum power output level in the output power control loop.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.PowerManager.MinAttenDB','0',0,0,'Minimum transmitter attenuation level, in dB wrt full scale on the D/A output. This sets the maximum power output level in the output power control loop.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.PowerManager.NumSamples','10',0,0,'Number of samples averaged by the output power control loop.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.PowerManager.Period','6000',0,0,'');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.PowerManager.SamplePeriod','2000',0,0,'Sample period for the output power control loop.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.PowerManager.Period','6000',0,0,'Power manager control loop master period, in milliseconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.PowerManager.SamplePeriod','2000',0,0,'Sample period for the output power control loopm in milliseconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.PowerManager.TargetT3122','5000',0,0,'Target value for T3122, the random access hold-off timer, for the power control loop.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.RxGain','47',1,0,'Receiver gain setting in dB. Ideal value is dictacted by the hardware. This database parameter is static but the receiver gain can be modified in real time with the CLI rxgain command. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.RSSITarget','-50',0,0,'Target uplink RSSI for MS power control loop, in dB wrt to A/D full scale. Should be 6-10 dB above the noise floor.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.NeedBSIC','0',0,0,'Does the Radio type require the full BSIC');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Timer.T3113','10000',0,0,'Paging timer T3113 in ms. This is the timeout for a handset to respond to a paging request. This should usually be the same as SIP.Timer.B in your VoIP network.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Radio.RxGain','47',1,0,'Receiver gain setting in dB. Ideal value is dictated by the hardware; 47 dB for RAD1. This database parameter is static but the receiver gain can be modified in real time with the CLI rxgain command. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.ShowCountry','0',0,0,'1=enabled, 0=disabled - Tell the phone to show the country name based on the MCC.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Timer.T3103','5000',1,0,'Handover timeout in milliseconds, GSM 04.08 11.1.2. This is the timeout for a handset to sieze a channel during handover. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Timer.T3105','50',1,0,'Milliseconds for handset to respond to physical information. GSM 04.08 11.1.2. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Timer.T3113','10000',0,0,'Paging timer T3113 in milliseconds. This is the timeout for a handset to respond to a paging request. This should usually be the same as SIP.Timer.B in your VoIP network.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Timer.T3122Max','255000',0,0,'Maximum allowed value for T3122, the RACH holdoff timer, in milliseconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Timer.T3122Min','2000',0,0,'Minimum allowed value for T3122, the RACH holdoff timer, in milliseconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('GSM.Timer.T3212','30',0,0,'Registration timer T3212 period in minutes. Should be a factor of 6. Set to 0 to disable periodic registration. Should be smaller than SIP registration period.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Log.Alarms.Max','20',0,0,'Maximum number of alarms to remember inside the application.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Log.Level','WARNING',0,0,'Default logging level when no other level is defined for a file.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Log.Level.CallControl.cpp','INFO',0,1,'Default configuration logs a trace at L3.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Log.Level.MobilityManagement.cpp','INFO',0,1,'Default configuration logs a trace at L3.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Log.Level.RadioResource.cpp','INFO',0,1,'Default configuration logs a trace at L3.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Log.Level.SMSControl.cpp','INFO',0,1,'Default configuration logs a trace at L3.');
INSERT OR IGNORE INTO "CONFIG" VALUES('NTP.Server','pool.ntp.org',0,1,'NTP server(s) for time-of-day clock syncing. For multiple servers, use a space-delimited list. If left undefined, NTP will not be used, but it is strongly recommended.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Log.File','',0,0,'Path to use for textfile based logging. By default, this feature is disabled. To enable, specify an absolute path to the file you wish to use, eg: /tmp/my-debug.log. To disable again, execute "unconfig Log.File".');
INSERT OR IGNORE INTO "CONFIG" VALUES('Log.Level','NOTICE',0,0,'Default logging level when no other level is defined for a file.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Peering.Neighbor.RefreshAge','60000',0,0,'Milliseconds before refreshing parameters from a neighbor.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Peering.NeighborTable.Path','/var/run/NeighborTable.db',1,0,'File path for neighbor information database. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Peering.Port','16001',1,0,'The UDP port used by the peer interface for handover. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Peering.ResendCount','5',0,0,'Number of tries to send message over the peer interface before giving up');
INSERT OR IGNORE INTO "CONFIG" VALUES('Peering.ResendTimeout','100',0,0,'Milliseconds before resending a message on the peer interface');
INSERT OR IGNORE INTO "CONFIG" VALUES('RTP.Range','98',1,0,'Range of RTP port pool. Pool is RTP.Start to RTP.Range-1. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('RTP.Start','16484',1,0,'Base of RTP port pool. Pool is RTP.Start to RTP.Range-1. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.RFC3428.NoTrying','0',0,1,'If NULL or 0, send 100 Trying response to SIP MESSAGE, even though that violates RFC-3428. In other words, to actually comply with the RFC, set this to something other than NULL or 0');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.DTMF.RFC2833','1',0,1,'If not NULL, use RFC-2833 (RTP event signalling) for in-call DTMF.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.DTMF.RFC2833.PayloadType','101',0,1,'Payload type to use for RFC-2833 telephone event packets. If SIP.DTMF.2833 is defined, this must also be defined.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.DTMF.RFC2967',NULL,0,1,'If not NULL, use RFC-2967 (SIP INFO method) for in-call DTMF.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SGSN.Debug','0',0,0,'1=enabled, 0=disabled - Add layer-3 messages to the GGSN.Logfile, if any.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SGSN.Timer.ImplicitDetach','3480',0,0,'3GPP 24.008 11.2.2. GPRS attached MS is implicitly detached in seconds. Should be at least 240 seconds greater than SGSN.Timer.RAUpdate.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SGSN.Timer.MS.Idle','600',0,0,'How long an MS is idle before the SGSN forgets TLLI specific information.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SGSN.Timer.RAUpdate','3240',0,0,'Also known as T3312, 3GPP 24.008 4.7.2.2. How often MS polls routing info from the BTS when it is idle, in seconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SGSN.Timer.Ready','44',0,0,'Also known as T3314, 3GPP 24.008 4.7.2.1. Inactivity period required before MS may perform another routing area or cell update, in seconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.DTMF.RFC2833','1',0,0,'1=enabled, 0=disabled - Use RFC-2833 (RTP event signalling) for in-call DTMF.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.DTMF.RFC2833.PayloadType','101',0,0,'Payload type to use for RFC-2833 telephone event packets.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.DTMF.RFC2967','0',0,0,'1=enabled, 0=disabled - Use RFC-2967 (SIP INFO method) for in-call DTMF.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Local.IP','127.0.0.1',1,0,'IP address of the OpenBTS machine as seen by its proxies. If these are all local, this can be localhost. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Local.Port','5062',1,0,'IP port that OpenBTS uses for its SIP interface. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.MaxForwards','5',0,0,'Maximum allowed number of referrals.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.MaxForwards','70',0,0,'Maximum allowed number of referrals.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Proxy.Registration','127.0.0.1:5064',0,0,'The IP host and port of the proxy to be used for registration and authentication. This should normally be the subscriber registry SIP interface, not Asterisk.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Proxy.SMS','127.0.0.1:5063',0,0,'The IP host and port of the proxy to be used for text messaging. This is smqueue, for example.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Proxy.Speech','127.0.0.1:5060',0,0,'The IP host and port of the proxy to be used for normal speech calls. This is Asterisk, for example.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.RFC3428.NoTrying','0',0,0,'1=enabled, 0=disabled - Send 100 Trying response to SIP MESSAGE, even though that violates RFC-3428.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.RegistrationPeriod','90',0,0,'Registration period in minutes for MS SIP users. Should be longer than GSM T3212.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.SMSC','smsc',0,1,'The SMSC handler in smqueue. This is the entity that handles full 3GPP MIME-encapsulted TPDUs. If not defined, use direct numeric addressing. Normally the value is NULL if SMS.MIMIEType is "text/plain" or "smsc" if SMS.MIMEType is "application/vnd.3gpp".');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.A','500',0,0,'INVITE retransmit period in ms.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.B','10000',0,0,'INVITE transaction timeout in ms. This value should usually match GSM.Timer.T3113.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.E','500',0,0,'Non-INVITE initial request retransmit period in ms.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.F','5000',0,0,'Non-INVITE initial request timeout in ms.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.J','500',0,0,'Non-INVITE non-initial request retransmit period in ms.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.H','5000',0,0,'ACK timeout period in ms.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.I','500',0,0,'ACK retransmit period in ms.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SMS.DefaultDestSMSC','0000',0,0,'Use this to fill in L4 SMSC address in SMS submission.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.SMSC','smsc',0,0,'The SMSC handler in smqueue. This is the entity that handles full 3GPP MIME-encapsulted TPDUs. If not defined, use direct numeric addressing. The value should be disabled with "unconfig SIP.SMSC" if SMS.MIMEType is "text/plain" or set to "smsc" if SMS.MIMEType is "application/vnd.3gpp".');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.A','2000',0,0,'SIP timer A, the INVITE retry period, RFC-3261 Section 17.1.1.2, in milliseconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.B','10000',0,0,'INVITE transaction timeout in milliseconds. This value should usually match GSM.Timer.T3113.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.E','500',0,0,'Non-INVITE initial request retransmit period in milliseconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.F','5000',0,0,'Non-INVITE initial request timeout in milliseconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SIP.Timer.H','5000',0,0,'ACK timeout period in milliseconds.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SMS.FakeSrcSMSC','0000',0,0,'Use this to fill in L4 SMSC address in SMS delivery.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SMS.MIMEType','application/vnd.3gpp.sms',0,0,'This is the MIME Type that OpenBTS will use for RFC-3428 SIP MESSAGE payloads. Valid values are "application/vnd.3gpp.sms" and "text/plain".');
INSERT OR IGNORE INTO "CONFIG" VALUES('SubscriberRegistry.Manager.Title','Subscriber Registry',0,0,'Title of subscriber registry database manager web page.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SubscriberRegistry.Manager.Url','http://127.0.0.1/cgi/srmanager.cgi',0,0,'URL of the subscriber registry database manager.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SubscriberRegistry.Manager.VisibleColumns','name username type context host',0,0,'Field names in subscriber registry visible in the database manager.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SubscriberRegistry.db','/var/lib/asterisk/sqlite3dir/sqlite3.db',0,0,'The location of the sqlite3 database holding the subscriber registry.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SubscriberRegistry.A3A8','/OpenBTS/comp128',0,0,'Path to the program that implements the A3/A8 algorithm.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SubscriberRegistry.Manager.Title','Subscriber Registry',0,0,'Title text to be displayed on the subscriber registry manager.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SubscriberRegistry.Port','5064',0,0,'Port used by the SIP Authentication Server. NOTE: In some older releases (pre-2.8.1) this is called SIP.myPort.');
INSERT OR IGNORE INTO "CONFIG" VALUES('SubscriberRegistry.UpstreamServer','',0,0,'URL of the subscriber registry HTTP interface on the upstream server. By default, this feature is disabled. To enable, specify a server URL eg: http://localhost/cgi/subreg.cgi. To disable again, execute "unconfig SubscriberRegistry.UpstreamServer".');
INSERT OR IGNORE INTO "CONFIG" VALUES('SubscriberRegistry.db','/var/lib/asterisk/sqlite3dir/sqlite3.db',0,0,'The location of the sqlite3 database holding the subscriber registry.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.IP','127.0.0.1',1,0,'IP address of the transceiver application. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.MinimumRxRSSI','-63',0,0,'Bursts received at the physical layer below this threshold are automatically ignored. Values in dB. Set at the factory. Do not adjust without proper calibration.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.Port','5700',1,0,'IP port of the transceiver application. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.RadioFrequencyOffset','128',1,0,'Fine-tuning adjustment for the transceiver master clock. Roughly 170 Hz/step. Set at the factory. Do not adjust without proper calibration. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.Timeout.Clock','10',0,1,'How long to wait during a read operation from the transceiver before giving up.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.Timeout.Start','2',0,1,'How long to wait during system startup before checking to see if the transceiver can be reached.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.TxAttenOffset','2',1,0,'Hardware-specific gain adjustment for transmitter, matched to the power amplifier, expessed as an attenuationi in dB. Set at the factory. Do not adjust without proper calibration. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.Timeout.Clock','10',0,0,'How long to wait during a read operation from the transceiver before giving up.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.Timeout.Start','2',0,0,'How long to wait during system startup before checking to see if the transceiver can be reached.');
INSERT OR IGNORE INTO "CONFIG" VALUES('TRX.TxAttenOffset','0',1,0,'Hardware-specific gain adjustment for transmitter, matched to the power amplifier, expessed as an attenuationi in dB. Set at the factory. Do not adjust without proper calibration. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Test.GSM.SimulatedFER.Downlink','0',1,0,'Probability (0-100) of dropping any downlink frame to test robustness. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Test.GSM.SimulatedFER.Uplink','0',1,0,'Probability (0-100) of dropping any uplink frame to test robustness. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Test.GSM.UplinkFuzzingRate','0',1,0,'Probability (0-100) of flipping a bit in any uplink frame to test robustness. Static.');
INSERT OR IGNORE INTO "CONFIG" VALUES('Test.SIP.SimulatedPacketLoss','0',1,0,'Probability (0-100) of dropping any inbound or outbound SIP packet to test robustness. Static.');
COMMIT;

6
apps/OpenBTS.logrotate Executable file
View File

@@ -0,0 +1,6 @@
/var/log/OpenBTS.log {
sizem 20
rotate 10
compress
notifempty
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011 Range Networks, Inc.
* Copyright 2011, 2012 Range Networks, Inc.
*
* This software is distributed under the terms of the GNU Affero Public License.
* See the COPYING file in the main directory for details.
@@ -8,8 +8,8 @@
* 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
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -22,6 +22,9 @@
*/
// KEEP THIS FILE CLEAN FOR GPL PUBLIC RELEASE.
#include <config.h>
#include <sys/types.h>
#include <unistd.h>
@@ -32,6 +35,9 @@
#include <limits.h>
#include <time.h>
#define HAVE_LIBREADLINE
#ifdef HAVE_LIBREADLINE
# include <readline/readline.h>
# include <readline/history.h>
@@ -44,6 +50,13 @@
int main(int argc, char *argv[])
{
printf("OpenBTS Commnd Line Interface (CLI) utility\n");
printf("Copyright 2012, 2013 Range Networks, Inc.\n");
printf("Licensed under GPLv2.\n");
#ifdef HAVE_LIBREADLINE
printf("Includes libreadline, GPLv2.\n");
#endif
const char* cmdPath = DEFAULT_CMD_PATH;
if (argc!=1) {
cmdPath = argv[1];
@@ -73,8 +86,8 @@ int main(int argc, char *argv[])
// locally bound address
struct sockaddr_un rspSockName;
rspSockName.sun_family = AF_UNIX;
char rmcmd[strlen(rspPath)+5];
sprintf(rmcmd,"rm %s",rspPath);
char rmcmd[strlen(rspPath)+10];
sprintf(rmcmd,"rm -f %s",rspPath);
system(rmcmd);
strcpy(rspSockName.sun_path,rspPath);
if (bind(sock, (struct sockaddr *) &rspSockName, sizeof(struct sockaddr_un))) {
@@ -106,12 +119,10 @@ int main(int argc, char *argv[])
read_history(history_name);
}
}
printf("readline installed\n");
#endif
printf("Remote Interface Ready.\nType:\n \"help\" to see commands,\n \"version\" for version information,\n \"notices\" for licensing information.\n\"quit\" to exit console interface\n");
printf("Remote Interface Ready.\nType:\n \"help\" to see commands,\n \"version\" for version information,\n \"notices\" for licensing information.\n \"quit\" to exit console interface\n");
while (1) {
@@ -135,13 +146,19 @@ int main(int argc, char *argv[])
printf("closing remote console\n");
break;
}
// shell escape?
if (cmd[0]=='!') {
system(cmd+1);
continue;
}
// use the socket
if (sendto(sock,cmd,strlen(cmd)+1,0,(struct sockaddr*)&cmdSockName,sizeof(cmdSockName))<0) {
perror("sending datagram");
printf("Is the remote application running?\n");
continue;
}
free(cmd);
const int bufsz = 10000;
const int bufsz = 100000;
char resbuf[bufsz];
int nread = recv(sock,resbuf,bufsz-1,0);
if (nread<0) {
@@ -166,4 +183,8 @@ int main(int argc, char *argv[])
close(sock);
// Delete the path to limit clutter in /tmp.
sprintf(rmcmd,"rm -f %s",rspPath);
system(rmcmd);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011 Range Networks, Inc.
* Copyright 2011, 2012 Range Networks, Inc.
*
* This software is distributed under the terms of the GNU Affero Public License.
* See the COPYING file in the main directory for details.
@@ -34,7 +34,7 @@
#include <limits.h>
#define DEFAULT_CMD_PATH "/var/run/command"
#define DEFAULT_CMD_PATH "/var/run/OpenBTS/command"
int main(int argc, char *argv[])
{
@@ -61,6 +61,9 @@ int main(int argc, char *argv[])
// locally bound address
struct sockaddr_un rspSockName;
rspSockName.sun_family = AF_UNIX;
char rmcmd[strlen(rspPath)+10];
sprintf(rmcmd,"rm -f %s",rspPath);
system(rmcmd);
strcpy(rspSockName.sun_path,rspPath);
if (bind(sock, (struct sockaddr *) &rspSockName, sizeof(struct sockaddr_un))) {
perror("binding name to datagram socket");
@@ -71,13 +74,15 @@ int main(int argc, char *argv[])
char *inbuf = (char*)malloc(200);
char *cmd = fgets(inbuf,199,stdin);
if (!cmd) exit(0);
cmd[strlen(cmd)-1] = '\0';
if (sendto(sock,cmd,strlen(cmd)+1,0,(struct sockaddr*)&cmdSockName,sizeof(cmdSockName))<0) {
perror("sending datagram");
exit(1);
}
const int bufsz = 1500;
// buffer to be sized as necessary to accomodate config data length
const int bufsz = 8500;
char resbuf[bufsz];
int nread = recv(sock,resbuf,bufsz-1,0);
if (nread<0) {
@@ -88,4 +93,8 @@ int main(int argc, char *argv[])
printf("%s\n",resbuf);
close(sock);
// Delete the path to limit clutter in /tmp.
sprintf(rmcmd,"rm -f %s",rspPath);
system(rmcmd);
}

3
apps/exportConfigTable.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
sqlite3 /etc/OpenBTS/OpenBTS.db ".dump CONFIG" > OpenBTS.export.sql

20
apps/generateConfigTable.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
CONFIG_DIR=/etc/OpenBTS
# Create the dir if it dos not exist
if [ ! -d "$CONFIG_DIR" ]; then
mkdir $CONFIG_DIR
fi
# Create the dir if it dos not exist
if [ ! -d "$CONFIG_DIR/saved" ]; then
mkdir $CONFIG_DIR/saved
fi
# backup any exsisting DB before we create the default
if [ -e $CONFIG_DIR/OpenBTS.db ]; then
mv -f $CONFIG_DIR/OpenBTS.db $CONFIG_DIR/saved/OpenBTS.db
fi
sqlite3 $CONFIG_DIR/OpenBTS.db ".read $1"

3
apps/generateTeX.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
sqlite3 -separator "" $1 "select '\item ',KEYSTRING,' -- ',COMMENTS from CONFIG order by KEYSTRING;"

19
apps/importConfigTable.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
CONFIG_DIR=/etc/OpenBTS
# Create the config dir if it dos not exist
if [ ! -d "$CONFIG_DIR" ]; then
mkdir $CONFIG_DIR
fi
# Create the config/saved dir if it dos not exist
if [ ! -d "$CONFIG_DIR/saved" ]; then
mkdir $CONFIG_DIR/saved
fi
# backup any exsisting DB before we create the default
if [ -e $CONFIG_DIR/OpenBTS.db ]; then
mv -f $CONFIG_DIR/OpenBTS.db $CONFIG_DIR/saved/OpenBTS.db
fi
sqlite3 $CONFIG_DIR/OpenBTS.db ".read OpenBTS.export.sql"

13
apps/iptables.rules Normal file
View File

@@ -0,0 +1,13 @@
# Generated by iptables-save v1.4.4
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -o wlan0 -j MASQUERADE
COMMIT
# Generated by iptables-save v1.4.4
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT

7
apps/openbtsconfig Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
if [ $# -eq '1' ]
then
sqlite3 /etc/OpenBTS/OpenBTS.db "select KEYSTRING,VALUESTRING from CONFIG where KEYSTRING like '%$1%'";
else
sqlite3 /etc/OpenBTS/OpenBTS.db "insert or replace into CONFIG (VALUESTRING,KEYSTRING) values ('$2','$1')";
fi

View File

@@ -0,0 +1,4 @@
# OpenBTS logging controls
local7.* /var/log/OpenBTS.log

View File

@@ -1,4 +0,0 @@
#!/bin/sh
# A script to restart and just keep OpenBTS running.
while true; do killall transceiver; killall wget; sleep 2; ./OpenBTS; done