Display the reason in client hangup message.

git-svn-id: http://yate.null.ro/svn/yate/trunk@1169 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2007-01-17 02:09:24 +00:00
parent 240e58b9db
commit 50d6b1ed2e
2 changed files with 13 additions and 0 deletions

View File

@ -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();

View File

@ -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;