Author: sayer
Date: 2008-11-11 16:36:48 +0100 (Tue, 11 Nov 2008)
New Revision: 1130
Added:
trunk/apps/dsm/doc/examples/early_media.dsm
trunk/apps/dsm/doc/examples/moddlg_late_early.dsm
Log:
some early media examples
Added: trunk/apps/dsm/doc/examples/early_media.dsm
===================================================================
--- trunk/apps/dsm/doc/examples/early_media.dsm 2008-11-11 14:58:59 UTC (rev
1129)
+++ trunk/apps/dsm/doc/examples/early_media.dsm 2008-11-11 15:36:48 UTC (rev
1130)
@@ -0,0 +1,30 @@
+
+import(mod_dlg);
+
+initial state START ;
+transition "on invite" START - invite -> runinvite;
+transition "on sess start" START - sessionStart -> runstart;
+
+state runinvite
+ enter {
+ -- we don't want to have the default 200 OK reply
+ set(reply_request=0);
+ };
+
+state runstart
+ enter {
+ dlg.acceptInvite(183, progress);
+ connectMedia();
+ -- can of course be playPrompt as well
+ playFile(/home/stefan/sub_nautilus.wav);
+ setTimer(1, 10);
+ };
+
+transition FR runstart - timerTest(#id==1) /
+ dlg.reply(500, denied);
+ stop
+ -> FIN;
+
+transition bye runstart - hangup / stop -> FIN;
+
+state FIN;
Added: trunk/apps/dsm/doc/examples/moddlg_late_early.dsm
===================================================================
--- trunk/apps/dsm/doc/examples/moddlg_late_early.dsm 2008-11-11 14:58:59 UTC
(rev 1129)
+++ trunk/apps/dsm/doc/examples/moddlg_late_early.dsm 2008-11-11 15:36:48 UTC
(rev 1130)
@@ -0,0 +1,44 @@
+-- this is an example of an early media application, that
+-- has to do some possibly blocking operation on start of processing,
+-- so session processing is delayed (here with timer 1)
+-- later 183 is sent, and FR sent after another timer 2
+
+import(mod_dlg);
+
+initial state START ;
+transition "on invite" START - invite -> runinvite;
+transition "on sess start" START - sessionStart -> runstart;
+state runinvite
+ enter {
+ log(2, run invite!);
+ dlg.reply(100, trytry);
+ -- we don't want to have the default 200 OK reply
+ set(reply_request=0);
+};
+
+state runstart
+ enter {
+ log(2, run start!);
+ -- we don't want to have session connected (RTP sent) yet
+ set(connect_session=0);
+ setTimer(1, 2);
+ };
+
+transition "go early" runstart - timerTest(#id==1) /
+ dlg.acceptInvite(183, progress);
+ connectMedia();
+ playFile(/home/stefan/sub_nautilus.wav);
+ setTimer(2, 5);
+ -> waitstop;
+
+state waitstop;
+
+transition FR waitstop - timerTest(#id==2) /
+ dlg.reply(500, denied);
+ stop
+ -> FIN;
+
+transition bye waitstop - hangup / stop -> FIN;
+transition bye runstart - hangup / stop -> FIN;
+
+state FIN;
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev