Commit Graph

52 Commits

Author SHA1 Message Date
Harald Welte ffa55a4e87 statistics: Introduce 'struct counter' instead of using unsigned long
This has the advantage that counters can be added all over the code
very easily, while having only one routine that stores all of the
current counter values to the database.  The counters are synced
every 60 seconds, providing relatively fine grained statistics
about the network usage as time passes by.
2009-12-22 20:42:40 +01:00
Harald Welte 4983921af1 [gsm_04_11] Replace hardcoded transaction_id by real allocation
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-22 13:45:58 +01:00
Harald Welte 24ff6ee0a3 keep some internal statistics inside OpenBSC
the statistics will give us some idea about the network load and
performance.
2009-12-22 00:41:05 +01:00
Steffen Neubauer ac0c13c02c [sms] bugfix: additional functionality indicator only appears in TP_VPF_ENHANCED - not in TP_VPF_ABSOLUTE 2009-12-21 23:27:54 +01:00
Sylvain Munaut feaca92fc0 Use 'new' rather than 'unknown' when starting transaction
'unknown' has a negative connotation for a case that's totally
normal so refer to it as 'new' so it doesn't sound like a problem.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:22:16 +01:00
Sylvain Munaut c56a14181c Fix transaction_id displayed in debug message
In SMS debug messages, we always display the transaction ID
as if we were 'sending' the message.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:22:04 +01:00
Sylvain Munaut 1d9efd6c9c Fix typos in debug message / comments
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:21:51 +01:00
Steffen Neubauer ad69d7f8b2 [sms] trivial: Removed unneeded double check in unbcdify 2009-12-05 12:07:12 +05:30
Steffen Neubauer f326267fb7 [SMS] Implement TP-VPF-ENHANCED
While doing so, we also restructure/reorganize the vailidity period
parsing in general.
2009-11-26 12:28:41 +01:00
Harald Welte ccda96517c move 'struct value_string' and 'get_value_string()' to gsm_data 2009-11-12 22:28:18 +09:00
Steffen Neubauer 5727cf4ea7 [SMS] implement GSM340_TP_VPF_ABSOLUTE
- Added function "gsm340_scts" to decode the service center time stamp
  into a UTC/GMT timestamp
- in function gsm340_validity_period: can now decode validity period
  format absolute.
2009-11-11 23:02:07 +09:00
Holger Hans Peter Freyther dc1e1058f3 Fix warnings by removing unused variables 2009-10-22 15:40:33 +02:00
Sylvain Munaut 6b0b103bdc [gsm_04_11] Free transaction on RX_RP_ACK for SMS
When only one SMS is sent, the freeing of the lchan will
automatically free all transactions on the lchan.

However, if there are several SMS sent at once, the call
to gsm411_send_sms_lchan will create a new transaction
with the same caracteristics as the previous one. If
the old one is not free'd, the next call to trans_find_by_id
(triggered by the next incoming RP-ACK) will not return the good
transaction and things go haywire.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-09-27 11:16:22 +02:00
Harald Welte (local) ee4410a4f3 actual code running at end of har2009 2009-08-17 09:39:55 +02:00
Harald Welte (local) 0abaf33297 paging_request() now returns the number of started paging requests
this helps the caller to determine if he will ever get called back
or not (and if he should free his data structures now or not)
2009-08-15 11:25:45 +02:00
Harald Welte b2dc37f512 Merge commit 'har/master' 2009-08-15 03:21:45 +02:00
Daniel Willmann d5d5e1d460 Fix decoding of SMS Data Coding Scheme 2009-08-15 03:19:40 +02:00
Harald Welte e903edf580 provide return code from paging_request() function
this enables the caller to detect if the paging request was rejected
by the paging layer, especially in case it is already paging this very
subscriber.

In the case of SMS / 04.11, we used to have a memory leak of struct gsm_sms's,
since we would only free them from the paging succeeded/expired callbacks.
2009-08-15 03:16:17 +02:00
Daniel Willmann 6b024cb83a Handle SMS with UCS2 and binary userdata 2009-08-15 03:15:08 +02:00
Harald Welte (local) d19e58b13c move talloc context creation out of on_dso / constructors
the various constructors get called in a non-obvious, linker determined
order, which makes certain objects disappear from the talloc report.

This change moves the talloc context creation into a new talloc_ctx.c file
2009-08-15 02:30:58 +02:00
Harald Welte (local) 86b17172fd fix sms layer timer leak/corruiption using trans_free()
we only stopped the cp1* timer on reception of cp-ack, but not
in error cases like rx of cp-error.
2009-08-14 14:52:17 +02:00
Harald Welte (local) daef606502 respect the link_id, not only the SAPI from SMS code
SMS related messages are all sent over SAPI=3.  But in addition
to that, we also need to send it over the correct link identifier,
i.e. SACCH or main signalling channel
2009-08-14 11:41:12 +02:00
Harald Welte (local) c89a511616 add more debugging to SMS layer 2009-08-14 10:42:43 +02:00
Stefan Schmidt aa665876c0 Merge branch 'master' of git@192.168.100.10:openbsc 2009-08-13 21:01:25 +02:00
Stefan Schmidt 689537af9d gsm_04_11: Month in unix time starts with 0. 2009-08-13 21:00:44 +02:00
Daniel Willmann 9aef14547a Beautify septet->octet calculation (do not use ceil) 2009-08-13 16:35:00 +02:00
Daniel Willmann 58c83d8368 Support sms with a validity period format of none 2009-08-13 16:08:09 +02:00
Harald Welte (local) aa9dc19ca7 remove FIRST_CONTACT signal, the subscriber flag is sufficient 2009-08-13 13:49:51 +02:00
Jan Luebbe 336f8ec57a allocate a token for new subscribers 2009-08-13 10:15:09 +02:00
Daniel Willmann 6b1e822611 Fix gsm_7bit_{en,de}code function and sms user_data calculations
With the 7bit alphabet the user_data_len field needs to be in
septets (characters) and not in octets occupied.
2009-08-12 23:49:48 +02:00
Holger Hans Peter Freyther 09e364b167 misc: Fix warnings about returning with value...
return rc in these cases.
2009-08-10 08:26:12 +02:00
Holger Hans Peter Freyther 34e97495a6 misc: Add prototypes to header files, include more header files
Fix various warnings about implicit declarations of functions.
2009-08-10 07:54:02 +02:00
Harald Welte 4198561305 add SMS CP timer TC1* to tear down lchan in case MS never responds to CP-DATA 2009-08-10 00:24:32 +02:00
Harald Welte 0d544e7db5 fix off-by-one error in calculating RPDU length for CP-USER-DATA IE 2009-08-10 00:22:19 +02:00
Harald Welte cf6a3819aa SMS improvements
* send more pending messages after RP-ACK of DELIVER has been received
* send pending messages after RP-SMMA has been received
* clear the transaction when sending CP-ACK in MT/DELIVER case
* always use the same transaction ID (since my assumptions about
  SMS transactions were wrong)
* try to deliver messages through existing lchan rather than starting
  paging
* send pending SM's after LOCATION UPDATE ACCEPT has been sent
2009-08-09 19:07:41 +02:00
Harald Welte cb8f443399 implement proper SAPI3 handling for SMS
SM's need to be transferred over their own RLL connection on SAPI3, rather than
the default SAPI0 connection that we're using for signalling like 04.08
RR/MM/CC.

This is not that much of a problem in the case of SMS SUBMIT from the MS to
the netwrok.  In that case, the MS will start its primary RLL connection
with SAPI3, and we can just respond with SAPI3.

However, in the case of SMS DELIVER to a MS, we first page the MS, it then
establishes SAPI0.  We then need to explicitly request the establishment of
a SAPI3 RLL connection, before we can send CP-DATA with our RP-DATA and DELIVER
RPDU

Now that we have the bsc_rll.c code, we can actually wait for a paging
response, and from the paging response request the establishment of the SAPI3
connection.  We will be called back once that connection is open and can
successively start transmission of the SM.
2009-08-09 14:59:02 +02:00
Harald Welte 76042188e0 first 'working' SMS implementation
we now have the full path from the MS into the database (SUBMIT), as well as
back from the database to the MS (DELIVER).  The database gets correctly
updated once a SMS has been successfully delivered.

What's still missing is the periodic scan over all undelivered messages,
trying to deliver them to the respective MS.  So far, you have to manually
trigger this on the telnet interface with 'sms send pending 1'
2009-08-08 16:03:15 +02:00
Harald Welte 3366a94d6c Merge branch 'master' into sms
Conflicts:
	openbsc/include/openbsc/transaction.h
	openbsc/src/gsm_04_11.c
	openbsc/src/transaction.c
2009-07-28 00:44:49 +02:00
Harald Welte 7bfc267496 move allocation of talloc contexts into link-time constructor
This is much more optimal than checking if the context exists every
time we allocate the respective object.
2009-07-28 00:41:45 +02:00
Harald Welte f3efc597d1 further steps towards better, transaction based SMS 2009-07-27 20:11:35 +02:00
Harald Welte 88f0425197 Merge branch 'master' into sms 2009-07-23 21:24:28 +02:00
Harald Welte 761e944182 make sure subscr->net is always set
since a subscriber is an element of the gsm_network, we have to ensure
subscr->net is always set correctly.  We do this by using gsm_network
as an argument to all functions that resolve or create a subscriber.
2009-07-23 19:21:02 +02:00
Harald Welte 9176bd46e3 make sure subscr->net is always set
since a subscriber is an element of the gsm_network, we have to ensure
subscr->net is always set correctly.  We do this by using gsm_network
as an argument to all functions that resolve or create a subscriber.
2009-07-23 18:46:00 +02:00
Harald Welte 3e0f6173f1 some more comments 2009-07-09 23:52:59 +02:00
Harald Welte b9c758b2ac more SMS improvements
* describe data structures in gsm_04_11.h
* increae LCHAN RELEASE TIMEOUT for case of long SMS
* convert header field in sql table from NUMERIC to BLOB
* initial handling for validity period
* send RP ERROR messages with meaningful RP CAUSE in case of error
2009-07-05 14:02:46 +02:00
Harald Welte 87f5d637c5 more layering /abstraction of sms protocol 2009-07-04 17:39:00 +02:00
Harald Welte 966636f39f use named variant when allocating msgb's
when we generate a talloc report (SIGUSR1), we can now see which system
allocated a given msgb, this helps memory leak debugging
2009-06-26 19:39:35 +02:00
Harald Welte 2cf161be08 introduce talloc all over OpenBSC 2009-06-20 22:36:41 +02:00
Harald Welte 3cfdb22214 SMS: fix parsing of destination phone number 2009-06-12 02:42:11 +08:00
Harald Welte a718780253 SMS: fix parsing of destination address BCD
this bug was introduced in Andreas' MNCC patches while altering
decode_bcd_number().
2009-06-12 01:53:29 +08:00