Index: /pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 781)
+++ /pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 782)
@@ -537,5 +537,5 @@
 			    or.clock_rate == ar.clock_rate &&
 			    (pj_stricmp(&or.param, &ar.param)==0 ||
-			     ar.param.slen==1 && *ar.param.ptr=='1'))
+			     (ar.param.slen==1 && *ar.param.ptr=='1')))
 			{
 			    /* Match! */
@@ -731,5 +731,5 @@
 			    or.clock_rate == lr.clock_rate &&
 			    (pj_strcmp(&or.param, &lr.param)==0 ||
-			     or.param.slen==1 && *or.param.ptr=='1')) 
+			     (or.param.slen==1 && *or.param.ptr=='1'))) 
 			{
 			    /* Match! */
Index: /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 781)
+++ /pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 782)
@@ -64,4 +64,8 @@
     pj_bool_t		    auto_loop;
     pj_bool_t		    auto_conf;
+    pj_str_t		    rec_file;
+    pj_bool_t		    auto_rec;
+    pjsua_recorder_id	    rec_id;
+    pjsua_conf_port_id	    rec_port;
     unsigned		    ptime;
     unsigned		    auto_answer;
@@ -139,8 +143,10 @@
     puts  ("  --clock-rate=N      Override sound device clock rate");
     puts  ("  --null-audio        Use NULL audio device");
-    puts  ("  --play-file=file    Play WAV file in conference bridge");
+    puts  ("  --play-file=file    Register WAV file in conference bridge");
     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  ("  --rec-file=file     Open file recorder (extension can be .wav or .mp3");
+    puts  ("  --auto-rec          Automatically record conversation");
     puts  ("  --rtp-port=N        Base port to try for RTP (default=4000)");
     puts  ("  --quality=N         Specify media quality (0-10, default=6)");
@@ -189,5 +195,7 @@
     cfg->duration = NO_LIMIT;
     cfg->wav_id = PJSUA_INVALID_ID;
+    cfg->rec_id = PJSUA_INVALID_ID;
     cfg->wav_port = PJSUA_INVALID_ID;
+    cfg->rec_port = PJSUA_INVALID_ID;
 }
 
@@ -286,4 +294,5 @@
 	   OPT_AUTO_CONF, OPT_CLOCK_RATE,
 	   OPT_PLAY_FILE, OPT_RTP_PORT, OPT_ADD_CODEC, OPT_ILBC_MODE,
+	   OPT_REC_FILE, OPT_AUTO_REC,
 	   OPT_COMPLEXITY, OPT_QUALITY, OPT_PTIME, OPT_NO_VAD,
 	   OPT_RX_DROP_PCT, OPT_TX_DROP_PCT, OPT_EC_TAIL,
@@ -325,7 +334,9 @@
 	{ "auto-hangup",1, 0, OPT_AUTO_HANGUP},
 	{ "auto-play",  0, 0, OPT_AUTO_PLAY},
+	{ "auto-rec",   0, 0, OPT_AUTO_REC},
 	{ "auto-loop",  0, 0, OPT_AUTO_LOOP},
 	{ "auto-conf",  0, 0, OPT_AUTO_CONF},
 	{ "play-file",  1, 0, OPT_PLAY_FILE},
+	{ "rec-file",   1, 0, OPT_REC_FILE},
 	{ "rtp-port",	1, 0, OPT_RTP_PORT},
 	{ "add-codec",  1, 0, OPT_ADD_CODEC},
@@ -626,4 +637,8 @@
 	    break;
 
+	case OPT_AUTO_REC:
+	    cfg->auto_rec = 1;
+	    break;
+
 	case OPT_AUTO_LOOP:
 	    cfg->auto_loop = 1;
@@ -636,4 +651,8 @@
 	case OPT_PLAY_FILE:
 	    cfg->wav_file = pj_str(pj_optarg);
+	    break;
+
+	case OPT_REC_FILE:
+	    cfg->rec_file = pj_str(pj_optarg);
 	    break;
 
@@ -1001,4 +1020,13 @@
 	pj_strcat2(&cfg, line);
     }
+    if (config->rec_file.slen) {
+	pj_ansi_sprintf(line, "--rec-file %s\n",
+			config->rec_file.ptr);
+	pj_strcat2(&cfg, line);
+    }
+    if (config->auto_rec)
+	pj_strcat2(&cfg, "--auto-rec\n");
+
+
     /* Media clock rate. */
     if (config->media_cfg.clock_rate != PJSUA_DEFAULT_CLOCK_RATE) {
@@ -1375,4 +1403,9 @@
 	    pjsua_conf_connect(call_info.conf_slot, call_info.conf_slot);
 	    connect_sound = PJ_FALSE;
+
+	    /* Automatically record conversation, if desired */
+	    if (app_config.auto_rec && app_config.rec_port != PJSUA_INVALID_ID) {
+		pjsua_conf_connect(call_info.conf_slot, app_config.rec_port);
+	    }
 	}
 
@@ -1405,4 +1438,11 @@
 		pjsua_conf_connect(pjsua_call_get_conf_port(call_ids[i]),
 				   call_info.conf_slot);
+
+		/* Automatically record conversation, if desired */
+		if (app_config.auto_rec && app_config.rec_port != PJSUA_INVALID_ID) {
+		    pjsua_conf_connect(pjsua_call_get_conf_port(call_ids[i]), 
+				       app_config.rec_port);
+		}
+
 	    }
 
@@ -1415,4 +1455,10 @@
 	    pjsua_conf_connect(call_info.conf_slot, 0);
 	    pjsua_conf_connect(0, call_info.conf_slot);
+
+	    /* Automatically record conversation, if desired */
+	    if (app_config.auto_rec && app_config.rec_port != PJSUA_INVALID_ID) {
+		pjsua_conf_connect(call_info.conf_slot, app_config.rec_port);
+		pjsua_conf_connect(0, app_config.rec_port);
+	    }
 	}
 
@@ -2535,4 +2581,13 @@
     }
 
+    /* Optionally create recorder file, if any. */
+    if (app_config.rec_file.slen) {
+	status = pjsua_recorder_create(&app_config.rec_file, 0, NULL, 0, 0,
+				       &app_config.rec_id);
+	if (status != PJ_SUCCESS)
+	    goto on_error;
+
+	app_config.rec_port = pjsua_recorder_get_conf_port(app_config.rec_id);
+    }
 
     /* Add TCP transport unless it's disabled */
Index: /pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_resolve.c	(revision 781)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_resolve.c	(revision 782)
@@ -125,5 +125,5 @@
     pj_assert(!"Resolver is disabled (PJSIP_HAS_RESOLVER==0)");
     return PJ_EINVALIDOP;
-#endif;
+#endif
 }
 
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 781)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 782)
@@ -74,15 +74,4 @@
 static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event);
 static void xfer_server_on_evsub_state( pjsip_evsub *sub, pjsip_event *event);
-
-/*
- * Callback called by event framework when NOTIFY is received for outgoing
- * REFER subscription.
- */
-static void xfer_on_rx_notify(pjsip_evsub *sub, 
-			      pjsip_rx_data *rdata,
-			      int *p_st_code,
-			      pj_str_t **p_st_text,
-			      pjsip_hdr *res_hdr,
-			      pjsip_msg_body **p_body);
 
 /*
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 781)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 782)
@@ -1228,4 +1228,6 @@
 	case PJSIP_TRANSPORT_TCP:
 	    break;
+	default:
+	    break;
 	}
 	
@@ -1237,4 +1239,6 @@
 	    return (*pjsua_var.tpdata[id].data.factory->destroy)
 			(pjsua_var.tpdata[id].data.factory);
+	default:
+	    break;
 	}
     }
