From 554a372ac5f37e53b95ee3ac7f315bfb7b8e044d Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandre.savard@savoirfairelinux.net>
Date: Thu, 24 Sep 2009 10:36:02 -0400
Subject: [PATCH] [#2176] Add some usefull comments and debugging info

---
 sflphone-common/src/managerimpl.cpp     | 21 +++++++++++----------
 sflphone-common/src/sip/sipvoiplink.cpp |  2 +-
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp
index 9f6e24540f..46163a25d5 100644
--- a/sflphone-common/src/managerimpl.cpp
+++ b/sflphone-common/src/managerimpl.cpp
@@ -792,20 +792,24 @@ ManagerImpl::removeConference(const ConfID& conference_id)
 
     Conference* conf = NULL;
 
-    _debug("ManagerImpl::removeConference _conferencemap.size: %i\n", _conferencemap.size());
+    _debug("    removeConference: _conferencemap.size: %i\n", _conferencemap.size());
     ConferenceMap::iterator iter = _conferencemap.find(conference_id);
 
     if (iter != _conferencemap.end()) {
-	_debug("Found conference id %s in conferencemap\n", conference_id.c_str());
+	_debug("    removeConference: Found conference id %s in conferencemap\n", conference_id.c_str());
         conf = iter->second;
     }
 
-    if(conf == NULL)
+    if(conf == NULL) {
+
+	_debug("    removeConference: Error conference not found\n");
 	return;
+    }
 
 
-    
-    // unbind main participant from conference
+    // We now need to bind the audio to the remain participant
+
+    // unbind main participant from conference (just to be sure)
     _audiodriver->getMainBuffer()->unBindAll(default_id);
 
     ParticipantSet participants = conf->getParticipantList();
@@ -819,9 +823,7 @@ ManagerImpl::removeConference(const ConfID& conference_id)
 	_audiodriver->getMainBuffer()->bindCallID(*iter_p, default_id);
     }
     
-
-    
-
+    // Then remove the conference from the conference map
     _debug("ManagerImpl:: remove conference %s\n", conference_id.c_str());
     if (_conferencemap.erase(conference_id) == 1)
         _debug("ManagerImpl:: conference %s removed succesfully\n", conference_id.c_str());
@@ -1491,7 +1493,6 @@ ManagerImpl::sendDtmf (const CallID& id, char code)
     AccountID accountid = getAccountFromCall (id);
 
     if (accountid == AccountNULL) {
-        _debug("Send DTMF: call doesn't exists\n");
         playDtmf (code, false);
         return false;
     }
@@ -1583,7 +1584,7 @@ ManagerImpl::playDtmf (char code, bool isTalking)
         audiolayer->putUrgent (buf, size * sizeof (SFLDataFormat));
     }
     else {
-	_debug("    playDtmf: Error cannot play dtmf");
+	_debug("    playDtmf: Error cannot play dtmf\n");
     }
 
     ret = true;
diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp
index 0c9a132c1e..be814b18af 100644
--- a/sflphone-common/src/sip/sipvoiplink.cpp
+++ b/sflphone-common/src/sip/sipvoiplink.cpp
@@ -3585,8 +3585,8 @@ bool setCallAudioLocal (SIPCall* call, std::string localIP)
         	//}
     	}
 
+	_debug ("            Setting local ip address: %s\n", localIP.c_str());
     	_debug ("            Setting local audio port to: %d\n", callLocalAudioPort);
-
     	_debug ("            Setting local audio port (external) to: %d\n", callLocalExternAudioPort);
 
     	// Set local audio port for SIPCall(id)
-- 
GitLab