aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bssap.c
AgeCommit message (Collapse)AuthorFilesLines
2010-05-01bssap: Store the link_id in the new msgb->cb.Holger Hans Peter Freyther1-4/+6
Work with a new version of libosmocore that gets rid of additional pointers.
2010-04-19bsc_msc_ip: Crash fix on MO-Call starting with a SDCCHHolger Hans Peter Freyther1-2/+4
We do not assing a GSM Subscriber to Mobile Originated calls, when requesting a SDCCH and then starting call control we will crash here due trying to copy a NULL subscriber from the lchan to the other. We do not need to know the IMSI at the BSC so it is okay to not copy the subscriber around, we could even kill all subscriber handling in the future.
2010-04-19[alloc] Assign a TCH for LU when all SDCCHs are occupied.Holger Hans Peter Freyther1-1/+1
When the cell becomes visible we will be bombed with location updating requests and to reduce the load on the network we should assign as many channels for it as possible. During load peek it is even more important than to have a spare voice channel and in general the LU procedure is pretty fast.
2010-04-18bssap: Move parsing of paging into the paging section...Holger Hans Peter Freyther1-2/+2
2010-04-17Use osmocore tlv definition for GSM0808.Holger Hans Peter Freyther1-32/+4
2010-04-09[rsl] Set the right state when asking for the activation.Holger Hans Peter Freyther1-0/+1
Set the state to activation to avoid a warning about the getting a CHAN ACK without waiting for it. We set it in the code to make sure it is set after all error checking to avoid inconsistent state as the state is only set back to NONE/ACT due replies from the BTS.
2010-04-08bssap: Reset the msc_data on the lchan earlier/just in caseHolger Hans Peter Freyther1-0/+1
The refcount should drop to zero immediately and then the msc_data would be reset automatically but it is better to remove all traces of it right away.
2010-04-08bssap: Use the new method to give up the secondary lchan and related resourcesHolger Hans Peter Freyther1-2/+2
2010-04-08bssap: Forget the secondary lchan in the MSC data and forget the MSC dataHolger Hans Peter Freyther1-1/+7
We will handle sending the assignment failure inside the T10 timer but it is better to reset the secondary_lchan inside the msc_data right away before we might accidently use it.
2010-04-08bsc_msc_ip: Attempt to handle assignment failures more properlyHolger Hans Peter Freyther1-0/+35
1.) when we do get a assignment failure from the MS. It is coming on the old channel and not the new one. Fix the comparison. Also always reset the msc_data to NULL before dropping the reference 2.) the LCHAN signal handler in bssap.c claims that the T10 expire cb should free the secondary channel. It currently does not do it and we have to do it now... the whole thing was not tested and even after this commit this behavior is not heavily excercised... with OsmocoreBB we would be able to do this in the future.
2010-04-08bssap: Speculative crash fix when queueing messages for the BTSHolger Hans Peter Freyther1-2/+13
It appears to be possible that we attempt to submit a DTAP on a SCCP connection when we have a channel without the msc_data assigned. This change should fix the crash (which is not well understood), fix a memleak in the case of the queue being full.
2010-04-07bssap: Comment and code cleanupHolger Hans Peter Freyther1-3/+2
2010-04-07bssap: Switch to use LOGP and pick some debug categoriesHolger Hans Peter Freyther1-53/+53
2010-04-07bssap: Another possible null derference on the code.Holger Hans Peter Freyther1-1/+1
We do not want to send a msg over the NULL lchan. Let us return fast from here.
2010-04-07bssap: Speculative crash fix.Holger Hans Peter Freyther1-1/+1
2010-04-06Merge remote branch 'origin/master' into on-waves/bsc-masterHolger Hans Peter Freyther1-6/+6
* Move to the new log code and update binaries * Catch up with lchan changes from master Conflicts: openbsc/include/openbsc/Makefile.am openbsc/include/openbsc/gsm_data.h openbsc/src/Makefile.am openbsc/src/bsc_rll.c openbsc/src/chan_alloc.c openbsc/src/debug.c openbsc/src/gsm_04_08.c openbsc/src/gsm_04_11.c openbsc/src/gsm_subscriber_base.c openbsc/src/handover_logic.c openbsc/src/silent_call.c openbsc/src/transaction.c openbsc/src/vty_interface.c openbsc/src/vty_interface_cmds.c
2010-03-31[mgcp] Add a helper function to convert from GSM0808 ts/mux to MGCP endpointHolger Hans Peter Freyther1-3/+1
Move the conversion of GSM0808 timeslot and multiplex from the bssap.c into the mgcp.h so it can be reused by multiple users. The weird math comes from the mapping of the MSC...
2010-03-30misc: Do not prepend 0x when using %p in printf.Holger Hans Peter Freyther1-1/+1
2010-03-29[misc] Clean some whitespace in files of this branch.Holger Hans Peter Freyther1-1/+1
2010-03-24bssap: Allow to submit a SMS on the TCHHolger Hans Peter Freyther1-1/+9
Similar to the bsc_rll.c code we need to indicate if we want to send the data on the SACH or on the normal signalling link. For CC and any other SAPI=0 usage this bits must be zero, whener we try to do something with SMS this bit needs to be set to one.
2010-03-24Specify a release reason for the lchanHolger Hans Peter Freyther1-4/+4
In case the put_lchan is making the refcount drop to zero use the release reason specified in the put_lchan call. This is used by the BSC MSC IP implementation for the assignment handling where the old channel is getting closed with a local end release (1).
2010-03-24bssap.c: Handle an assignment failure correctlyHolger Hans Peter Freyther1-0/+1
This method should return !0 in case of an failure so we can send an assignment reject right away.
2010-03-24Correct the company name. It should be On-Waves (ehf)Holger Hans Peter Freyther1-1/+1
2010-03-24Merge remote branch 'origin/master' into on-waves/bsc-masterHolger Hans Peter Freyther1-6/+7
* Move to libosmocore * Move to new debugging architecture * Register the BTS types * Has only been compile tested Conflicts: openbsc/include/openbsc/Makefile.am openbsc/include/openbsc/gsm_data.h openbsc/include/openbsc/ipaccess.h openbsc/include/openbsc/mgcp.h openbsc/include/openbsc/msgb.h openbsc/include/openbsc/tlv.h openbsc/src/Makefile.am openbsc/src/abis_rsl.c openbsc/src/bsc_init.c openbsc/src/bsc_mgcp.c openbsc/src/chan_alloc.c openbsc/src/debug.c openbsc/src/gsm_subscriber_base.c openbsc/src/msgb.c openbsc/src/rest_octets.c openbsc/src/sccp/sccp.c openbsc/src/vty/command.c openbsc/src/vty_interface.c openbsc/tests/Makefile.am
2010-02-09[nat] Intercept the PAGING message and then forward it to the BSCs with that LACHolger Hans Peter Freyther1-0/+5
* Provide access to the GSM0808 TLV attributes so we can use it in the nat code. * Read the PAGING message, if it is paged by LAC we go through each LAC and then attempt to find the proper BSC connection and then send the message to that BSC.
2010-02-08[bsc_msc_ip] Fix the re-queuing of packets...on-waves/0.3.1Holger Hans Peter Freyther1-1/+1
* The MSC is sending us the next 04.08 packet before we have received the answer for the cipher model complete. The code was supposed to copy all packets from the current queue, to a new queue and then send the packets again. * This would (re)establish the different SAPIs. Now the requeuing code was grabbing the packet from the empty queue (NULL pointer) and we were dereferencing it. It appears that we need to use "head" until the queue is empty.
2010-01-28[bsc] Implement early assignment for CC for the MT case.Holger Hans Peter Freyther1-9/+115
In case we need to handle speech but we are currently on a SDCCH we need to assign a new channel and close the old one. This implementation should have the correct flow of things but we might need to fix some error situations properly. It is implemented by keeping a secondary_lchan pointer that will be swapped into the lchan pointer after the assignment complete message from the MS. The old lchan will be deactivated (the SACCH should stay open). We have to manually remove the subscr from the lchan structure to properly close things down.
2010-01-28[bssap] Use switch/case for the signal handlerHolger Hans Peter Freyther1-26/+30
Use switch/case, switch/case for the subsys and signal to prepare to handle more signals in the future.
2010-01-27[msc] Attempt to fix MT SMS with ciphering enabled.Holger Hans Peter Freyther1-1/+25
The MSC is asking us to enable ciphering and then immediately sends a DTAP msg for SAPI=3. We handle this correctly by attempting to establish SAPI=3 but we never get an establishment confirm for this SAPI. Attempt to fix it by not sending any DTAP message when we receive the Cipher Mode Request and unblock the queue when the ciphering is confirmed. The unblocking currently works by taking all messages out of the queue and then submitting them again. This will attempt to establish the SAPI=3 and such automaticaly. And the MSC stopped sending me SMS so this needs to be verified at a later time.
2010-01-07[bssap] Return u_int16_t from the get_*_code methodsHolger Hans Peter Freyther1-4/+4
The LAI generation wants to have 16bit unsigned, just keep them like this already. This means the int32_t will be truncated inside the get_*_code methods which is better than doing it somewhere else.
2010-01-07[bssap] Fix brown paper bag... Keep the air id ...*sigh*Holger Hans Peter Freyther1-2/+2
We want to use the real number on the Um... Using the core network code is totally wrong in this scope...
2010-01-07[bssap] Allow to use a different country code tooHolger Hans Peter Freyther1-16/+27
* Be able to have a country code in the air but use a different country code when talking to the core network. * Now both country and network code can be different on air and on the MSC communication.
2010-01-05[bsc_msc_ip] Turn the MNC hack into a config optionHolger Hans Peter Freyther1-6/+19
* Make it possible to have a different MNC in the RSL traffic than in the core network. * Introduce the "core network code NUMBER" variable. If it is set this network code will be used in traffic with the MSC. * Use the core_network_code number when sending a packet to the MSC * Regenerate the LAI (this is where I could have a bug) when sending packets to the BTS. * Add size checks. This is not tested, I might got something wrong.
2010-01-05[bssap] Set the right GSM08.08 speech version indicatorHolger Hans Peter Freyther1-6/+13
* For half rate we also need to set the 3rd bit to one * See GSM08.08 §3.2.2.51 and then §3.2.2.11
2009-11-20HACK patch the network code..Holger Hans Peter Freyther1-1/+10
Report to the MSC with the right code and patch it on the air...
2009-11-20[lchan] Release the channel ones its' usecount drops to zeroHolger Hans Peter Freyther1-0/+1
Remove the timer handling from the LCHAN and release the channel ones the use count is dropping to zero. Change code that was sending/using the lchan after the release and change the send data method to warn in case the lchan is used after it has been freed.
2009-11-20[bssap] Support multiple multiplexers in the assignment commandHolger Hans Peter Freyther1-7/+12
When more than one trunk group is allocated to the BSC the MSC will start to assign channels from the different multiplexer. We will map them the following way onto MGCP endpoints Multiplex 0: 0 -> 1 1 -> signalling 2 -> 2 .. -> .. 16 -> signalling (might be 15) 30 -> 30 Multiplex 1: 0 -> 31 2 -> 32 ... Multiplex 3: ..
2009-11-20[bsc] Add a rtp base port to the BSC config tooHolger Hans Peter Freyther1-1/+2
Stop having a global variable... keep it in the gsm network or the mgcp
2009-11-20[bssap] Cope with weird channel mapping on the network sideHolger Hans Peter Freyther1-1/+5
The timeslot of the network maps the following way 0 -> 1 1 -> n/a 2 -> 2 ... -> ... 31 -> 31
2009-11-20[bssap] Send multirate config for HR AMR with 5.9kHolger Hans Peter Freyther1-0/+6
Send a hardcoded multirate config when usin the AMR codec. This should be more configurable in the future.
2009-11-20[bssap] Attempt to allow selecting the speech mode from configHolger Hans Peter Freyther1-14/+86
It is possible to specify a list of possible speech codecs and we will try to match the assignment command with the one from the config file. This is not tested yet and we have one problem. We assume we can modify the channel to hold the speech value... this will require more work.
2009-11-20[bssap] Pick the A5/0 vs A5/1 setting from the gsm_networkHolger Hans Peter Freyther1-3/+43
Follow the configuration of the gsm network. If the Cipher Mode Request does not allow our preferred format we will reject it. Otherwise send the cipher mode command to the mobile station. This code is mostly untested.
2009-11-20[bssap] Implement generating a classmark update messageHolger Hans Peter Freyther1-0/+20
Generate a classmark update message from a given payload this might need to be changed to get the version2 and version3 parameters
2009-11-20[bssmap] Fix the chosen encryption in assignment completeHolger Hans Peter Freyther1-1/+1
Send the RSL value... it is the right value
2009-11-20[bssmap] Unconditionally include the chosen encryption in cipher mode completeHolger Hans Peter Freyther1-11/+7
2009-11-20[bssmap] Assignment handling fixes and improvementsHolger Hans Peter Freyther1-4/+23
- Fix the generation of the assignment failure message - Parse the permitted indicator of the assignment request message
2009-11-20[bssap] Fix generation of the failure messageHolger Hans Peter Freyther1-2/+3
2009-11-20[bssap] Only start establish when the link is not yet establishedHolger Hans Peter Freyther1-1/+1
This is fixing a bug when we try to submit a SMS from the MS to the network. We send the RLS ESTABLISH REQUEST but as the MS already established this SAPI we waited for the timeout and failed..
2009-11-20[bssap] Improve log messages...Holger Hans Peter Freyther1-2/+1
2009-11-20[bssap] First go at implementing channel assignment...Holger Hans Peter Freyther1-8/+33