Module: sems
Branch: master
Commit: ace2674c7fd960eebac7925cff5ce97787b6cf5c
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=ace2674c7fd960eebac7925cff5ce97787b6cf5c

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Tue Sep 27 13:17:59 2011 +0200

sbc: handle server shutdown in call control

---

 apps/sbc/SBC.cpp |    9 ++++++++-
 apps/sbc/SBC.h   |    2 ++
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/apps/sbc/SBC.cpp b/apps/sbc/SBC.cpp
index eee02f3..e435c12 100644
--- a/apps/sbc/SBC.cpp
+++ b/apps/sbc/SBC.cpp
@@ -1160,13 +1160,20 @@ void SBCDialog::onBye(const AmSipRequest& req)
   AmB2BCallerSession::onBye(req);
 }
 
-
 void SBCDialog::onCancel(const AmSipRequest& cancel)
 {
   dlg.bye();
   stopCall();
 }
 
+void SBCDialog::onSystemEvent(AmSystemEvent* ev) {
+  if (ev->sys_event == AmSystemEvent::ServerShutdown) {
+    onCallStopped();
+  }
+
+  AmB2BCallerSession::onSystemEvent(ev);
+}
+
 void SBCDialog::stopCall() {
   terminateOtherLeg();
   terminateLeg();
diff --git a/apps/sbc/SBC.h b/apps/sbc/SBC.h
index e33ac1d..c84d699 100644
--- a/apps/sbc/SBC.h
+++ b/apps/sbc/SBC.h
@@ -189,6 +189,8 @@ class SBCDialog : public AmB2BCallerSession, public 
CredentialHolder
   void onInvite(const AmSipRequest& req);
   void onCancel(const AmSipRequest& cancel);
 
+  void onSystemEvent(AmSystemEvent* ev);
+
   UACAuthCred* getCredentials();
 
   void setAuthHandler(AmSessionEventHandler* h) { auth = h; }

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to