From ehsan99 at gmail.com Mon Dec 1 20:25:59 2014 From: ehsan99 at gmail.com (ehsan akhavan) Date: Mon, 1 Dec 2014 23:55:59 +0330 Subject: how add multi-trx support to osmo-bts Message-ID: Hello I know that OpenBSC support multi-trx BTS,but osmo-bts doesn't. So how i can enable this ability in osmo-bts? I see the source code and i think i should change some structures and add trx_id variable to them. but i don't know the correct way. can anyone help me? From holger at freyther.de Tue Dec 2 07:59:29 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Tue, 2 Dec 2014 08:59:29 +0100 Subject: recurring issue with OpenBSC In-Reply-To: <547B76C6.3080408@autistici.org> References: <5479FD5C.3000708@autistici.org> <20141130154252.GU16131@xiaoyu.lan> <547B76C6.3080408@autistici.org> Message-ID: <20141202075929.GA14607@xiaoyu.lan> On Sun, Nov 30, 2014 at 01:57:58PM -0600, Ciaby wrote: > That would be great. Can you point me in the right direction? Which > file/library is responsible for that? > Cheers Hi, something like the below would be a start. You could add a VTY command to dump the queue including the state and the reason string. And also show the last reason as this shows the item that is currently being dispatched. Going through the "FIXME"/HACKs notes. Depending on how much time/budget you have this whole code could be cleaned up. In real systems the voice and SMS services are independent. They shouldn't share the same "queue".. but I am drifting away. diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 7e0a419..207c010 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -60,6 +60,9 @@ struct gsm_subscriber { /* GPRS/SGSN related fields */ struct sgsn_mm_ctx *mm; + + /* debugging */ + const char *last_reason; }; enum gsm_subscriber_field { @@ -92,7 +95,7 @@ struct gsm_subscriber *subscr_get_or_create(struct gsm_network *net, int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason); void subscr_put_channel(struct gsm_subscriber *subscr); void subscr_get_channel(struct gsm_subscriber *subscr, - int type, gsm_cbfn *cbfn, void *param); + int type, gsm_cbfn *cbfn, void *param, const char *reason); struct gsm_subscriber *subscr_active_by_tmsi(struct gsm_network *net, uint32_t tmsi); struct gsm_subscriber *subscr_active_by_imsi(struct gsm_network *net, @@ -114,4 +117,38 @@ int subscr_update_expire_lu(struct gsm_subscriber *subscr, struct gsm_bts *bts); struct gsm_subscriber *subscr_alloc(void); extern struct llist_head active_subscribers; +/* + * Struct for pending channel requests. This is managed in the + * llist_head requests of each subscriber. The reference counting + * should work in such a way that a subscriber with a pending request + * remains in memory. + */ +struct subscr_request { + struct llist_head entry; + + /* back reference */ + struct gsm_subscriber *subscr; + + /* the requested channel type */ + int channel_type; + + /* what did we do */ + int state; + + /* the callback data */ + gsm_cbfn *cbfn; + void *param; + + /* debugging */ + const char *reason; +}; + +enum { + REQ_STATE_INITIAL, + REQ_STATE_QUEUED, + REQ_STATE_PAGED, + REQ_STATE_FAILED_START, + REQ_STATE_DISPATCHED, +}; + #endif /* _GSM_SUBSCR_H */ diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/openbsc/src/libbsc/bsc_ctrl_commands.c index 7c8636c..a806670 100644 --- a/openbsc/src/libbsc/bsc_ctrl_commands.c +++ b/openbsc/src/libbsc/bsc_ctrl_commands.c @@ -237,7 +237,6 @@ static int verify_trx_max_power(struct ctrl_cmd *cmd, const char *value, void *_ return 0; } -CTRL_CMD_DEFINE_RANGE(trx_arfcn, "arfcn", struct gsm_bts_trx, arfcn, 0, 1023); static int set_trx_max_power(struct ctrl_cmd *cmd, void *_data) { @@ -259,6 +258,7 @@ static int set_trx_max_power(struct ctrl_cmd *cmd, void *_data) return get_trx_max_power(cmd, _data); } CTRL_CMD_DEFINE(trx_max_power, "max-power-reduction"); +CTRL_CMD_DEFINE_RANGE(trx_arfcn, "arfcn", struct gsm_bts_trx, arfcn, 0, 1023); int bsc_base_ctrl_cmds_install(void) { diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index db6fc5f..dbe1393 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -3115,7 +3115,7 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg) } *trans->paging_request = subscr->net; - subscr_get_channel(subscr, RSL_CHANNEED_TCH_F, setup_trig_pag_evt, trans->paging_request); + subscr_get_channel(subscr, RSL_CHANNEED_TCH_F, setup_trig_pag_evt, trans->paging_request, "MNCC RX call"); subscr_put(subscr); return 0; diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index b2100d8..802ec17 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -944,7 +944,7 @@ int gsm411_send_sms_subscr(struct gsm_subscriber *subscr, } /* if not, we have to start paging */ - subscr_get_channel(subscr, RSL_CHANNEED_SDCCH, paging_cb_send_sms, sms); + subscr_get_channel(subscr, RSL_CHANNEED_SDCCH, paging_cb_send_sms, sms, "SEND SMS"); return 0; } diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index bc6f3cf..881604b 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -47,37 +47,6 @@ int gsm48_secure_channel(struct gsm_subscriber_connection *conn, int key_seq, gsm_cbfn *cb, void *cb_data); -/* - * Struct for pending channel requests. This is managed in the - * llist_head requests of each subscriber. The reference counting - * should work in such a way that a subscriber with a pending request - * remains in memory. - */ -struct subscr_request { - struct llist_head entry; - - /* back reference */ - struct gsm_subscriber *subscr; - - /* the requested channel type */ - int channel_type; - - /* what did we do */ - int state; - - /* the callback data */ - gsm_cbfn *cbfn; - void *param; -}; - -enum { - REQ_STATE_INITIAL, - REQ_STATE_QUEUED, - REQ_STATE_PAGED, - REQ_STATE_FAILED_START, - REQ_STATE_DISPATCHED, -}; - static struct gsm_subscriber *get_subscriber(struct gsm_network *net, int type, const char *ident) { @@ -125,6 +94,7 @@ static int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, request->state = REQ_STATE_DISPATCHED; llist_del(&request->entry); subscr->in_callback = 1; + subscr->last_reason = request->reason; request->cbfn(hooknum, event, msg, data, request->param); subscr->in_callback = 0; @@ -216,7 +186,7 @@ static void subscr_send_paging_request(struct gsm_subscriber *subscr) } void subscr_get_channel(struct gsm_subscriber *subscr, - int type, gsm_cbfn *cbfn, void *param) + int type, gsm_cbfn *cbfn, void *param, const char *reason) { struct subscr_request *request; @@ -234,6 +204,7 @@ void subscr_get_channel(struct gsm_subscriber *subscr, request->cbfn = cbfn; request->param = param; request->state = REQ_STATE_INITIAL; + request->reason = reason; /* * FIXME: We might be able to assign more than one diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 9fb1e9e..75b441a 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -77,7 +77,7 @@ int main(int argc, char **argv) subscr->net = network; /* Ask for a channel... */ - subscr_get_channel(subscr, RSL_CHANNEED_TCH_F, subscr_cb, (void*)0x2342L); + subscr_get_channel(subscr, RSL_CHANNEED_TCH_F, subscr_cb, (void*)0x2342L, "dummy"); while (!s_end) { osmo_select_main(0); From holger at freyther.de Fri Dec 5 09:36:49 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Fri, 5 Dec 2014 10:36:49 +0100 Subject: [PATCH 1/2] logging: Make it possible to print category/subsys and timestamps Message-ID: <1417772210-25290-1-git-send-email-holger@freyther.de> From: Holger Hans Peter Freyther We want to see from which category/subsystem a certain log message is coming from and use a different timestamp format as well. Add two new bitfields. This doesn't change the size of the structure and on 32bit we still have 27bits left. The extended timestamp will take preference over the current and default timestamp format. Fixes: SYS#602 --- include/osmocom/core/logging.h | 6 +++++ src/logging.c | 50 +++++++++++++++++++++++++++++++++++++++++- src/vty/logging_vty.c | 49 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 101 insertions(+), 4 deletions(-) diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index c37c9f3..ba41762 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -154,6 +154,10 @@ struct log_target { unsigned int print_timestamp:1; /*! \brief should log messages be prefixed with a filename? */ unsigned int print_filename:1; + /*! \brief should log messages be prefixed with a category name? */ + unsigned int print_category:1; + /*! \brief should log messages be prefixed with an extended timestamp? */ + unsigned int print_ext_timestamp:1; /*! \brief the type of this log taget */ enum log_target_type type; @@ -202,8 +206,10 @@ int log_set_context(uint8_t ctx, void *value); void log_set_all_filter(struct log_target *target, int); void log_set_use_color(struct log_target *target, int); +void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int); +void log_set_print_category(struct log_target *target, int); void log_set_log_level(struct log_target *target, int log_level); void log_parse_category_mask(struct log_target *target, const char* mask); int log_parse_level(const char *lvl); diff --git a/src/logging.c b/src/logging.c index a4c3e0e..7b53277 100644 --- a/src/logging.c +++ b/src/logging.c @@ -226,6 +226,14 @@ static const char* color(int subsys) return NULL; } +static const char* category_name(int subsys) +{ + if (subsys < osmo_log_info->num_cat) + return osmo_log_info->cat[subsys].name; + + return NULL; +} + static void _output(struct log_target *target, unsigned int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap) @@ -244,7 +252,17 @@ static void _output(struct log_target *target, unsigned int subsys, } } if (!cont) { - if (target->print_timestamp) { + if (target->print_ext_timestamp) { + struct tm tm; + time_t timep = time(NULL); + localtime_r(&timep, &tm); + ret = snprintf(buf + offset, rem, "%04d%02d%02d%02d%02d%02d000 ", + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } else if (target->print_timestamp) { char *timestr; time_t tm; tm = time(NULL); @@ -255,6 +273,12 @@ static void _output(struct log_target *target, unsigned int subsys, goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); } + if (target->print_category) { + ret = snprintf(buf + offset, rem, "%s ", category_name(subsys)); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } if (target->print_filename) { ret = snprintf(buf + offset, rem, "<%4.4x> %s:%d ", subsys, file, line); @@ -426,6 +450,19 @@ void log_set_print_timestamp(struct log_target *target, int print_timestamp) target->print_timestamp = print_timestamp; } +/*! \brief Enable or disable printing of extended timestamps while logging + * \param[in] target Log target to be affected + * \param[in] print_timestamp Enable (1) or disable (0) timestamps + * + * When both timestamp and extended timestamp is enabled then only + * the extended timestamp will be used. The format of the timestamp + * is YYYYMMDDhhmmssnnn. + */ +void log_set_print_extended_timestamp(struct log_target *target, int print_timestamp) +{ + target->print_ext_timestamp = print_timestamp; +} + /*! \brief Enable or disable printing of the filename while logging * \param[in] target Log target to be affected * \param[in] print_filename Enable (1) or disable (0) filenames @@ -435,6 +472,17 @@ void log_set_print_filename(struct log_target *target, int print_filename) target->print_filename = print_filename; } +/*! \brief Enable or disable printing of the category name + * \param[in] target Log target to be affected + * \param[in] print_catname Enable (1) or disable (0) filenames + * + * Print the category/subsys name in front of every log message. + */ +void log_set_print_category(struct log_target *target, int print_category) +{ + target->print_category = print_category; +} + /*! \brief Set the global log level for a given log target * \param[in] target Log target to be affected * \param[in] log_level New global log level diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 47877fe..bb19a31 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -1,6 +1,6 @@ /* OpenBSC logging helper for the VTY */ /* (C) 2009-2010 by Harald Welte - * (C) 2009-2010 by Holger Hans Peter Freyther + * (C) 2009-2014 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -149,6 +149,40 @@ DEFUN(logging_prnt_timestamp, return CMD_SUCCESS; } +DEFUN(logging_prnt_ext_timestamp, + logging_prnt_ext_timestamp_cmd, + "logging print extended-timestamp (0|1)", + LOGGING_STR "Log output settings\n" + "Configure log message timestamping\n" + "Don't prefix each log message\n" + "Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + + if (!tgt) + return CMD_WARNING; + + log_set_print_extended_timestamp(tgt, atoi(argv[0])); + return CMD_SUCCESS; +} + +DEFUN(logging_prnt_cat, + logging_prnt_cat_cmd, + "logging print category (0|1)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with category/subsystem name\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + + if (!tgt) + return CMD_WARNING; + + log_set_print_category(tgt, atoi(argv[0])); + return CMD_SUCCESS; +} + DEFUN(logging_level, logging_level_cmd, NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */ @@ -625,8 +659,13 @@ static int config_write_log_single(struct vty *vty, struct log_target *tgt) vty_out(vty, " logging color %u%s", tgt->use_color ? 1 : 0, VTY_NEWLINE); - vty_out(vty, " logging timestamp %u%s", tgt->print_timestamp ? 1 : 0, - VTY_NEWLINE); + vty_out(vty, " logging print cateyory %d%s", + tgt->print_ext_timestamp ? 1 : 0, VTY_NEWLINE); + if (tgt->print_ext_timestamp) + vty_out(vty, " logging print extended-timestamp 1%s", VTY_NEWLINE); + else + vty_out(vty, " logging timestamp %u%s", + tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(level_lower, log_level_str(tgt->loglevel)); @@ -670,6 +709,8 @@ void logging_vty_add_cmds(const struct log_info *cat) install_element_ve(&logging_fltr_all_cmd); install_element_ve(&logging_use_clr_cmd); install_element_ve(&logging_prnt_timestamp_cmd); + install_element_ve(&logging_prnt_ext_timestamp_cmd); + install_element_ve(&logging_prnt_cat_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -685,6 +726,8 @@ void logging_vty_add_cmds(const struct log_info *cat) install_element(CFG_LOG_NODE, &logging_fltr_all_cmd); install_element(CFG_LOG_NODE, &logging_use_clr_cmd); install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); install_element(CONFIG_NODE, &cfg_log_stderr_cmd); -- 2.1.3 From holger at freyther.de Fri Dec 5 09:36:50 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Fri, 5 Dec 2014 10:36:50 +0100 Subject: [PATCH 2/2] logging: Call color only once and use the result In-Reply-To: <1417772210-25290-1-git-send-email-holger@freyther.de> References: <1417772210-25290-1-git-send-email-holger@freyther.de> Message-ID: <1417772210-25290-2-git-send-email-holger@freyther.de> From: Holger Hans Peter Freyther First we check if a color is defined and then we call it again and use the result. Avoid the second call and use the result of the previous call. --- src/logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logging.c b/src/logging.c index 7b53277..36c31c4 100644 --- a/src/logging.c +++ b/src/logging.c @@ -245,7 +245,7 @@ static void _output(struct log_target *target, unsigned int subsys, if (target->use_color) { const char *c = color(subsys); if (c) { - ret = snprintf(buf + offset, rem, "%s", color(subsys)); + ret = snprintf(buf + offset, rem, "%s", c); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -- 2.1.3 From Max.Suraev at fairwaves.co Tue Dec 9 10:43:34 2014 From: Max.Suraev at fairwaves.co (=?UTF-8?B?4piO?=) Date: Tue, 09 Dec 2014 10:43:34 +0000 Subject: sms sender Message-ID: <5486D256.4010206@fairwaves.co> Hi all. I recall the question of sending sms through OpenBSC via command-line popped-up few times before. Shall we add attached snippet to openbsc/contrib? -- best regards, Max, http://fairwaves.co -------------- next part -------------- #!/usr/bin/expect # Usage: ./sms.exp 123456789 "LOL, sms from hell" spawn telnet localhost 4242 expect "OpenBSC> " send "subscriber imsi [lindex $argv 0] sms sender id 1 send [lindex $argv 1]\r" expect "OpenBSC> " send "exit\r" From rs515794 at gmail.com Tue Dec 9 14:16:25 2014 From: rs515794 at gmail.com (ramesh shankar) Date: Tue, 9 Dec 2014 09:16:25 -0500 Subject: radio priority setting Message-ID: Hello Can anybody suggest where its specified "Radio priority (PDP or SMS)" I can see radio priority setting in gprs_gmm.c but changing that is not working. also in gprs_gmm.c its mention radio_pri /* Radio priority 10.5.7.2 */ /* msgb_v_put(msg, pdp->lib->radio_pri) but under attach accept in gprs_gmm.c its aa->radio_prio = 3; are they same or typo any suggestion please RS -------------- next part -------------- An HTML attachment was scrubbed... URL: From arik at cybercanary.com Wed Dec 10 10:30:19 2014 From: arik at cybercanary.com (arik at cybercanary.com) Date: Wed, 10 Dec 2014 10:30:19 +0000 Subject: Set an openBSC with demo BTS Message-ID: <20141210103019.Horde.cULo6e51_AcLqAyDJnAtlA1@166.62.36.162> Hi, I'm trying to set an "OpenBSC network-in-the-box (NITB) mode" using a BTS demo/simulator, but couldn't find any good instructions guide for it. Any help will happily accepted. I followed this guide: http://openbsc.osmocom.org/trac/wiki/Building_OpenBSC and tried to use this simulator instructions: http://openbsc.osmocom.org/trac/wiki/simulation Best regards, Arik From holger at freyther.de Fri Dec 12 16:45:10 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Fri, 12 Dec 2014 17:45:10 +0100 Subject: [PATCH] ipa: Set the BSC_FD_WRITE in ipa_client_conn_open Message-ID: <1418402710-9721-1-git-send-email-holger@freyther.de> From: Holger Hans Peter Freyther When the link is being created BSC_FD_WRITE and BSC_FD_READ are being ored into the flag. When the socket connects the first time the ipa_client_fd_cb function is called and the link->state is moved from connecting to connect. In case the connection drops and ipa_client_conn_open is called again the BSC_FD_WRITE flag might not be set. This means that after the socket is connected, ipa_client_fd_cb will not be called. This means that the updown_cb will not be called until after the first write or read on the socket. It might even lead to missing some data. When re-connecting set the write flag again. --- src/input/ipa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/input/ipa.c b/src/input/ipa.c index e2da6f4..1ddf802 100644 --- a/src/input/ipa.c +++ b/src/input/ipa.c @@ -218,6 +218,7 @@ int ipa_client_conn_open(struct ipa_client_conn *link) return ret; } link->ofd->fd = ret; + link->ofd->when |= BSC_FD_WRITE; if (osmo_fd_register(link->ofd) < 0) { close(ret); link->ofd->fd = -1; -- 2.1.3 From Lars.Rasmusson at sics.se Mon Dec 15 16:02:12 2014 From: Lars.Rasmusson at sics.se (Lars Rasmusson SICS) Date: Mon, 15 Dec 2014 17:02:12 +0100 Subject: Set an openBSC with demo BTS Message-ID: I am also trying to do that. How far have you gotten? I am stuck at bts connect: 'localhost'; waitForBTSReady. This is what I see # gst GNU Smalltalk ready st> PackageLoader fileInPackage: #FakeBTS Loading package OsmoLogging Loading package OsmoCore Loading package Parser Loading package PetitParser Loading package Sockets Loading package OsmoNetwork Loading package OsmoGSM Loading package FakeBTS PackageLoader PackageLoaderts := FakeBTS.BTS new. a BTS st> bts btsId: '1/0/0' a BTS st> bts connect: 'localhost'; waitForBTSReady. Stop Object: nil error: did not understand #+ MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254) UndefinedObject(Object)>>doesNotUnderstand: #+ (SysExcept.st:1407) Sockets.TCPSocketImpl(FileDescriptor)>>nextAvailable:into:startingAt: (FileDescr.st:802) optimized [] in Sockets.StreamSocket>>newReadBuffer: (Sockets.star#VFS.ZipFile/Sockets.st:1323) Sockets.ReadBuffer>>atEnd (Sockets.star#VFS.ZipFile/Buffers.st:129) Sockets.ReadBuffer>>pastEnd (Sockets.star#VFS.ZipFile/Buffers.st:137) Sockets.ReadBuffer(PositionableStream)>>next (PosStream.st:78) Sockets.StreamSocket>>next (Sockets.star#VFS.ZipFile/Sockets.st:1217) Sockets.StreamSocket>>nextByte (OsmoNetwork.star#VFS.ZipFile/core/Extensions.st:125) Sockets.StreamSocket>>nextBytes:signed: (OsmoNetwork.star#VFS.ZipFile/core/Extensions.st:113) Sockets.StreamSocket>>nextUshort (OsmoNetwork.star#VFS.ZipFile/core/Extensions.st:102) Osmo.IPADemuxer>>next (OsmoNetwork.star#VFS.ZipFile/ipa/IPAMuxer.st:39) [] in FakeBTS.BTSOmlConnection(FakeBTS.BTSConnectionBase)>>processOne (FakeBTS.star#VFS.ZipFile/BTSConnection.st:159) BlockClosure>>on:do:on:do: (BlkClosure.st:206) FakeBTS.BTSOmlConnection(FakeBTS.BTSConnectionBase)>>processOne (FakeBTS.star#VFS.ZipFile/BTSConnection.st:172) optimized [] in FakeBTS.BTSConnectionBase>>connect:port: (FakeBTS.star#VFS.ZipFile/BTSConnection.st:145) [] in Process>>onBlock:at:suspend: (Process.st:392) BlockClosure>>on:do: (BlkClosure.st:193) [] in Process>>onBlock:at:suspend: (Process.st:393) BlockClosure>>ensure: (BlkClosure.st:269) [] in Process>>onBlock:at:suspend: (Process.st:370) [] in BlockClosure>>asContext: (BlkClosure.st:179) BlockContext class>>fromClosure:parent: (BlkContext.st:68) *** HERE IT JUST WAITS AND I PRESS CTRL-C *** Object: nil error: interrupted!!! SystemExceptions.UserInterrupt(Exception)>>signal (ExcHandling.st:254) SystemExceptions.UserInterrupt class(Exception class)>>signal (ExcHandling.st:151) UndefinedObject(Object)>>userInterrupt (Object.st:1414) FakeBTS.BTS>>waitForBTSReady (FakeBTS.star#VFS.ZipFile/BTS.st:393) UndefinedObject>>executeStatements (a String:1) nil st> > > > Hi, > I'm trying to set an "OpenBSC network-in-the-box (NITB) mode" using a > BTS demo/simulator, but couldn't find any good instructions guide for > it. > Any help will happily accepted. > I followed this guide: > http://openbsc.osmocom.org/trac/wiki/Building_OpenBSC > and tried to use this simulator instructions: > http://openbsc.osmocom.org/trac/wiki/simulation > Best regards, > Arik -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at freyther.de Tue Dec 16 06:56:41 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Tue, 16 Dec 2014 07:56:41 +0100 Subject: Set an openBSC with demo BTS In-Reply-To: References: Message-ID: <20141216065641.GI22201@xiaoyu.lan> On Mon, Dec 15, 2014 at 05:02:12PM +0100, Lars Rasmusson SICS wrote: Good morning, > st> bts btsId: '1/0/0' > a BTS do you have a unit with the ID 1 configured in the BSC config? It looks the NITB/BSC is closing your connection and the above is the most likely reason for that. From holger at freyther.de Wed Dec 17 14:52:36 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Wed, 17 Dec 2014 15:52:36 +0100 Subject: [PATCH 2/2] bts: When one link drops.. check what needs to be dropped In-Reply-To: <1418827956-13024-1-git-send-email-holger@freyther.de> References: <1418827956-13024-1-git-send-email-holger@freyther.de> Message-ID: <1418827956-13024-2-git-send-email-holger@freyther.de> From: Holger Hans Peter Freyther In case a BTS is dropped, iterate over the list of BTS and check if a dependency is now missing and then drop the BTS. This check could lead to check of 256*256 checks (e.g. all BTS on each other in the chain and the master is being dropped). The performance aspect of it doesn't matter for our usecase. We expect to have pairs of BTS right now. --- openbsc/include/openbsc/gsm_data.h | 1 + openbsc/src/libbsc/bts_ipaccess_nanobts.c | 16 ++++++++++++++++ openbsc/src/libcommon/gsm_data.c | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 89db48b..ae6757d 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -440,5 +440,6 @@ int msc_ctrl_cmds_install(void); void bts_depend_mark(struct gsm_bts *bts, int dep); void bts_depend_clear(struct gsm_bts *bts, int dep); int bts_depend_check(struct gsm_bts *bts); +int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); #endif /* _GSM_DATA_H */ diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index 825a22e..9e1b3c2 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -551,6 +551,7 @@ void ipaccess_drop_rsl(struct gsm_bts_trx *trx) void ipaccess_drop_oml(struct gsm_bts *bts) { + struct gsm_bts *rdep_bts; struct gsm_bts_trx *trx; if (!bts->oml_link) @@ -564,6 +565,21 @@ void ipaccess_drop_oml(struct gsm_bts *bts) ipaccess_drop_rsl(trx); bts->ip_access.flags = 0; + + /* + * Go through the list and see if we are the depndency of a BTS + * and then drop the BTS. This can lead to some recursion but it + * should be fine in userspace. + * The oml_link is serving as recursion anchor for us and + * it is set to NULL some lines above. + */ + llist_for_each_entry(rdep_bts, &bts->network->bts_list, list) { + if (!bts_depend_is_depedency(rdep_bts, bts)) + continue; + LOGP(DLINP, LOGL_NOTICE, "Dropping BTS(%u) due BTS(%u).\n", + rdep_bts->nr, bts->nr); + ipaccess_drop_oml(rdep_bts); + } } /* This function is called once the OML/RSL link becomes up. */ diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 73041fc..7cb1d38 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -388,7 +388,7 @@ void bts_depend_clear(struct gsm_bts *bts, int dep) bts->depends_on[idx] &= ~(1 << bit); } -static int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other) +int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other) { int idx, bit; depends_calc_index_bit(other->nr, &idx, &bit); -- 2.1.3 From holger at freyther.de Wed Dec 17 14:52:35 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Wed, 17 Dec 2014 15:52:35 +0100 Subject: [PATCH 1/2] bts: Add some simple dependency between different BTS Message-ID: <1418827956-13024-1-git-send-email-holger@freyther.de> From: Holger Hans Peter Freyther E.g. for the sysmoBTS2050 we have the requirement that the first board connects before the second due clocking. The easiest point to enforce this is the BSC. Add a simple bitmask based system to allow to express dependencies for IP based systems. --- openbsc/include/openbsc/gsm_data.h | 5 +++ openbsc/include/openbsc/gsm_data_shared.h | 3 ++ openbsc/src/libbsc/bsc_vty.c | 63 +++++++++++++++++++++++++++++++ openbsc/src/libbsc/bts_ipaccess_nanobts.c | 7 ++++ openbsc/src/libcommon/gsm_data.c | 58 ++++++++++++++++++++++++++++ 5 files changed, 136 insertions(+) diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index e237ea2..89db48b 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -436,4 +436,9 @@ extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1]; int bsc_base_ctrl_cmds_install(void); int msc_ctrl_cmds_install(void); +/* dependency handling */ +void bts_depend_mark(struct gsm_bts *bts, int dep); +void bts_depend_clear(struct gsm_bts *bts, int dep); +int bts_depend_check(struct gsm_bts *bts); + #endif /* _GSM_DATA_H */ diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 001a526..5d84969 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -720,6 +720,9 @@ struct gsm_bts { /* supported codecs beside FR */ struct bts_codec_conf codec; + + /* BTS dependencies bit field */ + uint32_t depends_on[256/(8*4)]; #endif /* ROLE_BSC */ void *role; }; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 08f9a8e..d6d66c6 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -650,6 +650,23 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) vty_out(vty, " %sforce-combined-si%s", bts->force_combined_si ? "" : "no ", VTY_NEWLINE); + for (i = 0; i < ARRAY_SIZE(bts->depends_on); ++i) { + int j; + + if (bts->depends_on[i] == 0) + continue; + + for (j = 0; j < sizeof(bts->depends_on[i]) * 8; ++j) { + int bts_nr; + + if ((bts->depends_on[i] & (1<depends_on[i]) * 8) + j; + vty_out(vty, " depends-on-bts %d%s", bts_nr, VTY_NEWLINE); + } + } + config_write_bts_model(vty, bts); } @@ -2772,6 +2789,50 @@ DEFUN(cfg_bts_codec4, cfg_bts_codec4_cmd, return CMD_SUCCESS; } +DEFUN(cfg_bts_depends_on, cfg_bts_depends_on_cmd, + "depends-on-bts <0-255>", + "This BTS can only be started if another one is up\n" "BTS Number\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts *other_bts; + int dep = atoi(argv[0]); + + + if (!is_ipaccess_bts(bts)) { + vty_out(vty, "This feature is only available for IP systems.%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + other_bts = gsm_bts_num(bts->network, dep); + if (!other_bts || !is_ipaccess_bts(other_bts)) { + vty_out(vty, "This feature is only available for IP systems.%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + if (dep >= bts->nr) { + vty_out(vty, "%%Need to depend on an already declared unit.%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + bts_depend_mark(bts, dep); + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_no_depends_on, cfg_bts_no_depends_on_cmd, + "depeneds-on-bts <0-255>", + NO_STR "This BTS can only be started if another one is up\n" + "BTS Number\n") +{ + struct gsm_bts *bts = vty->index; + int dep = atoi(argv[0]); + + bts_depend_clear(bts, dep); + return CMD_SUCCESS; +} + #define TRX_TEXT "Radio Transceiver\n" /* per TRX configuration */ @@ -3383,6 +3444,8 @@ int bsc_vty_init(const struct log_info *cat) install_element(BTS_NODE, &cfg_bts_codec2_cmd); install_element(BTS_NODE, &cfg_bts_codec3_cmd); install_element(BTS_NODE, &cfg_bts_codec4_cmd); + install_element(BTS_NODE, &cfg_bts_depends_on_cmd); + install_element(BTS_NODE, &cfg_bts_no_depends_on_cmd); install_element(BTS_NODE, &cfg_trx_cmd); install_node(&trx_node, dummy_config_write); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index 9fa03bf..825a22e 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -590,6 +590,13 @@ ipaccess_sign_link_up(void *unit_data, struct e1inp_line *line, /* remove old OML signal link for this BTS. */ ipaccess_drop_oml(bts); + if (!bts_depend_check(bts)) { + LOGP(DLINP, LOGL_NOTICE, + "Dependency not full-filled for %u/%u/%u\n", + dev->site_id, dev->bts_id, dev->trx_id); + return NULL; + } + /* create new OML link. */ sign_link = bts->oml_link = e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1], diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 03e9b85..73041fc 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -364,3 +364,61 @@ int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **ar return ret; } +/* Assume there are only 256 possible bts */ +osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); +static void depends_calc_index_bit(int bts_nr, int *idx, int *bit) +{ + *idx = bts_nr / (8 * 4); + *bit = bts_nr % (8 * 4); +} + +void bts_depend_mark(struct gsm_bts *bts, int dep) +{ + int idx, bit; + depends_calc_index_bit(dep, &idx, &bit); + + bts->depends_on[idx] |= 1 << bit; +} + +void bts_depend_clear(struct gsm_bts *bts, int dep) +{ + int idx, bit; + depends_calc_index_bit(dep, &idx, &bit); + + bts->depends_on[idx] &= ~(1 << bit); +} + +static int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other) +{ + int idx, bit; + depends_calc_index_bit(other->nr, &idx, &bit); + + /* Check if there is a depends bit */ + return (base->depends_on[idx] & (1 << bit)) > 0; +} + +static int bts_is_online(struct gsm_bts *bts) +{ + /* TODO: support E1 BTS too */ + if (!is_ipaccess_bts(bts)) + return 1; + + if (!bts->oml_link) + return 0; + + return bts->mo.nm_state.operational == NM_OPSTATE_ENABLED; +} + +int bts_depend_check(struct gsm_bts *bts) +{ + struct gsm_bts *other_bts; + + llist_for_each_entry(other_bts, &bts->network->bts_list, list) { + if (!bts_depend_is_depedency(bts, other_bts)) + continue; + if (bts_is_online(other_bts)) + continue; + return 0; + } + return 1; +} -- 2.1.3 From holger at freyther.de Wed Dec 17 20:24:04 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Wed, 17 Dec 2014 21:24:04 +0100 Subject: [PATCH] ho: Make sure the timer is always stopped Message-ID: <1418847844-24566-1-git-send-email-holger@freyther.de> From: Holger Hans Peter Freyther In case of a ho_chan_activ_nack (sent due another bug inside both sysmobts and openbsc) the code would not stop the timer but free the datastructure. This can lead to a clear segfault when the timer has expired. Create a "free" function which is responsible to detach the handover structure, stop the timer (which is idempotent) and free the structure. --- openbsc/src/libbsc/handover_logic.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index 22f9883..9284f7e 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -54,6 +54,13 @@ struct bsc_handover { static LLIST_HEAD(bsc_handovers); +static void handover_free(struct bsc_handover *ho) +{ + osmo_timer_del(&ho->T3103); + llist_del(&ho->list); + talloc_free(ho); +} + static struct bsc_handover *bsc_ho_by_new_lchan(struct gsm_lchan *new_lchan) { struct bsc_handover *ho; @@ -169,9 +176,7 @@ void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan) if (free_lchan) lchan_release(ho->new_lchan, 0, RSL_REL_LOCAL_END); - osmo_timer_del(&ho->T3103); - llist_del(&ho->list); - talloc_free(ho); + handover_free(ho); } /* T3103 expired: Handover has failed without HO COMPLETE or HO FAIL */ @@ -186,8 +191,7 @@ static void ho_T3103_cb(void *_ho) ho->new_lchan->conn->ho_lchan = NULL; ho->new_lchan->conn = NULL; lchan_release(ho->new_lchan, 0, RSL_REL_LOCAL_END); - llist_del(&ho->list); - talloc_free(ho); + handover_free(ho); } /* RSL has acknowledged activation of the new lchan */ @@ -234,8 +238,7 @@ static int ho_chan_activ_nack(struct gsm_lchan *new_lchan) new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; - llist_del(&ho->list); - talloc_free(ho); + handover_free(ho); /* FIXME: maybe we should try to allocate a new LCHAN here? */ @@ -282,9 +285,7 @@ static int ho_gsm48_ho_compl(struct gsm_lchan *new_lchan) rsl_lchan_set_state(ho->old_lchan, LCHAN_S_INACTIVE); lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); - llist_del(&ho->list); - talloc_free(ho); - + handover_free(ho); return 0; } @@ -293,6 +294,7 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan) { struct gsm_network *net = old_lchan->ts->trx->bts->network; struct bsc_handover *ho; + struct gsm_lchan *new_lchan; ho = bsc_ho_by_old_lchan(old_lchan); if (!ho) { @@ -302,15 +304,15 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan) osmo_counter_inc(net->stats.handover.failed); - osmo_timer_del(&ho->T3103); - llist_del(&ho->list); + new_lchan = ho->new_lchan; /* release the channel and forget about it */ ho->new_lchan->conn->ho_lchan = NULL; ho->new_lchan->conn = NULL; - lchan_release(ho->new_lchan, 0, RSL_REL_LOCAL_END); + handover_free(ho); + + lchan_release(new_lchan, 0, RSL_REL_LOCAL_END); - talloc_free(ho); return 0; } -- 2.1.3 From holger at freyther.de Thu Dec 18 17:34:55 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Thu, 18 Dec 2014 18:34:55 +0100 Subject: [PATCH] ho: Copy the multirate config to the new lchan Message-ID: <1418924095-12295-1-git-send-email-holger@freyther.de> From: Holger Hans Peter Freyther The new lchan will be in speech mode already but for AMR we will need to provide a working multirate config in the channel activation, otherwise the channel act might be nacked. Copy the config from the current lchan into the new lchan. The abis code simply added the mrconf if the speech mode was amr. Before this commit the invalidate mrconf with all zeroes was copied/sent. --- openbsc/src/libbsc/handover_logic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index 9284f7e..ff6e993 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -133,6 +133,7 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) new_lchan->bs_power = old_lchan->bs_power; new_lchan->rsl_cmode = old_lchan->rsl_cmode; new_lchan->tch_mode = old_lchan->tch_mode; + new_lchan->mr_conf = old_lchan->mr_conf; new_lchan->conn = old_lchan->conn; new_lchan->conn->ho_lchan = new_lchan; -- 2.1.3 From jerlbeck at sysmocom.de Mon Dec 22 09:58:45 2014 From: jerlbeck at sysmocom.de (Jacob Erlbeck) Date: Mon, 22 Dec 2014 10:58:45 +0100 Subject: [PATCH 1/2] ipa: Add forward declaration of struct osmo_fd Message-ID: <1419242326-11385-1-git-send-email-jerlbeck@sysmocom.de> A pointer to struct osmo_fd is used in a few prototypes declared in gsm/ipa.h, but is neither declared explicitly nor is such a declaration reachable via the given include directives. This patch adds a forward declaration of this type to ensure proper compilation. Sponsored-by: On-Waves ehf --- include/osmocom/gsm/ipa.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/osmocom/gsm/ipa.h b/include/osmocom/gsm/ipa.h index 2878676..1227ee1 100644 --- a/include/osmocom/gsm/ipa.h +++ b/include/osmocom/gsm/ipa.h @@ -5,6 +5,8 @@ #include #include +struct osmo_fd; + /* internal (host-only) data structure */ struct ipaccess_unit { uint16_t site_id; -- 1.9.1 From jerlbeck at sysmocom.de Mon Dec 22 09:58:46 2014 From: jerlbeck at sysmocom.de (Jacob Erlbeck) Date: Mon, 22 Dec 2014 10:58:46 +0100 Subject: [PATCH 2/2] ipa: Return -errno instead of -1 in ipa_send In-Reply-To: <1419242326-11385-1-git-send-email-jerlbeck@sysmocom.de> References: <1419242326-11385-1-git-send-email-jerlbeck@sysmocom.de> Message-ID: <1419242326-11385-2-git-send-email-jerlbeck@sysmocom.de> Currently, the ipa_send function returns -1 in one execution branch to indicate an error and -EIO in another. This is not consistent and can lead to a misinterpretation of the error code, since -1 is -EPERM and in general, EPERM is not returned by write(2). This patch changes the return code to -errno instead of -1 for the case that write(2) fails for same reason. So -rc is always a sensible error value if there is a failure. Sponsored-by: On-Waves ehf --- src/gsm/ipa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index ce98f08..7cff1e8 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -199,7 +199,7 @@ int ipa_send(int fd, const void *msg, size_t msglen) ret = write(fd, msg, msglen); if (ret < 0) - return ret; + return -errno; if (ret < msglen) { LOGP(DLINP, LOGL_ERROR, "ipa_send: short write\n"); return -EIO; -- 1.9.1 From jerlbeck at sysmocom.de Mon Dec 22 10:14:34 2014 From: jerlbeck at sysmocom.de (Jacob Erlbeck) Date: Mon, 22 Dec 2014 11:14:34 +0100 Subject: [PATCH] ipa: Declare all structs used Message-ID: <1419243274-14268-1-git-send-email-jerlbeck@sysmocom.de> A few declarations are missing. This patch adds forward declarations for struct used for pointers only and an include directive (osmocom/core/select.h) to get a full definition of struct osmo_fd. Sponsored-by: On-Waves ehf --- include/osmocom/abis/ipa.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/osmocom/abis/ipa.h b/include/osmocom/abis/ipa.h index 19815f6..6f40a40 100644 --- a/include/osmocom/abis/ipa.h +++ b/include/osmocom/abis/ipa.h @@ -4,8 +4,13 @@ #include #include #include +#include #include +struct e1inp_line; +struct e1inp_ts; +struct msgb; + struct ipa_server_link { struct e1inp_line *line; struct osmo_fd ofd; -- 1.9.1 From arikdlug at gmail.com Mon Dec 22 17:50:49 2014 From: arikdlug at gmail.com (arik dlugatch) Date: Mon, 22 Dec 2014 19:50:49 +0200 Subject: Set an openBSC with demo BTS In-Reply-To: <20141216065641.GI22201@xiaoyu.lan> References: <20141216065641.GI22201@xiaoyu.lan> Message-ID: Hi guys, Sorry for not replying. I was O.O.O and didn't work on the setup of the system. You've mentioned the starterkit. Where I can find it, and what device did you provisioned? Supposing I got a working HLR and NITB configuration, what about the BTS? And one last thing, I couldn't find the package feed but it would be lovely if you can upload it again for Debian 7.0. Lars, did you solve all your problems? I'll be happy to use your experience and feedbacks. Thanks, Arik 2014-12-16 8:56 GMT+02:00 Holger Hans Peter Freyther : > On Mon, Dec 15, 2014 at 05:02:12PM +0100, Lars Rasmusson SICS wrote: > > Good morning, > > > > st> bts btsId: '1/0/0' > > a BTS > > do you have a unit with the ID 1 configured in the BSC config? It > looks the NITB/BSC is closing your connection and the above is the > most likely reason for that. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at freyther.de Mon Dec 29 09:21:35 2014 From: holger at freyther.de (Holger Hans Peter Freyther) Date: Mon, 29 Dec 2014 10:21:35 +0100 Subject: handover crash Message-ID: <20141229092135.GA4842@xiaoyu.lan> hi, this is a note. We had a crash with handover. So ho->new_lchan points to a "valid" lchan but ho->new_lchan->conn is NULL. Which means the new lchan failed/was freed/re-used.. but the "ho" entry wasn't killed. I thought I fixed such a bug recently but obviously no. Program terminated with signal 11, Segmentation fault. #0 0x00000000004078a7 in ho_T3103_cb (_ho=) at handover_logic.c:192 192 ho->new_lchan->conn->ho_lchan = NULL; (gdb) p *ho->new_lchan $1 = {ts = 0x7f9c1439d028, nr = 0 '\000', type = GSM_LCHAN_NONE, rsl_cmode = RSL_CMOD_SPD_SPEECH, tch_mode = GSM48_CMODE_SPEECH_V1, csd_mode = LCHAN_CSD_M_NT, state = LCHAN_S_NONE, broken_reason = 0x44c5e3 "", bs_power = 0 '\000', ms_power = 0 '\000', encr = {alg_id = 2 '\002', key_len = 8 '\b', key = "\314]\204\276J6\204\000\000\000\000\000\000\000\000"}, mr_conf = {smod = 0 '\000', spare = 0 '\000', icmi = 0 '\000', nscb = 0 '\000', ver = 0 '\000', m4_75 = 0 '\000', m5_15 = 0 '\000', m5_90 = 0 '\000', m6_70 = 0 '\000', m7_40 = 0 '\000', m7_95 = 0 '\000', m10_2 = 0 '\000', m12_2 = 0 '\000'}, sapis = "\000\000\000\000\000\000\000", sacch_deact = 0, abis_ip = {bound_ip = 3232247317, connect_ip = 3232247297, bound_port = 44336, connect_port = 5011, conn_id = 0, rtp_payload = 3 '\003', rtp_payload2 = 0 '\000', speech_mode = 0 '\000', rtp_socket = 0x0}, rqd_ta = 0 '\000', T3101 = {node = {rb_parent_color = 30560649, rb_right = 0x1e46618, rb_left = 0x1bcaf30}, list = {next = 0x7f9c1439e1c0, prev = 0x7f9c1439e1c0}, timeout = {tv_sec = 1419790405, tv_usec = 573730}, active = 0, cb = 0x41fd10 , data = 0x7f9c1439e130}, T3109 = {node = {rb_parent_color = 31559320, rb_right = 0x0, rb_left = 0x0}, list = { next = 0x7f9c1439e210, prev = 0x7f9c1439e210}, timeout = {tv_sec = 1419790684, tv_usec = 182786}, active = 0, cb = 0x41fa20 , data = 0x7f9c1439e130}, T3111 = {node = {rb_parent_color = 29138256, rb_right = 0x0, rb_left = 0x0}, list = { next = 0x7f9c1439e260, prev = 0x7f9c1439e260}, timeout = {tv_sec = 1419791140, tv_usec = 812411}, active = 0, cb = 0x41fa70 , data = 0x7f9c1439e130}, error_timer = {node = {rb_parent_color = 30539945, rb_right = 0x1bc9470, rb_left = 0x1c75728}, list = {next = 0x7f9c1439e2b0, prev = 0x7f9c1439e2b0}, timeout = { tv_sec = 1419790405, tv_usec = 637282}, active = 0, cb = 0x41d0f0 , data = 0x7f9c1439e130}, act_timer = {node = {rb_parent_color = 29769248, rb_right = 0x0, rb_left = 0x0}, list = {next = 0x7f9c1439e300, prev = 0x7f9c1439e300}, timeout = { tv_sec = 1419791144, tv_usec = 812427}, active = 0, cb = 0x41bff0 , data = 0x7f9c1439e130}, rel_work = {node = {rb_parent_color = 0, rb_right = 0x0, rb_left = 0x0}, list = {next = 0x0, prev = 0x0}, timeout = {tv_sec = 0, tv_usec = 0}, active = 0, cb = 0, data = 0x0}, error_cause = 0 '\000', neigh_meas = {{arfcn = 0, bsic = 63 '?', rxlev = ",,'&\032\016-.+)", rxlev_cnt = 4376, last_seen_nr = 0 '\000'}, { arfcn = 0, bsic = 63 '?', rxlev = "\031\004$(' \037%*&", rxlev_cnt = 4372, last_seen_nr = 0 '\000'}, {arfcn = 0, bsic = 63 '?', rxlev = "%\017\004''&&&&%", rxlev_cnt = 4313, last_seen_nr = 0 '\000'}, {arfcn = 0, bsic = 63 '?', rxlev = "\027\026\024\031\030\031\033\003\027\025", rxlev_cnt = 3328, last_seen_nr = 0 '\000'}, {arfcn = 0, bsic = 63 '?', rxlev = "\000\002\001\001\001\003\002\000\000", rxlev_cnt = 1177, last_seen_nr = 48 '0'}, {arfcn = 0, bsic = 63 '?', rxlev = "\002\004\002\003\002\005\000\002\005\004", rxlev_cnt = 224, last_seen_nr = 18 '\022'}, {arfcn = 0, bsic = 0 '\000', rxlev = "\000\000\000\000\000\000\000\000\000", rxlev_cnt = 0, last_seen_nr = 0 '\000'}, {arfcn = 0, bsic = 0 '\000', rxlev = "\000\000\000\000\000\000\000\000\000", rxlev_cnt = 0, last_seen_nr = 0 '\000'}, {arfcn = 0, bsic = 0 '\000', rxlev = "\000\000\000\000\000\000\000\000\000", rxlev_cnt = 0, last_seen_nr = 0 '\000'}, {arfcn = 0, bsic = 0 '\000', rxlev = "\000\000\000\000\000\000\000\000\000", rxlev_cnt = 0, ---Type to continue, or q to quit--- last_seen_nr = 0 '\000'}}, meas_rep = {{lchan = 0x7f9c1439e130, nr = 0 '\000', flags = 0, ul = {full = {rx_lev = 3 '\003', rx_qual = 0 '\000'}, sub = { rx_lev = 63 '?', rx_qual = 0 '\000'}}, dl = {full = {rx_lev = 3 '\003', rx_qual = 7 '\a'}, sub = {rx_lev = 7 '\a', rx_qual = 7 '\a'}}, bs_power = 0 '\000', ms_timing_offset = 0 '\000', ms_l1 = {pwr = 30 '\036', ta = 0 '\000'}, num_cell = 3, cell = {{rxlev = 14 '\016', bsic = 63 '?', neigh_idx = 0 '\000', arfcn = 866, flags = 1}, {rxlev = 4 '\004', bsic = 63 '?', neigh_idx = 4 '\004', arfcn = 877, flags = 1}, {rxlev = 4 '\004', bsic = 63 '?', neigh_idx = 1 '\001', arfcn = 868, flags = 1}, {rxlev = 0 '\000', bsic = 0 '\000', neigh_idx = 0 '\000', arfcn = 0, flags = 0}, {rxlev = 0 '\000', bsic = 0 '\000', neigh_idx = 0 '\000', arfcn = 0, flags = 0}, {rxlev = 0 '\000', bsic = 0 '\000', neigh_idx = 0 '\000', arfcn = 0, flags = 0}}}, {lchan = 0x7f9c1439e130, nr = 0 '\000', flags = 0, ul = {full = { rx_lev = 35 '#', rx_qual = 0 '\000'}, sub = {rx_lev = 63 '?', rx_qual = 0 '\000'}}, dl = {full = {rx_lev = 44 ',', rx_qual = 0 '\000'}, sub = {rx_lev = 41 ')', rx_qual = 0 '\000'}}, bs_power = 0 '\000', ms_timing_offset = 0 '\000', ms_l1 = { pwr = 22 '\026', ta = 0 '\000'}, num_cell = 5, cell = {{rxlev = 43 '+', bsic = 63 '?', neigh_idx = 1 '\001', arfcn = 868, flags = 1}, {rxlev = 39 '\'', bsic = 63 '?', neigh_idx = 0 '\000', arfcn = 866, flags = 1}, {rxlev = 38 '&', bsic = 63 '?', neigh_idx = 3 '\003', arfcn = 873, flags = 1}, {rxlev = 22 '\026', bsic = 63 '?', neigh_idx = 5 '\005', arfcn = 881, flags = 1}, {rxlev = 2 '\002', bsic = 63 '?', neigh_idx = 2 '\002', arfcn = 871, flags = 1}, {rxlev = 0 '\000', bsic = 0 '\000', neigh_idx = 0 '\000', arfcn = 0, flags = 0}}}, { lchan = 0x7f9c1439e130, nr = 0 '\000', flags = 0, ul = {full = {rx_lev = 45 '-', rx_qual = 0 '\000'}, sub = {rx_lev = 63 '?', rx_qual = 0 '\000'}}, dl = {full = { rx_lev = 42 '*', rx_qual = 0 '\000'}, sub = {rx_lev = 41 ')', rx_qual = 0 '\000'}}, bs_power = 0 '\000', ms_timing_offset = 0 '\000', ms_l1 = {pwr = 30 '\036', ta = 0 '\000'}, num_cell = 5, cell = {{rxlev = 41 ')', bsic = 63 '?', neigh_idx = 1 '\001', arfcn = 868, flags = 1}, {rxlev = 38 '&', bsic = 63 '?', neigh_idx = 3 '\003', arfcn = 873, flags = 1}, {rxlev = 32 ' ', bsic = 63 '?', neigh_idx = 0 '\000', arfcn = 866, flags = 1}, {rxlev = 20 '\024', bsic = 63 '?', neigh_idx = 5 '\005', arfcn = 881, flags = 1}, {rxlev = 1 '\001', bsic = 63 '?', neigh_idx = 2 '\002', arfcn = 871, flags = 1}, {rxlev = 0 '\000', bsic = 0 '\000', neigh_idx = 0 '\000', arfcn = 0, flags = 0}}}, {lchan = 0x7f9c1439e130, nr = 0 '\000', flags = 0, ul = {full = {rx_lev = 37 '%', rx_qual = 0 '\000'}, sub = { rx_lev = 63 '?', rx_qual = 0 '\000'}}, dl = {full = {rx_lev = 44 ',', rx_qual = 0 '\000'}, sub = {rx_lev = 44 ',', rx_qual = 0 '\000'}}, bs_power = 0 '\000', ms_timing_offset = 0 '\000', ms_l1 = {pwr = 14 '\016', ta = 0 '\000'}, num_cell = 5, cell = {{rxlev = 44 ',', bsic = 63 '?', neigh_idx = 1 '\001', arfcn = 868, flags = 1}, {rxlev = 38 '&', bsic = 63 '?', neigh_idx = 3 '\003', arfcn = 873, flags = 1}, {rxlev = 31 '\037', bsic = 63 '?', neigh_idx = 0 '\000', arfcn = 866, flags = 1}, {rxlev = 25 '\031', bsic = 63 '?', neigh_idx = 5 '\005', arfcn = 881, flags = 1}, {rxlev = 1 '\001', bsic = 63 '?', neigh_idx = 2 '\002', arfcn = 871, flags = 1}, {rxlev = 0 '\000', bsic = 0 '\000', neigh_idx = 0 '\000', arfcn = 0, flags = 0}}}, {lchan = 0x7f9c1439e130, nr = 0 '\000', flags = 0, ul = {full = {rx_lev = 23 '\027', rx_qual = 0 '\000'}, sub = { rx_lev = 63 '?', rx_qual = 0 '\000'}}, dl = {full = {rx_lev = 44 ',', ---Type to continue, or q to quit--- rx_qual = 4 '\004'}, sub = {rx_lev = 43 '+', rx_qual = 0 '\000'}}, bs_power = 0 '\000', ms_timing_offset = 0 '\000', ms_l1 = {pwr = 10 '\n', ta = 0 '\000'}, num_cell = 5, cell = {{rxlev = 44 ',', bsic = 63 '?', neigh_idx = 1 '\001', arfcn = 868, flags = 1}, {rxlev = 38 '&', bsic = 63 '?', neigh_idx = 3 '\003', arfcn = 873, flags = 1}, {rxlev = 37 '%', bsic = 63 '?', neigh_idx = 0 '\000', arfcn = 866, flags = 1}, {rxlev = 24 '\030', bsic = 63 '?', neigh_idx = 5 '\005', arfcn = 881, flags = 1}, {rxlev = 1 '\001', bsic = 63 '?', neigh_idx = 2 '\002', arfcn = 871, flags = 1}, {rxlev = 0 '\000', bsic = 0 '\000', neigh_idx = 0 '\000', arfcn = 0, flags = 0}}}, {lchan = 0x7f9c1439e130, nr = 0 '\000', flags = 0, ul = {full = {rx_lev = 30 '\036', rx_qual = 0 '\000'}, sub = { rx_lev = 63 '?', rx_qual = 0 '\000'}}, dl = {full = {rx_lev = 39 '\'', rx_qual = 2 '\002'}, sub = {rx_lev = 38 '&', rx_qual = 0 '\000'}}, bs_power = 0 '\000', ms_timing_offset = 0 '\000', ms_l1 = {pwr = 26 '\032', ta = 0 '\000'}, num_cell = 5, cell = {{rxlev = 42 '*', bsic = 63 '?', neigh_idx = 0 '\000', arfcn = 866, flags = 1}, {rxlev = 39 '\'', bsic = 63 '?', neigh_idx = 1 '\001', arfcn = 868, flags = 1}, {rxlev = 37 '%', bsic = 63 '?', neigh_idx = 3 '\003', arfcn = 873, flags = 1}, {rxlev = 25 '\031', bsic = 63 '?', neigh_idx = 5 '\005', arfcn = 881, flags = 1}, {rxlev = 3 '\003', bsic = 63 '?', neigh_idx = 2 '\002', arfcn = 871, flags = 1}, {rxlev = 0 '\000', bsic = 0 '\000', neigh_idx = 0 '\000', arfcn = 0, flags = 0}}}}, meas_rep_idx = 0, rqd_ref = 0x0, conn = 0x0} From ciaby at autistici.org Mon Dec 29 19:37:58 2014 From: ciaby at autistici.org (Ciaby) Date: Mon, 29 Dec 2014 21:37:58 +0200 Subject: handover crash In-Reply-To: <20141229092135.GA4842@xiaoyu.lan> References: <20141229092135.GA4842@xiaoyu.lan> Message-ID: <54A1AD96.3070100@autistici.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 12/29/2014 11:21 AM, Holger Hans Peter Freyther wrote: > hi, > > this is a note. We had a crash with handover. So ho->new_lchan > points to a "valid" lchan but ho->new_lchan->conn is NULL. Which > means the new lchan failed/was freed/re-used.. but the "ho" entry > wasn't killed. I thought I fixed such a bug recently but obviously > no. Yep, looks a lot like the handover crashes we were having some time ago :) We fixed it by disabling handover, as we can't spend too much time on it when we have a production network running. Ping me/us (Rhizomatica) if you want more info about our crashes. Cheers Ciaby -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJUoa2UAAoJEPU83OtbD4fQAS0P/R4H+zAEv9kvRN205bFrOvSI Ia5EHdmU+xOT35d/sIqXmrOAIXpnaXue7m0qWICb0f7crML/jmaospEibIB6AyFk yKwaGTqp/EKiSus1UV1Pnp3yJjWeSkdAhWyfyC8MmXcvl4LYlyLap3frFO69FyK5 coFj6iOczYxcyjLpd4aeVxWxc8hXAotSa7sWarG7rSqs7kLXtphlHc5jhGYTQ8gr eipzh/YKXX/xCYUEVXZjkRK4dknvT7U/iuUE9JLbuxCal8szTqZIirUXN4DExF/D 9h83CC2jZ1yicXvNTvoLt7VFic27iuRLW601+mhv43jinGFK0/azlmqvFK/r+ebI NKOEZRZBa3/TgU1IiDonUUY1suT2V7Xla8zsvrxuZCjduDQ3HMRgnvQGb6vjAAjP rkPSmjqbmeW4mi5j5/+rBNBSXFIMjiHTmzpgFmAVG9shvLBjrdwXATg1ebxH+vtb FfCltzpTGoqaql2RjlmAyaKkqdps4xdQZ3kKVfPhRgWewCFFG0Qdr3Dm/9OX4+nV vYLgpdiTQqx1EsMT7ftMyIInO817Ihh3EJcDqLMzNYPer4K1p4/gY1DcSKKWPJRN Ffvh9jdXpwNIOAjLDZbxmXx2waRVOvOyRYSj0PRUGMs6YZlhhnVbGz9/7PCT6tzJ r1+/ULi7a1QSAiRBwpx8 =9Tgm -----END PGP SIGNATURE-----