diff --git a/src/audio/audiolayer.cpp b/src/audio/audiolayer.cpp
index 18ca6f32c6d9eb804fea0d92fe1dfb2ed7f1cb93..2e9650a5602f52995aee6fd9995251088df86dcb 100644
--- a/src/audio/audiolayer.cpp
+++ b/src/audio/audiolayer.cpp
@@ -103,6 +103,7 @@ AudioLayer::startStream(void)
 {
   ost::MutexLock guard(_mutex);
   if (_stream && !_stream->isActive()) {
+    _debug("starting stream...\n");
     _stream->start();
   }
 }
@@ -113,6 +114,7 @@ AudioLayer::stopStream(void)
   ost::MutexLock guard(_mutex);
   try {
     if (_stream && !_stream->isStopped()) {
+      _debug("stopping stream...\n");
       _stream->stop();
       _mainSndRingBuffer.flush();
       _urgentRingBuffer.flush();
@@ -163,8 +165,7 @@ AudioLayer::flushMain()
 void
 AudioLayer::putUrgent(void* buffer, int toCopy)
 {
-  ost::MutexLock guard(_mutex);
-  int a = _mainSndRingBuffer.AvailForPut();
+  int a = _urgentRingBuffer.AvailForPut();
   if ( a >= toCopy ) {
     _urgentRingBuffer.Put(buffer, toCopy);
   } else {
diff --git a/src/audio/audiortp.cpp b/src/audio/audiortp.cpp
index 3395ae8d9e4b91833d9841f4255b5c7a8bbd825b..6a65a1ffe278db2be00046a72ee0d1131a028574 100644
--- a/src/audio/audiortp.cpp
+++ b/src/audio/audiortp.cpp
@@ -181,7 +181,6 @@ AudioRtpRTX::sendSessionFromMic (unsigned char* data_to_send, int16* data_from_m
   }
 
   // Get bytes from micRingBuffer to data_from_mic
-  Manager::instance().getAudioDriver()->startStream();
   Manager::instance().getAudioDriver()->micRingBuffer().Get(data_from_mic_stereo, bytesAvail, 100);
   // control volume and stereo->mono
   // the j is in int16 RTP_FRAMES2SEND
@@ -192,6 +191,7 @@ AudioRtpRTX::sendSessionFromMic (unsigned char* data_to_send, int16* data_from_m
   }
   if ( bytesAvail != maxBytesToGet ) {
     // fill end with 0...
+    _debug("Padding mic: %d bytes\n", (maxBytesToGet-bytesAvail)/2);
     bzero(data_from_mic_mono + (bytesAvail/4), (maxBytesToGet-bytesAvail)/2);
   }
 
@@ -258,6 +258,8 @@ AudioRtpRTX::receiveSessionForSpkr (int16* data_for_speakers_stereo, int16* data
   Manager::instance().getAudioDriver()->putMain(data_for_speakers_stereo, expandedSize*2);
   //}
 	
+  Manager::instance().getAudioDriver()->startStream();
+
 	// Notify (with a beep) an incoming call when there is already a call 
 	countTime += time->getSecond();
 	if (Manager::instance().incomingCallWaiting() > 0) {
diff --git a/src/gui/server/request.cpp b/src/gui/server/request.cpp
index 2775dabc92f24a3d37165a6bf1e1c605bacc54e3..b872dceff4ff2aec352ad53b1272496083a18d83 100644
--- a/src/gui/server/request.cpp
+++ b/src/gui/server/request.cpp
@@ -204,6 +204,7 @@ RequestVersion::execute()
 ResponseMessage
 RequestQuit::execute()
 {
+  GUIServer::instance().hangupAll();
   GUIServer::instance().stopTone();
   GUIServer::instance().quit();
   return message("200", "Quitting");
@@ -212,6 +213,7 @@ RequestQuit::execute()
 ResponseMessage
 RequestStop::execute()
 {
+  GUIServer::instance().hangupAll();
   GUIServer::instance().stopTone();
   GUIServer::instance().stop();
   return message("200", "Stopping server");
diff --git a/src/gui/server/tcpsessionio.cpp b/src/gui/server/tcpsessionio.cpp
index c2de67c0995cc3263849b18b279b4955b1df4f25..eae54d1bbb877018cd9fb76a2ae9d66ee076e3a4 100644
--- a/src/gui/server/tcpsessionio.cpp
+++ b/src/gui/server/tcpsessionio.cpp
@@ -17,6 +17,7 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 #include "tcpsessionio.h"
+#include <cstdio>
 
 const int TCPSessionIO::PORT = 3999;
 const char * const TCPSessionIO::IP = "127.0.0.1";
@@ -37,8 +38,11 @@ TCPSessionIO::TCPSessionIO() : SessionIO()
 
 TCPSessionIO::~TCPSessionIO()
 {
+  fprintf(stderr, "TCPSessionIO: delete clientStream\n");
   delete _clientStream; _clientStream = NULL;
+  fprintf(stderr, "TCPSessionIO: delete serverSocket\n");
   delete _serverSocket; _serverSocket = NULL;
+  fprintf(stderr, "TCPSessionIO: end\n");
 }
 
 bool
diff --git a/src/gui/server/tcpstreampool.cpp b/src/gui/server/tcpstreampool.cpp
index 172443c87e41bdb3ec15bdcb5a95fb75da6e99e9..b3fd59546817d191567d6e0520a64008300fd437 100644
--- a/src/gui/server/tcpstreampool.cpp
+++ b/src/gui/server/tcpstreampool.cpp
@@ -23,9 +23,14 @@
 
 TCPStreamPool::~TCPStreamPool() 
 {
+  _debug("TCPStreamPool terminate\n");
   terminate();
+  _debug("terminate done\n");
+
+
   std::string output;
-  while (good() && _outputPool.pop(output, WAITING_TIME))  {
+  while (_outputPool.pop(output, WAITING_TIME))  {
+    _debug("TCPStreamPool send %s\n", output.c_str());
     //_debug("sending last message...\n");
     *this << output << std::endl;
   }
@@ -40,7 +45,7 @@ TCPStreamPool::run() {
   while(!testCancel() && good()) {
     while (isPending(ost::TCPSocket::pendingInput, WAITING_TIME)) {
       std::getline(*this, input);
-      //_debug("TCPStreamPool getline %s\n", input.c_str());
+      _debug("TCPStreamPool getline %s\n", input.c_str());
       if (input != null && input[0]!=cr13) {
         _inputPool.push(input);
       }
@@ -48,7 +53,7 @@ TCPStreamPool::run() {
       if (testCancel() || !good()) {break;}
     }
     if (good() && _outputPool.pop(output, WAITING_TIME)) {
-      //_debug("TCPStreamPool send %s\n", output.c_str());
+      _debug("TCPStreamPool send %s\n", output.c_str());
       *this << output << std::endl;
     }
   }
diff --git a/src/gui/server/tcpstreampool.h b/src/gui/server/tcpstreampool.h
index 3c7420ee0f8b008988b117fd5b3b701991d0b8c8..75145ff466232d2adeb601b652b54cd808be696d 100644
--- a/src/gui/server/tcpstreampool.h
+++ b/src/gui/server/tcpstreampool.h
@@ -41,7 +41,7 @@ class TCPStreamPool : public ost::TCPSession
 public:
   TCPStreamPool(ost::TCPSocket& server) : ost::TCPSession(server) 
   {
-    setCancel(cancelDeferred);
+    setCancel(cancelImmediate);
   }
   TCPStreamPool::~TCPStreamPool();
 
diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp
index 84f6917c34d24f8998319b2d395b22b36b9b32f6..bebae80cab25f33a6252f942d4657d1f7bc8140e 100644
--- a/src/managerimpl.cpp
+++ b/src/managerimpl.cpp
@@ -881,13 +881,17 @@ ManagerImpl::stopTone() {
   _debug("TONE: stop tone...\n");
   _toneMutex.enterMutex();
   _telephoneTone->setCurrentTone(Tone::TONE_NULL);
+  _toneMutex.leaveMutex();
+  _debug("TONE: tone stopped\n");
+
   // for ringing tone..
+  _toneMutex.enterMutex();
   if ( _toneType != ZT_TONE_NULL ) {
     _toneType = ZT_TONE_NULL;
     _tone->stopTone();
   }
   _toneMutex.leaveMutex();
-  _debug("TONE: tone stopped\n");
+  _debug("TONE: leave stop tone function\n");
 }
 
 /**
@@ -963,19 +967,19 @@ ManagerImpl::getTelephoneTone()
 void
 ManagerImpl::ringtone() 
 {
-  std::string ringchoice = getConfigString(AUDIO, RING_CHOICE);
+  //std::string ringchoice = getConfigString(AUDIO, RING_CHOICE);
   // if there is no / inside the path
-  if ( ringchoice.find(DIR_SEPARATOR_CH) == std::string::npos ) {
+  //if ( ringchoice.find(DIR_SEPARATOR_CH) == std::string::npos ) {
     // check inside global share directory
-    ringchoice = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + ringchoice; 
-  }
-  _toneMutex.enterMutex(); 
-  _toneType = ZT_TONE_FILE;
-  int play = _tone->playRingtone(ringchoice.c_str());
-  _toneMutex.leaveMutex();
-  if (play!=1) {
+  //  ringchoice = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + ringchoice; 
+  //}
+  //_toneMutex.enterMutex(); 
+  //_toneType = ZT_TONE_FILE;
+  //int play = _tone->playRingtone(ringchoice.c_str());
+  //_toneMutex.leaveMutex();
+  //if (play!=1) {
     ringback();
-  }
+  //}
 }
 
 /**