Index: /pjproject/trunk/build.symbian/pjlib_util.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjlib_util.mmp	(revision 1239)
+++ /pjproject/trunk/build.symbian/pjlib_util.mmp	(revision 1239)
@@ -0,0 +1,41 @@
+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	crc32.c
+SOURCE	dns.c
+SOURCE	dns_dump.c
+SOURCE	errno.c
+SOURCE	getopt.c
+SOURCE	hmac_md5.c
+SOURCE	hmac_sha1.c
+SOURCE	md5.c
+SOURCE	resolver.c
+SOURCE	scanner.c
+SOURCE	sha1.c
+SOURCE	srv_resolver.c
+SOURCE	string.c
+SOURCE	stun_simple.c
+SOURCE	stun_simple_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/trunk/build.symbian/pjnath.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjnath.mmp	(revision 1239)
+++ /pjproject/trunk/build.symbian/pjnath.mmp	(revision 1239)
@@ -0,0 +1,35 @@
+TARGET 		pjnath.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjnath\src\pjnath
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+OPTION		CW -lang c++
+
+// PJNATH files
+
+SOURCE	errno.c
+SOURCE	ice_session.c
+SOURCE	ice_strans.c
+SOURCE	stun_auth.c
+SOURCE	stun_msg.c
+SOURCE	stun_msg_dump.c
+SOURCE	stun_session.c
+SOURCE	stun_transaction.c
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include
+SYSTEMINCLUDE	..\pjnath\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+LIBRARY		pjlib.lib 
+LIBRARY		pjlib_util.lib 
+CAPABILITY	None
+
Index: /pjproject/trunk/build.symbian/pjstun_client.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjstun_client.mmp	(revision 1239)
+++ /pjproject/trunk/build.symbian/pjstun_client.mmp	(revision 1239)
@@ -0,0 +1,31 @@
+TARGET 		pjstun_client.exe
+TARGETTYPE 	exe
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjnath\src\pjstun-client
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+MACRO		PJ_IMPORTING
+
+OPTION		CW -lang c++
+
+// PJSTUN-CLIENT files
+
+SOURCE	client_main.c
+
+//SOURCE	main_symbian.cpp
+
+
+SYSTEMINCLUDE	..\pjlib\include
+SYSTEMINCLUDE	..\pjlib-util\include
+SYSTEMINCLUDE	..\pjnath\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+LIBRARY		pjnath.lib pjlib_util.lib pjlib.lib esock.lib insock.lib charconv.lib euser.lib estlib.lib eexe.lib
+STATICLIBRARY   ecrt0.lib
+CAPABILITY	None
+
Index: /pjproject/trunk/pjlib-util/src/pjlib-util/dns.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/dns.c	(revision 1238)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/dns.c	(revision 1239)
@@ -67,5 +67,5 @@
 
     /* Initialize header */
-    hdr = packet;
+    hdr = (pj_dns_hdr*) packet;
     pj_bzero(hdr, sizeof(struct pj_dns_hdr));
     hdr->id = pj_htons(id);
@@ -111,9 +111,9 @@
  * it may contain pointers when name compression is applied) 
  */
-static pj_status_t get_name_len(int rec_counter, const char *pkt, 
-				const char *start, const char *max, 
+static pj_status_t get_name_len(int rec_counter, const pj_uint8_t *pkt, 
+				const pj_uint8_t *start, const pj_uint8_t *max,
 				int *parsed_len, int *name_len)
 {
-    const char *p;
+    const pj_uint8_t *p;
     pj_status_t status;
 
@@ -181,9 +181,9 @@
  * it may contain pointers when compression is applied).
  */
-static pj_status_t get_name(int rec_counter, const char *pkt, 
-			    const char *start, const char *max,
+static pj_status_t get_name(int rec_counter, const pj_uint8_t *pkt, 
+			    const pj_uint8_t *start, const pj_uint8_t *max,
 			    pj_str_t *name)
 {
-    const char *p;
+    const pj_uint8_t *p;
     pj_status_t status;
 
@@ -242,8 +242,8 @@
 /* Skip query records. */
 static pj_status_t parse_query(pj_dns_parsed_query *q, pj_pool_t *pool,
-			       const char *pkt, const char *start, 
-			       const char *max, int *parsed_len)
-{
-    const char *p = start;
+			       const pj_uint8_t *pkt, const pj_uint8_t *start,
+			       const pj_uint8_t *max, int *parsed_len)
+{
+    const pj_uint8_t *p = start;
     int name_len, name_part_len;
     pj_status_t status;
@@ -255,5 +255,5 @@
 
     /* Allocate memory for the name */
-    q->name.ptr = pj_pool_alloc(pool, name_len+4);
+    q->name.ptr = (char*) pj_pool_alloc(pool, name_len+4);
     q->name.slen = 0;
 
@@ -283,9 +283,9 @@
 /* Parse RR records */
 static pj_status_t parse_rr(pj_dns_parsed_rr *rr, pj_pool_t *pool,
-			    const char *pkt,
-			    const char *start, const char *max, 
+			    const pj_uint8_t *pkt,
+			    const pj_uint8_t *start, const pj_uint8_t *max,
 			    int *parsed_len)
 {
-    const char *p = start;
+    const pj_uint8_t *p = start;
     int name_len, name_part_len;
     pj_status_t status;
@@ -297,5 +297,5 @@
 
     /* Allocate memory for the name */
-    rr->name.ptr = pj_pool_alloc(pool, name_len+4);
+    rr->name.ptr = (char*) pj_pool_alloc(pool, name_len+4);
     rr->name.slen = 0;
 
@@ -355,5 +355,5 @@
 
 	/* Allocate memory for the name */
-	rr->rdata.cname.name.ptr = pj_pool_alloc(pool, name_len);
+	rr->rdata.cname.name.ptr = (char*) pj_pool_alloc(pool, name_len);
 	rr->rdata.cname.name.slen = 0;
 
@@ -388,5 +388,5 @@
 
 	/* Allocate memory for the name */
-	rr->rdata.srv.target.ptr = pj_pool_alloc(pool, name_len);
+	rr->rdata.srv.target.ptr = (char*) pj_pool_alloc(pool, name_len);
 	rr->rdata.srv.target.slen = 0;
 
@@ -419,5 +419,5 @@
 {
     pj_dns_parsed_packet *res;
-    char *start, *end;
+    const pj_uint8_t *start, *end;
     pj_status_t status;
     unsigned i;
@@ -431,5 +431,5 @@
 
     /* Create the structure */
-    res = pj_pool_zalloc(pool, sizeof(pj_dns_parsed_packet));
+    res = PJ_POOL_ZALLOC_T(pool, pj_dns_parsed_packet);
 
     /* Copy the DNS header, and convert endianness to host byte order */
@@ -443,17 +443,18 @@
 
     /* Mark start and end of payload */
-    start = ((char*)packet) + sizeof(pj_dns_hdr);
-    end = ((char*)packet) + size;
+    start = ((const pj_uint8_t*)packet) + sizeof(pj_dns_hdr);
+    end = ((const pj_uint8_t*)packet) + size;
 
     /* Parse query records (if any).
      */
     if (res->hdr.qdcount) {
-	res->q = pj_pool_zalloc(pool, res->hdr.qdcount *
+	res->q = (pj_dns_parsed_query*)
+		 pj_pool_zalloc(pool, res->hdr.qdcount *
 				      sizeof(pj_dns_parsed_query));
 	for (i=0; i<res->hdr.qdcount; ++i) {
 	    int parsed_len = 0;
 	    
-	    status = parse_query(&res->q[i], pool, packet, start, end,
-				 &parsed_len);
+	    status = parse_query(&res->q[i], pool, (const pj_uint8_t*)packet, 
+	    			 start, end, &parsed_len);
 	    if (status != PJ_SUCCESS)
 		return status;
@@ -465,5 +466,6 @@
     /* Parse answer, if any */
     if (res->hdr.anscount) {
-	res->ans = pj_pool_zalloc(pool, res->hdr.anscount * 
+	res->ans = (pj_dns_parsed_rr*)
+		   pj_pool_zalloc(pool, res->hdr.anscount * 
 					sizeof(pj_dns_parsed_rr));
 
@@ -471,6 +473,6 @@
 	    int parsed_len;
 
-	    status = parse_rr(&res->ans[i], pool, packet, start, end, 
-			      &parsed_len);
+	    status = parse_rr(&res->ans[i], pool, (const pj_uint8_t*)packet, 
+	    		      start, end, &parsed_len);
 	    if (status != PJ_SUCCESS)
 		return status;
@@ -482,5 +484,6 @@
     /* Parse authoritative NS records, if any */
     if (res->hdr.nscount) {
-	res->ns = pj_pool_zalloc(pool, res->hdr.nscount *
+	res->ns = (pj_dns_parsed_rr*)
+		  pj_pool_zalloc(pool, res->hdr.nscount *
 				       sizeof(pj_dns_parsed_rr));
 
@@ -488,6 +491,6 @@
 	    int parsed_len;
 
-	    status = parse_rr(&res->ns[i], pool, packet, start, end, 
-			      &parsed_len);
+	    status = parse_rr(&res->ns[i], pool, (const pj_uint8_t*)packet, 
+	    		      start, end, &parsed_len);
 	    if (status != PJ_SUCCESS)
 		return status;
@@ -499,5 +502,6 @@
     /* Parse additional RR answer, if any */
     if (res->hdr.arcount) {
-	res->arr = pj_pool_zalloc(pool, res->hdr.arcount *
+	res->arr = (pj_dns_parsed_rr*)
+		   pj_pool_zalloc(pool, res->hdr.arcount *
 					sizeof(pj_dns_parsed_rr));
 
@@ -505,6 +509,6 @@
 	    int parsed_len;
 
-	    status = parse_rr(&res->arr[i], pool, packet, start, end, 
-			      &parsed_len);
+	    status = parse_rr(&res->arr[i], pool, (const pj_uint8_t*)packet, 
+	    		      start, end, &parsed_len);
 	    if (status != PJ_SUCCESS)
 		return status;
@@ -614,5 +618,5 @@
 
     /* Create packet and copy header */
-    *p_dst = dst = pj_pool_zalloc(pool, sizeof(pj_dns_parsed_packet));
+    *p_dst = dst = PJ_POOL_ZALLOC_T(pool, pj_dns_parsed_packet);
     pj_memcpy(&dst->hdr, &p->hdr, sizeof(p->hdr));
 
@@ -629,5 +633,6 @@
     /* Copy query section */
     if (p->hdr.qdcount && (options & PJ_DNS_NO_QD)==0) {
-	dst->q = pj_pool_alloc(pool, p->hdr.qdcount * 
+	dst->q = (pj_dns_parsed_query*)
+		 pj_pool_alloc(pool, p->hdr.qdcount * 
 				     sizeof(pj_dns_parsed_query));
 	for (i=0; i<p->hdr.qdcount; ++i) {
@@ -640,5 +645,6 @@
     /* Copy answer section */
     if (p->hdr.anscount && (options & PJ_DNS_NO_ANS)==0) {
-	dst->ans = pj_pool_alloc(pool, p->hdr.anscount * 
+	dst->ans = (pj_dns_parsed_rr*)
+		   pj_pool_alloc(pool, p->hdr.anscount * 
 				       sizeof(pj_dns_parsed_rr));
 	for (i=0; i<p->hdr.anscount; ++i) {
@@ -651,5 +657,6 @@
     /* Copy NS section */
     if (p->hdr.nscount && (options & PJ_DNS_NO_NS)==0) {
-	dst->ns = pj_pool_alloc(pool, p->hdr.nscount * 
+	dst->ns = (pj_dns_parsed_rr*)
+		  pj_pool_alloc(pool, p->hdr.nscount * 
 				      sizeof(pj_dns_parsed_rr));
 	for (i=0; i<p->hdr.nscount; ++i) {
@@ -662,5 +669,6 @@
     /* Copy additional info section */
     if (p->hdr.arcount && (options & PJ_DNS_NO_AR)==0) {
-	dst->arr = pj_pool_alloc(pool, p->hdr.arcount * 
+	dst->arr = (pj_dns_parsed_rr*)
+		   pj_pool_alloc(pool, p->hdr.arcount * 
 				       sizeof(pj_dns_parsed_rr));
 	for (i=0; i<p->hdr.arcount; ++i) {
Index: /pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c	(revision 1238)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c	(revision 1239)
@@ -244,5 +244,5 @@
 
     /* Create pool and name */
-    resv = pj_pool_zalloc(pool, sizeof(struct pj_dns_resolver));
+    resv = PJ_POOL_ZALLOC_T(pool, struct pj_dns_resolver);
     resv->pool = pool;
     resv->udp_sock = PJ_INVALID_SOCKET;
@@ -338,5 +338,6 @@
 	it = pj_hash_first(resolver->hquerybyid, &it_buf);
 	while (it) {
-	    pj_dns_async_query *q = pj_hash_this(resolver->hquerybyid, it);
+	    pj_dns_async_query *q = (pj_dns_async_query *)
+	    			    pj_hash_this(resolver->hquerybyid, it);
 	    pj_dns_async_query *cq;
 	    if (q->cb)
@@ -498,5 +499,5 @@
 	pj_bzero(q, sizeof(*q));
     } else {
-	q = pj_pool_zalloc(resolver->pool, sizeof(*q));
+	q = PJ_POOL_ZALLOC_T(resolver->pool, pj_dns_async_query);
     }
 
@@ -658,5 +659,6 @@
      */
     hval = 0;
-    cache = pj_hash_get(resolver->hrescache, &key, sizeof(key), &hval);
+    cache = (struct cached_res *) pj_hash_get(resolver->hrescache, &key, 
+    					      sizeof(key), &hval);
     if (cache) {
 	/* We've found a cached entry. */
@@ -703,5 +705,6 @@
 
     /* Next, check if we have pending query on the same resource */
-    q = pj_hash_get(resolver->hquerybyres, &key, sizeof(key), NULL);
+    q = (pj_dns_async_query *) pj_hash_get(resolver->hquerybyres, &key, 
+    					   sizeof(key), NULL);
     if (q) {
 	/* Yes, there's another pending query to the same key.
@@ -942,5 +945,6 @@
     /* If status is unsuccessful, clear the same entry from the cache */
     if (status != PJ_SUCCESS) {
-	cache = pj_hash_get(resolver->hrescache, key, sizeof(*key), &hval);
+	cache = (struct cached_res *) pj_hash_get(resolver->hrescache, key, 
+						  sizeof(*key), &hval);
 	if (cache)
 	    pj_list_push_back(&resolver->res_free_nodes, cache);
@@ -977,5 +981,6 @@
     /* If TTL is zero, clear the same entry in the hash table */
     if (ttl == 0) {
-	cache = pj_hash_get(resolver->hrescache, key, sizeof(*key), &hval);
+	cache = (struct cached_res *) pj_hash_get(resolver->hrescache, key, 
+						  sizeof(*key), &hval);
 	if (cache)
 	    pj_list_push_back(&resolver->res_free_nodes, cache);
@@ -985,5 +990,6 @@
 
     /* Get a cache response entry */
-    cache = pj_hash_get(resolver->hrescache, key, sizeof(*key), &hval);
+    cache = (struct cached_res *) pj_hash_get(resolver->hrescache, key, 
+    					      sizeof(*key), &hval);
     if (cache == NULL) {
 	if (!pj_list_empty(&resolver->res_free_nodes)) {
@@ -991,5 +997,5 @@
 	    pj_list_erase(cache);
 	} else {
-	    cache = pj_pool_zalloc(resolver->pool, sizeof(*cache));
+	    cache = PJ_POOL_ZALLOC_T(resolver->pool, struct cached_res);
 	}
     }
@@ -1041,5 +1047,5 @@
     PJ_UNUSED_ARG(timer_heap);
 
-    q = entry->user_data;
+    q = (pj_dns_async_query *) entry->user_data;
     resolver = q->resolver;
 
@@ -1125,5 +1131,5 @@
 
 
-    resolver = pj_ioqueue_get_user_data(key);
+    resolver = (pj_dns_resolver *) pj_ioqueue_get_user_data(key);
     pj_mutex_lock(resolver->mutex);
 
@@ -1188,5 +1194,6 @@
 
     /* Find the query based on the transaction ID */
-    q = pj_hash_get(resolver->hquerybyid, &dns_pkt->hdr.id, 
+    q = (pj_dns_async_query*) 
+        pj_hash_get(resolver->hquerybyid, &dns_pkt->hdr.id,
 		    sizeof(dns_pkt->hdr.id), NULL);
     if (!q) {
@@ -1372,5 +1379,6 @@
 	it = pj_hash_first(resolver->hrescache, &itbuf);
 	while (it) {
-	    struct cached_res *cache = pj_hash_this(resolver->hrescache, it);
+	    struct cached_res *cache;
+	    cache = (struct cached_res*)pj_hash_this(resolver->hrescache, it);
 	    PJ_LOG(3,(resolver->name.ptr, 
 		      "   Type %s: %s",
@@ -1390,5 +1398,5 @@
 	while (it) {
 	    struct pj_dns_async_query *q;
-	    q = pj_hash_this(resolver->hquerybyid, it);
+	    q = (pj_dns_async_query*) pj_hash_this(resolver->hquerybyid, it);
 	    PJ_LOG(3,(resolver->name.ptr, 
 		      "   Type %s: %s",
Index: /pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c	(revision 1238)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c	(revision 1239)
@@ -382,5 +382,5 @@
 			 pj_dns_parsed_packet *pkt)
 {
-    pj_dns_srv_resolver_job *query_job = user_data;
+    pj_dns_srv_resolver_job *query_job = (pj_dns_srv_resolver_job*) user_data;
     unsigned i;
 
Index: /pjproject/trunk/pjlib-util/src/pjlib-util/string.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/string.c	(revision 1238)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/string.c	(revision 1239)
@@ -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/trunk/pjlib-util/src/pjlib-util/stun_simple.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple.c	(revision 1238)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple.c	(revision 1239)
@@ -36,5 +36,5 @@
 
 
-    hdr = pj_pool_calloc(pool, 1, sizeof(pjstun_msg_hdr));
+    hdr = PJ_POOL_ZALLOC_T(pool, pjstun_msg_hdr);
     if (!hdr)
 	return PJ_ENOMEM;
Index: /pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple_client.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple_client.c	(revision 1238)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple_client.c	(revision 1239)
@@ -42,5 +42,5 @@
     int i, j, send_cnt = 0;
     pj_pool_t *pool;
-    struct {
+    struct query_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 query_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) {
-		pjstun_msg_hdr *msg_hdr = out_msg;
+		pjstun_msg_hdr *msg_hdr = (pjstun_msg_hdr*) out_msg;
                 pj_ssize_t sent_len;
 
@@ -195,5 +195,6 @@
 		}
 
-		attr = (void*)pjstun_msg_find_attr(&msg, PJSTUN_ATTR_MAPPED_ADDR);
+		attr = (pjstun_mapped_addr_attr*) 
+		       pjstun_msg_find_attr(&msg, PJSTUN_ATTR_MAPPED_ADDR);
 		if (!attr) {
 		    status = PJLIB_UTIL_ESTUNNOMAP;
Index: /pjproject/trunk/pjlib-util/src/pjlib-util/xml.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/xml.c	(revision 1238)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/xml.c	(revision 1239)
@@ -38,5 +38,5 @@
     pj_xml_node *node;
 
-    node = pj_pool_zalloc(pool, sizeof(pj_xml_node));
+    node = PJ_POOL_ZALLOC_T(pool, 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_POOL_ZALLOC_T(pool, pj_xml_attr);
 }
 
@@ -394,5 +394,5 @@
 				  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/trunk/pjnath/src/pjnath/ice_session.c
===================================================================
--- /pjproject/trunk/pjnath/src/pjnath/ice_session.c	(revision 1238)
+++ /pjproject/trunk/pjnath/src/pjnath/ice_session.c	(revision 1239)
@@ -297,5 +297,5 @@
 
     if (local_ufrag == NULL) {
-	ice->rx_ufrag.ptr = pj_pool_alloc(ice->pool, 16);
+	ice->rx_ufrag.ptr = (char*) pj_pool_alloc(ice->pool, 16);
 	pj_create_random_string(ice->rx_ufrag.ptr, 16);
 	ice->rx_ufrag.slen = 16;
@@ -305,5 +305,5 @@
 
     if (local_passwd == NULL) {
-	ice->rx_pass.ptr = pj_pool_alloc(ice->pool, 16);
+	ice->rx_pass.ptr = (char*) pj_pool_alloc(ice->pool, 16);
 	pj_create_random_string(ice->rx_pass.ptr, 16);
 	ice->rx_pass.slen = 16;
@@ -397,6 +397,6 @@
 {
     PJ_ASSERT_RETURN(ice && prefs, PJ_EINVAL);
-    ice->prefs = pj_pool_calloc(ice->pool, PJ_ARRAY_SIZE(prefs), 
-				sizeof(pj_uint8_t));
+    ice->prefs = (pj_uint8_t*) pj_pool_calloc(ice->pool, PJ_ARRAY_SIZE(prefs),
+					      sizeof(pj_uint8_t));
     pj_memcpy(ice->prefs, prefs, sizeof(prefs));
     return PJ_SUCCESS;
@@ -1709,5 +1709,5 @@
      * Request was sent from.
      */
-    if (sockaddr_cmp(&check->rcand->addr, src_addr) != 0) {
+    if (sockaddr_cmp(&check->rcand->addr, (const pj_sockaddr*)src_addr) != 0) {
 	status = PJNATH_EICEINSRCADDR;
 	LOG4((ice->obj_name, 
@@ -2064,5 +2064,5 @@
 
 	/* Foundation is random, unique from other foundation */
-	rcand->foundation.ptr = pj_pool_alloc(ice->pool, 36);
+	rcand->foundation.ptr = (char*) pj_pool_alloc(ice->pool, 36);
 	rcand->foundation.slen = pj_ansi_snprintf(rcand->foundation.ptr, 36,
 						  "f%p", 
@@ -2303,5 +2303,6 @@
     }
 
-    stun_status = pj_stun_msg_check(pkt, pkt_size, PJ_STUN_IS_DATAGRAM);
+    stun_status = pj_stun_msg_check((const pj_uint8_t*)pkt, pkt_size, 
+    				    PJ_STUN_IS_DATAGRAM);
     if (stun_status == PJ_SUCCESS) {
 	status = pj_stun_session_on_rx_pkt(comp->stun_sess, pkt, pkt_size,
Index: /pjproject/trunk/pjnath/src/pjnath/stun_msg.c
===================================================================
--- /pjproject/trunk/pjnath/src/pjnath/stun_msg.c	(revision 1238)
+++ /pjproject/trunk/pjnath/src/pjnath/stun_msg.c	(revision 1239)
@@ -1495,5 +1495,5 @@
     if (data && length) {
 	attr->length = length;
-	attr->data = pj_pool_alloc(pool, length);
+	attr->data = (pj_uint8_t*) pj_pool_alloc(pool, length);
 	pj_memcpy(attr->data, data, length);
     }
@@ -1537,5 +1537,5 @@
     /* Copy the data to the attribute */
     attr->length = attr->hdr.length;
-    attr->data = pj_pool_alloc(pool, attr->length);
+    attr->data = (pj_uint8_t*) pj_pool_alloc(pool, attr->length);
     pj_memcpy(attr->data, buf+ATTR_HDR_LEN, attr->length);
 
Index: /pjproject/trunk/pjnath/src/pjnath/stun_session.c
===================================================================
--- /pjproject/trunk/pjnath/src/pjnath/stun_session.c	(revision 1238)
+++ /pjproject/trunk/pjnath/src/pjnath/stun_session.c	(revision 1239)
@@ -381,5 +381,5 @@
     sess->use_fingerprint = fingerprint;
     
-    sess->srv_name.ptr = pj_pool_alloc(pool, 32);
+    sess->srv_name.ptr = (char*) pj_pool_alloc(pool, 32);
     sess->srv_name.slen = pj_ansi_snprintf(sess->srv_name.ptr, 32,
 					   "pj_stun-%s", PJ_VERSION);
@@ -454,5 +454,5 @@
     if (cred) {
 	if (!sess->cred)
-	    sess->cred = pj_pool_alloc(sess->pool, sizeof(pj_stun_auth_cred));
+	    sess->cred = PJ_POOL_ALLOC_T(sess->pool, pj_stun_auth_cred);
 	pj_stun_auth_cred_dup(sess->pool, sess->cred, cred);
     } else {
@@ -599,6 +599,7 @@
 
     /* Encode message */
-    status = pj_stun_msg_encode(tdata->msg, tdata->pkt, tdata->max_len,
-			        0, get_passwd(sess, tdata->pool, tdata->msg),
+    status = pj_stun_msg_encode(tdata->msg, (pj_uint8_t*)tdata->pkt, 
+    				tdata->max_len, 0, 
+    				get_passwd(sess, tdata->pool, tdata->msg),
 				&tdata->pkt_size);
     if (status != PJ_SUCCESS) {
@@ -753,5 +754,5 @@
     /* Alloc packet buffer */
     out_max_len = PJ_STUN_MAX_PKT_LEN;
-    out_pkt = pj_pool_alloc(pool, out_max_len);
+    out_pkt = (pj_uint8_t*) pj_pool_alloc(pool, out_max_len);
 
     /* Encode */
@@ -959,5 +960,5 @@
     }
 
-    dump = pj_pool_alloc(tmp_pool, PJ_STUN_MAX_PKT_LEN);
+    dump = (char*) pj_pool_alloc(tmp_pool, PJ_STUN_MAX_PKT_LEN);
 
     PJ_LOG(5,(SNAME(sess),
@@ -981,6 +982,6 @@
      */
     if ((options & PJ_STUN_NO_AUTHENTICATE) == 0) {
-	status = authenticate_msg(sess, packet, pkt_size, msg, tmp_pool,
-				  src_addr, src_addr_len);
+	status = authenticate_msg(sess, (const pj_uint8_t*) packet, pkt_size, 
+				  msg, tmp_pool, src_addr, src_addr_len);
 	if (status != PJ_SUCCESS) {
 	    goto on_return;
@@ -996,10 +997,12 @@
     } else if (PJ_STUN_IS_REQUEST(msg->hdr.type)) {
 
-	status = on_incoming_request(sess, tmp_pool, packet, pkt_size, msg,
-				     src_addr, src_addr_len);
+	status = on_incoming_request(sess, tmp_pool, 
+				     (const pj_uint8_t*) packet, pkt_size, 
+				     msg, src_addr, src_addr_len);
 
     } else if (PJ_STUN_IS_INDICATION(msg->hdr.type)) {
 
-	status = on_incoming_indication(sess, tmp_pool, packet, pkt_size,
+	status = on_incoming_indication(sess, tmp_pool, 
+					(const pj_uint8_t*) packet, pkt_size,
 					msg, src_addr, src_addr_len);
 
