aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
AgeCommit message (Collapse)AuthorFilesLines
2009-06-20introduce talloc all over OpenBSCHarald Welte18-47/+1957
2009-06-20fix setfault during registration of VTY TRX functionHarald Welte1-1/+1
2009-06-20Introduce BS and MS power control related functionsHarald Welte4-6/+195
* add bts->band field plus corresponding VTY and commandline argument * add trx->nominal_power and trx->max_power_red fields * add rsl_chan_bs_power_ctrl() to control TRX RF power for a given TS * add rsl_chan_ms_power_ctrl() to control MS RF power for a given lchan.
2009-06-20BS11: use abis_nm_set_{bts,radio}_attr()Harald Welte1-16/+14
BS11 should only use the raw message sending function if there is no standard alternative. For TRX and BTS attributes, we have the standard variant.
2009-06-15mncc: Add IMSI to gsm_mnccAndreas Eversberg1-2/+19
This allows us to do subscriber lookups based on IMSI and e.g. establish MT calls to subscribers with no assigned extension.
2009-06-14Merge branch 'mncc-harald'Harald Welte13-388/+2439
2009-06-14Merge branch 'master' of gitosis@bs11-abis.gnumonks.org:openbscHarald Welte1-1/+1
2009-06-14Use correct cause value and cause locationAndreas Eversberg1-10/+22
Fixed indication of cause value and location. Replaced plain cause numbers by definitions from header file. diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c index f323a2a..39e7b1f 100644 --- a/openbsc/src/gsm_04_08.c +++ b/openbsc/src/gsm_04_08.c @@ -1865,8 +1865,7 @@ int mncc_release_ind(struct gsm_network *net, struct gsm_trans *trans, memset(&rel, 0, sizeof(rel)); rel.callref = callref; - mncc_set_cause(&rel, GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_UNASSIGNED_NR); + mncc_set_cause(&rel, location, value); return mncc_recvmsg(net, trans, MNCC_REL_IND, &rel); } @@ -1879,7 +1878,9 @@ void free_trans(struct gsm_trans *trans) /* send release to L4, if callref still exists */ if (trans->callref) { /* Ressource unavailable */ - mncc_release_ind(trans->network, trans, trans->callref, 1, 47); + mncc_release_ind(trans->network, trans, trans->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_RESOURCE_UNAVAIL); if (trans->state != GSM_CSTATE_NULL) new_cc_state(trans, GSM_CSTATE_NULL); } @@ -1960,7 +1961,7 @@ static int setup_trig_pag_evt(unsigned int hooknum, unsigned int event, subscr->extension); /* Temporarily out of order */ mncc_release_ind(transt->network, transt, transt->callref, - 1, 27); + 1, GSM48_CC_CAUSE_DEST_OOO); transt->callref = 0; free_trans(transt); break; @@ -2270,7 +2271,8 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg) "This is not allowed!\n"); /* Temporarily out of order */ rc = mncc_release_ind(trans->network, trans, trans->callref, - 1, 47); + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_RESOURCE_UNAVAIL); trans->callref = 0; free_trans(trans); return rc; @@ -2287,7 +2289,8 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg) if ((trans_id_mask & 0x007f) == 0x7f) { /* no free transaction ID */ rc = mncc_release_ind(trans->network, trans, trans->callref, - 1, 47); + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_RESOURCE_UNAVAIL); trans->callref = 0; free_trans(trans); return rc; @@ -3373,14 +3376,18 @@ int mncc_send(struct gsm_network *net, int msg_type, void *arg) "unknown callref %d\n", data->called.number, get_mncc_name(msg_type), data->callref); /* Invalid call reference */ - return mncc_release_ind(net, NULL, data->callref, 1, 81); + return mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_INVAL_TRANS_ID); } if (!data->called.number[0] && !data->called.imsi[0]) { DEBUGP(DCC, "(bts - trx - ts - ti) " "Received '%s' from MNCC with " "no number or IMSI\n", get_mncc_name(msg_type)); /* Invalid number */ - return mncc_release_ind(net, NULL, data->callref, 1, 28); + return mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_INV_NR_FORMAT); } /* New transaction due to setup, find subscriber */ if (data->called.number[0]) @@ -3394,7 +3401,9 @@ int mncc_send(struct gsm_network *net, int msg_type, void *arg) "unknown subscriber %s\n", data->called.number, get_mncc_name(msg_type), data->called.number); /* Unknown subscriber */ - return mncc_release_ind(net, NULL, data->callref, 1, 1); + return mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_UNASSIGNED_NR); } /* If subscriber is not "attached" */ if (!subscr->lac) { @@ -3404,14 +3413,18 @@ int mncc_send(struct gsm_network *net, int msg_type, void *arg) get_mncc_name(msg_type), data->called.number); subscr_put(subscr); /* Temporarily out of order */ - return mncc_release_ind(net, NULL, data->callref, 1, 27); + return mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_DEST_OOO); } /* Create transaction */ if (!(trans = calloc(1, sizeof(struct gsm_trans)))) { DEBUGP(DCC, "No memory for trans.\n"); subscr_put(subscr); /* Ressource unavailable */ - mncc_release_ind(net, NULL, data->callref, 1, 47); + mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_RESOURCE_UNAVAIL); return -ENOMEM; } trans->callref = data->callref;
2009-06-14Fix lchan refcounting in case of IMSI DETACHAndreas Eversberg1-2/+0
Removed lchan_put() after IMSI detach function. We don't need to put lchan, because we don't hold a ressource.
2009-06-12make btstype2str return a const char* to make gcc 4.4 happyHolger Hans Peter Freyther1-1/+1
2009-06-12SMS: fix parsing of destination phone numberHarald Welte1-2/+3
2009-06-1204.08: Make mncc-harald branch workHarald Welte1-2/+2
This fixes two reasons for crashes due to uninitialized memory or wrong pointer passing introduced in my own mncc modifications
2009-06-12SMS: fix parsing of destination address BCDHarald Welte1-1/+1
this bug was introduced in Andreas' MNCC patches while altering decode_bcd_number().
2009-06-12abis_nm: fix printing of ADMinistrative stateHarald Welte1-1/+1
2009-06-11use less magic numbers (04.08 CC cause values)Harald Welte2-13/+30
Introduce a gsm48_cc_cause enum and use it from gsm_04_08 and MNCC, also make sure we use gsm48_cause_loc rather than plain numbers.
2009-06-10reworked MNCC codebaseHarald Welte11-384/+2407
This is Harald's reworked MNCC base, slowly heading towards integration into master. The key changes are: * provide much more structure to the data in gsm_mncc * encode_* and decode_* functions now take a structure rather than tons of individual arguments (whose order nobody can remember) * make sure we don't have copies of the same code everywhere by introducing mncc_set_cause() and mncc_release_ind() * save horizontal screen space if possible * make sure we break lines > 80 characters
2009-06-10Merge commit 'origin/master'Harald Welte6-41/+209
2009-06-10[pcap] Write incoming packages without the extra mISDN headerAndreas Eversberg1-4/+7
This patch fixes the PCAP logging. If frames are received from E1 interface, an 8 byte mISDN header (MISDN_HEADER_LEN) is in front of the RSL packet. When frames are transmitted to the E1 interface, the pcap_write_packet function will get a message buffer without the mISDN header in front of the RSL packet. The pcap file was tested and the output is correct. Follow up patches should make use the msgb->l2, make the ipaccess code use the pcap writing too...
2009-06-10Handle and dispatch paging requests in gsm_subscriberHolger Freyther1-2/+108
Implement subscr_get_channel and subscr_put_channel to a degree that SMS Submit and phone call scheduled at the same time will deliver both (one after the other).
2009-06-10Proposal for a "channel request" interface...Holger Freyther3-3/+14
Reuqests for a subscriber a stored within the gsm_subscriber datastructure and it will keep track how many channels are allocated for this user and of which type to decide on policy... e.g. attempt to submit SMS during a phone call and not doing paging but a simple (immediate) assignment of the channel...
2009-06-10[paging] Unbreak breakge when moving things into paging.cHolger Hans Peter Freyther1-1/+4
By calling _paging_request_stop with NULL for the lchan we have never used the paging complete callback... I didn't spot that when moving the code over and thought it is a great simplification to not call paging_request_stop first and then loop... *sigh* restore the old behaviour. Call the callback first and then free the requests.
2009-06-10[o&m] Dispatch a signal for nacked O&M messagesHolger Hans Peter Freyther2-0/+17
When trying to operate a nanoBTS900 on channels for 1800 or the other way around the "SET BTS ATTRIBUTES" message will be nacked. Dispatch all nacked messages from abis_nm via signals. Handle this in bsc_hack.c, print a small hint and exit the application as this is considered a fatal unrecoverable error (the exit is in the app, so a library can be more robust).
2009-06-10[bsc_hack] Sanity check for the GSM1800 nanoBTSHolger Hans Peter Freyther1-0/+20
The GSM1800 requires us to use channels between 512-885. When failing to provide such a channel the OML layer will fail and no RSL connection will be opened. Add a sanity check before creating the gsm_network and fail when the channels are not within the allowed range. Assume no one is operating a BS11 in the 1800 spectrum.
2009-06-10Remove use_lchan and put_lchan from location updating request pathsHolger Hans Peter Freyther1-8/+0
Andreas Eversberg is suspecting that some of these messages are not balanced and we are seeing a leak here. The general location updating request is guarded by the "location updating request" object inside the lchan that will keep the channel open for at least five seconds to get all the information we need.
2009-06-10Move the "finding" of the right BTS into paging.cHolger Hans Peter Freyther2-27/+44
Move the secret of how to find the BTS in a LocationArea into the paging layer. This allows to implement different strategies without changing other parts. E.g. we might want to try the BTS were the device was seen last and then try... There should be no semantic change and things should continue to work. It is sadly not tested though.
2009-06-10Search for BTS's in the Location Area of the subscriber we callHolger Hans Peter Freyther1-2/+1
Search for the MS at BTS in the location area of the called_subscr. This makes the case work where caller and receiver are not in the same location area. In fact this looks like a breach of a BSC/MSC separation, I have no idea if in true networks a BSC is managing BTS in different location areas.
2009-06-10introduce encoding/decoding functions for 04.08 CCHarald Welte2-27/+472
this patch implements the encoding/decoding of 04.08 call control information elements. It adds new functions to be used for the application interface patch, and is basis for the application patch (currently patch 36). Please ignore warnings about unused static functions for now. (Andreas Eversberg)
2009-06-10use gsm_bts_by_lac() function to start paging of all bts with same lacHarald Welte2-7/+28
when paging is successfull, the paging_request_stop() function is called with the current lchan, so the callback function will be called. for all other bts', the paging_request_stop() function is called without lchan, so the paging is stopped, but the callback function is not called. this ensures that only one paging result is received when paging multiple BTS. (Andreas Eversberg)
2009-06-10move openbsc into its own subdirectoryHarald Welte37-0/+20105