People in this thread
have found out, how to add dbus listener, which would be triggered on incoming SMS. But SMS is encoded in-to a PDU string
so it has to be decoded first. I've added support for this in-to latest (0.0.9) gsmdecode.py from ussd-comon package.
You can use gsmdecode.decode_pdu (pdumsg) function, which would return to you something like this:
'user_data': 'Decoded SMS message ',
'type': 64, 'dcs': 8,
But you should remember, that long SMS messages are just sequence of several messages. So you should check for 'part' element and if it is true you should accumulate messages somewhere. So your signal listener would look like this:
def callback(pdumsg, msgcenter, somestring, sendernumber):
pdu = gsmdecode.decode_pdu (pdumsg)
if pdu != None :
message += pdu['user_data']
if not pdu['part']:
message = ""
Check for None was added, because this signal is triggered for delivery notifications too. I hadn't nor time nor need to write PDU decoding for them, so decode_pdu returns None in such cases.