Index: pjproject/trunk/build/m-x86_64.mak
===================================================================
--- pjproject/trunk/build/m-x86_64.mak	(revision 624)
+++ pjproject/trunk/build/m-x86_64.mak	(revision 624)
@@ -0,0 +1,4 @@
+export M_CFLAGS := $(CC_DEF)PJ_M_X86_64=1
+export M_CXXFLAGS :=
+export M_LDFLAGS :=
+export M_SOURCES :=
Index: pjproject/trunk/configure
===================================================================
--- pjproject/trunk/configure	(revision 623)
+++ pjproject/trunk/configure	(revision 624)
@@ -12,4 +12,6 @@
 elif echo $MACHINE | grep i.86 > /dev/null; then
     MACHINE_NAME=i386
+elif echo $MACHINE | grep x86_64 > /dev/null; then
+    MACHINE_NAME=x86_64
 elif echo $MACHINE | grep alpha > /dev/null; then
     MACHINE_NAME=alpha
Index: pjproject/trunk/pjlib/include/pj/compat/m_x86_64.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/m_x86_64.h	(revision 624)
+++ pjproject/trunk/pjlib/include/pj/compat/m_x86_64.h	(revision 624)
@@ -0,0 +1,35 @@
+/* $Id$ */
+/* 
+ * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJ_COMPAT_M_x86_64_H__
+#define __PJ_COMPAT_M_x86_64_H__
+
+/**
+ * @file m_i386.h
+ * @brief Describes 64bit x86 Intel/AMD family processor specifics.
+ */
+
+#define PJ_M_NAME		"x86_64"
+
+#define PJ_HAS_PENTIUM		1
+#define PJ_IS_LITTLE_ENDIAN	1
+#define PJ_IS_BIG_ENDIAN	0
+
+
+#endif	/* __PJ_COMPAT_M_x86_64_H__ */
+
Index: pjproject/trunk/pjlib/include/pj/config.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/config.h	(revision 623)
+++ pjproject/trunk/pjlib/include/pj/config.h	(revision 624)
@@ -66,4 +66,6 @@
 #if defined (PJ_M_I386) && PJ_M_I386 != 0
 #   include <pj/compat/m_i386.h>
+#elif defined (PJ_M_X86_64) && PJ_M_X86_64 != 0
+#   include <pj/compat/m_x86_64.h>
 #elif defined (PJ_M_M68K) && PJ_M_M68K != 0
 #   include <pj/compat/m_m68k.h>
Index: pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 623)
+++ pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 624)
@@ -209,5 +209,5 @@
 	{
 	  int value;
-	  socklen_t vallen = sizeof(value);
+	  int vallen = sizeof(value);
 	  int gs_rc = pj_sock_getsockopt(h->fd, SOL_SOCKET, SO_ERROR, 
 					 &value, &vallen);
@@ -529,5 +529,5 @@
 #if (defined(PJ_HAS_SO_ERROR) && PJ_HAS_SO_ERROR!=0)
 	int value;
-	socklen_t vallen = sizeof(value);
+	int vallen = sizeof(value);
 	int gs_rc = pj_sock_getsockopt(h->fd, SOL_SOCKET, SO_ERROR, 
 				       &value, &vallen);
Index: pjproject/trunk/pjlib/src/pj/pool_caching.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/pool_caching.c	(revision 623)
+++ pjproject/trunk/pjlib/src/pj/pool_caching.c	(revision 624)
@@ -176,5 +176,5 @@
 
     /* Mark factory data */
-    pool->factory_data = (void*) idx;
+    pool->factory_data = (void*) (long) idx;
 
     /* Increment used count. */
@@ -226,5 +226,5 @@
      * Otherwise put the pool in our recycle list.
      */
-    i = (unsigned)pool->factory_data;
+    i = (unsigned) (unsigned long) pool->factory_data;
 
     pj_assert(i<PJ_CACHING_POOL_ARRAY_SIZE);
Index: pjproject/trunk/pjmedia/build/m-x86_64.mak
===================================================================
--- pjproject/trunk/pjmedia/build/m-x86_64.mak	(revision 624)
+++ pjproject/trunk/pjmedia/build/m-x86_64.mak	(revision 624)
@@ -0,0 +1,6 @@
+
+#
+# We need to define PA_LITTLE_ENDIAN when compiling PortAudio on Linux x86_64
+#
+
+export M_CFLAGS += $(CC_DEF)PA_LITTLE_ENDIAN
Index: pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c	(revision 623)
+++ pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c	(revision 624)
@@ -505,8 +505,11 @@
 
     /*
-     * Respond any requests with 500.
+     * Respond any requests (except ACK!) with 500.
      */
-    pjsip_endpt_respond_stateless(app.sip_endpt, rdata, 500, &reason,
-				  NULL, NULL);
+    if (rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) {
+	pjsip_endpt_respond_stateless(app.sip_endpt, rdata, 500, &reason,
+				      NULL, NULL);
+    }
+
     return PJ_TRUE;
 }
@@ -1314,5 +1317,5 @@
 {
     pj_time_val end_time, last_report, now;
-    unsigned thread_index = (unsigned)arg;
+    unsigned thread_index = (unsigned)(long)arg;
     unsigned cycle = 0, last_cycle = 0;
 
@@ -1471,5 +1474,5 @@
 {
     pj_time_val timeout = { 0, 1 };
-    unsigned thread_index = (unsigned)arg;
+    unsigned thread_index = (unsigned)(long)arg;
     pj_time_val last_report, next_report;
 
@@ -1607,6 +1610,6 @@
 
 	for (i=0; i<app.thread_count; ++i) {
-	    status = pj_thread_create(app.pool, NULL, &client_thread, (void*)i,
-				      0, 0, &app.thread[i]);
+	    status = pj_thread_create(app.pool, NULL, &client_thread, 
+				      (void*)(long)i, 0, 0, &app.thread[i]);
 	    if (status != PJ_SUCCESS) {
 		app_perror(THIS_FILE, "Unable to create thread", status);
@@ -1716,6 +1719,6 @@
 
 	for (i=0; i<app.thread_count; ++i) {
-	    status = pj_thread_create(app.pool, NULL, &server_thread, (void*)i,
-				      0, 0, &app.thread[i]);
+	    status = pj_thread_create(app.pool, NULL, &server_thread, 
+				      (void*)(long)i, 0, 0, &app.thread[i]);
 	    if (status != PJ_SUCCESS) {
 		app_perror(THIS_FILE, "Unable to create thread", status);
Index: pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c	(revision 623)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c	(revision 624)
@@ -87,5 +87,5 @@
     rdata->tp_info.pool = pool;
     rdata->tp_info.transport = &tp->base;
-    rdata->tp_info.tp_data = (void*) rdata_index;
+    rdata->tp_info.tp_data = (void*)(long)rdata_index;
     rdata->tp_info.op_key.rdata = rdata;
     pj_ioqueue_op_key_init(&rdata->tp_info.op_key.op_key, 
@@ -191,5 +191,5 @@
 
 	    rdata_tp = (struct udp_transport*)rdata->tp_info.transport;
-	    rdata_index = (unsigned)rdata->tp_info.tp_data;
+	    rdata_index = (unsigned)(unsigned long)rdata->tp_info.tp_data;
 
 	    pj_pool_reset(rdata_pool);
Index: pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c	(revision 623)
+++ pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c	(revision 624)
@@ -540,11 +540,17 @@
 	    pj_mutex_unlock(mod_ua.mutex);
 
-	    PJ_LOG(5,(THIS_FILE, 
-		      "Unable to find dialog for %s, answering with 481",
-		      pjsip_rx_data_get_info(rdata)));
-
-	    pjsip_endpt_respond_stateless(mod_ua.endpt, rdata,
-					  PJSIP_SC_CALL_TSX_DOES_NOT_EXIST, 
-					  NULL, NULL, NULL);
+	    if (rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) {
+		PJ_LOG(5,(THIS_FILE, 
+		          "Unable to find dialog for %s, answering with 481",
+		          pjsip_rx_data_get_info(rdata)));
+
+		pjsip_endpt_respond_stateless(mod_ua.endpt, rdata,
+					      PJSIP_SC_CALL_TSX_DOES_NOT_EXIST, 
+					      NULL, NULL, NULL);
+	    } else {
+		PJ_LOG(5,(THIS_FILE, 
+		          "Unable to find dialog for %s",
+		          pjsip_rx_data_get_info(rdata)));
+	    }
 	    return PJ_TRUE;
 	}
Index: pjproject/trunk/pjsip/src/test-pjsip/msg_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/msg_test.c	(revision 623)
+++ pjproject/trunk/pjsip/src/test-pjsip/msg_test.c	(revision 624)
@@ -819,5 +819,5 @@
 			  "per second (tested with %d message sets with "
 			  "average message length of "
-			  "%d bytes)", PJ_ARRAY_SIZE(test_array), avg_len);
+			  "%d bytes)", (int)PJ_ARRAY_SIZE(test_array), avg_len);
     report_ival("msg-detect-per-sec", max, "msg/sec", desc);
 
@@ -832,5 +832,5 @@
 			  "per second (tested with %d message sets with "
 			  "average message length of "
-			  "%d bytes)", PJ_ARRAY_SIZE(test_array), avg_len);
+			  "%d bytes)", (int)PJ_ARRAY_SIZE(test_array), avg_len);
     report_ival("msg-parse-per-sec", max, "msg/sec", desc);
 
@@ -852,5 +852,5 @@
 			  " per second (tested with %d message sets with "
 			  "average message length of "
-			  "%d bytes)", PJ_ARRAY_SIZE(test_array), avg_len);
+			  "%d bytes)", (int)PJ_ARRAY_SIZE(test_array), avg_len);
 
     report_ival("msg-print-per-sec", max, "msg/sec", desc);
Index: pjproject/trunk/pjsip/src/test-pjsip/transport_loop_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/transport_loop_test.c	(revision 623)
+++ pjproject/trunk/pjsip/src/test-pjsip/transport_loop_test.c	(revision 624)
@@ -32,5 +32,5 @@
     pj_status_t status;
     long ref_cnt;
-    unsigned rtt[LOOP], min_rtt;
+    int rtt[LOOP], min_rtt;
 
     PJ_LOG(3,(THIS_FILE, "testing datagram loop transport"));
Index: pjproject/trunk/pjsip/src/test-pjsip/transport_tcp_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/transport_tcp_test.c	(revision 623)
+++ pjproject/trunk/pjsip/src/test-pjsip/transport_tcp_test.c	(revision 624)
@@ -36,5 +36,5 @@
     pj_status_t status;
     char url[64];
-    unsigned rtt[SEND_RECV_LOOP], min_rtt;
+    int rtt[SEND_RECV_LOOP], min_rtt;
     int i, pkt_lost;
 
Index: pjproject/trunk/pjsip/src/test-pjsip/transport_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/transport_test.c	(revision 623)
+++ pjproject/trunk/pjsip/src/test-pjsip/transport_test.c	(revision 624)
@@ -490,5 +490,5 @@
 static int rt_worker_thread(void *arg)
 {
-    int i, thread_id = (int)arg;
+    int i, thread_id = (int)(long)arg;
     pj_time_val poll_delay = { 0, 10 };
 
@@ -577,5 +577,5 @@
 
 	/* Create thread, suspended. */
-	status = pj_thread_create(pool, "rttest%p", &rt_worker_thread, (void*)i, 0,
+	status = pj_thread_create(pool, "rttest%p", &rt_worker_thread, (void*)(long)i, 0,
 				  PJ_THREAD_SUSPENDED, &rt_test_data[i].thread);
 	if (status != PJ_SUCCESS) {
Index: pjproject/trunk/pjsip/src/test-pjsip/transport_udp_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/transport_udp_test.c	(revision 623)
+++ pjproject/trunk/pjsip/src/test-pjsip/transport_udp_test.c	(revision 624)
@@ -35,5 +35,5 @@
     pj_str_t s;
     pj_status_t status;
-    unsigned rtt[SEND_RECV_LOOP], min_rtt;
+    int rtt[SEND_RECV_LOOP], min_rtt;
     int i, pkt_lost;
 
Index: pjproject/trunk/pjsip/src/test-pjsip/uri_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/uri_test.c	(revision 623)
+++ pjproject/trunk/pjsip/src/test-pjsip/uri_test.c	(revision 624)
@@ -956,5 +956,5 @@
 			  "(tested with %d URI set, with average length of "
 			  "%d chars)",
-			  PJ_ARRAY_SIZE(uri_test_array), avg_len);
+			  (int)PJ_ARRAY_SIZE(uri_test_array), avg_len);
 
     report_ival("uri-parse-per-sec", max, "URI/sec", desc);
@@ -976,5 +976,5 @@
 			  "(tested with %d URI set, with average length of "
 			  "%d chars)",
-			  PJ_ARRAY_SIZE(uri_test_array), avg_len);
+			  (int)PJ_ARRAY_SIZE(uri_test_array), avg_len);
 
     report_ival("uri-print-per-sec", max, "URI/sec", desc);
@@ -990,5 +990,5 @@
 			  "(tested with %d URI set, with average length of "
 			  "%d chars)",
-			  PJ_ARRAY_SIZE(uri_test_array), avg_len);
+			  (int)PJ_ARRAY_SIZE(uri_test_array), avg_len);
 
     report_ival("uri-cmp-per-sec", max, "URI/sec", desc);
