From 669570bfd36d447d446efb1e05f0c324a2710a6d Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Fri, 5 Dec 2008 17:07:30 +0000 Subject: [PATCH] new event handler onBeforeDestroy(): called in the session thread before the session is destroyed, i.e. after the main event loop has finished git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1162 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmSession.cpp | 1 + core/AmSession.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/AmSession.cpp b/core/AmSession.cpp index 6b1942d4..da43b5b5 100644 --- a/core/AmSession.cpp +++ b/core/AmSession.cpp @@ -369,6 +369,7 @@ void AmSession::run() ERROR("%i %s\n",e.code,e.reason.c_str()); } + onBeforeDestroy(); destroy(); session_num_mut.lock(); diff --git a/core/AmSession.h b/core/AmSession.h index 20086f22..8bf39a27 100644 --- a/core/AmSession.h +++ b/core/AmSession.h @@ -416,7 +416,9 @@ public: * Entry point for SIP events */ virtual void onSipEvent(AmSipEvent* sip_ev); + /** Entry point for SIP Requests */ virtual void onSipRequest(const AmSipRequest& req); + /** Entry point for SIP Replies */ virtual void onSipReply(const AmSipReply& reply); @@ -435,7 +437,7 @@ public: /** This callback is called if RTP timeout encountered */ virtual void onRtpTimeout(); - /* only called by AmSipDialog */ + /* Called by AmSipDialog when a request is sent */ virtual void onSendRequest(const string& method, const string& content_type, const string& body, @@ -443,6 +445,7 @@ public: int flags, unsigned int cseq); + /* Called by AmSipDialog when a reply is sent */ virtual void onSendReply(const AmSipRequest& req, unsigned int code, const string& reason, @@ -451,6 +454,12 @@ public: string& hdrs, int flags); + /** + * called in the session thread before the session is destroyed, + * i.e. after the main event loop has finished + */ + virtual void onBeforeDestroy() { } + // The IP address to put as c= in SDP bodies and to use for Contact:. string advertisedIP(); };