Index: /pjproject/branches/symbian/pjlib-util/src/pjlib-util/errno.c
===================================================================
--- /pjproject/branches/symbian/pjlib-util/src/pjlib-util/errno.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib-util/src/pjlib-util/errno.c	(revision 789)
@@ -17,5 +17,5 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
-#include <pjlib-util/errno.h>
+#include <pjlib-util.h>
 #include <pj/string.h>
 
Index: /pjproject/branches/symbian/pjlib-util/src/pjlib-util/string.c
===================================================================
--- /pjproject/branches/symbian/pjlib-util/src/pjlib-util/string.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib-util/src/pjlib-util/string.c	(revision 789)
@@ -32,5 +32,5 @@
 	return *src_str;
 
-    dst = dst_str.ptr = pj_pool_alloc(pool, src_str->slen);
+    dst = dst_str.ptr = (char*) pj_pool_alloc(pool, src_str->slen);
 
     while (src != end) {
Index: /pjproject/branches/symbian/pjlib-util/src/pjlib-util/stun.c
===================================================================
--- /pjproject/branches/symbian/pjlib-util/src/pjlib-util/stun.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib-util/src/pjlib-util/stun.c	(revision 789)
@@ -36,5 +36,5 @@
 
 
-    hdr = pj_pool_calloc(pool, 1, sizeof(pj_stun_msg_hdr));
+    hdr = (pj_stun_msg_hdr*) pj_pool_calloc(pool, 1, sizeof(pj_stun_msg_hdr));
     if (!hdr)
 	return PJ_ENOMEM;
Index: /pjproject/branches/symbian/pjlib-util/src/pjlib-util/stun_client.c
===================================================================
--- /pjproject/branches/symbian/pjlib-util/src/pjlib-util/stun_client.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib-util/src/pjlib-util/stun_client.c	(revision 789)
@@ -42,5 +42,5 @@
     int i, j, send_cnt = 0;
     pj_pool_t *pool;
-    struct {
+    struct stun_rec {
 	struct {
 	    pj_uint32_t	mapped_addr;
@@ -62,5 +62,5 @@
 
     /* Allocate client records */
-    rec = pj_pool_calloc(pool, sock_cnt, sizeof(*rec));
+    rec = (struct stun_rec*) pj_pool_calloc(pool, sock_cnt, sizeof(*rec));
     if (!rec) {
 	status = PJ_ENOMEM;
@@ -98,5 +98,5 @@
 	for (i=0; i<sock_cnt && status==PJ_SUCCESS; ++i) {
 	    for (j=0; j<2 && status==PJ_SUCCESS; ++j) {
-		pj_stun_msg_hdr *msg_hdr = out_msg;
+		pj_stun_msg_hdr *msg_hdr = (pj_stun_msg_hdr*) out_msg;
                 pj_ssize_t sent_len;
 
@@ -195,5 +195,5 @@
 		}
 
-		attr = (void*)pj_stun_msg_find_attr(&msg, PJ_STUN_ATTR_MAPPED_ADDR);
+		attr = (pj_stun_mapped_addr_attr *)pj_stun_msg_find_attr(&msg, PJ_STUN_ATTR_MAPPED_ADDR);
 		if (!attr) {
 		    status = PJLIB_UTIL_ESTUNNOMAP;
Index: /pjproject/branches/symbian/pjlib-util/src/pjlib-util/xml.c
===================================================================
--- /pjproject/branches/symbian/pjlib-util/src/pjlib-util/xml.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib-util/src/pjlib-util/xml.c	(revision 789)
@@ -38,5 +38,5 @@
     pj_xml_node *node;
 
-    node = pj_pool_zalloc(pool, sizeof(pj_xml_node));
+    node = (pj_xml_node*) pj_pool_zalloc(pool, sizeof(pj_xml_node));
     pj_list_init( &node->attr_head );
     pj_list_init( &node->node_head );
@@ -47,5 +47,5 @@
 static pj_xml_attr *alloc_attr( pj_pool_t *pool )
 {
-    return pj_pool_zalloc(pool, sizeof(pj_xml_attr));
+    return (pj_xml_attr*) pj_pool_zalloc(pool, sizeof(pj_xml_attr));
 }
 
@@ -394,5 +394,6 @@
 				  pj_bool_t (*match)(pj_xml_node *, const void*))
 {
-    pj_xml_node *head = (void*)&parent->node_head, *node = head->next;
+    pj_xml_node *head = (pj_xml_node *) &parent->node_head, 
+	        *node = head->next;
 
     while (node != (void*)head) {
Index: /pjproject/branches/symbian/pjlib/include/pj/compat/os_symbian.h
===================================================================
--- /pjproject/branches/symbian/pjlib/include/pj/compat/os_symbian.h	(revision 788)
+++ /pjproject/branches/symbian/pjlib/include/pj/compat/os_symbian.h	(revision 789)
@@ -103,5 +103,11 @@
  */
 
-#define NULL 0
+#ifndef NULL
+#   define NULL 0
+#endif
+
+
+/* Doesn't seem to allow more than this */
+#define PJ_IOQUEUE_MAX_HANDLES	    8
 
 /*
@@ -109,5 +115,5 @@
  */
 #define PJ_HAS_FLOATING_POINT	    1
-#define PJ_HAS_MALLOC               1
+#define PJ_HAS_MALLOC               0
 #define PJ_HAS_SEMAPHORE	    1
 #define PJ_HAS_EVENT_OBJ	    0
Index: /pjproject/branches/symbian/pjlib/include/pj/compat/socket.h
===================================================================
--- /pjproject/branches/symbian/pjlib/include/pj/compat/socket.h	(revision 788)
+++ /pjproject/branches/symbian/pjlib/include/pj/compat/socket.h	(revision 789)
@@ -82,4 +82,8 @@
 #  define OSERR_EINPROGRESS    WSAEINPROGRESS
 #  define OSERR_ECONNRESET     WSAECONNRESET
+#elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+#  define OSERR_EWOULDBLOCK    -1
+#  define OSERR_EINPROGRESS    -1
+#  define OSERR_ECONNRESET     -1
 #else
 #  define OSERR_EWOULDBLOCK    EWOULDBLOCK
Index: /pjproject/branches/symbian/pjlib/include/pj/list_i.h
===================================================================
--- /pjproject/branches/symbian/pjlib/include/pj/list_i.h	(revision 788)
+++ /pjproject/branches/symbian/pjlib/include/pj/list_i.h	(revision 789)
@@ -125,5 +125,5 @@
     while (node != list) {
 	++count;
-	node = node->next;
+	node = (pj_list*)node->next;
     }
 
Index: /pjproject/branches/symbian/pjlib/src/pj/array.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/array.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/array.c	(revision 789)
@@ -56,5 +56,5 @@
 {
     unsigned i;
-    const char *char_array = array;
+    const char *char_array = (const char*) array;
     for (i=0; i<count; ++i) {
 	if ( (*matching)(char_array) == PJ_SUCCESS) {
Index: /pjproject/branches/symbian/pjlib/src/pj/errno.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/errno.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/errno.c	(revision 789)
@@ -24,6 +24,8 @@
  * in separate file.
  */
-extern int platform_strerror( pj_os_err_type code, 
-                              char *buf, pj_size_t bufsize );
+PJ_BEGIN_DECL
+PJ_DECL(int) platform_strerror(pj_os_err_type code, 
+                               char *buf, pj_size_t bufsize );
+PJ_END_DECL
 
 #define PJLIB_MAX_ERR_MSG_HANDLER   8
Index: /pjproject/branches/symbian/pjlib/src/pj/fifobuf.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/fifobuf.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/fifobuf.c	(revision 789)
@@ -35,5 +35,5 @@
 	       fifobuf, buffer, size));
 
-    fifobuf->first = buffer;
+    fifobuf->first = (char*) buffer;
     fifobuf->last = fifobuf->first + size;
     fifobuf->ubegin = fifobuf->uend = fifobuf->first;
@@ -119,5 +119,5 @@
 pj_fifobuf_unalloc (pj_fifobuf_t *fifobuf, void *buf)
 {
-    char *ptr = buf;
+    char *ptr = (char*) buf;
     char *endptr;
     unsigned sz;
@@ -150,5 +150,5 @@
 pj_fifobuf_free (pj_fifobuf_t *fifobuf, void *buf)
 {
-    char *ptr = buf;
+    char *ptr = (char*) buf;
     char *end;
     unsigned sz;
Index: /pjproject/branches/symbian/pjlib/src/pj/guid.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/guid.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/guid.c	(revision 789)
@@ -22,5 +22,5 @@
 PJ_DEF(void) pj_create_unique_string(pj_pool_t *pool, pj_str_t *str)
 {
-    str->ptr = pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH);
+    str->ptr = (char*) pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH);
     pj_generate_unique_string(str);
 }
Index: /pjproject/branches/symbian/pjlib/src/pj/hash.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/hash.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/hash.c	(revision 789)
@@ -56,10 +56,10 @@
 
     if (keylen==PJ_HASH_KEY_STRING) {
-	const unsigned char *p = key;
+	const unsigned char *p = (const unsigned char*) key;
 	for ( ; *p; ++p ) {
 	    hash = (hash * PJ_HASH_MULTIPLIER) + *p;
 	}
     } else {
-	const unsigned char *p = key,
+	const unsigned char *p = (const unsigned char*) key,
 			    *end = p + keylen;
 	for ( ; p!=end; ++p) {
@@ -93,5 +93,5 @@
     PJ_ASSERT_RETURN(sizeof(pj_hash_entry)==PJ_HASH_ENTRY_SIZE, NULL);
 
-    h = pj_pool_alloc(pool, sizeof(pj_hash_table_t));
+    h = (pj_hash_table_t*) pj_pool_alloc(pool, sizeof(pj_hash_table_t));
     h->count = 0;
 
@@ -109,5 +109,5 @@
     
     h->rows = table_size;
-    h->table = pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*));
+    h->table = (pj_hash_entry**) pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*));
     return h;
 }
@@ -129,5 +129,5 @@
 	hash=0;
 	if (keylen==PJ_HASH_KEY_STRING) {
-	    const unsigned char *p = key;
+	    const unsigned char *p = (const unsigned char*)key;
 	    for ( ; *p; ++p ) {
 		hash = hash * PJ_HASH_MULTIPLIER + *p;
@@ -135,5 +135,5 @@
 	    keylen = p - (const unsigned char*)key;
 	} else {
-	    const unsigned char *p = key,
+	    const unsigned char *p = (const unsigned char*) key,
 				*end = p + keylen;
 	    for ( ; p!=end; ++p) {
@@ -166,10 +166,10 @@
      */
     if (entry_buf) {
-	entry = entry_buf;
+	entry = (pj_hash_entry*) entry_buf;
     } else {
 	/* Pool must be specified! */
 	PJ_ASSERT_RETURN(pool != NULL, NULL);
 
-	entry = pj_pool_alloc(pool, sizeof(pj_hash_entry));
+	entry = (pj_hash_entry*) pj_pool_alloc(pool, sizeof(pj_hash_entry));
 	PJ_LOG(6, ("hashtbl", 
 		   "%p: New p_entry %p created, pool used=%u, cap=%u", 
Index: /pjproject/branches/symbian/pjlib/src/pj/ioqueue_symbian.cpp
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/ioqueue_symbian.cpp	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/ioqueue_symbian.cpp	(revision 789)
@@ -45,13 +45,9 @@
 {
 public:
-    CIoqueueCallback(pj_ioqueue_t *ioqueue,
-		     pj_ioqueue_key_t *key, pj_sock_t sock, 
-		     const pj_ioqueue_callback *cb, void *user_data)
-    : CActive(CActive::EPriorityStandard),
-	  ioqueue_(ioqueue), key_(key), sock_((CPjSocket*)sock), cb_(cb), 
-	  user_data_(user_data), aBufferPtr_(NULL, 0), type_(TYPE_NONE)
-    {
-	CActiveScheduler::Add(this);
-    }
+    static CIoqueueCallback* NewL(pj_ioqueue_t *ioqueue,
+				  pj_ioqueue_key_t *key, 
+				  pj_sock_t sock, 
+				  const pj_ioqueue_callback *cb, 
+				  void *user_data);
 
     //
@@ -60,22 +56,5 @@
     pj_status_t StartRead(pj_ioqueue_op_key_t *op_key, 
 			  void *buf, pj_ssize_t *size, unsigned flags,
-			  pj_sockaddr_t *addr, int *addrlen)
-    {
-	PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY);
-	PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY);
-
-	pending_data_.read_.op_key_ = op_key;
-	pending_data_.read_.addr_ = addr;
-	pending_data_.read_.addrlen_ = addrlen;
-
-	aBufferPtr_.Set((TUint8*)buf, 0, (TInt)*size);
-
-	type_ = TYPE_READ;
-	SetActive();
-	sock_->Socket().RecvFrom(aBufferPtr_, aAddress_, flags, iStatus);
-
-	return PJ_EPENDING;
-    }
-
+			  pj_sockaddr_t *addr, int *addrlen);
 
     //
@@ -86,142 +65,21 @@
 			    pj_sockaddr_t *local,
 			    pj_sockaddr_t *remote,
-			    int *addrlen )
-    {
-	PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY);
-	PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY);
-
-	pending_data_.accept_.op_key_ = op_key;
-	pending_data_.accept_.new_sock_ = new_sock;
-	pending_data_.accept_.local_ = local;
-	pending_data_.accept_.remote_ = remote;
-	pending_data_.accept_.addrlen_ = addrlen;
-
-	// Create blank socket
-	blank_sock_.Open(PjSymbianOS::Instance()->SocketServ());
-
-	type_ = TYPE_ACCEPT;
-	SetActive();
-	sock_->Socket().Accept(blank_sock_, iStatus);
-
-	return PJ_EPENDING;
-    }
-
+			    int *addrlen );
 
     //
     // Completion callback.
     //
-    void RunL()
-    {
-	Type cur_type = type_;
-
-	type_ = TYPE_NONE;
-
-	if (cur_type == TYPE_READ) {
-	    //
-	    // Completion of asynchronous RecvFrom()
-	    //
-
-	    /* Clear op_key (save it to temp variable first!) */
-	    pj_ioqueue_op_key_t	*op_key = pending_data_.read_.op_key_;
-	    pending_data_.read_.op_key_ = NULL;
-
-	    // Handle failure condition
-	    if (iStatus != KErrNone) {
-		cb_->on_read_complete(key_, op_key, -PJ_RETURN_OS_ERROR(iStatus.Int()));
-		return;
-	    }
-
-	    if (pending_data_.read_.addr_) {
-		PjSymbianOS::Addr2pj(aAddress_, 
-				     *(pj_sockaddr_in*)pending_data_.read_.addr_);
-		pending_data_.read_.addr_ = NULL;
-	    }
-	    if (pending_data_.read_.addrlen_) {
-		*pending_data_.read_.addrlen_ = sizeof(pj_sockaddr_in);
-		pending_data_.read_.addrlen_ = NULL;
-	    }
-
-	    /* Call callback */
-	    cb_->on_read_complete(key_, op_key, aBufferPtr_.Length());
-
-	} else if (cur_type == TYPE_ACCEPT) {
-	    //
-	    // Completion of asynchronous Accept()
-	    //
-	    
-	    /* Clear op_key (save it to temp variable first!) */
-	    pj_ioqueue_op_key_t	*op_key = pending_data_.read_.op_key_;
-	    pending_data_.read_.op_key_ = NULL;
-
-	    // Handle failure condition
-	    if (iStatus != KErrNone) {
-		if (pending_data_.accept_.new_sock_)
-		    *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET;
-
-		cb_->on_accept_complete(key_, op_key, PJ_INVALID_SOCKET,
-					-PJ_RETURN_OS_ERROR(iStatus.Int()));
-		return;
-	    }
-
-	    CPjSocket *pjNewSock = new CPjSocket(blank_sock_);
-
-	    if (pending_data_.accept_.new_sock_) {
-		*pending_data_.accept_.new_sock_ = (pj_sock_t)pjNewSock;
-		pending_data_.accept_.new_sock_ = NULL;
-	    }
-
-	    if (pending_data_.accept_.local_) {
-		TInetAddr aAddr;
-		blank_sock_.LocalName(aAddr);
-		PjSymbianOS::Addr2pj(aAddr, *(pj_sockaddr_in*)pending_data_.accept_.local_);
-		pending_data_.accept_.local_ = NULL;
-	    }
-
-	    if (pending_data_.accept_.remote_) {
-		TInetAddr aAddr;
-		blank_sock_.RemoteName(aAddr);
-		PjSymbianOS::Addr2pj(aAddr, *(pj_sockaddr_in*)pending_data_.accept_.remote_);
-		pending_data_.accept_.remote_ = NULL;
-	    }
-
-	    if (pending_data_.accept_.addrlen_) {
-		*pending_data_.accept_.addrlen_ = sizeof(pj_sockaddr_in);
-		pending_data_.accept_.addrlen_ = NULL;
-	    }
-
-	    // Call callback.
-	    cb_->on_accept_complete(key_, op_key, (pj_sock_t)pjNewSock, PJ_SUCCESS);
-	}
-
-	ioqueue_->eventCount++;
-    }
+    void RunL();
 
     //
     // CActive's DoCancel()
     //
-    void DoCancel()
-    {
-	if (type_ == TYPE_READ)
-	    sock_->Socket().CancelRecv();
-	else if (type_ == TYPE_ACCEPT)
-	    sock_->Socket().CancelAccept();
-
-	type_ = TYPE_NONE;
-    }
+    void DoCancel();
 
     //
     // Cancel operation and call callback.
     //
-    void CancelOperation(pj_ioqueue_op_key_t *op_key, pj_ssize_t bytes_status)
-    {
-	Type cur_type = type_;
-
-	Cancel();
-
-	if (cur_type == TYPE_READ)
-	    cb_->on_read_complete(key_, op_key, bytes_status);
-	else if (cur_type == TYPE_ACCEPT)
-	    ;
-    }
+    void CancelOperation(pj_ioqueue_op_key_t *op_key, 
+			 pj_ssize_t bytes_status);
 
     //
@@ -293,9 +151,236 @@
     union Pending_Data		 pending_data_;
     RSocket			blank_sock_;
+
+    CIoqueueCallback(pj_ioqueue_t *ioqueue,
+		     pj_ioqueue_key_t *key, pj_sock_t sock, 
+		     const pj_ioqueue_callback *cb, void *user_data)
+    : CActive(CActive::EPriorityStandard),
+	  ioqueue_(ioqueue), key_(key), sock_((CPjSocket*)sock), cb_(cb), 
+	  user_data_(user_data), aBufferPtr_(NULL, 0), type_(TYPE_NONE)
+    {
+    }
+
+
+    void ConstructL()
+    {
+	CActiveScheduler::Add(this);
+    }
 };
 
 
-
-
+CIoqueueCallback* CIoqueueCallback::NewL(pj_ioqueue_t *ioqueue,
+					 pj_ioqueue_key_t *key, 
+					 pj_sock_t sock, 
+					 const pj_ioqueue_callback *cb, 
+					 void *user_data)
+{
+    CIoqueueCallback *self = new CIoqueueCallback(ioqueue, key, sock, 
+						  cb, user_data);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+}
+
+
+//
+// Start asynchronous recv() operation
+//
+pj_status_t CIoqueueCallback::StartRead(pj_ioqueue_op_key_t *op_key, 
+					void *buf, pj_ssize_t *size, 
+					unsigned flags,
+					pj_sockaddr_t *addr, int *addrlen)
+{
+    PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY);
+    PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY);
+
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
+
+    pending_data_.read_.op_key_ = op_key;
+    pending_data_.read_.addr_ = addr;
+    pending_data_.read_.addrlen_ = addrlen;
+
+    aBufferPtr_.Set((TUint8*)buf, 0, (TInt)*size);
+
+    type_ = TYPE_READ;
+    if (addr && addrlen) {
+	sock_->Socket().RecvFrom(aBufferPtr_, aAddress_, flags, iStatus);
+    } else {
+	aAddress_.SetAddress(0);
+	aAddress_.SetPort(0);
+	sock_->Socket().Recv(aBufferPtr_, flags, iStatus);
+    }
+
+    if (iStatus==KRequestPending) {
+	SetActive();
+	return PJ_EPENDING;
+    } else {
+	return PJ_RETURN_OS_ERROR(iStatus.Int());
+    }
+}
+
+
+//
+// Start asynchronous accept() operation.
+//
+pj_status_t CIoqueueCallback::StartAccept(pj_ioqueue_op_key_t *op_key,
+					  pj_sock_t *new_sock,
+					  pj_sockaddr_t *local,
+					  pj_sockaddr_t *remote,
+					  int *addrlen )
+{
+    PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY);
+    PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY);
+
+    pending_data_.accept_.op_key_ = op_key;
+    pending_data_.accept_.new_sock_ = new_sock;
+    pending_data_.accept_.local_ = local;
+    pending_data_.accept_.remote_ = remote;
+    pending_data_.accept_.addrlen_ = addrlen;
+
+    // Create blank socket
+    blank_sock_.Open(PjSymbianOS::Instance()->SocketServ());
+
+    type_ = TYPE_ACCEPT;
+    sock_->Socket().Accept(blank_sock_, iStatus);
+
+    if (iStatus==KRequestPending) {
+	SetActive();
+	return PJ_EPENDING;
+    } else {
+	return PJ_RETURN_OS_ERROR(iStatus.Int());
+    }
+}
+
+
+//
+// Completion callback.
+//
+void CIoqueueCallback::RunL()
+{
+    Type cur_type = type_;
+
+    type_ = TYPE_NONE;
+
+    if (cur_type == TYPE_READ) {
+	//
+	// Completion of asynchronous RecvFrom()
+	//
+
+	/* Clear op_key (save it to temp variable first!) */
+	pj_ioqueue_op_key_t	*op_key = pending_data_.read_.op_key_;
+	pending_data_.read_.op_key_ = NULL;
+
+	// Handle failure condition
+	if (iStatus != KErrNone) {
+	    cb_->on_read_complete(key_, op_key, 
+				  -PJ_RETURN_OS_ERROR(iStatus.Int()));
+	    return;
+	}
+
+	if (pending_data_.read_.addr_) {
+	    PjSymbianOS::Addr2pj(aAddress_, 
+				 *(pj_sockaddr_in*)pending_data_.read_.addr_);
+	    pending_data_.read_.addr_ = NULL;
+	}
+	if (pending_data_.read_.addrlen_) {
+	    *pending_data_.read_.addrlen_ = sizeof(pj_sockaddr_in);
+	    pending_data_.read_.addrlen_ = NULL;
+	}
+
+	/* Call callback */
+	cb_->on_read_complete(key_, op_key, aBufferPtr_.Length());
+
+    } else if (cur_type == TYPE_ACCEPT) {
+	//
+	// Completion of asynchronous Accept()
+	//
+	
+	/* Clear op_key (save it to temp variable first!) */
+	pj_ioqueue_op_key_t	*op_key = pending_data_.read_.op_key_;
+	pending_data_.read_.op_key_ = NULL;
+
+	// Handle failure condition
+	if (iStatus != KErrNone) {
+	    if (pending_data_.accept_.new_sock_)
+		*pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET;
+
+	    cb_->on_accept_complete(key_, op_key, PJ_INVALID_SOCKET,
+				    -PJ_RETURN_OS_ERROR(iStatus.Int()));
+	    return;
+	}
+
+	CPjSocket *pjNewSock = new CPjSocket(blank_sock_);
+
+	if (pending_data_.accept_.new_sock_) {
+	    *pending_data_.accept_.new_sock_ = (pj_sock_t)pjNewSock;
+	    pending_data_.accept_.new_sock_ = NULL;
+	}
+
+	if (pending_data_.accept_.local_) {
+	    TInetAddr aAddr;
+	    pj_sockaddr_in *ptr_sockaddr;
+
+	    blank_sock_.LocalName(aAddr);
+	    ptr_sockaddr = (pj_sockaddr_in*)pending_data_.accept_.local_;
+	    PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr);
+	    pending_data_.accept_.local_ = NULL;
+	}
+
+	if (pending_data_.accept_.remote_) {
+	    TInetAddr aAddr;
+	    pj_sockaddr_in *ptr_sockaddr;
+
+	    blank_sock_.RemoteName(aAddr);
+	    ptr_sockaddr = (pj_sockaddr_in*)pending_data_.accept_.remote_;
+	    PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr);
+	    pending_data_.accept_.remote_ = NULL;
+	}
+
+	if (pending_data_.accept_.addrlen_) {
+	    *pending_data_.accept_.addrlen_ = sizeof(pj_sockaddr_in);
+	    pending_data_.accept_.addrlen_ = NULL;
+	}
+
+	// Call callback.
+	cb_->on_accept_complete(key_, op_key, (pj_sock_t)pjNewSock, 
+				PJ_SUCCESS);
+    }
+
+    ioqueue_->eventCount++;
+}
+
+//
+// CActive's DoCancel()
+//
+void CIoqueueCallback::DoCancel()
+{
+    if (type_ == TYPE_READ)
+	sock_->Socket().CancelRecv();
+    else if (type_ == TYPE_ACCEPT)
+	sock_->Socket().CancelAccept();
+
+    type_ = TYPE_NONE;
+}
+
+//
+// Cancel operation and call callback.
+//
+void CIoqueueCallback::CancelOperation(pj_ioqueue_op_key_t *op_key, 
+				       pj_ssize_t bytes_status)
+{
+    Type cur_type = type_;
+
+    Cancel();
+
+    if (cur_type == TYPE_READ)
+	cb_->on_read_complete(key_, op_key, bytes_status);
+    else if (cur_type == TYPE_ACCEPT)
+	;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
 /*
  * IO Queue key structure.
@@ -376,6 +461,6 @@
     pj_ioqueue_key_t *key;
 
-    key = (pj_ioqueue_key_t*) pj_pool_alloc(pool, sizeof(pj_ioqueue_key_t));
-    key->cbObj = new CIoqueueCallback(ioq, key, sock, cb, user_data);
+    key = (pj_ioqueue_key_t*) pj_pool_zalloc(pool, sizeof(pj_ioqueue_key_t));
+    key->cbObj = CIoqueueCallback::NewL(ioq, key, sock, cb, user_data);
 
     *p_key = key;
@@ -390,4 +475,9 @@
     if (key == NULL || key->cbObj == NULL)
 	return PJ_SUCCESS;
+
+    // Cancel pending async object
+    if (key->cbObj && key->cbObj->IsActive()) {
+	key->cbObj->Cancel();
+    }
 
     // Close socket.
@@ -395,7 +485,9 @@
     delete key->cbObj->get_pj_socket();
 
-    // Delete async object
-    delete key->cbObj;
-    key->cbObj = NULL;
+    // Delete async object.
+    if (key->cbObj) {
+	delete key->cbObj;
+	key->cbObj = NULL;
+    }
 
     return PJ_SUCCESS;
@@ -519,5 +611,6 @@
 
     if (timeout) {
-	if (!ioq->timeoutTimer->IsActive())
+	//if (!ioq->timeoutTimer->IsActive())
+	if (0)
 	    timer = ioq->timeoutTimer;
 	else
@@ -534,10 +627,10 @@
     do {
 	PjSymbianOS::Instance()->WaitForActiveObjects();
-    } while (ioq->eventCount == 0 && !timer->HasTimedOut());
-
-    if (!timer->HasTimedOut())
+    } while (ioq->eventCount == 0 && (!timer || (timer && !timer->HasTimedOut())));
+
+    if (timer && !timer->HasTimedOut())
 	timer->Cancel();
 
-    if (timer != ioq->timeoutTimer)
+    if (timer && timer != ioq->timeoutTimer)
 	delete timer;
 
@@ -555,5 +648,7 @@
 				     pj_uint32_t flags )
 {
-    return pj_ioqueue_recvfrom(key, op_key, buffer, length, flags, NULL, NULL);
+    // Clear flag
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
+    return key->cbObj->StartRead(op_key, buffer, length, flags, NULL, NULL);
 }
 
@@ -575,4 +670,6 @@
 	return PJ_EBUSY;
 
+    // Clear flag
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
     return key->cbObj->StartRead(op_key, buffer, length, flags, addr, addrlen);
 }
@@ -597,4 +694,7 @@
     PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL);
 
+    // Clear flag
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
+
     key->cbObj->get_pj_socket()->Socket().Send(aBuffer, flags, reqStatus, aLen);
     User::WaitForRequest(reqStatus);
@@ -603,5 +703,7 @@
 	return PJ_RETURN_OS_ERROR(reqStatus.Int());
 
-    *length = aLen.Length();
+    //At least in UIQ Emulator, aLen.Length() reports incorrect length
+    //for UDP (some newlc.com users seem to have reported this too).
+    //*length = aLen.Length();
     return PJ_SUCCESS;
 }
@@ -632,9 +734,12 @@
     PJ_ASSERT_RETURN(addrlen == sizeof(pj_sockaddr_in), PJ_EINVAL);
 
+    // Clear flag
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
+
     aBuffer.Set((const TUint8*)data, (TInt)*length);
     PjSymbianOS::pj2Addr(*(const pj_sockaddr_in*)addr, inetAddr);
     CPjSocket *pjSock = key->cbObj->get_pj_socket();
 
-    pjSock->Socket().Send(aBuffer, flags, reqStatus, aLen);
+    pjSock->Socket().SendTo(aBuffer, inetAddr, flags, reqStatus, aLen);
     User::WaitForRequest(reqStatus);
 
@@ -642,6 +747,8 @@
 	return PJ_RETURN_OS_ERROR(reqStatus.Int());
 
-    *length = aLen.Length();
-    return PJ_SUCCESS;
-}
-
+    //At least in UIQ Emulator, aLen.Length() reports incorrect length
+    //for UDP (some newlc.com users seem to have reported this too).
+    //*length = aLen.Length();
+    return PJ_SUCCESS;
+}
+
Index: /pjproject/branches/symbian/pjlib/src/pj/lock.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/lock.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/lock.c	(revision 789)
@@ -64,5 +64,5 @@
     PJ_ASSERT_RETURN(pool && lock, PJ_EINVAL);
 
-    p_lock = pj_pool_alloc(pool, sizeof(pj_lock_t));
+    p_lock = (pj_lock_t*) pj_pool_alloc(pool, sizeof(pj_lock_t));
     if (!p_lock)
 	return PJ_ENOMEM;
@@ -150,5 +150,5 @@
     PJ_ASSERT_RETURN(pool && lock, PJ_EINVAL);
 
-    p_lock = pj_pool_alloc(pool, sizeof(pj_lock_t));
+    p_lock = (pj_lock_t*) pj_pool_alloc(pool, sizeof(pj_lock_t));
     if (!p_lock)
 	return PJ_ENOMEM;
Index: /pjproject/branches/symbian/pjlib/src/pj/os_core_symbian.cpp
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/os_core_symbian.cpp	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/os_core_symbian.cpp	(revision 789)
@@ -47,4 +47,12 @@
     void	   *tls_values[PJ_MAX_TLS];
 
+#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0
+    pj_uint32_t	    stk_size;
+    pj_uint32_t	    stk_max_usage;
+    char	   *stk_start;
+    const char	   *caller_file;
+    int		    caller_line;
+#endif
+
 } main_thread;
 
@@ -54,4 +62,9 @@
 };
 
+struct pj_sem_t
+{
+    int value;
+    int max;
+};
 
 /* Flags to indicate which TLS variables have been used */
@@ -67,5 +80,5 @@
 
 CPjTimeoutTimer::CPjTimeoutTimer()
-: CActive(EPriorityNormal), hasTimedOut_(false)
+: CActive(EPriorityNormal), hasTimedOut_(PJ_FALSE)
 {
 }
@@ -80,4 +93,5 @@
 void CPjTimeoutTimer::ConstructL()
 {
+    hasTimedOut_ = PJ_FALSE;
     timer_.CreateLocal();
     CActiveScheduler::Add(this);
@@ -86,5 +100,5 @@
 CPjTimeoutTimer *CPjTimeoutTimer::NewL()
 {
-    CPjTimeoutTimer *self = new (ELeave) CPjTimeoutTimer;
+    CPjTimeoutTimer *self = new CPjTimeoutTimer;
     CleanupStack::PushL(self);
 
@@ -101,17 +115,19 @@
 	Cancel();
 
-    hasTimedOut_ = false;
+    hasTimedOut_ = PJ_FALSE;
     timer_.After(iStatus, miliSeconds * 1000);
     SetActive();
+
+    pj_assert(iStatus==KRequestPending);
 }
 
 bool CPjTimeoutTimer::HasTimedOut() const
 {
-    return hasTimedOut_;
+    return hasTimedOut_ != 0;
 }
 
 void CPjTimeoutTimer::RunL()
 {
-    hasTimedOut_ = true;
+    hasTimedOut_ = PJ_TRUE;
 }
 
@@ -252,4 +268,7 @@
 {
     pj_ansi_strcpy(main_thread.obj_name, "pjthread");
+
+    // Init main thread
+    pj_memset(&main_thread, 0, sizeof(main_thread));
 
     // Initialize PjSymbianOS instance
@@ -365,5 +384,11 @@
 PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec)
 {
+    //Not a good idea, as we don't want network events to
+    //arrive while we're not polling them:
+    //PjSymbianOS::Instance()->WaitForActiveObjects();
+
+    //.. so rather use this, which won't wake up Active Objects:
     User::After(msec*1000);
+
     return PJ_SUCCESS;
 }
@@ -642,55 +667,118 @@
 				   unsigned initial, 
                                    unsigned max,
-				   pj_sem_t **sem)
-{
-    PJ_UNUSED_ARG(pool);
+				   pj_sem_t **p_sem)
+{
+    pj_sem_t *sem;
+ 
     PJ_UNUSED_ARG(name);
-    PJ_UNUSED_ARG(initial);
-    PJ_UNUSED_ARG(max);
+
+    sem = (pj_sem_t*) pj_pool_zalloc(pool, sizeof(pj_sem_t));
+    sem->value = initial;
+    sem->max = max;
+
+    *p_sem = sem;
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Wait for semaphore.
+ */
+PJ_DEF(pj_status_t) pj_sem_wait(pj_sem_t *sem)
+{
+    if (sem->value > 0) {
+	sem->value--;
+	return PJ_SUCCESS;
+    } else {
+	pj_assert(!"Unexpected!");
+	return PJ_EINVALIDOP;
+    }
+}
+
+
+/*
+ * Try wait for semaphore.
+ */
+PJ_DEF(pj_status_t) pj_sem_trywait(pj_sem_t *sem)
+{
+    if (sem->value > 0) {
+	sem->value--;
+	return PJ_SUCCESS;
+    } else {
+	pj_assert(!"Unexpected!");
+	return PJ_EINVALIDOP;
+    }
+}
+
+
+/*
+ * Release semaphore.
+ */
+PJ_DEF(pj_status_t) pj_sem_post(pj_sem_t *sem)
+{
+    sem->value++;
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Destroy semaphore.
+ */
+PJ_DEF(pj_status_t) pj_sem_destroy(pj_sem_t *sem)
+{
     PJ_UNUSED_ARG(sem);
-
-    /* Unsupported */
-    return PJ_ENOTSUP;
-}
-
-
-/*
- * Wait for semaphore.
- */
-PJ_DEF(pj_status_t) pj_sem_wait(pj_sem_t *sem)
-{
-    PJ_UNUSED_ARG(sem);
-    return PJ_EINVALIDOP;
-}
-
-
-/*
- * Try wait for semaphore.
- */
-PJ_DEF(pj_status_t) pj_sem_trywait(pj_sem_t *sem)
-{
-    PJ_UNUSED_ARG(sem);
-    return PJ_EINVALIDOP;
-}
-
-
-/*
- * Release semaphore.
- */
-PJ_DEF(pj_status_t) pj_sem_post(pj_sem_t *sem)
-{
-    PJ_UNUSED_ARG(sem);
-    return PJ_EINVALIDOP;
-}
-
-
-/*
- * Destroy semaphore.
- */
-PJ_DEF(pj_status_t) pj_sem_destroy(pj_sem_t *sem)
-{
-    PJ_UNUSED_ARG(sem);
-    return PJ_EINVALIDOP;
-}
-
-
+    return PJ_SUCCESS;
+}
+
+
+#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK != 0
+/*
+ * The implementation of stack checking. 
+ */
+PJ_DEF(void) pj_thread_check_stack(const char *file, int line)
+{
+    char stk_ptr;
+    pj_uint32_t usage;
+    pj_thread_t *thread = pj_thread_this();
+
+    pj_assert(thread);
+
+    /* Calculate current usage. */
+    usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start :
+		thread->stk_start - &stk_ptr;
+
+    /* Assert if stack usage is dangerously high. */
+    pj_assert("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128));
+
+    /* Keep statistic. */
+    if (usage > thread->stk_max_usage) {
+	thread->stk_max_usage = usage;
+	thread->caller_file = file;
+	thread->caller_line = line;
+    }
+}
+
+/*
+ * Get maximum stack usage statistic. 
+ */
+PJ_DEF(pj_uint32_t) pj_thread_get_stack_max_usage(pj_thread_t *thread)
+{
+    return thread->stk_max_usage;
+}
+
+/*
+ * Dump thread stack status. 
+ */
+PJ_DEF(pj_status_t) pj_thread_get_stack_info(pj_thread_t *thread,
+					     const char **file,
+					     int *line)
+{
+    pj_assert(thread);
+
+    *file = thread->caller_file;
+    *line = thread->caller_line;
+    return 0;
+}
+
+#endif	/* PJ_OS_HAS_CHECK_STACK */
Index: /pjproject/branches/symbian/pjlib/src/pj/os_error_symbian.cpp
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/os_error_symbian.cpp	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/os_error_symbian.cpp	(revision 789)
@@ -117,6 +117,9 @@
 }
 
-extern "C" int platform_strerror( pj_os_err_type os_errcode, 
-                       		  char *buf, pj_size_t bufsize);
+extern "C" 
+{
+    PJ_DECL(int) platform_strerror( pj_os_err_type os_errcode, 
+                       		    char *buf, pj_size_t bufsize);
+}
 
 /* 
@@ -126,6 +129,6 @@
  * in errno.c 
  */
-int platform_strerror( pj_os_err_type os_errcode, 
-                       char *buf, pj_size_t bufsize)
+PJ_DEF(int) platform_strerror( pj_os_err_type os_errcode, 
+			       char *buf, pj_size_t bufsize)
 {
     int len = 0;
Index: /pjproject/branches/symbian/pjlib/src/pj/os_symbian.h
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/os_symbian.h	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/os_symbian.h	(revision 789)
@@ -167,6 +167,6 @@
 
 private:
-    RTimer timer_;
-    bool   hasTimedOut_;
+    RTimer	timer_;
+    pj_bool_t	hasTimedOut_;
 
     CPjTimeoutTimer();
@@ -279,4 +279,5 @@
     {
 	TInt aError;
+	User::WaitForAnyRequest();
 	CActiveScheduler::RunIfReady(aError, aPriority);
     }
@@ -295,5 +296,4 @@
 private:
     PjSymbianOS();
-    
 };
 
Index: /pjproject/branches/symbian/pjlib/src/pj/pool.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/pool.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/pool.c	(revision 789)
@@ -178,5 +178,5 @@
 
     /* Allocate initial block */
-    buffer = (*f->policy.block_alloc)(f, initial_size);
+    buffer = (unsigned char*) (*f->policy.block_alloc)(f, initial_size);
     if (!buffer)
 	return NULL;
Index: /pjproject/branches/symbian/pjlib/src/pj/pool_caching.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/pool_caching.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/pool_caching.c	(revision 789)
@@ -74,5 +74,5 @@
     /* Delete all pool in free list */
     for (i=0; i < PJ_CACHING_POOL_ARRAY_SIZE; ++i) {
-	pj_pool_t *pool = cp->free_list[i].next;
+	pj_pool_t *pool = (pj_pool_t*)cp->free_list[i].next;
 	pj_pool_t *next;
 	for (; pool != (void*)&cp->free_list[i]; pool = next) {
@@ -84,5 +84,5 @@
 
     /* Delete all pools in used list */
-    pool = cp->used_list.next;
+    pool = (pj_pool_t*)cp->used_list.next;
     while (pool != (pj_pool_t*) &cp->used_list) {
 	pj_pool_t *next = pool->next;
@@ -141,5 +141,5 @@
     } else {
 	/* Get one pool from the list. */
-	pool = cp->free_list[idx].next;
+	pool = (pj_pool_t*) cp->free_list[idx].next;
 	pj_list_erase(pool);
 
@@ -230,5 +230,5 @@
 			     cp->capacity, cp->max_capacity, cp->used_count));
     if (detail) {
-	pj_pool_t *pool = cp->used_list.next;
+	pj_pool_t *pool = (pj_pool_t*) cp->used_list.next;
 	pj_uint32_t total_used = 0, total_capacity = 0;
         PJ_LOG(3,("cachpool", "  Dumping all active pools:"));
Index: /pjproject/branches/symbian/pjlib/src/pj/sock_symbian.cpp
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/sock_symbian.cpp	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/sock_symbian.cpp	(revision 789)
@@ -567,7 +567,4 @@
     RSocket &rSock = pjSock->Socket();
 
-    // Socket must be connected.
-    PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP);
-
     TInetAddr inetAddr;
     rSock.LocalName(inetAddr);
Index: /pjproject/branches/symbian/pjlib/src/pj/timer.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/timer.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pj/timer.c	(revision 789)
@@ -245,5 +245,5 @@
     pj_timer_entry **new_heap = 0;
     
-    new_heap = pj_pool_alloc(ht->pool, sizeof(pj_timer_entry*) * new_size);
+    new_heap = (pj_timer_entry **) pj_pool_alloc(ht->pool, sizeof(pj_timer_entry*) * new_size);
     memcpy(new_heap, ht->heap, ht->max_size * sizeof(pj_timer_entry*));
     //delete [] this->heap_;
@@ -253,5 +253,5 @@
     
     new_timer_ids = 0;
-    new_timer_ids = pj_pool_alloc(ht->pool, new_size * sizeof(pj_timer_id_t));
+    new_timer_ids = (pj_timer_id_t*) pj_pool_alloc(ht->pool, new_size * sizeof(pj_timer_id_t));
     
     memcpy( new_timer_ids, ht->timer_ids, ht->max_size * sizeof(pj_timer_id_t));
@@ -360,5 +360,5 @@
 
     /* Allocate timer heap data structure from the pool */
-    ht = pj_pool_alloc(pool, sizeof(pj_timer_heap_t));
+    ht = (pj_timer_heap_t*) pj_pool_alloc(pool, sizeof(pj_timer_heap_t));
     if (!ht)
         return PJ_ENOMEM;
@@ -376,10 +376,10 @@
 
     // Create the heap array.
-    ht->heap = pj_pool_alloc(pool, sizeof(pj_timer_entry*) * size);
+    ht->heap = (pj_timer_entry **) pj_pool_alloc(pool, sizeof(pj_timer_entry*) * size);
     if (!ht->heap)
         return PJ_ENOMEM;
 
     // Create the parallel
-    ht->timer_ids = pj_pool_alloc( pool, sizeof(pj_timer_id_t) * size);
+    ht->timer_ids = (pj_timer_id_t*) pj_pool_alloc( pool, sizeof(pj_timer_id_t) * size);
     if (!ht->timer_ids)
         return PJ_ENOMEM;
Index: /pjproject/branches/symbian/pjlib/src/pjlib-test/atomic.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pjlib-test/atomic.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pjlib-test/atomic.c	(revision 789)
@@ -19,4 +19,5 @@
 #include "test.h"
 #include <pj/os.h>
+#include <pj/pool.h>
 
 /**
Index: /pjproject/branches/symbian/pjlib/src/pjlib-test/ioq_tcp.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pjlib-test/ioq_tcp.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pjlib-test/ioq_tcp.c	(revision 789)
@@ -18,4 +18,5 @@
  */
 #include "test.h"
+#include <pj/os.h>
 
 /**
@@ -414,6 +415,6 @@
     pj_pool_release(pool);
     return status;
-
-}
+}
+
 
 /*
Index: /pjproject/branches/symbian/pjlib/src/pjlib-test/main_symbian.cpp
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pjlib-test/main_symbian.cpp	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pjlib-test/main_symbian.cpp	(revision 789)
@@ -52,5 +52,9 @@
     // add your program code here, example code below
     //
-    test_main();
+    int rc = test_main();
+
+    console->Printf(_L(" [press any key]\n"));
+    console->Getch();
+
     CActiveScheduler::Stop();
 }
@@ -142,9 +146,4 @@
 
     CActiveScheduler::Start();
-
-    // Delete active scheduler
-    //CActiveScheduler::Install(NULL);
-    scheduler->Stop();
-    //delete scheduler;
     }
 
Index: /pjproject/branches/symbian/pjlib/src/pjlib-test/string_test.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pjlib-test/string_test.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pjlib-test/string_test.c	(revision 789)
@@ -236,4 +236,5 @@
     }
 
+    if (c2 == 0) c2 = 1;
     PJ_LOG(3, ("", "  time: stricmp=%u, stricmp_alnum=%u (speedup=%d.%02dx)", 
 		   c1, c2,
Index: /pjproject/branches/symbian/pjlib/src/pjlib-test/test.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pjlib-test/test.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pjlib-test/test.c	(revision 789)
@@ -44,6 +44,5 @@
 const char *param_echo_server = ECHO_SERVER_ADDRESS;
 int param_echo_port = ECHO_SERVER_START_PORT;
-int param_log_decor = PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | 
-		      PJ_LOG_HAS_MICRO_SEC;
+int param_log_decor = PJ_LOG_HAS_NEWLINE;
 
 int null_func()
@@ -186,5 +185,5 @@
     pj_caching_pool_destroy( &caching_pool );
 
-    PJ_LOG(3,("test", ""));
+    PJ_LOG(3,("test", " "));
  
     pj_thread_get_stack_info(pj_thread_this(), &filename, &line);
Index: /pjproject/branches/symbian/pjlib/src/pjlib-test/test.h
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pjlib-test/test.h	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pjlib-test/test.h	(revision 789)
@@ -22,7 +22,7 @@
 #include <pj/types.h>
 
-#define GROUP_LIBC                  0
-#define GROUP_OS                    0
-#define GROUP_DATA_STRUCTURE        0
+#define GROUP_LIBC                  1
+#define GROUP_OS                    1
+#define GROUP_DATA_STRUCTURE        1
 #define GROUP_NETWORK               1
 #define GROUP_FILE                  0
@@ -34,7 +34,7 @@
 #define INCLUDE_LIST_TEST	    GROUP_DATA_STRUCTURE
 #define INCLUDE_POOL_TEST	    GROUP_LIBC
-#define INCLUDE_POOL_PERF_TEST	    0	// (PJ_HAS_MALLOC && GROUP_LIBC)
-#define INCLUDE_STRING_TEST	    0	// GROUP_DATA_STRUCTURE
-#define INCLUDE_FIFOBUF_TEST	    0	// GROUP_DATA_STRUCTURE
+#define INCLUDE_POOL_PERF_TEST	    (PJ_HAS_MALLOC && GROUP_LIBC)
+#define INCLUDE_STRING_TEST	    GROUP_DATA_STRUCTURE
+#define INCLUDE_FIFOBUF_TEST	    GROUP_DATA_STRUCTURE
 #define INCLUDE_RBTREE_TEST	    GROUP_DATA_STRUCTURE
 #define INCLUDE_TIMER_TEST	    GROUP_DATA_STRUCTURE
@@ -43,10 +43,10 @@
 #define INCLUDE_SLEEP_TEST          GROUP_OS
 #define INCLUDE_THREAD_TEST         (PJ_HAS_THREADS && GROUP_OS)
-#define INCLUDE_SOCK_TEST	    0 	// GROUP_NETWORK
-#define INCLUDE_SOCK_PERF_TEST      0	// GROUP_NETWORK
-#define INCLUDE_SELECT_TEST	    0	// GROUP_NETWORK
+#define INCLUDE_SOCK_TEST	    GROUP_NETWORK
+#define INCLUDE_SOCK_PERF_TEST      GROUP_NETWORK
+#define INCLUDE_SELECT_TEST	    GROUP_NETWORK
 #define INCLUDE_UDP_IOQUEUE_TEST    GROUP_NETWORK
 #define INCLUDE_TCP_IOQUEUE_TEST    GROUP_NETWORK
-#define INCLUDE_IOQUEUE_PERF_TEST   GROUP_NETWORK
+#define INCLUDE_IOQUEUE_PERF_TEST   (PJ_HAS_THREADS && GROUP_NETWORK)
 #define INCLUDE_IOQUEUE_UNREG_TEST  0	// GROUP_NETWORK
 #define INCLUDE_FILE_TEST           GROUP_FILE
Index: /pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c	(revision 789)
@@ -19,6 +19,8 @@
 #include <pj/errno.h>
 #include <pj/ioqueue.h>
+#include <pj/os.h>
 #include <pj/pool.h>
 #include <pj/sock.h>
+#include <pj/string.h>
 #include "test.h"
 
Index: /pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_sync.c
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_sync.c	(revision 788)
+++ /pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_sync.c	(revision 789)
@@ -20,4 +20,5 @@
 #include <pj/errno.h>
 #include <pj/ioqueue.h>
+#include <pj/log.h>
 #include <pj/os.h>
 #include <pj/pool.h>
Index: /pjproject/branches/symbian/pjmedia/include/pjmedia/config.h
===================================================================
--- /pjproject/branches/symbian/pjmedia/include/pjmedia/config.h	(revision 788)
+++ /pjproject/branches/symbian/pjmedia/include/pjmedia/config.h	(revision 789)
@@ -37,4 +37,6 @@
 #  if defined(PJ_WIN32) && PJ_WIN32!=0
 #   define PJMEDIA_SOUND_IMPLEMENTATION	    PJMEDIA_SOUND_WIN32_DIRECT_SOUND
+#  elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+#   define PJMEDIA_SOUND_IMPLEMENTATION	    PJMEDIA_SOUND_NULL_SOUND
 #  else
 #   define PJMEDIA_SOUND_IMPLEMENTATION	    PJMEDIA_SOUND_PORTAUDIO_SOUND
Index: /pjproject/branches/symbian/pjmedia/src/pjmedia/errno.c
===================================================================
--- /pjproject/branches/symbian/pjmedia/src/pjmedia/errno.c	(revision 788)
+++ /pjproject/branches/symbian/pjmedia/src/pjmedia/errno.c	(revision 789)
@@ -20,5 +20,8 @@
 #include <pjmedia/types.h>
 #include <pj/string.h>
-#include <portaudio.h>
+
+#if PJMEDIA_SOUND_IMPLEMENTATION==PJMEDIA_SOUND_PORTAUDIO_SOUND
+#   include <portaudio.h>
+#endif
 
 
Index: /pjproject/branches/symbian/pjmedia/src/pjmedia/sdp.c
===================================================================
--- /pjproject/branches/symbian/pjmedia/src/pjmedia/sdp.c	(revision 788)
+++ /pjproject/branches/symbian/pjmedia/src/pjmedia/sdp.c	(revision 789)
@@ -93,5 +93,5 @@
     PJ_ASSERT_RETURN(pool && name, NULL);
 
-    attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = (pjmedia_sdp_attr*) pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
     pj_strdup2(pool, &attr->name, name);
 
@@ -113,5 +113,5 @@
     PJ_ASSERT_RETURN(pool && rhs, NULL);
 
-    attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = (pjmedia_sdp_attr*) pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
 
     pj_strdup(pool, &attr->name, &rhs->name);
@@ -365,5 +365,5 @@
     PJ_ASSERT_RETURN(pool && attr && p_rtpmap, PJ_EINVAL);
 
-    *p_rtpmap = pj_pool_alloc(pool, sizeof(pjmedia_sdp_rtpmap));
+    *p_rtpmap = (pjmedia_sdp_rtpmap*) pj_pool_alloc(pool, sizeof(pjmedia_sdp_rtpmap));
     PJ_ASSERT_RETURN(*p_rtpmap, PJ_ENOMEM);
 
@@ -394,5 +394,5 @@
     }
 
-    attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = (pjmedia_sdp_attr*) pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
     PJ_ASSERT_RETURN(attr != NULL, PJ_ENOMEM);
 
@@ -431,5 +431,5 @@
 
     attr->value.slen = p-tempbuf;
-    attr->value.ptr = pj_pool_alloc(pool, attr->value.slen);
+    attr->value.ptr = (char*)pj_pool_alloc(pool, attr->value.slen);
     pj_memcpy(attr->value.ptr, tempbuf, attr->value.slen);
 
@@ -465,5 +465,5 @@
 						  const pjmedia_sdp_conn *rhs)
 {
-    pjmedia_sdp_conn *c = pj_pool_alloc (pool, sizeof(pjmedia_sdp_conn));
+    pjmedia_sdp_conn *c = (pjmedia_sdp_conn*) pj_pool_alloc (pool, sizeof(pjmedia_sdp_conn));
     if (!c) return NULL;
 
@@ -559,5 +559,5 @@
 {
     unsigned int i;
-    pjmedia_sdp_media *m = pj_pool_alloc (pool, sizeof(pjmedia_sdp_media));
+    pjmedia_sdp_media *m = (pjmedia_sdp_media*) pj_pool_alloc (pool, sizeof(pjmedia_sdp_media));
     PJ_ASSERT_RETURN(m != NULL, NULL);
 
@@ -896,5 +896,5 @@
     ctx->last_error = PJMEDIA_SDP_EINATTR;
 
-    attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+    attr = (pjmedia_sdp_attr*)pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
 
     /* skip a= */
@@ -928,5 +928,5 @@
     pjmedia_sdp_session *session;
     pjmedia_sdp_media *media = NULL;
-    void *attr;
+    pjmedia_sdp_attr *attr;
     pjmedia_sdp_conn *conn;
     pj_str_t dummy;
@@ -940,5 +940,5 @@
 
     pj_scan_init(&scanner, buf, len, 0, &on_scanner_error);
-    session = pj_pool_calloc(pool, 1, sizeof(pjmedia_sdp_session));
+    session = (pjmedia_sdp_session*)pj_pool_calloc(pool, 1, sizeof(pjmedia_sdp_session));
     PJ_ASSERT_RETURN(session != NULL, PJ_ENOMEM);
 
@@ -964,5 +964,5 @@
 		    break;
 		case 'c':
-		    conn = pj_pool_calloc(pool, 1, sizeof(*conn));
+		    conn = (pjmedia_sdp_conn*) pj_pool_calloc(pool, 1, sizeof(*conn));
 		    parse_connection_info(&scanner, conn, &ctx);
 		    if (media) {
@@ -976,5 +976,5 @@
 		    break;
 		case 'm':
-		    media = pj_pool_calloc(pool, 1, sizeof(*media));
+		    media = (pjmedia_sdp_media*) pj_pool_calloc(pool, 1, sizeof(*media));
 		    parse_media(&scanner, media, &ctx);
 		    session->media[ session->media_count++ ] = media;
@@ -992,5 +992,5 @@
 
     }
-    PJ_CATCH(SYNTAX_ERROR) {
+    PJ_CATCH_ANY {
 	
 	char errmsg[PJ_ERR_MSG_SIZE];
@@ -1034,5 +1034,5 @@
     PJ_ASSERT_RETURN(pool && rhs, NULL);
 
-    sess = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_session));
+    sess = (pjmedia_sdp_session*)pj_pool_zalloc(pool, sizeof(pjmedia_sdp_session));
     PJ_ASSERT_RETURN(sess != NULL, NULL);
 
Index: /pjproject/branches/symbian/pjmedia/src/pjmedia/sdp_neg.c
===================================================================
--- /pjproject/branches/symbian/pjmedia/src/pjmedia/sdp_neg.c	(revision 788)
+++ /pjproject/branches/symbian/pjmedia/src/pjmedia/sdp_neg.c	(revision 789)
@@ -82,5 +82,5 @@
 
     /* Create and initialize negotiator. */
-    neg = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));
+    neg = (pjmedia_sdp_neg*) pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));
     PJ_ASSERT_RETURN(neg != NULL, PJ_ENOMEM);
 
@@ -116,5 +116,5 @@
 
     /* Create and initialize negotiator. */
-    neg = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));
+    neg = (pjmedia_sdp_neg*) pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));
     PJ_ASSERT_RETURN(neg != NULL, PJ_ENOMEM);
 
@@ -634,5 +634,5 @@
 		 */
 		const pjmedia_sdp_attr *a;
-		pjmedia_sdp_rtpmap or;
+		pjmedia_sdp_rtpmap ormt;
 		pj_bool_t is_codec;
 
@@ -644,7 +644,7 @@
 		    return PJ_FALSE;
 		}
-		pjmedia_sdp_attr_get_rtpmap(a, &or);
-
-		if (!pj_strcmp2(&or.enc_name, "telephone-event")) {
+		pjmedia_sdp_attr_get_rtpmap(a, &ormt);
+
+		if (!pj_strcmp2(&ormt.enc_name, "telephone-event")) {
 		    offer_has_telephone_event = 1;
 		    if (found_matching_telephone_event)
@@ -669,6 +669,6 @@
 
 			/* See if encoding name and clock rate match */
-			if (!pj_strcmp(&or.enc_name, &lr.enc_name) &&
-			    or.clock_rate == lr.clock_rate) 
+			if (!pj_strcmp(&ormt.enc_name, &lr.enc_name) &&
+			    ormt.clock_rate == lr.clock_rate) 
 			{
 			    /* Match! */
Index: /pjproject/branches/symbian/pjsip-apps/src/samples/main_symbian.cpp
===================================================================
--- /pjproject/branches/symbian/pjsip-apps/src/samples/main_symbian.cpp	(revision 789)
+++ /pjproject/branches/symbian/pjsip-apps/src/samples/main_symbian.cpp	(revision 789)
@@ -0,0 +1,172 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <e32std.h>
+#include <e32base.h>
+#include <e32std.h>
+#include <e32cons.h>            // Console
+
+/* PJLIB Unicode conversion */
+#include <pj/unicode.h>
+
+/* Log writing */
+#include <pj/log.h>
+
+
+/* This will be defined in application's code */
+extern "C"
+{
+	int pj_app_main(int argc, char *argv[]);
+}
+
+
+
+//  Global Variables
+
+LOCAL_D CConsoleBase* console;  // write all messages to this
+
+
+//  Local Functions
+
+LOCAL_C void MainL()
+{
+    //
+    // add your program code here, example code below
+    //
+    char *argv[] = { "main_symbian", NULL };
+    int rc = pj_app_main(1, argv);
+
+    console->Printf(_L(" [press any key]\n"));
+    console->Getch();
+
+    CActiveScheduler::Stop();
+}
+
+class MyScheduler : public CActiveScheduler
+{
+public:
+    MyScheduler()
+    {}
+
+    void Error(TInt aError) const;
+};
+
+void MyScheduler::Error(TInt aError) const
+{
+    int i = 0;
+}
+
+class ProgramStarter : public CActive
+{
+public:
+    static ProgramStarter *NewL();
+    void Start();
+
+protected:
+    ProgramStarter();
+    void ConstructL();
+    virtual void RunL();
+    virtual void DoCancel();
+    TInt RunError(TInt aError);
+
+private:
+    RTimer timer_;
+};
+
+ProgramStarter::ProgramStarter()
+: CActive(EPriorityNormal)
+{
+}
+
+void ProgramStarter::ConstructL()
+{
+    timer_.CreateLocal();
+    CActiveScheduler::Add(this);
+}
+
+ProgramStarter *ProgramStarter::NewL()
+{
+    ProgramStarter *self = new (ELeave) ProgramStarter;
+    CleanupStack::PushL(self);
+
+    self->ConstructL();
+
+    CleanupStack::Pop(self);
+    return self;
+}
+
+void ProgramStarter::Start()
+{
+    timer_.After(iStatus, 0);
+    SetActive();
+}
+
+void ProgramStarter::RunL()
+{
+    MainL();
+}
+
+void ProgramStarter::DoCancel()
+{
+}
+
+TInt ProgramStarter::RunError(TInt aError)
+{
+    PJ_UNUSED_ARG(aError);
+    return KErrNone;
+}
+
+
+LOCAL_C void DoStartL()
+{
+    // Create active scheduler (to run active objects)
+    CActiveScheduler* scheduler = new (ELeave) MyScheduler;
+    CleanupStack::PushL(scheduler);
+    CActiveScheduler::Install(scheduler);
+
+    ProgramStarter *starter = ProgramStarter::NewL();
+    starter->Start();
+
+    CActiveScheduler::Start();
+}
+
+
+//  Global Functions
+
+static void log_writer(int level, const char *buf, int len)
+{
+    wchar_t buf16[PJ_LOG_MAX_SIZE];
+
+    pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16));
+
+    TPtrC16 aBuf((const TUint16*)buf16, (TInt)len);
+    console->Write(aBuf);
+}
+
+
+GLDEF_C TInt E32Main()
+{
+    // Create cleanup stack
+    __UHEAP_MARK;
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+
+    // Create output console
+    TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen)));
+    if (createError)
+        return createError;
+
+    pj_log_set_log_func(&log_writer);
+
+    // Run application code inside TRAP harness, wait keypress when terminated
+    TRAPD(mainError, DoStartL());
+    if (mainError)
+        console->Printf(_L(" failed, leave code = %d"), mainError);
+    console->Printf(_L(" [press any key]\n"));
+    console->Getch();
+    
+    delete console;
+    delete cleanup;
+    __UHEAP_MARKEND;
+    return KErrNone;
+}
+
+
Index: /pjproject/branches/symbian/pjsip-apps/src/samples/sipstateless.c
===================================================================
--- /pjproject/branches/symbian/pjsip-apps/src/samples/sipstateless.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip-apps/src/samples/sipstateless.c	(revision 789)
@@ -32,4 +32,5 @@
 #include <pjlib-util.h>
 #include <pjlib.h>
+#include "../../../pjlib/src/pj/os_symbian.h"
 
 
@@ -62,9 +63,23 @@
 
 
+extern "C"
+{
+	int pj_app_main(int argc, char *argv[]);
+}
+
+
+static void app_perror(pj_status_t status)
+{
+    char errmsg[PJ_ERR_MSG_SIZE];
+    pj_strerror(status, errmsg, sizeof(errmsg));
+    PJ_LOG(1,("main", "Error: %s", errmsg));
+}
+
+
 /*
- * main()
+ * pj_app_main()
  *
  */
-int main()
+int pj_app_main(int argc, char *argv[])
 {
     pj_caching_pool cp;
@@ -93,5 +108,4 @@
     PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
 
-
     /* Then init PJLIB-UTIL: */
     status = pjlib_util_init();
@@ -99,5 +113,5 @@
 
     /* Must create a pool factory before we can allocate any memory. */
-    pj_caching_pool_init(&cp, &pj_pool_factory_default_policy, 0);
+    pj_caching_pool_init(&cp, pj_pool_factory_get_default_policy(), 0);
 
 
@@ -135,6 +149,9 @@
 	status = pjsip_udp_transport_start( sip_endpt, &addr, NULL, 1, NULL);
 	if (status != PJ_SUCCESS) {
+	    char errmsg[PJ_ERR_MSG_SIZE];
+
+	    pj_strerror(status, errmsg, sizeof(errmsg));
 	    PJ_LOG(3,(THIS_FILE, 
-		      "Error starting UDP transport (port in use?)"));
+		      "Error starting UDP transport: %s", errmsg));
 	    return 1;
 	}
Index: /pjproject/branches/symbian/pjsip/include/pjsip-ua/sip_inv.h
===================================================================
--- /pjproject/branches/symbian/pjsip/include/pjsip-ua/sip_inv.h	(revision 788)
+++ /pjproject/branches/symbian/pjsip/include/pjsip-ua/sip_inv.h	(revision 789)
@@ -27,5 +27,4 @@
 
 
-typedef enum pjsip_inv_state pjsip_inv_state;
 typedef struct pjsip_inv_session pjsip_inv_session;
 typedef struct pjsip_inv_callback pjsip_inv_callback;
@@ -34,5 +33,5 @@
  * This enumeration describes invite session state.
  */
-enum pjsip_inv_state
+typedef enum pjsip_inv_state
 {
     PJSIP_INV_STATE_NULL,	    /**< Before INVITE is sent or received  */
@@ -43,5 +42,5 @@
     PJSIP_INV_STATE_CONFIRMED,	    /**< After ACK is sent/received.	    */
     PJSIP_INV_STATE_DISCONNECTED,   /**< Session is terminated.		    */
-};
+} pjsip_inv_state;
 
 /**
Index: /pjproject/branches/symbian/pjsip/include/pjsip/print_util.h
===================================================================
--- /pjproject/branches/symbian/pjsip/include/pjsip/print_util.h	(revision 788)
+++ /pjproject/branches/symbian/pjsip/include/pjsip/print_util.h	(revision 789)
@@ -106,8 +106,8 @@
 PJ_INLINE(void) init_hdr(void *hptr, pjsip_hdr_e htype, void *vptr)
 {
-    pjsip_hdr *hdr = hptr;
+    pjsip_hdr *hdr = (pjsip_hdr*) hptr;
     hdr->type = htype;
     hdr->name = hdr->sname = pjsip_hdr_names[htype];
-    hdr->vptr = vptr;
+    hdr->vptr = (pjsip_hdr_vptr*) vptr;
     pj_list_init(hdr);
 }
Index: /pjproject/branches/symbian/pjsip/include/pjsip/sip_dialog.h
===================================================================
--- /pjproject/branches/symbian/pjsip/include/pjsip/sip_dialog.h	(revision 788)
+++ /pjproject/branches/symbian/pjsip/include/pjsip/sip_dialog.h	(revision 789)
@@ -53,9 +53,9 @@
  * Dialog state.
  */
-enum pjsip_dialog_state
+typedef enum pjsip_dialog_state
 {
     PJSIP_DIALOG_STATE_NULL,
     PJSIP_DIALOG_STATE_ESTABLISHED,
-};
+} pjsip_dialog_state;
 
 /**
Index: /pjproject/branches/symbian/pjsip/include/pjsip/sip_types.h
===================================================================
--- /pjproject/branches/symbian/pjsip/include/pjsip/sip_types.h	(revision 788)
+++ /pjproject/branches/symbian/pjsip/include/pjsip/sip_types.h	(revision 789)
@@ -140,9 +140,4 @@
 
 /**
- * Dialog state (sip_dialog.h).
- */
-typedef enum pjsip_dialog_state pjsip_dialog_state;
-
-/**
  * Transaction role.
  */
Index: /pjproject/branches/symbian/pjsip/src/pjsip-simple/evsub_msg.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip-simple/evsub_msg.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip-simple/evsub_msg.c	(revision 789)
@@ -22,5 +22,4 @@
 #include <pj/pool.h>
 #include <pj/string.h>
-#include <pj/except.h>
 
 /*
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_client.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_client.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_client.c	(revision 789)
@@ -213,5 +213,5 @@
     
     /* Allocate memory. */
-    cred->response.ptr = pj_pool_alloc(pool, PJSIP_MD5STRLEN);
+    cred->response.ptr = (char*)pj_pool_alloc(pool, PJSIP_MD5STRLEN);
     cred->response.slen = PJSIP_MD5STRLEN;
 
@@ -228,5 +228,5 @@
 	 */
 	cred->qop = pjsip_AUTH_STR;
-	cred->nc.ptr = pj_pool_alloc(pool, 16);
+	cred->nc.ptr = (char*)pj_pool_alloc(pool, 16);
 	pj_ansi_snprintf(cred->nc.ptr, 16, "%06u", nc);
 
@@ -266,5 +266,6 @@
     if (cached_auth->cnonce.slen == 0) {
 	/* Save the whole challenge */
-	cached_auth->last_chal = pjsip_hdr_clone(ses_pool, hdr);
+	cached_auth->last_chal = (pjsip_www_authenticate_hdr*)
+				  pjsip_hdr_clone(ses_pool, hdr);
 
 	/* Create cnonce */
@@ -366,5 +367,5 @@
     sess->endpt = (pjsip_endpoint*)rhs->endpt;
     sess->cred_cnt = rhs->cred_cnt;
-    sess->cred_info = pj_pool_alloc(pool, 
+    sess->cred_info = (pjsip_cred_info*) pj_pool_alloc(pool, 
 				    sess->cred_cnt*sizeof(pjsip_cred_info));
     for (i=0; i<rhs->cred_cnt; ++i) {
@@ -401,5 +402,6 @@
     } else {
 	int i;
-	sess->cred_info = pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c));
+	sess->cred_info = (pjsip_cred_info*)
+			  pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c));
 	for (i=0; i<cred_cnt; ++i) {
 	    sess->cred_info[i].data_type = c[i].data_type;
@@ -527,5 +529,6 @@
 		cached_hdr->hdr = hauth;
 	    } else {
-		cached_hdr = pj_pool_alloc(pool, sizeof(*cached_hdr));
+		cached_hdr = (pjsip_cached_auth_hdr*)
+			     pj_pool_alloc(pool, sizeof(*cached_hdr));
 		pjsip_method_copy( pool, &cached_hdr->method, method);
 		cached_hdr->hdr = hauth;
@@ -536,5 +539,6 @@
 #	if defined(PJSIP_AUTH_AUTO_SEND_NEXT) && PJSIP_AUTH_AUTO_SEND_NEXT!=0
 	    if (hdr != cached_auth->last_chal) {
-		cached_auth->last_chal = pjsip_hdr_clone(sess_pool, hdr);
+		cached_auth->last_chal = (pjsip_www_authenticate_hdr*)
+					  pjsip_hdr_clone(sess_pool, hdr);
 	    }
 #	endif
@@ -609,5 +613,6 @@
 		    if (pjsip_method_cmp(&entry->method, method)==0) {
 			pjsip_authorization_hdr *hauth;
-			hauth = pjsip_hdr_shallow_clone(tdata->pool, entry->hdr);
+			hauth=(pjsip_authorization_hdr*) 
+			      pjsip_hdr_shallow_clone(tdata->pool, entry->hdr);
 			pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)hauth);
 		    } else {
@@ -795,5 +800,6 @@
 	cached_auth = find_cached_auth(sess, &hchal->challenge.common.realm );
 	if (!cached_auth) {
-	    cached_auth = pj_pool_zalloc( sess->pool, sizeof(*cached_auth));
+	    cached_auth = (pjsip_cached_auth *)
+			  pj_pool_zalloc( sess->pool, sizeof(*cached_auth));
 	    pj_strdup( sess->pool, &cached_auth->realm, &hchal->challenge.common.realm);
 	    cached_auth->is_proxy = (hchal->type == PJSIP_H_PROXY_AUTHENTICATE);
@@ -823,5 +829,6 @@
 
     /* Remove branch param in Via header. */
-    via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
+    via = (pjsip_via_hdr*)
+	  pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
     via->branch_param.slen = 0;
 
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_msg.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_msg.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_msg.c	(revision 789)
@@ -47,5 +47,6 @@
 PJ_DEF(pjsip_authorization_hdr*) pjsip_authorization_hdr_create(pj_pool_t *pool)
 {
-    pjsip_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+    pjsip_authorization_hdr *hdr = (pjsip_authorization_hdr *)
+				    pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_AUTHORIZATION, &authorization_hdr_vptr);
     pj_list_init(&hdr->credential.common.other_param);
@@ -55,5 +56,6 @@
 PJ_DEF(pjsip_proxy_authorization_hdr*) pjsip_proxy_authorization_hdr_create(pj_pool_t *pool)
 {
-    pjsip_proxy_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+    pjsip_proxy_authorization_hdr *hdr = (pjsip_proxy_authorization_hdr *)
+					 pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_PROXY_AUTHORIZATION, &authorization_hdr_vptr);
     pj_list_init(&hdr->credential.common.other_param);
@@ -173,5 +175,6 @@
 {
     /* This function also serves Proxy-Authorization header. */
-    pjsip_authorization_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_authorization_hdr *hdr = (pjsip_authorization_hdr *)
+				   pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone(pool, &hdr->credential.common.other_param, 
@@ -202,5 +205,6 @@
 PJ_DEF(pjsip_www_authenticate_hdr*) pjsip_www_authenticate_hdr_create(pj_pool_t *pool)
 {
-    pjsip_www_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+    pjsip_www_authenticate_hdr *hdr = (pjsip_www_authenticate_hdr *) 
+				      pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_WWW_AUTHENTICATE, &www_authenticate_hdr_vptr);
     pj_list_init(&hdr->challenge.common.other_param);
@@ -211,5 +215,6 @@
 PJ_DEF(pjsip_proxy_authenticate_hdr*) pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool)
 {
-    pjsip_proxy_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+    pjsip_proxy_authenticate_hdr *hdr = (pjsip_proxy_authenticate_hdr *)
+				         pj_pool_calloc(pool, 1, sizeof(*hdr));
     init_hdr(hdr, PJSIP_H_PROXY_AUTHENTICATE, &www_authenticate_hdr_vptr);
     pj_list_init(&hdr->challenge.common.other_param);
@@ -323,5 +328,6 @@
 {
     /* This function also serves Proxy-Authenticate header. */
-    pjsip_www_authenticate_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_www_authenticate_hdr *hdr = (pjsip_www_authenticate_hdr *) 
+				       pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone(pool, &hdr->challenge.common.other_param, 
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_parser.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_parser.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_parser.c	(revision 789)
@@ -107,5 +107,6 @@
 
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = (pjsip_param *)
+			     pj_pool_alloc(pool, sizeof(pjsip_param));
 	    p->name = name;
 	    p->value = value;
@@ -169,5 +170,6 @@
 
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = (pjsip_param *)
+			     pj_pool_alloc(pool, sizeof(pjsip_param));
 	    p->name = name;
 	    p->value = value;
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_server.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_server.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_auth_server.c	(revision 789)
@@ -115,5 +115,5 @@
     pjsip_authorization_hdr *h_auth;
     pjsip_msg *msg = rdata->msg_info.msg;
-    int htype;
+    pjsip_hdr_e htype;
     pj_str_t acc_name;
     pjsip_cred_info cred_info;
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_dialog.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_dialog.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_dialog.c	(revision 789)
@@ -70,5 +70,5 @@
 	return PJ_ENOMEM;
 
-    dlg = pj_pool_zalloc(pool, sizeof(pjsip_dialog));
+    dlg = (pjsip_dialog*)pj_pool_zalloc(pool, sizeof(pjsip_dialog));
     PJ_ASSERT_RETURN(dlg != NULL, PJ_ENOMEM);
 
@@ -145,5 +145,6 @@
 	    pjsip_hdr *hdr;
 
-	    hdr = pjsip_parse_hdr(dlg->pool, &param->name, param->value.ptr,
+	    hdr = (pjsip_hdr *)
+		  pjsip_parse_hdr(dlg->pool, &param->name, param->value.ptr,
 				  param->value.slen, NULL);
 	    if (hdr == NULL) {
@@ -290,8 +291,9 @@
      * both local and remote URI.
      */
-    tmp.ptr = pj_pool_alloc(rdata->tp_info.pool, TMP_LEN);
+    tmp.ptr = (char*)pj_pool_alloc(rdata->tp_info.pool, TMP_LEN);
 
     /* Init local info from the To header. */
-    dlg->local.info = pjsip_hdr_clone(dlg->pool, rdata->msg_info.to);
+    dlg->local.info = (pjsip_to_hdr*)
+		      pjsip_hdr_clone(dlg->pool, rdata->msg_info.to);
     pjsip_fromto_hdr_set_from(dlg->local.info);
 
@@ -348,5 +350,6 @@
 
     /* Init remote info from the From header. */
-    dlg->remote.info = pjsip_hdr_clone(dlg->pool, rdata->msg_info.from);
+    dlg->remote.info = (pjsip_from_hdr*)
+		       pjsip_hdr_clone(dlg->pool, rdata->msg_info.from);
     pjsip_fromto_hdr_set_to(dlg->remote.info);
 
@@ -365,5 +368,6 @@
 
     /* Init remote's contact from Contact header. */
-    contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
+    contact_hdr = (pjsip_hdr*)
+	          pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
 				     NULL);
     if (!contact_hdr) {
@@ -371,5 +375,6 @@
 	goto on_error;
     }
-    dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact_hdr);
+    dlg->remote.contact = (pjsip_contact_hdr*)
+			  pjsip_hdr_clone(dlg->pool, contact_hdr);
 
     /* Init remote's CSeq from CSeq header */
@@ -391,5 +396,6 @@
 
     /* Call-ID */
-    dlg->call_id = pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid);
+    dlg->call_id = (pjsip_cid_hdr*)
+		   pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid);
 
     /* Route set. 
@@ -406,5 +412,5 @@
 
 	/* Clone the Record-Route, change the type to Route header. */
-	route = pjsip_hdr_clone(dlg->pool, rr);
+	route = (pjsip_route_hdr*)pjsip_hdr_clone(dlg->pool, rr);
 	pjsip_routing_hdr_set_route(route);
 
@@ -416,5 +422,6 @@
 	if (rr == (pjsip_rr_hdr*)&rdata->msg_info.msg->hdr)
 	    break;
-	rr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_RECORD_ROUTE, rr);
+	rr = (pjsip_route_hdr*)
+	     pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_RECORD_ROUTE, rr);
     }
 
@@ -501,8 +508,9 @@
 
     /* Clone remote target. */
-    dlg->target = pjsip_uri_clone(dlg->pool, first_dlg->target);
+    dlg->target = (pjsip_uri*) pjsip_uri_clone(dlg->pool, first_dlg->target);
 
     /* Clone local info. */
-    dlg->local.info = pjsip_hdr_clone(dlg->pool, first_dlg->local.info);
+    dlg->local.info = (pjsip_fromto_hdr*)
+		      pjsip_hdr_clone(dlg->pool, first_dlg->local.info);
 
     /* Clone local tag. */
@@ -515,8 +523,10 @@
 
     /* Clone local Contact. */
-    dlg->local.contact = pjsip_hdr_clone(dlg->pool, first_dlg->local.contact);
+    dlg->local.contact = (pjsip_contact_hdr*)
+			 pjsip_hdr_clone(dlg->pool, first_dlg->local.contact);
 
     /* Clone remote info. */
-    dlg->remote.info = pjsip_hdr_clone(dlg->pool, first_dlg->remote.info);
+    dlg->remote.info = (pjsip_fromto_hdr*)
+		       pjsip_hdr_clone(dlg->pool, first_dlg->remote.info);
 
     /* Set remote tag from the response. */
@@ -542,5 +552,6 @@
 
     /* Clone Call-ID header. */
-    dlg->call_id = pjsip_hdr_clone(dlg->pool, first_dlg->call_id);
+    dlg->call_id = (pjsip_cid_hdr*)
+		   pjsip_hdr_clone(dlg->pool, first_dlg->call_id);
 
     /* Duplicate Route-Set. */
@@ -550,5 +561,5 @@
 	pjsip_route_hdr *h;
 
-	h = pjsip_hdr_clone(dlg->pool, r);
+	h = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, r);
 	pj_list_push_back(&dlg->route_set, h);
 
@@ -653,5 +664,5 @@
 	pjsip_route_hdr *new_r;
 
-	new_r = pjsip_hdr_clone(dlg->pool, r);
+	new_r = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, r);
 	pj_list_push_back(&dlg->route_set, new_r);
 
@@ -860,5 +871,5 @@
     for (; route != end_list; route = route->next ) {
 	pjsip_route_hdr *r;
-	r = pjsip_hdr_shallow_clone( tdata->pool, route );
+	r = (pjsip_route_hdr*) pjsip_hdr_shallow_clone( tdata->pool, route );
 	pjsip_routing_hdr_set_route(r);
 	pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)r);
@@ -1041,5 +1052,6 @@
 	    /* Add contact header only if one is not present. */
 	    if (pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL) == 0) {
-		hdr = pjsip_hdr_clone(tdata->pool, dlg->local.contact);
+		hdr = (pjsip_hdr*) 
+		      pjsip_hdr_clone(tdata->pool, dlg->local.contact);
 		pjsip_msg_add_hdr(tdata->msg, hdr);
 	    }
@@ -1053,5 +1065,5 @@
 					       PJSIP_H_ALLOW, NULL);
 	    if (c_hdr) {
-		hdr = pjsip_hdr_clone(tdata->pool, c_hdr);
+		hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, c_hdr);
 		pjsip_msg_add_hdr(tdata->msg, hdr);
 	    }
@@ -1065,5 +1077,5 @@
 					       PJSIP_H_SUPPORTED, NULL);
 	    if (c_hdr) {
-		hdr = pjsip_hdr_clone(tdata->pool, c_hdr);
+		hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, c_hdr);
 		pjsip_msg_add_hdr(tdata->msg, hdr);
 	    }
@@ -1238,5 +1250,5 @@
 	while (hdr != hdr_list) {
 	    pjsip_msg_add_hdr(tdata->msg,
-			      pjsip_hdr_clone(tdata->pool, hdr));
+			      (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr));
 	    hdr = hdr->next;
 	}
@@ -1387,5 +1399,5 @@
 	    if (hdr->type == PJSIP_H_RECORD_ROUTE) {
 		pjsip_route_hdr *r;
-		r = pjsip_hdr_clone(dlg->pool, hdr);
+		r = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, hdr);
 		pjsip_routing_hdr_set_route(r);
 		pj_list_push_back(&dlg->route_set, r);
@@ -1396,8 +1408,10 @@
 	 * field of the response.
 	 */
-	contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
+	contact = (pjsip_contact_hdr*) 
+		  pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
 				     NULL);
 	if (contact) {
-	    dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact);
+	    dlg->remote.contact = (pjsip_contact_hdr*)
+				  pjsip_hdr_clone(dlg->pool, contact);
 	    dlg->target = dlg->remote.contact->uri;
 	}
@@ -1414,8 +1428,10 @@
 	pjsip_contact_hdr *contact;
 
-	contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
+	contact = (pjsip_contact_hdr*) 
+		  pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
 				     NULL);
 	if (contact) {
-	    dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact);
+	    dlg->remote.contact = (pjsip_contact_hdr*) 
+				  pjsip_hdr_clone(dlg->pool, contact);
 	    dlg->target = dlg->remote.contact->uri;
 	}
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_endpoint.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_endpoint.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_endpoint.c	(revision 789)
@@ -144,5 +144,6 @@
 static int cmp_mod_name(void *name, const void *mod)
 {
-    return pj_stricmp(name, &((pjsip_module*)mod)->name);
+    return pj_stricmp((pj_str_t*)name, 
+		      (const pj_str_t*)&((pjsip_module*)mod)->name);
 }
 
@@ -401,5 +402,5 @@
 
     /* Create endpoint. */
-    endpt = pj_pool_zalloc(pool, sizeof(*endpt));
+    endpt = (pjsip_endpoint*) pj_pool_zalloc(pool, sizeof(*endpt));
     endpt->pool = pool;
     endpt->pf = pf;
@@ -591,4 +592,5 @@
     /* timeout is 'out' var. This just to make compiler happy. */
     pj_time_val timeout = { 0, 0};
+    pj_time_val *p_timeout;
 
     PJ_LOG(6, (THIS_FILE, "pjsip_endpt_handle_events()"));
@@ -612,6 +614,12 @@
     }
 
+    /* Timer heap may return PJ_MAXINT32 when it has no entries */
+    if (timeout.sec == PJ_MAXINT32 || timeout.msec == PJ_MAXINT32)
+	p_timeout = NULL;
+    else
+	p_timeout = &timeout;
+
     /* Poll ioqueue. */
-    if (pj_ioqueue_poll( endpt->ioqueue, &timeout) < 0) {
+    if (pj_ioqueue_poll( endpt->ioqueue, p_timeout) < 0) {
 	pj_thread_sleep(1);
 	return pj_get_netos_error();
@@ -676,6 +684,6 @@
 	pj_bool_t mismatch = PJ_FALSE;
 	if (port == 0) {
-	    int type;
-	    type = rdata->tp_info.transport->key.type;
+	    pjsip_transport_type_e type;
+	    type = (pjsip_transport_type_e) rdata->tp_info.transport->key.type;
 	    port = pjsip_transport_get_default_port_for_type(type);
 	}
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_msg.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_msg.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_msg.c	(revision 789)
@@ -238,5 +238,5 @@
 PJ_DEF(pjsip_msg*) pjsip_msg_create( pj_pool_t *pool, pjsip_msg_type_e type)
 {
-    pjsip_msg *msg = pj_pool_alloc(pool, sizeof(pjsip_msg));
+    pjsip_msg *msg = (pjsip_msg *) pj_pool_alloc(pool, sizeof(pjsip_msg));
     pj_list_init(&msg->hdr);
     msg->type = type;
@@ -248,5 +248,5 @@
 				   pjsip_hdr_e hdr_type, const void *start)
 {
-    const pjsip_hdr *hdr=start, *end=&msg->hdr;
+    const pjsip_hdr *hdr=(const pjsip_hdr *)start, *end=&msg->hdr;
 
     if (hdr == NULL) {
@@ -264,5 +264,5 @@
 					   const void *start)
 {
-    const pjsip_hdr *hdr=start, *end=&msg->hdr;
+    const pjsip_hdr *hdr=(const pjsip_hdr *)start, *end=&msg->hdr;
 
     if (hdr == NULL) {
@@ -284,5 +284,5 @@
 				         pjsip_hdr_e hdr_type, void *start)
 {
-    pjsip_hdr *hdr = pjsip_msg_find_hdr(msg, hdr_type, start);
+    pjsip_hdr *hdr = (pjsip_hdr *)pjsip_msg_find_hdr(msg, hdr_type, start);
     if (hdr) {
 	pj_list_erase(hdr);
@@ -316,5 +316,5 @@
 
 	/* Add URI */
-	uri = pjsip_uri_get_uri(msg->line.req.uri);
+	uri = (pjsip_uri*) pjsip_uri_get_uri(msg->line.req.uri);
 	len = pjsip_uri_print( PJSIP_URI_IN_REQ_URI, uri, p, end-p);
 	if (len < 1)
@@ -448,5 +448,5 @@
 PJ_DEF(void*) pjsip_hdr_clone( pj_pool_t *pool, const void *hdr_ptr )
 {
-    const pjsip_hdr *hdr = hdr_ptr;
+    const pjsip_hdr *hdr = (const pjsip_hdr *)hdr_ptr;
     return (*hdr->vptr->clone)(pool, hdr_ptr);
 }
@@ -455,5 +455,5 @@
 PJ_DEF(void*) pjsip_hdr_shallow_clone( pj_pool_t *pool, const void *hdr_ptr )
 {
-    const pjsip_hdr *hdr = hdr_ptr;
+    const pjsip_hdr *hdr = (const pjsip_hdr *)hdr_ptr;
     return (*hdr->vptr->shallow_clone)(pool, hdr_ptr);
 }
@@ -461,5 +461,5 @@
 PJ_DEF(int) pjsip_hdr_print_on( void *hdr_ptr, char *buf, pj_size_t len)
 {
-    pjsip_hdr *hdr = hdr_ptr;
+    pjsip_hdr *hdr = (pjsip_hdr *)hdr_ptr;
     return (*hdr->vptr->print_on)(hdr_ptr, buf, len);
 }
@@ -507,5 +507,5 @@
 			       const pj_str_t *hvalue)
 {
-    pjsip_generic_string_hdr *hdr = mem;
+    pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr *)mem;
 
     init_hdr(hdr, PJSIP_H_OTHER, &generic_hdr_vptr);
@@ -567,5 +567,6 @@
 							   const pjsip_generic_string_hdr *rhs )
 {
-    pjsip_generic_string_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr *)
+				     pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -596,5 +597,5 @@
 							    int value)
 {
-    pjsip_generic_int_hdr *hdr = mem;
+    pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *) mem;
 
     init_hdr(hdr, PJSIP_H_OTHER, &generic_int_hdr_vptr);
@@ -636,5 +637,6 @@
 					           const pjsip_generic_int_hdr *rhs)
 {
-    pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *)
+				  pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -644,5 +646,6 @@
 							   const pjsip_generic_int_hdr *rhs )
 {
-    pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr *)
+				 pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -671,5 +674,5 @@
 							       const pj_str_t *hnames)
 {
-    pjsip_generic_array_hdr *hdr = mem;
+    pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *) mem;
 
     init_hdr(hdr, PJSIP_H_OTHER, &generic_array_hdr_vptr);
@@ -715,5 +718,6 @@
 {
     unsigned i;
-    pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *)
+				   pj_pool_alloc(pool, sizeof(*hdr));
 
     pj_memcpy(hdr, rhs, sizeof(*hdr));
@@ -729,5 +733,6 @@
 						 const pjsip_generic_array_hdr *rhs)
 {
-    pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr *)
+				   pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -741,5 +746,5 @@
 						 void *mem )
 {
-    pjsip_accept_hdr *hdr = mem;
+    pjsip_accept_hdr *hdr = (pjsip_accept_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -765,5 +770,5 @@
 					       void *mem )
 {
-    pjsip_allow_hdr *hdr = mem;
+    pjsip_allow_hdr *hdr = (pjsip_allow_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -788,5 +793,5 @@
 					   void *mem )
 {
-    pjsip_cid_hdr *hdr = mem;
+    pjsip_cid_hdr *hdr = (pjsip_cid_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -822,5 +827,5 @@
 					     void *mem )
 {
-    pjsip_clen_hdr *hdr = mem;
+    pjsip_clen_hdr *hdr = (pjsip_clen_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -884,5 +889,5 @@
 					     void *mem )
 {
-    pjsip_cseq_hdr *hdr = mem;
+    pjsip_cseq_hdr *hdr = (pjsip_cseq_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -939,5 +944,6 @@
 						     const pjsip_cseq_hdr *rhs )
 {
-    pjsip_cseq_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_cseq_hdr *hdr = (pjsip_cseq_hdr *) 
+			  pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     return hdr;
@@ -963,5 +969,5 @@
 						   void *mem )
 {
-    pjsip_contact_hdr *hdr = mem;
+    pjsip_contact_hdr *hdr = (pjsip_contact_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1055,5 +1061,5 @@
 	return hdr;
 
-    hdr->uri = pjsip_uri_clone(pool, rhs->uri);
+    hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri);
     hdr->q1000 = rhs->q1000;
     hdr->expires = rhs->expires;
@@ -1066,5 +1072,6 @@
 				 const pjsip_contact_hdr *rhs)
 {
-    pjsip_contact_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_contact_hdr *hdr = (pjsip_contact_hdr *) 
+			     pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
@@ -1092,5 +1099,5 @@
 					       void *mem )
 {
-    pjsip_ctype_hdr *hdr = mem;
+    pjsip_ctype_hdr *hdr = (pjsip_ctype_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1169,5 +1176,5 @@
 						   int value)
 {
-    pjsip_expires_hdr *hdr = mem;
+    pjsip_expires_hdr *hdr = (pjsip_expires_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1208,5 +1215,5 @@
 					     void *mem )
 {
-    pjsip_from_hdr *hdr = mem;
+    pjsip_from_hdr *hdr = (pjsip_from_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1227,5 +1234,5 @@
 					 void *mem )
 {
-    pjsip_to_hdr *hdr = mem;
+    pjsip_to_hdr *hdr = (pjsip_to_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1296,5 +1303,5 @@
     hdr->name = rhs->name;
     hdr->sname = rhs->sname;
-    hdr->uri = pjsip_uri_clone(pool, rhs->uri);
+    hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri);
     pj_strdup( pool, &hdr->tag, &rhs->tag);
     pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param);
@@ -1307,5 +1314,6 @@
 				const pjsip_fromto_hdr *rhs)
 {
-    pjsip_fromto_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_fromto_hdr *hdr = (pjsip_fromto_hdr *) 
+			    pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param);
@@ -1322,5 +1330,5 @@
 						   int value)
 {
-    pjsip_max_fwd_hdr *hdr = mem;
+    pjsip_max_fwd_hdr *hdr = (pjsip_max_fwd_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1348,5 +1356,5 @@
 							   int value )
 {
-    pjsip_min_expires_hdr *hdr = mem;
+    pjsip_min_expires_hdr *hdr = (pjsip_min_expires_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1382,5 +1390,5 @@
 					 void *mem )
 {
-    pjsip_rr_hdr *hdr = mem;
+    pjsip_rr_hdr *hdr = (pjsip_rr_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1402,5 +1410,5 @@
 					       void *mem )
 {
-    pjsip_route_hdr *hdr = mem;
+    pjsip_route_hdr *hdr = (pjsip_route_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1462,5 +1470,6 @@
 						   const pjsip_routing_hdr *rhs )
 {
-    pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_routing_hdr *hdr = (pjsip_routing_hdr *)
+			     pj_pool_alloc(pool, sizeof(*hdr));
 
     init_hdr(hdr, rhs->type, rhs->vptr);
@@ -1474,5 +1483,6 @@
 							   const pjsip_routing_hdr *rhs )
 {
-    pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_routing_hdr *hdr = (pjsip_routing_hdr *)
+			     pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param);
@@ -1488,5 +1498,5 @@
 						   void *mem )
 {
-    pjsip_require_hdr *hdr = mem;
+    pjsip_require_hdr *hdr = (pjsip_require_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1511,5 +1521,5 @@
 							   int value )
 {
-    pjsip_retry_after_hdr *hdr = mem;
+    pjsip_retry_after_hdr *hdr = (pjsip_retry_after_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1535,5 +1545,5 @@
 						       void *mem )
 {
-    pjsip_supported_hdr *hdr = mem;
+    pjsip_supported_hdr *hdr = (pjsip_supported_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1557,5 +1567,5 @@
 							   void *mem )
 {
-    pjsip_unsupported_hdr *hdr = mem;
+    pjsip_unsupported_hdr *hdr = (pjsip_unsupported_hdr *) mem;
     
     PJ_UNUSED_ARG(pool);
@@ -1590,5 +1600,5 @@
 					   void *mem )
 {
-    pjsip_via_hdr *hdr = mem;
+    pjsip_via_hdr *hdr = (pjsip_via_hdr *) mem;
 
     PJ_UNUSED_ARG(pool);
@@ -1697,5 +1707,5 @@
 						   const pjsip_via_hdr *rhs )
 {
-    pjsip_via_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+    pjsip_via_hdr *hdr = (pjsip_via_hdr *) pj_pool_alloc(pool, sizeof(*hdr));
     pj_memcpy(hdr, rhs, sizeof(*hdr));
     pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
@@ -1715,5 +1725,6 @@
     pj_str_t hvalue;
 
-    hvalue.ptr = pj_pool_alloc(pool, 10 +		/* code */
+    hvalue.ptr = (char*)
+		 pj_pool_alloc(pool, 10 +		/* code */
 				     host->slen + 2 +	/* host */
 				     text->slen + 2);	/* text */
@@ -1755,5 +1766,5 @@
 
     if (len) {
-	newdata = pj_pool_alloc(pool, len);
+	newdata = (char*) pj_pool_alloc(pool, len);
 	pj_memcpy(newdata, data, len);
     }
@@ -1797,5 +1808,5 @@
     pj_status_t status;
 
-    new_body = pj_pool_alloc(pool, sizeof(pjsip_msg_body));
+    new_body = (pjsip_msg_body*) pj_pool_alloc(pool, sizeof(pjsip_msg_body));
     PJ_ASSERT_RETURN(new_body, NULL);
 
@@ -1815,5 +1826,5 @@
     PJ_ASSERT_RETURN(pool && type && subtype && text, NULL);
 
-    body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));
+    body = (pjsip_msg_body*) pj_pool_zalloc(pool, sizeof(pjsip_msg_body));
     PJ_ASSERT_RETURN(body != NULL, NULL);
 
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_parser.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_parser.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_parser.c	(revision 789)
@@ -221,5 +221,5 @@
 
     len = param->slen + pname->slen + pvalue->slen + 3;
-    p = new_param = pj_pool_alloc(pool, len);
+    p = new_param = (char*) pj_pool_alloc(pool, len);
     
     if (param->slen) {
@@ -887,5 +887,6 @@
 	 */
 	if (ctype_hdr && scanner->curptr!=scanner->end) {
-	    pjsip_msg_body *body = pj_pool_alloc(pool, sizeof(pjsip_msg_body));
+	    pjsip_msg_body *body = (pjsip_msg_body *) 
+				   pj_pool_alloc(pool, sizeof(pjsip_msg_body));
 	    body->content_type.type = ctype_hdr->media.type;
 	    body->content_type.subtype = ctype_hdr->media.subtype;
@@ -907,5 +908,6 @@
 	    pjsip_parser_err_report *err_info;
 	    
-	    err_info = pj_pool_alloc(pool, sizeof(*err_info));
+	    err_info = (pjsip_parser_err_report *) 
+		       pj_pool_alloc(pool, sizeof(*err_info));
 	    err_info->except_code = PJ_GET_EXCEPTION();
 	    err_info->line = scanner->line;
@@ -1096,5 +1098,6 @@
 	    }
 
-	    uri = (*func)( scanner, pool, 
+	    uri = (pjsip_uri*)
+		  (*func)( scanner, pool, 
 			  (opt & PJSIP_PARSE_URI_IN_FROM_TO_HDR)== 0);
 
@@ -1217,5 +1220,6 @@
 
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = (pjsip_param *) 
+			     pj_pool_alloc(pool, sizeof(pjsip_param));
 	    p->name = pname;
 	    p->value = pvalue;
@@ -1229,5 +1233,5 @@
       do {
 	pjsip_param *param;
-	param = pj_pool_alloc(pool, sizeof(pjsip_param));
+	param = (pjsip_param *) pj_pool_alloc(pool, sizeof(pjsip_param));
 	int_parse_hparam(scanner, pool, &param->name, &param->value);
 	pj_list_insert_before(&url->header_param, param);
@@ -1417,5 +1421,5 @@
 	int_parse_param( scanner, pool, &pname, &pvalue);
 	if (!parser_stricmp(pname, pjsip_Q_STR) && pvalue.slen) {
-	    char *dot_pos = memchr(pvalue.ptr, '.', pvalue.slen);
+	    char *dot_pos = (char *) memchr(pvalue.ptr, '.', pvalue.slen);
 	    if (!dot_pos) {
 		hdr->q1000 = pj_strtoul(&pvalue);
@@ -1429,5 +1433,6 @@
 
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = (pjsip_param *) 
+			     pj_pool_alloc(pool, sizeof(pjsip_param));
 	    p->name = pname;
 	    p->value = pvalue;
@@ -1567,5 +1572,6 @@
 	    
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = (pjsip_param *) 
+			     pj_pool_alloc(pool, sizeof(pjsip_param));
 	    p->name = pname;
 	    p->value = pvalue;
@@ -1665,5 +1671,6 @@
 		hdr->rport_param = 0;
 	} else {
-	    pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	    pjsip_param *p = (pjsip_param *) 
+			     pj_pool_alloc(pool, sizeof(pjsip_param));
 	    p->name = pname;
 	    p->value = pvalue;
@@ -1705,5 +1712,6 @@
 
     while (*scanner->curptr == ';') {
-	pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+	pjsip_param *p = (pjsip_param *) 
+			 pj_pool_alloc(pool, sizeof(pjsip_param));
 	int_parse_param(scanner, pool, &p->name, &p->value);
 	pj_list_insert_before(&hdr->other_param, p);
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_tel_uri.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_tel_uri.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_tel_uri.c	(revision 789)
@@ -74,17 +74,22 @@
 				     pj_bool_t parse_params);
 
-#ifdef __GNUC__
-#  define HAPPY_FLAG	(void*)
-#else
-#  define HAPPY_FLAG
-#endif
+
+typedef const pj_str_t* (*FGETSCHEME)(const void *uri);
+typedef void* (*FGETURI)(void *uri);
+typedef pj_ssize_t (*FPRINT)(pjsip_uri_context_e context,
+			     const void *uri, 
+			     char *buf, pj_size_t size);
+typedef pj_status_t (*FCOMPARE)(pjsip_uri_context_e context, 
+				const void *uri1, const void *uri2);
+typedef void *(*FCLONE)(pj_pool_t *pool, const void *uri);
+
 
 static pjsip_uri_vptr tel_uri_vptr = 
 {
-    HAPPY_FLAG &tel_uri_get_scheme,
-    HAPPY_FLAG &tel_uri_get_uri,
-    HAPPY_FLAG &tel_uri_print,
-    HAPPY_FLAG &tel_uri_cmp,
-    HAPPY_FLAG &tel_uri_clone
+    (FGETSCHEME) &tel_uri_get_scheme,
+    (FGETURI)	 &tel_uri_get_uri,
+    (FPRINT)	 &tel_uri_print,
+    (FCOMPARE)   &tel_uri_cmp,
+    (FCLONE)	 &tel_uri_clone
 };
 
@@ -92,5 +97,6 @@
 PJ_DEF(pjsip_tel_uri*) pjsip_tel_uri_create(pj_pool_t *pool)
 {
-    pjsip_tel_uri *uri = pj_pool_zalloc(pool, sizeof(pjsip_tel_uri));
+    pjsip_tel_uri *uri = (pjsip_tel_uri *) 
+			 pj_pool_zalloc(pool, sizeof(pjsip_tel_uri));
     uri->vptr = &tel_uri_vptr;
     pj_list_init(&uri->other_param);
@@ -404,5 +410,6 @@
 		uri->context = pvalue;
 	    } else {
-		pjsip_param *param = pj_pool_alloc(pool, sizeof(pjsip_param));
+		pjsip_param *param = (pjsip_param *)
+				     pj_pool_alloc(pool, sizeof(pjsip_param));
 		param->name = pname;
 		param->value = pvalue;
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_transaction.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_transaction.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_transaction.c	(revision 789)
@@ -280,5 +280,5 @@
 		   9 +			    /* Via port. */
 		   16;			    /* Separator+Allowance. */
-    key = p = pj_pool_alloc(pool, len_required);
+    key = p = (char*) pj_pool_alloc(pool, len_required);
     end = p + len_required;
 
@@ -347,5 +347,6 @@
     PJ_ASSERT_RETURN(pool && key && method && branch, PJ_EINVAL);
 
-    p = key->ptr = pj_pool_alloc(pool, branch->slen + method->name.slen + 4 );
+    p = key->ptr = (char*) 
+		   pj_pool_alloc(pool, branch->slen + method->name.slen + 4 );
     
     /* Add role. */
@@ -581,5 +582,6 @@
 
     pj_mutex_lock(mod_tsx_layer.mutex);
-    tsx = pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen, &hval );
+    tsx = (pjsip_transaction*) 
+	  pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen, &hval );
     pj_mutex_unlock(mod_tsx_layer.mutex);
 
@@ -632,5 +634,6 @@
     it = pj_hash_first(mod_tsx_layer.htable, &it_buf);
     while (it) {
-	pjsip_transaction *tsx = pj_hash_this(mod_tsx_layer.htable, it);
+	pjsip_transaction *tsx = (pjsip_transaction *) 
+				 pj_hash_this(mod_tsx_layer.htable, it);
 	pj_hash_iterator_t *next = pj_hash_next(mod_tsx_layer.htable, it);
 	if (tsx)
@@ -679,5 +682,6 @@
     pj_mutex_lock( mod_tsx_layer.mutex );
 
-    tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval );
+    tsx = (pjsip_transaction *) 
+	  pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval );
 
 
@@ -727,5 +731,6 @@
     pj_mutex_lock( mod_tsx_layer.mutex );
 
-    tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval );
+    tsx = (pjsip_transaction *) 
+	  pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval );
 
 
@@ -765,5 +770,6 @@
 PJ_DEF(pjsip_transaction*) pjsip_rdata_get_tsx( pjsip_rx_data *rdata )
 {
-    return rdata->endpt_info.mod_data[mod_tsx_layer.mod.id];
+    return (pjsip_transaction *) 
+	   rdata->endpt_info.mod_data[mod_tsx_layer.mod.id];
 }
 
@@ -790,5 +796,6 @@
 	} else {
 	    while (it != NULL) {
-		pjsip_transaction *tsx = pj_hash_this(mod_tsx_layer.htable,it);
+		pjsip_transaction *tsx = (pjsip_transaction *)
+					 pj_hash_this(mod_tsx_layer.htable,it);
 
 		PJ_LOG(3, (THIS_FILE, " %s %s|%d|%s",
@@ -868,5 +875,5 @@
 	return PJ_ENOMEM;
 
-    tsx = pj_pool_zalloc(pool, sizeof(pjsip_transaction));
+    tsx = (pjsip_transaction*) pj_pool_zalloc(pool, sizeof(pjsip_transaction));
     tsx->pool = pool;
     tsx->tsx_user = tsx_user;
@@ -934,5 +941,5 @@
 
     /* Clear TLS, so that mutex will not be unlocked */
-    lck = pj_thread_local_get(pjsip_tsx_lock_tls_id);
+    lck = (struct tsx_lock_data *) pj_thread_local_get(pjsip_tsx_lock_tls_id);
     while (lck) {
 	if (lck->tsx == tsx) {
@@ -956,5 +963,5 @@
 {
     pjsip_event event;
-    pjsip_transaction *tsx = entry->user_data;
+    pjsip_transaction *tsx = (pjsip_transaction *) entry->user_data;
     struct tsx_lock_data lck;
 
@@ -1006,5 +1013,5 @@
      */
     if (event_src_type==PJSIP_EVENT_RX_MSG && tsx->tsx_user) {
-	pjsip_rx_data *rdata = event_src;
+	pjsip_rx_data *rdata = (pjsip_rx_data *) event_src;
 
 	pj_assert(rdata != NULL);
@@ -1087,5 +1094,5 @@
 
     /* Make sure CSeq header is present. */
-    cseq = pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL);
+    cseq = (pjsip_cseq_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL);
     if (!cseq) {
 	pj_assert(!"CSeq header not present in outgoing message!");
@@ -1113,5 +1120,5 @@
 
     /* Generate Via header if it doesn't exist. */
-    via = pjsip_msg_find_hdr(msg, PJSIP_H_VIA, NULL);
+    via = (pjsip_via_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_VIA, NULL);
     if (via == NULL) {
 	via = pjsip_via_hdr_create(tdata->pool);
@@ -1122,5 +1129,6 @@
     if (via->branch_param.slen == 0) {
 	pj_str_t tmp;
-	via->branch_param.ptr = pj_pool_alloc(tsx->pool, PJSIP_MAX_BRANCH_LEN);
+	via->branch_param.ptr = (char*)
+				pj_pool_alloc(tsx->pool, PJSIP_MAX_BRANCH_LEN);
 	via->branch_param.slen = PJSIP_MAX_BRANCH_LEN;
 	pj_memcpy(via->branch_param.ptr, PJSIP_RFC3261_BRANCH_ID, 
@@ -1418,5 +1426,5 @@
 			       pj_ssize_t sent, pj_bool_t *cont )
 {
-    pjsip_transaction *tsx = send_state->token;
+    pjsip_transaction *tsx = (pjsip_transaction *) send_state->token;
     struct tsx_lock_data lck;
 
@@ -1535,5 +1543,5 @@
 {
     if (sent < 0) {
-	pjsip_transaction *tsx = token;
+	pjsip_transaction *tsx = (pjsip_transaction *) token;
 	struct tsx_lock_data lck;
 	char errmsg[PJ_ERR_MSG_SIZE];
@@ -2117,5 +2125,6 @@
 	     */
 	    if (!tsx->is_reliable) {
-		pjsip_cseq_hdr *cseq = pjsip_msg_find_hdr( msg, PJSIP_H_CSEQ,
+		pjsip_cseq_hdr *cseq = (pjsip_cseq_hdr *) 
+				       pjsip_msg_find_hdr( msg, PJSIP_H_CSEQ,
                                                            NULL);
 		if (cseq->method.id == PJSIP_INVITE_METHOD) {
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_transport.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_transport.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_transport.c	(revision 789)
@@ -233,5 +233,5 @@
 	return PJ_ENOMEM;
 
-    tdata = pj_pool_zalloc(pool, sizeof(pjsip_tx_data));
+    tdata = (pjsip_tx_data*) pj_pool_zalloc(pool, sizeof(pjsip_tx_data));
     tdata->pool = pool;
     tdata->mgr = mgr;
@@ -314,5 +314,5 @@
     int len;
 
-    cseq = pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL);
+    cseq = (pjsip_cseq_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL);
     PJ_ASSERT_RETURN(cseq != NULL, "INVALID MSG");
 
@@ -336,5 +336,5 @@
     }
 
-    info = pj_pool_alloc(pool, len+1);
+    info = (char*) pj_pool_alloc(pool, len+1);
     pj_memcpy(info, info_buf, len+1);
 
@@ -392,5 +392,5 @@
 				    pj_ssize_t size)
 {
-    pjsip_tx_data *tdata = token;
+    pjsip_tx_data *tdata = (pjsip_tx_data *) token;
 
     PJ_UNUSED_ARG(transport);
@@ -417,5 +417,5 @@
     /* Allocate buffer if necessary. */
     if (tdata->buf.start == NULL) {
-	tdata->buf.start = pj_pool_alloc( tdata->pool, PJSIP_MAX_PKT_LEN);
+	tdata->buf.start = (char*)pj_pool_alloc( tdata->pool, PJSIP_MAX_PKT_LEN);
 	tdata->buf.cur = tdata->buf.start;
 	tdata->buf.end = tdata->buf.start + PJSIP_MAX_PKT_LEN;
@@ -510,5 +510,5 @@
 				    struct pj_timer_entry *entry)
 {
-    pjsip_transport *tp = entry->user_data;
+    pjsip_transport *tp = (pjsip_transport *) entry->user_data;
     pj_assert(tp != NULL);
 
@@ -725,5 +725,5 @@
 
     /* Create and initialize transport manager. */
-    mgr = pj_pool_zalloc(pool, sizeof(*mgr));
+    mgr = (pjsip_tpmgr *) pj_pool_zalloc(pool, sizeof(*mgr));
     mgr->endpt = endpt;
     mgr->on_rx_msg = rx_cb;
@@ -771,5 +771,5 @@
 	pjsip_transport *transport;
 	
-	transport = pj_hash_this(mgr->table, itr);
+	transport = (pjsip_transport*) pj_hash_this(mgr->table, itr);
 
 	next = pj_hash_next(mgr->table, itr);
@@ -909,5 +909,5 @@
 	    hdr = (pjsip_hdr*)rdata->msg_info.via->next;
 	    if (hdr != &msg->hdr) {
-		hdr = pjsip_msg_find_hdr(msg, PJSIP_H_VIA, hdr);
+		hdr = (pjsip_hdr*)pjsip_msg_find_hdr(msg, PJSIP_H_VIA, hdr);
 		if (hdr) {
 		    mgr->on_rx_msg(mgr->endpt, PJSIP_EMULTIPLEVIA, rdata);
@@ -964,5 +964,5 @@
     pj_memcpy(&key.addr, remote, addr_len);
 
-    transport = pj_hash_get(mgr->table, &key, key_len, NULL);
+    transport = (pjsip_transport*)pj_hash_get(mgr->table, &key, key_len, NULL);
     if (transport == NULL) {
 	unsigned flag = pjsip_transport_get_flag_from_type(type);
@@ -977,5 +977,6 @@
 	    pj_memset(addr, 0, sizeof(pj_sockaddr_in));
 	    key_len = sizeof(key.type) + sizeof(pj_sockaddr_in);
-	    transport = pj_hash_get(mgr->table, &key, key_len, NULL);
+	    transport = (pjsip_transport*)
+			pj_hash_get(mgr->table, &key, key_len, NULL);
 	}
 	/* For datagram INET transports, try lookup with zero address.
@@ -990,5 +991,6 @@
 
 	    key_len = sizeof(key.type) + sizeof(pj_sockaddr_in);
-	    transport = pj_hash_get(mgr->table, &key, key_len, NULL);
+	    transport = (pjsip_transport*)
+			pj_hash_get(mgr->table, &key, key_len, NULL);
 	}
     }
@@ -1023,5 +1025,6 @@
     /* Request factory to create transport. */
     status = factory->create_transport(factory, mgr, mgr->endpt,
-				       remote, addr_len, tp);
+				       (const pj_sockaddr *)remote, 
+				       addr_len, tp);
     if (status == PJ_SUCCESS) {
 	PJ_ASSERT_ON_FAIL(tp!=NULL, 
@@ -1054,5 +1057,5 @@
 
 	do {
-	    pjsip_transport *t = pj_hash_this(mgr->table, itr);
+	    pjsip_transport *t = (pjsip_transport *) pj_hash_this(mgr->table, itr);
 
 	    PJ_LOG(3, (THIS_FILE, "  %s %s (refcnt=%d)", 
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_transport_loop.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_transport_loop.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_transport_loop.c	(revision 789)
@@ -78,5 +78,5 @@
 	return NULL;
 
-    pkt = pj_pool_zalloc(pool, sizeof(struct recv_list));
+    pkt = (struct recv_list *) pj_pool_zalloc(pool, sizeof(struct recv_list));
 
     /* Initialize rdata. */
@@ -120,5 +120,6 @@
     pjsip_tx_data_add_ref(tdata);
     pj_lock_acquire(tdata->lock);
-    sent_status = pj_pool_alloc(tdata->pool, sizeof(struct send_list));
+    sent_status = (struct send_list *)
+		  pj_pool_alloc(tdata->pool, sizeof(struct send_list));
     pj_lock_release(tdata->lock);
 
@@ -253,5 +254,5 @@
 static int loop_transport_worker_thread(void *arg)
 {
-    struct loop_transport *loop = arg;
+    struct loop_transport *loop = (struct loop_transport *) arg;
     struct recv_list r;
     struct send_list s;
@@ -356,5 +357,6 @@
 
     /* Create the loop structure. */
-    loop = pj_pool_zalloc(pool, sizeof(struct loop_transport));
+    loop = (struct loop_transport*) 
+	   pj_pool_zalloc(pool, sizeof(struct loop_transport));
     
     /* Initialize transport properties. */
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_transport_udp.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_transport_udp.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_transport_udp.c	(revision 789)
@@ -17,5 +17,5 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
-#include <pjsip/sip_transport.h>
+#include <pjsip/sip_transport_udp.h>
 #include <pjsip/sip_endpoint.h>
 #include <pjsip/sip_errno.h>
@@ -82,5 +82,5 @@
     pj_pool_reset(pool);
 
-    rdata = pj_pool_zalloc(pool, sizeof(pjsip_rx_data));
+    rdata = (pjsip_rx_data*) pj_pool_zalloc(pool, sizeof(pjsip_rx_data));
 
     /* Init tp_info part. */
@@ -261,5 +261,5 @@
 				   pj_ssize_t bytes_sent)
 {
-    struct udp_transport *tp = pj_ioqueue_get_user_data(key);
+    struct udp_transport *tp = (struct udp_transport *) pj_ioqueue_get_user_data(key);
     pjsip_tx_data_op_key *tdata_op_key = (pjsip_tx_data_op_key*)op_key;
 
@@ -337,6 +337,8 @@
 
     /* Unregister from ioqueue. */
-    if (tp->key)
+    if (tp->key) {
 	pj_ioqueue_unregister(tp->key);
+	tp->sock = PJ_INVALID_SOCKET;
+    }
 
     /* Close socket. */
@@ -425,5 +427,6 @@
 
     /* Create the UDP transport object. */
-    tp = pj_pool_zalloc(pool, sizeof(struct udp_transport));
+    tp = (struct udp_transport*) 
+	 pj_pool_zalloc(pool, sizeof(struct udp_transport));
 
     /* Save pool. */
@@ -474,5 +477,5 @@
 
     /* Transport info. */
-    tp->base.info = pj_pool_alloc(pool, 80);
+    tp->base.info = (char*) pj_pool_alloc(pool, 80);
     pj_ansi_sprintf( 
 	tp->base.info, "udp %s:%d [published as %s:%d]",
@@ -519,5 +522,6 @@
     /* Create rdata and put it in the array. */
     tp->rdata_cnt = 0;
-    tp->rdata = pj_pool_calloc(tp->base.pool, async_cnt, 
+    tp->rdata = (pjsip_rx_data**)
+	        pj_pool_calloc(tp->base.pool, async_cnt, 
 			       sizeof(pjsip_rx_data*));
     for (i=0; i<async_cnt; ++i) {
@@ -553,4 +557,5 @@
 	} else if (status != PJ_EPENDING) {
 	    /* Error! */
+	    pj_atomic_dec(tp->base.ref_cnt);
 	    pjsip_transport_unregister(tp->base.tpmgr, &tp->base);
 	    return status;
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_ua_layer.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_ua_layer.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_ua_layer.c	(revision 789)
@@ -166,5 +166,5 @@
 
     /* Get the dialog where this transaction belongs. */
-    dlg = tsx->mod_data[mod_ua.mod.id];
+    dlg = (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id];
     
     /* If dialog instance has gone, it could mean that the dialog
@@ -245,5 +245,5 @@
 
     set_key->slen = call_id->slen + local_tag->slen + 1;
-    set_key->ptr = pj_pool_alloc(pool, set_key->slen);
+    set_key->ptr = (char*) pj_pool_alloc(pool, set_key->slen);
     pj_assert(set_key->ptr != NULL);
 
@@ -268,5 +268,6 @@
 	return set;
     } else {
-	set = pj_pool_alloc(mod_ua.pool, sizeof(struct dlg_set));
+	set = (struct dlg_set *) 
+	      pj_pool_alloc(mod_ua.pool, sizeof(struct dlg_set));
 	return set;
     }
@@ -299,5 +300,6 @@
 	struct dlg_set *dlg_set;
 
-	dlg_set = pj_hash_get( mod_ua.dlg_table, dlg->local.info->tag.ptr, 
+	dlg_set = (struct dlg_set *)
+		  pj_hash_get( mod_ua.dlg_table, dlg->local.info->tag.ptr, 
 			       dlg->local.info->tag.slen,
 			       &dlg->local.tag_hval);
@@ -367,5 +369,5 @@
 
     /* Find this dialog from the dialog set. */
-    dlg_set = dlg->dlg_set;
+    dlg_set = (struct dlg_set *) dlg->dlg_set;
     d = dlg_set->dlg_list.next;
     while (d != (pjsip_dialog*)&dlg_set->dlg_list && d != dlg) {
@@ -401,10 +403,10 @@
 PJ_DEF(pjsip_dialog*) pjsip_rdata_get_dlg( pjsip_rx_data *rdata )
 {
-    return rdata->endpt_info.mod_data[mod_ua.mod.id];
+    return (pjsip_dialog*) rdata->endpt_info.mod_data[mod_ua.mod.id];
 }
 
 PJ_DEF(pjsip_dialog*) pjsip_tsx_get_dlg( pjsip_transaction *tsx )
 {
-    return tsx->mod_data[mod_ua.mod.id];
+    return (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id];
 }
 
@@ -442,5 +444,5 @@
 	/* We should find the dialog attached to the INVITE transaction */
 	if (tsx) {
-	    dlg = tsx->mod_data[mod_ua.mod.id];
+	    dlg = (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id];
 	    pj_mutex_unlock(tsx->mutex);
 
@@ -448,5 +450,5 @@
 	     * (e.g. during debugging where initially there is a dialog)
 	     */
-	    return dlg ? dlg->dlg_set : NULL;
+	    return dlg ? (struct dlg_set *)dlg->dlg_set : NULL;
 
 	} else {
@@ -465,5 +467,6 @@
 
 	/* Lookup the dialog set. */
-	dlg_set = pj_hash_get(mod_ua.dlg_table, tag->ptr, tag->slen, NULL);
+	dlg_set = (struct dlg_set *) 
+		  pj_hash_get(mod_ua.dlg_table, tag->ptr, tag->slen, NULL);
 	return dlg_set;
     }
@@ -594,5 +597,5 @@
 
 	/* Get the dialog set. */
-	dlg_set = dlg->dlg_set;
+	dlg_set = (struct dlg_set *)dlg->dlg_set;
 
 	/* Even if transaction is found and (candidate) dialog has been 
@@ -622,5 +625,6 @@
 
 	/* Get the dialog set. */
-	dlg_set = pj_hash_get(mod_ua.dlg_table, 
+	dlg_set = (struct dlg_set *)
+		  pj_hash_get(mod_ua.dlg_table, 
 			      rdata->msg_info.from->tag.ptr,
 			      rdata->msg_info.from->tag.slen,
@@ -801,5 +805,5 @@
 	    const char *title;
 
-	    dlg_set = pj_hash_this(mod_ua.dlg_table, it);
+	    dlg_set = (struct dlg_set *) pj_hash_this(mod_ua.dlg_table, it);
 	    if (!dlg_set || pj_list_empty(&dlg_set->dlg_list)) continue;
 
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_uri.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_uri.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_uri.c	(revision 789)
@@ -61,5 +61,6 @@
     pj_list_init(dst_list);
     while (p != src_list) {
-	pjsip_param *new_param = pj_pool_alloc(pool, sizeof(pjsip_param));
+	pjsip_param *new_param = (pjsip_param *)
+				 pj_pool_alloc(pool, sizeof(pjsip_param));
 	pj_strdup(pool, &new_param->name, &p->name);
 	pj_strdup(pool, &new_param->value, &p->value);
@@ -78,5 +79,6 @@
     pj_list_init(dst_list);
     while (p != src_list) {
-	pjsip_param *new_param = pj_pool_alloc(pool, sizeof(pjsip_param));
+	pjsip_param *new_param = (pjsip_param *) 
+				 pj_pool_alloc(pool, sizeof(pjsip_param));
 	new_param->name = p->name;
 	new_param->value = p->value;
@@ -156,29 +158,39 @@
 				      const pjsip_sip_uri *rhs);
 
+typedef const pj_str_t* (*FGETSCHEME)(const void *uri);
+typedef void* (*FGETURI)(void *uri);
+typedef pj_ssize_t (*FPRINT)(pjsip_uri_context_e context,
+			     const void *uri, 
+			     char *buf, pj_size_t size);
+typedef pj_status_t (*FCOMPARE)(pjsip_uri_context_e context, 
+			        const void *uri1, const void *uri2);
+typedef void *(*FCLONE)(pj_pool_t *pool, const void *uri);
+
+
 static pjsip_uri_vptr sip_url_vptr = 
 {
-    HAPPY_FLAG &pjsip_url_get_scheme,
-    HAPPY_FLAG &pjsip_get_uri,
-    HAPPY_FLAG &pjsip_url_print,
-    HAPPY_FLAG &pjsip_url_compare,
-    HAPPY_FLAG &pjsip_url_clone
+    (FGETSCHEME)&pjsip_url_get_scheme,
+    (FGETURI)	&pjsip_get_uri,
+    (FPRINT)	&pjsip_url_print,
+    (FCOMPARE)	&pjsip_url_compare,
+    (FCLONE)	&pjsip_url_clone
 };
 
 static pjsip_uri_vptr sips_url_vptr = 
 {
-    HAPPY_FLAG &pjsips_url_get_scheme,
-    HAPPY_FLAG &pjsip_get_uri,
-    HAPPY_FLAG &pjsip_url_print,
-    HAPPY_FLAG &pjsip_url_compare,
-    HAPPY_FLAG &pjsip_url_clone
+    (FGETSCHEME)&pjsips_url_get_scheme,
+    (FGETURI)	&pjsip_get_uri,
+    (FPRINT)	&pjsip_url_print,
+    (FCOMPARE)	&pjsip_url_compare,
+    (FCLONE)	&pjsip_url_clone
 };
 
 static pjsip_uri_vptr name_addr_vptr = 
 {
-    HAPPY_FLAG &pjsip_name_addr_get_scheme,
-    HAPPY_FLAG &pjsip_name_addr_get_uri,
-    HAPPY_FLAG &pjsip_name_addr_print,
-    HAPPY_FLAG &pjsip_name_addr_compare,
-    HAPPY_FLAG &pjsip_name_addr_clone
+    (FGETSCHEME)&pjsip_name_addr_get_scheme,
+    (FGETURI)	&pjsip_name_addr_get_uri,
+    (FPRINT)	&pjsip_name_addr_print,
+    (FCOMPARE)	&pjsip_name_addr_compare,
+    (FCLONE)	&pjsip_name_addr_clone
 };
 
@@ -216,5 +228,5 @@
 PJ_DEF(pjsip_sip_uri*) pjsip_sip_uri_create( pj_pool_t *pool, int secure )
 {
-    pjsip_sip_uri *url = pj_pool_alloc(pool, sizeof(pjsip_sip_uri));
+    pjsip_sip_uri *url = (pjsip_sip_uri *)pj_pool_alloc(pool, sizeof(pjsip_sip_uri));
     pjsip_sip_uri_init(url, secure);
     return url;
@@ -485,5 +497,5 @@
 static pjsip_sip_uri* pjsip_url_clone(pj_pool_t *pool, const pjsip_sip_uri *rhs)
 {
-    pjsip_sip_uri *url = pj_pool_alloc(pool, sizeof(pjsip_sip_uri));
+    pjsip_sip_uri *url = (pjsip_sip_uri *)pj_pool_alloc(pool, sizeof(pjsip_sip_uri));
     if (!url)
 	return NULL;
@@ -509,5 +521,5 @@
 PJ_DEF(pjsip_name_addr*) pjsip_name_addr_create(pj_pool_t *pool)
 {
-    pjsip_name_addr *name_addr = pj_pool_alloc(pool, sizeof(pjsip_name_addr));
+    pjsip_name_addr *name_addr = (pjsip_name_addr *)pj_pool_alloc(pool, sizeof(pjsip_name_addr));
     pjsip_name_addr_init(name_addr);
     return name_addr;
@@ -552,5 +564,5 @@
 {
     pj_strdup( pool, &dst->display, &src->display);
-    dst->uri = pjsip_uri_clone(pool, src->uri);
+    dst->uri = (pjsip_uri*)pjsip_uri_clone(pool, src->uri);
 }
 
@@ -558,5 +570,5 @@
 					       const pjsip_name_addr *rhs)
 {
-    pjsip_name_addr *addr = pj_pool_alloc(pool, sizeof(pjsip_name_addr));
+    pjsip_name_addr *addr = (pjsip_name_addr *)pj_pool_alloc(pool, sizeof(pjsip_name_addr));
     if (!addr)
 	return NULL;
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_util.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_util.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_util.c	(revision 789)
@@ -85,5 +85,5 @@
     endpt_hdr = pjsip_endpt_get_request_headers(endpt)->next;
     while (endpt_hdr != pjsip_endpt_get_request_headers(endpt)) {
-	pjsip_hdr *hdr = pjsip_hdr_shallow_clone(tdata->pool, endpt_hdr);
+	pjsip_hdr *hdr = (pjsip_hdr *)pjsip_hdr_shallow_clone(tdata->pool, endpt_hdr);
 	pjsip_msg_add_hdr( tdata->msg, hdr );
 	endpt_hdr = endpt_hdr->next;
@@ -93,24 +93,24 @@
     if (param_from->tag.slen == 0)
 	pj_create_unique_string(tdata->pool, &param_from->tag);
-    pjsip_msg_add_hdr(msg, (void*)param_from);
+    pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_from);
 
     /* Add To header. */
-    pjsip_msg_add_hdr(msg, (void*)param_to);
+    pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_to);
 
     /* Add Contact header. */
     if (param_contact) {
-	pjsip_msg_add_hdr(msg, (void*)param_contact);
+	pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_contact);
     }
 
     /* Add Call-ID header. */
-    pjsip_msg_add_hdr(msg, (void*)param_call_id);
+    pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_call_id);
 
     /* Add CSeq header. */
-    pjsip_msg_add_hdr(msg, (void*)param_cseq);
+    pjsip_msg_add_hdr(msg, (pjsip_hdr*)param_cseq);
 
     /* Add a blank Via header in the front of the message. */
     via = pjsip_via_hdr_create(tdata->pool);
     via->rport_param = 0;
-    pjsip_msg_insert_first_hdr(msg, (void*)via);
+    pjsip_msg_insert_first_hdr(msg, (pjsip_hdr*)via);
 
     /* Add header params as request headers */
@@ -135,5 +135,5 @@
     /* Create message body. */
     if (param_text) {
-	body = pj_pool_calloc(tdata->pool, 1, sizeof(pjsip_msg_body));
+	body = (pjsip_msg_body*) pj_pool_calloc(tdata->pool, 1, sizeof(pjsip_msg_body));
 	body->content_type.type = str_TEXT;
 	body->content_type.subtype = str_PLAIN;
@@ -297,14 +297,14 @@
     PJ_TRY {
 	/* Duplicate target URI and headers. */
-	target = pjsip_uri_clone(tdata->pool, param_target);
-	from = pjsip_hdr_clone(tdata->pool, param_from);
+	target = (pjsip_uri*) pjsip_uri_clone(tdata->pool, param_target);
+	from = (pjsip_fromto_hdr*) pjsip_hdr_clone(tdata->pool, param_from);
 	pjsip_fromto_hdr_set_from(from);
-	to = pjsip_hdr_clone(tdata->pool, param_to);
+	to = (pjsip_fromto_hdr*)pjsip_hdr_clone(tdata->pool, param_to);
 	pjsip_fromto_hdr_set_to(to);
 	if (param_contact)
-	    contact = pjsip_hdr_clone(tdata->pool, param_contact);
+	    contact = (pjsip_contact_hdr*) pjsip_hdr_clone(tdata->pool, param_contact);
 	else
 	    contact = NULL;
-	call_id = pjsip_hdr_clone(tdata->pool, param_call_id);
+	call_id = (pjsip_cid_hdr*) pjsip_hdr_clone(tdata->pool, param_call_id);
 	cseq = pjsip_cseq_hdr_create(tdata->pool);
 	if (param_cseq >= 0)
@@ -386,8 +386,8 @@
     via = rdata->msg_info.via;
     while (via) {
-	pjsip_msg_add_hdr( msg, pjsip_hdr_clone(tdata->pool, via));
+	pjsip_msg_add_hdr( msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, via));
 	via = via->next;
 	if (via != (void*)&req_msg->hdr)
-	    via = pjsip_msg_find_hdr(req_msg, PJSIP_H_VIA, via);
+	    via = (pjsip_via_hdr*) pjsip_msg_find_hdr(req_msg, PJSIP_H_VIA, via);
 	else
 	    break;
@@ -395,10 +395,10 @@
 
     /* Copy all Record-Route headers, in order. */
-    rr = pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, NULL);
+    rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, NULL);
     while (rr) {
-	pjsip_msg_add_hdr(msg, pjsip_hdr_clone(tdata->pool, rr));
+	pjsip_msg_add_hdr(msg, (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rr));
 	rr = rr->next;
 	if (rr != (void*)&req_msg->hdr)
-	    rr = pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, rr);
+	    rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(req_msg, PJSIP_H_RECORD_ROUTE, rr);
 	else
 	    break;
@@ -406,17 +406,17 @@
 
     /* Copy Call-ID header. */
-    hdr = pjsip_msg_find_hdr( req_msg, PJSIP_H_CALL_ID, NULL);
-    pjsip_msg_add_hdr(msg, pjsip_hdr_clone(tdata->pool, hdr));
+    hdr = (pjsip_hdr*) pjsip_msg_find_hdr( req_msg, PJSIP_H_CALL_ID, NULL);
+    pjsip_msg_add_hdr(msg, (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr));
 
     /* Copy From header. */
-    hdr = pjsip_hdr_clone(tdata->pool, rdata->msg_info.from);
+    hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.from);
     pjsip_msg_add_hdr( msg, hdr);
 
     /* Copy To header. */
-    hdr = pjsip_hdr_clone(tdata->pool, rdata->msg_info.to);
+    hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.to);
     pjsip_msg_add_hdr( msg, hdr);
 
     /* Copy CSeq header. */
-    hdr = pjsip_hdr_clone(tdata->pool, rdata->msg_info.cseq);
+    hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, rdata->msg_info.cseq);
     pjsip_msg_add_hdr( msg, hdr);
 
@@ -495,21 +495,21 @@
 
     /* Clear Via headers in the new request. */
-    while ((via=pjsip_msg_find_hdr(ack->msg, PJSIP_H_VIA, NULL)) != NULL)
+    while ((via=(pjsip_hdr*)pjsip_msg_find_hdr(ack->msg, PJSIP_H_VIA, NULL)) != NULL)
 	pj_list_erase(via);
 
     /* Must contain single Via, just as the original INVITE. */
-    hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_VIA, NULL);
-    pjsip_msg_insert_first_hdr( ack->msg, pjsip_hdr_clone(ack->pool,hdr) );
+    hdr = (pjsip_hdr*) pjsip_msg_find_hdr( invite_msg, PJSIP_H_VIA, NULL);
+    pjsip_msg_insert_first_hdr( ack->msg, (pjsip_hdr*) pjsip_hdr_clone(ack->pool,hdr) );
 
     /* If the original INVITE has Route headers, those header fields MUST 
      * appear in the ACK.
      */
-    hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, NULL);
+    hdr = (pjsip_hdr*) pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, NULL);
     while (hdr != NULL) {
-	pjsip_msg_add_hdr( ack->msg, pjsip_hdr_clone(ack->pool, hdr) );
+	pjsip_msg_add_hdr( ack->msg, (pjsip_hdr*) pjsip_hdr_clone(ack->pool, hdr) );
 	hdr = hdr->next;
 	if (hdr == &invite_msg->hdr)
 	    break;
-	hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, hdr);
+	hdr = (pjsip_hdr*) pjsip_msg_find_hdr( invite_msg, PJSIP_H_ROUTE, hdr);
     }
 
@@ -579,5 +579,5 @@
 
     /* Clear Via headers in the new request. */
-    while ((via=pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_VIA, NULL)) != NULL)
+    while ((via=(pjsip_hdr*)pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_VIA, NULL)) != NULL)
 	pj_list_erase(via);
 
@@ -586,8 +586,8 @@
      * request being cancelled. 
      */
-    hdr = pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_VIA, NULL);
+    hdr = (pjsip_hdr*) pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_VIA, NULL);
     if (hdr) {
 	pjsip_msg_insert_first_hdr(cancel_tdata->msg, 
-				   pjsip_hdr_clone(cancel_tdata->pool, hdr));
+				   (pjsip_hdr*) pjsip_hdr_clone(cancel_tdata->pool, hdr));
     }
 
@@ -596,11 +596,11 @@
      * Copy "Route" header from the request.
      */
-    hdr = pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_ROUTE, NULL);
+    hdr = (pjsip_hdr*) pjsip_msg_find_hdr(req_tdata->msg, PJSIP_H_ROUTE, NULL);
     while (hdr != NULL) {
 	pjsip_msg_add_hdr(cancel_tdata->msg, 
-			  pjsip_hdr_clone(cancel_tdata->pool, hdr));
+			  (pjsip_hdr*) pjsip_hdr_clone(cancel_tdata->pool, hdr));
 	hdr = hdr->next;
 	if (hdr != &cancel_tdata->msg->hdr)
-	    hdr = pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_ROUTE, hdr);
+	    hdr = (pjsip_hdr*) pjsip_msg_find_hdr(cancel_tdata->msg, PJSIP_H_ROUTE, hdr);
 	else
 	    break;
@@ -642,10 +642,11 @@
      */
     last_route_hdr = first_route_hdr = 
-	pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, NULL);
+	(pjsip_route_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, NULL);
     if (first_route_hdr) {
 	topmost_route_uri = &first_route_hdr->name_addr;
 	while (last_route_hdr->next != (void*)&tdata->msg->hdr) {
 	    pjsip_route_hdr *hdr;
-	    hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, 
+	    hdr = (pjsip_route_hdr*) 
+		  pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE, 
                                      last_route_hdr->next);
 	    if (!hdr)
@@ -672,5 +673,5 @@
 	    PJSIP_URI_SCHEME_IS_SIPS(topmost_route_uri))
 	{
-	    const pjsip_sip_uri *url = 
+	    const pjsip_sip_uri *url = (const pjsip_sip_uri *)
 		pjsip_uri_get_uri((void*)topmost_route_uri);
 	    has_lr_param = url->lr_param;
@@ -691,5 +692,6 @@
 	    */
 	} else {
-	    new_request_uri = pjsip_uri_get_uri((void*)topmost_route_uri);
+	    new_request_uri = (const pjsip_uri *) 
+			      pjsip_uri_get_uri((void*)topmost_route_uri);
 	    pj_list_erase(first_route_hdr);
 	    if (first_route_hdr == last_route_hdr)
@@ -758,5 +760,5 @@
 					 pj_ssize_t sent )
 {
-    pjsip_send_state *stateless_data = token;
+    pjsip_send_state *stateless_data = (pjsip_send_state *) token;
 
     PJ_UNUSED_ARG(tdata);
@@ -858,5 +860,6 @@
 	if (via->branch_param.slen == 0) {
 	    pj_str_t tmp;
-	    via->branch_param.ptr = pj_pool_alloc(tdata->pool,
+	    via->branch_param.ptr = (char*)
+				    pj_pool_alloc(tdata->pool,
 						  PJSIP_MAX_BRANCH_LEN);
 	    via->branch_param.slen = PJSIP_MAX_BRANCH_LEN;
@@ -902,5 +905,5 @@
 				  const struct pjsip_server_addresses *addr)
 {
-    pjsip_send_state *stateless_data = token;
+    pjsip_send_state *stateless_data = (pjsip_send_state *) token;
 
     /* Fail on server resolution. */
@@ -950,5 +953,6 @@
 
     /* Keep stateless data. */
-    stateless_data = pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state));
+    stateless_data = (pjsip_send_state *) 
+		     pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state));
     stateless_data->token = token;
     stateless_data->endpt = endpt;
@@ -1073,5 +1077,5 @@
 				       pj_ssize_t sent)
 {
-    pjsip_send_state *send_state = token;
+    pjsip_send_state *send_state = (pjsip_send_state *) token;
     pj_bool_t cont = PJ_FALSE;
 
@@ -1093,5 +1097,5 @@
 				       const pjsip_server_addresses *addr )
 {
-    pjsip_send_state *send_state = token;
+    pjsip_send_state *send_state = (pjsip_send_state *) token;
 
     if (status != PJ_SUCCESS) {
@@ -1161,5 +1165,6 @@
 
     /* Create structure to keep the sending state. */
-    send_state = pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state));
+    send_state = (pjsip_send_state *) 
+		 pj_pool_zalloc(tdata->pool, sizeof(pjsip_send_state));
     send_state->endpt = endpt;
     send_state->tdata = tdata;
@@ -1229,5 +1234,5 @@
 	const pjsip_hdr *hdr = hdr_list->next;
 	while (hdr != hdr_list) {
-	    pjsip_msg_add_hdr( tdata->msg, pjsip_hdr_clone(tdata->pool, hdr) );
+	    pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hdr) );
 	    hdr = hdr->next;
 	}
Index: /pjproject/branches/symbian/pjsip/src/pjsip/sip_util_statefull.c
===================================================================
--- /pjproject/branches/symbian/pjsip/src/pjsip/sip_util_statefull.c	(revision 788)
+++ /pjproject/branches/symbian/pjsip/src/pjsip/sip_util_statefull.c	(revision 789)
@@ -60,5 +60,5 @@
 	return;
 
-    tsx_data = tsx->mod_data[mod_stateful_util.id];
+    tsx_data = (struct tsx_data *) tsx->mod_data[mod_stateful_util.id];
     if (tsx_data == NULL)
 	return;
@@ -100,5 +100,6 @@
     }
 
-    tsx_data = pj_pool_alloc(tsx->pool, sizeof(struct tsx_data));
+    tsx_data = (struct tsx_data *) 
+	       pj_pool_alloc(tsx->pool, sizeof(struct tsx_data));
     tsx_data->token = token;
     tsx_data->cb = cb;
@@ -142,5 +143,5 @@
 	const pjsip_hdr *hdr = hdr_list->next;
 	while (hdr != hdr_list) {
-	    pjsip_msg_add_hdr( tdata->msg, pjsip_hdr_clone(tdata->pool, hdr) );
+	    pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hdr) );
 	    hdr = hdr->next;
 	}
Index: /pjproject/branches/symbian/symbian/bld.inf
===================================================================
--- /pjproject/branches/symbian/symbian/bld.inf	(revision 788)
+++ /pjproject/branches/symbian/symbian/bld.inf	(revision 789)
@@ -1,3 +1,9 @@
 prj_mmpfiles
 pjlib.mmp
+pjlib_util.mmp
+pjsip.mmp
+pjsip_simple.mmp
+pjsdp.mmp
+pjsip_ua.mmp
 pjlib_test.mmp
+sipstateless.mmp
Index: /pjproject/branches/symbian/symbian/pjlib.mmp
===================================================================
--- /pjproject/branches/symbian/symbian/pjlib.mmp	(revision 788)
+++ /pjproject/branches/symbian/symbian/pjlib.mmp	(revision 789)
@@ -5,4 +5,6 @@
 
 SOURCEPATH	..\pjlib\src\pj
+
+OPTION		CW -lang c++
 
 MACRO		PJ_M_I386=1
@@ -56,4 +58,6 @@
 
 SYSTEMINCLUDE	..\pjlib\include
+
 SYSTEMINCLUDE	\epoc32\include
 SYSTEMINCLUDE	\epoc32\include\libc
+
Index: /pjproject/branches/symbian/symbian/pjlib_test.mmp
===================================================================
--- /pjproject/branches/symbian/symbian/pjlib_test.mmp	(revision 788)
+++ /pjproject/branches/symbian/symbian/pjlib_test.mmp	(revision 789)
@@ -10,4 +10,5 @@
 MACRO		PJ_IMPORTING
 
+OPTION		CW -lang c++
 
 // Test files
@@ -48,4 +49,5 @@
 
 SYSTEMINCLUDE	..\pjlib\include
+
 SYSTEMINCLUDE	\epoc32\include
 SYSTEMINCLUDE	\epoc32\include\libc
Index: /pjproject/branches/symbian/symbian/pjlib_util.mmp
===================================================================
--- /pjproject/branches/symbian/symbian/pjlib_util.mmp	(revision 789)
+++ /pjproject/branches/symbian/symbian/pjlib_util.mmp	(revision 789)
@@ -0,0 +1,33 @@
+TARGET 		pjlib_util.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjlib-util\src\pjlib-util
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+OPTION		CW -lang c++
+
+// PJLIB-UTIL files
+
+SOURCE	errno.c
+SOURCE	getopt.c
+SOURCE	md5.c
+SOURCE	scanner.c
+SOURCE	string.c
+SOURCE	stun.c
+SOURCE	stun_client.c
+SOURCE	xml.c
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+LIBRARY		pjlib.lib 
+CAPABILITY	None
+
Index: /pjproject/branches/symbian/symbian/pjsdp.mmp
===================================================================
--- /pjproject/branches/symbian/symbian/pjsdp.mmp	(revision 789)
+++ /pjproject/branches/symbian/symbian/pjsdp.mmp	(revision 789)
@@ -0,0 +1,29 @@
+TARGET 		pjsdp.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjmedia\src\pjmedia
+
+OPTION		CW -lang c++
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_EXPORTING
+
+//
+// Platform independent source
+//
+SOURCE		errno.c
+SOURCE		sdp.c
+SOURCE		sdp_cmp.c
+SOURCE		sdp_neg.c
+
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjmedia\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
Index: /pjproject/branches/symbian/symbian/pjsip.mmp
===================================================================
--- /pjproject/branches/symbian/symbian/pjsip.mmp	(revision 789)
+++ /pjproject/branches/symbian/symbian/pjsip.mmp	(revision 789)
@@ -0,0 +1,45 @@
+TARGET 		pjsip.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjsip\src\pjsip
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+OPTION		CW -lang c++
+
+// PJSIP-CORE files
+
+SOURCE	sip_auth_client.c
+SOURCE	sip_auth_msg.c
+SOURCE	sip_auth_parser.c
+SOURCE	sip_auth_server.c
+SOURCE	sip_dialog.c
+SOURCE	sip_endpoint.c
+SOURCE	sip_errno.c
+SOURCE	sip_msg.c
+SOURCE	sip_parser.c
+SOURCE	sip_resolve.c
+SOURCE	sip_tel_uri.c
+SOURCE	sip_transaction.c
+SOURCE	sip_transport.c
+SOURCE	sip_transport_loop.c
+SOURCE	sip_transport_udp.c
+SOURCE	sip_ua_layer.c
+SOURCE	sip_uri.c
+SOURCE	sip_util.c
+SOURCE	sip_util_proxy.c
+SOURCE	sip_util_statefull.c
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjsip\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+CAPABILITY	None
+
Index: /pjproject/branches/symbian/symbian/pjsip_simple.mmp
===================================================================
--- /pjproject/branches/symbian/symbian/pjsip_simple.mmp	(revision 789)
+++ /pjproject/branches/symbian/symbian/pjsip_simple.mmp	(revision 789)
@@ -0,0 +1,33 @@
+TARGET 		pjsip_simple.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjsip\src\pjsip-simple
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+//OPTION		CW -lang c++
+
+
+// PJSIP-SIMPLE files
+
+SOURCE	errno.c
+SOURCE	evsub.c
+SOURCE	evsub_msg.c
+SOURCE	iscomposing.c
+SOURCE	pidf.c
+SOURCE	presence.c
+SOURCE	xpidf.c
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjsip\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+CAPABILITY	None
+
Index: /pjproject/branches/symbian/symbian/pjsip_ua.mmp
===================================================================
--- /pjproject/branches/symbian/symbian/pjsip_ua.mmp	(revision 789)
+++ /pjproject/branches/symbian/symbian/pjsip_ua.mmp	(revision 789)
@@ -0,0 +1,30 @@
+TARGET 		pjsip_ua.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjsip\src\pjsip-ua
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+//OPTION		CW -lang c++
+
+
+// PJSIP-SIMPLE files
+
+SOURCE	sip_inv.c
+SOURCE	sip_reg.c
+SOURCE	sip_xfer.c
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjsip\include 
+SYSTEMINCLUDE	..\pjmedia\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+CAPABILITY	None
+
Index: /pjproject/branches/symbian/symbian/sipstateless.mmp
===================================================================
--- /pjproject/branches/symbian/symbian/sipstateless.mmp	(revision 789)
+++ /pjproject/branches/symbian/symbian/sipstateless.mmp	(revision 789)
@@ -0,0 +1,42 @@
+TARGET 		sipstateless.exe
+TARGETTYPE 	exe
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjsip-apps\src\samples
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+OPTION		CW -lang c++
+
+// Test files
+
+SOURCE	sipstateless.c
+SOURCE	main_symbian.cpp
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjsip\include 
+SYSTEMINCLUDE	..\pjmedia\include
+
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+LIBRARY		pjsip_ua.lib 
+LIBRARY		pjsip_simple.lib 
+LIBRARY		pjsip.lib 
+LIBRARY		pjsdp.lib 
+LIBRARY		pjlib_util.lib 
+LIBRARY		pjlib.lib 
+LIBRARY		esock.lib 
+LIBRARY		insock.lib 
+LIBRARY		charconv.lib 
+LIBRARY		euser.lib 
+LIBRARY		estlib.lib 
+LIBRARY		eexe.lib
+STATICLIBRARY   ecrt0.lib
+CAPABILITY	None
+
