Commit Graph

4058 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther a769dcb889 mgcp: Methods generating a response now include the endpoint pointer
This is required for remembering the last result in a central place
and is required to properly implement detection of re-transmissions.
2012-12-10 13:36:00 +01:00
Holger Hans Peter Freyther cf2f158caa mgcp: Add testdata for MDCX handling 2012-12-10 13:35:53 +01:00
Holger Hans Peter Freyther d267f4d685 mgcp: Test the second CRCX as a CRCX and not as a re-transmission
The second CRCX would be mostly ignored and be handled by the
retransmission layer of MGCP.
2012-12-10 12:16:23 +01:00
Holger Hans Peter Freyther 0d904e004a mgcp: Fix a typo.. it is msg and not mgs 2012-12-10 12:16:23 +01:00
Holger Hans Peter Freyther 01d315f19c mgcp: We do not need to check for talloc_free
Simplify the code and remove null check for the two strings.
2012-12-10 12:16:23 +01:00
Holger Hans Peter Freyther 3d4d79d890 bsc: Fix compiler warning and return from the method with a value. 2012-12-10 12:09:22 +01:00
Holger Hans Peter Freyther d2361d970a bsc: Send the USSD message after the location updating accept.
Make sure to accept the phone first before sending the USSD message.
2012-12-03 15:32:54 +01:00
Holger Hans Peter Freyther f589221ed0 msc: Add debug messages when not sending a USSD welcome message 2012-12-03 14:39:19 +01:00
Holger Hans Peter Freyther b3089e437d bsc: Fix a brown paper bug and most likely fix the USSD welcome issue 2012-12-03 14:39:11 +01:00
Holger Hans Peter Freyther 383d3c33e6 bsc: Call the variable with a more appropriate name. 2012-12-03 14:38:59 +01:00
Holger Hans Peter Freyther c5903a2b01 Merge branch 'zecke/jolly-sms'
MT-SMS:
Manual test with VTY to phone. Also multiple SMS deliveries on
the same lchan. Manual test with phone to phone.

MO-SMS:
Manual test with phone to phone but only a single SMS at a time,
not testing the special 'CP-ACK' case.

Forced CP timeout using the fakebts SMSTest, not causing a crash.
2012-12-01 12:03:46 +01:00
Holger Hans Peter Freyther 536a10b63b sms: Kill the linkid as we are using SAPI=3 all the time
For GSM (not GPRS) we will never use a SAPI!=3. Simplify the code
and remove the link_id=0.
2012-12-01 11:49:33 +01:00
Andreas Eversberg bc6c43f759 sms: Replaced the SMR process by new implementation in libosmocore
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-01 11:49:33 +01:00
Andreas Eversberg f7396eac2f sms: Replaced the SMC process by new implementation in libosmocore
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-01 11:49:15 +01:00
Holger Hans Peter Freyther 07dec137de sms: Remove the susbcr_put_lchan logic from the SMS code
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-01 11:33:00 +01:00
Holger Hans Peter Freyther 70ae5d3000 nitb: Release the channel if there is nothing on it
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-12-01 11:32:47 +01:00
Holger Hans Peter Freyther 6d818839a9 Merge branch 'zecke/mgcp-dtmf' 2012-12-01 10:53:15 +01:00
Holger Hans Peter Freyther 8d0be259cb mgcp: Begin handling of the RQNT message as needed for DTMF
Introduce a callback for the request and forward the signalrequest
to the callback. This is not a full implementation of MGCP RQNT.
2012-11-29 19:56:22 +01:00
Harald Welte 0d0c9ec5c5 use DLSMS and not DSMS in SMPP related code (merge with master) 2012-11-24 11:13:19 +01:00
Harald Welte c6483683eb tests: Fix build of 'db' test after smpp merge 2012-11-24 11:11:59 +01:00
Harald Welte b8a1f967c5 SMPP: fix handling of UDH / multi-part for 7-bit messages
... I would have never believed it is such a broken mindfuck.
2012-11-24 11:09:21 +01:00
Harald Welte c0de14da8f SMPP: add small utility program 'smpp_mirror'
This program binds as ESME transceiver to a SMSC and simply mirrors back
all SMS that it receives.
2012-11-24 11:09:21 +01:00
Harald Welte e07b6a77e5 SMPP: Implement support for MO SMS
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-24 11:07:30 +01:00
Harald Welte 338e3b3b4b SMPP: VTY configuration of SMPP code, authentication support 2012-11-24 11:07:29 +01:00
Holger Hans Peter Freyther eff4094950 sms: Use the DLSMS instead of the DSMS category throughout our code 2012-11-21 21:33:03 +01:00
Holger Hans Peter Freyther 366c33185b sms: Use the definitions from the libosmogsm
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-21 21:31:47 +01:00
Harald Welte 0a1a312311 Merge branch 'laforge/smpp' 2012-11-16 22:17:49 +01:00
Harald Welte 6c7680d726 SMPP: build the smpp interface only in case of ./configure --enable-smpp 2012-11-16 22:16:46 +01:00
Harald Welte 1a2993adb7 SMPP: fix subscriber reference leak.
subscr_get_by_* is already increasing the refcount, we shouldn't
do that a second time (thanks, Holger).
2012-11-16 22:00:10 +01:00
Harald Welte 9122c13933 SMPP: More logging in error cases, fix UDH in 7bit ASCII 2012-11-16 22:00:10 +01:00
Harald Welte 874f9f1aa7 SMPP: More consistent logging / error reporting 2012-11-16 22:00:10 +01:00
Harald Welte 8a1b056bff SMPP: Implement ALERT NOTIFICATION on attach/detach of subscribers 2012-11-16 22:00:10 +01:00
Harald Welte 9ad0362429 SMPP: Deal with DCS according to 03.38 and respect TP-PID 2012-11-16 22:00:09 +01:00
Harald Welte 4dbcdad903 SMPP: Introduce wrapper macro to memset all structures to zero
For some reason, libsmpp34 is too smart to zero out the entire structure
to which it is unpacking.  This introduces an ugly wrapper macro to
work around.  This needs discussion with the libsmpp34 maintainer.
2012-11-16 22:00:09 +01:00
Harald Welte e94db49698 SMPP: Introduce ESME reference coounting
In case a ESME disappears after SUBMIT-SM but before the MT-SMS
is delivered (transaction mode), we have to make sure the esme
structure still exists.
2012-11-16 22:00:09 +01:00
Harald Welte d4bdee79e9 SMPP: Implement transaction mode for SUBMIT-SM
WARNING: if the ESME disconnects, osmo_esme gets freed, and
sms->smpp.esme might point to invalid/unallocated memory!
2012-11-16 22:00:09 +01:00
Harald Welte f1033cc752 Initial support of SMPP interface for MT-SMS 2012-11-16 22:00:09 +01:00
Harald Welte 90d7f26f67 Makefile: just a slight re-order / breaking of a line 2012-11-16 22:00:09 +01:00
Holger Hans Peter Freyther eedb45362d mgcp: Print both receivd and expected address in the error statement
The log statement is split into two because inet_ntoa works on an
internal buffer and would print the last address twice.
2012-11-12 10:55:29 +01:00
Holger Hans Peter Freyther 98da544992 nat: Move the ctrl handling code into a separate file
Move to the control command handling out of the main file into
a dedicated module. There are still some calls embedded into the
main code but it will be moved soon.
2012-11-12 10:49:10 +01:00
Holger Hans Peter Freyther 88c06bcd64 Merge branch 'zecke/mgcp-rtp-statistics' 2012-11-12 10:46:11 +01:00
Holger Hans Peter Freyther cb306a689e mgcp: Send the jitter statistics at the end of the call 2012-11-12 10:45:09 +01:00
Holger Hans Peter Freyther 30690adbc8 mgcp: Calculate the jitter with the formula/code from the appendix
Use a usec timestamp for the local time. The seconds to usec will
swap over to the lower bits but this appears to be correct. The
CLOCK_MONOTONIC is used to fulfill the RFC 3550 requirement even
if it is a bit slower than the gettimeofday.

Make sure to initialize transit in a way that the first transit
time will be 0. Otherwise the jitter will contain the difference
of the localtime and the remote time.
2012-11-12 10:45:03 +01:00
Holger Hans Peter Freyther 38e02c5125 mgcp: Calculate the packet loss as of Appendix A of RFC 3550
Calculate the expected packages and packet loss as of RFC 3550.
The values should be clamped but our packet loss counter is 32
bits and not 24 and we should clamp at other values but I am
waiting for some issues first before dealing with that.
2012-11-12 10:44:58 +01:00
Holger Hans Peter Freyther 769912c9e9 mgcp: Calculate the wrap around as of Appendix A in RFC 3550
This is missing the probation and the dealing with a remote
restart. For the remote restart we will simply write a log
statement as this is unlikely to happen during a call or if
it does happen the call will be taken down by the BSC anyway.
2012-11-12 10:42:05 +01:00
Holger Hans Peter Freyther 1e85af661c mgcp: Document a difference between RFC 3550 and this code
Explain why this code deals with only one source and that this is
a limit of some equipment (e.g. the nanoBTS).
2012-11-12 10:42:05 +01:00
Holger Hans Peter Freyther ed3a661d0b mgcp: Align the variable naming with Appendix A of RFC 3550
Align the naming inside the mgcp_rtp_state with the naming inside
the 'source' struct of the appendix. Make first_seq_no/base_seq
a uint16_t. This is removing rules for alignments and reduces the
struct from 40 bytes to 36.
2012-11-12 10:42:05 +01:00
Holger Hans Peter Freyther 0bf15a8187 mgcp: Include statistics at the end of a connection
Follow the MGCP specification and send the collected statistics
at the end of a call. Right now this does not include jitter, packet
loss and delay.
2012-11-12 10:42:05 +01:00
Holger Hans Peter Freyther 2e8e659586 mgcp: Remember the initial sequence number of the stream
This information is required for calculating the packet loss at the
end of a phone call.
2012-11-12 10:42:05 +01:00
Holger Hans Peter Freyther 952f752ffa mgcp: Count the received octets as of the MGCP specification
Count the received octets. This is encouraged by the MGCP specification.
Use a 32bit counter that is good enough for more than 12 hours of a EFR
call. This limit is good enough for the current configuration.
2012-11-12 10:42:05 +01:00