maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   [SFOS] smsrun dbus example application (https://talk.maemo.org/showthread.php?t=100848)

Halftux 2019-10-04 22:27

smsrun dbus example application
 
1 Attachment(s)
I played the last days with dbus and org.ofono on sfos. So I want to share my outcome for learning purpose.
I don't know if it is the right way but I could not easy find another one. So telepathy could be also something interesting.

This application listens for incoming sms on sim card slot 1.
When an incoming sms phone number is in the whitelist.txt it will check the cmdlist.txt, if the sms message text matches an entry. If there is a match it runs the defined command in the cmdlist.txt.

/home/nemo/.config/smsrun/whitelist.txt
/home/nemo/.config/smsrun/cmdlist.txt

The whitelist.txt should contain per line only one phone number.
The cmdlist.txt has in one line the sms key word and the command seperated by a tabulator.

The application runs not as a deamon atm it is only for development purpose. Close it with ctrl+c or if it is running in the background kill the pid of smsrun.

D-Bus info:
service: org.ofono
path: /ril_0
interface: org.ofono.MessageManager
signal: IncomingMessage

It returns a string (the message) and a variant map [string,variant] which holds LocalSentTime, Sender, SentTime.


Sourcecode:
https://github.com/halftux/smsrun


All times are GMT. The time now is 08:27.

vBulletin® Version 3.8.8