DSM: adds onBeforeDestroy event handler to modules

sayer/1.4-spce2.6
Stefan Sayer 16 years ago
parent c2bbb3f709
commit aee8585091

@ -341,6 +341,10 @@ void DSMCall::onSystemEvent(AmSystemEvent* ev) {
}
}
void DSMCall::onBeforeDestroy() {
engine.onBeforeDestroy(this, this);
}
void DSMCall::process(AmEvent* event)
{

@ -81,6 +81,7 @@ public:
void onCancel();
void onBye(const AmSipRequest& req);
void onDtmf(int event, int duration_msec);
void onBeforeDestroy();
void onSipRequest(const AmSipRequest& req);
void onSipReply(const AmSipReply& reply, int old_dlg_status, const string& trans_method);

@ -51,6 +51,7 @@ class DSMModule {
virtual int preload() { return 0; }
virtual bool onInvite(const AmSipRequest& req, DSMSession* sess) { return true; }
virtual void onBeforeDestroy(DSMSession* sc_sess, AmSession* sess) { }
};
typedef map<string,string> EventParamT;

@ -218,6 +218,11 @@ bool DSMStateEngine::onInvite(const AmSipRequest& req, DSMSession* sess) {
return res;
}
void DSMStateEngine::onBeforeDestroy(DSMSession* sc_sess, AmSession* sess) {
for (vector<DSMModule*>::iterator it =
mods.begin(); it != mods.end(); it++)
(*it)->onBeforeDestroy(sc_sess, sess);
}
bool DSMStateEngine::runactions(vector<DSMAction*>::iterator from,
vector<DSMAction*>::iterator to,

@ -249,6 +249,7 @@ class DSMStateEngine {
/** @return whether call should be accepted */
bool onInvite(const AmSipRequest& req, DSMSession* sess);
void onBeforeDestroy(DSMSession* sc_sess, AmSession* sess);
};
extern void varPrintArg(const AmArg& a, map<string, string>& dst, const string& name);

Loading…
Cancel
Save