Index: /pjproject/trunk/build.symbian/bld.inf
===================================================================
--- /pjproject/trunk/build.symbian/bld.inf	(revision 1241)
+++ /pjproject/trunk/build.symbian/bld.inf	(revision 1242)
@@ -1,9 +1,12 @@
 prj_mmpfiles
 pjlib.mmp
-//pjlib_util.mmp
-//pjsip.mmp
-//pjsip_simple.mmp
-//pjsdp.mmp
-//pjsip_ua.mmp
+pjlib_util.mmp
+pjnath.mmp
+pjsdp.mmp
+pjmedia.mmp
+pjsip.mmp
+pjsip_simple.mmp
+pjsip_ua.mmp
 //pjlib_test.mmp
 //sipstateless.mmp
+symbian_ua.mmp
Index: /pjproject/trunk/build.symbian/pjlib.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjlib.mmp	(revision 1241)
+++ /pjproject/trunk/build.symbian/pjlib.mmp	(revision 1242)
@@ -10,5 +10,4 @@
 MACRO		PJ_M_I386=1
 MACRO		PJ_SYMBIAN=1
-MACRO		PJ_EXPORTING
 
 //
@@ -58,4 +57,35 @@
 SOURCE		unicode_symbian.cpp
 
+DOCUMENT	os_symbian.h
+
+DOCUMENT	pj\\addr_resolv.h
+DOCUMENT	pj\\array.h
+DOCUMENT	pj\\assert.h
+DOCUMENT	pj\\config.h
+DOCUMENT	pj\\config_site.h
+DOCUMENT	pj\\config_site_sample.h
+DOCUMENT	pj\\ctype.h
+DOCUMENT	pj\\errno.h
+DOCUMENT	pj\\except.h
+DOCUMENT	pj\\file_access.h
+DOCUMENT	pj\\file_io.h
+DOCUMENT	pj\\guid.h
+DOCUMENT	pj\\hash.h
+DOCUMENT	pj\\ioqueue.h
+DOCUMENT	pj\\ip_helper.h
+DOCUMENT	pj\\list.h
+DOCUMENT	pj\\lock.h
+DOCUMENT	pj\\log.h
+DOCUMENT	pj\\os.h
+DOCUMENT	pj\\pool.h
+DOCUMENT	pj\\pool_buf.h
+DOCUMENT	pj\\rand.h
+DOCUMENT	pj\\rbtree.h
+DOCUMENT	pj\\sock.h
+DOCUMENT	pj\\sock_select.h
+DOCUMENT	pj\\string.h
+DOCUMENT	pj\\timer.h
+DOCUMENT	pj\\types.h
+DOCUMENT	pj\\unicode.h
 
 SYSTEMINCLUDE	..\pjlib\include
Index: /pjproject/trunk/build.symbian/pjlib_test.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjlib_test.mmp	(revision 1241)
+++ /pjproject/trunk/build.symbian/pjlib_test.mmp	(revision 1242)
@@ -8,5 +8,4 @@
 MACRO		PJ_M_I386=1
 MACRO		PJ_SYMBIAN=1
-MACRO		PJ_IMPORTING
 
 OPTION		CW -lang c++
Index: /pjproject/trunk/build.symbian/pjlib_util.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjlib_util.mmp	(revision 1241)
+++ /pjproject/trunk/build.symbian/pjlib_util.mmp	(revision 1242)
@@ -8,10 +8,10 @@
 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
@@ -31,4 +31,25 @@
 SOURCE	xml.c
 
+//
+// Header files
+//
+DOCUMENT pjlib-util\\config.h
+DOCUMENT pjlib-util\\crc32.h
+DOCUMENT pjlib-util\\dns.h
+DOCUMENT pjlib-util\\errno.h
+DOCUMENT pjlib-util\\getopt.h
+DOCUMENT pjlib-util\\hmac_md5.h
+DOCUMENT pjlib-util\hmac_sha1.h
+DOCUMENT pjlib-util\md5.h
+DOCUMENT pjlib-util\resolver.h
+DOCUMENT pjlib-util\scanner.h
+DOCUMENT pjlib-util\sha1.h
+DOCUMENT pjlib-util\srv_resolver.h
+DOCUMENT pjlib-util\string.h
+DOCUMENT pjlib-util\stun_simple.h
+DOCUMENT pjlib-util\types.h
+DOCUMENT pjlib-util\xml.h
+
+
 SYSTEMINCLUDE	..\pjlib\include 
 SYSTEMINCLUDE	..\pjlib-util\include
Index: /pjproject/trunk/build.symbian/pjmedia.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjmedia.mmp	(revision 1242)
+++ /pjproject/trunk/build.symbian/pjmedia.mmp	(revision 1242)
@@ -0,0 +1,79 @@
+TARGET 		pjmedia.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
+
+//
+// Platform independent source
+//
+
+SOURCE		alaw_ulaw.c
+SOURCE		alaw_ulaw_table.c
+SOURCE		bidirectional.c
+SOURCE		clock_thread.c
+SOURCE		codec.c
+SOURCE		conference.c
+SOURCE		echo_common.c
+SOURCE		echo_port.c
+SOURCE		echo_suppress.c
+SOURCE		endpoint.c
+SOURCE		errno.c
+SOURCE		g711.c
+SOURCE		jbuf.c
+SOURCE		master_port.c
+SOURCE		mem_capture.c
+SOURCE		mem_player.c
+SOURCE		null_port.c
+SOURCE		plc_common.c
+SOURCE		port.c
+SOURCE		resample_port.c
+SOURCE		resample_resample.c
+SOURCE		rtcp.c
+SOURCE		rtp.c
+//SDP files are in pjsdp.mmp
+//SOURCE		sdp.c
+//SOURCE		sdp_cmp.c
+//SOURCE		sdp_neg.c
+SOURCE		session.c
+SOURCE		silencedet.c
+SOURCE		sound_port.c
+SOURCE		splitcomb.c
+SOURCE		stream.c
+SOURCE		transport_ice.c
+SOURCE		transport_udp.c
+SOURCE		wav_player.c
+SOURCE		wav_playlist.c
+SOURCE		wav_writer.c
+SOURCE		wave.c
+
+//
+// Symbian specific
+// These are on separate project
+//
+//SOURCE		symbian_sound.cpp
+//SOURCE		null_sound.c
+
+
+//
+// Header files
+//
+
+
+SYSTEMINCLUDE	..\pjmedia\include
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include 
+SYSTEMINCLUDE	..\pjnath\include 
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+SYSTEMINCLUDE	\epoc32\include\mmf\plugin
+
+CAPABILITY	None
+
Index: /pjproject/trunk/build.symbian/pjnath.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjnath.mmp	(revision 1241)
+++ /pjproject/trunk/build.symbian/pjnath.mmp	(revision 1242)
@@ -8,10 +8,10 @@
 MACRO		PJ_M_I386=1
 MACRO		PJ_SYMBIAN=1
-MACRO		PJ_IMPORTING
 
-OPTION		CW -lang c++
+//OPTION		CW -lang c++
 
+//
 // PJNATH files
-
+//
 SOURCE	errno.c
 SOURCE	ice_session.c
@@ -22,4 +22,20 @@
 SOURCE	stun_session.c
 SOURCE	stun_transaction.c
+
+//
+// Include files
+//
+DOCUMENT pjnath\config.h
+DOCUMENT pjnath\\errno.h
+DOCUMENT pjnath\\ice_session.h
+DOCUMENT pjnath\\ice_strans.h
+DOCUMENT pjnath\\stun_auth.h
+DOCUMENT pjnath\\stun_config.h
+DOCUMENT pjnath\\stun_msg.h
+DOCUMENT pjnath\\stun_session.h
+DOCUMENT pjnath\\stun_transaction.h
+DOCUMENT pjnath\\types.h
+
+
 
 SYSTEMINCLUDE	..\pjlib\include 
Index: /pjproject/trunk/build.symbian/pjproject.cww
===================================================================
--- /pjproject/trunk/build.symbian/pjproject.cww	(revision 1242)
+++ /pjproject/trunk/build.symbian/pjproject.cww	(revision 1242)
@@ -0,0 +1,416 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<?codewarrior exportversion="1.0" ideversion="5.5" success="y" ?>
+
+<!DOCTYPE MWIDEWORKSPACE [
+<!ELEMENT MWIDEWORKSPACE (WINDOW*, COMWINDOW*)>
+<!ELEMENT WINDOW (SESSION, EDOCTYPE, PATH, FRAMELOC, FRAMESIZE, DOCKINFO)>
+<!ELEMENT COMWINDOW (SESSION, CLSID, OWNERPROJECT, DATA, FRAMELOC, FRAMESIZE, DOCKINFO)>
+<!ELEMENT SESSION (#PCDATA)>
+<!ELEMENT EDOCTYPE (#PCDATA)>
+<!ELEMENT DEFAULT (#PCDATA)>
+<!ELEMENT MAXIMIZED (#PCDATA)>
+<!ELEMENT PATH (#PCDATA)>
+<!ATTLIST PATH USERELATIVEPATHS (true | false) "true">
+<!ELEMENT FRAMELOC (X, Y)>
+<!ELEMENT X (#PCDATA)>
+<!ELEMENT Y (#PCDATA)>
+<!ELEMENT FRAMESIZE (W, H)>
+<!ELEMENT W (#PCDATA)>
+<!ELEMENT H (#PCDATA)>
+<!ELEMENT DOCKINFO (STATUS, ROW, COLUMN, DOCKBARID, PCTWIDTH, HGT, GROUPID)>
+<!ELEMENT STATUS (#PCDATA)>
+<!ELEMENT ROW (#PCDATA)>
+<!ELEMENT COLUMN (#PCDATA)>
+<!ELEMENT DOCKBARID (#PCDATA)>
+<!ELEMENT PCTWIDTH (#PCDATA)>
+<!ELEMENT HGT (#PCDATA)>
+<!ELEMENT GROUPID (GIDHIGHPART, GIDLOWPART)>
+<!ELEMENT GIDHIGHPART (#PCDATA)>
+<!ELEMENT GIDLOWPART (#PCDATA)>
+<!ELEMENT CLSID (#PCDATA)>
+<!ELEMENT OWNERPROJECT (#PCDATA)>
+<!ATTLIST OWNERPROJECT USERELATIVEPATHS (true | false) "true">
+<!ELEMENT DATA (#PCDATA)>
+<!ATTLIST DATA BINARYFORMAT (true | false) "true">
+]>
+
+<MWIDEWORKSPACE>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <DEFAULT>true</DEFAULT>
+        <PATH USERELATIVEPATHS = "true">pjlib.mcp</PATH>
+        <FRAMELOC>
+            <X>0</X>
+            <Y>0</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>347</W>
+            <H>128</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">pjlib_test.mcp</PATH>
+        <FRAMELOC>
+            <X>0</X>
+            <Y>0</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>347</W>
+            <H>128</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">pjlib_util.mcp</PATH>
+        <FRAMELOC>
+            <X>0</X>
+            <Y>0</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>347</W>
+            <H>128</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">pjnath.mcp</PATH>
+        <FRAMELOC>
+            <X>0</X>
+            <Y>0</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>347</W>
+            <H>128</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">pjmedia.mcp</PATH>
+        <FRAMELOC>
+            <X>0</X>
+            <Y>0</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>347</W>
+            <H>128</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">pjsdp.mcp</PATH>
+        <FRAMELOC>
+            <X>0</X>
+            <Y>0</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>347</W>
+            <H>128</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">pjsip.mcp</PATH>
+        <FRAMELOC>
+            <X>0</X>
+            <Y>0</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>347</W>
+            <H>128</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">pjsip_ua.mcp</PATH>
+        <FRAMELOC>
+            <X>548</X>
+            <Y>123</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>400</W>
+            <H>372</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">pjsip_simple.mcp</PATH>
+        <FRAMELOC>
+            <X>0</X>
+            <Y>0</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>347</W>
+            <H>128</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">pjsua_lib.mcp</PATH>
+        <FRAMELOC>
+            <X>631</X>
+            <Y>228</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>400</W>
+            <H>372</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>0</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">symbian_ua.mcp</PATH>
+        <FRAMELOC>
+            <X>568</X>
+            <Y>146</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>400</W>
+            <H>372</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>1</STATUS>
+            <ROW>0</ROW>
+            <COLUMN>0</COLUMN>
+            <DOCKBARID>59420</DOCKBARID>
+            <PCTWIDTH>1.000000</PCTWIDTH>
+            <HGT>506</HGT>
+            <GROUPID>
+                <GIDHIGHPART>4294967294</GIDHIGHPART>
+                <GIDLOWPART>4294967294</GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-1</SESSION>
+        <EDOCTYPE>1</EDOCTYPE>
+        <PATH USERELATIVEPATHS = "true">..\pjsip-apps\src\symbian_ua\ua.cpp</PATH>
+        <MAXIMIZED>true</MAXIMIZED>
+        <FRAMELOC>
+            <X>4</X>
+            <Y>4</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>731</W>
+            <H>822</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>0</STATUS>
+            <ROW></ROW>
+            <COLUMN></COLUMN>
+            <DOCKBARID></DOCKBARID>
+            <PCTWIDTH></PCTWIDTH>
+            <HGT></HGT>
+            <GROUPID>
+                <GIDHIGHPART></GIDHIGHPART>
+                <GIDLOWPART></GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-2147483648</SESSION>
+        <EDOCTYPE>36</EDOCTYPE>
+        <DEFAULT>true</DEFAULT>
+        <FRAMELOC>
+            <X>4</X>
+            <Y>23</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>414</W>
+            <H>516</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>0</STATUS>
+            <ROW></ROW>
+            <COLUMN></COLUMN>
+            <DOCKBARID></DOCKBARID>
+            <PCTWIDTH></PCTWIDTH>
+            <HGT></HGT>
+            <GROUPID>
+                <GIDHIGHPART></GIDHIGHPART>
+                <GIDLOWPART></GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-2147483648</SESSION>
+        <EDOCTYPE>20</EDOCTYPE>
+        <DEFAULT>true</DEFAULT>
+        <FRAMELOC>
+            <X>4</X>
+            <Y>23</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>792</W>
+            <H>1413</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>0</STATUS>
+            <ROW></ROW>
+            <COLUMN></COLUMN>
+            <DOCKBARID></DOCKBARID>
+            <PCTWIDTH></PCTWIDTH>
+            <HGT></HGT>
+            <GROUPID>
+                <GIDHIGHPART></GIDHIGHPART>
+                <GIDLOWPART></GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+    <WINDOW>
+        <SESSION>-2147483648</SESSION>
+        <EDOCTYPE>23</EDOCTYPE>
+        <DEFAULT>true</DEFAULT>
+        <MAXIMIZED>true</MAXIMIZED>
+        <FRAMELOC>
+            <X>6</X>
+            <Y>81</Y>
+        </FRAMELOC>
+        <FRAMESIZE>
+            <W>566</W>
+            <H>477</H>
+        </FRAMESIZE>
+        <DOCKINFO>
+            <STATUS>0</STATUS>
+            <ROW></ROW>
+            <COLUMN></COLUMN>
+            <DOCKBARID></DOCKBARID>
+            <PCTWIDTH></PCTWIDTH>
+            <HGT></HGT>
+            <GROUPID>
+                <GIDHIGHPART></GIDHIGHPART>
+                <GIDLOWPART></GIDLOWPART>
+            </GROUPID>
+        </DOCKINFO>
+    </WINDOW>
+</MWIDEWORKSPACE>
Index: /pjproject/trunk/build.symbian/pjsdp.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjsdp.mmp	(revision 1241)
+++ /pjproject/trunk/build.symbian/pjsdp.mmp	(revision 1242)
@@ -10,5 +10,4 @@
 MACRO		PJ_M_I386=1
 MACRO		PJ_SYMBIAN=1
-MACRO		PJ_EXPORTING
 
 //
Index: /pjproject/trunk/build.symbian/pjsip.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjsip.mmp	(revision 1241)
+++ /pjproject/trunk/build.symbian/pjsip.mmp	(revision 1242)
@@ -8,5 +8,4 @@
 MACRO		PJ_M_I386=1
 MACRO		PJ_SYMBIAN=1
-MACRO		PJ_IMPORTING
 
 OPTION		CW -lang c++
Index: /pjproject/trunk/build.symbian/pjsip_simple.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjsip_simple.mmp	(revision 1241)
+++ /pjproject/trunk/build.symbian/pjsip_simple.mmp	(revision 1242)
@@ -8,5 +8,4 @@
 MACRO		PJ_M_I386=1
 MACRO		PJ_SYMBIAN=1
-MACRO		PJ_IMPORTING
 
 OPTION		CW -lang c++
Index: /pjproject/trunk/build.symbian/pjsip_ua.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjsip_ua.mmp	(revision 1241)
+++ /pjproject/trunk/build.symbian/pjsip_ua.mmp	(revision 1242)
@@ -8,5 +8,4 @@
 MACRO		PJ_M_I386=1
 MACRO		PJ_SYMBIAN=1
-MACRO		PJ_IMPORTING
 
 //OPTION		CW -lang c++
Index: /pjproject/trunk/build.symbian/pjstun_client.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjstun_client.mmp	(revision 1241)
+++ /pjproject/trunk/build.symbian/pjstun_client.mmp	(revision 1242)
@@ -8,5 +8,4 @@
 MACRO		PJ_M_I386=1
 MACRO		PJ_SYMBIAN=1
-MACRO		PJ_IMPORTING
 
 OPTION		CW -lang c++
Index: /pjproject/trunk/build.symbian/pjsua_lib.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjsua_lib.mmp	(revision 1242)
+++ /pjproject/trunk/build.symbian/pjsua_lib.mmp	(revision 1242)
@@ -0,0 +1,32 @@
+TARGET 		pjsua_lib.lib
+TARGETTYPE 	lib
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjsip\src\pjsua-lib
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+
+// OPTION		CW -lang c++
+
+// PJLIB-UTIL files
+
+SOURCE	pjsua_acc.c
+SOURCE	pjsua_call.c
+SOURCE	pjsua_core.c
+SOURCE	pjsua_im.c
+SOURCE	pjsua_media.c
+SOURCE	pjsua_pres.c
+
+SYSTEMINCLUDE	..\pjlib\include 
+SYSTEMINCLUDE	..\pjlib-util\include
+SYSTEMINCLUDE	..\pjnath\include
+SYSTEMINCLUDE	..\pjmedia\include
+SYSTEMINCLUDE	..\pjsip\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+CAPABILITY	None
+
Index: /pjproject/trunk/build.symbian/symbian_ua.mmp
===================================================================
--- /pjproject/trunk/build.symbian/symbian_ua.mmp	(revision 1242)
+++ /pjproject/trunk/build.symbian/symbian_ua.mmp	(revision 1242)
@@ -0,0 +1,30 @@
+TARGET 		symbian_ua.exe
+TARGETTYPE 	exe
+UID		0x100039CE 0x10004299
+VENDORID	0x70000001
+
+SOURCEPATH	..\pjsip-apps\src\symbian_ua
+
+MACRO		PJ_M_I386=1
+MACRO		PJ_SYMBIAN=1
+
+// Test files
+
+SOURCE	ua.cpp
+SOURCE	main_symbian.cpp
+
+DOCUMENT ua.h
+
+SYSTEMINCLUDE	..\pjlib\include
+SYSTEMINCLUDE	..\pjlib-util\include
+SYSTEMINCLUDE	..\pjnath\include
+SYSTEMINCLUDE	..\pjmedia\include
+SYSTEMINCLUDE	..\pjsip\include
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\libc
+
+LIBRARY		pjsua_lib.lib pjsip_ua.lib pjsip_simple.lib pjsip.lib pjsdp.lib pjmedia.lib 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/include/pjlib-util.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util.h	(revision 1241)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util.h	(revision 1242)
@@ -53,25 +53,4 @@
 #include <pjlib-util/stun_simple.h>
 
-/**
- * @addtogroup PJLIB_UTIL
- * @{
- */
-
-PJ_BEGIN_DECL
-
-/**
- * Initialize PJLIB UTIL (defined in errno.c)
- *
- * @return PJ_SUCCESS on success.
- */
-PJ_DECL(pj_status_t) pjlib_util_init(void);
-
-
-/**
- * @}
- */
-
-PJ_END_DECL
-
 
 #endif	/* __PJLIB_UTIL_H__ */
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/types.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/types.h	(revision 1241)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/types.h	(revision 1242)
@@ -30,5 +30,25 @@
 /**
  * @defgroup PJLIB_UTIL PJLIB-UTIL Library
+ * @{
  */
+
+PJ_BEGIN_DECL
+
+/**
+ * Initialize PJLIB UTIL (defined in errno.c)
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjlib_util_init(void);
+
+
+
+PJ_END_DECL
+
+
+/**
+ * @}
+ */
+
 
 /**
Index: /pjproject/trunk/pjlib-util/src/pjlib-util/errno.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/errno.c	(revision 1241)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/errno.c	(revision 1242)
@@ -18,4 +18,5 @@
  */
 #include <pjlib-util/errno.h>
+#include <pjlib-util/types.h>
 #include <pj/string.h>
 
Index: /pjproject/trunk/pjlib/include/pj/compat/os_symbian.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/compat/os_symbian.h	(revision 1241)
+++ /pjproject/trunk/pjlib/include/pj/compat/os_symbian.h	(revision 1242)
@@ -146,4 +146,5 @@
 #include <e32def.h>
 
+/*
 #if defined(PJ_EXPORTING)
 #   define PJ_EXPORT_IMPORT EXPORT_C
@@ -153,4 +154,5 @@
 #   error "Must define either PJ_EXPORTING or PJ_IMPORTING"
 #endif
+*/
 
 #endif	/* __PJ_COMPAT_OS_SYMBIAN_H__ */
Index: /pjproject/trunk/pjlib/include/pj/config_site_sample.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/config_site_sample.h	(revision 1241)
+++ /pjproject/trunk/pjlib/include/pj/config_site_sample.h	(revision 1242)
@@ -31,5 +31,17 @@
  */
 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+
+#   undef PJ_HAS_FLOATING_POINT
+#   define PJ_HAS_FLOATING_POINT	0
+
 #   define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND
+#   define PJMEDIA_HAS_LIBRESAMPLE	0
+#   define PJMEDIA_HAS_SPEEX_AEC	0
+
+#   define PJMEDIA_HAS_L16_CODEC	0
+#   define PJMEDIA_HAS_GSM_CODEC	0
+#   define PJMEDIA_HAS_ILBC_CODEC	0
+#   define PJMEDIA_HAS_SPEEX_CODEC	0
+
 #endif
 
Index: /pjproject/trunk/pjlib/include/pj/except.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/except.h	(revision 1241)
+++ /pjproject/trunk/pjlib/include/pj/except.h	(revision 1242)
@@ -246,4 +246,9 @@
  ****************************************************************************/
 
+/* To include this file, the source file must be compiled as
+ * C++ code!
+ */
+#ifdef __cplusplus
+
 class TPjException
 {
@@ -261,4 +266,6 @@
 #define PJ_GET_EXCEPTION()	pj_excp_.code_
 
+#endif	/* __cplusplus */
+
 #else
 /*****************************************************************************
Index: /pjproject/trunk/pjlib/include/pj/pool_buf.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/pool_buf.h	(revision 1241)
+++ /pjproject/trunk/pjlib/include/pj/pool_buf.h	(revision 1242)
@@ -71,4 +71,5 @@
  */
 
+PJ_BEGIN_DECL
 
 /**
@@ -94,4 +95,6 @@
 					  pj_size_t size);
 
+PJ_END_DECL
+
 /**
  * @}
Index: /pjproject/trunk/pjlib/src/pj/exception_symbian.cpp
===================================================================
--- /pjproject/trunk/pjlib/src/pj/exception_symbian.cpp	(revision 1241)
+++ /pjproject/trunk/pjlib/src/pj/exception_symbian.cpp	(revision 1242)
@@ -35,42 +35,4 @@
 #endif  /* PJ_HAS_EXCEPTION_NAMES */
 
-
-//#if !defined(PJ_EXCEPTION_USE_WIN32_SEH) || PJ_EXCEPTION_USE_WIN32_SEH==0
-#if 0
-PJ_DEF(void) pj_throw_exception_(int exception_id)
-{
-    struct pj_exception_state_t *handler;
-
-    handler = (pj_exception_state_t*)pj_thread_local_get(thread_local_id);
-    if (handler == NULL) {
-        PJ_LOG(1,("except.c", "!!!FATAL: unhandled exception %d!\n", exception_id));
-        pj_assert(handler != NULL);
-        /* This will crash the system! */
-    }
-    pj_longjmp(handler->state, exception_id);
-}
-
-PJ_DEF(void) pj_push_exception_handler_(struct pj_exception_state_t *rec)
-{
-    struct pj_exception_state_t *parent_handler = NULL;
-
-    if (thread_local_id == -1) {
-	pj_thread_local_alloc(&thread_local_id);
-	pj_assert(thread_local_id != -1);
-    }
-    parent_handler = (pj_exception_state_t*)pj_thread_local_get(thread_local_id);
-    rec->prev = parent_handler;
-    pj_thread_local_set(thread_local_id, rec);
-}
-
-PJ_DEF(void) pj_pop_exception_handler_(void)
-{
-    struct pj_exception_state_t *handler;
-
-    handler = (pj_exception_state_t*)pj_thread_local_get(thread_local_id);
-    pj_assert(handler != NULL);
-    pj_thread_local_set(thread_local_id, handler->prev);
-}
-#endif
 
 #if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0
Index: /pjproject/trunk/pjlib/src/pj/os_core_symbian.cpp
===================================================================
--- /pjproject/trunk/pjlib/src/pj/os_core_symbian.cpp	(revision 1241)
+++ /pjproject/trunk/pjlib/src/pj/os_core_symbian.cpp	(revision 1242)
@@ -271,4 +271,6 @@
 PJ_DEF(pj_status_t) pj_init(void)
 {
+    pj_status_t status;
+    
     pj_ansi_strcpy(main_thread.obj_name, "pjthread");
 
@@ -281,8 +283,15 @@
     PJ_LOG(4,(THIS_FILE, "Initializing PJLIB for Symbian OS.."));
 
-    TInt err;
+    TInt err; 
     err = os->Initialize();
     if (err != KErrNone)
 	goto on_error;
+    
+    /* Initialize exception ID for the pool. 
+     * Must do so after critical section is configured.
+     */ 
+    status = pj_exception_id_alloc("PJLIB/No memory", &PJ_NO_MEMORY_EXCEPTION);
+    if (status != PJ_SUCCESS)
+        return status;
 
     PJ_LOG(5,(THIS_FILE, "PJLIB initialized."));
@@ -308,11 +317,9 @@
 PJ_DEF(void) pj_shutdown(void)
 {
-    unsigned i;
-
     /* Call atexit() functions */
-    for (i=atexit_count-1; i>=0; --i) {
-	(*atexit_func[i])();
-    }
-    atexit_count = 0;
+    while (atexit_count > 0) {
+	(*atexit_func[atexit_count-1])();
+	--atexit_count;
+    }
 
     /* Free exception ID */
Index: /pjproject/trunk/pjlib/src/pjlib-test/errno.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/errno.c	(revision 1241)
+++ /pjproject/trunk/pjlib/src/pjlib-test/errno.c	(revision 1242)
@@ -71,9 +71,11 @@
 {
     enum { CUT = 6 };
-    pj_status_t rc;
+    pj_status_t rc = 0;
     char errbuf[256];
 
     PJ_LOG(3,(THIS_FILE, "...errno test: check the msg carefully"));
 
+    PJ_UNUSED_ARG(rc);
+    
     /* 
      * Windows platform error. 
Index: /pjproject/trunk/pjmedia/src/pjmedia/codec.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/codec.c	(revision 1241)
+++ /pjproject/trunk/pjmedia/src/pjmedia/codec.c	(revision 1242)
@@ -323,5 +323,5 @@
 			 codec_id->slen) == 0) 
 	{
-	    mgr->codec_desc[i].prio = prio;
+	    mgr->codec_desc[i].prio = (pjmedia_codec_priority) prio;
 	    ++found;
 	}
Index: /pjproject/trunk/pjmedia/src/pjmedia/g711.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 1241)
+++ /pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 1242)
@@ -373,5 +373,5 @@
 {
     struct g711_private *priv = codec->codec_data;
-    int i;
+    int i = 0;
 
     PJ_ASSERT_RETURN(factory==&g711_factory.base, PJ_EINVAL);
Index: project/trunk/pjmedia/src/pjmedia/plc_steveu.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/plc_steveu.c	(revision 1241)
+++ 	(revision )
@@ -1,338 +1,0 @@
-/*
- * SpanDSP - a series of DSP components for telephony
- *
- * plc.c
- *
- * Written by Steve Underwood <steveu@coppice.org>
- *
- * Copyright (C) 2004 Steve Underwood
- *
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * This version may be optionally licenced under the GNU LGPL licence.
- * This version is disclaimed to DIGIUM for inclusion in the Asterisk project.
- */
-
-/*! \file */
-
-#include <pjmedia/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <limits.h>
-
-#include "plc_steveu.h"
-
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
-#ifndef INT16_MAX
-#define INT16_MAX   (32767)
-#endif
-
-#ifndef INT16_MIN
-#define INT16_MIN   (-32767-1)
-#endif
-
-//#define PJ_HAS_RINT	1
-
-
-/* We do a straight line fade to zero volume in 50ms when we are filling in for missing data. */
-#define ATTENUATION_INCREMENT       0.0025                              /* Attenuation per sample */
-
-#define ms_to_samples(t)            (((t)*SAMPLE_RATE)/1000)
-
-
-#if defined(PJ_HAS_RINT) && PJ_HAS_RINT!=0
-#define RINT(d)	rint(d)
-#else
-double RINT(double d)
-{
-    double f = floor(d);
-    double c = ceil(d);
-    
-    if (c-d > d-f)
-	return f;
-    else if (c-d < d-f)
-	return c;
-    else if (d >= 0) {
-	if (f/2==f)
-	    return f;
-	else
-	    return c;
-    } else {
-	if (c/2==c)
-	    return c;
-	else
-	    return f;
-    }
-}
-#endif
-
-
-PJ_INLINE(pj_int16_t) fsaturate(double damp)
-{
-    if (damp > 32767.0)
-	return  INT16_MAX;
-    else if (damp < -32768.0)
-	return  INT16_MIN;
-    else {
-	return (pj_int16_t) RINT(damp);
-    }
-}
-
-static void save_history(plc_state_t *s, pj_int16_t *buf, int len)
-{
-    if (len >= PLC_HISTORY_LEN)
-    {
-        /* Just keep the last part of the new data, starting at the beginning of the buffer */
-        memcpy(s->history, buf + len - PLC_HISTORY_LEN, sizeof(pj_int16_t)*PLC_HISTORY_LEN);
-        s->buf_ptr = 0;
-        return;
-    }
-    if (s->buf_ptr + len > PLC_HISTORY_LEN)
-    {
-        /* Wraps around - must break into two sections */
-        memcpy(s->history + s->buf_ptr, buf, sizeof(pj_int16_t)*(PLC_HISTORY_LEN - s->buf_ptr));
-        len -= (PLC_HISTORY_LEN - s->buf_ptr);
-        memcpy(s->history, buf + (PLC_HISTORY_LEN - s->buf_ptr), sizeof(pj_int16_t)*len);
-        s->buf_ptr = len;
-        return;
-    }
-    /* Can use just one section */
-    memcpy(s->history + s->buf_ptr, buf, sizeof(pj_int16_t)*len);
-    s->buf_ptr += len;
-}
-/*- End of function --------------------------------------------------------*/
-
-static void normalise_history(plc_state_t *s)
-{
-    pj_int16_t tmp[PLC_HISTORY_LEN];
-
-    if (s->buf_ptr == 0)
-        return;
-    memcpy(tmp, s->history, sizeof(pj_int16_t)*s->buf_ptr);
-    memcpy(s->history, s->history + s->buf_ptr, sizeof(pj_int16_t)*(PLC_HISTORY_LEN - s->buf_ptr));
-    memcpy(s->history + PLC_HISTORY_LEN - s->buf_ptr, tmp, sizeof(pj_int16_t)*s->buf_ptr);
-    s->buf_ptr = 0;
-}
-/*- End of function --------------------------------------------------------*/
-
-PJ_INLINE(int) amdf_pitch(int min_pitch, int max_pitch, pj_int16_t amp[], int len)
-{
-    int i;
-    int j;
-    int acc;
-    int min_acc;
-    int pitch;
-
-    pitch = min_pitch;
-    min_acc = INT_MAX;
-    for (i = max_pitch;  i <= min_pitch;  i++)
-    {
-        acc = 0;
-        for (j = 0;  j < len;  j++)
-            acc += abs(amp[i + j] - amp[j]);
-        if (acc < min_acc)
-        {
-            min_acc = acc;
-            pitch = i;
-        }
-    }
-    return pitch;
-}
-/*- End of function --------------------------------------------------------*/
-
-int plc_rx(plc_state_t *s, pj_int16_t amp[], int len)
-{
-    int i;
-    /*int overlap_len;*/
-    int pitch_overlap;
-    float old_step;
-    float new_step;
-    float old_weight;
-    float new_weight;
-    float gain;
-    
-    if (s->missing_samples)
-    {
-        /* Although we have a real signal, we need to smooth it to fit well
-           with the synthetic signal we used for the previous block */
-
-        /* The start of the real data is overlapped with the next 1/4 cycle
-           of the synthetic data. */
-        pitch_overlap = s->pitch >> 2;
-        if (pitch_overlap > len)
-            pitch_overlap = len;
-        gain = 1.0 - s->missing_samples*ATTENUATION_INCREMENT;
-        if (gain < 0.0)
-            gain = 0.0;
-        new_step = 1.0/pitch_overlap;
-        old_step = new_step*gain;
-        new_weight = new_step;
-        old_weight = (1.0 - new_step)*gain;
-        for (i = 0;  i < pitch_overlap;  i++)
-        {
-            amp[i] = fsaturate(old_weight*s->pitchbuf[s->pitch_offset] + new_weight*amp[i]);
-            if (++s->pitch_offset >= s->pitch)
-                s->pitch_offset = 0;
-            new_weight += new_step;
-            old_weight -= old_step;
-            if (old_weight < 0.0)
-                old_weight = 0.0;
-        }
-        s->missing_samples = 0;
-    }
-    save_history(s, amp, len);
-    return len;
-}
-/*- End of function --------------------------------------------------------*/
-
-int plc_fillin(plc_state_t *s, pj_int16_t amp[], int len)
-{
-    /*pj_int16_t tmp[PLC_PITCH_OVERLAP_MAX];*/
-    int i;
-    int pitch_overlap;
-    float old_step;
-    float new_step;
-    float old_weight;
-    float new_weight;
-    float gain;
-    pj_int16_t *orig_amp;
-    int orig_len;
-
-    orig_amp = amp;
-    orig_len = len;
-    if (s->missing_samples == 0)
-    {
-        /* As the gap in real speech starts we need to assess the last known pitch,
-           and prepare the synthetic data we will use for fill-in */
-        normalise_history(s);
-        s->pitch = amdf_pitch(PLC_PITCH_MIN, PLC_PITCH_MAX, s->history + PLC_HISTORY_LEN - CORRELATION_SPAN - PLC_PITCH_MIN, CORRELATION_SPAN);
-        /* We overlap a 1/4 wavelength */
-        pitch_overlap = s->pitch >> 2;
-        /* Cook up a single cycle of pitch, using a single of the real signal with 1/4
-           cycle OLA'ed to make the ends join up nicely */
-        /* The first 3/4 of the cycle is a simple copy */
-        for (i = 0;  i < s->pitch - pitch_overlap;  i++)
-            s->pitchbuf[i] = s->history[PLC_HISTORY_LEN - s->pitch + i];
-        /* The last 1/4 of the cycle is overlapped with the end of the previous cycle */
-        new_step = 1.0/pitch_overlap;
-        new_weight = new_step;
-        for (  ;  i < s->pitch;  i++)
-        {
-            s->pitchbuf[i] = s->history[PLC_HISTORY_LEN - s->pitch + i]*(1.0 - new_weight) + s->history[PLC_HISTORY_LEN - 2*s->pitch + i]*new_weight;
-            new_weight += new_step;
-        }
-        /* We should now be ready to fill in the gap with repeated, decaying cycles
-           of what is in pitchbuf */
-
-        /* We need to OLA the first 1/4 wavelength of the synthetic data, to smooth
-           it into the previous real data. To avoid the need to introduce a delay
-           in the stream, reverse the last 1/4 wavelength, and OLA with that. */
-        gain = 1.0;
-        new_step = 1.0/pitch_overlap;
-        old_step = new_step;
-        new_weight = new_step;
-        old_weight = 1.0 - new_step;
-        for (i = 0;  i < pitch_overlap;  i++)
-        {
-            amp[i] = fsaturate(old_weight*s->history[PLC_HISTORY_LEN - 1 - i] + new_weight*s->pitchbuf[i]);
-            new_weight += new_step;
-            old_weight -= old_step;
-            if (old_weight < 0.0)
-                old_weight = 0.0;
-        }
-        s->pitch_offset = i;
-    }
-    else
-    {
-        gain = 1.0 - s->missing_samples*ATTENUATION_INCREMENT;
-        i = 0;
-    }
-    for (  ;  gain > 0.0  &&  i < len;  i++)
-    {
-        amp[i] = (pj_int16_t)(s->pitchbuf[s->pitch_offset]*gain);
-        gain = gain - ATTENUATION_INCREMENT;
-        if (++s->pitch_offset >= s->pitch)
-            s->pitch_offset = 0;
-    }
-    for (  ;  i < len;  i++)
-        amp[i] = 0;
-    s->missing_samples += orig_len;
-    save_history(s, amp, len);
-    return len;
-}
-/*- End of function --------------------------------------------------------*/
-
-plc_state_t *plc_init(plc_state_t *s)
-{
-    memset(s, 0, sizeof(*s));
-    return s;
-}
-/*- End of function --------------------------------------------------------*/
-
-
-/*
- * PJMEDIA specifics
- */
-#include <pj/assert.h>
-#include <pj/pool.h>
-#include <pj/log.h>
-
-#define THIS_FILE	"plc_steveu.c"
-
-struct steveu_plc
-{
-    plc_state_t	    state;
-    unsigned	    samples_per_frame;
-};
-
-void* pjmedia_plc_steveu_create(pj_pool_t *pool, unsigned c, unsigned f)
-{
-    struct steveu_plc *splc;
-
-    PJ_ASSERT_RETURN(c==8000, NULL);
-    PJ_UNUSED_ARG(c);
-
-    splc = pj_pool_alloc(pool, sizeof(struct steveu_plc));
-    plc_init(&splc->state);
-    splc->samples_per_frame = f;
-
-    return splc;
-}
-
-void  pjmedia_plc_steveu_save(void *obj, pj_int16_t *samples)
-{
-    struct steveu_plc *splc = obj;
-    plc_rx(&splc->state, samples, splc->samples_per_frame);
-}
-
-void  pjmedia_plc_steveu_generate(void *obj, pj_int16_t *samples)
-{
-    struct steveu_plc *splc = obj;
-    //PJ_LOG(5,(THIS_FILE, "PLC: generating lost frame"));
-    plc_fillin(&splc->state, samples, splc->samples_per_frame);
-}
-
-/*- End of file ------------------------------------------------------------*/
-
Index: /pjproject/trunk/pjmedia/src/pjmedia/resample_resample.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/resample_resample.c	(revision 1241)
+++ /pjproject/trunk/pjmedia/src/pjmedia/resample_resample.c	(revision 1242)
@@ -218,5 +218,55 @@
 #else /* PJMEDIA_HAS_LIBRESAMPLE */
 
-int pjmedia_resample_resample_excluded;
+/*
+ * This is the configuration when sample rate conversion is disabled.
+ */
+struct pjmedia_resample
+{
+	unsigned samples_per_frame;
+};
+
+PJ_DEF(pj_status_t) pjmedia_resample_create( pj_pool_t *pool,
+					     pj_bool_t high_quality,
+					     pj_bool_t large_filter,
+					     unsigned channel_count,
+					     unsigned rate_in,
+					     unsigned rate_out,
+					     unsigned samples_per_frame,
+					     pjmedia_resample **p_resample) 
+{
+	pjmedia_resample *resample;
+	
+	PJ_ASSERT_RETURN(rate_in == rate_out, PJ_EINVALIDOP);
+
+	PJ_UNUSED_ARG(high_quality);
+	PJ_UNUSED_ARG(large_filter);
+	PJ_UNUSED_ARG(channel_count);
+	PJ_UNUSED_ARG(rate_in);
+	PJ_UNUSED_ARG(rate_out);
+		
+	resample = PJ_POOL_ZALLOC_T(pool, pjmedia_resample);
+	resample->samples_per_frame = samples_per_frame;
+	
+	*p_resample = resample;
+	
+	return PJ_SUCCESS;
+}
+
+PJ_DEF(void) pjmedia_resample_run( pjmedia_resample *resample,
+				   const pj_int16_t *input,
+				   pj_int16_t *output ) 
+{
+	pjmedia_copy_samples(output, input, resample->samples_per_frame);
+}
+
+PJ_DEF(unsigned) pjmedia_resample_get_input_size(pjmedia_resample *resample) 
+{
+	return resample->samples_per_frame;
+}
+
+PJ_DEF(void) pjmedia_resample_destroy(pjmedia_resample *resample) 
+{
+	PJ_UNUSED_ARG(resample);
+}
 
 #endif	/* PJMEDIA_HAS_LIBRESAMPLE */
Index: /pjproject/trunk/pjmedia/src/pjmedia/symbian_sound.cpp
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/symbian_sound.cpp	(revision 1242)
+++ /pjproject/trunk/pjmedia/src/pjmedia/symbian_sound.cpp	(revision 1242)
@@ -0,0 +1,873 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#include <pjmedia/sound.h>
+#include <pjmedia/errno.h>
+#include <pj/assert.h>
+#include <pj/log.h>
+#include <pj/os.h>
+
+
+/*
+ * This file provides sound implementation for Symbian Audio Streaming
+ * device. Application using this sound abstraction must link with:
+ *  - mediaclientaudiostream.lib, and
+ *  - mediaclientaudioinputstream.lib 
+ */
+#include <mda/common/audio.h>
+#include <MdaAudioOutputStream.h>
+#include <MdaAudioInputStream.h>
+
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+#define THIS_FILE	    "symbian_sound.cpp"
+#define BYTES_PER_SAMPLE    2
+#define POOL_NAME	    "SymbianSound"
+#define POOL_SIZE	    512
+#define POOL_INC	    512
+
+static pjmedia_snd_dev_info symbian_snd_dev_info = 
+{
+    "Symbian Sound Device",
+    1,
+    1,
+    8000
+};
+
+class CPjAudioInputEngine;
+class CPjAudioOutputEngine;
+
+/* 
+ * PJMEDIA Sound Stream instance 
+ */
+struct pjmedia_snd_stream
+{
+    // Pool
+    pj_pool_t			*pool;
+
+    // Common settings.
+    unsigned			 clock_rate;
+    unsigned			 channel_count;
+    unsigned			 samples_per_frame;
+
+    // Input stream
+    CPjAudioInputEngine		*inEngine;
+
+    // Output stream
+    CPjAudioOutputEngine	*outEngine;
+};
+
+static pj_pool_factory *snd_pool_factory;
+
+
+/*
+ * Convert clock rate to Symbian's TMdaAudioDataSettings capability.
+ */
+static TInt get_clock_rate_cap(unsigned clock_rate)
+{
+    switch (clock_rate) {
+    case 8000:  return TMdaAudioDataSettings::ESampleRate8000Hz;
+    case 11025: return TMdaAudioDataSettings::ESampleRate11025Hz;
+    case 12000: return TMdaAudioDataSettings::ESampleRate12000Hz;
+    case 16000: return TMdaAudioDataSettings::ESampleRate16000Hz;
+    case 22050: return TMdaAudioDataSettings::ESampleRate22050Hz;
+    case 24000: return TMdaAudioDataSettings::ESampleRate24000Hz;
+    case 32000: return TMdaAudioDataSettings::ESampleRate32000Hz;
+    case 44100: return TMdaAudioDataSettings::ESampleRate44100Hz;
+    case 48000: return TMdaAudioDataSettings::ESampleRate48000Hz;
+    case 64000: return TMdaAudioDataSettings::ESampleRate64000Hz;
+    case 96000: return TMdaAudioDataSettings::ESampleRate96000Hz;
+    default:
+	return 0;
+    }
+}
+
+
+/*
+ * Convert number of channels into Symbian's TMdaAudioDataSettings capability.
+ */
+static TInt get_channel_cap(unsigned channel_count)
+{
+    switch (channel_count) {
+    case 1: return TMdaAudioDataSettings::EChannelsMono;
+    case 2: return TMdaAudioDataSettings::EChannelsStereo;
+    default:
+	return 0;
+    }
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+/*
+ * Implementation: Symbian Input Stream.
+ */
+class CPjAudioInputEngine : public MMdaAudioInputStreamCallback
+{
+public:
+    enum State
+    {
+	STATE_INACTIVE,
+	STATE_ACTIVE,
+    };
+
+    ~CPjAudioInputEngine();
+
+    static CPjAudioInputEngine *NewL(pjmedia_snd_stream *parent_strm,
+				     pjmedia_snd_rec_cb rec_cb,
+				     void *user_data);
+
+    static CPjAudioInputEngine *NewLC(pjmedia_snd_stream *parent_strm,
+				      pjmedia_snd_rec_cb rec_cb,
+				      void *user_data);
+
+    pj_status_t StartRecord();
+    void Stop();
+
+public:
+    State		     state_;
+    pjmedia_snd_stream	    *parentStrm_;
+    pjmedia_snd_rec_cb	     recCb_;
+    void		    *userData_;
+    CMdaAudioInputStream    *iInputStream_;
+    HBufC8		    *iStreamBuffer_;
+    TPtr8		     iFramePtr_;
+    TInt		     lastError_;
+    pj_uint32_t		     timeStamp_;
+
+    CPjAudioInputEngine(pjmedia_snd_stream *parent_strm,
+			pjmedia_snd_rec_cb rec_cb,
+			void *user_data);
+    void ConstructL();
+    
+public:
+    virtual void MaiscOpenComplete(TInt aError);
+    virtual void MaiscBufferCopied(TInt aError, const TDesC8 &aBuffer);
+    virtual void MaiscRecordComplete(TInt aError);
+
+};
+
+
+CPjAudioInputEngine::CPjAudioInputEngine(pjmedia_snd_stream *parent_strm,
+					 pjmedia_snd_rec_cb rec_cb,
+					 void *user_data)
+    : state_(STATE_INACTIVE), parentStrm_(parent_strm), recCb_(rec_cb), 
+      iInputStream_(NULL), iStreamBuffer_(NULL), iFramePtr_(NULL, 0),
+      userData_(user_data), lastError_(KErrNone), timeStamp_(0)
+{
+}
+
+CPjAudioInputEngine::~CPjAudioInputEngine()
+{
+    Stop();
+    delete iStreamBuffer_;
+}
+
+void CPjAudioInputEngine::ConstructL()
+{
+    iStreamBuffer_ = HBufC8::NewMaxL(parentStrm_->samples_per_frame *
+				     parentStrm_->channel_count * 
+				     BYTES_PER_SAMPLE);
+}
+
+CPjAudioInputEngine *CPjAudioInputEngine::NewLC(pjmedia_snd_stream *parent,
+					        pjmedia_snd_rec_cb rec_cb,
+					        void *user_data)
+{
+    CPjAudioInputEngine* self = new (ELeave) CPjAudioInputEngine(parent,
+								 rec_cb, 
+								 user_data);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+}
+
+CPjAudioInputEngine *CPjAudioInputEngine::NewL(pjmedia_snd_stream *parent,
+					       pjmedia_snd_rec_cb rec_cb,
+					       void *user_data)
+{
+    CPjAudioInputEngine *self = NewLC(parent, rec_cb, user_data);
+    CleanupStack::Pop(self);
+    return self;
+}
+
+
+pj_status_t CPjAudioInputEngine::StartRecord()
+{
+
+    // Ignore command if recording is in progress.
+    if (state_ == STATE_ACTIVE)
+	return PJ_SUCCESS;
+
+    // According to Nokia's AudioStream example, some 2nd Edition, FP2 devices
+    // (such as Nokia 6630) require the stream to be reconstructed each time 
+    // before calling Open() - otherwise the callback never gets called.
+    // For uniform behavior, lets just delete/re-create the stream for all
+    // devices.
+
+    // Destroy existing stream.
+    if (iInputStream_) delete iInputStream_;
+    iInputStream_ = NULL;
+
+    // Create the stream.
+    TRAPD(err, iInputStream_ = CMdaAudioInputStream::NewL(*this));
+    if (err != KErrNone)
+	return PJ_RETURN_OS_ERROR(err);
+
+    // Initialize settings.
+    TMdaAudioDataSettings iStreamSettings;
+    iStreamSettings.iChannels = get_channel_cap(parentStrm_->channel_count);
+    iStreamSettings.iSampleRate = get_clock_rate_cap(parentStrm_->clock_rate);
+
+    pj_assert(iStreamSettings.iChannels != 0 && 
+	      iStreamSettings.iSampleRate != 0);
+
+    // Create timeout timer to wait for Open to complete
+    RTimer timer;
+    TRequestStatus reqStatus;
+    TInt rc;
+    
+    rc = timer.CreateLocal();
+    if (rc != KErrNone) {
+    	delete iInputStream_;
+	iInputStream_ = NULL;
+	return PJ_RETURN_OS_ERROR(rc);
+    }
+
+    PJ_LOG(4,(THIS_FILE, "Opening sound device for capture, "
+    		         "clock rate=%d, channel count=%d..",
+    		         parentStrm_->clock_rate, 
+    		         parentStrm_->channel_count));
+    
+    // Open stream.
+    lastError_ = KRequestPending;
+    iInputStream_->Open(&iStreamSettings);
+
+    // Wait until callback is called.
+    if (lastError_ == KRequestPending) {
+	timer.After(reqStatus, 5 * 1000 * 1000);
+
+	do {
+	    User::WaitForAnyRequest();
+	} while (lastError_==KRequestPending && reqStatus==KRequestPending);
+	
+	if (reqStatus==KRequestPending)
+	    timer.Cancel();
+    }
+
+    // Close timer
+    timer.Close();
+    
+    // Handle timeout
+    if (lastError_ == KRequestPending) {
+    	iInputStream_->Stop();
+    	delete iInputStream_;
+	iInputStream_ = NULL;
+	return PJ_ETIMEDOUT;
+    }
+    else if (lastError_ != KErrNone) {
+    	// Handle failure.
+	delete iInputStream_;
+	iInputStream_ = NULL;
+	return PJ_RETURN_OS_ERROR(lastError_);
+    }
+
+    // Feed the first frame.
+    iFramePtr_ = iStreamBuffer_->Des();
+    iInputStream_->ReadL(iFramePtr_);
+
+    // Success
+    PJ_LOG(4,(THIS_FILE, "Sound capture started."));
+    return PJ_SUCCESS;
+}
+
+
+void CPjAudioInputEngine::Stop()
+{
+    // If capture is in progress, stop it.
+    if (iInputStream_ && state_ == STATE_ACTIVE) {
+    	lastError_ = KRequestPending;
+    	iInputStream_->Stop();
+
+	// Wait until it's actually stopped
+    	while (lastError_ == KRequestPending)
+	    pj_thread_sleep(100);
+    }
+
+    if (iInputStream_) {
+	delete iInputStream_;
+	iInputStream_ = NULL;
+    }
+    
+    state_ = STATE_INACTIVE;
+}
+
+
+void CPjAudioInputEngine::MaiscOpenComplete(TInt aError)
+{
+    lastError_ = aError;
+}
+
+void CPjAudioInputEngine::MaiscBufferCopied(TInt aError, 
+					    const TDesC8 &aBuffer)
+{
+    lastError_ = aError;
+    if (aError != KErrNone)
+	return;
+
+    // Call the callback.
+    recCb_(userData_, timeStamp_, (void*)aBuffer.Ptr(), aBuffer.Size());
+
+    // Increment timestamp.
+    timeStamp_ += (aBuffer.Size() * BYTES_PER_SAMPLE);
+
+    // Record next frame
+    iFramePtr_ = iStreamBuffer_->Des();
+    iInputStream_->ReadL(iFramePtr_);
+}
+
+
+void CPjAudioInputEngine::MaiscRecordComplete(TInt aError)
+{
+    lastError_ = aError;
+    state_ = STATE_INACTIVE;
+}
+
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+/*
+ * Implementation: Symbian Output Stream.
+ */
+
+class CPjAudioOutputEngine : public MMdaAudioOutputStreamCallback
+{
+public:
+    enum State
+    {
+	STATE_INACTIVE,
+	STATE_ACTIVE,
+    };
+
+    ~CPjAudioOutputEngine();
+
+    static CPjAudioOutputEngine *NewL(pjmedia_snd_stream *parent_strm,
+				      pjmedia_snd_play_cb play_cb,
+				      void *user_data);
+
+    static CPjAudioOutputEngine *NewLC(pjmedia_snd_stream *parent_strm,
+				       pjmedia_snd_play_cb rec_cb,
+				       void *user_data);
+
+    pj_status_t StartPlay();
+    void Stop();
+
+public:
+    State		     state_;
+    pjmedia_snd_stream	    *parentStrm_;
+    pjmedia_snd_play_cb	     playCb_;
+    void		    *userData_;
+    CMdaAudioOutputStream   *iOutputStream_;
+    TUint8		    *frameBuf_;
+    unsigned		     frameBufSize_;
+    TInt		     lastError_;
+    unsigned		     timestamp_;
+
+    CPjAudioOutputEngine(pjmedia_snd_stream *parent_strm,
+			 pjmedia_snd_play_cb play_cb,
+			 void *user_data);
+    void ConstructL();
+
+    virtual void MaoscOpenComplete(TInt aError);
+    virtual void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer);
+    virtual void MaoscPlayComplete(TInt aError);
+};
+
+
+CPjAudioOutputEngine::CPjAudioOutputEngine(pjmedia_snd_stream *parent_strm,
+					   pjmedia_snd_play_cb play_cb,
+					   void *user_data) 
+: state_(STATE_INACTIVE), parentStrm_(parent_strm), playCb_(play_cb), 
+  userData_(user_data), iOutputStream_(NULL), frameBuf_(NULL),
+  lastError_(KErrNone), timestamp_(0)
+{
+}
+
+
+void CPjAudioOutputEngine::ConstructL()
+{
+    frameBufSize_ = parentStrm_->samples_per_frame *
+			   parentStrm_->channel_count * 
+			   BYTES_PER_SAMPLE;
+    frameBuf_ = new TUint8[frameBufSize_];
+}
+
+CPjAudioOutputEngine::~CPjAudioOutputEngine()
+{
+    Stop();
+    delete [] frameBuf_;	
+}
+
+CPjAudioOutputEngine *
+CPjAudioOutputEngine::NewLC(pjmedia_snd_stream *parent_strm,
+			    pjmedia_snd_play_cb rec_cb,
+			    void *user_data)
+{
+    CPjAudioOutputEngine* self = new (ELeave) CPjAudioOutputEngine(parent_strm,
+								   rec_cb, 
+								   user_data);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+}
+
+CPjAudioOutputEngine *
+CPjAudioOutputEngine::NewL(pjmedia_snd_stream *parent_strm,
+			   pjmedia_snd_play_cb play_cb,
+			   void *user_data)
+{
+    CPjAudioOutputEngine *self = NewLC(parent_strm, play_cb, user_data);
+    CleanupStack::Pop(self);
+    return self;
+}
+
+pj_status_t CPjAudioOutputEngine::StartPlay()
+{
+    // Ignore command if playing is in progress.
+    if (state_ == STATE_ACTIVE)
+	return PJ_SUCCESS;
+    
+    // Destroy existing stream.
+    if (iOutputStream_) delete iOutputStream_;
+    iOutputStream_ = NULL;
+    
+    // Create the stream
+    TRAPD(err, iOutputStream_ = CMdaAudioOutputStream::NewL(*this));
+    if (err != KErrNone)
+	return PJ_RETURN_OS_ERROR(err);
+    
+    // Initialize settings.
+    TMdaAudioDataSettings iStreamSettings;
+    iStreamSettings.iChannels = get_channel_cap(parentStrm_->channel_count);
+    iStreamSettings.iSampleRate = get_clock_rate_cap(parentStrm_->clock_rate);
+
+    pj_assert(iStreamSettings.iChannels != 0 && 
+	      iStreamSettings.iSampleRate != 0);
+    
+    PJ_LOG(4,(THIS_FILE, "Opening sound device for playback, "
+    		         "clock rate=%d, channel count=%d..",
+    		         parentStrm_->clock_rate, 
+    		         parentStrm_->channel_count));
+    
+    // Open stream.
+    lastError_ = KRequestPending;
+    iOutputStream_->Open(&iStreamSettings);
+
+    // Wait until callback is called.
+    while (lastError_ == KRequestPending)
+	pj_thread_sleep(100);
+
+    // Handle failure.
+    if (lastError_ != KErrNone) {
+	delete iOutputStream_;
+	iOutputStream_ = NULL;
+	return PJ_RETURN_OS_ERROR(lastError_);
+    }
+
+    // Success
+    PJ_LOG(4,(THIS_FILE, "Sound playback started"));
+    return PJ_SUCCESS;
+
+}
+
+void CPjAudioOutputEngine::Stop()
+{
+    // Stop stream if it's playing
+    if (iOutputStream_ && state_ != STATE_INACTIVE) {
+    	lastError_ = KRequestPending;
+    	iOutputStream_->Stop();
+
+	// Wait until it's actually stopped
+    	while (lastError_ == KRequestPending)
+	    pj_thread_sleep(100);
+    }
+    
+    if (iOutputStream_) {	
+	delete iOutputStream_;
+	iOutputStream_ = NULL;
+    }
+    
+    state_ = STATE_INACTIVE;
+}
+
+void CPjAudioOutputEngine::MaoscOpenComplete(TInt aError)
+{
+    lastError_ = aError;
+    
+    if (aError==KErrNone) {
+	// output stream opened succesfully, set status to Active
+	state_ = STATE_ACTIVE;
+
+	// set stream properties, 16bit 8KHz mono
+	TMdaAudioDataSettings iSettings;
+	iSettings.iChannels = get_channel_cap(parentStrm_->channel_count);
+	iSettings.iSampleRate = get_clock_rate_cap(parentStrm_->clock_rate);
+
+	iOutputStream_->SetAudioPropertiesL(iSettings.iSampleRate, 
+					    iSettings.iChannels);
+
+	// set volume to 1/4th of stream max volume
+	iOutputStream_->SetVolume(iOutputStream_->MaxVolume()/4);
+	
+	// set stream priority to normal and time sensitive
+	iOutputStream_->SetPriority(EPriorityNormal, 
+				    EMdaPriorityPreferenceTime);				
+
+	// Call callback to retrieve frame from upstream.
+	pj_status_t status;
+	status = playCb_(this->userData_, timestamp_, frameBuf_, 
+			 frameBufSize_);
+	if (status != PJ_SUCCESS) {
+	    this->Stop();
+	    return;
+	}
+
+	// Increment timestamp.
+	timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE);
+
+	// issue WriteL() to write the first audio data block, 
+	// subsequent calls to WriteL() will be issued in 
+	// MMdaAudioOutputStreamCallback::MaoscBufferCopied() 
+	// until whole data buffer is written.
+	TPtrC8 frame(frameBuf_, frameBufSize_);
+	iOutputStream_->WriteL(frame);
+    } 
+}
+
+void CPjAudioOutputEngine::MaoscBufferCopied(TInt aError, 
+					     const TDesC8& aBuffer)
+{
+    PJ_UNUSED_ARG(aBuffer);
+
+    if (aError==KErrNone) {
+    	// Buffer successfully written, feed another one.
+
+	// Call callback to retrieve frame from upstream.
+	pj_status_t status;
+	status = playCb_(this->userData_, timestamp_, frameBuf_, 
+			 frameBufSize_);
+	if (status != PJ_SUCCESS) {
+	    this->Stop();
+	    return;
+	}
+
+	// Increment timestamp.
+	timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE);
+
+	// Write to playback stream.
+	TPtrC8 frame(frameBuf_, frameBufSize_);
+	iOutputStream_->WriteL(frame);
+
+    } else if (aError==KErrAbort) {
+	// playing was aborted, due to call to CMdaAudioOutputStream::Stop()
+	state_ = STATE_INACTIVE;
+    } else  {
+	// error writing data to output
+	lastError_ = aError;
+	state_ = STATE_INACTIVE;
+    }
+}
+
+void CPjAudioOutputEngine::MaoscPlayComplete(TInt aError)
+{
+    lastError_ = aError;
+    state_ = STATE_INACTIVE;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+
+/*
+ * Initialize sound subsystem.
+ */
+PJ_DEF(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory)
+{
+    snd_pool_factory = factory;
+    return PJ_SUCCESS;
+}
+
+/*
+ * Get device count.
+ */
+PJ_DEF(int) pjmedia_snd_get_dev_count(void)
+{
+    /* Always return 1 */
+    return 1;
+}
+
+/*
+ * Get device info.
+ */
+PJ_DEF(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned index)
+{
+    /* Always return the default sound device */
+    PJ_ASSERT_RETURN(index==0, NULL);
+    return &symbian_snd_dev_info;
+}
+
+
+
+/*
+ * Open sound recorder stream.
+ */
+PJ_DEF(pj_status_t) pjmedia_snd_open_rec( int index,
+					  unsigned clock_rate,
+					  unsigned channel_count,
+					  unsigned samples_per_frame,
+					  unsigned bits_per_sample,
+					  pjmedia_snd_rec_cb rec_cb,
+					  void *user_data,
+					  pjmedia_snd_stream **p_snd_strm)
+{
+    pj_pool_t *pool;
+    pjmedia_snd_stream *strm;
+
+    PJ_ASSERT_RETURN(index == 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(clock_rate && channel_count && samples_per_frame &&
+    		     bits_per_sample && rec_cb && p_snd_strm, PJ_EINVAL);
+
+    pool = pj_pool_create(snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, 
+    			  NULL);
+    if (!pool)
+	return PJ_ENOMEM;
+
+    strm = (pjmedia_snd_stream*) pj_pool_zalloc(pool, 
+    						sizeof(pjmedia_snd_stream));
+    strm->pool = pool;
+    strm->clock_rate = clock_rate;
+    strm->channel_count = channel_count;
+    strm->samples_per_frame = samples_per_frame;
+
+    TMdaAudioDataSettings settings;
+    TInt clockRateCap, channelCountCap;
+
+    clockRateCap = get_clock_rate_cap(clock_rate);
+    channelCountCap = get_channel_cap(channel_count);
+
+    PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL);
+    PJ_ASSERT_RETURN(clockRateCap != 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(channelCountCap != 0, PJ_EINVAL);
+
+    // Create the input stream.
+    TRAPD(err, strm->inEngine = CPjAudioInputEngine::NewL(strm, rec_cb, 
+    							  user_data));
+    if (err != KErrNone) {
+    	pj_pool_release(pool);
+	return PJ_RETURN_OS_ERROR(err);
+    }
+
+
+    // Done.
+    *p_snd_strm = strm;
+    return PJ_SUCCESS;
+}
+
+PJ_DEF(pj_status_t) pjmedia_snd_open_player( int index,
+					unsigned clock_rate,
+					unsigned channel_count,
+					unsigned samples_per_frame,
+					unsigned bits_per_sample,
+					pjmedia_snd_play_cb play_cb,
+					void *user_data,
+					pjmedia_snd_stream **p_snd_strm )
+{
+    pj_pool_t *pool;
+    pjmedia_snd_stream *strm;
+
+    PJ_ASSERT_RETURN(index == 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(clock_rate && channel_count && samples_per_frame &&
+    		     bits_per_sample && play_cb && p_snd_strm, PJ_EINVAL);
+
+    pool = pj_pool_create(snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, 
+    			  NULL);
+    if (!pool)
+	return PJ_ENOMEM;
+
+    strm = (pjmedia_snd_stream*) pj_pool_zalloc(pool, 
+    						sizeof(pjmedia_snd_stream));
+    strm->pool = pool;
+    strm->clock_rate = clock_rate;
+    strm->channel_count = channel_count;
+    strm->samples_per_frame = samples_per_frame;
+
+    TMdaAudioDataSettings settings;
+    TInt clockRateCap, channelCountCap;
+
+    clockRateCap = get_clock_rate_cap(clock_rate);
+    channelCountCap = get_channel_cap(channel_count);
+
+    PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL);
+    PJ_ASSERT_RETURN(clockRateCap != 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(channelCountCap != 0, PJ_EINVAL);
+
+    // Create the output stream.
+    TRAPD(err, strm->outEngine = CPjAudioOutputEngine::NewL(strm, play_cb, 
+    							    user_data));
+    if (err != KErrNone) {
+    	pj_pool_release(pool);	
+	return PJ_RETURN_OS_ERROR(err);
+    }
+
+    // Done.
+    *p_snd_strm = strm;
+    return PJ_SUCCESS;
+}
+
+PJ_DEF(pj_status_t) pjmedia_snd_open( int rec_id,
+				      int play_id,
+				      unsigned clock_rate,
+				      unsigned channel_count,
+				      unsigned samples_per_frame,
+				      unsigned bits_per_sample,
+				      pjmedia_snd_rec_cb rec_cb,
+				      pjmedia_snd_play_cb play_cb,
+				      void *user_data,
+				      pjmedia_snd_stream **p_snd_strm)
+{
+    pj_pool_t *pool;
+    pjmedia_snd_stream *strm;
+
+    PJ_ASSERT_RETURN(rec_id == 0 && play_id == 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(clock_rate && channel_count && samples_per_frame &&
+    		     bits_per_sample && rec_cb && play_cb && p_snd_strm, 
+    		     PJ_EINVAL);
+
+    pool = pj_pool_create(snd_pool_factory, POOL_NAME, POOL_SIZE, POOL_INC, 
+    			  NULL);
+    if (!pool)
+	return PJ_ENOMEM;
+
+    strm = (pjmedia_snd_stream*) pj_pool_zalloc(pool, 
+    						sizeof(pjmedia_snd_stream));
+    strm->pool = pool;
+    strm->clock_rate = clock_rate;
+    strm->channel_count = channel_count;
+    strm->samples_per_frame = samples_per_frame;
+
+    TMdaAudioDataSettings settings;
+    TInt clockRateCap, channelCountCap;
+
+    clockRateCap = get_clock_rate_cap(clock_rate);
+    channelCountCap = get_channel_cap(channel_count);
+
+    PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL);
+    PJ_ASSERT_RETURN(clockRateCap != 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(channelCountCap != 0, PJ_EINVAL);
+
+    // Create the output stream.
+    TRAPD(err, strm->outEngine = CPjAudioOutputEngine::NewL(strm, play_cb, 
+    							    user_data));
+    if (err != KErrNone) {
+    	pj_pool_release(pool);	
+	return PJ_RETURN_OS_ERROR(err);
+    }
+
+    // Done.
+    *p_snd_strm = strm;
+    return PJ_SUCCESS;
+}
+
+
+PJ_DEF(pj_status_t) pjmedia_snd_stream_start(pjmedia_snd_stream *stream)
+{
+    pj_status_t status;
+    
+    PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL);
+    
+    if (stream->inEngine) {
+    	status = stream->inEngine->StartRecord();
+    	if (status != PJ_SUCCESS)
+    	    return status;
+    }
+    	
+    if (stream->outEngine) {
+    	status = stream->outEngine->StartPlay();
+    	if (status != PJ_SUCCESS)
+    	    return status;
+    }
+    
+    return PJ_SUCCESS;
+}
+
+
+PJ_DEF(pj_status_t) pjmedia_snd_stream_stop(pjmedia_snd_stream *stream)
+{
+    PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL);
+    
+    if (stream->inEngine) {
+    	stream->inEngine->Stop();
+    }
+    	
+    if (stream->outEngine) {
+    	stream->outEngine->Stop();
+    }
+    
+    return PJ_SUCCESS;
+}
+
+
+PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream)
+{
+    pj_pool_t *pool;
+    
+    PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL);
+    
+    if (stream->inEngine) {
+    	delete stream->inEngine;
+    	stream->inEngine = NULL;
+    }
+
+    if (stream->outEngine) {
+    	delete stream->outEngine;
+    	stream->outEngine = NULL;
+    }
+    
+    pool = stream->pool;
+    if (pool) {	
+    	stream->pool = NULL;
+    	pj_pool_release(pool);
+    }
+    
+    return PJ_SUCCESS;
+}
+
+
+PJ_DEF(pj_status_t) pjmedia_snd_deinit(void)
+{
+    /* Nothing to do */
+    return PJ_SUCCESS;
+}
+
Index: /pjproject/trunk/pjnath/include/pjnath/ice_session.h
===================================================================
--- /pjproject/trunk/pjnath/include/pjnath/ice_session.h	(revision 1241)
+++ /pjproject/trunk/pjnath/include/pjnath/ice_session.h	(revision 1242)
@@ -17,6 +17,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
-#ifndef __PJNATH_ICE_SOCK_H__
-#define __PJNATH_ICE_SOCK_H__
+#ifndef __PJNATH_ICE_SESSION_H__
+#define __PJNATH_ICE_SESSION_H__
 
 /**
@@ -751,4 +751,4 @@
 
 
-#endif	/* __PJNATH_ICE_SOCK_H__ */
-
+#endif	/* __PJNATH_ICE_SESSION_H__ */
+
Index: /pjproject/trunk/pjnath/include/pjnath/ice_strans.h
===================================================================
--- /pjproject/trunk/pjnath/include/pjnath/ice_strans.h	(revision 1241)
+++ /pjproject/trunk/pjnath/include/pjnath/ice_strans.h	(revision 1242)
@@ -17,6 +17,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
-#ifndef __PJNATH_ICE_STREAM_TRANSPORT_H__
-#define __PJNATH_ICE_STREAM_TRANSPORT_H__
+#ifndef __PJNATH_ICE_STRANS_H__
+#define __PJNATH_ICE_STRANS_H__
 
 
@@ -588,4 +588,4 @@
 
 
-#endif	/* __PJNATH_ICE_STREAM_TRANSPORT_H__ */
-
+#endif	/* __PJNATH_ICE_STRANS_H__ */
+
Index: /pjproject/trunk/pjsip-apps/src/symbian_ua/main_symbian.cpp
===================================================================
--- /pjproject/trunk/pjsip-apps/src/symbian_ua/main_symbian.cpp	(revision 1242)
+++ /pjproject/trunk/pjsip-apps/src/symbian_ua/main_symbian.cpp	(revision 1242)
@@ -0,0 +1,157 @@
+//Auto-generated file. Please do not modify.
+//#include <e32cmn.h>
+
+//#pragma data_seg(".SYMBIAN")
+//__EMULATOR_IMAGE_HEADER2 (0x1000007a,0x00000000,0x00000000,EPriorityForeground,0x00000000u,0x00000000u,0x00000000,0x00000000,0x00000000,0)
+//#pragma data_seg()
+
+#include "ua.h"
+#include <stdlib.h>
+#include <pj/errno.h>
+#include <pj/os.h>
+#include <pj/log.h>
+#include <pj/unicode.h>
+#include <stdio.h>
+
+#include <e32std.h>
+
+#include <pj/os.h>
+
+#include <e32base.h>
+#include <e32std.h>
+
+
+
+//  Global Variables
+CConsoleBase* console;
+static CActiveSchedulerWait *asw;
+
+
+//  Local Functions
+
+LOCAL_C void MainL()
+{
+    //
+    // add your program code here, example code below
+    //
+    int rc = ua_main();
+
+    asw->AsyncStop();
+}
+
+class MyScheduler : public CActiveScheduler
+{
+public:
+    MyScheduler()
+    {}
+
+    void Error(TInt aError) const;
+};
+
+void MyScheduler::Error(TInt aError) const
+{
+    PJ_UNUSED_ARG(aError);
+}
+
+class MyTask : public CActive
+{
+public:
+    static MyTask *NewL();
+    void Start();
+
+protected:
+    MyTask();
+    void ConstructL();
+    virtual void RunL();
+    virtual void DoCancel();
+    TInt RunError(TInt aError);
+
+private:
+    RTimer timer_;
+};
+
+MyTask::MyTask()
+: CActive(EPriorityNormal)
+{
+}
+
+void MyTask::ConstructL()
+{
+    timer_.CreateLocal();
+    CActiveScheduler::Add(this);
+}
+
+MyTask *MyTask::NewL()
+{
+    MyTask *self = new (ELeave) MyTask;
+    CleanupStack::PushL(self);
+
+    self->ConstructL();
+
+    CleanupStack::Pop(self);
+    return self;
+}
+
+void MyTask::Start()
+{
+    timer_.After(iStatus, 0);
+    SetActive();
+}
+
+void MyTask::RunL()
+{
+    MainL();
+}
+
+void MyTask::DoCancel()
+{
+}
+
+TInt MyTask::RunError(TInt aError)
+{
+    PJ_UNUSED_ARG(aError);
+    return KErrNone;
+}
+
+
+LOCAL_C void DoStartL()
+{
+    // Create active scheduler (to run active objects)
+    MyScheduler* scheduler = new (ELeave) MyScheduler;
+    CleanupStack::PushL(scheduler);
+    CActiveScheduler::Install(scheduler);
+
+    MyTask *task = MyTask::NewL();
+    task->Start();
+
+    asw = new CActiveSchedulerWait;
+    asw->Start();
+    
+    delete asw;
+    CleanupStack::Pop(scheduler);
+}
+
+
+//  Global Functions
+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;
+
+    TRAPD(startError, DoStartL());
+
+    console->Printf(_L("[press any key to close]\n"));
+    console->Getch();
+    
+    delete console;
+    delete cleanup;
+    //__UHEAP_MARKEND;
+    return KErrNone;
+}
+
Index: /pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp
===================================================================
--- /pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp	(revision 1242)
+++ /pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp	(revision 1242)
@@ -0,0 +1,323 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+
+/**
+ * simple_pjsua.c
+ *
+ * This is a very simple but fully featured SIP user agent, with the 
+ * following capabilities:
+ *  - SIP registration
+ *  - Making and receiving call
+ *  - Audio/media to sound device.
+ *
+ * Usage:
+ *  - To make outgoing call, start simple_pjsua with the URL of remote
+ *    destination to contact.
+ *    E.g.:
+ *	 simpleua sip:user@remote
+ *
+ *  - Incoming calls will automatically be answered with 200.
+ *
+ * This program will quit once it has completed a single call.
+ */
+
+#include <pjsua-lib/pjsua.h>
+#include "ua.h"
+
+#define THIS_FILE	"symbian_ua.cpp"
+
+#define SIP_DOMAIN	"colinux"
+#define SIP_USER	"bulukucing"
+#define SIP_PASSWD	"netura"
+
+
+/* Callback called by the library upon receiving incoming call */
+static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id,
+			     pjsip_rx_data *rdata)
+{
+    pjsua_call_info ci;
+
+    PJ_UNUSED_ARG(acc_id);
+    PJ_UNUSED_ARG(rdata);
+
+    pjsua_call_get_info(call_id, &ci);
+
+    PJ_LOG(3,(THIS_FILE, "Incoming call from %.*s!!",
+			 (int)ci.remote_info.slen,
+			 ci.remote_info.ptr));
+
+    /* Automatically answer incoming calls with 200/OK */
+    pjsua_call_answer(call_id, 200, NULL, NULL);
+}
+
+/* Callback called by the library when call's state has changed */
+static void on_call_state(pjsua_call_id call_id, pjsip_event *e)
+{
+    pjsua_call_info ci;
+
+    PJ_UNUSED_ARG(e);
+
+    pjsua_call_get_info(call_id, &ci);
+    PJ_LOG(3,(THIS_FILE, "Call %d state=%.*s", call_id,
+			 (int)ci.state_text.slen,
+			 ci.state_text.ptr));
+}
+
+/* Callback called by the library when call's media state has changed */
+static void on_call_media_state(pjsua_call_id call_id)
+{
+    pjsua_call_info ci;
+
+    pjsua_call_get_info(call_id, &ci);
+
+    if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) {
+	// When media is active, connect call to sound device.
+	pjsua_conf_connect(ci.conf_slot, 0);
+	pjsua_conf_connect(0, ci.conf_slot);
+    }
+}
+
+
+/* Logging callback */
+static void log_writer(int level, const char *buf, unsigned len)
+{
+    wchar_t buf16[PJ_LOG_MAX_SIZE];
+
+    PJ_UNUSED_ARG(level);
+    
+    pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16));
+
+    TPtrC16 aBuf((const TUint16*)buf16, (TInt)len);
+    console->Write(aBuf);
+}
+
+/*
+ * app_startup()
+ *
+ * url may contain URL to call.
+ */
+static pj_status_t app_startup(char *url)
+{
+    pjsua_acc_id acc_id;
+    pj_status_t status;
+
+    /* Redirect log before pjsua_init() */
+    pj_log_set_log_func((void (*)(int,const char*,int)) &log_writer);
+
+    /* Create pjsua first! */
+    status = pjsua_create();
+    if (status != PJ_SUCCESS) {
+    	pjsua_perror(THIS_FILE, "pjsua_create() error", status);
+    	return status;
+    }
+
+    /* If argument is specified, it's got to be a valid SIP URL */
+    if (url) {
+	status = pjsua_verify_sip_url(url);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "Invalid URL", status);
+		return status;
+	}
+    }
+
+    /* Init pjsua */
+    {
+	pjsua_config cfg;
+	pjsua_logging_config log_cfg;
+	pjsua_media_config med_cfg;
+
+	pjsua_config_default(&cfg);
+	cfg.thread_cnt = 0; // Disable threading on Symbian
+	cfg.cb.on_incoming_call = &on_incoming_call;
+	cfg.cb.on_call_media_state = &on_call_media_state;
+	cfg.cb.on_call_state = &on_call_state;
+
+	pjsua_logging_config_default(&log_cfg);
+	log_cfg.console_level = 4;
+	log_cfg.cb = &log_writer;
+
+	pjsua_media_config_default(&med_cfg);
+	med_cfg.thread_cnt = 0; // Disable threading on Symbian
+	med_cfg.has_ioqueue = PJ_FALSE;
+	med_cfg.ec_tail_len = 0;
+	
+	status = pjsua_init(&cfg, &log_cfg, &med_cfg);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "pjsua_init() error", status);
+		pjsua_destroy();
+		return status;
+	}
+    }
+
+    /* Add UDP transport. */
+    {
+	pjsua_transport_config cfg;
+
+	pjsua_transport_config_default(&cfg);
+	cfg.port = 5060;
+	status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &cfg, NULL);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "Error creating transport", status);
+		pjsua_destroy();
+		return status;
+	}
+    }
+
+    /* Initialization is done, now start pjsua */
+    status = pjsua_start();
+    if (status != PJ_SUCCESS) {
+    	pjsua_perror(THIS_FILE, "Error starting pjsua", status);
+    	pjsua_destroy();
+    	return status;
+    }
+
+    /* Register to SIP server by creating SIP account. */
+    {
+	pjsua_acc_config cfg;
+
+	pjsua_acc_config_default(&cfg);
+	cfg.id = pj_str("sip:" SIP_USER "@" SIP_DOMAIN);
+	cfg.reg_uri = pj_str("sip:" SIP_DOMAIN);
+	cfg.cred_count = 1;
+	cfg.cred_info[0].realm = pj_str(SIP_DOMAIN);
+	cfg.cred_info[0].scheme = pj_str("digest");
+	cfg.cred_info[0].username = pj_str(SIP_USER);
+	cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
+	cfg.cred_info[0].data = pj_str(SIP_PASSWD);
+
+	status = pjsua_acc_add(&cfg, PJ_TRUE, &acc_id);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "Error adding account", status);
+		pjsua_destroy();
+		return status;
+	}
+    }
+
+    /* If URL is specified, make call to the URL. */
+    if (url != NULL) {
+	pj_str_t uri = pj_str(url);
+	status = pjsua_call_make_call(acc_id, &uri, 0, NULL, NULL, NULL);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "Error making call", status);
+		pjsua_destroy();
+		return status;
+	}
+			
+    }
+
+    return PJ_SUCCESS;
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+#include <e32base.h>
+
+class ConsoleUI : public CActive 
+{
+public:
+	ConsoleUI(CActiveSchedulerWait *asw, CConsoleBase *con);
+    
+	// Run console UI
+	void Run();
+
+	// Stop
+	void Stop();
+    
+protected:
+	// Cancel asynchronous read.
+	void DoCancel();
+
+	// Implementation: called when read has completed.
+	void RunL();
+    
+private:
+	CActiveSchedulerWait *asw_;
+	CConsoleBase *con_;
+};
+
+
+ConsoleUI::ConsoleUI(CActiveSchedulerWait *asw, CConsoleBase *con) 
+: CActive(EPriorityStandard), asw_(asw), con_(con)
+{
+	CActiveScheduler::Add(this);
+}
+
+// Run console UI
+void ConsoleUI::Run() 
+{
+	con_->Read(iStatus);
+	SetActive();
+}
+
+// Stop console UI
+void ConsoleUI::Stop() 
+{
+	DoCancel();
+}
+
+// Cancel asynchronous read.
+void ConsoleUI::DoCancel() 
+{
+	con_->ReadCancel();
+}
+
+// Implementation: called when read has completed.
+void ConsoleUI::RunL() 
+{
+	TKeyCode kc = con_->KeyCode();
+	
+	switch (kc) {
+	case 'q':
+		asw_->AsyncStop();
+		break;
+	default:
+		PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed",
+			  kc, kc));
+		Run();
+		break;
+	}
+}
+
+////////////////////////////////////////////////////////////////////////////
+int ua_main() 
+{
+	pj_status_t status;
+	
+	// Initialize pjsua
+	status  = app_startup(NULL);
+	if (status != PJ_SUCCESS)
+		return status;
+	
+	
+	// Run the UI
+	CActiveSchedulerWait *asw = new CActiveSchedulerWait;
+	ConsoleUI *con = new ConsoleUI(asw, console);
+	
+	con->Run();
+	asw->Start();
+	
+	delete con;
+	delete asw;
+	
+	// Shutdown pjsua
+	pjsua_destroy();
+	
+    	return 0;
+}
+
Index: /pjproject/trunk/pjsip-apps/src/symbian_ua/ua.h
===================================================================
--- /pjproject/trunk/pjsip-apps/src/symbian_ua/ua.h	(revision 1242)
+++ /pjproject/trunk/pjsip-apps/src/symbian_ua/ua.h	(revision 1242)
@@ -0,0 +1,5 @@
+#include <e32cons.h>            // Console
+
+extern CConsoleBase* console;  // write all messages to this
+
+int ua_main();
Index: /pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c	(revision 1241)
+++ /pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c	(revision 1242)
@@ -170,5 +170,5 @@
 {
     if (cause_code > inv->cause) {
-	inv->cause = cause_code;
+	inv->cause = (pjsip_status_code) cause_code;
 	if (cause_text)
 	    pj_strdup(inv->pool, &inv->cause_text, cause_text);
@@ -462,5 +462,5 @@
     inv->options = options;
     inv->notify = PJ_TRUE;
-    inv->cause = 0;
+    inv->cause = (pjsip_status_code) 0;
 
     /* Object name will use the same dialog pointer. */
@@ -884,5 +884,5 @@
     inv->options = options;
     inv->notify = PJ_TRUE;
-    inv->cause = 0;
+    inv->cause = (pjsip_status_code) 0;
 
     /* Object name will use the same dialog pointer. */
Index: /pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c	(revision 1241)
+++ /pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c	(revision 1242)
@@ -59,5 +59,5 @@
 
 const pjsip_method pjsip_refer_method = {
-    PJSIP_REFER_METHOD,
+    (pjsip_method_e) PJSIP_REFER_METHOD,
     { "REFER", 5}
 };
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c	(revision 1241)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c	(revision 1242)
@@ -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>
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 1241)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 1242)
@@ -683,20 +683,20 @@
     
     if (acc->reg_last_err) {
-	info->status = acc->reg_last_err;
+	info->status = (pjsip_status_code) acc->reg_last_err;
 	pj_strerror(acc->reg_last_err, info->buf_, sizeof(info->buf_));
 	info->status_text = pj_str(info->buf_);
     } else if (acc->reg_last_code) {
 	if (info->has_registration) {
-	    info->status = acc->reg_last_code;
+	    info->status = (pjsip_status_code) acc->reg_last_code;
 	    info->status_text = *pjsip_get_status_text(acc->reg_last_code);
 	} else {
-	    info->status = 0;
+	    info->status = (pjsip_status_code) 0;
 	    info->status_text = pj_str("not registered");
 	}
     } else if (acc->cfg.reg_uri.slen) {
-	info->status = 100;
+	info->status = PJSIP_SC_TRYING;
 	info->status_text = pj_str("In Progress");
     } else {
-	info->status = 0;
+	info->status = (pjsip_status_code) 0;
 	info->status_text = pj_str("does not register");
     }
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 1241)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 1242)
@@ -85,5 +85,5 @@
     call->session = NULL;
     call->xfer_sub = NULL;
-    call->last_code = 0;
+    call->last_code = (pjsip_status_code) 0;
     call->conf_slot = PJSUA_INVALID_ID;
     call->last_text.ptr = call->last_text_buf_;
@@ -1947,5 +1947,6 @@
 	    if (call->res_time.sec == 0)
 		pj_gettimeofday(&call->res_time);
-	    call->last_code = e->body.tsx_state.tsx->status_code;
+	    call->last_code = (pjsip_status_code) 
+	    		      e->body.tsx_state.tsx->status_code;
 	    pj_strncpy(&call->last_text, 
 		       &e->body.tsx_state.tsx->status_text,
@@ -1960,5 +1961,6 @@
 		pj_gettimeofday(&call->res_time);
 	    if (e->body.tsx_state.tsx->status_code > call->last_code) {
-		call->last_code = e->body.tsx_state.tsx->status_code;
+		call->last_code = (pjsip_status_code) 
+				  e->body.tsx_state.tsx->status_code;
 		pj_strncpy(&call->last_text, 
 			   &e->body.tsx_state.tsx->status_text,
@@ -1967,5 +1969,6 @@
 	    break;
 	default:
-	    call->last_code = e->body.tsx_state.tsx->status_code;
+	    call->last_code = (pjsip_status_code) 
+	    		      e->body.tsx_state.tsx->status_code;
 	    pj_strncpy(&call->last_text, 
 		       &e->body.tsx_state.tsx->status_text,
@@ -2535,5 +2538,5 @@
 
     if (code < 200)
-	code = 200;
+	code = PJSIP_SC_OK;
     if (code >= 300) {
 	/* Application rejects call transfer request */
@@ -2776,5 +2779,6 @@
 						    &im_data->body,
 						    im_data->user_data,
-						    tsx->status_code,
+						    (pjsip_status_code)
+						    	tsx->status_code,
 						    &tsx->status_text);
 	    }
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c	(revision 1241)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c	(revision 1242)
@@ -36,5 +36,5 @@
 const pjsip_method pjsip_message_method =
 {
-    PJSIP_MESSAGE_METHOD,
+    (pjsip_method_e) PJSIP_MESSAGE_METHOD,
     { "MESSAGE", 7 }
 };
@@ -341,5 +341,6 @@
 						&im_data->body,
 						im_data->user_data,
-						tsx->status_code,
+						(pjsip_status_code) 
+						    tsx->status_code,
 						&tsx->status_text);
     }
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1241)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1242)
@@ -39,5 +39,5 @@
 pj_status_t pjsua_media_subsys_init(const pjsua_media_config *cfg)
 {
-    pj_str_t codec_id;
+    pj_str_t codec_id = {NULL, 0};
     unsigned opt;
     pj_status_t status;
