Tested with sylvain/traffic branch.
# A special case for GSM Mobile Station interface.
# A special case for GSM Mobile Station interface.
-# give "gsm-ms <name of mobile> <layer 2 socket to layer 1>".
+# give "gsm-ms <name of mobile instance>".
# Don't remove/change the settings, they will cause undefined behaviour
# of LCR. The actual interface is defined in gsm.conf.
# You may add 'extern' to make this interface the external line by default.
# Don't remove/change the settings, they will cause undefined behaviour
# of LCR. The actual interface is defined in gsm.conf.
# You may add 'extern' to make this interface the external line by default.
#channel-in free
#channel-out any
#nodtmf
#channel-in free
#channel-out any
#nodtmf
# Use chan_lcr (Asterisk PBX interface) as internal interface.
# Use chan_lcr (Asterisk PBX interface) as internal interface.
extern "C" {
#include <getopt.h>
#include <arpa/inet.h>
extern "C" {
#include <getopt.h>
#include <arpa/inet.h>
#include <osmocom/core/select.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/talloc.h>
#include <osmocom/bb/mobile/app_mobile.h>
}
#include <osmocom/bb/mobile/app_mobile.h>
}
-static const char *config_file = "/etc/osmocom/osmocom.cfg";
+//char *config_dir = NULL;
+
short vty_port = 4247;
struct llist_head ms_list;
short vty_port = 4247;
struct llist_head ms_list;
+ const char *home;
+ size_t len;
+ const char osmocomcfg[] = ".osmocom/bb/mobile.cfg";
+ char *config_file = NULL;
+
INIT_LLIST_HEAD(&ms_list);
INIT_LLIST_HEAD(&ms_list);
+ log_init(&log_info, NULL);
stderr_target = log_target_create_stderr();
log_add_target(stderr_target);
log_set_all_filter(stderr_target, 1);
l23_ctx = talloc_named_const(NULL, 1, "layer2 context");
stderr_target = log_target_create_stderr();
log_add_target(stderr_target);
log_set_all_filter(stderr_target, 1);
l23_ctx = talloc_named_const(NULL, 1, "layer2 context");
- log_parse_category_mask(stderr_target, "DCS:DPLMN:DRR:DMM:DSIM:DCC:DMNCC:DPAG:DSUM");
+ log_parse_category_mask(stderr_target, "DNB:DCS:DPLMN:DRR:DMM:DSIM:DCC:DMNCC:DPAG:DSUM");
log_set_log_level(stderr_target, LOGL_INFO);
#if 0
log_set_log_level(stderr_target, LOGL_INFO);
#if 0
+ home = getenv("HOME");
+ if (home != NULL) {
+ len = strlen(home) + 1 + sizeof(osmocomcfg);
+ config_file = (char *)talloc_size(l23_ctx, len);
+ if (config_file != NULL)
+ snprintf(config_file, len, "%s/%s", home, osmocomcfg);
+ }
+ /* save the config file directory name */
+ config_dir = talloc_strdup(l23_ctx, config_file);
+ config_dir = dirname(config_dir);
+
l23_app_init(message_ms, config_file, vty_port);
return 0;
l23_app_init(message_ms, config_file, vty_port);
return 0;