Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c	(revision 3877)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c	(revision 3878)
@@ -439,5 +439,5 @@
 
 
-#if PJMEDIA_HAS_INTEL_IPP_CODEC_AMR
+#if PJMEDIA_HAS_INTEL_IPP_CODEC_AMR || PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB
 
 #include <pjmedia-codec/amr_helper.h>
Index: /pjproject/trunk/pjmedia/src/pjmedia/stream.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 3877)
+++ /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 3878)
@@ -2073,4 +2073,9 @@
 	stream->codec_param.setting.frm_per_pkt = 1;
 
+    /* Init the codec. */
+    status = pjmedia_codec_init(stream->codec, pool);
+    if (status != PJ_SUCCESS)
+	goto err_cleanup;
+
     /* Open the codec. */
     status = pjmedia_codec_open(stream->codec, &stream->codec_param);
Index: /pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 3877)
+++ /pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 3878)
@@ -462,7 +462,11 @@
     fport = (struct file_reader_port*) port;
 
-    PJ_ASSERT_RETURN(bytes < fport->fsize - fport->start_data, PJ_EINVAL);
+    /* Check that this offset does not pass the audio-data (in case of
+     * extra chunk after audio data chunk
+     */
+    PJ_ASSERT_RETURN(bytes < fport->data_len, PJ_EINVAL);
 
     fport->fpos = fport->start_data + bytes;
+    fport->data_left = fport->data_len - bytes;
     pj_file_setpos( fport->fd, fport->fpos, PJ_SEEK_SET);
 
Index: /pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c	(revision 3877)
+++ /pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c	(revision 3878)
@@ -456,15 +456,23 @@
     if (method->id == PJSIP_ACK_METHOD && inv) {
 
+	/* Ignore if we don't have INVITE in progress */
+	if (!inv->invite_tsx) {
+	    return PJ_TRUE;
+	}
+
 	/* Ignore ACK if pending INVITE transaction has not finished. */
-	if (inv->invite_tsx && 
-	    inv->invite_tsx->state < PJSIP_TSX_STATE_COMPLETED)
-	{
+	if (inv->invite_tsx->state < PJSIP_TSX_STATE_COMPLETED) {
 	    return PJ_TRUE;
 	}
 
+	/* Ignore ACK with different CSeq
+	 * https://trac.pjsip.org/repos/ticket/1391
+	 */
+	if (rdata->msg_info.cseq->cseq != inv->invite_tsx->cseq) {
+	    return PJ_TRUE;
+	}
+
 	/* Terminate INVITE transaction, if it's still present. */
-	if (inv->invite_tsx && 
-	    inv->invite_tsx->state <= PJSIP_TSX_STATE_COMPLETED)
-	{
+	if (inv->invite_tsx->state <= PJSIP_TSX_STATE_COMPLETED) {
 	    /* Before we terminate INVITE transaction, process the SDP
 	     * in the ACK request, if any. 
Index: /pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c	(revision 3877)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c	(revision 3878)
@@ -279,6 +279,6 @@
     /* Check algorithm is supported. We support MD5 and AKAv1-MD5. */
     if (chal->algorithm.slen==0 ||
-	(pj_stricmp(&chal->algorithm, &pjsip_MD5_STR) ||
-	 pj_stricmp(&chal->algorithm, &pjsip_AKAv1_MD5_STR)))
+	(pj_stricmp(&chal->algorithm, &pjsip_MD5_STR)==0 ||
+	 pj_stricmp(&chal->algorithm, &pjsip_AKAv1_MD5_STR)==0))
     {
 	;
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 3877)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 3878)
@@ -896,4 +896,10 @@
 #endif
 
+    /* Use of proxy */
+    if (acc->cfg.reg_use_proxy != cfg->reg_use_proxy) {
+        acc->cfg.reg_use_proxy = cfg->reg_use_proxy;
+        update_reg = PJ_TRUE;
+    }
+
     /* Global outbound proxy */
     if (global_route_crc != acc->global_route_crc) {
@@ -1006,4 +1012,5 @@
     acc->cfg.reg_first_retry_interval = cfg->reg_first_retry_interval;
     acc->cfg.drop_calls_on_reg_fail = cfg->drop_calls_on_reg_fail;
+    acc->cfg.register_on_acc_add = cfg->register_on_acc_add;
     if (acc->cfg.reg_delay_before_refresh != cfg->reg_delay_before_refresh) {
         acc->cfg.reg_delay_before_refresh = cfg->reg_delay_before_refresh;
@@ -1068,4 +1075,7 @@
     acc->cfg.vid_cap_dev = cfg->vid_cap_dev;
     acc->cfg.vid_rend_dev = cfg->vid_rend_dev;
+
+    /* Call hold type */
+    acc->cfg.call_hold_type = cfg->call_hold_type;
 
 on_return:
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 3877)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 3878)
@@ -1322,6 +1322,10 @@
 	 */
 	if (wait) {
-	    while (pjsua_var.stun_status == PJ_EPENDING)
-		pjsua_handle_events(10);
+	    while (pjsua_var.stun_status == PJ_EPENDING) {
+		if (pjsua_var.thread[0] == NULL)
+		    pjsua_handle_events(10);
+		else
+		    pj_thread_sleep(10);
+	    }
 	}
     }
