Module: sems Branch: master Commit: 7a1e2164b83cd5331bd791b8a2a8342df56a3774 URL: https://github.com/sems-server/sems/commit/7a1e2164b83cd5331bd791b8a2a8342df56a3774
Author: Stefan Sayer <stefan.sa...@googlemail.com> Committer: Stefan Sayer <stefan.sa...@googlemail.com> Date: 2015-06-09T00:33:04+02:00 dsm: add beforeDestroy event (onBeforeDestroy), for cleanup etc --- Modified: apps/dsm/DSMCall.cpp Modified: apps/dsm/DSMCoreModule.cpp Modified: apps/dsm/DSMStateEngine.cpp Modified: apps/dsm/DSMStateEngine.h Modified: doc/dsm/dsm_syntax.txt --- Diff: https://github.com/sems-server/sems/commit/7a1e2164b83cd5331bd791b8a2a8342df56a3774.diff Patch: https://github.com/sems-server/sems/commit/7a1e2164b83cd5331bd791b8a2a8342df56a3774.patch --- diff --git a/apps/dsm/DSMCall.cpp b/apps/dsm/DSMCall.cpp index d02f6ff..c1d4615 100644 --- a/apps/dsm/DSMCall.cpp +++ b/apps/dsm/DSMCall.cpp @@ -446,6 +446,9 @@ void DSMCall::onSystemEvent(AmSystemEvent* ev) { } void DSMCall::onBeforeDestroy() { + map<string, string> params; + engine.runEvent(this, this, DSMCondition::BeforeDestroy, ¶ms); + engine.onBeforeDestroy(this, this); } diff --git a/apps/dsm/DSMCoreModule.cpp b/apps/dsm/DSMCoreModule.cpp index 2e53b8c..6e9991d 100644 --- a/apps/dsm/DSMCoreModule.cpp +++ b/apps/dsm/DSMCoreModule.cpp @@ -246,6 +246,9 @@ DSMCondition* DSMCoreModule::getCondition(const string& from_str) { if (cmd == "start") return new TestDSMCondition(params, DSMCondition::Start); + if (cmd == "beforeDestroy") + return new TestDSMCondition(params, DSMCondition::BeforeDestroy); + if (cmd == "reload") return new TestDSMCondition(params, DSMCondition::Reload); diff --git a/apps/dsm/DSMStateEngine.cpp b/apps/dsm/DSMStateEngine.cpp index 462b681..edbc5f2 100644 --- a/apps/dsm/DSMStateEngine.cpp +++ b/apps/dsm/DSMStateEngine.cpp @@ -50,6 +50,7 @@ const char* DSMCondition::type2str(EventType event) { rt(FailedCall); rt(SipRequest); rt(SipReply); + rt(BeforeDestroy); rt(Hangup); rt(Hold); diff --git a/apps/dsm/DSMStateEngine.h b/apps/dsm/DSMStateEngine.h index 7a247f5..44194d7 100644 --- a/apps/dsm/DSMStateEngine.h +++ b/apps/dsm/DSMStateEngine.h @@ -68,6 +68,7 @@ class DSMCondition FailedCall, SipRequest, SipReply, + BeforeDestroy, Hangup, Hold, diff --git a/doc/dsm/dsm_syntax.txt b/doc/dsm/dsm_syntax.txt index 1546af2..0a78671 100644 --- a/doc/dsm/dsm_syntax.txt +++ b/doc/dsm/dsm_syntax.txt @@ -356,6 +356,9 @@ brackets match. start start of a session (onStart). This event is processed before any other. +beforeDestroy + end of a session (onBeforeDestroy). This event is processed after any other. + hangup bye/cancel received parameters: _______________________________________________ Semsdev mailing list Semsdev@lists.iptel.org http://lists.iptel.org/mailman/listinfo/semsdev