From 1c83a0f27d7a48b815b8c5e12733ee4d7eebbc5f Mon Sep 17 00:00:00 2001 From: rjongbloed Date: Sat, 9 Jun 2007 07:37:59 +0000 Subject: [PATCH] Fixed some bugs in the LID code so USB handsets work correctly. --- src/lids/lidep.cxx | 27 ++++++++++----------------- src/lids/lidpluginmgr.cxx | 7 ++++++- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/lids/lidep.cxx b/src/lids/lidep.cxx index 0a1903ed..c6061135 100644 --- a/src/lids/lidep.cxx +++ b/src/lids/lidep.cxx @@ -24,6 +24,9 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.45 2007/06/09 07:37:59 rjongbloed + * Fixed some bugs in the LID code so USB handsets work correctly. + * * Revision 2.44 2007/04/04 02:12:00 rjongbloed * Reviewed and adjusted PTRACE log levels * Now follows 1=error,2=warn,3=info,4+=debug @@ -662,11 +665,6 @@ BOOL OpalLineConnection::OnSetUpConnection() BOOL OpalLineConnection::SetAlerting(const PString & calleeName, BOOL) { - if (IsOriginating()) { - PTRACE(2, "LID Con\tSetAlerting ignored on call we originated."); - return TRUE; - } - PTRACE(3, "LID Con\tSetAlerting " << *this); if (GetPhase() != SetUpPhase) @@ -683,21 +681,16 @@ BOOL OpalLineConnection::SetAlerting(const PString & calleeName, BOOL) BOOL OpalLineConnection::SetConnected() { - if (IsOriginating()) { - PTRACE(2, "LID Con\tSetConnected ignored on call we originated."); - return TRUE; - } - PTRACE(3, "LID Con\tSetConnected " << *this); - if (GetPhase() < ConnectedPhase) { - // switch phase - phase = ConnectedPhase; - connectedTime = PTime(); + if (GetPhase() >= ConnectedPhase) + return FALSE; - return line.StopTone(); - } - return FALSE; + // switch phase + phase = ConnectedPhase; + connectedTime = PTime(); + + return line.StopTone(); } diff --git a/src/lids/lidpluginmgr.cxx b/src/lids/lidpluginmgr.cxx index e6130774..8a7ac3ad 100644 --- a/src/lids/lidpluginmgr.cxx +++ b/src/lids/lidpluginmgr.cxx @@ -25,6 +25,9 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.11 2007/06/09 07:37:59 rjongbloed + * Fixed some bugs in the LID code so USB handsets work correctly. + * * Revision 2.10 2007/02/12 23:55:41 dereksmithies * Fix GCC warnings about unused enumeration values in switch statements. * @@ -162,6 +165,7 @@ OpalPluginLID::OpalPluginLID(const PluginLID_Definition & definition) OpalPluginLID::~OpalPluginLID() { + StopTone(0); if (m_context != NULL && m_definition.Destroy != NULL) m_definition.Destroy(&m_definition, m_context); } @@ -225,7 +229,7 @@ BOOL OpalPluginLID::Open(const PString & device) return FALSE; } - if (!m_recorder.Open(device, PSoundChannel::Player)) { + if (!m_recorder.Open(device, PSoundChannel::Recorder)) { PTRACE(1, "LID Plugin\t" << m_definition.name << " requires sound system, but cannot open recorder for \"" << device << '"'); return FALSE; } @@ -617,6 +621,7 @@ BOOL OpalPluginLID::ReadFrame(unsigned line, void * buffer, PINDEX & count) unsigned uiCount = 0; switch (CHECK_FN(ReadFrame, (m_context, line, buffer, &uiCount))) { case PluginLID_UnimplementedFunction : + count = GetReadFrameSize(line); if (!m_recorder.Read(buffer, count)) return FALSE; count = m_recorder.GetLastReadCount(); -- 2.11.4.GIT