implemented CANCEL handling in early dialogs

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1647 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 16 years ago
parent 30cef546f6
commit e21df1c86e

@ -197,6 +197,15 @@ void DSMCall::onBye(const AmSipRequest& req)
engine.runEvent(this, DSMCondition::Hangup, &params);
}
void DSMCall::onCancel() {
DBG("onCancel\n");
if (dlg.getStatus() < AmSipDialog::Connected)
engine.runEvent(this, DSMCondition::Hangup, NULL);
else {
DBG("ignoring onCancel event in established dialog\n");
}
}
void DSMCall::process(AmEvent* event)
{

@ -76,6 +76,7 @@ public:
void onSessionStart(const AmSipRequest& req);
void onSessionStart(const AmSipReply& rep);
void startSession();
void onCancel();
void onBye(const AmSipRequest& req);
void onDtmf(int event, int duration_msec);

@ -19,36 +19,37 @@ state runinvite
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);
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(wav/default_en.wav);
dlg.acceptInvite(183, progress);
connectMedia();
playFile(wav/default_en.wav);
-> playing_early_msg;
transition "playing file failed" runstart - exception; test(#type==file) / {
log(1, Error playing file!);
dlg.reply(500, server error);
stop
log(1, Error playing file!);
dlg.reply(500, server error);
stop
} -> FIN;
state playing_early_msg;
transition "early message ended" playing_early_msg - noAudioTest /
dlg.acceptInvite(200, ok);
recordFile(/tmp/test.wav);
setTimer(3,10);
dlg.acceptInvite(200, ok);
recordFile(/tmp/test.wav);
setTimer(3,10);
-> recording;
transition "recording failed" playing_early_msg - exception; /
log(1, Error recording!); stop(true) -> FIN;
state recording;
transition "recording timer" recording - timerTest(#id==3) / stop(true) -> FIN;
transition bye (playing_early_msg, recording) - hangup / stop -> FIN;
transition "bye in early" (playing_early_msg, runstart) - hangup / {
dlg.reply(487,call terminated);
stop(false)
} -> FIN;
transition "recording timer" recording - timerTest(#id==3) / stop -> FIN;
transition "bye in recording" recording - hangup / stop -> FIN;
state FIN;

Loading…
Cancel
Save