Hello,

I have just published the DonkeySM, a state machine interpreter for easy 
application development in SEMS (yet easier than it was before!). See
http://svn.berlios.de/wsvn/sems/trunk/apps/dsm/doc/Readme.dsm.txt
for a description.

A motivation for developing this was that if you have complex services 
with a lot of user interaction, your service logic gets split up on the 
various event handlers, and after a while it is difficult keeping track 
of it and testing it. The DSM makes it much simpler - define your 
service in an easy to understand state machine, and if you need to, your 
complex processing wrapped in some module actions and conditions.

An example?
-----------
initial state START
         enter {
           playPrompt(hello);
          -- hint timer
           setTimer(1, 5);
           -- timeout timer, another way to set a timer
           DI(user_timer, setTimer, (int)2, (int)60, @local_tag);
           -- just for fun
           recordFile(/tmp/test_rec.wav);
         };

transition "start pin entry" START - / set($pin = "") -> ADDKEY;
state ADDKEY;

transition "play hint (from timer)" ADDKEY - timerTest(#id == 1) /  {
             playPrompt(hint);
            } -> ADDKEY;

transition "add a key" ADDKEY - keyTest(#key < 10) / {
              append($pin, #key);
              closePlaylist();
              playPrompt(#key);
            } -> ADDKEY;

state FIN
        enter {
          stopRecord();
         -- send BYE
         stop(true);
        };

transition "finished with entry" ADDKEY - keyTest(#key > 9) /
    log(2, $pin) -> FIN;

transition "timeout - stop it" ADDKEY - timerTest(#id == 2) -> FIN;
transition "bye received" ADDKEY - hangup / stopRecord(); stop(false) -> 
ADDKEY;
---------

You can get it by checking out SEMS from trunk.

BR
Stefan

P.S. do we want the 110k commit log in the dev list?

-- 
Stefan Sayer
VoIP Services

[EMAIL PROTECTED]
www.iptego.com

iptego GmbH
Am Borsigturm 40
13507 Berlin
Germany

Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to