From 21265b0fc3f21ff5976758aab046ffd687d2770e Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Tue, 6 Jul 2010 19:54:05 +0200 Subject: [PATCH] DSM: pass DSMSession along & save a dynamic_cast --- apps/dsm/DSMCall.cpp | 38 ++++++------ apps/dsm/DSMCoreModule.cpp | 2 +- apps/dsm/DSMCoreModule.h | 2 +- apps/dsm/DSMModule.h | 60 +++++-------------- apps/dsm/DSMStateEngine.cpp | 45 +++++++------- apps/dsm/DSMStateEngine.h | 26 ++++---- apps/dsm/mods/mod_dlg/ModDlg.cpp | 7 --- .../dsm/mods/mod_monitoring/ModMonitoring.cpp | 10 +--- apps/dsm/mods/mod_py/ModPy.h | 4 +- 9 files changed, 80 insertions(+), 114 deletions(-) diff --git a/apps/dsm/DSMCall.cpp b/apps/dsm/DSMCall.cpp index 2ad8ebc8..b3477534 100644 --- a/apps/dsm/DSMCall.cpp +++ b/apps/dsm/DSMCall.cpp @@ -93,7 +93,7 @@ void DSMCall::onInvite(const AmSipRequest& req) { bool run_session_invite = engine.onInvite(req, this); if (run_invite_event) { - if (!engine.init(this, startDiagName, DSMCondition::Invite)) + if (!engine.init(this, this, startDiagName, DSMCondition::Invite)) run_session_invite =false; if (checkVar(DSM_CONNECT_SESSION, DSM_CONNECT_SESSION_FALSE)) { @@ -120,7 +120,7 @@ void DSMCall::onOutgoingInvite(const string& headers) { bool run_session_invite = engine.onInvite(req, this); if (run_invite_event) { - if (!engine.init(this, startDiagName, DSMCondition::Invite)) + if (!engine.init(this, this, startDiagName, DSMCondition::Invite)) run_session_invite =false; if (checkVar(DSM_CONNECT_SESSION, DSM_CONNECT_SESSION_FALSE)) { @@ -146,7 +146,7 @@ void DSMCall::onOutgoingInvite(const string& headers) { params["reason"] = reply.reason; params["has_body"] = reply.body.empty() ? "false" : "true"; - engine.runEvent(this, DSMCondition::Ringing, ¶ms); + engine.runEvent(this, this, DSMCondition::Ringing, ¶ms); // todo: local ringbacktone } @@ -156,7 +156,7 @@ void DSMCall::onEarlySessionStart(const AmSipReply& reply) { params["reason"] = reply.reason; params["has_body"] = reply.body.empty() ? "false" : "true"; - engine.runEvent(this, DSMCondition::EarlySession, ¶ms); + engine.runEvent(this, this, DSMCondition::EarlySession, ¶ms); if (checkVar(DSM_CONNECT_EARLY_SESSION, DSM_CONNECT_EARLY_SESSION_FALSE)) { DBG("call does not connect early session\n"); @@ -192,7 +192,7 @@ void DSMCall::onSessionStart(const AmSipReply& rep) } void DSMCall::startSession(){ - engine.init(this, startDiagName, DSMCondition::SessionStart); + engine.init(this, this, startDiagName, DSMCondition::SessionStart); setReceiving(true); @@ -232,7 +232,7 @@ void DSMCall::onDtmf(int event, int duration_msec) { map params; params["key"] = int2str(event); params["duration"] = int2str(duration_msec); - engine.runEvent(this, DSMCondition::Key, ¶ms); + engine.runEvent(this, this, DSMCondition::Key, ¶ms); } void DSMCall::onBye(const AmSipRequest& req) @@ -241,13 +241,13 @@ void DSMCall::onBye(const AmSipRequest& req) map params; params["headers"] = req.hdrs; - engine.runEvent(this, DSMCondition::Hangup, ¶ms); + engine.runEvent(this, this, DSMCondition::Hangup, ¶ms); } void DSMCall::onCancel() { DBG("onCancel\n"); if (dlg.getStatus() < AmSipDialog::Connected) - engine.runEvent(this, DSMCondition::Hangup, NULL); + engine.runEvent(this, this, DSMCondition::Hangup, NULL); else { DBG("ignoring onCancel event in established dialog\n"); } @@ -272,7 +272,7 @@ void DSMCall::onSipRequest(const AmSipRequest& req) { DSMSipRequest* sip_req = new DSMSipRequest(&req); avar[DSM_AVAR_REQUEST] = AmArg(sip_req); - engine.runEvent(this, DSMCondition::SipRequest, ¶ms); + engine.runEvent(this, this, DSMCondition::SipRequest, ¶ms); delete sip_req; avar.erase(DSM_AVAR_REQUEST); @@ -306,7 +306,7 @@ void DSMCall::onSipReply(const AmSipReply& reply, int old_dlg_status) { DSMSipReply* dsm_reply = new DSMSipReply(&reply); avar[DSM_AVAR_REPLY] = AmArg(dsm_reply); - engine.runEvent(this, DSMCondition::SipReply, ¶ms); + engine.runEvent(this, this, DSMCondition::SipReply, ¶ms); delete dsm_reply; avar.erase(DSM_AVAR_REPLY); @@ -327,7 +327,7 @@ void DSMCall::onSipReply(const AmSipReply& reply, int old_dlg_status) { map params; params["code"] = int2str(reply.code); params["reason"] = reply.reason; - engine.runEvent(this, DSMCondition::FailedCall, ¶ms); + engine.runEvent(this, this, DSMCondition::FailedCall, ¶ms); setStopped(); } } @@ -338,7 +338,7 @@ void DSMCall::process(AmEvent* event) if (event->event_id == DSM_EVENT_ID) { DSMEvent* dsm_event = dynamic_cast(event); if (dsm_event) { - engine.runEvent(this, DSMCondition::DSMEvent, &dsm_event->params); + engine.runEvent(this, this, DSMCondition::DSMEvent, &dsm_event->params); return; } @@ -350,7 +350,7 @@ void DSMCall::process(AmEvent* event) (audio_event->event_id == AmAudioEvent::noAudio))){ map params; params["type"] = audio_event->event_id == AmAudioEvent::cleared?"cleared":"noAudio"; - engine.runEvent(this, DSMCondition::NoAudio, ¶ms); + engine.runEvent(this, this, DSMCondition::NoAudio, ¶ms); return; } @@ -359,14 +359,14 @@ void DSMCall::process(AmEvent* event) int timer_id = plugin_event->data.get(0).asInt(); map params; params["id"] = int2str(timer_id); - engine.runEvent(this, DSMCondition::Timer, ¶ms); + engine.runEvent(this, this, DSMCondition::Timer, ¶ms); } AmPlaylistSeparatorEvent* sep_ev = dynamic_cast(event); if (sep_ev) { map params; params["id"] = int2str(sep_ev->event_id); - engine.runEvent(this, DSMCondition::PlaylistSeparator, ¶ms); + engine.runEvent(this, this, DSMCondition::PlaylistSeparator, ¶ms); } // todo: give modules the possibility to define/process events @@ -389,7 +389,7 @@ void DSMCall::process(AmEvent* event) // save reference to full parameters avar[DSM_AVAR_JSONRPCRESPONEDATA] = AmArg(&resp_ev->response.data); - engine.runEvent(this, DSMCondition::JsonRpcResponse, ¶ms); + engine.runEvent(this, this, DSMCondition::JsonRpcResponse, ¶ms); avar.erase(DSM_AVAR_JSONRPCRESPONEDATA); return; @@ -412,7 +412,7 @@ void DSMCall::process(AmEvent* event) // save reference to full parameters avar[DSM_AVAR_JSONRPCREQUESTDATA] = AmArg(&req_ev->params); - engine.runEvent(this, DSMCondition::JsonRpcRequest, ¶ms); + engine.runEvent(this, this, DSMCondition::JsonRpcRequest, ¶ms); avar.erase(DSM_AVAR_JSONRPCREQUESTDATA); return; @@ -613,7 +613,7 @@ void DSMCall::onOtherBye(const AmSipRequest& req) { map params; params["hdrs"] = req.hdrs; // todo: optimization - make this configurable - engine.runEvent(this, DSMCondition::B2BOtherBye, ¶ms); + engine.runEvent(this, this, DSMCondition::B2BOtherBye, ¶ms); } bool DSMCall::onOtherReply(const AmSipReply& reply) { @@ -625,7 +625,7 @@ bool DSMCall::onOtherReply(const AmSipReply& reply) { params["reason"] = reply.reason; params["hdrs"] = reply.hdrs; // todo: optimization - make this configurable - engine.runEvent(this, DSMCondition::B2BOtherReply, ¶ms); + engine.runEvent(this, this, DSMCondition::B2BOtherReply, ¶ms); return false; } diff --git a/apps/dsm/DSMCoreModule.cpp b/apps/dsm/DSMCoreModule.cpp index 7dc70dad..8b0947a3 100644 --- a/apps/dsm/DSMCoreModule.cpp +++ b/apps/dsm/DSMCoreModule.cpp @@ -352,7 +352,7 @@ EXEC_ACTION_START(SCStopAction) { #define DEF_SCModActionExec(clsname) \ \ - bool clsname::execute(AmSession* sess, \ + bool clsname::execute(AmSession* sess, DSMSession* sc_sess, \ DSMCondition::EventType event, \ map* event_params) { \ return true; \ diff --git a/apps/dsm/DSMCoreModule.h b/apps/dsm/DSMCoreModule.h index 5c45ebcc..6f13f0dd 100644 --- a/apps/dsm/DSMCoreModule.h +++ b/apps/dsm/DSMCoreModule.h @@ -110,7 +110,7 @@ class SCDIAction bool get_res; public: SCDIAction(const string& arg, bool get_res); - bool execute(AmSession* sess, + bool execute(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params); }; diff --git a/apps/dsm/DSMModule.h b/apps/dsm/DSMModule.h index 3b32e0b6..78c58b7e 100644 --- a/apps/dsm/DSMModule.h +++ b/apps/dsm/DSMModule.h @@ -96,7 +96,7 @@ class SCStrArgAction : public SCStrArgAction { \ public: \ CL_Name(const string& arg) : SCStrArgAction(arg) { } \ - bool execute(AmSession* sess, \ + bool execute(AmSession* sess, DSMSession* sc_sess, \ DSMCondition::EventType event, \ map* event_params); \ }; \ @@ -107,7 +107,7 @@ class SCStrArgAction : public SCStrArgAction { \ public: \ CL_Name(const string& arg) : SCStrArgAction(arg) { } \ - bool execute(AmSession* sess, \ + bool execute(AmSession* sess, DSMSession* sc_sess, \ DSMCondition::EventType event, \ map* event_params); \ SEAction getSEAction(std::string&); \ @@ -120,7 +120,7 @@ class SCStrArgAction string par2; \ public: \ CL_Name(const string& arg); \ - bool execute(AmSession* sess, \ + bool execute(AmSession* sess, DSMSession* sc_sess, \ DSMCondition::EventType event, \ map* event_params); \ }; \ @@ -195,25 +195,17 @@ class SCStrArgAction } \ -#define GET_SCSESSION() \ - DSMSession* sc_sess = dynamic_cast(sess); \ - if (!sc_sess) { \ - ERROR("wrong session type\n"); \ - return false; \ - } - - #define EXEC_ACTION_START(act_name) \ - bool act_name::execute(AmSession* sess, \ + bool act_name::execute(AmSession* sess, DSMSession* sc_sess, \ DSMCondition::EventType event, \ - map* event_params) { \ - GET_SCSESSION(); + map* event_params) { + #define EXEC_ACTION_END \ return false; \ } -#define EXEC_ACTION_STOP \ +#define EXEC_ACTION_STOP \ return false; string resolveVars(const string s, AmSession* sess, @@ -241,39 +233,19 @@ void splitCmd(const string& from_str, \ public: \ \ - cond_name(const string& arg, bool inv) \ - : arg(arg), inv(inv) { } \ - bool match(AmSession* sess, DSMCondition::EventType event, \ - map* event_params); \ - }; \ + cond_name(const string& arg, bool inv) \ + : arg(arg), inv(inv) { } \ + bool match(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, \ + map* event_params); \ + }; #define MATCH_CONDITION_START(cond_clsname) \ - bool cond_clsname::match(AmSession* sess, DSMCondition::EventType event, \ - map* event_params) { \ - GET_SCSESSION(); - -#define MATCH_CONDITION_END } - - -#define GET_SCSESSION() \ - DSMSession* sc_sess = dynamic_cast(sess); \ - if (!sc_sess) { \ - ERROR("wrong session type\n"); \ - return false; \ - } - - -#define EXEC_ACTION_START(act_name) \ - bool act_name::execute(AmSession* sess, \ - DSMCondition::EventType event, \ - map* event_params) { \ - GET_SCSESSION(); - -#define EXEC_ACTION_END \ - return false; \ - } + bool cond_clsname::match(AmSession* sess, DSMSession* sc_sess, \ + DSMCondition::EventType event, \ + map* event_params) { +#define MATCH_CONDITION_END } #define DECLARE_MODULE(mod_cls_name) \ class mod_cls_name \ diff --git a/apps/dsm/DSMStateEngine.cpp b/apps/dsm/DSMStateEngine.cpp index 7769d118..8b12798e 100644 --- a/apps/dsm/DSMStateEngine.cpp +++ b/apps/dsm/DSMStateEngine.cpp @@ -221,12 +221,12 @@ bool DSMStateEngine::onInvite(const AmSipRequest& req, DSMSession* sess) { bool DSMStateEngine::runactions(vector::iterator from, vector::iterator to, - AmSession* sess, DSMCondition::EventType event, + AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params, bool& is_consumed) { // DBG("running %zd actions\n", to - from); for (vector::iterator it=from; it != to; it++) { DBG("executing '%s'\n", (*it)->name.c_str()); - if ((*it)->execute(sess, event, event_params)) { + if ((*it)->execute(sess, sc_sess, event, event_params)) { string se_modifier; switch ((*it)->getSEAction(se_modifier)) { case DSMAction::Repost: @@ -234,17 +234,17 @@ bool DSMStateEngine::runactions(vector::iterator from, break; case DSMAction::Jump: DBG("jumping %s\n", se_modifier.c_str()); - if (jumpDiag(se_modifier, sess, event, event_params)) { + if (jumpDiag(se_modifier, sess, sc_sess, event, event_params)) { // is_consumed = false; return true; } break; case DSMAction::Call: - if (callDiag(se_modifier, sess, event, event_params)) { + if (callDiag(se_modifier, sess, sc_sess, event, event_params)) { // is_consumed = false; return true; } break; case DSMAction::Return: - if (returnDiag(sess)) { + if (returnDiag(sess, sc_sess)) { //is_consumed = false; return true; } break; @@ -266,11 +266,12 @@ void DSMStateEngine::addModules(vector modules) { mods.push_back(*it); } -bool DSMStateEngine::init(AmSession* sess, const string& startDiagram, +bool DSMStateEngine::init(AmSession* sess, DSMSession* sc_sess, + const string& startDiagram, DSMCondition::EventType init_event) { try { - if (!jumpDiag(startDiagram, sess, init_event, NULL)) { + if (!jumpDiag(startDiagram, sess, sc_sess, init_event, NULL)) { ERROR("initializing with start diag '%s'\n", startDiagram.c_str()); return false; @@ -278,24 +279,24 @@ bool DSMStateEngine::init(AmSession* sess, const string& startDiagram, } catch (DSMException& e) { DBG("Exception type '%s' occured while initializing! Run init event as exception...\n", e.params["type"].c_str()); - runEvent(sess, init_event, &e.params, true); + runEvent(sess, sc_sess, init_event, &e.params, true); return true; } DBG("run init event...\n"); - runEvent(sess, init_event, NULL); + runEvent(sess, sc_sess, init_event, NULL); return true; } -bool DSMCondition::_match(AmSession* sess, +bool DSMCondition::_match(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params) { // or xor - return invert?(!match(sess,event,event_params)):match(sess,event,event_params); + return invert?(!match(sess,sc_sess,event,event_params)):match(sess, sc_sess, event, event_params); } -bool DSMCondition::match(AmSession* sess, +bool DSMCondition::match(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params) { @@ -316,7 +317,7 @@ bool DSMCondition::match(AmSession* sess, return true; } -void DSMStateEngine::runEvent(AmSession* sess, +void DSMStateEngine::runEvent(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params, bool run_exception) { @@ -342,7 +343,7 @@ void DSMStateEngine::runEvent(AmSession* sess, vector::iterator con=tr->precond.begin(); while (con!=tr->precond.end()) { - if (!(*con)->_match(sess, active_event, active_params)) + if (!(*con)->_match(sess, sc_sess, active_event, active_params)) break; con++; } @@ -366,7 +367,7 @@ void DSMStateEngine::runEvent(AmSession* sess, current->post_actions.size(), current->name.c_str()); if (runactions(current->post_actions.begin(), current->post_actions.end(), - sess, active_event, active_params, is_consumed)) { + sess, sc_sess, active_event, active_params, is_consumed)) { break; } } @@ -377,7 +378,7 @@ void DSMStateEngine::runEvent(AmSession* sess, tr->actions.size(), tr->name.c_str()); if (runactions(tr->actions.begin(), tr->actions.end(), - sess, active_event, active_params, is_consumed)) { + sess, sc_sess, active_event, active_params, is_consumed)) { break; } } @@ -412,7 +413,7 @@ void DSMStateEngine::runEvent(AmSession* sess, current->pre_actions.size(), current->name.c_str()); if (runactions(current->pre_actions.begin(), current->pre_actions.end(), - sess, active_event, active_params, is_consumed)) { + sess, sc_sess, active_event, active_params, is_consumed)) { break; } } @@ -433,7 +434,7 @@ void DSMStateEngine::runEvent(AmSession* sess, } while (!is_consumed); } -bool DSMStateEngine::callDiag(const string& diag_name, AmSession* sess, +bool DSMStateEngine::callDiag(const string& diag_name, AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params) { if (!current || !current_diag) { @@ -441,10 +442,10 @@ bool DSMStateEngine::callDiag(const string& diag_name, AmSession* sess, return false; } stack.push_back(std::make_pair(current_diag, current)); - return jumpDiag(diag_name, sess, event, event_params); + return jumpDiag(diag_name, sess, sc_sess, event, event_params); } -bool DSMStateEngine::jumpDiag(const string& diag_name, AmSession* sess, +bool DSMStateEngine::jumpDiag(const string& diag_name, AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params) { for (vector::iterator it= @@ -478,7 +479,7 @@ bool DSMStateEngine::jumpDiag(const string& diag_name, AmSession* sess, is_finished = true; runactions(current->pre_actions.begin(), current->pre_actions.end(), - sess, event, event_params, is_finished); + sess, sc_sess, event, event_params, is_finished); return true; } @@ -487,7 +488,7 @@ bool DSMStateEngine::jumpDiag(const string& diag_name, AmSession* sess, return false; } -bool DSMStateEngine::returnDiag(AmSession* sess) { +bool DSMStateEngine::returnDiag(AmSession* sess, DSMSession* sc_sess) { if (stack.empty()) { ERROR("returning from empty stack\n"); return false; diff --git a/apps/dsm/DSMStateEngine.h b/apps/dsm/DSMStateEngine.h index 1f0023e7..89731b1f 100644 --- a/apps/dsm/DSMStateEngine.h +++ b/apps/dsm/DSMStateEngine.h @@ -87,6 +87,7 @@ class DSMCondition JsonRpcResponse, JsonRpcRequest + }; bool invert; @@ -97,10 +98,10 @@ class DSMCondition EventType type; map params; - bool _match(AmSession* sess, DSMCondition::EventType event, + bool _match(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params); - virtual bool match(AmSession* sess, DSMCondition::EventType event, + virtual bool match(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params); }; @@ -120,7 +121,7 @@ class DSMAction virtual ~DSMAction() { /* DBG("dest action\n"); */ } /** @return whether state engine is to be modified (via getSEAction) */ - virtual bool execute(AmSession* sess, DSMCondition::EventType event, \ + virtual bool execute(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, \ map* event_params) = 0; /** @return state engine modification */ @@ -210,14 +211,16 @@ class DSMStateEngine { vector > stack; - bool callDiag(const string& diag_name, AmSession* sess, DSMCondition::EventType event, - map* event_params); - bool jumpDiag(const string& diag_name, AmSession* sess, DSMCondition::EventType event, - map* event_params); - bool returnDiag(AmSession* sess); + bool callDiag(const string& diag_name, AmSession* sess, DSMSession* sc_sess, + DSMCondition::EventType event, + map* event_params); + bool jumpDiag(const string& diag_name, AmSession* sess, DSMSession* sc_sess, + DSMCondition::EventType event, + map* event_params); + bool returnDiag(AmSession* sess, DSMSession* sc_sess); bool runactions(vector::iterator from, vector::iterator to, - AmSession* sess, DSMCondition::EventType event, + AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params, bool& is_consumed); vector mods; @@ -229,10 +232,11 @@ class DSMStateEngine { void addDiagram(DSMStateDiagram* diag); void addModules(vector modules); - bool init(AmSession* sess, const string& startDiagram, + bool init(AmSession* sess, DSMSession* sc_sess, + const string& startDiagram, DSMCondition::EventType init_event); - void runEvent(AmSession* sess, + void runEvent(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params, bool run_exception = false); diff --git a/apps/dsm/mods/mod_dlg/ModDlg.cpp b/apps/dsm/mods/mod_dlg/ModDlg.cpp index 0f6c10a0..dc48a595 100644 --- a/apps/dsm/mods/mod_dlg/ModDlg.cpp +++ b/apps/dsm/mods/mod_dlg/ModDlg.cpp @@ -60,13 +60,6 @@ bool DLGModule::onInvite(const AmSipRequest& req, DSMSession* sess) { return true; } -#define GET_SCSESSION() \ - DSMSession* sc_sess = dynamic_cast(sess); \ - if (!sc_sess) { \ - ERROR("wrong session type\n"); \ - return false; \ - } - // todo: convert errors to exceptions void replyRequest(DSMSession* sc_sess, AmSession* sess, EventParamT* event_params, diff --git a/apps/dsm/mods/mod_monitoring/ModMonitoring.cpp b/apps/dsm/mods/mod_monitoring/ModMonitoring.cpp index af258dc5..84e67eba 100644 --- a/apps/dsm/mods/mod_monitoring/ModMonitoring.cpp +++ b/apps/dsm/mods/mod_monitoring/ModMonitoring.cpp @@ -73,10 +73,9 @@ DSMCondition* MonitoringModule::getCondition(const string& from_str) { } CONST_ACTION_2P(MonLogAction, ',', true); -bool MonLogAction::execute(AmSession* sess, +bool MonLogAction::execute(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params) { - GET_SCSESSION(); string prop = resolveVars(par1, sess, sc_sess, event_params); string val = resolveVars(par2, sess, sc_sess, event_params); @@ -87,10 +86,9 @@ bool MonLogAction::execute(AmSession* sess, } CONST_ACTION_2P(MonLogAddAction, ',', true); -bool MonLogAddAction::execute(AmSession* sess, +bool MonLogAddAction::execute(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params) { - GET_SCSESSION(); string prop = resolveVars(par1, sess, sc_sess, event_params); string val = resolveVars(par2, sess, sc_sess, event_params); @@ -100,11 +98,9 @@ bool MonLogAddAction::execute(AmSession* sess, return false; } -bool MonLogVarsAction::execute(AmSession* sess, +bool MonLogVarsAction::execute(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params) { - GET_SCSESSION(); - AmArg di_args,ret; di_args.push(AmArg(sess->getLocalTag().c_str())); diff --git a/apps/dsm/mods/mod_py/ModPy.h b/apps/dsm/mods/mod_py/ModPy.h index 972fb5cf..abe1bc1c 100644 --- a/apps/dsm/mods/mod_py/ModPy.h +++ b/apps/dsm/mods/mod_py/ModPy.h @@ -67,7 +67,7 @@ class SCPyPyAction PyObject* py_func; public: SCPyPyAction(const string& arg); - bool execute(AmSession* sess, + bool execute(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params); }; @@ -79,7 +79,7 @@ class PyPyCondition public: PyPyCondition(const string& arg); - bool match(AmSession* sess, DSMCondition::EventType event, + bool match(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, map* event_params); };