From 04e796acfec6ae996ccc90ea92e3f912997c328f Mon Sep 17 00:00:00 2001
From: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
Date: Wed, 5 Sep 2007 15:32:18 -0400
Subject: [PATCH] Cosmetics, documentation.

---
 src/audio/audiortp.h |  3 ++-
 src/call.h           | 23 ++++++++++++++++++++---
 src/sipvoiplink.cpp  | 10 +++++-----
 3 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/src/audio/audiortp.h b/src/audio/audiortp.h
index 720e5a9e9a..bc5d4b0728 100644
--- a/src/audio/audiortp.h
+++ b/src/audio/audiortp.h
@@ -31,7 +31,8 @@
 #include <samplerate.h>
 
 #include "../global.h"
-/** maximum of byte inside an incoming packet 
+
+/** maximum bytes inside an incoming packet 
  *  8000 sampling/s * 20s/1000 = 160
  */
 #define RTP_20S_8KHZ_MAX 160
diff --git a/src/call.h b/src/call.h
index c12e1bac85..7f64b56c17 100644
--- a/src/call.h
+++ b/src/call.h
@@ -33,9 +33,26 @@ typedef std::string CallID;
  */
 class Call{
 public:
-    enum CallType {Incoming, Outgoing};
-    enum ConnectionState {Disconnected, Trying, Progressing, Ringing, Connected };
-    enum CallState {Inactive, Active, Hold, Busy, Refused, Error};
+  /**
+   * This determines if the call originated from the local user (Outgoing)
+   * or from some remote peer (Incoming).
+   */
+  enum CallType {Incoming, Outgoing};
+  
+  /**
+   * Tell where we're at with the call. The call gets Connected when we know
+   * from the other end what happened with out call. A call can be 'Connected'
+   * even if the call state is Busy, Refused, or Error.
+   *
+   * Audio should be transmitted when ConnectionState = Connected AND
+   * CallState = Active.
+   */
+  enum ConnectionState {Disconnected, Trying, Progressing, Ringing, Connected};
+
+  /**
+   * The Call State.
+   */
+  enum CallState {Inactive, Active, Hold, Busy, Refused, Error};
 
     /**
      * Constructor of a call
diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp
index d6d9106935..2d604cf8cf 100644
--- a/src/sipvoiplink.cpp
+++ b/src/sipvoiplink.cpp
@@ -1436,7 +1436,7 @@ SIPVoIPLink::findSIPCallWithCid(int cid)
 {
   if (cid < 1) {
     _debug("! SIP Error: Not enough information for this event\n");
-    return 0;
+    return NULL;
   }
   ost::MutexLock m(_callMapMutex);
   SIPCall* call = 0;
@@ -1448,7 +1448,7 @@ SIPVoIPLink::findSIPCallWithCid(int cid)
     }
     iter++;
   }
-  return 0;
+  return NULL;
 }
 
 SIPCall* 
@@ -1456,7 +1456,7 @@ SIPVoIPLink::findSIPCallWithCidDid(int cid, int did)
 {
   if (cid < 1 && did < -1) {
     _debug("! SIP Error: Not enough information for this event\n");
-    return 0;
+    return NULL;
   }
   ost::MutexLock m(_callMapMutex);
   SIPCall* call = 0;
@@ -1468,7 +1468,7 @@ SIPVoIPLink::findSIPCallWithCidDid(int cid, int did)
     }
     iter++;
   }
-  return 0;
+  return NULL;
 }
 
 SIPCall*
@@ -1478,7 +1478,7 @@ SIPVoIPLink::getSIPCall(const CallID& id)
   if (call) {
     return dynamic_cast<SIPCall*>(call);
   }
-  return 0;
+  return NULL;
 }
 
 /**
-- 
GitLab