From 50d6b1ed2e8c0e40315ba99f119672e577ca37b8 Mon Sep 17 00:00:00 2001 From: paulc Date: Wed, 17 Jan 2007 02:09:24 +0000 Subject: [PATCH] Display the reason in client hangup message. git-svn-id: http://yate.null.ro/svn/yate/trunk@1169 acf43c95-373e-0410-b603-e72c3f656dc1 --- engine/Client.cpp | 11 +++++++++++ yatecbase.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/engine/Client.cpp b/engine/Client.cpp index b54252b4..c4ba2334 100644 --- a/engine/Client.cpp +++ b/engine/Client.cpp @@ -2109,6 +2109,8 @@ ClientChannel::~ClientChannel() closeMedia(); String tmp("Hung up:"); tmp << " " << (address() ? address() : id()); + if (m_reason) + tmp << " (" << m_reason << ")"; if (Client::self()) { Client::self()->delChannel(this); Client::self()->setStatusLocked(tmp); @@ -2116,6 +2118,13 @@ ClientChannel::~ClientChannel() Engine::enqueue(message("chan.hangup")); } +void ClientChannel::disconnected(bool final, const char* reason) +{ + Channel::disconnected(final,reason); + if (!final) + m_reason = reason; +} + bool ClientChannel::openMedia(bool replace) { String dev = ClientDriver::device(); @@ -2267,6 +2276,7 @@ bool ClientChannel::msgAnswered(Message& msg) m_canAnswer = false; m_canConference = true; m_canTransfer = true; + m_reason.clear(); Client::self()->setStatusLocked("Call answered"); openMedia(); bool ret = Channel::msgAnswered(msg); @@ -2282,6 +2292,7 @@ void ClientChannel::callAnswer() m_canAnswer = false; m_canConference = true; m_canTransfer = true; + m_reason.clear(); status("answered"); Client::self()->setStatus("Call answered"); openMedia(); diff --git a/yatecbase.h b/yatecbase.h index f6c6f60d..aa0187ab 100644 --- a/yatecbase.h +++ b/yatecbase.h @@ -410,9 +410,11 @@ public: { return m_line; } void line(int newLine); protected: + virtual void disconnected(bool final, const char* reason); void update(bool client = true); String m_party; String m_desc; + String m_reason; u_int64_t m_time; int m_line; bool m_flashing;