Index: pjproject/branches/1.x/pjlib-util/build/Makefile
===================================================================
--- pjproject/branches/1.x/pjlib-util/build/Makefile	(revision 4386)
+++ pjproject/branches/1.x/pjlib-util/build/Makefile	(revision 4387)
@@ -75,5 +75,5 @@
 	$(MAKE) -f $(RULES_MAK) APP=PJLIB_UTIL app=pjlib-util $(PJLIB_UTIL_LIB)
 
-pjlib-util-test:
+pjlib-util-test: pjlib-util
 	$(MAKE) -f $(RULES_MAK) APP=UTIL_TEST app=pjlib-util-test $(UTIL_TEST_EXE)
 
Index: pjproject/branches/1.x/pjlib/build/Makefile
===================================================================
--- pjproject/branches/1.x/pjlib/build/Makefile	(revision 4386)
+++ pjproject/branches/1.x/pjlib/build/Makefile	(revision 4387)
@@ -88,5 +88,5 @@
 	touch ../include/pj/config_site.h
 	
-pjlib-test: 
+pjlib-test: pjlib
 	$(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test $(TEST_EXE)
 
Index: pjproject/branches/1.x/pjlib/src/pj/sock_bsd.c
===================================================================
--- pjproject/branches/1.x/pjlib/src/pj/sock_bsd.c	(revision 4386)
+++ pjproject/branches/1.x/pjlib/src/pj/sock_bsd.c	(revision 4387)
@@ -719,5 +719,4 @@
     PJ_CHECK_STACK();
     PJ_ASSERT_RETURN(buf && len, PJ_EINVAL);
-    PJ_ASSERT_RETURN(from && fromlen, (*len=-1, PJ_EINVAL));
 
     *len = recvfrom(sock, (char*)buf, *len, flags, 
@@ -727,5 +726,7 @@
 	return PJ_RETURN_OS_ERROR(pj_get_native_netos_error());
     else {
-	PJ_SOCKADDR_RESET_LEN(from);
+        if (from) {
+            PJ_SOCKADDR_RESET_LEN(from);
+        }
 	return PJ_SUCCESS;
     }
Index: pjproject/branches/1.x/pjlib/src/pjlib-test/activesock.c
===================================================================
--- pjproject/branches/1.x/pjlib/src/pjlib-test/activesock.c	(revision 4386)
+++ pjproject/branches/1.x/pjlib/src/pjlib-test/activesock.c	(revision 4387)
@@ -214,4 +214,5 @@
 	    pj_time_val delay = {0, 10};
 #ifdef PJ_SYMBIAN
+	    PJ_UNUSED_ARG(delay);
 	    pj_symbianos_poll(-1, 100);
 #else
Index: pjproject/branches/1.x/pjlib/src/pjlib-test/ioq_tcp.c
===================================================================
--- pjproject/branches/1.x/pjlib/src/pjlib-test/ioq_tcp.c	(revision 4386)
+++ pjproject/branches/1.x/pjlib/src/pjlib-test/ioq_tcp.c	(revision 4387)
@@ -364,5 +364,5 @@
 #ifdef PJ_SYMBIAN
 	callback_call_count = 0;
-	pj_symbianos_poll(-1, 1000);
+	pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
 	status = callback_call_count;
 #else
@@ -413,5 +413,5 @@
         pj_time_val timeout = {1, 0};
 #ifdef PJ_SYMBIAN
-	status = pj_symbianos_poll(-1, 1000);
+	status = pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
 #else
         status = pj_ioqueue_poll(ioque, &timeout);
@@ -543,5 +543,5 @@
 #ifdef PJ_SYMBIAN
 	callback_call_count = 0;
-	pj_symbianos_poll(-1, 1000);
+	pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
 	status = callback_call_count;
 #else
@@ -577,5 +577,5 @@
         pj_time_val timeout = {1, 0};
 #ifdef PJ_SYMBIAN
-	status = pj_symbianos_poll(-1, 1000);
+	status = pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
 #else
         status = pj_ioqueue_poll(ioque, &timeout);
@@ -772,5 +772,5 @@
 
 #ifdef PJ_SYMBIAN
-		status = pj_symbianos_poll(-1, 1000);
+		status = pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
 #else
 		status = pj_ioqueue_poll(ioque, &timeout);
@@ -798,5 +798,5 @@
 	    pj_time_val timeout = {1, 0};
 #ifdef PJ_SYMBIAN
-	    status = pj_symbianos_poll(-1, 1000);
+	    status = pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
 #else
 	    status = pj_ioqueue_poll(ioque, &timeout);
Index: pjproject/branches/1.x/pjlib/src/pjlib-test/ioq_udp.c
===================================================================
--- pjproject/branches/1.x/pjlib/src/pjlib-test/ioq_udp.c	(revision 4386)
+++ pjproject/branches/1.x/pjlib/src/pjlib-test/ioq_udp.c	(revision 4387)
@@ -268,5 +268,5 @@
 	TRACE_("poll...");
 #ifdef PJ_SYMBIAN
-	rc = pj_symbianos_poll(-1, 5000);
+	rc = pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
 #else
 	rc = pj_ioqueue_poll(ioque, &timeout);
@@ -784,5 +784,5 @@
 	    pj_time_val timeout = { 1, 0 };
 #ifdef PJ_SYMBIAN
-	    rc = pj_symbianos_poll(-1, 1000);
+	    rc = pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
 #else
 	    rc = pj_ioqueue_poll(ioque, &timeout);
@@ -813,4 +813,5 @@
 	    pj_time_val timeout = { 0, 10 };
 #ifdef PJ_SYMBIAN
+	    PJ_UNUSED_ARG(timeout);
 	    rc = pj_symbianos_poll(-1, 100);
 #else	    
Index: pjproject/branches/1.x/pjmedia/build/Makefile
===================================================================
--- pjproject/branches/1.x/pjmedia/build/Makefile	(revision 4386)
+++ pjproject/branches/1.x/pjmedia/build/Makefile	(revision 4387)
@@ -151,5 +151,7 @@
 	$(MAKE) -f $(RULES_MAK) APP=PJSDP app=pjsdp $(PJSDP_LIB)
 
-pjmedia-test: $(PJMEDIA_LIB)
+$(PJMEDIA_LIB): pjmedia
+
+pjmedia-test: $(PJMEDIA_LIB) pjmedia
 	$(MAKE) -f $(RULES_MAK) APP=PJMEDIA_TEST app=pjmedia-test $(PJMEDIA_TEST_EXE)
 
Index: pjproject/branches/1.x/pjmedia/src/pjmedia-audiodev/alsa_dev.c
===================================================================
--- pjproject/branches/1.x/pjmedia/src/pjmedia-audiodev/alsa_dev.c	(revision 4386)
+++ pjproject/branches/1.x/pjmedia/src/pjmedia-audiodev/alsa_dev.c	(revision 4387)
@@ -233,5 +233,5 @@
 
     /* Set device name */
-    strcpy(adi->name, dev_name);
+    strncpy(adi->name, dev_name, sizeof(adi->name));
 
     /* Check the number of playback channels */
Index: pjproject/branches/1.x/pjmedia/src/pjmedia/g711.c
===================================================================
--- pjproject/branches/1.x/pjmedia/src/pjmedia/g711.c	(revision 4386)
+++ pjproject/branches/1.x/pjmedia/src/pjmedia/g711.c	(revision 4387)
@@ -331,5 +331,6 @@
 #if !PLC_DISABLED
 	/* Create PLC, always with 10ms ptime */
-	status = pjmedia_plc_create(g711_factory.pool, 8000, 80,
+	status = pjmedia_plc_create(g711_factory.pool, 8000,
+				    SAMPLES_PER_FRAME,
 				    0, &codec_priv->plc);
 	if (status != PJ_SUCCESS) {
@@ -341,5 +342,5 @@
 	/* Create VAD */
 	status = pjmedia_silence_det_create(g711_factory.pool,
-					    8000, 80,
+					    8000, SAMPLES_PER_FRAME,
 					    &codec_priv->vad);
 	if (status != PJ_SUCCESS) {
Index: pjproject/branches/1.x/pjmedia/src/pjmedia/rtcp.c
===================================================================
--- pjproject/branches/1.x/pjmedia/src/pjmedia/rtcp.c	(revision 4386)
+++ pjproject/branches/1.x/pjmedia/src/pjmedia/rtcp.c	(revision 4387)
@@ -753,5 +753,6 @@
     /* Check and get BYE reason */
     if (size > 8) {
-	reason.slen = *((pj_uint8_t*)pkt+8);
+	reason.slen = PJ_MIN(sizeof(sess->stat.peer_sdes_buf_),
+                             *((pj_uint8_t*)pkt+8));
 	pj_memcpy(sess->stat.peer_sdes_buf_, ((pj_uint8_t*)pkt+9),
 		  reason.slen);
Index: pjproject/branches/1.x/pjmedia/src/pjmedia/rtp.c
===================================================================
--- pjproject/branches/1.x/pjmedia/src/pjmedia/rtp.c	(revision 4386)
+++ pjproject/branches/1.x/pjmedia/src/pjmedia/rtp.c	(revision 4387)
@@ -119,6 +119,4 @@
 					    const void **rtphdr, int *hdrlen )
 {
-    PJ_UNUSED_ARG(payload_len);
-
     /* Update timestamp */
     ses->out_hdr.ts = pj_htonl(pj_ntohl(ses->out_hdr.ts)+ts_len);
Index: pjproject/branches/1.x/pjmedia/src/pjmedia/transport_srtp.c
===================================================================
--- pjproject/branches/1.x/pjmedia/src/pjmedia/transport_srtp.c	(revision 4386)
+++ pjproject/branches/1.x/pjmedia/src/pjmedia/transport_srtp.c	(revision 4387)
@@ -38,5 +38,5 @@
 #define MAX_RTP_BUFFER_LEN	    1500
 #define MAX_RTCP_BUFFER_LEN	    1500
-#define MAX_KEY_LEN		    32
+#define MAX_KEY_LEN		    128
 
 /* Initial value of probation counter. When probation counter > 0, 
@@ -612,17 +612,45 @@
     srtp->session_inited = PJ_TRUE;
 
-    PJ_LOG(5, (srtp->pool->obj_name, "TX: %s key=%s", srtp->tx_policy.name.ptr,
-	       octet_string_hex_string(tx->key.ptr, tx->key.slen)));
-    if (srtp->tx_policy.flags) {
-	PJ_LOG(5,(srtp->pool->obj_name,"TX: disable%s%s", (cr_tx_idx?"":" enc"),
-		  (au_tx_idx?"":" auth")));
-    }
-
-    PJ_LOG(5, (srtp->pool->obj_name, "RX: %s key=%s", srtp->rx_policy.name.ptr,
-	       octet_string_hex_string(rx->key.ptr, rx->key.slen)));
-    if (srtp->rx_policy.flags) {
-	PJ_LOG(5,(srtp->pool->obj_name,"RX: disable%s%s", (cr_rx_idx?"":" enc"),
-		  (au_rx_idx?"":" auth")));
-    }
+    /* Logging stuffs */
+#if PJ_LOG_MAX_LEVEL >= 5
+    {
+	char b64[PJ_BASE256_TO_BASE64_LEN(MAX_KEY_LEN)];
+	int b64_len;
+
+	/* TX crypto and key */
+	b64_len = sizeof(b64);
+	status = pj_base64_encode((pj_uint8_t*)tx->key.ptr, tx->key.slen,
+				  b64, &b64_len);
+	if (status != PJ_SUCCESS)
+	    b64_len = pj_ansi_sprintf(b64, "--key too long--");
+	else
+	    b64[b64_len] = '\0';
+        
+	PJ_LOG(5, (srtp->pool->obj_name, "TX: %s key=%s",
+		   srtp->tx_policy.name.ptr, b64));
+	if (srtp->tx_policy.flags) {
+	    PJ_LOG(5,(srtp->pool->obj_name, "TX: disable%s%s",
+		      (cr_tx_idx?"":" enc"),
+		      (au_tx_idx?"":" auth")));
+	}
+
+	/* RX crypto and key */
+	b64_len = sizeof(b64);
+	status = pj_base64_encode((pj_uint8_t*)rx->key.ptr, rx->key.slen,
+				  b64, &b64_len);
+	if (status != PJ_SUCCESS)
+	    b64_len = pj_ansi_sprintf(b64, "--key too long--");
+	else
+	    b64[b64_len] = '\0';
+
+	PJ_LOG(5, (srtp->pool->obj_name, "RX: %s key=%s",
+		   srtp->rx_policy.name.ptr, b64));
+	if (srtp->rx_policy.flags) {
+	    PJ_LOG(5,(srtp->pool->obj_name,"RX: disable%s%s",
+		      (cr_rx_idx?"":" enc"),
+		      (au_rx_idx?"":" auth")));
+	}
+    }
+#endif
 
 on_return:
Index: pjproject/branches/1.x/pjnath/build/Makefile
===================================================================
--- pjproject/branches/1.x/pjnath/build/Makefile	(revision 4386)
+++ pjproject/branches/1.x/pjnath/build/Makefile	(revision 4387)
@@ -98,4 +98,6 @@
 	$(MAKE) -f $(RULES_MAK) APP=PJNATH app=pjnath $(PJNATH_LIB)
 
+$$(PJNATH_LIB): pjnath
+
 pjnath-test: $(PJLIB_LIB) $(PJLIB_UTIL_LIB) $(PJNATH_LIB)
 	$(MAKE) -f $(RULES_MAK) APP=PJNATH_TEST app=pjnath-test $(PJNATH_TEST_EXE)
Index: pjproject/branches/1.x/pjsip-apps/src/python/setup.py
===================================================================
--- pjproject/branches/1.x/pjsip-apps/src/python/setup.py	(revision 4386)
+++ pjproject/branches/1.x/pjsip-apps/src/python/setup.py	(revision 4387)
@@ -88,6 +88,7 @@
     extra_link_args = ["-framework", "CoreFoundation", 
                        "-framework", "AudioToolbox"]
-    # OS X Lion support
-    if platform.mac_ver()[0].startswith("10.7"):
+    version = platform.mac_ver()[0].split(".")    
+    # OS X Lion (10.7.x) or above support
+    if version[0] == '10' and int(version[1]) >= 7:
         extra_link_args += ["-framework", "AudioUnit"]
 else:
Index: pjproject/branches/1.x/pjsip-apps/src/samples/icedemo.c
===================================================================
--- pjproject/branches/1.x/pjsip-apps/src/samples/icedemo.c	(revision 4386)
+++ pjproject/branches/1.x/pjsip-apps/src/samples/icedemo.c	(revision 4387)
@@ -615,4 +615,5 @@
 
 	/* Enumerate all candidates for this component */
+	cand_cnt = PJ_ARRAY_SIZE(cand);
 	status = pj_ice_strans_enum_cands(icedemo.icest, comp+1,
 					  &cand_cnt, cand);
Index: pjproject/branches/1.x/pjsip/build/Makefile
===================================================================
--- pjproject/branches/1.x/pjsip/build/Makefile	(revision 4386)
+++ pjproject/branches/1.x/pjsip/build/Makefile	(revision 4387)
@@ -138,5 +138,5 @@
 	$(MAKE) -f $(RULES_MAK) APP=PJSUA_LIB app=pjsua-lib $(PJSUA_LIB_LIB)
 
-pjsip-test:
+pjsip-test: pjsip
 	$(MAKE) -f $(RULES_MAK) APP=TEST app=pjsip-test $(TEST_EXE)
 
Index: pjproject/branches/1.x/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- pjproject/branches/1.x/pjsip/include/pjsua-lib/pjsua.h	(revision 4386)
+++ pjproject/branches/1.x/pjsip/include/pjsua-lib/pjsua.h	(revision 4387)
@@ -654,7 +654,8 @@
      *  - it may delay the processing of the request, for example to request
      *    user permission whether to accept or reject the request. In this 
-     *	  case, the application MUST set the \a code argument to 202, and 
-     *	  later calls #pjsua_pres_notify() to accept or reject the 
-     *	  subscription request.
+     *	  case, the application MUST set the \a code argument to 202, then
+     *    IMMEDIATELY calls #pjsua_pres_notify() with state
+     *    PJSIP_EVSUB_STATE_PENDING and later calls #pjsua_pres_notify()
+     *    again to accept or reject the subscription request.
      *
      * Any \a code other than 200 and 202 will be treated as 200.
@@ -2241,5 +2242,6 @@
     /** 
      * The full SIP URL for the account. The value can take name address or 
-     * URL format, and will look something like "sip:account@serviceprovider".
+     * URL format, and will look something like "sip:account@serviceprovider"
+     * or "\"Display Name\" <sip:account@provider>".
      *
      * This field is mandatory.
@@ -3525,5 +3527,6 @@
  *
  * @param call_id	The call id to be transfered.
- * @param dest		Address of new target to be contacted.
+ * @param dest		URI of new target to be contacted. The URI may be
+ * 			in name address or addr-spec format.
  * @param msg_data	Optional message components to be sent with
  *			the request.
Index: pjproject/branches/1.x/pjsip/src/pjsip/sip_parser.c
===================================================================
--- pjproject/branches/1.x/pjsip/src/pjsip/sip_parser.c	(revision 4386)
+++ pjproject/branches/1.x/pjsip/src/pjsip/sip_parser.c	(revision 4387)
@@ -1523,6 +1523,13 @@
     /* Get the SIP-URL */
     has_bracket = (*scanner->curptr == '<');
-    if (has_bracket)
+    if (has_bracket) {
 	pj_scan_get_char(scanner);
+    } else if (name_addr->display.slen) {
+	/* Must have bracket now (2012-10-26).
+	 * Allowing (invalid) name-addr to pass URI verification will
+	 * cause us to send invalid URI to the wire.
+	 */
+	PJ_THROW( PJSIP_SYN_ERR_EXCEPTION);
+    }
     name_addr->uri = int_parse_uri( scanner, pool, PJ_TRUE );
     if (has_bracket) {
Index: pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_call.c	(revision 4386)
+++ pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_call.c	(revision 4387)
@@ -34,4 +34,15 @@
  */
 #define LOCK_CODEC_MAX_RETRY	     5
+
+
+/*
+ * The INFO method.
+ */
+const pjsip_method pjsip_info_method =
+{
+    PJSIP_OTHER_METHOD,
+    { "INFO", 4 }
+};
+
 
 /* This callback receives notification from invite session when the
@@ -175,4 +186,8 @@
     pjsip_endpt_add_capability(pjsua_var.endpt, NULL, PJSIP_H_SUPPORTED,
 			       NULL, 1, &str_norefersub);
+
+    /* Add "INFO" in Allow header, for DTMF and video key frame request. */
+    pjsip_endpt_add_capability(pjsua_var.endpt, NULL, PJSIP_H_ALLOW,
+			       NULL, 1, &pjsip_info_method.name);
 
     return status;
