FSO oeventsd and rules

Matt Joyce matt.joyce at gmail.com
Fri Aug 8 02:41:31 CEST 2008

On Thu, Aug 7, 2008 at 12:53 PM, Guillaume Chereau <charlie at openmoko.org> wrote:
> Just for your information, with the new events system, it will soon be
> different. You will have to edit the rule.yaml file. It looks like this
> now :
> -
>    # This rule will play a ring tone when a call is incoming
>    trigger: CallStatus()
>    filters: HasAttr(status, "incoming")
>    actions:
>        - PlaySound("/usr/share/sounds/Arkanoid_PSID.sid")
>        - StartVibration()
> -
>    # This one will stop the ring tone when the call is in an other state
>    trigger: CallStatus()
>    filters: Not(HasAttr(status, "incoming"))
>    actions:
>        - StopSound("/usr/share/sounds/Arkanoid_PSID.sid")
>        - StopVibration()

> Well, it is very new, I just added this to the framework a few days ago.
> It uses the yaml syntax [0] that I like a lot . If you want to see the
> code, download the framework daemon [1], and have a look at the files in
> subsystems/oeventsd/ It is all in python and there is enough
> documentation to get the idea.
> As soon as the framework team accepts this thing, I will create a
> tutorial on how to create custom rules in the freesmartphone wiki [1]
> [0] http://www.yaml.org/
> [1] http://git.freesmartphone.org/?p=framework.git;a=summary
> [2] http://www.freesmartphone.org/index.php/Tutorials

Am I right in thinking that oeventsd [1] is essentially a rules
engine, looks that way.

So, for instance, to implement the feature 'change ringtone depending
on caller'.

1. Would ophone look up the callerid in contacts for a ringtone, and
pass it to oeventsd to be handled by Playsound?

2. Or will oeventsd be the brains, taking the callerid and processing
the rules, which may involve factoring in time, location, contact,
contact group memebership, etc, and initiating the most appropriate
action? (play sound, hangup, divert, answer and play message, start

3. Or might oeventsd hand off to a separate rules engine altogether?
This would allow others to write their own dbus compliant 'rulesd' in
whatever suits them (prolog, lua, etc).

Interesting times indeed.


[1] http://git.freesmartphone.org/?p=framework.git;a=tree;f=framework/subsystems/oeventsd

More information about the community mailing list