Index: /pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia-audiodev/audiodev.h
===================================================================
--- /pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia-audiodev/audiodev.h	(revision 2491)
+++ /pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia-audiodev/audiodev.h	(revision 2492)
@@ -65,11 +65,4 @@
     PJMEDIA_AUD_INVALID_DEV = -3
 };
-
-
-/** 
- * Type for device unique identifier. The unique device ID can be used to save
- * a reference to a particular device across software reboots.
- */
-typedef pj_uint32_t pjmedia_aud_dev_uid;
 
 
@@ -187,6 +180,11 @@
      * PJ_FALSE.
      */
-    PJMEDIA_AUD_DEV_CAP_PLC = 8192
+    PJMEDIA_AUD_DEV_CAP_PLC = 8192,
     
+    /**
+     * End of capability
+     */
+    PJMEDIA_AUD_DEV_CAP_MAX = 16384
+
 } pjmedia_aud_dev_cap;
 
@@ -370,9 +368,29 @@
     unsigned output_latency_ms;
 
+    /**
+     * Input volume setting, in percent. This setting is optional, and will 
+     * only be used if PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING is set in 
+     * the flags.
+     */
+    unsigned input_vol;
+
+    /**
+     * Output volume setting, in percent. This setting is optional, and will 
+     * only be used if PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING is set in 
+     * the flags.
+     */
+    unsigned output_vol;
+
+    /** 
+     * Set the audio input route. This setting is optional, and will only be
+     * used if PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE is set in the flags.
+     */
+    pjmedia_aud_dev_route input_route;
+
     /** 
      * Set the audio output route. This setting is optional, and will only be
      * used if PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE is set in the flags.
      */
-    pjmedia_aud_dev_route out_route;
+    pjmedia_aud_dev_route output_route;
 
     /**
@@ -411,4 +429,50 @@
 typedef struct pjmedia_aud_dev_factory pjmedia_aud_dev_factory;
 
+/**
+ * Get string info for the specified capability.
+ *
+ * @param cap		The capability ID.
+ * @param p_desc	Optional pointer which will be filled with longer 
+ *			description about the capability.
+ *
+ * @return		Capability name.
+ */
+PJ_DECL(const char*) pjmedia_aud_dev_cap_name(pjmedia_aud_dev_cap cap,
+					      const char **p_desc);
+
+
+/**
+ * Set a capability field value in #pjmedia_aud_param structure. This will
+ * also set the flags field for the specified capability in the structure.
+ *
+ * @param param		The structure.
+ * @param cap		The audio capability which value is to be set.
+ * @param value		Pointer to value. Please see the type of value to
+ *			be supplied in the pjmedia_aud_dev_cap documentation.
+ *
+ * @return		PJ_SUCCESS on successful operation or the appropriate
+ *			error code.
+ */
+PJ_DECL(pj_status_t) pjmedia_aud_param_set_cap(pjmedia_aud_param *param,
+					       pjmedia_aud_dev_cap cap,
+					       const void *pval);
+
+
+/**
+ * Get a capability field value from #pjmedia_aud_param structure. This
+ * function will return PJMEDIA_EAUD_INVCAP error if the flag for that
+ * capability is not set in the flags field in the structure.
+ *
+ * @param param		The structure.
+ * @param cap		The audio capability which value is to be retrieved.
+ * @param value		Pointer to value. Please see the type of value to
+ *			be supplied in the pjmedia_aud_dev_cap documentation.
+ *
+ * @return		PJ_SUCCESS on successful operation or the appropriate
+ *			error code.
+ */
+PJ_DECL(pj_status_t) pjmedia_aud_param_get_cap(const pjmedia_aud_param *param,
+					       pjmedia_aud_dev_cap cap,
+					       void *pval);
 
 /**
@@ -444,17 +508,4 @@
  */
 PJ_DECL(pj_status_t) pjmedia_aud_subsys_shutdown(void);
-
-
-/**
- * Get string info for the specified capability.
- *
- * @param cap		The capability ID.
- * @param p_desc	Optional pointer which will be filled with longer 
- *			description about the capability.
- *
- * @return		Capability name.
- */
-PJ_DECL(const char*) pjmedia_aud_dev_cap_name(pjmedia_aud_dev_cap cap,
-					      const char **p_desc);
 
 
@@ -549,5 +600,7 @@
  * @param cap		The audio capability which value is to be retrieved.
  * @param value		Pointer to value to be filled in by this function 
- *			once it returns successfully.
+ *			once it returns successfully.  Please see the type 
+ *			of value to be supplied in the pjmedia_aud_dev_cap
+ *			documentation.
  *
  * @return		PJ_SUCCESS on successful operation or the appropriate
@@ -563,5 +616,6 @@
  * @param strm		The audio stream.
  * @param cap		The audio capability which value is to be set.
- * @param value		Pointer to value.
+ * @param value		Pointer to value. Please see the type of value to
+ *			be supplied in the pjmedia_aud_dev_cap documentation.
  *
  * @return		PJ_SUCCESS on successful operation or the appropriate
Index: /pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia.h
===================================================================
--- /pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia.h	(revision 2491)
+++ /pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia.h	(revision 2492)
@@ -53,10 +53,5 @@
 #include <pjmedia/session.h>
 #include <pjmedia/silencedet.h>
-/* This sound API is deprecated. Please see:
-http://trac.pjsip.org/repos/wiki/Audio_Dev_API
-*/
-#if PJMEDIA_AUDIO_API != PJMEDIA_AUDIO_API_NEW_ONLY
 #include <pjmedia/sound.h>
-#endif
 #include <pjmedia/sound_port.h>
 #include <pjmedia/splitcomb.h>
Index: /pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia/conference.h
===================================================================
--- /pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia/conference.h	(revision 2491)
+++ /pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia/conference.h	(revision 2492)
@@ -43,4 +43,16 @@
 
 PJ_BEGIN_DECL
+
+/**
+ * The conference bridge signature in pjmedia_port_info.
+ */
+#define PJMEDIA_CONF_BRIDGE_SIGNATURE	\
+		    PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'F')
+
+/**
+ * The audio switchboard signature in pjmedia_port_info.
+ */
+#define PJMEDIA_CONF_SWITCH_SIGNATURE	\
+		    PJMEDIA_PORT_SIGNATURE('A', 'S', 'W', 'I')
 
 
Index: /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/audiodev.c
===================================================================
--- /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/audiodev.c	(revision 2491)
+++ /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/audiodev.c	(revision 2492)
@@ -116,4 +116,121 @@
 } aud_subsys;
 
+/* API: get capability name/info */
+PJ_DEF(const char*) pjmedia_aud_dev_cap_name(pjmedia_aud_dev_cap cap,
+					     const char **p_desc)
+{
+    const char *desc;
+    unsigned i;
+
+    if (p_desc==NULL) p_desc = &desc;
+
+    for (i=0; i<PJ_ARRAY_SIZE(cap_infos); ++i) {
+	if ((1 << i)==cap)
+	    break;
+    }
+
+    if (i==32) {
+	*p_desc = "??";
+	return "??";
+    }
+
+    *p_desc = cap_infos[i].info;
+    return cap_infos[i].name;
+}
+
+static pj_status_t get_cap_pointer(const pjmedia_aud_param *param,
+				   pjmedia_aud_dev_cap cap,
+				   void **ptr,
+				   unsigned *size)
+{
+#define FIELD_INFO(name)    *ptr = (void*)&param->name; \
+			    *size = sizeof(param->name)
+
+    switch (cap) {
+    case PJMEDIA_AUD_DEV_CAP_EXT_FORMAT:
+	FIELD_INFO(ext_fmt);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY:
+	FIELD_INFO(input_latency_ms);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY:
+	FIELD_INFO(output_latency_ms);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING:
+	FIELD_INFO(input_vol);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING:
+	FIELD_INFO(output_vol);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE:
+	FIELD_INFO(input_route);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE:
+	FIELD_INFO(output_route);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_EC:
+	FIELD_INFO(ec_enabled);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_EC_TAIL:
+	FIELD_INFO(ec_tail_ms);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_VAD:
+	FIELD_INFO(ext_fmt.vad);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_CNG:
+	FIELD_INFO(cng_enabled);
+	break;
+    case PJMEDIA_AUD_DEV_CAP_PLC:
+	FIELD_INFO(plc_enabled);
+	break;
+    default:
+	return PJMEDIA_EAUD_INVCAP;
+    }
+
+#undef FIELD_INFO
+
+    return PJ_SUCCESS;
+}
+
+/* API: set cap value to param */
+PJ_DEF(pj_status_t) pjmedia_aud_param_set_cap( pjmedia_aud_param *param,
+					       pjmedia_aud_dev_cap cap,
+					       const void *pval)
+{
+    void *cap_ptr;
+    unsigned cap_size;
+    pj_status_t status;
+
+    status = get_cap_pointer(param, cap, &cap_ptr, &cap_size);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    pj_memcpy(cap_ptr, pval, cap_size);
+    param->flags |= cap;
+
+    return PJ_SUCCESS;
+}
+
+/* API: get cap value from param */
+PJ_DEF(pj_status_t) pjmedia_aud_param_get_cap( const pjmedia_aud_param *param,
+					       pjmedia_aud_dev_cap cap,
+					       void *pval)
+{
+    void *cap_ptr;
+    unsigned cap_size;
+    pj_status_t status;
+
+    status = get_cap_pointer(param, cap, &cap_ptr, &cap_size);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    if ((param->flags & cap) == 0) {
+	pj_bzero(cap_ptr, cap_size);
+	return PJMEDIA_EAUD_INVCAP;
+    }
+
+    pj_memcpy(pval, cap_ptr, cap_size);
+    return PJ_SUCCESS;
+}
 
 /* Internal: init driver */
@@ -292,27 +409,4 @@
     aud_subsys.pf = NULL;
     return PJ_SUCCESS;
-}
-
-/* API: get capability name/info */
-PJ_DEF(const char*) pjmedia_aud_dev_cap_name(pjmedia_aud_dev_cap cap,
-					     const char **p_desc)
-{
-    const char *desc;
-    unsigned i;
-
-    if (p_desc==NULL) p_desc = &desc;
-
-    for (i=0; i<PJ_ARRAY_SIZE(cap_infos); ++i) {
-	if ((1 << i)==cap)
-	    break;
-    }
-
-    if (i==32) {
-	*p_desc = "??";
-	return "??";
-    }
-
-    *p_desc = cap_infos[i].info;
-    return cap_infos[i].name;
 }
 
Index: /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp
===================================================================
--- /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp	(revision 2491)
+++ /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp	(revision 2492)
@@ -1206,7 +1206,7 @@
     param->samples_per_frame = af->dev_info.default_samples_per_sec * 20 / 1000;
     param->bits_per_sample = BITS_PER_SAMPLE;
-    param->flags = af->dev_info.caps;
+    param->flags = PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE;
     param->ext_fmt.id = PJMEDIA_FORMAT_L16;
-    param->out_route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE;
+    param->output_route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE;
 
     return PJ_SUCCESS;
@@ -1301,5 +1301,5 @@
     aps_setting.cng = aps_setting.vad;
     aps_setting.loudspk = 
-		strm->param.out_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER;
+		strm->param.output_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER;
 
     /* Set audio engine callbacks. */
@@ -1376,5 +1376,5 @@
     case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: 
 	if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) {
-	    *(pjmedia_aud_dev_route*)pval = strm->param.out_route;
+	    *(pjmedia_aud_dev_route*)pval = strm->param.output_route;
 	    status = PJ_SUCCESS;
 	}
@@ -1450,5 +1450,5 @@
 	    }
 	    if (status == PJ_SUCCESS)
-		strm->param.out_route = r; 
+		strm->param.output_route = r; 
 	}
 	break;
Index: /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/wmme_dev.c
===================================================================
--- /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/wmme_dev.c	(revision 2491)
+++ /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/wmme_dev.c	(revision 2492)
@@ -48,5 +48,4 @@
 #define THIS_FILE			"wmme_dev.c"
 
-
 /* WMME device info */
 struct wmme_dev_info
@@ -81,5 +80,4 @@
     DWORD         dwBufIdx;
     DWORD         dwMaxBufIdx;
-    unsigned	  latency_ms;
     pj_timestamp  timestamp;
 };
@@ -89,8 +87,6 @@
 struct wmme_stream
 {
-    pjmedia_aud_stream	 base;
-    pjmedia_dir          dir;               /**< Sound direction.      */
-    int                  play_id;           /**< Playback dev id.      */
-    int                  rec_id;            /**< Recording dev id.     */
+    pjmedia_aud_stream	 base;		    /**< Base stream	       */
+    pjmedia_aud_param	 param;		    /**< Settings	       */
     pj_pool_t           *pool;              /**< Memory pool.          */
 
@@ -105,9 +101,5 @@
     pjmedia_format_id	 fmt_id;	    /**< Frame format	       */
     pj_uint8_t		 silence_char;	    /**< Silence pattern       */
-    unsigned             clock_rate;        /**< Clock rate.           */
     unsigned		 bytes_per_frame;   /**< Bytes per frame       */
-    unsigned             samples_per_frame; /**< Samples per frame.    */
-    unsigned             bits_per_sample;   /**< Bits per sample.      */
-    unsigned             channel_count;     /**< Channel count.        */
 
     pjmedia_frame_ext	*xfrm;		    /**< Extended frame buffer */
@@ -438,5 +430,6 @@
     param->samples_per_frame = di->info.default_samples_per_sec * 20 / 1000;
     param->bits_per_sample = 16;
-    param->flags = di->info.caps;
+    param->flags = PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY |
+		   PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY;
     param->input_latency_ms = PJMEDIA_SND_DEFAULT_REC_LATENCY;
     param->output_latency_ms = PJMEDIA_SND_DEFAULT_PLAY_LATENCY;
@@ -498,5 +491,5 @@
 
     if (id == PJMEDIA_FORMAT_L16)
-	return "l16";
+	return "PCM";
     pj_memcpy(name, &id, 4);
     name[4] = '\0';
@@ -686,7 +679,7 @@
     eventCount = 0;
     events[eventCount++] = strm->thread_quit_event;
-    if (strm->dir & PJMEDIA_DIR_PLAYBACK)
+    if (strm->param.dir & PJMEDIA_DIR_PLAYBACK)
 	events[eventCount++] = strm->play_strm.hEvent;
-    if (strm->dir & PJMEDIA_DIR_CAPTURE)
+    if (strm->param.dir & PJMEDIA_DIR_CAPTURE)
 	events[eventCount++] = strm->rec_strm.hEvent;
 
@@ -696,5 +689,5 @@
      */
 #if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0
-    if (strm->dir & PJMEDIA_DIR_PLAYBACK)
+    if (strm->param.dir & PJMEDIA_DIR_PLAYBACK)
 	CeSetThreadPriority(GetCurrentThread(), 153);
     else
@@ -834,6 +827,6 @@
 		if (++wmme_strm->dwBufIdx >= wmme_strm->dwMaxBufIdx)
 		    wmme_strm->dwBufIdx = 0;
-		wmme_strm->timestamp.u64 += strm->samples_per_frame / 
-					    strm->channel_count;
+		wmme_strm->timestamp.u64 += strm->param.samples_per_frame /
+					    strm->param.channel_count;
 	    }
 	}
@@ -914,7 +907,9 @@
 		    strm->xfrm->samples_cnt = 0;
 		    strm->xfrm->subframe_cnt = 0;
-		    pjmedia_frame_ext_append_subframe(strm->xfrm, buffer,
-						      strm->bytes_per_frame *8,
-						      strm->samples_per_frame);
+		    pjmedia_frame_ext_append_subframe(
+			strm->xfrm, buffer,
+			strm->bytes_per_frame *8,
+			strm->param.samples_per_frame
+		    );
 		}
 
@@ -938,6 +933,6 @@
 		if (++wmme_strm->dwBufIdx >= wmme_strm->dwMaxBufIdx)
 		    wmme_strm->dwBufIdx = 0;
-		wmme_strm->timestamp.u64 += strm->samples_per_frame / 
-					    strm->channel_count;
+		wmme_strm->timestamp.u64 += strm->param.samples_per_frame /
+					    strm->param.channel_count;
 	    }
 	}
@@ -982,7 +977,5 @@
 
     strm = PJ_POOL_ZALLOC_T(pool, struct wmme_stream);
-    strm->dir = param->dir;
-    strm->play_id = param->play_id;
-    strm->rec_id = param->rec_id;
+    pj_memcpy(&strm->param, param, sizeof(*param));
     strm->pool = pool;
     strm->rec_cb = rec_cb;
@@ -991,8 +984,4 @@
     strm->fmt_id = param->ext_fmt.id;
     strm->silence_char = silence_char;
-    strm->clock_rate = param->clock_rate;
-    strm->samples_per_frame = param->samples_per_frame;
-    strm->bits_per_sample = param->bits_per_sample;
-    strm->channel_count = param->channel_count;
 
     /* Create player stream */
@@ -1000,10 +989,10 @@
 	unsigned buf_count;
 
-	if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY)
-	    strm->play_strm.latency_ms = param->output_latency_ms;
-	else
-	    strm->play_strm.latency_ms = PJMEDIA_SND_DEFAULT_PLAY_LATENCY;
-
-	buf_count = strm->play_strm.latency_ms * param->clock_rate * 
+	if ((param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY)==0) {
+	    strm->param.flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY;
+	    strm->param.output_latency_ms = PJMEDIA_SND_DEFAULT_PLAY_LATENCY;
+	}
+
+	buf_count = strm->param.output_latency_ms * param->clock_rate * 
 		    param->channel_count / param->samples_per_frame / 1000;
 
@@ -1024,10 +1013,10 @@
 	unsigned buf_count;
 
-	if (param->flags & PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY)
-	    strm->rec_strm.latency_ms = param->input_latency_ms;
-	else
-	    strm->rec_strm.latency_ms = PJMEDIA_SND_DEFAULT_REC_LATENCY;
-
-	buf_count = strm->rec_strm.latency_ms * param->clock_rate * 
+	if ((param->flags & PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY)==0) {
+	    strm->param.flags |= PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY;
+	    strm->param.input_latency_ms = PJMEDIA_SND_DEFAULT_REC_LATENCY;
+	}
+
+	buf_count = strm->param.input_latency_ms * param->clock_rate * 
 		    param->channel_count / param->samples_per_frame / 1000;
 
@@ -1075,4 +1064,11 @@
     }
 
+    /* Apply the remaining settings */
+    if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING) {
+	stream_set_cap(&strm->base, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING,
+		       &param->output_vol);
+    }
+
+
     /* Done */
     strm->base.op = &stream_op;
@@ -1090,24 +1086,6 @@
     PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL);
 
-    pj_bzero(pi, sizeof(*pi));
-    pi->dir = strm->dir;
-    pi->play_id = strm->play_id;
-    pi->rec_id = strm->rec_id;
-    pi->clock_rate = strm->clock_rate;
-    pi->channel_count = strm->channel_count;
-    pi->samples_per_frame = strm->samples_per_frame;
-    pi->bits_per_sample = strm->bits_per_sample;
+    pj_memcpy(pi, &strm->param, sizeof(*pi));
     
-    if (pi->dir & PJMEDIA_DIR_CAPTURE) {
-	pi->flags |= PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY;
-	pi->input_latency_ms = strm->rec_strm.latency_ms;
-    }
-
-    if (pi->dir & PJMEDIA_DIR_PLAYBACK) {
-	/* TODO: report the actual latency? */
-	pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY;
-	pi->output_latency_ms = strm->play_strm.latency_ms;
-    }
-
     return PJ_SUCCESS;
 }
@@ -1123,14 +1101,14 @@
 
     if (cap==PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY && 
-	(strm->dir & PJMEDIA_DIR_CAPTURE)) 
+	(strm->param.dir & PJMEDIA_DIR_CAPTURE)) 
     {
 	/* Recording latency */
-	*(unsigned*)pval = strm->rec_strm.latency_ms;
+	*(unsigned*)pval = strm->param.input_latency_ms;
 	return PJ_SUCCESS;
     } else if (cap==PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY  && 
-	       (strm->dir & PJMEDIA_DIR_PLAYBACK))
+	       (strm->param.dir & PJMEDIA_DIR_PLAYBACK))
     {
 	/* Playback latency */
-	*(unsigned*)pval = strm->play_strm.latency_ms;
+	*(unsigned*)pval = strm->param.output_latency_ms;
 	return PJ_SUCCESS;
     } else if (cap==PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING &&
@@ -1138,14 +1116,14 @@
     {
 	/* Output volume setting */
-	DWORD dwVol;
+	DWORD waveVol;
 	MMRESULT mr;
 
-	mr = waveOutGetVolume(strm->play_strm.hWave.Out, &dwVol);
+	mr = waveOutGetVolume(strm->play_strm.hWave.Out, &waveVol);
 	if (mr != MMSYSERR_NOERROR) {
 	    return PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_OUT(mr);
 	}
 
-	dwVol &= 0xFFFF;
-	*(unsigned*)pval = (dwVol * 100) / 0xFFFF;
+	waveVol &= 0xFFFF;
+	*(unsigned*)pval = (waveVol * 100) / 0xFFFF;
 	return PJ_SUCCESS;
     } else {
@@ -1167,13 +1145,22 @@
     {
 	/* Output volume setting */
-	DWORD dwVol;
+	unsigned vol = *(unsigned*)pval;
+	DWORD waveVol;
 	MMRESULT mr;
-
-	dwVol = ((*(unsigned*)pval) * 0xFFFF) / 100;
-	dwVol |= (dwVol << 16);
-
-	mr = waveOutSetVolume(strm->play_strm.hWave.Out, dwVol);
-	return (mr==MMSYSERR_NOERROR)? PJ_SUCCESS : 
+	pj_status_t status;
+
+	if (vol > 100)
+	    vol = 100;
+
+	waveVol = (vol * 0xFFFF) / 100;
+	waveVol |= (waveVol << 16);
+
+	mr = waveOutSetVolume(strm->play_strm.hWave.Out, waveVol);
+	status = (mr==MMSYSERR_NOERROR)? PJ_SUCCESS : 
 				PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_OUT(mr);
+	if (status == PJ_SUCCESS) {
+	    strm->param.output_vol = *(unsigned*)pval;
+	}
+	return status;
     }
 
Index: /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/conf_switch.c
===================================================================
--- /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/conf_switch.c	(revision 2491)
+++ /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/conf_switch.c	(revision 2492)
@@ -46,5 +46,5 @@
 #define THIS_FILE	    "conf_switch.c"
 
-#define SIGNATURE	    PJMEDIA_PORT_SIGNATURE('S', 'W', 'T', 'C')
+#define SIGNATURE	    PJMEDIA_CONF_SWITCH_SIGNATURE
 #define SIGNATURE_PORT	    PJMEDIA_PORT_SIGNATURE('S', 'W', 'T', 'P')
 #define NORMAL_LEVEL	    128
Index: /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/conference.c
===================================================================
--- /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/conference.c	(revision 2491)
+++ /pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/conference.c	(revision 2492)
@@ -65,5 +65,5 @@
 #define BYTES_PER_SAMPLE    2
 
-#define SIGNATURE	    PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'F')
+#define SIGNATURE	    PJMEDIA_CONF_BRIDGE_SIGNATURE
 #define SIGNATURE_PORT	    PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'P')
 /* Normal level is hardcodec to 128 in all over places */
