From 3a8594612228f6921b2001f7c70ce614a36be549 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <alexandre.savard@savoirfairelinux.net> Date: Wed, 28 Oct 2009 13:53:51 -0400 Subject: [PATCH] [#2352] Fix continuous ringing when peer hangup and call not yet answered --- sflphone-common/src/managerimpl.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 274bd21820..6f8304964d 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -1707,9 +1707,8 @@ ManagerImpl::playDtmf (char code, bool isTalking) // put the size in bytes... // so size * 1 channel (mono) * sizeof (bytes for the data) // audiolayer->flushUrgent(); - - audiolayer->startStream(); - audiolayer->putUrgent (buf, size * sizeof (SFLDataFormat)); + audiolayer->startStream(); + audiolayer->putUrgent (buf, size * sizeof (SFLDataFormat)); } else { _debug(" playDtmf: Error cannot play dtmf\n"); @@ -1920,22 +1919,22 @@ ManagerImpl::peerHungupCall (const CallID& call_id) if (isCurrentCall(call_id)) { stopTone (true); - - int nbCalls = getCallList().size(); - - // stop streams - if (nbCalls <= 1) - { - _debug(" hangupCall: stop audio stream, ther is only %i call(s) remaining\n", nbCalls); - - AudioLayer* audiolayer = getAudioDriver(); - audiolayer->stopStream(); - } switchCall (""); } } + int nbCalls = getCallList().size(); + + // stop streams + if (nbCalls <= 1) + { + _debug(" hangupCall: stop audio stream, ther is only %i call(s) remaining\n", nbCalls); + + AudioLayer* audiolayer = getAudioDriver(); + audiolayer->stopStream(); + } + /* Direct IP to IP call */ if (getConfigFromCall (call_id) == Call::IPtoIP) { SIPVoIPLink::instance (AccountNULL)->hangup (call_id); @@ -2039,8 +2038,8 @@ bool ManagerImpl::playATone (Tone::TONEID toneId) if (audiolayer) { - audiolayer->startStream(); audiolayer->flushUrgent(); + audiolayer->startStream(); } if (_telephoneTone != 0) { -- GitLab