Index: /pjproject/trunk/pjmedia/include/pjmedia/conference.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/conference.h	(revision 654)
+++ /pjproject/trunk/pjmedia/include/pjmedia/conference.h	(revision 655)
@@ -294,4 +294,14 @@
 
 /**
+ * Get total number of ports connections currently set up in the bridge.
+ * 
+ * @param conf		The conference bridge.
+ *
+ * @return		PJ_SUCCESS on success.
+ */
+PJ_DECL(unsigned) pjmedia_conf_get_connect_count(pjmedia_conf *conf);
+
+
+/**
  * Remove the specified port from the conference bridge.
  *
Index: /pjproject/trunk/pjmedia/include/pjmedia/silencedet.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/silencedet.h	(revision 654)
+++ /pjproject/trunk/pjmedia/include/pjmedia/silencedet.h	(revision 655)
@@ -71,4 +71,17 @@
 						 unsigned samples_per_frame,
 						 pjmedia_silence_det **p_sd );
+
+
+/**
+ * Set silence detector name to identify the particular silence detector
+ * instance in the log.
+ *
+ * @param sd		    The silence detector.
+ * @param name		    Name.
+ *
+ * @return		    PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_silence_det_set_name(pjmedia_silence_det *sd,
+						  const char *name);
 
 
@@ -110,5 +123,5 @@
  *			    signal is reported. If -1 is specified, then
  *			    the default value will be used. The default is
- *			    one frame.
+ *			    equal to one frame.
  * @param recalc_time	    The interval to recalculate signal and silence
  *			    proportion and to readjust the silence threshold
@@ -145,5 +158,5 @@
  *			of the input samples.
  *
- * @return		PJ_SUCCESS on success.
+ * @return		Non zero if signal is silence.
  */
 PJ_DECL(pj_bool_t) pjmedia_silence_det_detect( pjmedia_silence_det *sd,
@@ -174,5 +187,5 @@
  * @param level		Signal level.
  *
- * @return		PJ_SUCCESS on success.
+ * @return		Non zero if signal is silence.
  */
 PJ_DECL(pj_bool_t) pjmedia_silence_det_apply( pjmedia_silence_det *sd,
Index: /pjproject/trunk/pjmedia/src/pjmedia/conference.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 654)
+++ /pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 655)
@@ -222,5 +222,5 @@
 
     /* Set name */
-    pj_strdup(pool, &conf_port->name, name);
+    pj_strdup_with_null(pool, &conf_port->name, name);
 
     /* Default has tx and rx enabled. */
@@ -259,4 +259,6 @@
     pjmedia_silence_det_set_fixed(conf_port->vad, 2);
 
+    /* Set VAD name */
+    pjmedia_silence_det_set_name(conf_port->vad, conf_port->name.ptr);
 
     /* If port's clock rate is different than conference's clock rate,
@@ -895,4 +897,13 @@
 
     return PJ_SUCCESS;
+}
+
+
+/*
+ * Get total number of ports connections currently set up in the bridge.
+ */
+PJ_DECL(unsigned) pjmedia_conf_get_connect_count(pjmedia_conf *conf)
+{
+    return conf->connect_cnt;
 }
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/echo_common.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 654)
+++ /pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 655)
@@ -119,5 +119,5 @@
 
 #else
-static struct ec_operations aec_op = echo_supp_op;
+#define aec_op echo_supp_op
 #endif
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/echo_suppress.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/echo_suppress.c	(revision 654)
+++ /pjproject/trunk/pjmedia/src/pjmedia/echo_suppress.c	(revision 655)
@@ -28,5 +28,5 @@
 
 #define THIS_FILE			    "echo_suppress.c"
-#define PJMEDIA_ECHO_SUPPRESS_THRESHOLD	    20
+#define PJMEDIA_ECHO_SUPPRESS_THRESHOLD	    PJMEDIA_SILENCE_DET_THRESHOLD
 
 
@@ -36,9 +36,9 @@
 typedef struct echo_supp
 {
-    unsigned	threshold;
-    pj_bool_t	suppressing;
-    pj_time_val	last_signal;
-    unsigned	samples_per_frame;
-    unsigned	tail_ms;
+    pj_bool_t		 suppressing;
+    pjmedia_silence_det	*sd;
+    pj_time_val		 last_signal;
+    unsigned		 samples_per_frame;
+    unsigned		 tail_ms;
 } echo_supp;
 
@@ -79,4 +79,5 @@
 {
     echo_supp *ec;
+    pj_status_t status;
 
     PJ_UNUSED_ARG(clock_rate);
@@ -84,7 +85,15 @@
 
     ec = pj_pool_zalloc(pool, sizeof(struct echo_supp));
-    ec->threshold = PJMEDIA_ECHO_SUPPRESS_THRESHOLD;
     ec->samples_per_frame = samples_per_frame;
     ec->tail_ms = tail_ms;
+
+    status = pjmedia_silence_det_create(pool, clock_rate, samples_per_frame,
+					&ec->sd);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    pjmedia_silence_det_set_name(ec->sd, "ecsu%p");
+    pjmedia_silence_det_set_adaptive(ec->sd, PJMEDIA_ECHO_SUPPRESS_THRESHOLD);
+    pjmedia_silence_det_set_params(ec->sd, 0, 500, 3000);
 
     *p_state = ec;
@@ -110,15 +119,14 @@
 {
     echo_supp *ec = state;
+    pj_bool_t silence;
     pj_bool_t last_suppressing = ec->suppressing;
-    unsigned level;
 
-    level = pjmedia_calc_avg_signal(play_frm, ec->samples_per_frame);
-    level = linear2ulaw(level) ^ 0xff;
+    silence = pjmedia_silence_det_detect(ec->sd, play_frm,
+					 ec->samples_per_frame, NULL);
 
-    if (level >= ec->threshold) {
+    ec->suppressing = !silence;
+
+    if (ec->suppressing) {
 	pj_gettimeofday(&ec->last_signal);
-	ec->suppressing = 1;
-    } else {
-	ec->suppressing = 0;
     }
 
@@ -169,13 +177,13 @@
 {
     echo_supp *ec = state;
-    unsigned level;
+    pj_bool_t silence;
 
     PJ_UNUSED_ARG(options);
     PJ_UNUSED_ARG(reserved);
 
-    level = pjmedia_calc_avg_signal(play_frm, ec->samples_per_frame);
-    level = linear2ulaw(level) ^ 0xff;
+    silence = pjmedia_silence_det_detect(ec->sd, play_frm, 
+					 ec->samples_per_frame, NULL);
 
-    if (level >= ec->threshold) {
+    if (!silence) {
 	pjmedia_zero_samples(rec_frm, ec->samples_per_frame);
     }
Index: /pjproject/trunk/pjmedia/src/pjmedia/silencedet.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/silencedet.c	(revision 654)
+++ /pjproject/trunk/pjmedia/src/pjmedia/silencedet.c	(revision 655)
@@ -39,4 +39,6 @@
 struct pjmedia_silence_det
 {
+    char      objname[PJ_MAX_OBJ_NAME]; /**< VAD name.			    */
+
     int	      mode;		/**< VAD mode.				    */
     unsigned  ptime;		/**< Frame time, in msec.		    */
@@ -71,4 +73,7 @@
     sd = pj_pool_zalloc(pool, sizeof(struct pjmedia_silence_det));
 
+    pj_ansi_strncpy(sd->objname, THIS_FILE, PJ_MAX_OBJ_NAME);
+    sd->objname[PJ_MAX_OBJ_NAME-1] = '\0';
+
     sd->ptime = samples_per_frame * 1000 / clock_rate;
     sd->signal_cnt = 0;
@@ -87,4 +92,16 @@
     return PJ_SUCCESS;
 }
+
+
+PJ_DEF(pj_status_t) pjmedia_silence_det_set_name( pjmedia_silence_det *sd,
+						  const char *name)
+{
+    PJ_ASSERT_RETURN(sd && name, PJ_EINVAL);
+
+    pj_ansi_snprintf(sd->objname, PJ_MAX_OBJ_NAME, name, sd);
+    sd->objname[PJ_MAX_OBJ_NAME-1] = '\0';
+    return PJ_SUCCESS;
+}
+
 
 PJ_DEF(pj_status_t) pjmedia_silence_det_set_adaptive(pjmedia_silence_det *sd,
@@ -234,5 +251,5 @@
 	if (sd->mode == VAD_MODE_ADAPTIVE) {
 	    pj_bool_t updated = PJ_TRUE;
-	    unsigned pct_signal;
+	    unsigned pct_signal, new_threshold = sd->cur_threshold;
 
 	    /* Get percentage of signal */
@@ -242,17 +259,18 @@
 	    /* Adjust according to signal/silence proportions. */
 	    if (pct_signal > 95) {
-		sd->cur_threshold += (sd->weakest_signal - sd->cur_threshold)/4;
+		new_threshold += (sd->weakest_signal - sd->cur_threshold)/4;
 	    } else if (pct_signal < 5) {
-		sd->cur_threshold = (sd->cur_threshold+sd->loudest_silence)/2+1;
+		new_threshold = (sd->cur_threshold+sd->loudest_silence)/2+1;
 	    } else if (pct_signal > 90) {
-		sd->cur_threshold++;
+		new_threshold++;
 	    } else if (pct_signal < 10) {
-		sd->cur_threshold--;
+		new_threshold--;
 	    } else {
 		updated = PJ_FALSE;
 	    }
 
-	    if (updated) {
-		PJ_LOG(5,(THIS_FILE, "Vad cur_threshold updated to %d",
+	    if (updated && sd->cur_threshold != new_threshold) {
+		sd->cur_threshold = new_threshold;
+		PJ_LOG(5,(sd->objname, "Vad cur_threshold updated to %d",
 			  sd->cur_threshold));
 	    }
