mirror of https://github.com/sipwise/sems.git
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1130 8eb893ce-cfd4-0310-b710-fb5ebe64c474sayer/1.4-spce2.6
parent
c122dd0bf0
commit
2468e33441
@ -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;
|
||||
@ -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;
|
||||
Loading…
Reference in new issue