Index: /pjproject/trunk/pjlib/src/pj/config.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/config.c	(revision 658)
+++ /pjproject/trunk/pjlib/src/pj/config.c	(revision 659)
@@ -22,5 +22,5 @@
 
 static const char *id = "config.c";
-const char *PJ_VERSION = "0.5.7";
+const char *PJ_VERSION = "0.5.7.1";
 
 PJ_DEF(void) pj_dump_config(void)
Index: /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 658)
+++ /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 659)
@@ -53,4 +53,5 @@
     pj_bool_t		    auto_play;
     pj_bool_t		    auto_loop;
+    pj_bool_t		    auto_conf;
     unsigned		    ptime;
     unsigned		    auto_answer;
@@ -123,4 +124,5 @@
     puts  ("  --auto-play         Automatically play the file (to incoming calls only)");
     puts  ("  --auto-loop         Automatically loop incoming RTP to outgoing RTP");
+    puts  ("  --auto-conf         Automatically put calls in conference with others");
     puts  ("  --rtp-port=N        Base port to try for RTP (default=4000)");
     puts  ("  --quality=N         Specify media quality (0-10, default=6)");
@@ -581,4 +583,8 @@
 	    break;
 
+	case OPT_AUTO_CONF:
+	    cfg->auto_conf = 1;
+	    break;
+
 	case OPT_PLAY_FILE:
 	    cfg->wav_file = pj_str(pj_optarg);
@@ -923,4 +929,6 @@
     if (config->auto_loop)
 	pj_strcat2(&cfg, "--auto-loop\n");
+    if (config->auto_conf)
+	pj_strcat2(&cfg, "--auto-conf\n");
     if (config->wav_file.slen) {
 	pj_ansi_sprintf(line, "--play-file %s\n",
@@ -1247,4 +1255,31 @@
 	    pjsua_conf_connect(app_config.wav_port, call_info.conf_slot);
 	    connect_sound = PJ_FALSE;
+	}
+
+	/* Put call in conference with other calls, if desired */
+	if (app_config.auto_conf) {
+	    pjsua_call_id call_ids[PJSUA_MAX_CALLS];
+	    unsigned call_cnt=0;
+	    unsigned i;
+
+	    /* Get all calls, and establish media connection between
+	     * this call and other calls.
+	     */
+	    pjsua_enum_calls(call_ids, &call_cnt);
+	    for (i=0; i<call_cnt; ++i) {
+		if (call_ids[i] == call_id)
+		    continue;
+		
+		if (!pjsua_call_has_media(call_ids[i]))
+		    continue;
+
+		pjsua_conf_connect(call_info.conf_slot,
+				   pjsua_call_get_conf_port(call_ids[i]));
+		pjsua_conf_connect(pjsua_call_get_conf_port(call_ids[i]),
+				   call_info.conf_slot);
+	    }
+
+	    /* Also connect call to local sound device */
+	    connect_sound = PJ_TRUE;
 	}
 
Index: /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 658)
+++ /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 659)
@@ -2086,6 +2086,6 @@
     /**
      * Media quality, 0-10, according to this table:
-     *   8-10: resampling use large filter,
-     *   3-7:  resampling use small filter,
+     *   5-10: resampling use large filter,
+     *   3-4:  resampling use small filter,
      *   1-2:  resampling use linear.
      * The media quality also sets speex codec quality/complexity to the
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 658)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 659)
@@ -76,5 +76,5 @@
     /* Register speex. */
     status = pjmedia_codec_speex_init(pjsua_var.med_endpt, 
-				      PJMEDIA_SPEEX_NO_UWB,
+				      0,
 				      pjsua_var.media_cfg.quality, 
 				      pjsua_var.media_cfg.quality);
@@ -84,4 +84,19 @@
 	return status;
     }
+
+    /* Set speex/16000 to higher priority*/
+    codec_id = pj_str("speex/16000");
+    pjmedia_codec_mgr_set_codec_priority( 
+	pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt),
+	&codec_id, PJMEDIA_CODEC_PRIO_NORMAL+2);
+
+    /* Set speex/8000 to next higher priority*/
+    codec_id = pj_str("speex/8000");
+    pjmedia_codec_mgr_set_codec_priority( 
+	pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt),
+	&codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1);
+
+
+
 #endif /* PJMEDIA_HAS_SPEEX_CODEC */
 
@@ -146,5 +161,5 @@
     opt = PJMEDIA_CONF_NO_DEVICE;
     if (pjsua_var.media_cfg.quality >= 3 &&
-	pjsua_var.media_cfg.quality <= 7)
+	pjsua_var.media_cfg.quality <= 4)
     {
 	opt |= PJMEDIA_CONF_SMALL_FILTER;
