|Age||Commit message (Collapse)||Author||Files||Lines|
Openbsc has SMS Delivery Reports since recently, which means we are now
receiving deliver_sm messages and this workaround introduced in commit
db0d8ab4fcfac67e76729241d92ca128d4526240 is not required anymore.
SMPP specs say message reference is 16 bits field.
However, message reference field in GSM03.40 spec is only 8 bits.
I take the chance to also swap the two log parameters, because they are
included into a dictionary and shown in swapped order in the log anyway,
which distracts me every time I look at the values.
In commit 6100b629e55ed4aa319f46ad797741131b9da8e7 I assumed esme
already had a cleanup function, which doesn't seem to be the case. This
means if a test calls esme.connect() and fails afterwards without
calling esme.disconnect(), the connection will be kept but as the test
will finish and the NITB is closed, then the connection will be kept
forever in an erroneous state. With the cleanup function we ensure we
will close the connection after the test.
Sometimes in test esme_ms_sms_transaction.py we get the following error:
esme_ms_sms_transaction.py:54: ERR: ValueError: list.remove(x): x not in list
This appears due to a race condition because sms_send is used several times,
which means we don't wait or sync until we receive the response before calling
sms_send_wait_resp. That means when we wait for response of message with
seqnum X, we may receive response from message seqnum X-1 which was
initiated by sms_send and thus was not stored in the self.pdus_pending
array. As it's not there, trying to remove it triggers an exception.
esme: Add several bits to handle logic required by tests:
- Allow specifying the mode used to send an sms
- Add a parameter to ask to receive a Delivery receipt for that message
- Add sms_send_wait_resp API, which waits until the response message for
a given smpp message is received when sending an sms.
- Add receipt_was_received API, which together with
message_received_handler maintains state of the delivery receipts we
asked for and were still not received. However, the check needs to be
disabled for now because OsmoNITB doens't seem to be sending stuff
properly, see OsmoNITB #2353.
- On message_received_handler, also print alert_notification messages,
to show that there's actually a bug in OsmoNITB, see #2352.
Move old esme_ms_sms to esme_ms_sms_transaction, and explicitly state
that we are using that mode. On the same test, we can now enable the
part which asserts that sending an SMS to an msisdn with unknown
destination triggers an error. The issue was mainly that the error had
to come from the SMSC server response, not from the sent message, so
we have to wait for the response to have the failure triggered.
Finally, add esme_ms_sms_storeforward, which tests features for sms sent
using that mode, and uses the APIs described above.
As defined in , the different related actors are implemented in this
commit: ESME and SMSC.
SMSC: In Osmocom, the SMSC is currently implemented inside the NITB or
the MSC. A new Smsc abstract class is created to shared code between the
NITB and the MSC, and also makes it easier for later when the SMSC is
splitted. ESMEs can be dynamically added to its configuration in a
similar way to how the BTSs are added.
ESME: A new class Esme is created which can be used by tests to control
an ESME to interact with the SMSC. The ESME functionalities are
implemented using python-smpplib. Required version of this library is at
least 43cc6f819ec76b2c0a9d36d1d439308634716227, which contains support
for python 3 and some required features to poll the socket.
This commit already contains a few tests which checks different
features and tests the API. Extending tested features or scenarios can be
later done quite easily.
The tests are not enabled by default right now, because there are several
of them in a suite and the ip_address resources are not freed after every
tests which ends up in the suite failing due to missing reserved
resources. All the tests run alone work though. When the issue is fixed
they can then be added to the default list of tests to be run.