aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
AgeCommit message (Collapse)AuthorFilesLines
2013-07-11smpp_openbsc: Fix parsing of 03.38 data coding scheme in MO caseHarald Welte1-15/+28
2013-07-11Fix: Handle CM service request on already secured channel correctlyAndreas Eversberg1-1/+2
A CM service request must be acknowledged also, when encryption is already enabled. Without encryption enabled, the security status is GSM_SECURITY_NOTAVAIL, which causes a CM service acknowledge. On initial CM service request, the security status is GSM_SECURITY_SUCCEED, if encryption is enabled. This will not lead to an acknowledge, because the cyphering command implies an acknowlege. An additional CM service request requires an acknowledge, so I added a new security status: GSM_SECURITY_ALREADY
2013-07-06mncc: Remove what we believe to be a tautology from the MNCC codeHolger Hans Peter Freyther1-14/+16
Coverity pointed out that we use trans->subscr after a NULL check, it is our believe that every transaction will have a subscriber. Remove the check and add an assert before we are dispatching things. Fixes: Coverity CID 1040740, CID 1040739
2013-07-04nitb: Add a missing NULL check for searching the subscriberHolger Hans Peter Freyther1-1/+8
"subscriber " SUBSCR_TYPES " ID sms pending-send could fail with an invalid ID/IMSI for the subscriber. Fixes: Coverity CID 1040715
2013-07-04db: Fix an issue with the memsetHolger Hans Peter Freyther1-1/+1
We want to memset the entire area of the atuple and not just the first four/eight bytes of the data. Fixes: Coverity CID 1040708
2013-07-04gsm_subscriber: Fix compiler warning of the printf stringHolger Hans Peter Freyther1-1/+1
This fixes both a GCC and a Coverity warning: GCC: gsm_subscriber.c: In function ‘subscr_expire_callback’: gsm_subscriber.c:389:2: warning: format ‘%i’ expects argument of type ‘int’, but argument 8 has type ‘long long unsigned int’ [-Wformat] Coverity: CID 1040712
2013-06-12smpp: Only write the systemd-id if it is not emptyHolger Hans Peter Freyther1-1/+1
system_id is a char array, which makes the NULL check a tautology, so we should check with strlen if the string is empty or not. This is fixing the "write" command of VTY that would otherwise create a config file that can not be parsed.
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-05-28SMPP: Add new 'dcs_transparent' ESME settingHarald Welte3-9/+58
If an ESME has the dcs_transparent config flag, then the TP-DCS of MO-SMS is transparently passed to SMPP and not converted to SMPP specific data_coding values. This is needed in cases where ESMEs actually care about the exact TP-DCS, as the conversion from TP-DCS to SMPP data_coding is not bijective.
2013-05-28SMPP: Pass on 0xFx style DCS from SMPP to GSMHarald Welte1-17/+33
There are multiple ways how the TS 03.38 TP-DCS can indicate 8bit or 7bit messages. SMPP has it's own data coding specification, which is different from TS 03.38. However, some SMPP ESMEs want to be able to have fine-grained control over the TP-DCS indicated in the TPDU header. If such values like 0xF6 are used in SMPP, we now transparently pass them on to the GSM side.
2013-05-26SMPP: Respond with BIND_TRX_RESP to BIND_TRX, not BIND_TX_RESPHarald Welte1-1/+1
2013-04-29smpp: Attempt to fix a memory leak of the msgbHolger Hans Peter Freyther1-1/+3
The smpp_pdu_rx method does not free the msgb. Introduce an annotation (currently defined to nothing) to indicate what will happen to a msgb.
2013-03-13SMPP: Implement SMPP Osmocom Estensions on MO-SMS0.13.0Harald Welte4-6/+111
An ESME can now be configured in the VTY to enable osmocom-extensions, which will add vendor-specific SMPP TLVs for RxLev/RxQual/ARFCN/IMEI and transmit power to the SMPP DELIVER-SM message type.
2013-03-13SMPP: Fix crash on delivery of incoming SUBMIT-SMHarald Welte1-5/+8
As bsc_gsmnet is NULL at the time we call smpp_openbsc_init(), we later run into segfaults with subscribers that don't have a subscr->net set. However, we cannot delay smpp_openbsc_init() until after bsc_bootstrap_network(), as we then fail to parse the SMPP specific VTY/config file options...
2013-03-03vty: Document some previously undocumented parametersHolger Hans Peter Freyther1-2/+4
Katerina pointed out that some nodes are not fully documented and proposed some messages. The token/timeout messages were correct, I have modified the other messages. I removed the full-stop from the PING/PONG documentation as we are normally not using a full sentence.
2013-02-12VTY: backwards compatibility for 'logging level sms'Harald Welte1-0/+14
when the SMS code was moved into libosmocore, its logging prefix was changed from 'sms' to 'lsms', which breaks existing config files. This introduces a deprecated/hidden vty command to make sure those config files are still parsed OK, and will simply print a warning message about the config needing some update.
2013-01-25CC: gsm48_cc_tx_release() must not remove callrefAndreas Eversberg1-2/+0
If after release has been sent, the call control layer waits for: - reception of release complete - or timeout - or release of transaction (due to radio link failure) In this case, an MNCC_REL_CNF is sent to upper layer. The callref must still exist, so the upper layer can handle this confirm.
2013-01-25CC: mncc_release_ind() must send MNCC_REL_CNF in state N19Andreas Eversberg1-0/+2
If transaction is destroyed, but callref still exists, the mncc_release_ind function is called. If the upper layer already sent an MNCC_REL_REQ, the state N19 was entered. In this case it expects an MNCC_REL_CNF.
2013-01-25CC: Be sure to allocate call instance with talloc_zero()Andreas Eversberg1-1/+1
2013-01-24smpp_vty: Ensure to not print 'system-id' in openbsc.cfg if its emptyHarald Welte1-1/+2
... as an empty system-id would render the openbsc.cfg unparseable on next openbsc start.
2013-01-20smpp: Fix a memleak of the SMS on the submit pathHolger Hans Peter Freyther1-1/+2
2013-01-20SMPP: Inform the SMS Queue that a SMS was submitted to kick the queueHolger Hans Peter Freyther1-1/+6
Work on the 'forward' part.. tell the sms queue that something has been submitted for it.. Conflicts: openbsc/src/libmsc/smpp_openbsc.c
2013-01-13sms: Avoid infinite CP-ERROR/CP-ACK loop with sms.Holger Hans Peter Freyther1-0/+12
The issue can be reproduced by typing the following 9 or more times. OpenBSC> subscriber id 2 sms sender id 2 send bla For some unknown reason the phone sends us a CP-ERROR for a transaction identifier we have allocated and used but don't remember. Due the way we use the SMC/SMR we 'establish' the machine and this results in a CP-ACK being sent out. But the CP-ERROR is not having the content we want for an establish so we send out a RP-ERROR. This will result in a CP-ERROR because the phone does not know the transaction... Avoid the issue by checking the direction of the transaction. If we do not know the transaction and it is supposed to be allocated by us then just ignore it and do not create a new transaction.
2013-01-01libmsc: Track and update the location update expiryJan Luebbe2-6/+132
Set the subscriber expiry timeout to twice the duration of the location update period and provide functions subscr_expire() and db_subscriber_expire() to mark subscribers offline that have missed two location update periods. This patch increases the DB revision to 3, so the hlr will be incompatible with prior versions. We should allow 0 for T3212 as well to disable the location update period. In that case we will need a way to indicate that in the database.
2013-01-01misc: Do not use else when using return in the previous branchHolger Hans Peter Freyther1-1/+1
2013-01-01libmsc: Allow to set sender id when sending SMS from the VTYSylvain Munaut3-16/+54
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-01libmsc: Refuse service to anyone not attachedSylvain Munaut1-0/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-29gsm_04_08: Display debug message correctly on DETACH INDICATIONdaniel/channel-ho-wipDaniel Willmann1-3/+5
Log messages would get mangled before if we receive detach by TMSI or IMSI.
2012-12-26libmsc: One of assign_compl and assign_fail will always be calledHolger Hans Peter Freyther1-12/+0
Remove the log messages and comments as they are wrong for now. Even for the mode modify we will get the assign complete call.
2012-12-26handover: Fix the handover signalling for IP based BTSesHolger Hans Peter Freyther1-13/+20
This was reported by Kevin when he was testing handover. The problem is the order of the signal handlers for S_ABISIP_CRCX_ACK. Right now the handover signal handler is called before the one inside the libmsc gsm_04_08.c. This means S_HANDOVER_ACK is signalled _before_ there is a rtp socket created for the channel. The result is that the MDCX will never be sent and the called will not be properly switched _after_ the handover detection. I do not want to play with the order of signal handlers, remove the CRCX ack handling from the handover_logic.c and force the NITB (and later the BSC) to check if the lchan is involved with a handover and do the switching in there. This means right now we do what two signal handlers did in one. Reproduced and tested with the FakeBTS Handover test. Log message: <0004> abis_rsl.c:1954 (bts=1,trx=0,ts=3,ss=0) IPAC_CRCX_ACK ... <000c> gsm_04_08.c:1400 no RTP socket for new_lchan <001a> rtp_proxy.c:533 rtp_socket_create(): success <001a> rtp_proxy.c:615 rtp_socket_bind(rs=0x48703c8, IP=0.0.0.0): ...
2012-12-25gsm_subscriber: change subscr_bsc_active_subscriber to pluralJan Luebbe1-5/+5
This was requested by Holger Freyther <zecke@selfish.org>.
2012-12-25nitb: Add a VTY command to initiate a handover to another BTSHolger Hans Peter Freyther1-0/+53
2012-12-22libmsc: Avoid a crash on lchan release during call controlHolger Hans Peter Freyther1-5/+16
If subscriber A is calling B and has sent a CC Setup message we will allocate the MO and MT transaction and link them together. When the BTS or the lchan is failing the BSC API will send a clear request, as part of the clear request all pending transactions will be released. As part of taking down the transaction, the remote leg will be informed and will send a MNCC_REL_REQ. This results in a call to trans_free. The llist_for_each_entry_safe does not handle removing other elements from the list and we would segfault. One way to fix this is to move the transaction list into the subscriber connection. This might require to create the subscriber connection for MT handling earlier. Otherwise one could have one transaction list inside the subscriber connection and a global list for MT- transactions.
2012-12-22libmsc: Set trans->subscr = NULL after we release itHolger Hans Peter Freyther1-1/+3
This is a cosmetic change and should happen to find use after free of the subscriber.
2012-12-16nitb: Do not crash on IMSI Detach messages from a phoneHolger Hans Peter Freyther1-1/+0
This has been reported and analyzed by Tobias Engel. The IMSI Detach is dispatched as part of the complete layer3 message. I had patched the code to release the anchor and call msc_release_connection to release the connection as fast as possible (otherwise the anchor would trigger in a couple of seconds). With commit 70ae5d3000edd12aee38497a6f541595a8c7dee8 I made this more generic to release the connection immediately if there are no operations, no transaction and no silent call. This leads to the subscriber connection being released twice and eventually causing a segfault. Remove the msc_release_connection invocation from the IMSI Detach code as the connection will be taken down by the BSC API. This has been tested using the FakeBTS and an IMSI Detach message. The channel is released immediately and the nitb does not crash.
2012-12-01sms: Kill the linkid as we are using SAPI=3 all the timeHolger Hans Peter Freyther1-5/+3
For GSM (not GPRS) we will never use a SAPI!=3. Simplify the code and remove the link_id=0.
2012-12-01sms: Replaced the SMR process by new implementation in libosmocoreAndreas Eversberg1-85/+98
Rebased, tested and fixed by Holger Freyther. Release the transaction only once the SMC is asking for the release and set the cb's to NULL to catch a use after free early.
2012-12-01sms: Replaced the SMC process by new implementation in libosmocoreAndreas Eversberg1-168/+110
This has been rebased and fixed by Holger Freyther. The change of the debug area was split out in a previous commit and the is_mt was put back into the transaction code. The transaction is now freed from the RELEASE_REQ sent by the SMC layer and not inside the error path. When clearing the SMC instance we also clear the callbacks.
2012-12-01sms: Remove the susbcr_put_lchan logic from the SMS codeHolger Hans Peter Freyther1-22/+0
This should and does happen as part of the trans_free/msc_release_connection code. There is no easy way to determine that the lchan is now 'free' for other things.. Let the transaction code sort this out. This code just needs to make sure that transactions are always freed.
2012-12-01nitb: Release the channel if there is nothing on itHolger Hans Peter Freyther2-5/+20
This is more a work around and one still needs to implement a proper dispatch on the opening of the connection. If there is no operation left, no transaction and no silent call, close down the channel.
2012-11-24use DLSMS and not DSMS in SMPP related code (merge with master)Harald Welte1-8/+8
2012-11-24SMPP: fix handling of UDH / multi-part for 7-bit messagesHarald Welte1-14/+47
... I would have never believed it is such a broken mindfuck.
2012-11-24SMPP: add small utility program 'smpp_mirror'Harald Welte3-21/+32
This program binds as ESME transceiver to a SMSC and simply mirrors back all SMS that it receives.
2012-11-24SMPP: Implement support for MO SMSHarald Welte5-124/+577
Each ESME can have a number of prefix-matching routes, or it can be a 'default route' to whcih all otherwise unknown SMS destinations are routed.
2012-11-24SMPP: VTY configuration of SMPP code, authentication supportHarald Welte5-11/+485
2012-11-21sms: Use the DLSMS instead of the DSMS category throughout our codeHolger Hans Peter Freyther4-61/+61
2012-11-21sms: Use the definitions from the libosmogsmHolger Hans Peter Freyther1-227/+5
Use the code that is shipped inside the libosmogsm library. Right now the signature (besides the static) and the implementation is the same. This makes using the libosmogsm SMC code more easy in the near future. For the gsm340_gen_oa we are now using a small wrapper to generate the proper type and numbering plan.
2012-11-16SMPP: build the smpp interface only in case of ./configure --enable-smppHarald Welte2-1/+5
2012-11-16SMPP: fix subscriber reference leak.Harald Welte1-1/+1
subscr_get_by_* is already increasing the refcount, we shouldn't do that a second time (thanks, Holger).
2012-11-16SMPP: More logging in error cases, fix UDH in 7bit ASCIIHarald Welte1-1/+17