From 2468e334419982ca239005f2f39ba1b79ca65359 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Tue, 11 Nov 2008 15:36:48 +0000 Subject: [PATCH] some early media examples git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1130 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- apps/dsm/doc/examples/early_media.dsm | 30 ++++++++++++++ apps/dsm/doc/examples/moddlg_late_early.dsm | 44 +++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 apps/dsm/doc/examples/early_media.dsm create mode 100644 apps/dsm/doc/examples/moddlg_late_early.dsm diff --git a/apps/dsm/doc/examples/early_media.dsm b/apps/dsm/doc/examples/early_media.dsm new file mode 100644 index 00000000..dead6eaf --- /dev/null +++ b/apps/dsm/doc/examples/early_media.dsm @@ -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; diff --git a/apps/dsm/doc/examples/moddlg_late_early.dsm b/apps/dsm/doc/examples/moddlg_late_early.dsm new file mode 100644 index 00000000..bfb10ff4 --- /dev/null +++ b/apps/dsm/doc/examples/moddlg_late_early.dsm @@ -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;