diff --git a/.gitignore b/.gitignore
index ccc5bb9604ef9601947060d0f4b11a847e7aada2..a0250ddf67959028b70776c674f463f8b53c4a23 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,18 +49,18 @@ sflphone-client-gnome/stamp-h1
 # PJSIP files
 *.depend
 *i686-pc-linux-gnu
-/libs/pjproject-1.0.1/pjlib-util/build/os-auto.mak
-/libs/pjproject-1.0.1/pjlib/build/os-auto.mak
-/libs/pjproject-1.0.1/pjlib/include/pj/compat/m_auto.h
-/libs/pjproject-1.0.1/pjlib/include/pj/compat/os_auto.h
-/libs/pjproject-1.0.1/pjlib/include/pj/config_site.h
-/libs/pjproject-1.0.1/pjmedia/build/os-auto.mak
-/libs/pjproject-1.0.1/pjmedia/include/pjmedia-codec/config_auto.h
-/libs/pjproject-1.0.1/pjmedia/include/pjmedia/config_auto.h
-/libs/pjproject-1.0.1/pjsip/build/os-auto.mak
-/libs/pjproject-1.0.1/pjsip/include/pjsip/sip_autoconf.h
-/libs/pjproject-1.0.1/third_party/build/os-auto.mak
-/libs/pjproject-1.0.1/third_party/build/portaudio/os-auto.mak
+/libs/pjproject-1.0.3/pjlib-util/build/os-auto.mak
+/libs/pjproject-1.0.3/pjlib/build/os-auto.mak
+/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_auto.h
+/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_auto.h
+/libs/pjproject-1.0.3/pjlib/include/pj/config_site.h
+/libs/pjproject-1.0.3/pjmedia/build/os-auto.mak
+/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/config_auto.h
+/libs/pjproject-1.0.3/pjmedia/include/pjmedia/config_auto.h
+/libs/pjproject-1.0.3/pjsip/build/os-auto.mak
+/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_autoconf.h
+/libs/pjproject-1.0.3/third_party/build/os-auto.mak
+/libs/pjproject-1.0.3/third_party/build/portaudio/os-auto.mak
 
 # Makefile
 sflphone-common/src/Makefile
diff --git a/sflphone-common/configure.ac b/sflphone-common/configure.ac
index dcb00903d2210e44354ae232e3fd0c2ba33535c0..b39dc0343faa0146a480fe1388fc95212f2c7c65 100644
--- a/sflphone-common/configure.ac
+++ b/sflphone-common/configure.ac
@@ -409,6 +409,6 @@ AC_SUBST(DBUS_SERVICES_DIR)
 	AC_SUBST(SFLPHONE_CFLAGS)
 AC_SUBST(SFLPHONE_LIBS)
 	AC_OUTPUT
-	AC_MSG_NOTICE([[Configuration done! Please make sure that pjsip library (libs/pjproject-1.0.2) has already been compiled. Run `make' to build the software.]])
+	AC_MSG_NOTICE([[Configuration done! Please make sure that pjsip library (libs/pjproject-1.0.3) has already been compiled. Run `make' to build the software.]])
 
 
diff --git a/sflphone-common/globals.mak b/sflphone-common/globals.mak
index e6f165a1ac990f1dd0872e18d732a3e84afa8448..51fe32ac486c133abdf074e4ff5312dd3df4602a 100644
--- a/sflphone-common/globals.mak
+++ b/sflphone-common/globals.mak
@@ -6,7 +6,7 @@ sflplugindir=$(DESTDIR)$(libdir)/sflphone/plugins
 ASTYLERC="../astylerc"
 indent="/usr/bin/astyle"
 
-PJSIP_VERSION="1.0.2"
+PJSIP_VERSION="1.0.3"
 
 # for pjsip
 PJSIP_LIBS= \
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak
deleted file mode 100644
index f88de8f7e39bf8bb66fbe8975178b957c9e01ed1..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak
+++ /dev/null
@@ -1,11 +0,0 @@
-# build/os-auto.mak.  Generated from os-auto.mak.in by configure.
-
-export OS_CFLAGS   := $(CC_DEF)PJ_AUTOCONF=1 -O2
-
-export OS_CXXFLAGS := $(CC_DEF)PJ_AUTOCONF=1 -O2 
-
-export OS_LDFLAGS  :=  -lm -luuid -lnsl -lrt -lpthread  -lasound
-
-export OS_SOURCES  := 
-
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/config.log b/sflphone-common/libs/pjproject-1.0.2/config.log
deleted file mode 100644
index dc4f10f2c3fed3bb85071163efb239158e1b3ec2..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/config.log
+++ /dev/null
@@ -1,2905 +0,0 @@
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by pjproject aconfigure 1.0, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
-  $ ./aconfigure 
-
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = emilou-desktop
-uname -m = x86_64
-uname -r = 2.6.28-11-generic
-uname -s = Linux
-uname -v = #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009
-
-/usr/bin/uname -p = unknown
-/bin/uname -X     = unknown
-
-/bin/arch              = unknown
-/usr/bin/arch -k       = unknown
-/usr/convex/getsysinfo = unknown
-hostinfo               = unknown
-/bin/machine           = unknown
-/usr/bin/oslevel       = unknown
-/bin/universe          = unknown
-
-PATH: /usr/local/sbin
-PATH: /usr/local/bin
-PATH: /usr/sbin
-PATH: /usr/bin
-PATH: /sbin
-PATH: /bin
-PATH: /usr/games
-PATH: /usr/local/share/OpenSceneGraph/bin
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-aconfigure:1377: checking build system type
-aconfigure:1395: result: x86_64-unknown-linux-gnu
-aconfigure:1403: checking host system type
-aconfigure:1417: result: x86_64-unknown-linux-gnu
-aconfigure:1425: checking target system type
-aconfigure:1439: result: x86_64-unknown-linux-gnu
-aconfigure:1513: checking for gcc
-aconfigure:1529: found /usr/bin/gcc
-aconfigure:1539: result: gcc
-aconfigure:1783: checking for C compiler version
-aconfigure:1786: gcc --version </dev/null >&5
-gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3
-Copyright (C) 2008 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-aconfigure:1789: $? = 0
-aconfigure:1791: gcc -v </dev/null >&5
-Using built-in specs.
-Target: x86_64-linux-gnu
-Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
-Thread model: posix
-gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) 
-aconfigure:1794: $? = 0
-aconfigure:1796: gcc -V </dev/null >&5
-gcc: '-V' option must have argument
-aconfigure:1799: $? = 1
-aconfigure:1822: checking for C compiler default output file name
-aconfigure:1825: gcc -O2   conftest.c  >&5
-aconfigure:1828: $? = 0
-aconfigure:1874: result: a.out
-aconfigure:1879: checking whether the C compiler works
-aconfigure:1885: ./a.out
-aconfigure:1888: $? = 0
-aconfigure:1905: result: yes
-aconfigure:1912: checking whether we are cross compiling
-aconfigure:1914: result: no
-aconfigure:1917: checking for suffix of executables
-aconfigure:1919: gcc -o conftest -O2   conftest.c  >&5
-aconfigure:1922: $? = 0
-aconfigure:1947: result: 
-aconfigure:1953: checking for suffix of object files
-aconfigure:1974: gcc -c -O2  conftest.c >&5
-aconfigure:1977: $? = 0
-aconfigure:1999: result: o
-aconfigure:2003: checking whether we are using the GNU C compiler
-aconfigure:2027: gcc -c -O2  conftest.c >&5
-aconfigure:2033: $? = 0
-aconfigure:2037: test -z 
-			 || test ! -s conftest.err
-aconfigure:2040: $? = 0
-aconfigure:2043: test -s conftest.o
-aconfigure:2046: $? = 0
-aconfigure:2059: result: yes
-aconfigure:2065: checking whether gcc accepts -g
-aconfigure:2086: gcc -c -g  conftest.c >&5
-aconfigure:2092: $? = 0
-aconfigure:2096: test -z 
-			 || test ! -s conftest.err
-aconfigure:2099: $? = 0
-aconfigure:2102: test -s conftest.o
-aconfigure:2105: $? = 0
-aconfigure:2116: result: yes
-aconfigure:2133: checking for gcc option to accept ANSI C
-aconfigure:2203: gcc  -c -O2  conftest.c >&5
-aconfigure:2209: $? = 0
-aconfigure:2213: test -z 
-			 || test ! -s conftest.err
-aconfigure:2216: $? = 0
-aconfigure:2219: test -s conftest.o
-aconfigure:2222: $? = 0
-aconfigure:2240: result: none needed
-aconfigure:2258: gcc -c -O2  conftest.c >&5
-conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
-aconfigure:2264: $? = 1
-aconfigure: failed program was:
-| #ifndef __cplusplus
-|   choke me
-| #endif
-aconfigure:2449: checking for g++
-aconfigure:2465: found /usr/bin/g++
-aconfigure:2475: result: g++
-aconfigure:2491: checking for C++ compiler version
-aconfigure:2494: g++ --version </dev/null >&5
-g++ (Ubuntu 4.3.3-5ubuntu4) 4.3.3
-Copyright (C) 2008 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-aconfigure:2497: $? = 0
-aconfigure:2499: g++ -v </dev/null >&5
-Using built-in specs.
-Target: x86_64-linux-gnu
-Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
-Thread model: posix
-gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) 
-aconfigure:2502: $? = 0
-aconfigure:2504: g++ -V </dev/null >&5
-g++: '-V' option must have argument
-aconfigure:2507: $? = 1
-aconfigure:2510: checking whether we are using the GNU C++ compiler
-aconfigure:2534: g++ -c -O2   conftest.cc >&5
-aconfigure:2540: $? = 0
-aconfigure:2544: test -z 
-			 || test ! -s conftest.err
-aconfigure:2547: $? = 0
-aconfigure:2550: test -s conftest.o
-aconfigure:2553: $? = 0
-aconfigure:2566: result: yes
-aconfigure:2572: checking whether g++ accepts -g
-aconfigure:2593: g++ -c -g  conftest.cc >&5
-aconfigure:2599: $? = 0
-aconfigure:2603: test -z 
-			 || test ! -s conftest.err
-aconfigure:2606: $? = 0
-aconfigure:2609: test -s conftest.o
-aconfigure:2612: $? = 0
-aconfigure:2623: result: yes
-aconfigure:2665: g++ -c -O2   conftest.cc >&5
-aconfigure:2671: $? = 0
-aconfigure:2675: test -z 
-			 || test ! -s conftest.err
-aconfigure:2678: $? = 0
-aconfigure:2681: test -s conftest.o
-aconfigure:2684: $? = 0
-aconfigure:2710: g++ -c -O2   conftest.cc >&5
-conftest.cc: In function 'int main()':
-conftest.cc:13: error: 'exit' was not declared in this scope
-aconfigure:2716: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| /* end confdefs.h.  */
-| 
-| int
-| main ()
-| {
-| exit (42);
-|   ;
-|   return 0;
-| }
-aconfigure:2665: g++ -c -O2   conftest.cc >&5
-conftest.cc:9: error: 'void std::exit(int)' should have been declared inside 'std'
-aconfigure:2671: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| /* end confdefs.h.  */
-| extern "C" void std::exit (int) throw (); using std::exit;
-| #include <stdlib.h>
-| int
-| main ()
-| {
-| exit (42);
-|   ;
-|   return 0;
-| }
-aconfigure:2665: g++ -c -O2   conftest.cc >&5
-conftest.cc:9: error: 'void std::exit(int)' should have been declared inside 'std'
-In file included from conftest.cc:10:
-/usr/include/stdlib.h:531: error: declaration of 'void std::exit(int) throw ()' throws different exceptions
-conftest.cc:9: error: from previous declaration 'void std::exit(int)'
-aconfigure:2671: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| /* end confdefs.h.  */
-| extern "C" void std::exit (int); using std::exit;
-| #include <stdlib.h>
-| int
-| main ()
-| {
-| exit (42);
-|   ;
-|   return 0;
-| }
-aconfigure:2665: g++ -c -O2   conftest.cc >&5
-aconfigure:2671: $? = 0
-aconfigure:2675: test -z 
-			 || test ! -s conftest.err
-aconfigure:2678: $? = 0
-aconfigure:2681: test -s conftest.o
-aconfigure:2684: $? = 0
-aconfigure:2710: g++ -c -O2   conftest.cc >&5
-aconfigure:2716: $? = 0
-aconfigure:2720: test -z 
-			 || test ! -s conftest.err
-aconfigure:2723: $? = 0
-aconfigure:2726: test -s conftest.o
-aconfigure:2729: $? = 0
-aconfigure:2772: checking for pthread_create in -lpthread
-aconfigure:2802: gcc -o conftest -O2   conftest.c -lpthread   >&5
-aconfigure:2808: $? = 0
-aconfigure:2812: test -z 
-			 || test ! -s conftest.err
-aconfigure:2815: $? = 0
-aconfigure:2818: test -s conftest
-aconfigure:2821: $? = 0
-aconfigure:2834: result: yes
-aconfigure:2846: checking for puts in -lwsock32
-aconfigure:2876: gcc -o conftest -O2   conftest.c -lwsock32  -lpthread  >&5
-conftest.c:20: warning: conflicting types for built-in function 'puts'
-/usr/bin/ld: cannot find -lwsock32
-collect2: ld returned 1 exit status
-aconfigure:2882: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| /* end confdefs.h.  */
-| 
-| /* Override any gcc2 internal prototype to avoid an error.  */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| /* We use char because int might match the return type of a gcc2
-|    builtin and then its argument prototype would still apply.  */
-| char puts ();
-| int
-| main ()
-| {
-| puts ();
-|   ;
-|   return 0;
-| }
-aconfigure:2908: result: no
-aconfigure:2920: checking for puts in -lws2_32
-aconfigure:2950: gcc -o conftest -O2   conftest.c -lws2_32  -lpthread  >&5
-conftest.c:20: warning: conflicting types for built-in function 'puts'
-/usr/bin/ld: cannot find -lws2_32
-collect2: ld returned 1 exit status
-aconfigure:2956: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| /* end confdefs.h.  */
-| 
-| /* Override any gcc2 internal prototype to avoid an error.  */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| /* We use char because int might match the return type of a gcc2
-|    builtin and then its argument prototype would still apply.  */
-| char puts ();
-| int
-| main ()
-| {
-| puts ();
-|   ;
-|   return 0;
-| }
-aconfigure:2982: result: no
-aconfigure:2994: checking for puts in -lole32
-aconfigure:3024: gcc -o conftest -O2   conftest.c -lole32  -lpthread  >&5
-conftest.c:20: warning: conflicting types for built-in function 'puts'
-/usr/bin/ld: cannot find -lole32
-collect2: ld returned 1 exit status
-aconfigure:3030: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| /* end confdefs.h.  */
-| 
-| /* Override any gcc2 internal prototype to avoid an error.  */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| /* We use char because int might match the return type of a gcc2
-|    builtin and then its argument prototype would still apply.  */
-| char puts ();
-| int
-| main ()
-| {
-| puts ();
-|   ;
-|   return 0;
-| }
-aconfigure:3056: result: no
-aconfigure:3068: checking for puts in -lwinmm
-aconfigure:3098: gcc -o conftest -O2   conftest.c -lwinmm  -lpthread  >&5
-conftest.c:20: warning: conflicting types for built-in function 'puts'
-/usr/bin/ld: cannot find -lwinmm
-collect2: ld returned 1 exit status
-aconfigure:3104: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| /* end confdefs.h.  */
-| 
-| /* Override any gcc2 internal prototype to avoid an error.  */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| /* We use char because int might match the return type of a gcc2
-|    builtin and then its argument prototype would still apply.  */
-| char puts ();
-| int
-| main ()
-| {
-| puts ();
-|   ;
-|   return 0;
-| }
-aconfigure:3130: result: no
-aconfigure:3142: checking for puts in -lsocket
-aconfigure:3172: gcc -o conftest -O2   conftest.c -lsocket  -lpthread  >&5
-conftest.c:20: warning: conflicting types for built-in function 'puts'
-/usr/bin/ld: cannot find -lsocket
-collect2: ld returned 1 exit status
-aconfigure:3178: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| /* end confdefs.h.  */
-| 
-| /* Override any gcc2 internal prototype to avoid an error.  */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| /* We use char because int might match the return type of a gcc2
-|    builtin and then its argument prototype would still apply.  */
-| char puts ();
-| int
-| main ()
-| {
-| puts ();
-|   ;
-|   return 0;
-| }
-aconfigure:3204: result: no
-aconfigure:3216: checking for puts in -lrt
-aconfigure:3246: gcc -o conftest -O2   conftest.c -lrt  -lpthread  >&5
-conftest.c:20: warning: conflicting types for built-in function 'puts'
-aconfigure:3252: $? = 0
-aconfigure:3256: test -z 
-			 || test ! -s conftest.err
-aconfigure:3259: $? = 0
-aconfigure:3262: test -s conftest
-aconfigure:3265: $? = 0
-aconfigure:3278: result: yes
-aconfigure:3290: checking for puts in -lnsl
-aconfigure:3320: gcc -o conftest -O2   conftest.c -lnsl  -lrt -lpthread  >&5
-conftest.c:21: warning: conflicting types for built-in function 'puts'
-aconfigure:3326: $? = 0
-aconfigure:3330: test -z 
-			 || test ! -s conftest.err
-aconfigure:3333: $? = 0
-aconfigure:3336: test -s conftest
-aconfigure:3339: $? = 0
-aconfigure:3352: result: yes
-aconfigure:3364: checking for uuid_generate in -luuid
-aconfigure:3394: gcc -o conftest -O2   conftest.c -luuid  -lnsl -lrt -lpthread  >&5
-aconfigure:3400: $? = 0
-aconfigure:3404: test -z 
-			 || test ! -s conftest.err
-aconfigure:3407: $? = 0
-aconfigure:3410: test -s conftest
-aconfigure:3413: $? = 0
-aconfigure:3426: result: yes
-aconfigure:3437: checking for uuid_generate in -luuid
-aconfigure:3499: result: yes
-aconfigure:3506: result: Setting PJ_M_NAME to x86_64
-aconfigure:3513: checking memory alignment
-aconfigure:3521: result: 8 bytes
-aconfigure:3535: checking whether byte ordering is bigendian
-aconfigure:3562: gcc -c -O2  conftest.c >&5
-aconfigure:3568: $? = 0
-aconfigure:3572: test -z 
-			 || test ! -s conftest.err
-aconfigure:3575: $? = 0
-aconfigure:3578: test -s conftest.o
-aconfigure:3581: $? = 0
-aconfigure:3605: gcc -c -O2  conftest.c >&5
-conftest.c: In function 'main':
-conftest.c:25: error: 'not' undeclared (first use in this function)
-conftest.c:25: error: (Each undeclared identifier is reported only once
-conftest.c:25: error: for each function it appears in.)
-conftest.c:25: error: expected ';' before 'big'
-aconfigure:3611: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| /* end confdefs.h.  */
-| #include <sys/types.h>
-| #include <sys/param.h>
-| 
-| int
-| main ()
-| {
-| #if BYTE_ORDER != BIG_ENDIAN
-|  not big endian
-| #endif
-| 
-|   ;
-|   return 0;
-| }
-aconfigure:3746: result: no
-aconfigure:3829: result: Checking if floating point is disabled... no
-aconfigure:3832: checking for fmod in -lm
-aconfigure:3862: gcc -o conftest -O2   conftest.c -lm  -luuid -lnsl -lrt -lpthread  >&5
-conftest.c:27: warning: conflicting types for built-in function 'fmod'
-aconfigure:3868: $? = 0
-aconfigure:3872: test -z 
-			 || test ! -s conftest.err
-aconfigure:3875: $? = 0
-aconfigure:3878: test -s conftest
-aconfigure:3881: $? = 0
-aconfigure:3894: result: yes
-aconfigure:3914: checking how to run the C preprocessor
-aconfigure:3949: gcc -E  conftest.c
-aconfigure:3955: $? = 0
-aconfigure:3987: gcc -E  conftest.c
-conftest.c:21:28: error: ac_nonexistent.h: No such file or directory
-aconfigure:3993: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| /* end confdefs.h.  */
-| #include <ac_nonexistent.h>
-aconfigure:4032: result: gcc -E
-aconfigure:4056: gcc -E  conftest.c
-aconfigure:4062: $? = 0
-aconfigure:4094: gcc -E  conftest.c
-conftest.c:21:28: error: ac_nonexistent.h: No such file or directory
-aconfigure:4100: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| /* end confdefs.h.  */
-| #include <ac_nonexistent.h>
-aconfigure:4144: checking for egrep
-aconfigure:4154: result: grep -E
-aconfigure:4159: checking for ANSI C header files
-aconfigure:4184: gcc -c -O2  conftest.c >&5
-aconfigure:4190: $? = 0
-aconfigure:4194: test -z 
-			 || test ! -s conftest.err
-aconfigure:4197: $? = 0
-aconfigure:4200: test -s conftest.o
-aconfigure:4203: $? = 0
-aconfigure:4292: gcc -o conftest -O2   conftest.c -lm -luuid -lnsl -lrt -lpthread  >&5
-conftest.c: In function 'main':
-conftest.c:38: warning: incompatible implicit declaration of built-in function 'exit'
-aconfigure:4295: $? = 0
-aconfigure:4297: ./conftest
-aconfigure:4300: $? = 0
-aconfigure:4315: result: yes
-aconfigure:4339: checking for sys/types.h
-aconfigure:4355: gcc -c -O2  conftest.c >&5
-aconfigure:4361: $? = 0
-aconfigure:4365: test -z 
-			 || test ! -s conftest.err
-aconfigure:4368: $? = 0
-aconfigure:4371: test -s conftest.o
-aconfigure:4374: $? = 0
-aconfigure:4385: result: yes
-aconfigure:4339: checking for sys/stat.h
-aconfigure:4355: gcc -c -O2  conftest.c >&5
-aconfigure:4361: $? = 0
-aconfigure:4365: test -z 
-			 || test ! -s conftest.err
-aconfigure:4368: $? = 0
-aconfigure:4371: test -s conftest.o
-aconfigure:4374: $? = 0
-aconfigure:4385: result: yes
-aconfigure:4339: checking for stdlib.h
-aconfigure:4355: gcc -c -O2  conftest.c >&5
-aconfigure:4361: $? = 0
-aconfigure:4365: test -z 
-			 || test ! -s conftest.err
-aconfigure:4368: $? = 0
-aconfigure:4371: test -s conftest.o
-aconfigure:4374: $? = 0
-aconfigure:4385: result: yes
-aconfigure:4339: checking for string.h
-aconfigure:4355: gcc -c -O2  conftest.c >&5
-aconfigure:4361: $? = 0
-aconfigure:4365: test -z 
-			 || test ! -s conftest.err
-aconfigure:4368: $? = 0
-aconfigure:4371: test -s conftest.o
-aconfigure:4374: $? = 0
-aconfigure:4385: result: yes
-aconfigure:4339: checking for memory.h
-aconfigure:4355: gcc -c -O2  conftest.c >&5
-aconfigure:4361: $? = 0
-aconfigure:4365: test -z 
-			 || test ! -s conftest.err
-aconfigure:4368: $? = 0
-aconfigure:4371: test -s conftest.o
-aconfigure:4374: $? = 0
-aconfigure:4385: result: yes
-aconfigure:4339: checking for strings.h
-aconfigure:4355: gcc -c -O2  conftest.c >&5
-aconfigure:4361: $? = 0
-aconfigure:4365: test -z 
-			 || test ! -s conftest.err
-aconfigure:4368: $? = 0
-aconfigure:4371: test -s conftest.o
-aconfigure:4374: $? = 0
-aconfigure:4385: result: yes
-aconfigure:4339: checking for inttypes.h
-aconfigure:4355: gcc -c -O2  conftest.c >&5
-aconfigure:4361: $? = 0
-aconfigure:4365: test -z 
-			 || test ! -s conftest.err
-aconfigure:4368: $? = 0
-aconfigure:4371: test -s conftest.o
-aconfigure:4374: $? = 0
-aconfigure:4385: result: yes
-aconfigure:4339: checking for stdint.h
-aconfigure:4355: gcc -c -O2  conftest.c >&5
-aconfigure:4361: $? = 0
-aconfigure:4365: test -z 
-			 || test ! -s conftest.err
-aconfigure:4368: $? = 0
-aconfigure:4371: test -s conftest.o
-aconfigure:4374: $? = 0
-aconfigure:4385: result: yes
-aconfigure:4339: checking for unistd.h
-aconfigure:4355: gcc -c -O2  conftest.c >&5
-aconfigure:4361: $? = 0
-aconfigure:4365: test -z 
-			 || test ! -s conftest.err
-aconfigure:4368: $? = 0
-aconfigure:4371: test -s conftest.o
-aconfigure:4374: $? = 0
-aconfigure:4385: result: yes
-aconfigure:4407: checking arpa/inet.h usability
-aconfigure:4419: gcc -c -O2  conftest.c >&5
-aconfigure:4425: $? = 0
-aconfigure:4429: test -z 
-			 || test ! -s conftest.err
-aconfigure:4432: $? = 0
-aconfigure:4435: test -s conftest.o
-aconfigure:4438: $? = 0
-aconfigure:4448: result: yes
-aconfigure:4452: checking arpa/inet.h presence
-aconfigure:4462: gcc -E  conftest.c
-aconfigure:4468: $? = 0
-aconfigure:4488: result: yes
-aconfigure:4523: checking for arpa/inet.h
-aconfigure:4530: result: yes
-aconfigure:4552: checking assert.h usability
-aconfigure:4564: gcc -c -O2  conftest.c >&5
-aconfigure:4570: $? = 0
-aconfigure:4574: test -z 
-			 || test ! -s conftest.err
-aconfigure:4577: $? = 0
-aconfigure:4580: test -s conftest.o
-aconfigure:4583: $? = 0
-aconfigure:4593: result: yes
-aconfigure:4597: checking assert.h presence
-aconfigure:4607: gcc -E  conftest.c
-aconfigure:4613: $? = 0
-aconfigure:4633: result: yes
-aconfigure:4668: checking for assert.h
-aconfigure:4675: result: yes
-aconfigure:4697: checking ctype.h usability
-aconfigure:4709: gcc -c -O2  conftest.c >&5
-aconfigure:4715: $? = 0
-aconfigure:4719: test -z 
-			 || test ! -s conftest.err
-aconfigure:4722: $? = 0
-aconfigure:4725: test -s conftest.o
-aconfigure:4728: $? = 0
-aconfigure:4738: result: yes
-aconfigure:4742: checking ctype.h presence
-aconfigure:4752: gcc -E  conftest.c
-aconfigure:4758: $? = 0
-aconfigure:4778: result: yes
-aconfigure:4813: checking for ctype.h
-aconfigure:4820: result: yes
-aconfigure:4851: checking errno.h usability
-aconfigure:4863: gcc -c -O2  conftest.c >&5
-aconfigure:4869: $? = 0
-aconfigure:4873: test -z 
-			 || test ! -s conftest.err
-aconfigure:4876: $? = 0
-aconfigure:4879: test -s conftest.o
-aconfigure:4882: $? = 0
-aconfigure:4892: result: yes
-aconfigure:4896: checking errno.h presence
-aconfigure:4906: gcc -E  conftest.c
-aconfigure:4912: $? = 0
-aconfigure:4932: result: yes
-aconfigure:4967: checking for errno.h
-aconfigure:4974: result: yes
-aconfigure:4999: checking fcntl.h usability
-aconfigure:5011: gcc -c -O2  conftest.c >&5
-aconfigure:5017: $? = 0
-aconfigure:5021: test -z 
-			 || test ! -s conftest.err
-aconfigure:5024: $? = 0
-aconfigure:5027: test -s conftest.o
-aconfigure:5030: $? = 0
-aconfigure:5040: result: yes
-aconfigure:5044: checking fcntl.h presence
-aconfigure:5054: gcc -E  conftest.c
-aconfigure:5060: $? = 0
-aconfigure:5080: result: yes
-aconfigure:5115: checking for fcntl.h
-aconfigure:5122: result: yes
-aconfigure:5144: checking linux/socket.h usability
-aconfigure:5156: gcc -c -O2  conftest.c >&5
-aconfigure:5162: $? = 0
-aconfigure:5166: test -z 
-			 || test ! -s conftest.err
-aconfigure:5169: $? = 0
-aconfigure:5172: test -s conftest.o
-aconfigure:5175: $? = 0
-aconfigure:5185: result: yes
-aconfigure:5189: checking linux/socket.h presence
-aconfigure:5199: gcc -E  conftest.c
-aconfigure:5205: $? = 0
-aconfigure:5225: result: yes
-aconfigure:5260: checking for linux/socket.h
-aconfigure:5267: result: yes
-aconfigure:5289: checking malloc.h usability
-aconfigure:5301: gcc -c -O2  conftest.c >&5
-aconfigure:5307: $? = 0
-aconfigure:5311: test -z 
-			 || test ! -s conftest.err
-aconfigure:5314: $? = 0
-aconfigure:5317: test -s conftest.o
-aconfigure:5320: $? = 0
-aconfigure:5330: result: yes
-aconfigure:5334: checking malloc.h presence
-aconfigure:5344: gcc -E  conftest.c
-aconfigure:5350: $? = 0
-aconfigure:5370: result: yes
-aconfigure:5405: checking for malloc.h
-aconfigure:5412: result: yes
-aconfigure:5434: checking netdb.h usability
-aconfigure:5446: gcc -c -O2  conftest.c >&5
-aconfigure:5452: $? = 0
-aconfigure:5456: test -z 
-			 || test ! -s conftest.err
-aconfigure:5459: $? = 0
-aconfigure:5462: test -s conftest.o
-aconfigure:5465: $? = 0
-aconfigure:5475: result: yes
-aconfigure:5479: checking netdb.h presence
-aconfigure:5489: gcc -E  conftest.c
-aconfigure:5495: $? = 0
-aconfigure:5515: result: yes
-aconfigure:5550: checking for netdb.h
-aconfigure:5557: result: yes
-aconfigure:5579: checking netinet/in_systm.h usability
-aconfigure:5591: gcc -c -O2  conftest.c >&5
-aconfigure:5597: $? = 0
-aconfigure:5601: test -z 
-			 || test ! -s conftest.err
-aconfigure:5604: $? = 0
-aconfigure:5607: test -s conftest.o
-aconfigure:5610: $? = 0
-aconfigure:5620: result: yes
-aconfigure:5624: checking netinet/in_systm.h presence
-aconfigure:5634: gcc -E  conftest.c
-aconfigure:5640: $? = 0
-aconfigure:5660: result: yes
-aconfigure:5695: checking for netinet/in_systm.h
-aconfigure:5702: result: yes
-aconfigure:5724: checking netinet/in.h usability
-aconfigure:5736: gcc -c -O2  conftest.c >&5
-aconfigure:5742: $? = 0
-aconfigure:5746: test -z 
-			 || test ! -s conftest.err
-aconfigure:5749: $? = 0
-aconfigure:5752: test -s conftest.o
-aconfigure:5755: $? = 0
-aconfigure:5765: result: yes
-aconfigure:5769: checking netinet/in.h presence
-aconfigure:5779: gcc -E  conftest.c
-aconfigure:5785: $? = 0
-aconfigure:5805: result: yes
-aconfigure:5840: checking for netinet/in.h
-aconfigure:5847: result: yes
-aconfigure:5859: checking for netinet/ip.h
-aconfigure:5878: gcc -c -O2  conftest.c >&5
-aconfigure:5884: $? = 0
-aconfigure:5888: test -z 
-			 || test ! -s conftest.err
-aconfigure:5891: $? = 0
-aconfigure:5894: test -s conftest.o
-aconfigure:5897: $? = 0
-aconfigure:5908: result: yes
-aconfigure:5928: checking ifaddrs.h usability
-aconfigure:5940: gcc -c -O2  conftest.c >&5
-aconfigure:5946: $? = 0
-aconfigure:5950: test -z 
-			 || test ! -s conftest.err
-aconfigure:5953: $? = 0
-aconfigure:5956: test -s conftest.o
-aconfigure:5959: $? = 0
-aconfigure:5969: result: yes
-aconfigure:5973: checking ifaddrs.h presence
-aconfigure:5983: gcc -E  conftest.c
-aconfigure:5989: $? = 0
-aconfigure:6009: result: yes
-aconfigure:6044: checking for ifaddrs.h
-aconfigure:6051: result: yes
-aconfigure:6073: checking semaphore.h usability
-aconfigure:6085: gcc -c -O2  conftest.c >&5
-aconfigure:6091: $? = 0
-aconfigure:6095: test -z 
-			 || test ! -s conftest.err
-aconfigure:6098: $? = 0
-aconfigure:6101: test -s conftest.o
-aconfigure:6104: $? = 0
-aconfigure:6114: result: yes
-aconfigure:6118: checking semaphore.h presence
-aconfigure:6128: gcc -E  conftest.c
-aconfigure:6134: $? = 0
-aconfigure:6154: result: yes
-aconfigure:6189: checking for semaphore.h
-aconfigure:6196: result: yes
-aconfigure:6218: checking setjmp.h usability
-aconfigure:6230: gcc -c -O2  conftest.c >&5
-aconfigure:6236: $? = 0
-aconfigure:6240: test -z 
-			 || test ! -s conftest.err
-aconfigure:6243: $? = 0
-aconfigure:6246: test -s conftest.o
-aconfigure:6249: $? = 0
-aconfigure:6259: result: yes
-aconfigure:6263: checking setjmp.h presence
-aconfigure:6273: gcc -E  conftest.c
-aconfigure:6279: $? = 0
-aconfigure:6299: result: yes
-aconfigure:6334: checking for setjmp.h
-aconfigure:6341: result: yes
-aconfigure:6363: checking stdarg.h usability
-aconfigure:6375: gcc -c -O2  conftest.c >&5
-aconfigure:6381: $? = 0
-aconfigure:6385: test -z 
-			 || test ! -s conftest.err
-aconfigure:6388: $? = 0
-aconfigure:6391: test -s conftest.o
-aconfigure:6394: $? = 0
-aconfigure:6404: result: yes
-aconfigure:6408: checking stdarg.h presence
-aconfigure:6418: gcc -E  conftest.c
-aconfigure:6424: $? = 0
-aconfigure:6444: result: yes
-aconfigure:6479: checking for stdarg.h
-aconfigure:6486: result: yes
-aconfigure:6508: checking stddef.h usability
-aconfigure:6520: gcc -c -O2  conftest.c >&5
-aconfigure:6526: $? = 0
-aconfigure:6530: test -z 
-			 || test ! -s conftest.err
-aconfigure:6533: $? = 0
-aconfigure:6536: test -s conftest.o
-aconfigure:6539: $? = 0
-aconfigure:6549: result: yes
-aconfigure:6553: checking stddef.h presence
-aconfigure:6563: gcc -E  conftest.c
-aconfigure:6569: $? = 0
-aconfigure:6589: result: yes
-aconfigure:6624: checking for stddef.h
-aconfigure:6631: result: yes
-aconfigure:6653: checking stdio.h usability
-aconfigure:6665: gcc -c -O2  conftest.c >&5
-aconfigure:6671: $? = 0
-aconfigure:6675: test -z 
-			 || test ! -s conftest.err
-aconfigure:6678: $? = 0
-aconfigure:6681: test -s conftest.o
-aconfigure:6684: $? = 0
-aconfigure:6694: result: yes
-aconfigure:6698: checking stdio.h presence
-aconfigure:6708: gcc -E  conftest.c
-aconfigure:6714: $? = 0
-aconfigure:6734: result: yes
-aconfigure:6769: checking for stdio.h
-aconfigure:6776: result: yes
-aconfigure:6789: checking for stdint.h
-aconfigure:6794: result: yes
-aconfigure:6934: checking for stdlib.h
-aconfigure:6939: result: yes
-aconfigure:7079: checking for string.h
-aconfigure:7084: result: yes
-aconfigure:7233: checking sys/ioctl.h usability
-aconfigure:7245: gcc -c -O2  conftest.c >&5
-aconfigure:7251: $? = 0
-aconfigure:7255: test -z 
-			 || test ! -s conftest.err
-aconfigure:7258: $? = 0
-aconfigure:7261: test -s conftest.o
-aconfigure:7264: $? = 0
-aconfigure:7274: result: yes
-aconfigure:7278: checking sys/ioctl.h presence
-aconfigure:7288: gcc -E  conftest.c
-aconfigure:7294: $? = 0
-aconfigure:7314: result: yes
-aconfigure:7349: checking for sys/ioctl.h
-aconfigure:7356: result: yes
-aconfigure:7378: checking sys/select.h usability
-aconfigure:7390: gcc -c -O2  conftest.c >&5
-aconfigure:7396: $? = 0
-aconfigure:7400: test -z 
-			 || test ! -s conftest.err
-aconfigure:7403: $? = 0
-aconfigure:7406: test -s conftest.o
-aconfigure:7409: $? = 0
-aconfigure:7419: result: yes
-aconfigure:7423: checking sys/select.h presence
-aconfigure:7433: gcc -E  conftest.c
-aconfigure:7439: $? = 0
-aconfigure:7459: result: yes
-aconfigure:7494: checking for sys/select.h
-aconfigure:7501: result: yes
-aconfigure:7523: checking sys/socket.h usability
-aconfigure:7535: gcc -c -O2  conftest.c >&5
-aconfigure:7541: $? = 0
-aconfigure:7545: test -z 
-			 || test ! -s conftest.err
-aconfigure:7548: $? = 0
-aconfigure:7551: test -s conftest.o
-aconfigure:7554: $? = 0
-aconfigure:7564: result: yes
-aconfigure:7568: checking sys/socket.h presence
-aconfigure:7578: gcc -E  conftest.c
-aconfigure:7584: $? = 0
-aconfigure:7604: result: yes
-aconfigure:7639: checking for sys/socket.h
-aconfigure:7646: result: yes
-aconfigure:7668: checking sys/time.h usability
-aconfigure:7680: gcc -c -O2  conftest.c >&5
-aconfigure:7686: $? = 0
-aconfigure:7690: test -z 
-			 || test ! -s conftest.err
-aconfigure:7693: $? = 0
-aconfigure:7696: test -s conftest.o
-aconfigure:7699: $? = 0
-aconfigure:7709: result: yes
-aconfigure:7713: checking sys/time.h presence
-aconfigure:7723: gcc -E  conftest.c
-aconfigure:7729: $? = 0
-aconfigure:7749: result: yes
-aconfigure:7784: checking for sys/time.h
-aconfigure:7791: result: yes
-aconfigure:7813: checking sys/timeb.h usability
-aconfigure:7825: gcc -c -O2  conftest.c >&5
-aconfigure:7831: $? = 0
-aconfigure:7835: test -z 
-			 || test ! -s conftest.err
-aconfigure:7838: $? = 0
-aconfigure:7841: test -s conftest.o
-aconfigure:7844: $? = 0
-aconfigure:7854: result: yes
-aconfigure:7858: checking sys/timeb.h presence
-aconfigure:7868: gcc -E  conftest.c
-aconfigure:7874: $? = 0
-aconfigure:7894: result: yes
-aconfigure:7929: checking for sys/timeb.h
-aconfigure:7936: result: yes
-aconfigure:7949: checking for sys/types.h
-aconfigure:7954: result: yes
-aconfigure:8103: checking time.h usability
-aconfigure:8115: gcc -c -O2  conftest.c >&5
-aconfigure:8121: $? = 0
-aconfigure:8125: test -z 
-			 || test ! -s conftest.err
-aconfigure:8128: $? = 0
-aconfigure:8131: test -s conftest.o
-aconfigure:8134: $? = 0
-aconfigure:8144: result: yes
-aconfigure:8148: checking time.h presence
-aconfigure:8158: gcc -E  conftest.c
-aconfigure:8164: $? = 0
-aconfigure:8184: result: yes
-aconfigure:8219: checking for time.h
-aconfigure:8226: result: yes
-aconfigure:8239: checking for unistd.h
-aconfigure:8244: result: yes
-aconfigure:8393: checking winsock.h usability
-aconfigure:8405: gcc -c -O2  conftest.c >&5
-conftest.c:93:21: error: winsock.h: No such file or directory
-aconfigure:8411: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| /* end confdefs.h.  */
-| #include <stdio.h>
-| #if HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #if HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #if STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # if HAVE_STDLIB_H
-| #  include <stdlib.h>
-| # endif
-| #endif
-| #if HAVE_STRING_H
-| # if !STDC_HEADERS && HAVE_MEMORY_H
-| #  include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #if HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #if HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #else
-| # if HAVE_STDINT_H
-| #  include <stdint.h>
-| # endif
-| #endif
-| #if HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <winsock.h>
-aconfigure:8434: result: no
-aconfigure:8438: checking winsock.h presence
-aconfigure:8448: gcc -E  conftest.c
-conftest.c:59:21: error: winsock.h: No such file or directory
-aconfigure:8454: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| /* end confdefs.h.  */
-| #include <winsock.h>
-aconfigure:8474: result: no
-aconfigure:8509: checking for winsock.h
-aconfigure:8516: result: no
-aconfigure:8538: checking winsock2.h usability
-aconfigure:8550: gcc -c -O2  conftest.c >&5
-conftest.c:93:22: error: winsock2.h: No such file or directory
-aconfigure:8556: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| /* end confdefs.h.  */
-| #include <stdio.h>
-| #if HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #if HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #if STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # if HAVE_STDLIB_H
-| #  include <stdlib.h>
-| # endif
-| #endif
-| #if HAVE_STRING_H
-| # if !STDC_HEADERS && HAVE_MEMORY_H
-| #  include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #if HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #if HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #else
-| # if HAVE_STDINT_H
-| #  include <stdint.h>
-| # endif
-| #endif
-| #if HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <winsock2.h>
-aconfigure:8579: result: no
-aconfigure:8583: checking winsock2.h presence
-aconfigure:8593: gcc -E  conftest.c
-conftest.c:59:22: error: winsock2.h: No such file or directory
-aconfigure:8599: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| /* end confdefs.h.  */
-| #include <winsock2.h>
-aconfigure:8619: result: no
-aconfigure:8654: checking for winsock2.h
-aconfigure:8661: result: no
-aconfigure:8673: checking for mswsock.h
-aconfigure:8694: gcc -c -O2  conftest.c >&5
-conftest.c:66:21: error: mswsock.h: No such file or directory
-aconfigure:8700: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| /* end confdefs.h.  */
-| #if PJ_HAS_WINSOCK2_H
-|           	  #	include <winsock2.h>
-| 		  #elif PJ_HAS_WINSOCK_H
-|           	  #	include <winsock.h>
-|           	  #endif
-| 
-| 
-| #include <mswsock.h>
-aconfigure:8724: result: no
-aconfigure:8744: checking ws2tcpip.h usability
-aconfigure:8756: gcc -c -O2  conftest.c >&5
-conftest.c:93:22: error: ws2tcpip.h: No such file or directory
-aconfigure:8762: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| /* end confdefs.h.  */
-| #include <stdio.h>
-| #if HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #if HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #if STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # if HAVE_STDLIB_H
-| #  include <stdlib.h>
-| # endif
-| #endif
-| #if HAVE_STRING_H
-| # if !STDC_HEADERS && HAVE_MEMORY_H
-| #  include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #if HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #if HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #else
-| # if HAVE_STDINT_H
-| #  include <stdint.h>
-| # endif
-| #endif
-| #if HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <ws2tcpip.h>
-aconfigure:8785: result: no
-aconfigure:8789: checking ws2tcpip.h presence
-aconfigure:8799: gcc -E  conftest.c
-conftest.c:59:22: error: ws2tcpip.h: No such file or directory
-aconfigure:8805: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| /* end confdefs.h.  */
-| #include <ws2tcpip.h>
-aconfigure:8825: result: no
-aconfigure:8860: checking for ws2tcpip.h
-aconfigure:8867: result: no
-aconfigure:8889: checking uuid/uuid.h usability
-aconfigure:8901: gcc -c -O2  conftest.c >&5
-aconfigure:8907: $? = 0
-aconfigure:8911: test -z 
-			 || test ! -s conftest.err
-aconfigure:8914: $? = 0
-aconfigure:8917: test -s conftest.o
-aconfigure:8920: $? = 0
-aconfigure:8930: result: yes
-aconfigure:8934: checking uuid/uuid.h presence
-aconfigure:8944: gcc -E  conftest.c
-aconfigure:8950: $? = 0
-aconfigure:8970: result: yes
-aconfigure:9005: checking for uuid/uuid.h
-aconfigure:9012: result: yes
-aconfigure:9021: checking for net/if.h
-aconfigure:9040: gcc -c -O2  conftest.c >&5
-aconfigure:9046: $? = 0
-aconfigure:9050: test -z 
-			 || test ! -s conftest.err
-aconfigure:9053: $? = 0
-aconfigure:9056: test -s conftest.o
-aconfigure:9059: $? = 0
-aconfigure:9070: result: yes
-aconfigure:9081: result: Setting PJ_OS_NAME to x86_64-unknown-linux-gnu
-aconfigure:9088: result: Setting PJ_HAS_ERRNO_VAR to 1
-aconfigure:9095: result: Setting PJ_HAS_HIGH_RES_TIMER to 1
-aconfigure:9102: result: Setting PJ_HAS_MALLOC to 1
-aconfigure:9109: result: Setting PJ_NATIVE_STRING_IS_UNICODE to 0
-aconfigure:9116: result: Setting PJ_ATOMIC_VALUE_TYPE to long
-aconfigure:9123: checking if inet_aton() is available
-aconfigure:9143: gcc -c -O2  conftest.c >&5
-aconfigure:9149: $? = 0
-aconfigure:9153: test -z 
-			 || test ! -s conftest.err
-aconfigure:9156: $? = 0
-aconfigure:9159: test -s conftest.o
-aconfigure:9162: $? = 0
-aconfigure:9168: result: yes
-aconfigure:9179: checking if inet_pton() is available
-aconfigure:9199: gcc -c -O2  conftest.c >&5
-aconfigure:9205: $? = 0
-aconfigure:9209: test -z 
-			 || test ! -s conftest.err
-aconfigure:9212: $? = 0
-aconfigure:9215: test -s conftest.o
-aconfigure:9218: $? = 0
-aconfigure:9224: result: yes
-aconfigure:9235: checking if inet_ntop() is available
-aconfigure:9255: gcc -c -O2  conftest.c >&5
-aconfigure:9261: $? = 0
-aconfigure:9265: test -z 
-			 || test ! -s conftest.err
-aconfigure:9268: $? = 0
-aconfigure:9271: test -s conftest.o
-aconfigure:9274: $? = 0
-aconfigure:9280: result: yes
-aconfigure:9291: checking if getaddrinfo() is available
-aconfigure:9311: gcc -c -O2  conftest.c >&5
-aconfigure:9317: $? = 0
-aconfigure:9321: test -z 
-			 || test ! -s conftest.err
-aconfigure:9324: $? = 0
-aconfigure:9327: test -s conftest.o
-aconfigure:9330: $? = 0
-aconfigure:9336: result: yes
-aconfigure:9347: checking if sockaddr_in has sin_len member
-aconfigure:9368: gcc -c -O2  conftest.c >&5
-conftest.c: In function 'main':
-conftest.c:77: error: 'struct sockaddr_in' has no member named 'sin_len'
-aconfigure:9374: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| #define PJ_HAS_NET_IF_H 1
-| #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-| #define PJ_HAS_ERRNO_VAR 1
-| #define PJ_HAS_HIGH_RES_TIMER 1
-| #define PJ_HAS_MALLOC 1
-| #define PJ_NATIVE_STRING_IS_UNICODE 0
-| #define PJ_ATOMIC_VALUE_TYPE long
-| #define PJ_SOCK_HAS_INET_ATON 1
-| #define PJ_SOCK_HAS_INET_PTON 1
-| #define PJ_SOCK_HAS_INET_NTOP 1
-| #define PJ_SOCK_HAS_GETADDRINFO 1
-| /* end confdefs.h.  */
-| #include <sys/types.h>
-| 				     #include <sys/socket.h>
-| 		    		     #include <netinet/in.h>
-| 		    		     #include <arpa/inet.h>
-| int
-| main ()
-| {
-| struct sockaddr_in a; a.sin_len=0;
-|   ;
-|   return 0;
-| }
-aconfigure:9399: result: no
-aconfigure:9404: checking if socklen_t is available
-aconfigure:9422: gcc -c -O2  conftest.c >&5
-aconfigure:9428: $? = 0
-aconfigure:9432: test -z 
-			 || test ! -s conftest.err
-aconfigure:9435: $? = 0
-aconfigure:9438: test -s conftest.o
-aconfigure:9441: $? = 0
-aconfigure:9447: result: yes
-aconfigure:9458: checking if SO_ERROR is available
-aconfigure:9489: gcc -c -O2  conftest.c >&5
-aconfigure:9495: $? = 0
-aconfigure:9499: test -z 
-			 || test ! -s conftest.err
-aconfigure:9502: $? = 0
-aconfigure:9505: test -s conftest.o
-aconfigure:9508: $? = 0
-aconfigure:9514: result: yes
-aconfigure:9528: checking if pthread_rwlock_t is available
-aconfigure:9546: gcc -c -O2  conftest.c >&5
-aconfigure:9552: $? = 0
-aconfigure:9556: test -z 
-			 || test ! -s conftest.err
-aconfigure:9559: $? = 0
-aconfigure:9562: test -s conftest.o
-aconfigure:9565: $? = 0
-aconfigure:9572: result: yes
-aconfigure:9650: checking if pthread_mutexattr_settype() is available
-aconfigure:9668: gcc -c -O2  conftest.c >&5
-conftest.c: In function 'main':
-conftest.c:77: error: 'PTHREAD_MUTEX_FAST_NP' undeclared (first use in this function)
-conftest.c:77: error: (Each undeclared identifier is reported only once
-conftest.c:77: error: for each function it appears in.)
-aconfigure:9674: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| #define PJ_HAS_NET_IF_H 1
-| #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-| #define PJ_HAS_ERRNO_VAR 1
-| #define PJ_HAS_HIGH_RES_TIMER 1
-| #define PJ_HAS_MALLOC 1
-| #define PJ_NATIVE_STRING_IS_UNICODE 0
-| #define PJ_ATOMIC_VALUE_TYPE long
-| #define PJ_SOCK_HAS_INET_ATON 1
-| #define PJ_SOCK_HAS_INET_PTON 1
-| #define PJ_SOCK_HAS_INET_NTOP 1
-| #define PJ_SOCK_HAS_GETADDRINFO 1
-| #define PJ_HAS_SOCKLEN_T 1
-| #define PJ_HAS_SO_ERROR 1
-| #define PJ_EMULATE_RWMUTEX 0
-| /* end confdefs.h.  */
-| #include <pthread.h>
-| int
-| main ()
-| {
-| pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP);
-|   ;
-|   return 0;
-| }
-aconfigure:9699: result: no
-aconfigure:9704: checking if pthread_mutexattr_t has recursive member
-aconfigure:9723: gcc -c -O2  conftest.c >&5
-conftest.c: In function 'main':
-conftest.c:78: error: 'pthread_mutexattr_t' has no member named 'recursive'
-aconfigure:9729: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| #define PJ_HAS_NET_IF_H 1
-| #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-| #define PJ_HAS_ERRNO_VAR 1
-| #define PJ_HAS_HIGH_RES_TIMER 1
-| #define PJ_HAS_MALLOC 1
-| #define PJ_NATIVE_STRING_IS_UNICODE 0
-| #define PJ_ATOMIC_VALUE_TYPE long
-| #define PJ_SOCK_HAS_INET_ATON 1
-| #define PJ_SOCK_HAS_INET_PTON 1
-| #define PJ_SOCK_HAS_INET_NTOP 1
-| #define PJ_SOCK_HAS_GETADDRINFO 1
-| #define PJ_HAS_SOCKLEN_T 1
-| #define PJ_HAS_SO_ERROR 1
-| #define PJ_EMULATE_RWMUTEX 0
-| /* end confdefs.h.  */
-| #include <pthread.h>
-| int
-| main ()
-| {
-| pthread_mutexattr_t attr;
-| 				     attr.recursive=1;
-|   ;
-|   return 0;
-| }
-aconfigure:9754: result: no
-aconfigure:9760: checking ioqueue backend
-aconfigure:9773: result: select()
-aconfigure:9820: checking sys/soundcard.h usability
-aconfigure:9832: gcc -c -O2  conftest.c >&5
-aconfigure:9838: $? = 0
-aconfigure:9842: test -z 
-			 || test ! -s conftest.err
-aconfigure:9845: $? = 0
-aconfigure:9848: test -s conftest.o
-aconfigure:9851: $? = 0
-aconfigure:9861: result: yes
-aconfigure:9865: checking sys/soundcard.h presence
-aconfigure:9875: gcc -E  conftest.c
-aconfigure:9881: $? = 0
-aconfigure:9901: result: yes
-aconfigure:9936: checking for sys/soundcard.h
-aconfigure:9943: result: yes
-aconfigure:9962: checking linux/soundcard.h usability
-aconfigure:9974: gcc -c -O2  conftest.c >&5
-aconfigure:9980: $? = 0
-aconfigure:9984: test -z 
-			 || test ! -s conftest.err
-aconfigure:9987: $? = 0
-aconfigure:9990: test -s conftest.o
-aconfigure:9993: $? = 0
-aconfigure:10003: result: yes
-aconfigure:10007: checking linux/soundcard.h presence
-aconfigure:10017: gcc -E  conftest.c
-aconfigure:10023: $? = 0
-aconfigure:10043: result: yes
-aconfigure:10078: checking for linux/soundcard.h
-aconfigure:10085: result: yes
-aconfigure:10104: checking machine/soundcard.h usability
-aconfigure:10116: gcc -c -O2  conftest.c >&5
-conftest.c:107:31: error: machine/soundcard.h: No such file or directory
-aconfigure:10122: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| #define PJ_HAS_NET_IF_H 1
-| #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-| #define PJ_HAS_ERRNO_VAR 1
-| #define PJ_HAS_HIGH_RES_TIMER 1
-| #define PJ_HAS_MALLOC 1
-| #define PJ_NATIVE_STRING_IS_UNICODE 0
-| #define PJ_ATOMIC_VALUE_TYPE long
-| #define PJ_SOCK_HAS_INET_ATON 1
-| #define PJ_SOCK_HAS_INET_PTON 1
-| #define PJ_SOCK_HAS_INET_NTOP 1
-| #define PJ_SOCK_HAS_GETADDRINFO 1
-| #define PJ_HAS_SOCKLEN_T 1
-| #define PJ_HAS_SO_ERROR 1
-| #define PJ_EMULATE_RWMUTEX 0
-| /* end confdefs.h.  */
-| #include <stdio.h>
-| #if HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #if HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #if STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # if HAVE_STDLIB_H
-| #  include <stdlib.h>
-| # endif
-| #endif
-| #if HAVE_STRING_H
-| # if !STDC_HEADERS && HAVE_MEMORY_H
-| #  include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #if HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #if HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #else
-| # if HAVE_STDINT_H
-| #  include <stdint.h>
-| # endif
-| #endif
-| #if HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <machine/soundcard.h>
-aconfigure:10145: result: no
-aconfigure:10149: checking machine/soundcard.h presence
-aconfigure:10159: gcc -E  conftest.c
-conftest.c:73:31: error: machine/soundcard.h: No such file or directory
-aconfigure:10165: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| #define PJ_HAS_NET_IF_H 1
-| #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-| #define PJ_HAS_ERRNO_VAR 1
-| #define PJ_HAS_HIGH_RES_TIMER 1
-| #define PJ_HAS_MALLOC 1
-| #define PJ_NATIVE_STRING_IS_UNICODE 0
-| #define PJ_ATOMIC_VALUE_TYPE long
-| #define PJ_SOCK_HAS_INET_ATON 1
-| #define PJ_SOCK_HAS_INET_PTON 1
-| #define PJ_SOCK_HAS_INET_NTOP 1
-| #define PJ_SOCK_HAS_GETADDRINFO 1
-| #define PJ_HAS_SOCKLEN_T 1
-| #define PJ_HAS_SO_ERROR 1
-| #define PJ_EMULATE_RWMUTEX 0
-| /* end confdefs.h.  */
-| #include <machine/soundcard.h>
-aconfigure:10185: result: no
-aconfigure:10220: checking for machine/soundcard.h
-aconfigure:10227: result: no
-aconfigure:10283: checking alsa/version.h usability
-aconfigure:10295: gcc -c -O2  conftest.c >&5
-aconfigure:10301: $? = 0
-aconfigure:10305: test -z 
-			 || test ! -s conftest.err
-aconfigure:10308: $? = 0
-aconfigure:10311: test -s conftest.o
-aconfigure:10314: $? = 0
-aconfigure:10324: result: yes
-aconfigure:10328: checking alsa/version.h presence
-aconfigure:10338: gcc -E  conftest.c
-aconfigure:10344: $? = 0
-aconfigure:10364: result: yes
-aconfigure:10399: checking for alsa/version.h
-aconfigure:10406: result: yes
-aconfigure:10421: result: Checking sound device backend... unix
-aconfigure:10462: result: Checking if small filter is disabled... no
-aconfigure:10476: result: Checking if large filter is disabled... no
-aconfigure:10490: result: Checking if Speex AEC is disabled...no
-aconfigure:10508: result: Checking if G.711 codec is disabled...no
-aconfigure:10527: result: Checking if L16 codec is disabled...no
-aconfigure:10546: result: Checking if GSM codec is disabled...no
-aconfigure:10564: result: Checking if G.722 codec is disabled...no
-aconfigure:10582: result: Checking if Speex codec is disabled...no
-aconfigure:10600: result: Checking if iLBC codec is disabled...no
-aconfigure:10682: result: Skipping libsamplerate detection
-aconfigure:10959: result: Skipping Intel IPP settings (not wanted)
-aconfigure:10978: result: checking for OpenSSL installations..
-aconfigure:10993: checking openssl/ssl.h usability
-aconfigure:11005: gcc -c -O2  conftest.c >&5
-conftest.c:107:25: error: openssl/ssl.h: No such file or directory
-aconfigure:11011: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| #define PJ_HAS_NET_IF_H 1
-| #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-| #define PJ_HAS_ERRNO_VAR 1
-| #define PJ_HAS_HIGH_RES_TIMER 1
-| #define PJ_HAS_MALLOC 1
-| #define PJ_NATIVE_STRING_IS_UNICODE 0
-| #define PJ_ATOMIC_VALUE_TYPE long
-| #define PJ_SOCK_HAS_INET_ATON 1
-| #define PJ_SOCK_HAS_INET_PTON 1
-| #define PJ_SOCK_HAS_INET_NTOP 1
-| #define PJ_SOCK_HAS_GETADDRINFO 1
-| #define PJ_HAS_SOCKLEN_T 1
-| #define PJ_HAS_SO_ERROR 1
-| #define PJ_EMULATE_RWMUTEX 0
-| /* end confdefs.h.  */
-| #include <stdio.h>
-| #if HAVE_SYS_TYPES_H
-| # include <sys/types.h>
-| #endif
-| #if HAVE_SYS_STAT_H
-| # include <sys/stat.h>
-| #endif
-| #if STDC_HEADERS
-| # include <stdlib.h>
-| # include <stddef.h>
-| #else
-| # if HAVE_STDLIB_H
-| #  include <stdlib.h>
-| # endif
-| #endif
-| #if HAVE_STRING_H
-| # if !STDC_HEADERS && HAVE_MEMORY_H
-| #  include <memory.h>
-| # endif
-| # include <string.h>
-| #endif
-| #if HAVE_STRINGS_H
-| # include <strings.h>
-| #endif
-| #if HAVE_INTTYPES_H
-| # include <inttypes.h>
-| #else
-| # if HAVE_STDINT_H
-| #  include <stdint.h>
-| # endif
-| #endif
-| #if HAVE_UNISTD_H
-| # include <unistd.h>
-| #endif
-| #include <openssl/ssl.h>
-aconfigure:11034: result: no
-aconfigure:11038: checking openssl/ssl.h presence
-aconfigure:11048: gcc -E  conftest.c
-conftest.c:73:25: error: openssl/ssl.h: No such file or directory
-aconfigure:11054: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| #define PJ_HAS_NET_IF_H 1
-| #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-| #define PJ_HAS_ERRNO_VAR 1
-| #define PJ_HAS_HIGH_RES_TIMER 1
-| #define PJ_HAS_MALLOC 1
-| #define PJ_NATIVE_STRING_IS_UNICODE 0
-| #define PJ_ATOMIC_VALUE_TYPE long
-| #define PJ_SOCK_HAS_INET_ATON 1
-| #define PJ_SOCK_HAS_INET_PTON 1
-| #define PJ_SOCK_HAS_INET_NTOP 1
-| #define PJ_SOCK_HAS_GETADDRINFO 1
-| #define PJ_HAS_SOCKLEN_T 1
-| #define PJ_HAS_SO_ERROR 1
-| #define PJ_EMULATE_RWMUTEX 0
-| /* end confdefs.h.  */
-| #include <openssl/ssl.h>
-aconfigure:11074: result: no
-aconfigure:11109: checking for openssl/ssl.h
-aconfigure:11116: result: no
-aconfigure:11125: checking for SSL_library_init in -lssl
-aconfigure:11155: gcc -o conftest -O2   conftest.c -lssl  -lm -luuid -lnsl -lrt -lpthread  -lasound >&5
-/usr/bin/ld: cannot find -lssl
-collect2: ld returned 1 exit status
-aconfigure:11161: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| #define PJ_HAS_NET_IF_H 1
-| #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-| #define PJ_HAS_ERRNO_VAR 1
-| #define PJ_HAS_HIGH_RES_TIMER 1
-| #define PJ_HAS_MALLOC 1
-| #define PJ_NATIVE_STRING_IS_UNICODE 0
-| #define PJ_ATOMIC_VALUE_TYPE long
-| #define PJ_SOCK_HAS_INET_ATON 1
-| #define PJ_SOCK_HAS_INET_PTON 1
-| #define PJ_SOCK_HAS_INET_NTOP 1
-| #define PJ_SOCK_HAS_GETADDRINFO 1
-| #define PJ_HAS_SOCKLEN_T 1
-| #define PJ_HAS_SO_ERROR 1
-| #define PJ_EMULATE_RWMUTEX 0
-| /* end confdefs.h.  */
-| 
-| /* Override any gcc2 internal prototype to avoid an error.  */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| /* We use char because int might match the return type of a gcc2
-|    builtin and then its argument prototype would still apply.  */
-| char SSL_library_init ();
-| int
-| main ()
-| {
-| SSL_library_init ();
-|   ;
-|   return 0;
-| }
-aconfigure:11187: result: no
-aconfigure:11193: checking for ERR_load_BIO_strings in -lcrypto
-aconfigure:11223: gcc -o conftest -O2   conftest.c -lcrypto  -lm -luuid -lnsl -lrt -lpthread  -lasound >&5
-/usr/bin/ld: cannot find -lcrypto
-collect2: ld returned 1 exit status
-aconfigure:11229: $? = 1
-aconfigure: failed program was:
-| /* confdefs.h.  */
-| 
-| #define PACKAGE_NAME "pjproject"
-| #define PACKAGE_TARNAME "pjproject"
-| #define PACKAGE_VERSION "1.0"
-| #define PACKAGE_STRING "pjproject 1.0"
-| #define PACKAGE_BUGREPORT ""
-| #ifdef __cplusplus
-| extern "C" void exit (int) throw ();
-| #endif
-| #define HAVE_LIBPTHREAD 1
-| #define HAVE_LIBRT 1
-| #define HAVE_LIBNSL 1
-| #define HAVE_LIBUUID 1
-| #define PJ_M_NAME "x86_64"
-| #define PJ_POOL_ALIGNMENT 8
-| #define PJ_LINUX 1
-| #define PJ_HAS_FLOATING_POINT 1
-| #define HAVE_LIBM 1
-| #define STDC_HEADERS 1
-| #define HAVE_SYS_TYPES_H 1
-| #define HAVE_SYS_STAT_H 1
-| #define HAVE_STDLIB_H 1
-| #define HAVE_STRING_H 1
-| #define HAVE_MEMORY_H 1
-| #define HAVE_STRINGS_H 1
-| #define HAVE_INTTYPES_H 1
-| #define HAVE_STDINT_H 1
-| #define HAVE_UNISTD_H 1
-| #define PJ_HAS_ARPA_INET_H 1
-| #define PJ_HAS_ASSERT_H 1
-| #define PJ_HAS_CTYPE_H 1
-| #define PJ_HAS_ERRNO_H 1
-| #define PJ_HAS_FCNTL_H 1
-| #define PJ_HAS_LINUX_SOCKET_H 1
-| #define PJ_HAS_MALLOC_H 1
-| #define PJ_HAS_NETDB_H 1
-| #define PJ_HAS_NETINET_IN_SYSTM_H 1
-| #define PJ_HAS_NETINET_IN_H 1
-| #define PJ_HAS_NETINET_IP_H 1
-| #define PJ_HAS_IFADDRS_H 1
-| #define PJ_HAS_SEMAPHORE_H 1
-| #define PJ_HAS_SETJMP_H 1
-| #define PJ_HAS_STDARG_H 1
-| #define PJ_HAS_STDDEF_H 1
-| #define PJ_HAS_STDIO_H 1
-| #define PJ_HAS_STDINT_H 1
-| #define PJ_HAS_STDLIB_H 1
-| #define PJ_HAS_STRING_H 1
-| #define PJ_HAS_SYS_IOCTL_H 1
-| #define PJ_HAS_SYS_SELECT_H 1
-| #define PJ_HAS_SYS_SOCKET_H 1
-| #define PJ_HAS_SYS_TIME_H 1
-| #define PJ_HAS_SYS_TIMEB_H 1
-| #define PJ_HAS_SYS_TYPES_H 1
-| #define PJ_HAS_TIME_H 1
-| #define PJ_HAS_UNISTD_H 1
-| #define PJ_HAS_NET_IF_H 1
-| #define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-| #define PJ_HAS_ERRNO_VAR 1
-| #define PJ_HAS_HIGH_RES_TIMER 1
-| #define PJ_HAS_MALLOC 1
-| #define PJ_NATIVE_STRING_IS_UNICODE 0
-| #define PJ_ATOMIC_VALUE_TYPE long
-| #define PJ_SOCK_HAS_INET_ATON 1
-| #define PJ_SOCK_HAS_INET_PTON 1
-| #define PJ_SOCK_HAS_INET_NTOP 1
-| #define PJ_SOCK_HAS_GETADDRINFO 1
-| #define PJ_HAS_SOCKLEN_T 1
-| #define PJ_HAS_SO_ERROR 1
-| #define PJ_EMULATE_RWMUTEX 0
-| /* end confdefs.h.  */
-| 
-| /* Override any gcc2 internal prototype to avoid an error.  */
-| #ifdef __cplusplus
-| extern "C"
-| #endif
-| /* We use char because int might match the return type of a gcc2
-|    builtin and then its argument prototype would still apply.  */
-| char ERR_load_BIO_strings ();
-| int
-| main ()
-| {
-| ERR_load_BIO_strings ();
-|   ;
-|   return 0;
-| }
-aconfigure:11255: result: no
-aconfigure:11269: result: ** OpenSSL libraries not found, disabling SSL support **
-aconfigure:11278: checking if select() needs correct nfds
-aconfigure:11292: result: no (default)
-aconfigure:11294: result: ** Decided that select() doesn't need correct nfds (please check)
-aconfigure:11299: checking if pj_thread_create() should enforce stack size
-aconfigure:11313: result: no (default)
-aconfigure:11318: checking if pj_thread_create() should allocate stack
-aconfigure:11332: result: no (default)
-aconfigure:11348: result: ** Setting non-blocking recv() retval to EAGAIN (please check)
-aconfigure:11364: result: ** Setting non-blocking connect() retval to EINPROGRESS (please check)
-aconfigure:11488: creating ./config.status
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by pjproject config.status 1.0, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status 
-
-on emilou-desktop
-
-config.status:691: creating build.mak
-config.status:691: creating build/os-auto.mak
-config.status:691: creating pjlib/build/os-auto.mak
-config.status:691: creating pjlib-util/build/os-auto.mak
-config.status:691: creating pjmedia/build/os-auto.mak
-config.status:691: creating pjsip/build/os-auto.mak
-config.status:691: creating third_party/build/portaudio/os-auto.mak
-config.status:691: creating third_party/build/os-auto.mak
-config.status:794: creating pjlib/include/pj/compat/os_auto.h
-config.status:794: creating pjlib/include/pj/compat/m_auto.h
-config.status:794: creating pjmedia/include/pjmedia/config_auto.h
-config.status:794: creating pjmedia/include/pjmedia-codec/config_auto.h
-config.status:794: creating pjsip/include/pjsip/sip_autoconf.h
-aconfigure:12561: result:
-
-Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h.
-
-Further customizations can be put in:
-  - 'user.mak'
-  - 'pjlib/include/pj/config_site.h'
-
-The next step now is to run 'make dep' and 'make'.
-
-
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-
-ac_cv_build=x86_64-unknown-linux-gnu
-ac_cv_build_alias=x86_64-unknown-linux-gnu
-ac_cv_c_bigendian=no
-ac_cv_c_compiler_gnu=yes
-ac_cv_cxx_compiler_gnu=yes
-ac_cv_env_CC_set=
-ac_cv_env_CC_value=
-ac_cv_env_CFLAGS_set=
-ac_cv_env_CFLAGS_value=
-ac_cv_env_CPPFLAGS_set=
-ac_cv_env_CPPFLAGS_value=
-ac_cv_env_CPP_set=
-ac_cv_env_CPP_value=
-ac_cv_env_CXXFLAGS_set=
-ac_cv_env_CXXFLAGS_value=
-ac_cv_env_CXX_set=
-ac_cv_env_CXX_value=
-ac_cv_env_LDFLAGS_set=
-ac_cv_env_LDFLAGS_value=
-ac_cv_env_build_alias_set=
-ac_cv_env_build_alias_value=
-ac_cv_env_host_alias_set=
-ac_cv_env_host_alias_value=
-ac_cv_env_target_alias_set=
-ac_cv_env_target_alias_value=
-ac_cv_exeext=
-ac_cv_header_alsa_version_h=yes
-ac_cv_header_arpa_inet_h=yes
-ac_cv_header_assert_h=yes
-ac_cv_header_ctype_h=yes
-ac_cv_header_errno_h=yes
-ac_cv_header_fcntl_h=yes
-ac_cv_header_ifaddrs_h=yes
-ac_cv_header_inttypes_h=yes
-ac_cv_header_linux_socket_h=yes
-ac_cv_header_linux_soundcard_h=yes
-ac_cv_header_machine_soundcard_h=no
-ac_cv_header_malloc_h=yes
-ac_cv_header_memory_h=yes
-ac_cv_header_mswsock_h=no
-ac_cv_header_net_if_h=yes
-ac_cv_header_netdb_h=yes
-ac_cv_header_netinet_in_h=yes
-ac_cv_header_netinet_in_systm_h=yes
-ac_cv_header_netinet_ip_h=yes
-ac_cv_header_openssl_ssl_h=no
-ac_cv_header_semaphore_h=yes
-ac_cv_header_setjmp_h=yes
-ac_cv_header_stdarg_h=yes
-ac_cv_header_stdc=yes
-ac_cv_header_stddef_h=yes
-ac_cv_header_stdint_h=yes
-ac_cv_header_stdio_h=yes
-ac_cv_header_stdlib_h=yes
-ac_cv_header_string_h=yes
-ac_cv_header_strings_h=yes
-ac_cv_header_sys_ioctl_h=yes
-ac_cv_header_sys_select_h=yes
-ac_cv_header_sys_socket_h=yes
-ac_cv_header_sys_soundcard_h=yes
-ac_cv_header_sys_stat_h=yes
-ac_cv_header_sys_time_h=yes
-ac_cv_header_sys_timeb_h=yes
-ac_cv_header_sys_types_h=yes
-ac_cv_header_time_h=yes
-ac_cv_header_unistd_h=yes
-ac_cv_header_uuid_uuid_h=yes
-ac_cv_header_winsock2_h=no
-ac_cv_header_winsock_h=no
-ac_cv_header_ws2tcpip_h=no
-ac_cv_host=x86_64-unknown-linux-gnu
-ac_cv_host_alias=x86_64-unknown-linux-gnu
-ac_cv_lib_crypto_ERR_load_BIO_strings=no
-ac_cv_lib_m_fmod=yes
-ac_cv_lib_nsl_puts=yes
-ac_cv_lib_ole32_puts=no
-ac_cv_lib_pthread_pthread_create=yes
-ac_cv_lib_rt_puts=yes
-ac_cv_lib_socket_puts=no
-ac_cv_lib_ssl_SSL_library_init=no
-ac_cv_lib_uuid_uuid_generate=yes
-ac_cv_lib_winmm_puts=no
-ac_cv_lib_ws2_32_puts=no
-ac_cv_lib_wsock32_puts=no
-ac_cv_objext=o
-ac_cv_prog_CPP='gcc -E'
-ac_cv_prog_ac_ct_CC=gcc
-ac_cv_prog_ac_ct_CXX=g++
-ac_cv_prog_cc_g=yes
-ac_cv_prog_cc_stdc=
-ac_cv_prog_cxx_g=yes
-ac_cv_prog_egrep='grep -E'
-ac_cv_target=x86_64-unknown-linux-gnu
-ac_cv_target_alias=x86_64-unknown-linux-gnu
-
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-
-CC='gcc'
-CFLAGS='-O2'
-CPP='gcc -E'
-CPPFLAGS=''
-CXX='g++'
-CXXFLAGS='-O2 '
-DEFS='-DHAVE_CONFIG_H'
-ECHO_C=''
-ECHO_N='-n'
-ECHO_T=''
-EGREP='grep -E'
-EXEEXT=''
-LDFLAGS=''
-LIBOBJS=''
-LIBS='-lm -luuid -lnsl -lrt -lpthread  -lasound'
-LTLIBOBJS=''
-OBJEXT='o'
-PACKAGE_BUGREPORT=''
-PACKAGE_NAME='pjproject'
-PACKAGE_STRING='pjproject 1.0'
-PACKAGE_TARNAME='pjproject'
-PACKAGE_VERSION='1.0'
-PATH_SEPARATOR=':'
-SHELL='/bin/bash'
-ac_build_mak_vars=''
-ac_cross_compile=''
-ac_ct_CC='gcc'
-ac_ct_CXX='g++'
-ac_host='unix'
-ac_linux_poll='select'
-ac_main_obj='main.o'
-ac_no_g711_codec=''
-ac_no_g722_codec=''
-ac_no_gsm_codec=''
-ac_no_ilbc_codec=''
-ac_no_l16_codec=''
-ac_no_large_filter=''
-ac_no_small_filter=''
-ac_no_speex_aec=''
-ac_no_speex_codec=''
-ac_no_ssl=''
-ac_os_objs='ioqueue_select.o file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_uuid.o'
-ac_pa_cflags=' -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN'
-ac_pa_use_alsa='1'
-ac_pa_use_oss='1'
-ac_pjdir='/home/emilou/git-repos/sflphone/sflphone-common/libs/pjproject-1.0.2'
-ac_pjmedia_snd='pa_unix'
-bindir='${exec_prefix}/bin'
-build='x86_64-unknown-linux-gnu'
-build_alias=''
-build_cpu='x86_64'
-build_os='linux-gnu'
-build_vendor='unknown'
-datadir='${prefix}/share'
-exec_prefix='${prefix}'
-host='x86_64-unknown-linux-gnu'
-host_alias=''
-host_cpu='x86_64'
-host_os='linux-gnu'
-host_vendor='unknown'
-includedir='${prefix}/include'
-infodir='${prefix}/info'
-libcrypto_present=''
-libdir='${exec_prefix}/lib'
-libexecdir='${exec_prefix}/libexec'
-libssl_present=''
-localstatedir='${prefix}/var'
-mandir='${prefix}/man'
-oldincludedir='/usr/include'
-openssl_h_present=''
-prefix='/usr/local'
-program_transform_name='s,x,x,'
-sbindir='${exec_prefix}/sbin'
-sharedstatedir='${prefix}/com'
-sysconfdir='${prefix}/etc'
-target='x86_64-unknown-linux-gnu'
-target_alias=''
-target_cpu='x86_64'
-target_os='linux-gnu'
-target_vendor='unknown'
-
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-
-#define HAVE_INTTYPES_H 1
-#define HAVE_LIBM 1
-#define HAVE_LIBNSL 1
-#define HAVE_LIBPTHREAD 1
-#define HAVE_LIBRT 1
-#define HAVE_LIBUUID 1
-#define HAVE_MEMORY_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_STRING_H 1
-#define HAVE_SYS_STAT_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_UNISTD_H 1
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME "pjproject"
-#define PACKAGE_STRING "pjproject 1.0"
-#define PACKAGE_TARNAME "pjproject"
-#define PACKAGE_VERSION "1.0"
-#define PJ_ATOMIC_VALUE_TYPE long
-#define PJ_BLOCKING_CONNECT_ERROR_VAL EINPROGRESS
-#define PJ_BLOCKING_ERROR_VAL EAGAIN
-#define PJ_EMULATE_RWMUTEX 0
-#define PJ_HAS_ARPA_INET_H 1
-#define PJ_HAS_ASSERT_H 1
-#define PJ_HAS_CTYPE_H 1
-#define PJ_HAS_ERRNO_H 1
-#define PJ_HAS_ERRNO_VAR 1
-#define PJ_HAS_FCNTL_H 1
-#define PJ_HAS_FLOATING_POINT 1
-#define PJ_HAS_HIGH_RES_TIMER 1
-#define PJ_HAS_IFADDRS_H 1
-#define PJ_HAS_LINUX_SOCKET_H 1
-#define PJ_HAS_MALLOC 1
-#define PJ_HAS_MALLOC_H 1
-#define PJ_HAS_NETDB_H 1
-#define PJ_HAS_NETINET_IN_H 1
-#define PJ_HAS_NETINET_IN_SYSTM_H 1
-#define PJ_HAS_NETINET_IP_H 1
-#define PJ_HAS_NET_IF_H 1
-#define PJ_HAS_SEMAPHORE_H 1
-#define PJ_HAS_SETJMP_H 1
-#define PJ_HAS_SOCKLEN_T 1
-#define PJ_HAS_SO_ERROR 1
-#define PJ_HAS_STDARG_H 1
-#define PJ_HAS_STDDEF_H 1
-#define PJ_HAS_STDINT_H 1
-#define PJ_HAS_STDIO_H 1
-#define PJ_HAS_STDLIB_H 1
-#define PJ_HAS_STRING_H 1
-#define PJ_HAS_SYS_IOCTL_H 1
-#define PJ_HAS_SYS_SELECT_H 1
-#define PJ_HAS_SYS_SOCKET_H 1
-#define PJ_HAS_SYS_TIMEB_H 1
-#define PJ_HAS_SYS_TIME_H 1
-#define PJ_HAS_SYS_TYPES_H 1
-#define PJ_HAS_TIME_H 1
-#define PJ_HAS_UNISTD_H 1
-#define PJ_LINUX 1
-#define PJ_M_NAME "x86_64"
-#define PJ_NATIVE_STRING_IS_UNICODE 0
-#define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-#define PJ_POOL_ALIGNMENT 8
-#define PJ_SELECT_NEEDS_NFDS 0
-#define PJ_SOCK_HAS_GETADDRINFO 1
-#define PJ_SOCK_HAS_INET_ATON 1
-#define PJ_SOCK_HAS_INET_NTOP 1
-#define PJ_SOCK_HAS_INET_PTON 1
-#define PJ_THREAD_ALLOCATE_STACK 0
-#define PJ_THREAD_SET_STACK_SIZE 0
-#define STDC_HEADERS 1
-#endif
-#ifdef __cplusplus
-extern "C" void exit (int) throw ();
-
-aconfigure: exit 0
diff --git a/sflphone-common/libs/pjproject-1.0.2/config.status b/sflphone-common/libs/pjproject-1.0.2/config.status
deleted file mode 100755
index 2c61c60623246bb10326e73dc4512833636b35aa..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/config.status
+++ /dev/null
@@ -1,1075 +0,0 @@
-#! /bin/bash
-# Generated by aconfigure.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=${CONFIG_SHELL-/bin/bash}
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
-  fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by pjproject $as_me 1.0, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-config_files=" build.mak build/os-auto.mak pjlib/build/os-auto.mak pjlib-util/build/os-auto.mak pjmedia/build/os-auto.mak pjsip/build/os-auto.mak third_party/build/portaudio/os-auto.mak third_party/build/os-auto.mak"
-config_headers=" pjlib/include/pj/compat/os_auto.h pjlib/include/pj/compat/m_auto.h pjmedia/include/pjmedia/config_auto.h pjmedia/include/pjmedia-codec/config_auto.h pjsip/include/pjsip/sip_autoconf.h"
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
-  -q, --quiet      do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-		   instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
-		   instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Report bugs to <bug-autoconf@gnu.org>."
-ac_cs_version="\
-pjproject config.status 1.0
-configured by ./aconfigure, generated by GNU Autoconf 2.59,
-  with options \"\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=.
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  -*)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
-    ac_need_defaults=false;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; } ;;
-
-  *) ac_config_targets="$ac_config_targets $1" ;;
-
-  esac
-  shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-if $ac_cs_recheck; then
-  echo "running /bin/bash ./aconfigure "  $ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec /bin/bash ./aconfigure  $ac_configure_extra_args --no-create --no-recursion
-fi
-
-for ac_config_target in $ac_config_targets
-do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "build.mak" ) CONFIG_FILES="$CONFIG_FILES build.mak" ;;
-  "build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES build/os-auto.mak" ;;
-  "pjlib/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES pjlib/build/os-auto.mak" ;;
-  "pjlib-util/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES pjlib-util/build/os-auto.mak" ;;
-  "pjmedia/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES pjmedia/build/os-auto.mak" ;;
-  "pjsip/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES pjsip/build/os-auto.mak" ;;
-  "third_party/build/portaudio/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES third_party/build/portaudio/os-auto.mak" ;;
-  "third_party/build/os-auto.mak" ) CONFIG_FILES="$CONFIG_FILES third_party/build/os-auto.mak" ;;
-  "pjlib/include/pj/compat/os_auto.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjlib/include/pj/compat/os_auto.h" ;;
-  "pjlib/include/pj/compat/m_auto.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjlib/include/pj/compat/m_auto.h" ;;
-  "pjmedia/include/pjmedia/config_auto.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjmedia/include/pjmedia/config_auto.h" ;;
-  "pjmedia/include/pjmedia-codec/config_auto.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjmedia/include/pjmedia-codec/config_auto.h" ;;
-  "pjsip/include/pjsip/sip_autoconf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS pjsip/include/pjsip/sip_autoconf.h" ;;
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-fi
-
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
-{
-   echo "$me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
-
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t$/@;t t/; /@;t t$/s/[\\&,]/\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t$/,;t t/' >$tmp/subs.sed <<\CEOF
-s,@SHELL@,/bin/bash,;t t
-s,@PATH_SEPARATOR@,:,;t t
-s,@PACKAGE_NAME@,pjproject,;t t
-s,@PACKAGE_TARNAME@,pjproject,;t t
-s,@PACKAGE_VERSION@,1.0,;t t
-s,@PACKAGE_STRING@,pjproject 1.0,;t t
-s,@PACKAGE_BUGREPORT@,,;t t
-s,@exec_prefix@,${prefix},;t t
-s,@prefix@,/usr/local,;t t
-s,@program_transform_name@,s,x,x,,;t t
-s,@bindir@,${exec_prefix}/bin,;t t
-s,@sbindir@,${exec_prefix}/sbin,;t t
-s,@libexecdir@,${exec_prefix}/libexec,;t t
-s,@datadir@,${prefix}/share,;t t
-s,@sysconfdir@,${prefix}/etc,;t t
-s,@sharedstatedir@,${prefix}/com,;t t
-s,@localstatedir@,${prefix}/var,;t t
-s,@libdir@,${exec_prefix}/lib,;t t
-s,@includedir@,${prefix}/include,;t t
-s,@oldincludedir@,/usr/include,;t t
-s,@infodir@,${prefix}/info,;t t
-s,@mandir@,${prefix}/man,;t t
-s,@build_alias@,,;t t
-s,@host_alias@,,;t t
-s,@target_alias@,,;t t
-s,@DEFS@,-DHAVE_CONFIG_H,;t t
-s,@ECHO_C@,,;t t
-s,@ECHO_N@,-n,;t t
-s,@ECHO_T@,,;t t
-s,@LIBS@,-lm -luuid -lnsl -lrt -lpthread  -lasound,;t t
-s,@build@,x86_64-unknown-linux-gnu,;t t
-s,@build_cpu@,x86_64,;t t
-s,@build_vendor@,unknown,;t t
-s,@build_os@,linux-gnu,;t t
-s,@host@,x86_64-unknown-linux-gnu,;t t
-s,@host_cpu@,x86_64,;t t
-s,@host_vendor@,unknown,;t t
-s,@host_os@,linux-gnu,;t t
-s,@target@,x86_64-unknown-linux-gnu,;t t
-s,@target_cpu@,x86_64,;t t
-s,@target_vendor@,unknown,;t t
-s,@target_os@,linux-gnu,;t t
-s,@CC@,gcc,;t t
-s,@CFLAGS@,-O2,;t t
-s,@LDFLAGS@,,;t t
-s,@CPPFLAGS@,,;t t
-s,@ac_ct_CC@,gcc,;t t
-s,@EXEEXT@,,;t t
-s,@OBJEXT@,o,;t t
-s,@CXX@,g++,;t t
-s,@CXXFLAGS@,-O2 ,;t t
-s,@ac_ct_CXX@,g++,;t t
-s,@ac_pjdir@,/home/emilou/git-repos/sflphone/sflphone-common/libs/pjproject-1.0.2,;t t
-s,@ac_build_mak_vars@,,;t t
-s,@CPP@,gcc -E,;t t
-s,@EGREP@,grep -E,;t t
-s,@ac_os_objs@,ioqueue_select.o file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_uuid.o,;t t
-s,@ac_pjmedia_snd@,pa_unix,;t t
-s,@ac_pa_cflags@, -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN,;t t
-s,@ac_pa_use_alsa@,1,;t t
-s,@ac_pa_use_oss@,1,;t t
-s,@ac_no_small_filter@,,;t t
-s,@ac_no_large_filter@,,;t t
-s,@ac_no_speex_aec@,,;t t
-s,@ac_no_g711_codec@,,;t t
-s,@ac_no_l16_codec@,,;t t
-s,@ac_no_gsm_codec@,,;t t
-s,@ac_no_g722_codec@,,;t t
-s,@ac_no_speex_codec@,,;t t
-s,@ac_no_ilbc_codec@,,;t t
-s,@ac_no_ssl@,,;t t
-s,@openssl_h_present@,,;t t
-s,@libssl_present@,,;t t
-s,@libcrypto_present@,,;t t
-s,@ac_cross_compile@,,;t t
-s,@ac_linux_poll@,select,;t t
-s,@ac_host@,unix,;t t
-s,@ac_main_obj@,main.o,;t t
-s,@LIBOBJS@,,;t t
-s,@LTLIBOBJS@,,;t t
-CEOF
-
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
-  fi
-fi # test -n "$CONFIG_FILES"
-
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-				     sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  sed "/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[	 ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[	 ]*$//;
-}
-
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
-ac_dB='[	 ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 # Do quote $f, to prevent DOS paths from being IFS'd.
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
-
-  # Handle all the #define templates only if necessary.
-  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then
-  # If there are no defines, we may have an empty if/fi
-  :
-  cat >$tmp/defines.sed <<CEOF
-/^[	 ]*#[	 ]*define/!b
-t clr
-: clr
-${ac_dA}PACKAGE_NAME${ac_dB}PACKAGE_NAME${ac_dC}"pjproject"${ac_dD}
-${ac_dA}PACKAGE_TARNAME${ac_dB}PACKAGE_TARNAME${ac_dC}"pjproject"${ac_dD}
-${ac_dA}PACKAGE_VERSION${ac_dB}PACKAGE_VERSION${ac_dC}"1.0"${ac_dD}
-${ac_dA}PACKAGE_STRING${ac_dB}PACKAGE_STRING${ac_dC}"pjproject 1.0"${ac_dD}
-${ac_dA}PACKAGE_BUGREPORT${ac_dB}PACKAGE_BUGREPORT${ac_dC}""${ac_dD}
-${ac_dA}HAVE_LIBPTHREAD${ac_dB}HAVE_LIBPTHREAD${ac_dC}1${ac_dD}
-${ac_dA}HAVE_LIBRT${ac_dB}HAVE_LIBRT${ac_dC}1${ac_dD}
-${ac_dA}HAVE_LIBNSL${ac_dB}HAVE_LIBNSL${ac_dC}1${ac_dD}
-${ac_dA}HAVE_LIBUUID${ac_dB}HAVE_LIBUUID${ac_dC}1${ac_dD}
-${ac_dA}PJ_M_NAME${ac_dB}PJ_M_NAME${ac_dC}"x86_64"${ac_dD}
-${ac_dA}PJ_POOL_ALIGNMENT${ac_dB}PJ_POOL_ALIGNMENT${ac_dC}8${ac_dD}
-${ac_dA}PJ_LINUX${ac_dB}PJ_LINUX${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_FLOATING_POINT${ac_dB}PJ_HAS_FLOATING_POINT${ac_dC}1${ac_dD}
-${ac_dA}HAVE_LIBM${ac_dB}HAVE_LIBM${ac_dC}1${ac_dD}
-${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD}
-${ac_dA}HAVE_SYS_TYPES_H${ac_dB}HAVE_SYS_TYPES_H${ac_dC}1${ac_dD}
-${ac_dA}HAVE_SYS_STAT_H${ac_dB}HAVE_SYS_STAT_H${ac_dC}1${ac_dD}
-${ac_dA}HAVE_STDLIB_H${ac_dB}HAVE_STDLIB_H${ac_dC}1${ac_dD}
-${ac_dA}HAVE_STRING_H${ac_dB}HAVE_STRING_H${ac_dC}1${ac_dD}
-${ac_dA}HAVE_MEMORY_H${ac_dB}HAVE_MEMORY_H${ac_dC}1${ac_dD}
-${ac_dA}HAVE_STRINGS_H${ac_dB}HAVE_STRINGS_H${ac_dC}1${ac_dD}
-${ac_dA}HAVE_INTTYPES_H${ac_dB}HAVE_INTTYPES_H${ac_dC}1${ac_dD}
-${ac_dA}HAVE_STDINT_H${ac_dB}HAVE_STDINT_H${ac_dC}1${ac_dD}
-${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_ARPA_INET_H${ac_dB}PJ_HAS_ARPA_INET_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_ASSERT_H${ac_dB}PJ_HAS_ASSERT_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_CTYPE_H${ac_dB}PJ_HAS_CTYPE_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_ERRNO_H${ac_dB}PJ_HAS_ERRNO_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_FCNTL_H${ac_dB}PJ_HAS_FCNTL_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_LINUX_SOCKET_H${ac_dB}PJ_HAS_LINUX_SOCKET_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_MALLOC_H${ac_dB}PJ_HAS_MALLOC_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_NETDB_H${ac_dB}PJ_HAS_NETDB_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_NETINET_IN_SYSTM_H${ac_dB}PJ_HAS_NETINET_IN_SYSTM_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_NETINET_IN_H${ac_dB}PJ_HAS_NETINET_IN_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_NETINET_IP_H${ac_dB}PJ_HAS_NETINET_IP_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_IFADDRS_H${ac_dB}PJ_HAS_IFADDRS_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SEMAPHORE_H${ac_dB}PJ_HAS_SEMAPHORE_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SETJMP_H${ac_dB}PJ_HAS_SETJMP_H${ac_dC}1${ac_dD}
-CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-
-  cat >$tmp/defines.sed <<CEOF
-/^[	 ]*#[	 ]*define/!b
-t clr
-: clr
-${ac_dA}PJ_HAS_STDARG_H${ac_dB}PJ_HAS_STDARG_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_STDDEF_H${ac_dB}PJ_HAS_STDDEF_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_STDIO_H${ac_dB}PJ_HAS_STDIO_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_STDINT_H${ac_dB}PJ_HAS_STDINT_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_STDLIB_H${ac_dB}PJ_HAS_STDLIB_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_STRING_H${ac_dB}PJ_HAS_STRING_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SYS_IOCTL_H${ac_dB}PJ_HAS_SYS_IOCTL_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SYS_SELECT_H${ac_dB}PJ_HAS_SYS_SELECT_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SYS_SOCKET_H${ac_dB}PJ_HAS_SYS_SOCKET_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SYS_TIME_H${ac_dB}PJ_HAS_SYS_TIME_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SYS_TIMEB_H${ac_dB}PJ_HAS_SYS_TIMEB_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SYS_TYPES_H${ac_dB}PJ_HAS_SYS_TYPES_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_TIME_H${ac_dB}PJ_HAS_TIME_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_UNISTD_H${ac_dB}PJ_HAS_UNISTD_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_NET_IF_H${ac_dB}PJ_HAS_NET_IF_H${ac_dC}1${ac_dD}
-${ac_dA}PJ_OS_NAME${ac_dB}PJ_OS_NAME${ac_dC}"x86_64-unknown-linux-gnu"${ac_dD}
-${ac_dA}PJ_HAS_ERRNO_VAR${ac_dB}PJ_HAS_ERRNO_VAR${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_HIGH_RES_TIMER${ac_dB}PJ_HAS_HIGH_RES_TIMER${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_MALLOC${ac_dB}PJ_HAS_MALLOC${ac_dC}1${ac_dD}
-${ac_dA}PJ_NATIVE_STRING_IS_UNICODE${ac_dB}PJ_NATIVE_STRING_IS_UNICODE${ac_dC}0${ac_dD}
-${ac_dA}PJ_ATOMIC_VALUE_TYPE${ac_dB}PJ_ATOMIC_VALUE_TYPE${ac_dC}long${ac_dD}
-${ac_dA}PJ_SOCK_HAS_INET_ATON${ac_dB}PJ_SOCK_HAS_INET_ATON${ac_dC}1${ac_dD}
-${ac_dA}PJ_SOCK_HAS_INET_PTON${ac_dB}PJ_SOCK_HAS_INET_PTON${ac_dC}1${ac_dD}
-${ac_dA}PJ_SOCK_HAS_INET_NTOP${ac_dB}PJ_SOCK_HAS_INET_NTOP${ac_dC}1${ac_dD}
-${ac_dA}PJ_SOCK_HAS_GETADDRINFO${ac_dB}PJ_SOCK_HAS_GETADDRINFO${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SOCKLEN_T${ac_dB}PJ_HAS_SOCKLEN_T${ac_dC}1${ac_dD}
-${ac_dA}PJ_HAS_SO_ERROR${ac_dB}PJ_HAS_SO_ERROR${ac_dC}1${ac_dD}
-${ac_dA}PJ_EMULATE_RWMUTEX${ac_dB}PJ_EMULATE_RWMUTEX${ac_dC}0${ac_dD}
-${ac_dA}PJ_SELECT_NEEDS_NFDS${ac_dB}PJ_SELECT_NEEDS_NFDS${ac_dC}0${ac_dD}
-${ac_dA}PJ_THREAD_SET_STACK_SIZE${ac_dB}PJ_THREAD_SET_STACK_SIZE${ac_dC}0${ac_dD}
-${ac_dA}PJ_THREAD_ALLOCATE_STACK${ac_dB}PJ_THREAD_ALLOCATE_STACK${ac_dC}0${ac_dD}
-${ac_dA}PJ_BLOCKING_ERROR_VAL${ac_dB}PJ_BLOCKING_ERROR_VAL${ac_dC}EAGAIN${ac_dD}
-${ac_dA}PJ_BLOCKING_CONNECT_ERROR_VAL${ac_dB}PJ_BLOCKING_CONNECT_ERROR_VAL${ac_dC}EINPROGRESS${ac_dD}
-CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-
-  fi # grep
-
-  # Handle all the #undef templates
-  cat >$tmp/undefs.sed <<CEOF
-/^[	 ]*#[	 ]*undef/!b
-t clr
-: clr
-${ac_uA}PACKAGE_NAME${ac_uB}PACKAGE_NAME${ac_uC}"pjproject"${ac_uD}
-${ac_uA}PACKAGE_TARNAME${ac_uB}PACKAGE_TARNAME${ac_uC}"pjproject"${ac_uD}
-${ac_uA}PACKAGE_VERSION${ac_uB}PACKAGE_VERSION${ac_uC}"1.0"${ac_uD}
-${ac_uA}PACKAGE_STRING${ac_uB}PACKAGE_STRING${ac_uC}"pjproject 1.0"${ac_uD}
-${ac_uA}PACKAGE_BUGREPORT${ac_uB}PACKAGE_BUGREPORT${ac_uC}""${ac_uD}
-${ac_uA}HAVE_LIBPTHREAD${ac_uB}HAVE_LIBPTHREAD${ac_uC}1${ac_uD}
-${ac_uA}HAVE_LIBRT${ac_uB}HAVE_LIBRT${ac_uC}1${ac_uD}
-${ac_uA}HAVE_LIBNSL${ac_uB}HAVE_LIBNSL${ac_uC}1${ac_uD}
-${ac_uA}HAVE_LIBUUID${ac_uB}HAVE_LIBUUID${ac_uC}1${ac_uD}
-${ac_uA}PJ_M_NAME${ac_uB}PJ_M_NAME${ac_uC}"x86_64"${ac_uD}
-${ac_uA}PJ_POOL_ALIGNMENT${ac_uB}PJ_POOL_ALIGNMENT${ac_uC}8${ac_uD}
-${ac_uA}PJ_LINUX${ac_uB}PJ_LINUX${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_FLOATING_POINT${ac_uB}PJ_HAS_FLOATING_POINT${ac_uC}1${ac_uD}
-${ac_uA}HAVE_LIBM${ac_uB}HAVE_LIBM${ac_uC}1${ac_uD}
-${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD}
-${ac_uA}HAVE_SYS_TYPES_H${ac_uB}HAVE_SYS_TYPES_H${ac_uC}1${ac_uD}
-${ac_uA}HAVE_SYS_STAT_H${ac_uB}HAVE_SYS_STAT_H${ac_uC}1${ac_uD}
-${ac_uA}HAVE_STDLIB_H${ac_uB}HAVE_STDLIB_H${ac_uC}1${ac_uD}
-${ac_uA}HAVE_STRING_H${ac_uB}HAVE_STRING_H${ac_uC}1${ac_uD}
-${ac_uA}HAVE_MEMORY_H${ac_uB}HAVE_MEMORY_H${ac_uC}1${ac_uD}
-${ac_uA}HAVE_STRINGS_H${ac_uB}HAVE_STRINGS_H${ac_uC}1${ac_uD}
-${ac_uA}HAVE_INTTYPES_H${ac_uB}HAVE_INTTYPES_H${ac_uC}1${ac_uD}
-${ac_uA}HAVE_STDINT_H${ac_uB}HAVE_STDINT_H${ac_uC}1${ac_uD}
-${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_ARPA_INET_H${ac_uB}PJ_HAS_ARPA_INET_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_ASSERT_H${ac_uB}PJ_HAS_ASSERT_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_CTYPE_H${ac_uB}PJ_HAS_CTYPE_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_ERRNO_H${ac_uB}PJ_HAS_ERRNO_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_FCNTL_H${ac_uB}PJ_HAS_FCNTL_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_LINUX_SOCKET_H${ac_uB}PJ_HAS_LINUX_SOCKET_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_MALLOC_H${ac_uB}PJ_HAS_MALLOC_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_NETDB_H${ac_uB}PJ_HAS_NETDB_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_NETINET_IN_SYSTM_H${ac_uB}PJ_HAS_NETINET_IN_SYSTM_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_NETINET_IN_H${ac_uB}PJ_HAS_NETINET_IN_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_NETINET_IP_H${ac_uB}PJ_HAS_NETINET_IP_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_IFADDRS_H${ac_uB}PJ_HAS_IFADDRS_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SEMAPHORE_H${ac_uB}PJ_HAS_SEMAPHORE_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SETJMP_H${ac_uB}PJ_HAS_SETJMP_H${ac_uC}1${ac_uD}
-CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-
-  cat >$tmp/undefs.sed <<CEOF
-/^[	 ]*#[	 ]*undef/!b
-t clr
-: clr
-${ac_uA}PJ_HAS_STDARG_H${ac_uB}PJ_HAS_STDARG_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_STDDEF_H${ac_uB}PJ_HAS_STDDEF_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_STDIO_H${ac_uB}PJ_HAS_STDIO_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_STDINT_H${ac_uB}PJ_HAS_STDINT_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_STDLIB_H${ac_uB}PJ_HAS_STDLIB_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_STRING_H${ac_uB}PJ_HAS_STRING_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SYS_IOCTL_H${ac_uB}PJ_HAS_SYS_IOCTL_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SYS_SELECT_H${ac_uB}PJ_HAS_SYS_SELECT_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SYS_SOCKET_H${ac_uB}PJ_HAS_SYS_SOCKET_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SYS_TIME_H${ac_uB}PJ_HAS_SYS_TIME_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SYS_TIMEB_H${ac_uB}PJ_HAS_SYS_TIMEB_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SYS_TYPES_H${ac_uB}PJ_HAS_SYS_TYPES_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_TIME_H${ac_uB}PJ_HAS_TIME_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_UNISTD_H${ac_uB}PJ_HAS_UNISTD_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_NET_IF_H${ac_uB}PJ_HAS_NET_IF_H${ac_uC}1${ac_uD}
-${ac_uA}PJ_OS_NAME${ac_uB}PJ_OS_NAME${ac_uC}"x86_64-unknown-linux-gnu"${ac_uD}
-${ac_uA}PJ_HAS_ERRNO_VAR${ac_uB}PJ_HAS_ERRNO_VAR${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_HIGH_RES_TIMER${ac_uB}PJ_HAS_HIGH_RES_TIMER${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_MALLOC${ac_uB}PJ_HAS_MALLOC${ac_uC}1${ac_uD}
-${ac_uA}PJ_NATIVE_STRING_IS_UNICODE${ac_uB}PJ_NATIVE_STRING_IS_UNICODE${ac_uC}0${ac_uD}
-${ac_uA}PJ_ATOMIC_VALUE_TYPE${ac_uB}PJ_ATOMIC_VALUE_TYPE${ac_uC}long${ac_uD}
-${ac_uA}PJ_SOCK_HAS_INET_ATON${ac_uB}PJ_SOCK_HAS_INET_ATON${ac_uC}1${ac_uD}
-${ac_uA}PJ_SOCK_HAS_INET_PTON${ac_uB}PJ_SOCK_HAS_INET_PTON${ac_uC}1${ac_uD}
-${ac_uA}PJ_SOCK_HAS_INET_NTOP${ac_uB}PJ_SOCK_HAS_INET_NTOP${ac_uC}1${ac_uD}
-${ac_uA}PJ_SOCK_HAS_GETADDRINFO${ac_uB}PJ_SOCK_HAS_GETADDRINFO${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SOCKLEN_T${ac_uB}PJ_HAS_SOCKLEN_T${ac_uC}1${ac_uD}
-${ac_uA}PJ_HAS_SO_ERROR${ac_uB}PJ_HAS_SO_ERROR${ac_uC}1${ac_uD}
-${ac_uA}PJ_EMULATE_RWMUTEX${ac_uB}PJ_EMULATE_RWMUTEX${ac_uC}0${ac_uD}
-${ac_uA}PJ_SELECT_NEEDS_NFDS${ac_uB}PJ_SELECT_NEEDS_NFDS${ac_uC}0${ac_uD}
-${ac_uA}PJ_THREAD_SET_STACK_SIZE${ac_uB}PJ_THREAD_SET_STACK_SIZE${ac_uC}0${ac_uD}
-${ac_uA}PJ_THREAD_ALLOCATE_STACK${ac_uB}PJ_THREAD_ALLOCATE_STACK${ac_uC}0${ac_uD}
-${ac_uA}PJ_BLOCKING_ERROR_VAL${ac_uB}PJ_BLOCKING_ERROR_VAL${ac_uC}EAGAIN${ac_uD}
-${ac_uA}PJ_BLOCKING_CONNECT_ERROR_VAL${ac_uB}PJ_BLOCKING_CONNECT_ERROR_VAL${ac_uC}EINPROGRESS${ac_uD}
-s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
-  if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
-      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
-    else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-      rm -f $ac_file
-      mv $tmp/config.h $ac_file
-    fi
-  else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
-  fi
-done
-
-{ (exit 0); exit 0; }
diff --git a/sflphone-common/libs/pjproject-1.0.2/configure.ac b/sflphone-common/libs/pjproject-1.0.2/configure.ac
deleted file mode 100644
index bf1644033a4f5cb86b7e9dc8e49804bfa092ee58..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/configure.ac
+++ /dev/null
@@ -1,5 +0,0 @@
-dnl Dummy configure.ac for autotools
-
-AC_INIT
-LT_INIT
-AC_OUTPUT
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/bin/pjlib-util-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/bin/pjlib-util-test-x86_64-unknown-linux-gnu
deleted file mode 100755
index d29a2047c0c9e32e4549e062089937381641a02b..0000000000000000000000000000000000000000
Binary files a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/bin/pjlib-util-test-x86_64-unknown-linux-gnu and /dev/null differ
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-auto.mak
deleted file mode 100644
index fe7975b64497ac781be78cb52d8fcbd9cb2a9842..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-auto.mak
+++ /dev/null
@@ -1,3 +0,0 @@
-# pjlib-util/build/os-auto.mak.  Generated from os-auto.mak.in by configure.
-export UTIL_TEST_OBJS = main.o
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/bin/pjlib-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjlib/bin/pjlib-test-x86_64-unknown-linux-gnu
deleted file mode 100755
index c6ed11cacf80b33d2f1413c74947812304dcb047..0000000000000000000000000000000000000000
Binary files a/sflphone-common/libs/pjproject-1.0.2/pjlib/bin/pjlib-test-x86_64-unknown-linux-gnu and /dev/null differ
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak
deleted file mode 100644
index 126fe0993bef586c6b993db41f27a391b0682806..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak
+++ /dev/null
@@ -1,35 +0,0 @@
-# pjlib/build/os-auto.mak.  Generated from os-auto.mak.in by configure.
-
-# Determine OS specific files
-AC_OS_OBJS=ioqueue_select.o file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_uuid.o
-
-#
-# PJLIB_OBJS specified here are object files to be included in PJLIB
-# (the library) for this specific operating system. Object files common 
-# to all operating systems should go in Makefile instead.
-#
-export PJLIB_OBJS +=	$(AC_OS_OBJS) \
-			addr_resolv_sock.o \
-			log_writer_stdout.o \
-			os_timestamp_common.o \
-			pool_policy_malloc.o sock_bsd.o sock_select.o
-
-#
-# TEST_OBJS are operating system specific object files to be included in
-# the test application.
-#
-export TEST_OBJS +=	main.o
-
-#
-# Additional LDFLAGS for pjlib-test
-#
-export TEST_LDFLAGS +=  -lm -luuid -lnsl -lrt -lpthread  -lasound
-
-#
-# TARGETS are make targets in the Makefile, to be executed for this given
-# operating system.
-#
-export TARGETS	    =	pjlib pjlib-test
-
-
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h
deleted file mode 100644
index bbdce3ca67bafb8bef5e8186d18d37259be66260..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* pjlib/include/pj/compat/m_auto.h.  Generated by configure.  */
-/* $Id: m_auto.h.in 2528 2009-03-23 12:09:19Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __PJ_COMPAT_M_AUTO_H__
-#define __PJ_COMPAT_M_AUTO_H__
-
-/**
- * @file m_auto.h
- * @brief Automatically generated process definition file.
- */
-
-/* Machine name, filled in by autoconf script */
-#define PJ_M_NAME "x86_64"
-
-/* Endianness. It's reported on pjsip list on 09/02/13 that autoconf
- * endianness detection failed for universal build, so special case
- * for it here. Thanks Ruud Klaver for the fix.
- */
-#ifdef PJ_DARWINOS
-#  ifdef __BIG_ENDIAN__
-#    define WORDS_BIGENDIAN	1
-#  endif
-#else
-    /* Endianness, as detected by autoconf */
-/* #  undef WORDS_BIGENDIAN */
-#endif
-
-#ifdef WORDS_BIGENDIAN
-#  define PJ_IS_LITTLE_ENDIAN	0
-#  define PJ_IS_BIG_ENDIAN	1
-#else
-#  define PJ_IS_LITTLE_ENDIAN	1
-#  define PJ_IS_BIG_ENDIAN	0
-#endif
-
-
-/* Specify if floating point is present/desired */
-#define PJ_HAS_FLOATING_POINT 1
-
-/* Deprecated */
-#define PJ_HAS_PENTIUM		0
-
-#endif	/* __PJ_COMPAT_M_AUTO_H__ */
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_auto.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_auto.h
deleted file mode 100644
index 1d69febf20ff5dcf5a84f30e1320d1141f721c0f..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_auto.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/* pjlib/include/pj/compat/os_auto.h.  Generated by configure.  */
-/* $Id: os_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __PJ_COMPAT_OS_AUTO_H__
-#define __PJ_COMPAT_OS_AUTO_H__
-
-/**
- * @file os_auto.h
- * @brief Describes operating system specifics (automatically detected by
- *        autoconf)
- */
-
-/* Canonical OS name */
-#define PJ_OS_NAME "x86_64-unknown-linux-gnu"
-
-/* Legacy macros */
-/* #undef PJ_WIN32 */
-/* #undef PJ_WIN32_WINNT */
-/* #undef WIN32_LEAN_AND_MEAN */
-/* #undef PJ_DARWINOS */
-#define PJ_LINUX 1
-/* #undef PJ_RTEMS */
-/* #undef PJ_SUNOS */
-
-#if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
-#  define _WIN32_WINNT	PJ_WIN32_WINNT
-#endif
-
-/* Headers availability */
-#define PJ_HAS_ARPA_INET_H 1
-#define PJ_HAS_ASSERT_H 1
-#define PJ_HAS_CTYPE_H 1
-#define PJ_HAS_ERRNO_H 1
-#define PJ_HAS_FCNTL_H 1
-#define PJ_HAS_LINUX_SOCKET_H 1
-#define PJ_HAS_MALLOC_H 1
-#define PJ_HAS_NETDB_H 1
-#define PJ_HAS_NETINET_IN_SYSTM_H 1
-#define PJ_HAS_NETINET_IN_H 1
-#define PJ_HAS_NETINET_IP_H 1
-#define PJ_HAS_NET_IF_H 1
-#define PJ_HAS_IFADDRS_H 1
-#define PJ_HAS_SEMAPHORE_H 1
-#define PJ_HAS_SETJMP_H 1
-#define PJ_HAS_STDARG_H 1
-#define PJ_HAS_STDDEF_H 1
-#define PJ_HAS_STDIO_H 1
-#define PJ_HAS_STDINT_H 1
-#define PJ_HAS_STDLIB_H 1
-#define PJ_HAS_STRING_H 1
-#define PJ_HAS_SYS_IOCTL_H 1
-#define PJ_HAS_SYS_SELECT_H 1
-#define PJ_HAS_SYS_SOCKET_H 1
-#define PJ_HAS_SYS_TIME_H 1
-#define PJ_HAS_SYS_TIMEB_H 1
-#define PJ_HAS_SYS_TYPES_H 1
-#define PJ_HAS_TIME_H 1
-#define PJ_HAS_UNISTD_H 1
-
-/* #undef PJ_HAS_MSWSOCK_H */
-/* #undef PJ_HAS_WINSOCK_H */
-/* #undef PJ_HAS_WINSOCK2_H */
-/* #undef PJ_HAS_WS2TCPIP_H */
-
-#define PJ_SOCK_HAS_INET_ATON 1
-#define PJ_SOCK_HAS_INET_PTON 1
-#define PJ_SOCK_HAS_INET_NTOP 1
-#define PJ_SOCK_HAS_GETADDRINFO 1
-
-/* On these OSes, semaphore feature depends on semaphore.h */
-#if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
-#   define PJ_HAS_SEMAPHORE	1
-#elif defined(PJ_WIN32) && PJ_WIN32!=0
-#   define PJ_HAS_SEMAPHORE	1
-#else
-#   define PJ_HAS_SEMAPHORE	0
-#endif
-
-/* Do we have pthread_mutexattr_settype()? */
-/* #undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE */
-
-/* Does pthread_mutexattr_t has "recursive" member?  */
-/* #undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE */
-
-/* Set 1 if native sockaddr_in has sin_len member.
- * Default: 0
- */
-/* #undef PJ_SOCKADDR_HAS_LEN */
-
-/* Does the OS have socklen_t? */
-#define PJ_HAS_SOCKLEN_T 1
-
-#if !defined(socklen_t) && (!defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0)
-# define PJ_HAS_SOCKLEN_T 1
-  typedef int socklen_t;
-#endif
-
-/**
- * If this macro is set, it tells select I/O Queue that select() needs to
- * be given correct value of nfds (i.e. largest fd + 1). This requires
- * select ioqueue to re-scan the descriptors on each registration and
- * unregistration.
- * If this macro is not set, then ioqueue will always give FD_SETSIZE for
- * nfds argument when calling select().
- *
- * Default: 0
- */
-#define PJ_SELECT_NEEDS_NFDS 0
-
-/* Is errno a good way to retrieve OS errors?
- */
-#define PJ_HAS_ERRNO_VAR 1
-
-/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
- * the status of non-blocking connect() operation.
- */
-#define PJ_HAS_SO_ERROR 1
-
-/* This value specifies the value set in errno by the OS when a non-blocking
- * socket recv() can not return immediate daata.
- */
-#define PJ_BLOCKING_ERROR_VAL EAGAIN
-
-/* This value specifies the value set in errno by the OS when a non-blocking
- * socket connect() can not get connected immediately.
- */
-#define PJ_BLOCKING_CONNECT_ERROR_VAL EINPROGRESS
-
-/* Default threading is enabled, unless it's overridden. */
-#ifndef PJ_HAS_THREADS
-#  define PJ_HAS_THREADS	    (1)
-#endif
-
-/* Do we need high resolution timer? */
-#define PJ_HAS_HIGH_RES_TIMER 1
-
-/* Is malloc() available? */
-#define PJ_HAS_MALLOC 1
-
-#ifndef PJ_OS_HAS_CHECK_STACK
-#   define PJ_OS_HAS_CHECK_STACK    0
-#endif
-
-/* Unicode? */
-#define PJ_NATIVE_STRING_IS_UNICODE 0
-
-/* Pool alignment in bytes */
-#define PJ_POOL_ALIGNMENT 8
-
-/* The type of atomic variable value: */
-#define PJ_ATOMIC_VALUE_TYPE long
-
-/* If 1, use Read/Write mutex emulation for platforms that don't support it */
-#define PJ_EMULATE_RWMUTEX 0
-
-/* If 1, pj_thread_create() should enforce the stack size when creating
- * threads.
- * Default: 0 (let OS decide the thread's stack size).
- */
-#define PJ_THREAD_SET_STACK_SIZE 0
-
-/* If 1, pj_thread_create() should allocate stack from the pool supplied.
- * Default: 0 (let OS allocate memory for thread's stack).
- */
-#define PJ_THREAD_ALLOCATE_STACK 0
-
-#endif	/* __PJ_COMPAT_OS_AUTO_H__ */
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config_site.h b/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config_site.h
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_symbian.cpp
deleted file mode 100644
index 05e2312d14e955fe5fd6fb6d9692717b2ac0a9db..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_symbian.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/* $Id: addr_resolv_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pj/addr_resolv.h>
-#include <pj/assert.h>
-#include <pj/errno.h>
-#include <pj/ip_helper.h>
-#include <pj/log.h>
-#include <pj/sock.h>
-#include <pj/string.h>
-#include <pj/unicode.h>
-
-#include "os_symbian.h"
-
-#define THIS_FILE 	"addr_resolv_symbian.cpp"
-#define TRACE_ME	0
-
-
-// PJLIB API: resolve hostname
-PJ_DEF (pj_status_t) pj_gethostbyname (const pj_str_t *name, pj_hostent *he)
-{
-    static pj_addrinfo ai;
-    static char *aliases[2];
-    static char *addrlist[2];
-    unsigned count = 1;
-    pj_status_t status;
-
-    status = pj_getaddrinfo (PJ_AF_INET, name, &count, &ai);
-
-    if (status != PJ_SUCCESS)
-        return status;
-
-    aliases[0] = ai.ai_canonname;
-
-    aliases[1] = NULL;
-
-    addrlist[0] = (char*) &ai.ai_addr.ipv4.sin_addr;
-
-    addrlist[1] = NULL;
-
-    pj_bzero (he, sizeof (*he));
-
-    he->h_name = aliases[0];
-
-    he->h_aliases = aliases;
-
-    he->h_addrtype = PJ_AF_INET;
-
-    he->h_length = 4;
-
-    he->h_addr_list = addrlist;
-
-    return PJ_SUCCESS;
-}
-
-
-// Resolve for specific address family
-static pj_status_t getaddrinfo_by_af (int af, const pj_str_t *name,
-                                      unsigned *count, pj_addrinfo ai[])
-{
-    unsigned i;
-    pj_status_t status;
-
-    PJ_ASSERT_RETURN (name && count && ai, PJ_EINVAL);
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    // Get resolver for the specified address family
-    RHostResolver &resv = PjSymbianOS::Instance()->GetResolver (af);
-
-    // Convert name to Unicode
-    wchar_t name16[PJ_MAX_HOSTNAME];
-    pj_ansi_to_unicode (name->ptr, name->slen, name16, PJ_ARRAY_SIZE (name16));
-    TPtrC16 data ( (const TUint16*) name16);
-
-    // Resolve!
-    TNameEntry nameEntry;
-    TRequestStatus reqStatus;
-
-    resv.GetByName (data, nameEntry, reqStatus);
-    User::WaitForRequest (reqStatus);
-
-    // Iterate each result
-    i = 0;
-
-    while (reqStatus == KErrNone && i < *count) {
-
-        // Get the resolved TInetAddr
-        TInetAddr inetAddr (nameEntry().iAddr);
-        int addrlen;
-
-#if TRACE_ME
-
-        if (1) {
-            pj_sockaddr a;
-            char ipaddr[PJ_INET6_ADDRSTRLEN+2];
-            int namelen;
-
-            namelen = sizeof (pj_sockaddr);
-
-            if (PjSymbianOS::Addr2pj (inetAddr, a, &namelen,
-                                      PJ_FALSE) == PJ_SUCCESS) {
-                PJ_LOG (5, (THIS_FILE, "resolve %.*s: %s",
-                            (int) name->slen, name->ptr,
-                            pj_sockaddr_print (&a, ipaddr, sizeof (ipaddr), 2)));
-            }
-        }
-
-#endif
-
-        // Ignore if this is not the same address family
-        // Not a good idea, as Symbian mapps IPv4 to IPv6.
-        //fam = inetAddr.Family();
-        //if (fam != af) {
-        //    resv.Next(nameEntry, reqStatus);
-        //    User::WaitForRequest(reqStatus);
-        //    continue;
-        //}
-
-        // Convert IP address first to get IPv4 mapped address
-        addrlen = sizeof (ai[i].ai_addr);
-
-        status = PjSymbianOS::Addr2pj (inetAddr, ai[i].ai_addr,
-                                       &addrlen, PJ_TRUE);
-
-        if (status != PJ_SUCCESS)
-            return status;
-
-        // Ignore if address family doesn't match
-        if (ai[i].ai_addr.addr.sa_family != af) {
-            resv.Next (nameEntry, reqStatus);
-            User::WaitForRequest (reqStatus);
-            continue;
-        }
-
-        // Convert the official address to ANSI.
-        pj_unicode_to_ansi ( (const wchar_t*) nameEntry().iName.Ptr(),
-                             nameEntry().iName.Length(),
-                             ai[i].ai_canonname, sizeof (ai[i].ai_canonname));
-
-        // Next
-        ++i;
-
-        resv.Next (nameEntry, reqStatus);
-
-        User::WaitForRequest (reqStatus);
-    }
-
-    *count = i;
-
-    return PJ_SUCCESS;
-}
-
-/* Resolve IPv4/IPv6 address */
-PJ_DEF (pj_status_t) pj_getaddrinfo (int af, const pj_str_t *nodename,
-                                     unsigned *count, pj_addrinfo ai[])
-{
-    unsigned start;
-    pj_status_t status;
-
-    PJ_ASSERT_RETURN (af==PJ_AF_INET || af==PJ_AF_INET6 || af==PJ_AF_UNSPEC,
-                      PJ_EAFNOTSUP);
-    PJ_ASSERT_RETURN (nodename && count && *count && ai, PJ_EINVAL);
-
-    start = 0;
-
-    if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) {
-        unsigned max = *count;
-        status = getaddrinfo_by_af (PJ_AF_INET6, nodename,
-                                    &max, &ai[start]);
-
-        if (status == PJ_SUCCESS) {
-            (*count) -= max;
-            start += max;
-        }
-    }
-
-    if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) {
-        unsigned max = *count;
-        status = getaddrinfo_by_af (PJ_AF_INET, nodename,
-                                    &max, &ai[start]);
-
-        if (status == PJ_SUCCESS) {
-            (*count) -= max;
-            start += max;
-        }
-    }
-
-    *count = start;
-
-    if (*count) {
-        return PJ_SUCCESS;
-    } else {
-        return status!=PJ_SUCCESS ? status : PJ_ENOTFOUND;
-    }
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_symbian.cpp
deleted file mode 100644
index ceb23e258d9f2dd286ea5fcc918fddedd838c06c..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_symbian.cpp
+++ /dev/null
@@ -1,861 +0,0 @@
-/* $Id: ioqueue_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pj/ioqueue.h>
-#include <pj/assert.h>
-#include <pj/errno.h>
-#include <pj/list.h>
-#include <pj/lock.h>
-#include <pj/pool.h>
-#include <pj/string.h>
-
-#include "os_symbian.h"
-
-class CIoqueueCallback;
-
-/*
- * IO Queue structure.
- */
-
-struct pj_ioqueue_t {
-    int		     eventCount;
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Class to encapsulate asynchronous socket operation.
-//
-
-class CIoqueueCallback : public CActive
-{
-
-    public:
-        static CIoqueueCallback* NewL (pj_ioqueue_t *ioqueue,
-                                       pj_ioqueue_key_t *key,
-                                       pj_sock_t sock,
-                                       const pj_ioqueue_callback *cb,
-                                       void *user_data);
-
-        //
-        // Start asynchronous recv() operation
-        //
-        pj_status_t StartRead (pj_ioqueue_op_key_t *op_key,
-                               void *buf, pj_ssize_t *size, unsigned flags,
-                               pj_sockaddr_t *addr, int *addrlen);
-
-        //
-        // Start asynchronous accept() operation.
-        //
-        pj_status_t StartAccept (pj_ioqueue_op_key_t *op_key,
-                                 pj_sock_t *new_sock,
-                                 pj_sockaddr_t *local,
-                                 pj_sockaddr_t *remote,
-                                 int *addrlen);
-
-        //
-        // Completion callback.
-        //
-        void RunL();
-
-        //
-        // CActive's DoCancel()
-        //
-        void DoCancel();
-
-        //
-        // Cancel operation and call callback.
-        //
-        void CancelOperation (pj_ioqueue_op_key_t *op_key,
-                              pj_ssize_t bytes_status);
-
-        //
-        // Accessors
-        //
-        void* get_user_data() const {
-            return user_data_;
-        }
-
-        void set_user_data (void *user_data) {
-            user_data_ = user_data;
-        }
-
-        pj_ioqueue_op_key_t *get_op_key() const {
-            return pending_data_.common_.op_key_;
-        }
-
-        CPjSocket* get_pj_socket() {
-            return sock_;
-        }
-
-    private:
-        // Type of pending operation.
-        enum Type {
-            TYPE_NONE,
-            TYPE_READ,
-            TYPE_ACCEPT,
-        };
-
-        // Static data.
-        pj_ioqueue_t		*ioqueue_;
-        pj_ioqueue_key_t		*key_;
-        CPjSocket			*sock_;
-        pj_ioqueue_callback		 cb_;
-        void			*user_data_;
-
-        // Symbian data.
-        TPtr8			 aBufferPtr_;
-        TInetAddr			 aAddress_;
-
-        // Application data.
-        Type			 type_;
-
-        union Pending_Data {
-
-            struct Common {
-                pj_ioqueue_op_key_t	*op_key_;
-            } common_;
-
-            struct Pending_Read {
-                pj_ioqueue_op_key_t	*op_key_;
-                pj_sockaddr_t	*addr_;
-                int			*addrlen_;
-            } read_;
-
-            struct Pending_Accept {
-                pj_ioqueue_op_key_t *op_key_;
-                pj_sock_t		*new_sock_;
-                pj_sockaddr_t	*local_;
-                pj_sockaddr_t	*remote_;
-                int			*addrlen_;
-            } accept_;
-        };
-
-        union Pending_Data		 pending_data_;
-        RSocket			blank_sock_;
-
-        CIoqueueCallback (pj_ioqueue_t *ioqueue,
-                          pj_ioqueue_key_t *key, pj_sock_t sock,
-                          const pj_ioqueue_callback *cb, void *user_data)
-                : CActive (CActive::EPriorityStandard),
-                ioqueue_ (ioqueue), key_ (key), sock_ ( (CPjSocket*) sock),
-                user_data_ (user_data), aBufferPtr_ (NULL, 0), type_ (TYPE_NONE) {
-            pj_memcpy (&cb_, cb, sizeof (*cb));
-        }
-
-
-        void ConstructL() {
-            CActiveScheduler::Add (this);
-        }
-
-        void HandleReadCompletion();
-        CPjSocket *HandleAcceptCompletion();
-};
-
-
-CIoqueueCallback* CIoqueueCallback::NewL (pj_ioqueue_t *ioqueue,
-        pj_ioqueue_key_t *key,
-        pj_sock_t sock,
-        const pj_ioqueue_callback *cb,
-        void *user_data)
-{
-    CIoqueueCallback *self = new CIoqueueCallback (ioqueue, key, sock,
-            cb, user_data);
-    CleanupStack::PushL (self);
-    self->ConstructL();
-    CleanupStack::Pop (self);
-
-    return self;
-}
-
-
-//
-// Start asynchronous recv() operation
-//
-pj_status_t CIoqueueCallback::StartRead (pj_ioqueue_op_key_t *op_key,
-        void *buf, pj_ssize_t *size,
-        unsigned flags,
-        pj_sockaddr_t *addr, int *addrlen)
-{
-    PJ_ASSERT_RETURN (IsActive() ==false, PJ_EBUSY);
-    PJ_ASSERT_RETURN (pending_data_.common_.op_key_==NULL, PJ_EBUSY);
-
-    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
-
-    pending_data_.read_.op_key_ = op_key;
-    pending_data_.read_.addr_ = addr;
-    pending_data_.read_.addrlen_ = addrlen;
-
-    aBufferPtr_.Set ( (TUint8*) buf, 0, (TInt) *size);
-
-    type_ = TYPE_READ;
-
-    if (addr && addrlen) {
-        sock_->Socket().RecvFrom (aBufferPtr_, aAddress_, flags, iStatus);
-    } else {
-        aAddress_.SetAddress (0);
-        aAddress_.SetPort (0);
-        sock_->Socket().Recv (aBufferPtr_, flags, iStatus);
-    }
-
-    SetActive();
-
-    return PJ_EPENDING;
-}
-
-
-//
-// Start asynchronous accept() operation.
-//
-pj_status_t CIoqueueCallback::StartAccept (pj_ioqueue_op_key_t *op_key,
-        pj_sock_t *new_sock,
-        pj_sockaddr_t *local,
-        pj_sockaddr_t *remote,
-        int *addrlen)
-{
-    PJ_ASSERT_RETURN (IsActive() ==false, PJ_EBUSY);
-    PJ_ASSERT_RETURN (pending_data_.common_.op_key_==NULL, PJ_EBUSY);
-
-    // addrlen must be specified if local or remote is specified
-    PJ_ASSERT_RETURN ( (!local && !remote) ||
-                       (addrlen && *addrlen), PJ_EINVAL);
-
-    pending_data_.accept_.op_key_ = op_key;
-    pending_data_.accept_.new_sock_ = new_sock;
-    pending_data_.accept_.local_ = local;
-    pending_data_.accept_.remote_ = remote;
-    pending_data_.accept_.addrlen_ = addrlen;
-
-    // Create blank socket
-    blank_sock_.Open (PjSymbianOS::Instance()->SocketServ());
-
-    type_ = TYPE_ACCEPT;
-    sock_->Socket().Accept (blank_sock_, iStatus);
-
-    SetActive();
-    return PJ_EPENDING;
-}
-
-
-//
-// Handle asynchronous RecvFrom() completion
-//
-void CIoqueueCallback::HandleReadCompletion()
-{
-    if (pending_data_.read_.addr_ && pending_data_.read_.addrlen_) {
-        PjSymbianOS::Addr2pj (aAddress_,
-                              * (pj_sockaddr*) pending_data_.read_.addr_,
-                              pending_data_.read_.addrlen_);
-        pending_data_.read_.addr_ = NULL;
-        pending_data_.read_.addrlen_ = NULL;
-    }
-
-    pending_data_.read_.op_key_ = NULL;
-}
-
-
-//
-// Handle asynchronous Accept() completion.
-//
-CPjSocket *CIoqueueCallback::HandleAcceptCompletion()
-{
-    CPjSocket *pjNewSock = new CPjSocket (get_pj_socket()->GetAf(),
-                                          blank_sock_);
-    int addrlen = 0;
-
-    if (pending_data_.accept_.new_sock_) {
-        *pending_data_.accept_.new_sock_ = (pj_sock_t) pjNewSock;
-        pending_data_.accept_.new_sock_ = NULL;
-    }
-
-    if (pending_data_.accept_.local_) {
-        TInetAddr aAddr;
-        pj_sockaddr *ptr_sockaddr;
-
-        blank_sock_.LocalName (aAddr);
-        ptr_sockaddr = (pj_sockaddr*) pending_data_.accept_.local_;
-        addrlen = *pending_data_.accept_.addrlen_;
-        PjSymbianOS::Addr2pj (aAddr, *ptr_sockaddr, &addrlen);
-        pending_data_.accept_.local_ = NULL;
-    }
-
-    if (pending_data_.accept_.remote_) {
-        TInetAddr aAddr;
-        pj_sockaddr *ptr_sockaddr;
-
-        blank_sock_.RemoteName (aAddr);
-        ptr_sockaddr = (pj_sockaddr*) pending_data_.accept_.remote_;
-        addrlen = *pending_data_.accept_.addrlen_;
-        PjSymbianOS::Addr2pj (aAddr, *ptr_sockaddr, &addrlen);
-        pending_data_.accept_.remote_ = NULL;
-    }
-
-    if (pending_data_.accept_.addrlen_) {
-        if (addrlen == 0) {
-            if (pjNewSock->GetAf() == PJ_AF_INET)
-                addrlen = sizeof (pj_sockaddr_in);
-            else if (pjNewSock->GetAf() == PJ_AF_INET6)
-                addrlen = sizeof (pj_sockaddr_in6);
-            else {
-                pj_assert (!"Unsupported address family");
-            }
-        }
-
-        *pending_data_.accept_.addrlen_ = addrlen;
-
-        pending_data_.accept_.addrlen_ = NULL;
-    }
-
-    return pjNewSock;
-}
-
-
-//
-// Completion callback.
-//
-void CIoqueueCallback::RunL()
-{
-    Type cur_type = type_;
-
-    type_ = TYPE_NONE;
-
-    if (cur_type == TYPE_READ) {
-        //
-        // Completion of asynchronous RecvFrom()
-        //
-
-        /* Clear op_key (save it to temp variable first!) */
-        pj_ioqueue_op_key_t	*op_key = pending_data_.read_.op_key_;
-        pending_data_.read_.op_key_ = NULL;
-
-        // Handle failure condition
-
-        if (iStatus != KErrNone) {
-            if (cb_.on_read_complete) {
-                cb_.on_read_complete (key_, op_key,
-                                      -PJ_RETURN_OS_ERROR (iStatus.Int()));
-            }
-
-            return;
-        }
-
-        HandleReadCompletion();
-
-        /* Call callback */
-
-        if (cb_.on_read_complete) {
-            cb_.on_read_complete (key_, op_key, aBufferPtr_.Length());
-        }
-
-    } else if (cur_type == TYPE_ACCEPT) {
-        //
-        // Completion of asynchronous Accept()
-        //
-
-        /* Clear op_key (save it to temp variable first!) */
-        pj_ioqueue_op_key_t	*op_key = pending_data_.read_.op_key_;
-        pending_data_.read_.op_key_ = NULL;
-
-        // Handle failure condition
-
-        if (iStatus != KErrNone) {
-            if (pending_data_.accept_.new_sock_)
-                *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET;
-
-            if (cb_.on_accept_complete) {
-                cb_.on_accept_complete (key_, op_key, PJ_INVALID_SOCKET,
-                                        -PJ_RETURN_OS_ERROR (iStatus.Int()));
-            }
-
-            return;
-        }
-
-        CPjSocket *pjNewSock = HandleAcceptCompletion();
-
-        // Call callback.
-
-        if (cb_.on_accept_complete) {
-            cb_.on_accept_complete (key_, op_key, (pj_sock_t) pjNewSock,
-                                    PJ_SUCCESS);
-        }
-    }
-
-    ioqueue_->eventCount++;
-}
-
-//
-// CActive's DoCancel()
-//
-void CIoqueueCallback::DoCancel()
-{
-    if (type_ == TYPE_READ)
-        sock_->Socket().CancelRecv();
-    else if (type_ == TYPE_ACCEPT)
-        sock_->Socket().CancelAccept();
-
-    type_ = TYPE_NONE;
-
-    pending_data_.common_.op_key_ = NULL;
-}
-
-//
-// Cancel operation and call callback.
-//
-void CIoqueueCallback::CancelOperation (pj_ioqueue_op_key_t *op_key,
-                                        pj_ssize_t bytes_status)
-{
-    Type cur_type = type_;
-
-    pj_assert (op_key == pending_data_.common_.op_key_);
-
-    Cancel();
-
-    if (cur_type == TYPE_READ) {
-        if (cb_.on_read_complete)
-            cb_.on_read_complete (key_, op_key, bytes_status);
-    } else if (cur_type == TYPE_ACCEPT)
-        ;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-/*
- * IO Queue key structure.
- */
-
-struct pj_ioqueue_key_t {
-    CIoqueueCallback	*cbObj;
-};
-
-
-/*
- * Return the name of the ioqueue implementation.
- */
-PJ_DEF (const char*) pj_ioqueue_name (void)
-{
-    return "ioqueue-symbian";
-}
-
-
-/*
- * Create a new I/O Queue framework.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_create (pj_pool_t *pool,
-                                        pj_size_t max_fd,
-                                        pj_ioqueue_t **p_ioqueue)
-{
-    pj_ioqueue_t *ioq;
-
-    PJ_UNUSED_ARG (max_fd);
-
-    ioq = PJ_POOL_ZALLOC_T (pool, pj_ioqueue_t);
-    *p_ioqueue = ioq;
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Destroy the I/O queue.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_destroy (pj_ioqueue_t *ioq)
-{
-    PJ_UNUSED_ARG (ioq);
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Set the lock object to be used by the I/O Queue.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_set_lock (pj_ioqueue_t *ioq,
-        pj_lock_t *lock,
-        pj_bool_t auto_delete)
-{
-    /* Don't really need lock for now */
-    PJ_UNUSED_ARG (ioq);
-
-    if (auto_delete) {
-        pj_lock_destroy (lock);
-    }
-
-    return PJ_SUCCESS;
-}
-
-PJ_DEF (pj_status_t) pj_ioqueue_set_default_concurrency (pj_ioqueue_t *ioqueue,
-        pj_bool_t allow)
-{
-    /* Not supported, just return PJ_SUCCESS silently */
-    PJ_UNUSED_ARG (ioqueue);
-    PJ_UNUSED_ARG (allow);
-    return PJ_SUCCESS;
-}
-
-/*
- * Register a socket to the I/O queue framework.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_register_sock (pj_pool_t *pool,
-        pj_ioqueue_t *ioq,
-        pj_sock_t sock,
-        void *user_data,
-        const pj_ioqueue_callback *cb,
-        pj_ioqueue_key_t **p_key)
-{
-    pj_ioqueue_key_t *key;
-
-    key = PJ_POOL_ZALLOC_T (pool, pj_ioqueue_key_t);
-    key->cbObj = CIoqueueCallback::NewL (ioq, key, sock, cb, user_data);
-
-    *p_key = key;
-    return PJ_SUCCESS;
-}
-
-/*
- * Unregister from the I/O Queue framework.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_unregister (pj_ioqueue_key_t *key)
-{
-    if (key == NULL || key->cbObj == NULL)
-        return PJ_SUCCESS;
-
-    // Cancel pending async object
-    if (key->cbObj) {
-        key->cbObj->Cancel();
-    }
-
-    // Close socket.
-    key->cbObj->get_pj_socket()->Socket().Close();
-
-    delete key->cbObj->get_pj_socket();
-
-    // Delete async object.
-    if (key->cbObj) {
-        delete key->cbObj;
-        key->cbObj = NULL;
-    }
-
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Get user data associated with an ioqueue key.
- */
-PJ_DEF (void*) pj_ioqueue_get_user_data (pj_ioqueue_key_t *key)
-{
-    return key->cbObj->get_user_data();
-}
-
-
-/*
- * Set or change the user data to be associated with the file descriptor or
- * handle or socket descriptor.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_set_user_data (pj_ioqueue_key_t *key,
-        void *user_data,
-        void **old_data)
-{
-    if (old_data)
-        *old_data = key->cbObj->get_user_data();
-
-    key->cbObj->set_user_data (user_data);
-
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Initialize operation key.
- */
-PJ_DEF (void) pj_ioqueue_op_key_init (pj_ioqueue_op_key_t *op_key,
-                                      pj_size_t size)
-{
-    pj_bzero (op_key, size);
-}
-
-
-/*
- * Check if operation is pending on the specified operation key.
- */
-PJ_DEF (pj_bool_t) pj_ioqueue_is_pending (pj_ioqueue_key_t *key,
-        pj_ioqueue_op_key_t *op_key)
-{
-    return key->cbObj->get_op_key() ==op_key &&
-           key->cbObj->IsActive();
-}
-
-
-/*
- * Post completion status to the specified operation key and call the
- * appropriate callback.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_post_completion (pj_ioqueue_key_t *key,
-        pj_ioqueue_op_key_t *op_key,
-        pj_ssize_t bytes_status)
-{
-    if (pj_ioqueue_is_pending (key, op_key)) {
-        key->cbObj->CancelOperation (op_key, bytes_status);
-    }
-
-    return PJ_SUCCESS;
-}
-
-
-#if defined(PJ_HAS_TCP) && PJ_HAS_TCP != 0
-/**
- * Instruct I/O Queue to accept incoming connection on the specified
- * listening socket.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_accept (pj_ioqueue_key_t *key,
-                                        pj_ioqueue_op_key_t *op_key,
-                                        pj_sock_t *new_sock,
-                                        pj_sockaddr_t *local,
-                                        pj_sockaddr_t *remote,
-                                        int *addrlen)
-{
-
-    return key->cbObj->StartAccept (op_key, new_sock, local, remote, addrlen);
-}
-
-
-/*
- * Initiate non-blocking socket connect.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_connect (pj_ioqueue_key_t *key,
-        const pj_sockaddr_t *addr,
-        int addrlen)
-{
-    pj_status_t status;
-
-    RSocket &rSock = key->cbObj->get_pj_socket()->Socket();
-    TInetAddr inetAddr;
-    TRequestStatus reqStatus;
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    // Convert address
-    status = PjSymbianOS::pj2Addr (* (const pj_sockaddr*) addr, addrlen,
-                                   inetAddr);
-
-    if (status != PJ_SUCCESS)
-        return status;
-
-    // We don't support async connect for now.
-    PJ_TODO (IOQUEUE_SUPPORT_ASYNC_CONNECT);
-
-    rSock.Connect (inetAddr, reqStatus);
-
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus == KErrNone)
-        return PJ_SUCCESS;
-
-    return PJ_RETURN_OS_ERROR (reqStatus.Int());
-}
-
-
-#endif	/* PJ_HAS_TCP */
-
-/*
- * Poll the I/O Queue for completed events.
- */
-PJ_DEF (int) pj_ioqueue_poll (pj_ioqueue_t *ioq,
-                              const pj_time_val *timeout)
-{
-    /* Polling is not necessary on Symbian, since all async activities
-     * are registered to active scheduler.
-     */
-    PJ_UNUSED_ARG (ioq);
-    PJ_UNUSED_ARG (timeout);
-    return 0;
-}
-
-
-/*
- * Instruct the I/O Queue to read from the specified handle.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_recv (pj_ioqueue_key_t *key,
-                                      pj_ioqueue_op_key_t *op_key,
-                                      void *buffer,
-                                      pj_ssize_t *length,
-                                      pj_uint32_t flags)
-{
-    // If socket has reader, delete it.
-    if (key->cbObj->get_pj_socket()->Reader())
-        key->cbObj->get_pj_socket()->DestroyReader();
-
-    // Clear flag
-    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
-
-    return key->cbObj->StartRead (op_key, buffer, length, flags, NULL, NULL);
-}
-
-
-/*
- * This function behaves similarly as #pj_ioqueue_recv(), except that it is
- * normally called for socket, and the remote address will also be returned
- * along with the data.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_recvfrom (pj_ioqueue_key_t *key,
-        pj_ioqueue_op_key_t *op_key,
-        void *buffer,
-        pj_ssize_t *length,
-        pj_uint32_t flags,
-        pj_sockaddr_t *addr,
-        int *addrlen)
-{
-    CPjSocket *sock = key->cbObj->get_pj_socket();
-
-    // If address is specified, check that the length match the
-    // address family
-
-    if (addr || addrlen) {
-        PJ_ASSERT_RETURN (addr && addrlen && *addrlen, PJ_EINVAL);
-
-        if (sock->GetAf() == PJ_AF_INET) {
-            PJ_ASSERT_RETURN (*addrlen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL);
-        } else if (sock->GetAf() == PJ_AF_INET6) {
-            PJ_ASSERT_RETURN (*addrlen>= (int) sizeof (pj_sockaddr_in6), PJ_EINVAL);
-        }
-    }
-
-    // If socket has reader, delete it.
-    if (sock->Reader())
-        sock->DestroyReader();
-
-    if (key->cbObj->IsActive())
-        return PJ_EBUSY;
-
-    // Clear flag
-    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
-
-    return key->cbObj->StartRead (op_key, buffer, length, flags, addr, addrlen);
-}
-
-
-/*
- * Instruct the I/O Queue to write to the handle.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_send (pj_ioqueue_key_t *key,
-                                      pj_ioqueue_op_key_t *op_key,
-                                      const void *data,
-                                      pj_ssize_t *length,
-                                      pj_uint32_t flags)
-{
-    TRequestStatus reqStatus;
-    TPtrC8 aBuffer ( (const TUint8*) data, (TInt) *length);
-    TSockXfrLength aLen;
-
-    PJ_UNUSED_ARG (op_key);
-
-    // Forcing pending operation is not supported.
-    PJ_ASSERT_RETURN ( (flags & PJ_IOQUEUE_ALWAYS_ASYNC) ==0, PJ_EINVAL);
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    // Clear flag
-    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
-
-    key->cbObj->get_pj_socket()->Socket().Send (aBuffer, flags, reqStatus, aLen);
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus.Int() != KErrNone)
-        return PJ_RETURN_OS_ERROR (reqStatus.Int());
-
-    //At least in UIQ Emulator, aLen.Length() reports incorrect length
-    //for UDP (some newlc.com users seem to have reported this too).
-    //*length = aLen.Length();
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Instruct the I/O Queue to write to the handle.
- */
-PJ_DEF (pj_status_t) pj_ioqueue_sendto (pj_ioqueue_key_t *key,
-                                        pj_ioqueue_op_key_t *op_key,
-                                        const void *data,
-                                        pj_ssize_t *length,
-                                        pj_uint32_t flags,
-                                        const pj_sockaddr_t *addr,
-                                        int addrlen)
-{
-    TRequestStatus reqStatus;
-    TPtrC8 aBuffer;
-    TInetAddr inetAddr;
-    TSockXfrLength aLen;
-    pj_status_t status;
-
-    PJ_UNUSED_ARG (op_key);
-
-    // Forcing pending operation is not supported.
-    PJ_ASSERT_RETURN ( (flags & PJ_IOQUEUE_ALWAYS_ASYNC) ==0, PJ_EINVAL);
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    // Convert address
-    status = PjSymbianOS::pj2Addr (* (const pj_sockaddr*) addr, addrlen,
-                                   inetAddr);
-
-    if (status != PJ_SUCCESS)
-        return status;
-
-    // Clear flag
-    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
-
-    aBuffer.Set ( (const TUint8*) data, (TInt) *length);
-
-    CPjSocket *pjSock = key->cbObj->get_pj_socket();
-
-    pjSock->Socket().SendTo (aBuffer, inetAddr, flags, reqStatus, aLen);
-
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus.Int() != KErrNone)
-        return PJ_RETURN_OS_ERROR (reqStatus.Int());
-
-    //At least in UIQ Emulator, aLen.Length() reports incorrect length
-    //for UDP (some newlc.com users seem to have reported this too).
-    //*length = aLen.Length();
-    return PJ_SUCCESS;
-}
-
-PJ_DEF (pj_status_t) pj_ioqueue_set_concurrency (pj_ioqueue_key_t *key,
-        pj_bool_t allow)
-{
-    /* Not supported, just return PJ_SUCCESS silently */
-    PJ_UNUSED_ARG (key);
-    PJ_UNUSED_ARG (allow);
-    return PJ_SUCCESS;
-}
-
-PJ_DEF (pj_status_t) pj_ioqueue_lock_key (pj_ioqueue_key_t *key)
-{
-    /* Not supported, just return PJ_SUCCESS silently */
-    PJ_UNUSED_ARG (key);
-    return PJ_SUCCESS;
-}
-
-PJ_DEF (pj_status_t) pj_ioqueue_unlock_key (pj_ioqueue_key_t *key)
-{
-    /* Not supported, just return PJ_SUCCESS silently */
-    PJ_UNUSED_ARG (key);
-    return PJ_SUCCESS;
-}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_symbian.cpp
deleted file mode 100644
index 3cf3845870b18cd5c36fc34521f947dad2721b60..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_symbian.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/* $Id: ip_helper_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pj/ip_helper.h>
-#include <pj/addr_resolv.h>
-#include <pj/assert.h>
-#include <pj/errno.h>
-#include <pj/log.h>
-#include <pj/string.h>
-#include <pj/compat/socket.h>
-
-
-#include "os_symbian.h"
-
-#define THIS_FILE	"ip_helper_symbian.cpp"
-#define TRACE_ME	0
-
-static pj_status_t rsock_enum_interface (int af,
-        unsigned *p_cnt,
-        pj_sockaddr ifs[])
-{
-    TInt rc;
-    RSocket rSock;
-    TPckgBuf<TSoInetInterfaceInfo> info;
-    unsigned i;
-
-    if (PjSymbianOS::Instance()->Connection()) {
-
-        rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(),
-                         af, PJ_SOCK_DGRAM, KProtocolInetUdp,
-                         *PjSymbianOS::Instance()->Connection());
-    } else {
-
-        rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(),
-                         af, PJ_SOCK_DGRAM, KProtocolInetUdp);
-
-    }
-
-    if (rc != KErrNone)
-        return PJ_RETURN_OS_ERROR (rc);
-
-    rSock.SetOpt (KSoInetEnumInterfaces, KSolInetIfCtrl);
-
-    for (i=0; i<*p_cnt &&
-            rSock.GetOpt (KSoInetNextInterface, KSolInetIfCtrl,
-                          info) == KErrNone;) {
-        TInetAddr &iAddress = info().iAddress;
-        int namelen;
-
-#if TRACE_ME
-
-        if (1) {
-            pj_sockaddr a;
-            char ipaddr[PJ_INET6_ADDRSTRLEN+2];
-
-            namelen = sizeof (pj_sockaddr);
-
-            if (PjSymbianOS::Addr2pj (iAddress, a, &namelen,
-                                      PJ_FALSE) == PJ_SUCCESS) {
-                PJ_LOG (5, (THIS_FILE, "Enum: found address %s",
-                            pj_sockaddr_print (&a, ipaddr, sizeof (ipaddr), 2)));
-            }
-        }
-
-#endif
-
-        namelen = sizeof (ifs[i]);
-
-        if (PjSymbianOS::Addr2pj (iAddress, ifs[i], &namelen,
-                                  PJ_TRUE) != PJ_SUCCESS) {
-            continue;
-        }
-
-        if (ifs[i].addr.sa_family != af)
-            continue;
-
-        ++i;
-    }
-
-    rSock.Close();
-
-    // Done
-    *p_cnt = i;
-
-    return PJ_SUCCESS;
-}
-
-/*
- * Enumerate the local IP interface currently active in the host.
- */
-PJ_DEF (pj_status_t) pj_enum_ip_interface (int af,
-        unsigned *p_cnt,
-        pj_sockaddr ifs[])
-{
-    unsigned start;
-    pj_status_t status = PJ_SUCCESS;
-
-    start = 0;
-
-    /* Get IPv6 interface first. */
-
-    if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) {
-        unsigned max = *p_cnt;
-        status = rsock_enum_interface (PJ_AF_INET6, &max, &ifs[start]);
-
-        if (status == PJ_SUCCESS) {
-            (*p_cnt) -= max;
-            start += max;
-        }
-    }
-
-    /* Get IPv4 interface. */
-    if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) {
-        unsigned max = *p_cnt;
-        status = rsock_enum_interface (PJ_AF_INET, &max, &ifs[start]);
-
-        if (status == PJ_SUCCESS) {
-            (*p_cnt) -= max;
-            start += max;
-        }
-    }
-
-    *p_cnt = start;
-
-    return start ? PJ_SUCCESS : PJ_ENOTFOUND;
-}
-
-/*
- * Enumerate the IP routing table for this host.
- */
-PJ_DEF (pj_status_t) pj_enum_ip_route (unsigned *p_cnt,
-                                       pj_ip_route_entry routes[])
-{
-    PJ_ASSERT_RETURN (p_cnt && *p_cnt > 0 && routes, PJ_EINVAL);
-    *p_cnt = 0;
-    return PJ_ENOTSUP;
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_symbian.cpp
deleted file mode 100644
index b7f44b7903047ac293c6149e595c274093b7315a..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_symbian.cpp
+++ /dev/null
@@ -1,1043 +0,0 @@
-/* $Id: os_core_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pj/os.h>
-#include <pj/assert.h>
-#include <pj/pool.h>
-#include <pj/log.h>
-#include <pj/rand.h>
-#include <pj/string.h>
-#include <pj/guid.h>
-#include <pj/except.h>
-#include <pj/errno.h>
-
-#include "os_symbian.h"
-
-
-#define PJ_MAX_TLS	    32
-#define DUMMY_MUTEX	    ((pj_mutex_t*)101)
-#define DUMMY_SEMAPHORE	    ((pj_sem_t*)102)
-#define THIS_FILE	    "os_core_symbian.c"
-
-/*
- * Note:
- *
- * The Symbian implementation does not support threading!
- */
-
-struct pj_thread_t {
-    char	    obj_name[PJ_MAX_OBJ_NAME];
-    void	   *tls_values[PJ_MAX_TLS];
-
-#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0
-    pj_uint32_t	    stk_size;
-    pj_uint32_t	    stk_max_usage;
-    char	   *stk_start;
-    const char	   *caller_file;
-    int		    caller_line;
-#endif
-
-} main_thread;
-
-struct pj_atomic_t {
-    pj_atomic_value_t	value;
-};
-
-struct pj_sem_t {
-    int value;
-    int max;
-};
-
-/* Flags to indicate which TLS variables have been used */
-static int tls_vars[PJ_MAX_TLS];
-
-/* atexit handlers */
-static unsigned atexit_count;
-static void (*atexit_func[32]) (void);
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// CPjTimeoutTimer implementation
-//
-
-CPjTimeoutTimer::CPjTimeoutTimer()
-        : CActive (PJ_SYMBIAN_TIMER_PRIORITY), hasTimedOut_ (PJ_FALSE)
-{
-}
-
-CPjTimeoutTimer::~CPjTimeoutTimer()
-{
-    Cancel();
-    timer_.Close();
-}
-
-void CPjTimeoutTimer::ConstructL()
-{
-    hasTimedOut_ = PJ_FALSE;
-    timer_.CreateLocal();
-    CActiveScheduler::Add (this);
-}
-
-CPjTimeoutTimer *CPjTimeoutTimer::NewL()
-{
-    CPjTimeoutTimer *self = new CPjTimeoutTimer;
-    CleanupStack::PushL (self);
-
-    self->ConstructL();
-
-    CleanupStack::Pop (self);
-    return self;
-
-}
-
-void CPjTimeoutTimer::StartTimer (TUint miliSeconds)
-{
-    Cancel();
-
-    hasTimedOut_ = PJ_FALSE;
-    timer_.After (iStatus, miliSeconds * 1000);
-    SetActive();
-}
-
-bool CPjTimeoutTimer::HasTimedOut() const
-{
-    return hasTimedOut_ != 0;
-}
-
-void CPjTimeoutTimer::RunL()
-{
-    hasTimedOut_ = PJ_TRUE;
-}
-
-void CPjTimeoutTimer::DoCancel()
-{
-    timer_.Cancel();
-}
-
-TInt CPjTimeoutTimer::RunError (TInt aError)
-{
-    PJ_UNUSED_ARG (aError);
-    return KErrNone;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// PjSymbianOS implementation
-//
-
-PjSymbianOS::PjSymbianOS()
-        : isConnectionUp_ (false),
-        isSocketServInitialized_ (false), isResolverInitialized_ (false),
-        console_ (NULL), selectTimeoutTimer_ (NULL),
-        appSocketServ_ (NULL), appConnection_ (NULL), appHostResolver_ (NULL),
-        appHostResolver6_ (NULL)
-{
-}
-
-// Set parameters
-void PjSymbianOS::SetParameters (pj_symbianos_params *params)
-{
-    appSocketServ_ = (RSocketServ*) params->rsocketserv;
-    appConnection_ = (RConnection*) params->rconnection;
-    appHostResolver_ = (RHostResolver*) params->rhostresolver;
-    appHostResolver6_ = (RHostResolver*) params->rhostresolver6;
-}
-
-// Get PjSymbianOS instance
-PjSymbianOS *PjSymbianOS::Instance()
-{
-    static PjSymbianOS instance_;
-    return &instance_;
-}
-
-
-// Initialize
-TInt PjSymbianOS::Initialize()
-{
-    TInt err;
-
-    selectTimeoutTimer_ = CPjTimeoutTimer::NewL();
-
-#if 0
-    pj_assert (console_ == NULL);
-    TRAPD (err, console_ = Console::NewL (_L ("PJLIB"),
-                                          TSize (KConsFullScreen,KConsFullScreen)));
-    return err;
-#endif
-
-    /* Only create RSocketServ if application doesn't specify it
-     * in the parameters
-     */
-
-    if (!isSocketServInitialized_ && appSocketServ_ == NULL) {
-        err = socketServ_.Connect();
-
-        if (err != KErrNone)
-            goto on_error;
-
-        isSocketServInitialized_ = true;
-    }
-
-    if (!isResolverInitialized_) {
-        if (appHostResolver_ == NULL) {
-            if (Connection())
-                err = hostResolver_.Open (SocketServ(), KAfInet, KSockStream,
-                                          *Connection());
-            else
-                err = hostResolver_.Open (SocketServ(), KAfInet, KSockStream);
-
-            if (err != KErrNone)
-                goto on_error;
-        }
-
-#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0
-        if (appHostResolver6_ == NULL) {
-            if (Connection())
-                err = hostResolver6_.Open (SocketServ(), KAfInet6, KSockStream,
-                                           *Connection());
-            else
-                err = hostResolver6_.Open (SocketServ(), KAfInet6, KSockStream);
-
-            if (err != KErrNone)
-                goto on_error;
-        }
-
-#endif
-
-
-        isResolverInitialized_ = true;
-    }
-
-    isConnectionUp_ = true;
-
-    return KErrNone;
-
-on_error:
-    Shutdown();
-    return err;
-}
-
-// Shutdown
-void PjSymbianOS::Shutdown()
-{
-    isConnectionUp_ = false;
-
-    if (isResolverInitialized_) {
-        hostResolver_.Close();
-#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0
-        hostResolver6_.Close();
-#endif
-        isResolverInitialized_ = false;
-    }
-
-    if (isSocketServInitialized_) {
-        socketServ_.Close();
-        isSocketServInitialized_ = false;
-    }
-
-    delete console_;
-
-    console_ = NULL;
-
-    delete selectTimeoutTimer_;
-    selectTimeoutTimer_ = NULL;
-
-    appSocketServ_ = NULL;
-    appConnection_ = NULL;
-    appHostResolver_ = NULL;
-    appHostResolver6_ = NULL;
-}
-
-// Convert to Unicode
-TInt PjSymbianOS::ConvertToUnicode (TDes16 &aUnicode, const TDesC8 &aForeign)
-{
-#if 0
-    pj_assert (conv_ != NULL);
-    return conv_->ConvertToUnicode (aUnicode, aForeign, convToUnicodeState_);
-#else
-    return CnvUtfConverter::ConvertToUnicodeFromUtf8 (aUnicode, aForeign);
-#endif
-}
-
-// Convert from Unicode
-TInt PjSymbianOS::ConvertFromUnicode (TDes8 &aForeign, const TDesC16 &aUnicode)
-{
-#if 0
-    pj_assert (conv_ != NULL);
-    return conv_->ConvertFromUnicode (aForeign, aUnicode, convToAnsiState_);
-#else
-    return CnvUtfConverter::ConvertFromUnicodeToUtf8 (aForeign, aUnicode);
-#endif
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// PJLIB os.h implementation
-//
-
-PJ_DEF (pj_uint32_t) pj_getpid (void)
-{
-    return 0;
-}
-
-
-/* Set Symbian specific parameters */
-PJ_DEF (pj_status_t) pj_symbianos_set_params (pj_symbianos_params *prm)
-{
-    PJ_ASSERT_RETURN (prm != NULL, PJ_EINVAL);
-    PjSymbianOS::Instance()->SetParameters (prm);
-    return PJ_SUCCESS;
-}
-
-
-/* Set connection status */
-PJ_DEF (void) pj_symbianos_set_connection_status (pj_bool_t up)
-{
-    PjSymbianOS::Instance()->SetConnectionStatus (up != 0);
-}
-
-
-/*
- * pj_init(void).
- * Init PJLIB!
- */
-PJ_DEF (pj_status_t) pj_init (void)
-{
-    char stack_ptr;
-    pj_status_t status;
-
-    pj_ansi_strcpy (main_thread.obj_name, "pjthread");
-
-    // Init main thread
-    pj_memset (&main_thread, 0, sizeof (main_thread));
-
-    // Initialize PjSymbianOS instance
-    PjSymbianOS *os = PjSymbianOS::Instance();
-
-    PJ_LOG (4, (THIS_FILE, "Initializing PJLIB for Symbian OS.."));
-
-    TInt err;
-    err = os->Initialize();
-
-    if (err != KErrNone)
-        return PJ_RETURN_OS_ERROR (err);
-
-    /* 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)
-        goto on_error;
-
-#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0
-    main_thread.stk_start = &stack_ptr;
-
-    main_thread.stk_size = 0xFFFFFFFFUL;
-
-    main_thread.stk_max_usage = 0;
-
-#else
-    stack_ptr = '\0';
-
-#endif
-
-    PJ_LOG (5, (THIS_FILE, "PJLIB initialized."));
-
-    return PJ_SUCCESS;
-
-on_error:
-    pj_shutdown();
-
-    return PJ_RETURN_OS_ERROR (err);
-}
-
-
-PJ_DEF (pj_status_t) pj_atexit (pj_exit_callback func)
-{
-    if (atexit_count >= PJ_ARRAY_SIZE (atexit_func))
-        return PJ_ETOOMANY;
-
-    atexit_func[atexit_count++] = func;
-
-    return PJ_SUCCESS;
-}
-
-
-
-PJ_DEF (void) pj_shutdown (void)
-{
-    /* Call atexit() functions */
-    while (atexit_count > 0) {
-        (*atexit_func[atexit_count-1]) ();
-        --atexit_count;
-    }
-
-    /* Free exception ID */
-    if (PJ_NO_MEMORY_EXCEPTION != -1) {
-        pj_exception_id_free (PJ_NO_MEMORY_EXCEPTION);
-        PJ_NO_MEMORY_EXCEPTION = -1;
-    }
-
-    /* Clear static variables */
-    pj_errno_clear_handlers();
-
-    PjSymbianOS *os = PjSymbianOS::Instance();
-
-    os->Shutdown();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CPollTimeoutTimer : public CActive
-{
-
-    public:
-        static CPollTimeoutTimer* NewL (int msec, TInt prio);
-        ~CPollTimeoutTimer();
-
-        virtual void RunL();
-        virtual void DoCancel();
-
-    private:
-        RTimer	     rtimer_;
-
-        explicit CPollTimeoutTimer (TInt prio);
-        void ConstructL (int msec);
-};
-
-CPollTimeoutTimer::CPollTimeoutTimer (TInt prio)
-        : CActive (prio)
-{
-}
-
-
-CPollTimeoutTimer::~CPollTimeoutTimer()
-{
-    rtimer_.Close();
-}
-
-void CPollTimeoutTimer::ConstructL (int msec)
-{
-    rtimer_.CreateLocal();
-    CActiveScheduler::Add (this);
-    rtimer_.After (iStatus, msec*1000);
-    SetActive();
-}
-
-CPollTimeoutTimer* CPollTimeoutTimer::NewL (int msec, TInt prio)
-{
-    CPollTimeoutTimer *self = new CPollTimeoutTimer (prio);
-    CleanupStack::PushL (self);
-    self->ConstructL (msec);
-    CleanupStack::Pop (self);
-
-    return self;
-}
-
-void CPollTimeoutTimer::RunL()
-{
-}
-
-void CPollTimeoutTimer::DoCancel()
-{
-    rtimer_.Cancel();
-}
-
-
-/*
- * Wait the completion of any Symbian active objects.
- */
-PJ_DEF (pj_bool_t) pj_symbianos_poll (int priority, int ms_timeout)
-{
-    CPollTimeoutTimer *timer = NULL;
-
-    if (priority==-1)
-        priority = EPriorityNull;
-
-    if (ms_timeout >= 0) {
-        timer = CPollTimeoutTimer::NewL (ms_timeout, priority);
-    }
-
-    PjSymbianOS::Instance()->WaitForActiveObjects (priority);
-
-    if (timer) {
-        bool timer_is_active = timer->IsActive();
-
-        timer->Cancel();
-
-        delete timer;
-
-        return timer_is_active ? PJ_TRUE : PJ_FALSE;
-
-    } else {
-        return PJ_TRUE;
-    }
-}
-
-
-/*
- * pj_thread_is_registered()
- */
-PJ_DEF (pj_bool_t) pj_thread_is_registered (void)
-{
-    return PJ_FALSE;
-}
-
-
-/*
- * Get thread priority value for the thread.
- */
-PJ_DEF (int) pj_thread_get_prio (pj_thread_t *thread)
-{
-    PJ_UNUSED_ARG (thread);
-    return 1;
-}
-
-
-/*
- * Set the thread priority.
- */
-PJ_DEF (pj_status_t) pj_thread_set_prio (pj_thread_t *thread,  int prio)
-{
-    PJ_UNUSED_ARG (thread);
-    PJ_UNUSED_ARG (prio);
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Get the lowest priority value available on this system.
- */
-PJ_DEF (int) pj_thread_get_prio_min (pj_thread_t *thread)
-{
-    PJ_UNUSED_ARG (thread);
-    return 1;
-}
-
-
-/*
- * Get the highest priority value available on this system.
- */
-PJ_DEF (int) pj_thread_get_prio_max (pj_thread_t *thread)
-{
-    PJ_UNUSED_ARG (thread);
-    return 1;
-}
-
-
-/*
- * pj_thread_get_os_handle()
- */
-PJ_DEF (void*) pj_thread_get_os_handle (pj_thread_t *thread)
-{
-    PJ_UNUSED_ARG (thread);
-    return NULL;
-}
-
-/*
- * pj_thread_register(..)
- */
-PJ_DEF (pj_status_t) pj_thread_register (const char *cstr_thread_name,
-        pj_thread_desc desc,
-        pj_thread_t **thread_ptr)
-{
-    PJ_UNUSED_ARG (cstr_thread_name);
-    PJ_UNUSED_ARG (desc);
-    PJ_UNUSED_ARG (thread_ptr);
-    return PJ_EINVALIDOP;
-}
-
-
-/*
- * pj_thread_create(...)
- */
-PJ_DEF (pj_status_t) pj_thread_create (pj_pool_t *pool,
-                                       const char *thread_name,
-                                       pj_thread_proc *proc,
-                                       void *arg,
-                                       pj_size_t stack_size,
-                                       unsigned flags,
-                                       pj_thread_t **ptr_thread)
-{
-    PJ_UNUSED_ARG (pool);
-    PJ_UNUSED_ARG (thread_name);
-    PJ_UNUSED_ARG (proc);
-    PJ_UNUSED_ARG (arg);
-    PJ_UNUSED_ARG (stack_size);
-    PJ_UNUSED_ARG (flags);
-    PJ_UNUSED_ARG (ptr_thread);
-
-    /* Sorry mate, we don't support threading */
-    return PJ_ENOTSUP;
-}
-
-/*
- * pj_thread-get_name()
- */
-PJ_DEF (const char*) pj_thread_get_name (pj_thread_t *p)
-{
-    pj_assert (p == &main_thread);
-    return p->obj_name;
-}
-
-/*
- * pj_thread_resume()
- */
-PJ_DEF (pj_status_t) pj_thread_resume (pj_thread_t *p)
-{
-    PJ_UNUSED_ARG (p);
-    return PJ_EINVALIDOP;
-}
-
-/*
- * pj_thread_this()
- */
-PJ_DEF (pj_thread_t*) pj_thread_this (void)
-{
-    return &main_thread;
-}
-
-/*
- * pj_thread_join()
- */
-PJ_DEF (pj_status_t) pj_thread_join (pj_thread_t *rec)
-{
-    PJ_UNUSED_ARG (rec);
-    return PJ_EINVALIDOP;
-}
-
-/*
- * pj_thread_destroy()
- */
-PJ_DEF (pj_status_t) pj_thread_destroy (pj_thread_t *rec)
-{
-    PJ_UNUSED_ARG (rec);
-    return PJ_EINVALIDOP;
-}
-
-/*
- * pj_thread_sleep()
- */
-PJ_DEF (pj_status_t) pj_thread_sleep (unsigned msec)
-{
-    User::After (msec*1000);
-
-    return PJ_SUCCESS;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-/*
- * pj_thread_local_alloc()
- */
-
-PJ_DEF (pj_status_t) pj_thread_local_alloc (long *index)
-{
-    unsigned i;
-
-    /* Find unused TLS variable */
-
-    for (i=0; i<PJ_ARRAY_SIZE (tls_vars); ++i) {
-        if (tls_vars[i] == 0)
-            break;
-    }
-
-    if (i == PJ_ARRAY_SIZE (tls_vars))
-        return PJ_ETOOMANY;
-
-    tls_vars[i] = 1;
-
-    *index = i;
-
-    return PJ_SUCCESS;
-}
-
-/*
- * pj_thread_local_free()
- */
-PJ_DEF (void) pj_thread_local_free (long index)
-{
-    PJ_ASSERT_ON_FAIL (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) &&
-                       tls_vars[index] != 0, return);
-
-    tls_vars[index] = 0;
-}
-
-
-/*
- * pj_thread_local_set()
- */
-PJ_DEF (pj_status_t) pj_thread_local_set (long index, void *value)
-{
-    pj_thread_t *rec = pj_thread_this();
-
-    PJ_ASSERT_RETURN (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) &&
-                      tls_vars[index] != 0, PJ_EINVAL);
-
-    rec->tls_values[index] = value;
-    return PJ_SUCCESS;
-}
-
-/*
- * pj_thread_local_get()
- */
-PJ_DEF (void*) pj_thread_local_get (long index)
-{
-    pj_thread_t *rec = pj_thread_this();
-
-    PJ_ASSERT_RETURN (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) &&
-                      tls_vars[index] != 0, NULL);
-
-    return rec->tls_values[index];
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-/*
- * Create atomic variable.
- */
-PJ_DEF (pj_status_t) pj_atomic_create (pj_pool_t *pool,
-                                       pj_atomic_value_t initial,
-                                       pj_atomic_t **atomic)
-{
-    *atomic = (pj_atomic_t*) pj_pool_alloc (pool, sizeof (struct pj_atomic_t));
-    (*atomic)->value = initial;
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Destroy atomic variable.
- */
-PJ_DEF (pj_status_t) pj_atomic_destroy (pj_atomic_t *atomic_var)
-{
-    PJ_UNUSED_ARG (atomic_var);
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Set the value of an atomic type, and return the previous value.
- */
-PJ_DEF (void) pj_atomic_set (pj_atomic_t *atomic_var,
-                             pj_atomic_value_t value)
-{
-    atomic_var->value = value;
-}
-
-
-/*
- * Get the value of an atomic type.
- */
-PJ_DEF (pj_atomic_value_t) pj_atomic_get (pj_atomic_t *atomic_var)
-{
-    return atomic_var->value;
-}
-
-
-/*
- * Increment the value of an atomic type.
- */
-PJ_DEF (void) pj_atomic_inc (pj_atomic_t *atomic_var)
-{
-    ++atomic_var->value;
-}
-
-
-/*
- * Increment the value of an atomic type and get the result.
- */
-PJ_DEF (pj_atomic_value_t) pj_atomic_inc_and_get (pj_atomic_t *atomic_var)
-{
-    return ++atomic_var->value;
-}
-
-
-/*
- * Decrement the value of an atomic type.
- */
-PJ_DEF (void) pj_atomic_dec (pj_atomic_t *atomic_var)
-{
-    --atomic_var->value;
-}
-
-
-/*
- * Decrement the value of an atomic type and get the result.
- */
-PJ_DEF (pj_atomic_value_t) pj_atomic_dec_and_get (pj_atomic_t *atomic_var)
-{
-    return --atomic_var->value;
-}
-
-
-/*
- * Add a value to an atomic type.
- */
-PJ_DEF (void) pj_atomic_add (pj_atomic_t *atomic_var,
-                             pj_atomic_value_t value)
-{
-    atomic_var->value += value;
-}
-
-
-/*
- * Add a value to an atomic type and get the result.
- */
-PJ_DEF (pj_atomic_value_t) pj_atomic_add_and_get (pj_atomic_t *atomic_var,
-        pj_atomic_value_t value)
-{
-    atomic_var->value += value;
-    return atomic_var->value;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-PJ_DEF (pj_status_t) pj_mutex_create (pj_pool_t *pool,
-                                      const char *name,
-                                      int type,
-                                      pj_mutex_t **mutex)
-{
-    PJ_UNUSED_ARG (pool);
-    PJ_UNUSED_ARG (name);
-    PJ_UNUSED_ARG (type);
-
-    *mutex = DUMMY_MUTEX;
-    return PJ_SUCCESS;
-}
-
-/*
- * pj_mutex_create_simple()
- */
-PJ_DEF (pj_status_t) pj_mutex_create_simple (pj_pool_t *pool,
-        const char *name,
-        pj_mutex_t **mutex)
-{
-    return pj_mutex_create (pool, name, PJ_MUTEX_SIMPLE, mutex);
-}
-
-
-PJ_DEF (pj_status_t) pj_mutex_create_recursive (pj_pool_t *pool,
-        const char *name,
-        pj_mutex_t **mutex)
-{
-    return pj_mutex_create (pool, name, PJ_MUTEX_RECURSE, mutex);
-}
-
-
-/*
- * pj_mutex_lock()
- */
-PJ_DEF (pj_status_t) pj_mutex_lock (pj_mutex_t *mutex)
-{
-    pj_assert (mutex == DUMMY_MUTEX);
-    return PJ_SUCCESS;
-}
-
-/*
- * pj_mutex_trylock()
- */
-PJ_DEF (pj_status_t) pj_mutex_trylock (pj_mutex_t *mutex)
-{
-    pj_assert (mutex == DUMMY_MUTEX);
-    return PJ_SUCCESS;
-}
-
-/*
- * pj_mutex_unlock()
- */
-PJ_DEF (pj_status_t) pj_mutex_unlock (pj_mutex_t *mutex)
-{
-    pj_assert (mutex == DUMMY_MUTEX);
-    return PJ_SUCCESS;
-}
-
-/*
- * pj_mutex_destroy()
- */
-PJ_DEF (pj_status_t) pj_mutex_destroy (pj_mutex_t *mutex)
-{
-    pj_assert (mutex == DUMMY_MUTEX);
-    return PJ_SUCCESS;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-/*
- * RW Mutex
- */
-#include "os_rwmutex.c"
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-/*
- * Enter critical section.
- */
-PJ_DEF (void) pj_enter_critical_section (void)
-{
-    /* Nothing to do */
-}
-
-
-/*
- * Leave critical section.
- */
-PJ_DEF (void) pj_leave_critical_section (void)
-{
-    /* Nothing to do */
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-/*
- * Create semaphore.
- */
-PJ_DEF (pj_status_t) pj_sem_create (pj_pool_t *pool,
-                                    const char *name,
-                                    unsigned initial,
-                                    unsigned max,
-                                    pj_sem_t **p_sem)
-{
-    pj_sem_t *sem;
-
-    PJ_UNUSED_ARG (name);
-
-    sem = (pj_sem_t*) pj_pool_zalloc (pool, sizeof (pj_sem_t));
-    sem->value = initial;
-    sem->max = max;
-
-    *p_sem = sem;
-
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Wait for semaphore.
- */
-PJ_DEF (pj_status_t) pj_sem_wait (pj_sem_t *sem)
-{
-    if (sem->value > 0) {
-        sem->value--;
-        return PJ_SUCCESS;
-    } else {
-        pj_assert (!"Unexpected!");
-        return PJ_EINVALIDOP;
-    }
-}
-
-
-/*
- * Try wait for semaphore.
- */
-PJ_DEF (pj_status_t) pj_sem_trywait (pj_sem_t *sem)
-{
-    if (sem->value > 0) {
-        sem->value--;
-        return PJ_SUCCESS;
-    } else {
-        pj_assert (!"Unexpected!");
-        return PJ_EINVALIDOP;
-    }
-}
-
-
-/*
- * Release semaphore.
- */
-PJ_DEF (pj_status_t) pj_sem_post (pj_sem_t *sem)
-{
-    sem->value++;
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Destroy semaphore.
- */
-PJ_DEF (pj_status_t) pj_sem_destroy (pj_sem_t *sem)
-{
-    PJ_UNUSED_ARG (sem);
-    return PJ_SUCCESS;
-}
-
-
-#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK != 0
-/*
- * The implementation of stack checking.
- */
-PJ_DEF (void) pj_thread_check_stack (const char *file, int line)
-{
-    char stk_ptr;
-    pj_uint32_t usage;
-    pj_thread_t *thread = pj_thread_this();
-
-    pj_assert (thread);
-
-    /* Calculate current usage. */
-    usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start :
-            thread->stk_start - &stk_ptr;
-
-    /* Assert if stack usage is dangerously high. */
-    pj_assert ("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128));
-
-    /* Keep statistic. */
-
-    if (usage > thread->stk_max_usage) {
-        thread->stk_max_usage = usage;
-        thread->caller_file = file;
-        thread->caller_line = line;
-    }
-}
-
-/*
- * Get maximum stack usage statistic.
- */
-PJ_DEF (pj_uint32_t) pj_thread_get_stack_max_usage (pj_thread_t *thread)
-{
-    return thread->stk_max_usage;
-}
-
-/*
- * Dump thread stack status.
- */
-PJ_DEF (pj_status_t) pj_thread_get_stack_info (pj_thread_t *thread,
-        const char **file,
-        int *line)
-{
-    pj_assert (thread);
-
-    *file = thread->caller_file;
-    *line = thread->caller_line;
-    return 0;
-}
-
-#endif	/* PJ_OS_HAS_CHECK_STACK */
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_symbian.cpp
deleted file mode 100644
index bb57cd9663c507be0d5feb5c3368a99843db3bae..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_symbian.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-/* $Id: os_error_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pj/errno.h>
-#include <pj/assert.h>
-#include <pj/compat/stdarg.h>
-#include <pj/unicode.h>
-#include <pj/string.h>
-
-#include <e32err.h>
-#include <in_sock.h>
-
-
-#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0)
-
-static const struct {
-    pj_os_err_type code;
-    const char *msg;
-} gaErrorList[] = {
-
-    /*
-     * Generic error -1 to -46
-     */
-    PJ_BUILD_ERR (KErrNotFound,	    "Unable to find the specified object"),
-    PJ_BUILD_ERR (KErrGeneral,	    "General (unspecified) error"),
-    PJ_BUILD_ERR (KErrCancel,	    "The operation was cancelled"),
-    PJ_BUILD_ERR (KErrNoMemory,	    "Not enough memory"),
-    PJ_BUILD_ERR (KErrNotSupported, "The operation requested is not supported"),
-    PJ_BUILD_ERR (KErrArgument,	    "Bad request"),
-    PJ_BUILD_ERR (KErrTotalLossOfPrecision, "Total loss of precision"),
-    PJ_BUILD_ERR (KErrBadHandle,    "Bad object"),
-    PJ_BUILD_ERR (KErrOverflow,	    "Overflow"),
-    PJ_BUILD_ERR (KErrUnderflow,    "Underflow"),
-    PJ_BUILD_ERR (KErrAlreadyExists,"Already exists"),
-    PJ_BUILD_ERR (KErrPathNotFound, "Unable to find the specified folder"),
-    PJ_BUILD_ERR (KErrDied,	    "Closed"),
-    PJ_BUILD_ERR (KErrInUse,	    "The specified object is currently in use by another program"),
-    PJ_BUILD_ERR (KErrServerTerminated,	    "Server has closed"),
-    PJ_BUILD_ERR (KErrServerBusy,   "Server busy"),
-    PJ_BUILD_ERR (KErrCompletion,   "Completion error"),
-    PJ_BUILD_ERR (KErrNotReady,	    "Not ready"),
-    PJ_BUILD_ERR (KErrUnknown,	    "Unknown error"),
-    PJ_BUILD_ERR (KErrCorrupt,	    "Corrupt"),
-    PJ_BUILD_ERR (KErrAccessDenied, "Access denied"),
-    PJ_BUILD_ERR (KErrLocked,	    "Locked"),
-    PJ_BUILD_ERR (KErrWrite,	    "Failed to write"),
-    PJ_BUILD_ERR (KErrDisMounted,   "Wrong disk present"),
-    PJ_BUILD_ERR (KErrEof,	    "Unexpected end of file"),
-    PJ_BUILD_ERR (KErrDiskFull,	    "Disk full"),
-    PJ_BUILD_ERR (KErrBadDriver,    "Bad device driver"),
-    PJ_BUILD_ERR (KErrBadName,	    "Bad name"),
-    PJ_BUILD_ERR (KErrCommsLineFail,"Comms line failed"),
-    PJ_BUILD_ERR (KErrCommsFrame,   "Comms frame error"),
-    PJ_BUILD_ERR (KErrCommsOverrun, "Comms overrun error"),
-    PJ_BUILD_ERR (KErrCommsParity,  "Comms parity error"),
-    PJ_BUILD_ERR (KErrTimedOut,	    "Timed out"),
-    PJ_BUILD_ERR (KErrCouldNotConnect, "Failed to connect"),
-    PJ_BUILD_ERR (KErrCouldNotDisconnect, "Failed to disconnect"),
-    PJ_BUILD_ERR (KErrDisconnected, "Disconnected"),
-    PJ_BUILD_ERR (KErrBadLibraryEntryPoint, "Bad library entry point"),
-    PJ_BUILD_ERR (KErrBadDescriptor,"Bad descriptor"),
-    PJ_BUILD_ERR (KErrAbort,	    "Interrupted"),
-    PJ_BUILD_ERR (KErrTooBig,	    "Too big"),
-    PJ_BUILD_ERR (KErrDivideByZero, "Divide by zero"),
-    PJ_BUILD_ERR (KErrBadPower,	    "Batteries too low"),
-    PJ_BUILD_ERR (KErrDirFull,	    "Folder full"),
-    PJ_BUILD_ERR (KErrHardwareNotAvailable, ""),
-    PJ_BUILD_ERR (KErrSessionClosed,	    ""),
-    PJ_BUILD_ERR (KErrPermissionDenied,     ""),
-
-    /*
-     * Socket errors (-190 - -1000)
-     */
-    PJ_BUILD_ERR (KErrNetUnreach,   "Could not connect to the network. Currently unreachable"),
-    PJ_BUILD_ERR (KErrHostUnreach,  "Could not connect to the specified server"),
-    PJ_BUILD_ERR (KErrNoProtocolOpt,"The specified server refuses the selected protocol"),
-    PJ_BUILD_ERR (KErrUrgentData,   ""),
-    PJ_BUILD_ERR (KErrWouldBlock,   "Conflicts with KErrExtended, but cannot occur in practice"),
-
-    {0, NULL}
-};
-
-#endif	/* PJ_HAS_ERROR_STRING */
-
-
-PJ_DEF (pj_status_t) pj_get_os_error (void)
-{
-    return -1;
-}
-
-PJ_DEF (void) pj_set_os_error (pj_status_t code)
-{
-    PJ_UNUSED_ARG (code);
-}
-
-PJ_DEF (pj_status_t) pj_get_netos_error (void)
-{
-    return -1;
-}
-
-PJ_DEF (void) pj_set_netos_error (pj_status_t code)
-{
-    PJ_UNUSED_ARG (code);
-}
-
-PJ_BEGIN_DECL
-
-PJ_DECL (int) platform_strerror (pj_os_err_type os_errcode,
-                                 char *buf, pj_size_t bufsize);
-PJ_END_DECL
-
-/*
- * platform_strerror()
- *
- * Platform specific error message. This file is called by pj_strerror()
- * in errno.c
- */
-PJ_DEF (int) platform_strerror (pj_os_err_type os_errcode,
-                                char *buf, pj_size_t bufsize)
-{
-    int len = 0;
-
-    pj_assert (buf != NULL);
-    pj_assert (bufsize >= 0);
-
-    /*
-     * MUST NOT check stack here.
-     * This function might be called from PJ_CHECK_STACK() itself!
-       //PJ_CHECK_STACK();
-     */
-
-    if (!len) {
-#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0)
-        int i;
-
-        for (i = 0; gaErrorList[i].msg; ++i) {
-            if (gaErrorList[i].code == os_errcode) {
-                len = strlen (gaErrorList[i].msg);
-
-                if ( (pj_size_t) len >= bufsize) {
-                    len = bufsize-1;
-                }
-
-                pj_memcpy (buf, gaErrorList[i].msg, len);
-
-                buf[len] = '\0';
-                break;
-            }
-        }
-
-#endif	/* PJ_HAS_ERROR_STRING */
-
-    }
-
-    if (!len) {
-        len = pj_ansi_snprintf (buf, bufsize, "Symbian native error %d",
-                                os_errcode);
-        buf[len] = '\0';
-    }
-
-    return len;
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_win32.c b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_win32.c
deleted file mode 100644
index 5b9af57ebccad704e4c1bdcda9d973de4ef724b4..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_win32.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/* $Id: os_time_win32.c 2394 2008-12-23 17:27:53Z bennylp $ */
-/* 
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pj/os.h>
-#include <pj/string.h>
-#include <windows.h>
-
-///////////////////////////////////////////////////////////////////////////////
-
-#define SECS_TO_FT_MULT 10000000
-
-static LARGE_INTEGER base_time;
-
-// Find 1st Jan 1970 as a FILETIME 
-static void get_base_time(void)
-{
-    SYSTEMTIME st;
-    FILETIME ft;
-
-    memset(&st,0,sizeof(st));
-    st.wYear=1970;
-    st.wMonth=1;
-    st.wDay=1;
-    SystemTimeToFileTime(&st, &ft);
-    
-    base_time.LowPart = ft.dwLowDateTime;
-    base_time.HighPart = ft.dwHighDateTime;
-    base_time.QuadPart /= SECS_TO_FT_MULT;
-}
-
-PJ_DEF(pj_status_t) pj_gettimeofday(pj_time_val *tv)
-{
-    SYSTEMTIME st;
-    FILETIME ft;
-    LARGE_INTEGER li;
-
-    if (base_time.QuadPart == 0)
-	get_base_time();
-
-    GetLocalTime(&st);
-    SystemTimeToFileTime(&st, &ft);
-
-    li.LowPart = ft.dwLowDateTime;
-    li.HighPart = ft.dwHighDateTime;
-    li.QuadPart /= SECS_TO_FT_MULT;
-    li.QuadPart -= base_time.QuadPart;
-
-    tv->sec = li.LowPart;
-    tv->msec = st.wMilliseconds;
-
-    return PJ_SUCCESS;
-}
-
-PJ_DEF(pj_status_t) pj_time_decode(const pj_time_val *tv, pj_parsed_time *pt)
-{
-    LARGE_INTEGER li;
-    FILETIME ft;
-    SYSTEMTIME st;
-
-    li.QuadPart = tv->sec;
-    li.QuadPart += base_time.QuadPart;
-    li.QuadPart *= SECS_TO_FT_MULT;
-
-    ft.dwLowDateTime = li.LowPart;
-    ft.dwHighDateTime = li.HighPart;
-    FileTimeToSystemTime(&ft, &st);
-
-    pt->year = st.wYear;
-    pt->mon = st.wMonth-1;
-    pt->day = st.wDay;
-    pt->wday = st.wDayOfWeek;
-
-    pt->hour = st.wHour;
-    pt->min = st.wMinute;
-    pt->sec = st.wSecond;
-    pt->msec = tv->msec;
-
-    return PJ_SUCCESS;
-}
-
-/**
- * Encode parsed time to time value.
- */
-PJ_DEF(pj_status_t) pj_time_encode(const pj_parsed_time *pt, pj_time_val *tv)
-{
-    SYSTEMTIME st;
-    FILETIME ft;
-    LARGE_INTEGER li;
-
-    pj_bzero(&st, sizeof(st));
-    st.wYear = (pj_uint16_t) pt->year;
-    st.wMonth = (pj_uint16_t) (pt->mon + 1);
-    st.wDay = (pj_uint16_t) pt->day;
-    st.wHour = (pj_uint16_t) pt->hour;
-    st.wMinute = (pj_uint16_t) pt->min;
-    st.wSecond = (pj_uint16_t) pt->sec;
-    st.wMilliseconds = (pj_uint16_t) pt->msec;
-    
-    SystemTimeToFileTime(&st, &ft);
-
-    li.LowPart = ft.dwLowDateTime;
-    li.HighPart = ft.dwHighDateTime;
-    li.QuadPart /= SECS_TO_FT_MULT;
-    li.QuadPart -= base_time.QuadPart;
-
-    tv->sec = li.LowPart;
-    tv->msec = st.wMilliseconds;
-
-    return PJ_SUCCESS;
-}
-
-/**
- * Convert local time to GMT.
- */
-PJ_DEF(pj_status_t) pj_time_local_to_gmt(pj_time_val *tv);
-
-/**
- * Convert GMT to local time.
- */
-PJ_DEF(pj_status_t) pj_time_gmt_to_local(pj_time_val *tv);
-
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select_symbian.cpp
deleted file mode 100644
index 48170ff6d014141c1914aa352a001d1e17eaf021..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select_symbian.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/* $Id: sock_select_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pj/sock_select.h>
-#include <pj/array.h>
-#include <pj/assert.h>
-#include <pj/os.h>
-#include "os_symbian.h"
-
-
-struct symbian_fd_set {
-    unsigned	 count;
-    CPjSocket	*sock[PJ_IOQUEUE_MAX_HANDLES];
-};
-
-
-PJ_DEF (void) PJ_FD_ZERO (pj_fd_set_t *fdsetp)
-{
-    symbian_fd_set *fds = (symbian_fd_set *) fdsetp;
-    fds->count = 0;
-}
-
-
-PJ_DEF (void) PJ_FD_SET (pj_sock_t fd, pj_fd_set_t *fdsetp)
-{
-    symbian_fd_set *fds = (symbian_fd_set *) fdsetp;
-
-    PJ_ASSERT_ON_FAIL (fds->count < PJ_IOQUEUE_MAX_HANDLES, return);
-    fds->sock[fds->count++] = (CPjSocket*) fd;
-}
-
-
-PJ_DEF (void) PJ_FD_CLR (pj_sock_t fd, pj_fd_set_t *fdsetp)
-{
-    symbian_fd_set *fds = (symbian_fd_set *) fdsetp;
-    unsigned i;
-
-    for (i=0; i<fds->count; ++i) {
-        if (fds->sock[i] == (CPjSocket*) fd) {
-            pj_array_erase (fds->sock, sizeof (fds->sock[0]), fds->count, i);
-            --fds->count;
-            return;
-        }
-    }
-}
-
-
-PJ_DEF (pj_bool_t) PJ_FD_ISSET (pj_sock_t fd, const pj_fd_set_t *fdsetp)
-{
-    symbian_fd_set *fds = (symbian_fd_set *) fdsetp;
-    unsigned i;
-
-    for (i=0; i<fds->count; ++i) {
-        if (fds->sock[i] == (CPjSocket*) fd) {
-            return PJ_TRUE;
-        }
-    }
-
-    return PJ_FALSE;
-}
-
-PJ_DEF (pj_size_t) PJ_FD_COUNT (const pj_fd_set_t *fdsetp)
-{
-    symbian_fd_set *fds = (symbian_fd_set *) fdsetp;
-    return fds->count;
-}
-
-
-PJ_DEF (int) pj_sock_select (int n,
-                             pj_fd_set_t *readfds,
-                             pj_fd_set_t *writefds,
-                             pj_fd_set_t *exceptfds,
-                             const pj_time_val *timeout)
-{
-    CPjTimeoutTimer *pjTimer;
-    unsigned i;
-
-    PJ_UNUSED_ARG (n);
-    PJ_UNUSED_ARG (writefds);
-    PJ_UNUSED_ARG (exceptfds);
-
-    if (timeout) {
-        pjTimer = PjSymbianOS::Instance()->SelectTimeoutTimer();
-        pjTimer->StartTimer (timeout->sec*1000 + timeout->msec);
-
-    } else {
-        pjTimer = NULL;
-    }
-
-    /* Scan for readable sockets */
-
-    if (readfds) {
-        symbian_fd_set *fds = (symbian_fd_set *) readfds;
-
-        do {
-            /* Scan sockets for readily available data */
-            for (i=0; i<fds->count; ++i) {
-                CPjSocket *pjsock = fds->sock[i];
-
-                if (pjsock->Reader()) {
-                    if (pjsock->Reader()->HasData() && !pjsock->Reader()->IsActive()) {
-
-                        /* Found socket with data ready */
-                        PJ_FD_ZERO (readfds);
-                        PJ_FD_SET ( (pj_sock_t) pjsock, readfds);
-
-                        /* Cancel timer, if any */
-
-                        if (pjTimer) {
-                            pjTimer->Cancel();
-                        }
-
-                        /* Clear writable and exception fd_set */
-                        if (writefds)
-                            PJ_FD_ZERO (writefds);
-
-                        if (exceptfds)
-                            PJ_FD_ZERO (exceptfds);
-
-                        return 1;
-
-                    } else if (!pjsock->Reader()->IsActive())
-                        pjsock->Reader()->StartRecvFrom();
-
-                } else {
-                    pjsock->CreateReader();
-                    pjsock->Reader()->StartRecvFrom();
-                }
-            }
-
-            PjSymbianOS::Instance()->WaitForActiveObjects();
-
-        } while (pjTimer==NULL || !pjTimer->HasTimedOut());
-    }
-
-
-    /* Timeout */
-
-    if (readfds)
-        PJ_FD_ZERO (readfds);
-
-    if (writefds)
-        PJ_FD_ZERO (writefds);
-
-    if (exceptfds)
-        PJ_FD_ZERO (exceptfds);
-
-    return 0;
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_symbian.cpp
deleted file mode 100644
index 29858afab1d4485e6f476eb7c5d506f7ca57bfe1..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_symbian.cpp
+++ /dev/null
@@ -1,1045 +0,0 @@
-/* $Id: sock_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pj/sock.h>
-#include <pj/addr_resolv.h>
-#include <pj/assert.h>
-#include <pj/errno.h>
-#include <pj/os.h>
-#include <pj/string.h>
-#include <pj/unicode.h>
-
-#include "os_symbian.h"
-
-
-/*
- * Address families.
- */
-const pj_uint16_t PJ_AF_UNSPEC	= KAFUnspec;
-const pj_uint16_t PJ_AF_UNIX	= 0xFFFF;
-const pj_uint16_t PJ_AF_INET	= KAfInet;
-const pj_uint16_t PJ_AF_INET6	= KAfInet6;
-const pj_uint16_t PJ_AF_PACKET	= 0xFFFF;
-const pj_uint16_t PJ_AF_IRDA	= 0xFFFF;
-
-/*
- * Socket types conversion.
- * The values here are indexed based on pj_sock_type
- */
-const pj_uint16_t PJ_SOCK_STREAM= KSockStream;
-const pj_uint16_t PJ_SOCK_DGRAM	= KSockDatagram;
-const pj_uint16_t PJ_SOCK_RAW	= 0xFFFF;
-const pj_uint16_t PJ_SOCK_RDM	= 0xFFFF;
-
-/* setsockop() is not really supported. */
-const pj_uint16_t PJ_SOL_SOCKET	= 0xFFFF;
-const pj_uint16_t PJ_SOL_IP	= 0xFFFF;
-const pj_uint16_t PJ_SOL_TCP	= 0xFFFF;
-const pj_uint16_t PJ_SOL_UDP	= 0xFFFF;
-const pj_uint16_t PJ_SOL_IPV6	= 0xFFFF;
-
-/* TOS */
-const pj_uint16_t PJ_IP_TOS		= 0;
-const pj_uint16_t PJ_IPTOS_LOWDELAY	= 0;
-const pj_uint16_t PJ_IPTOS_THROUGHPUT	= 0;
-const pj_uint16_t PJ_IPTOS_RELIABILITY	= 0;
-const pj_uint16_t PJ_IPTOS_MINCOST	= 0;
-
-/* ioctl() is also not supported. */
-const pj_uint16_t PJ_SO_TYPE    = 0xFFFF;
-const pj_uint16_t PJ_SO_RCVBUF  = 0xFFFF;
-const pj_uint16_t PJ_SO_SNDBUF  = 0xFFFF;
-
-/* IP multicast is also not supported. */
-const pj_uint16_t PJ_IP_MULTICAST_IF    = 0xFFFF;
-const pj_uint16_t PJ_IP_MULTICAST_TTL   = 0xFFFF;
-const pj_uint16_t PJ_IP_MULTICAST_LOOP  = 0xFFFF;
-const pj_uint16_t PJ_IP_ADD_MEMBERSHIP  = 0xFFFF;
-const pj_uint16_t PJ_IP_DROP_MEMBERSHIP = 0xFFFF;
-
-/* Flags */
-const int PJ_MSG_OOB	     = 0;
-const int PJ_MSG_PEEK	     = KSockReadPeek;
-const int PJ_MSG_DONTROUTE   = 0;
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// CPjSocket implementation.
-// (declaration is in os_symbian.h)
-//
-
-CPjSocket::~CPjSocket()
-{
-    DestroyReader();
-    sock_.Close();
-}
-
-
-// Create socket reader.
-CPjSocketReader *CPjSocket::CreateReader (unsigned max_len)
-{
-    pj_assert (sockReader_ == NULL);
-    return sockReader_ = CPjSocketReader::NewL (*this, max_len);
-}
-
-// Delete socket reader when it's not wanted.
-void CPjSocket::DestroyReader()
-{
-    if (sockReader_) {
-        sockReader_->Cancel();
-        delete sockReader_;
-        sockReader_ = NULL;
-    }
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// CPjSocketReader implementation
-// (declaration in os_symbian.h)
-//
-
-
-CPjSocketReader::CPjSocketReader (CPjSocket &sock)
-        : CActive (EPriorityStandard),
-        sock_ (sock), buffer_ (NULL, 0), readCb_ (NULL), key_ (NULL)
-{
-}
-
-
-void CPjSocketReader::ConstructL (unsigned max_len)
-{
-    TProtocolDesc aProtocol;
-    TInt err;
-
-    err = sock_.Socket().Info (aProtocol);
-    User::LeaveIfError (err);
-
-    isDatagram_ = (aProtocol.iSockType == KSockDatagram);
-
-    TUint8 *ptr = new TUint8[max_len];
-    buffer_.Set (ptr, 0, (TInt) max_len);
-    CActiveScheduler::Add (this);
-}
-
-CPjSocketReader *CPjSocketReader::NewL (CPjSocket &sock, unsigned max_len)
-{
-    CPjSocketReader *self = new (ELeave) CPjSocketReader (sock);
-    CleanupStack::PushL (self);
-    self->ConstructL (max_len);
-    CleanupStack::Pop (self);
-
-    return self;
-}
-
-
-CPjSocketReader::~CPjSocketReader()
-{
-    const TUint8 *data = buffer_.Ptr();
-    delete [] data;
-}
-
-void CPjSocketReader::StartRecv (void (*cb) (void *key),
-                                 void *key,
-                                 TDes8 *aDesc,
-                                 TUint flags)
-{
-    StartRecvFrom (cb, key, aDesc, flags, NULL);
-}
-
-void CPjSocketReader::StartRecvFrom (void (*cb) (void *key),
-                                     void *key,
-                                     TDes8 *aDesc,
-                                     TUint flags,
-                                     TSockAddr *fromAddr)
-{
-    readCb_ = cb;
-    key_ = key;
-
-    if (aDesc == NULL) aDesc = &buffer_;
-
-    if (fromAddr == NULL) fromAddr = &recvAddr_;
-
-    sock_.Socket().RecvFrom (*aDesc, *fromAddr, flags, iStatus);
-
-    SetActive();
-}
-
-void CPjSocketReader::DoCancel()
-{
-    sock_.Socket().CancelRecv();
-}
-
-void CPjSocketReader::RunL()
-{
-    void (*old_cb) (void *key) = readCb_;
-    void *old_key = key_;
-
-    readCb_ = NULL;
-    key_ = NULL;
-
-    if (old_cb) {
-        (*old_cb) (old_key);
-    }
-}
-
-// Append data to aDesc, up to aDesc's maximum size.
-// If socket is datagram based, buffer_ will be clared.
-void CPjSocketReader::ReadData (TDes8 &aDesc, TInetAddr *addr)
-{
-    if (isDatagram_)
-        aDesc.Zero();
-
-    if (buffer_.Length() == 0)
-        return;
-
-    TInt size_to_copy = aDesc.MaxLength() - aDesc.Length();
-
-    if (size_to_copy > buffer_.Length())
-        size_to_copy = buffer_.Length();
-
-    aDesc.Append (buffer_.Ptr(), size_to_copy);
-
-    if (isDatagram_)
-        buffer_.Zero();
-    else
-        buffer_.Delete (0, size_to_copy);
-
-    if (addr)
-        *addr = recvAddr_;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// PJLIB's sock.h implementation
-//
-
-/*
- * Convert 16-bit value from network byte order to host byte order.
- */
-PJ_DEF (pj_uint16_t) pj_ntohs (pj_uint16_t netshort)
-{
-#if PJ_IS_LITTLE_ENDIAN
-    return pj_swap16 (netshort);
-#else
-    return netshort;
-#endif
-}
-
-/*
- * Convert 16-bit value from host byte order to network byte order.
- */
-PJ_DEF (pj_uint16_t) pj_htons (pj_uint16_t hostshort)
-{
-#if PJ_IS_LITTLE_ENDIAN
-    return pj_swap16 (hostshort);
-#else
-    return hostshort;
-#endif
-}
-
-/*
- * Convert 32-bit value from network byte order to host byte order.
- */
-PJ_DEF (pj_uint32_t) pj_ntohl (pj_uint32_t netlong)
-{
-#if PJ_IS_LITTLE_ENDIAN
-    return pj_swap32 (netlong);
-#else
-    return netlong;
-#endif
-}
-
-/*
- * Convert 32-bit value from host byte order to network byte order.
- */
-PJ_DEF (pj_uint32_t) pj_htonl (pj_uint32_t hostlong)
-{
-#if PJ_IS_LITTLE_ENDIAN
-    return pj_swap32 (hostlong);
-#else
-    return netlong;
-#endif
-}
-
-/*
- * Convert an Internet host address given in network byte order
- * to string in standard numbers and dots notation.
- */
-PJ_DEF (char*) pj_inet_ntoa (pj_in_addr inaddr)
-{
-    static char str8[PJ_INET_ADDRSTRLEN];
-    TBuf<PJ_INET_ADDRSTRLEN> str16 (0);
-
-    /* (Symbian IP address is in host byte order) */
-    TInetAddr temp_addr ( (TUint32) pj_ntohl (inaddr.s_addr), (TUint) 0);
-    temp_addr.Output (str16);
-
-    return pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(),
-                                str8, sizeof (str8));
-}
-
-/*
- * This function converts the Internet host address cp from the standard
- * numbers-and-dots notation into binary data and stores it in the structure
- * that inp points to.
- */
-PJ_DEF (int) pj_inet_aton (const pj_str_t *cp, struct pj_in_addr *inp)
-{
-    enum { MAXIPLEN = PJ_INET_ADDRSTRLEN };
-
-    /* Initialize output with PJ_INADDR_NONE.
-     * Some apps relies on this instead of the return value
-     * (and anyway the return value is quite confusing!)
-     */
-    inp->s_addr = PJ_INADDR_NONE;
-
-    /* Caution:
-     *	this function might be called with cp->slen >= 16
-     *  (i.e. when called with hostname to check if it's an IP addr).
-     */
-    PJ_ASSERT_RETURN (cp && cp->slen && inp, 0);
-
-    if (cp->slen >= 16) {
-        return 0;
-    }
-
-    char tempaddr8[MAXIPLEN];
-
-    pj_memcpy (tempaddr8, cp->ptr, cp->slen);
-    tempaddr8[cp->slen] = '\0';
-
-    wchar_t tempaddr16[MAXIPLEN];
-    pj_ansi_to_unicode (tempaddr8, pj_ansi_strlen (tempaddr8),
-                        tempaddr16, sizeof (tempaddr16));
-
-    TBuf<MAXIPLEN> ip_addr ( (const TText*) tempaddr16);
-
-    TInetAddr addr;
-    addr.Init (KAfInet);
-
-    if (addr.Input (ip_addr) == KErrNone) {
-        /* Success (Symbian IP address is in host byte order) */
-        inp->s_addr = pj_htonl (addr.Address());
-        return 1;
-    } else {
-        /* Error */
-        return 0;
-    }
-}
-
-/*
- * Convert text to IPv4/IPv6 address.
- */
-PJ_DEF (pj_status_t) pj_inet_pton (int af, const pj_str_t *src, void *dst)
-{
-    char tempaddr[PJ_INET6_ADDRSTRLEN];
-
-    PJ_ASSERT_RETURN (af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EINVAL);
-    PJ_ASSERT_RETURN (src && src->slen && dst, PJ_EINVAL);
-
-    /* Initialize output with PJ_IN_ADDR_NONE for IPv4 (to be
-     * compatible with pj_inet_aton()
-     */
-
-    if (af==PJ_AF_INET) {
-        ( (pj_in_addr*) dst)->s_addr = PJ_INADDR_NONE;
-    }
-
-    /* Caution:
-     *	this function might be called with cp->slen >= 46
-     *  (i.e. when called with hostname to check if it's an IP addr).
-     */
-    if (src->slen >= PJ_INET6_ADDRSTRLEN) {
-        return PJ_ENAMETOOLONG;
-    }
-
-    pj_memcpy (tempaddr, src->ptr, src->slen);
-
-    tempaddr[src->slen] = '\0';
-
-
-    wchar_t tempaddr16[PJ_INET6_ADDRSTRLEN];
-    pj_ansi_to_unicode (tempaddr, pj_ansi_strlen (tempaddr),
-                        tempaddr16, sizeof (tempaddr16));
-
-    TBuf<PJ_INET6_ADDRSTRLEN> ip_addr ( (const TText*) tempaddr16);
-
-    TInetAddr addr;
-    addr.Init (KAfInet6);
-
-    if (addr.Input (ip_addr) == KErrNone) {
-        if (af==PJ_AF_INET) {
-            /* Success (Symbian IP address is in host byte order) */
-            pj_uint32_t ip = pj_htonl (addr.Address());
-            pj_memcpy (dst, &ip, 4);
-        } else if (af==PJ_AF_INET6) {
-            const TIp6Addr & ip6 = addr.Ip6Address();
-            pj_memcpy (dst, ip6.u.iAddr8, 16);
-        } else {
-            pj_assert (!"Unexpected!");
-            return PJ_EBUG;
-        }
-
-        return PJ_SUCCESS;
-    } else {
-        /* Error */
-        return PJ_EINVAL;
-    }
-}
-
-/*
- * Convert IPv4/IPv6 address to text.
- */
-PJ_DEF (pj_status_t) pj_inet_ntop (int af, const void *src,
-                                   char *dst, int size)
-
-{
-    PJ_ASSERT_RETURN (src && dst && size, PJ_EINVAL);
-
-    *dst = '\0';
-
-    if (af==PJ_AF_INET) {
-
-        TBuf<PJ_INET_ADDRSTRLEN> str16;
-        pj_in_addr inaddr;
-
-        if (size < PJ_INET_ADDRSTRLEN)
-            return PJ_ETOOSMALL;
-
-        pj_memcpy (&inaddr, src, 4);
-
-        /* Symbian IP address is in host byte order */
-        TInetAddr temp_addr ( (TUint32) pj_ntohl (inaddr.s_addr), (TUint) 0);
-
-        temp_addr.Output (str16);
-
-        pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(),
-                             dst, size);
-
-        return PJ_SUCCESS;
-
-    } else if (af==PJ_AF_INET6) {
-        TBuf<PJ_INET6_ADDRSTRLEN> str16;
-
-        if (size < PJ_INET6_ADDRSTRLEN)
-            return PJ_ETOOSMALL;
-
-        TIp6Addr ip6;
-
-        pj_memcpy (ip6.u.iAddr8, src, 16);
-
-        TInetAddr temp_addr (ip6, (TUint) 0);
-
-        temp_addr.Output (str16);
-
-        pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(),
-                             dst, size);
-
-        return PJ_SUCCESS;
-
-    } else {
-        pj_assert (!"Unsupport address family");
-        return PJ_EINVAL;
-    }
-
-}
-
-/*
- * Get hostname.
- */
-PJ_DEF (const pj_str_t*) pj_gethostname (void)
-{
-    static char buf[PJ_MAX_HOSTNAME];
-    static pj_str_t hostname;
-
-    PJ_CHECK_STACK();
-
-    if (hostname.ptr == NULL) {
-        RHostResolver &resv = PjSymbianOS::Instance()->GetResolver (PJ_AF_INET);
-        TRequestStatus reqStatus;
-        THostName tmpName;
-
-        // Return empty hostname if access point is marked as down by app.
-        PJ_SYMBIAN_CHECK_CONNECTION2 (&hostname);
-
-        resv.GetHostName (tmpName, reqStatus);
-        User::WaitForRequest (reqStatus);
-
-        hostname.ptr = pj_unicode_to_ansi ( (const wchar_t*) tmpName.Ptr(), tmpName.Length(),
-                                            buf, sizeof (buf));
-        hostname.slen = tmpName.Length();
-    }
-
-    return &hostname;
-}
-
-/*
- * Create new socket/endpoint for communication and returns a descriptor.
- */
-PJ_DEF (pj_status_t) pj_sock_socket (int af,
-                                     int type,
-                                     int proto,
-                                     pj_sock_t *p_sock)
-{
-    TInt rc;
-
-    PJ_CHECK_STACK();
-
-    /* Sanity checks. */
-    PJ_ASSERT_RETURN (p_sock!=NULL, PJ_EINVAL);
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    /* Set proto if none is specified. */
-
-    if (proto == 0) {
-        if (type == pj_SOCK_STREAM())
-            proto = KProtocolInetTcp;
-        else if (type == pj_SOCK_DGRAM())
-            proto = KProtocolInetUdp;
-    }
-
-    /* Create Symbian RSocket */
-    RSocket rSock;
-
-    if (PjSymbianOS::Instance()->Connection())
-        rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(),
-                         af, type, proto,
-                         *PjSymbianOS::Instance()->Connection());
-    else
-        rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(),
-                         af, type, proto);
-
-    if (rc != KErrNone)
-        return PJ_RETURN_OS_ERROR (rc);
-
-
-    /* Wrap Symbian RSocket into PJLIB's CPjSocket, and return to caller */
-    CPjSocket *pjSock = new CPjSocket (af, rSock);
-
-    *p_sock = (pj_sock_t) pjSock;
-
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Bind socket.
- */
-PJ_DEF (pj_status_t) pj_sock_bind (pj_sock_t sock,
-                                   const pj_sockaddr_t *addr,
-                                   int len)
-{
-    pj_status_t status;
-    TInt rc;
-
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (sock != 0, PJ_EINVAL);
-    PJ_ASSERT_RETURN (addr && len>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL);
-
-    // Convert PJLIB's pj_sockaddr into Symbian's TInetAddr
-    TInetAddr inetAddr;
-    status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) addr, len, inetAddr);
-
-    if (status != PJ_SUCCESS)
-        return status;
-
-    // Get the RSocket instance
-    RSocket &rSock = ( (CPjSocket*) sock)->Socket();
-
-    // Bind
-    rc = rSock.Bind (inetAddr);
-
-    return (rc==KErrNone) ? PJ_SUCCESS : PJ_RETURN_OS_ERROR (rc);
-}
-
-
-/*
- * Bind socket.
- */
-PJ_DEF (pj_status_t) pj_sock_bind_in (pj_sock_t sock,
-                                      pj_uint32_t addr32,
-                                      pj_uint16_t port)
-{
-    pj_sockaddr_in addr;
-
-    PJ_CHECK_STACK();
-
-    pj_bzero (&addr, sizeof (addr));
-    addr.sin_family = PJ_AF_INET;
-    addr.sin_addr.s_addr = pj_htonl (addr32);
-    addr.sin_port = pj_htons (port);
-
-    return pj_sock_bind (sock, &addr, sizeof (pj_sockaddr_in));
-}
-
-
-/*
- * Close socket.
- */
-PJ_DEF (pj_status_t) pj_sock_close (pj_sock_t sock)
-{
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (sock != 0, PJ_EINVAL);
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-
-    // This will close the socket.
-    delete pjSock;
-
-    return PJ_SUCCESS;
-}
-
-/*
- * Get remote's name.
- */
-PJ_DEF (pj_status_t) pj_sock_getpeername (pj_sock_t sock,
-        pj_sockaddr_t *addr,
-        int *namelen)
-{
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (sock && addr && namelen &&
-                      *namelen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL);
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-    RSocket &rSock = pjSock->Socket();
-
-    // Socket must be connected.
-    PJ_ASSERT_RETURN (pjSock->IsConnected(), PJ_EINVALIDOP);
-
-    TInetAddr inetAddr;
-    rSock.RemoteName (inetAddr);
-
-    return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) addr, namelen);
-}
-
-/*
- * Get socket name.
- */
-PJ_DEF (pj_status_t) pj_sock_getsockname (pj_sock_t sock,
-        pj_sockaddr_t *addr,
-        int *namelen)
-{
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (sock && addr && namelen &&
-                      *namelen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL);
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-    RSocket &rSock = pjSock->Socket();
-
-    TInetAddr inetAddr;
-    rSock.LocalName (inetAddr);
-
-    return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) addr, namelen);
-}
-
-/*
- * Send data
- */
-PJ_DEF (pj_status_t) pj_sock_send (pj_sock_t sock,
-                                   const void *buf,
-                                   pj_ssize_t *len,
-                                   unsigned flags)
-{
-    PJ_CHECK_STACK();
-    PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL);
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-    RSocket &rSock = pjSock->Socket();
-
-    // send() should only be called to connected socket
-    PJ_ASSERT_RETURN (pjSock->IsConnected(), PJ_EINVALIDOP);
-
-    TPtrC8 data ( (const TUint8*) buf, (TInt) *len);
-    TRequestStatus reqStatus;
-    TSockXfrLength sentLen;
-
-    rSock.Send (data, flags, reqStatus, sentLen);
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus.Int() ==KErrNone) {
-        //*len = (TInt) sentLen.Length();
-        return PJ_SUCCESS;
-    } else
-        return PJ_RETURN_OS_ERROR (reqStatus.Int());
-}
-
-
-/*
- * Send data.
- */
-PJ_DEF (pj_status_t) pj_sock_sendto (pj_sock_t sock,
-                                     const void *buf,
-                                     pj_ssize_t *len,
-                                     unsigned flags,
-                                     const pj_sockaddr_t *to,
-                                     int tolen)
-{
-    pj_status_t status;
-
-    PJ_CHECK_STACK();
-    PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL);
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-    RSocket &rSock = pjSock->Socket();
-
-    // Only supports AF_INET for now
-    PJ_ASSERT_RETURN (tolen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL);
-
-    TInetAddr inetAddr;
-    status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) to, tolen, inetAddr);
-
-    if (status != PJ_SUCCESS)
-        return status;
-
-    TPtrC8 data ( (const TUint8*) buf, (TInt) *len);
-
-    TRequestStatus reqStatus;
-
-    TSockXfrLength sentLen;
-
-    rSock.SendTo (data, inetAddr, flags, reqStatus, sentLen);
-
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus.Int() ==KErrNone) {
-        //For some reason TSockXfrLength is not returning correctly!
-        //*len = (TInt) sentLen.Length();
-        return PJ_SUCCESS;
-    } else
-        return PJ_RETURN_OS_ERROR (reqStatus.Int());
-}
-
-/*
- * Receive data.
- */
-PJ_DEF (pj_status_t) pj_sock_recv (pj_sock_t sock,
-                                   void *buf,
-                                   pj_ssize_t *len,
-                                   unsigned flags)
-{
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL);
-    PJ_ASSERT_RETURN (*len > 0, PJ_EINVAL);
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-    RSocket &rSock = pjSock->Socket();
-
-    if (pjSock->Reader()) {
-        CPjSocketReader *reader = pjSock->Reader();
-
-        while (reader->IsActive() && !reader->HasData()) {
-            User::WaitForAnyRequest();
-        }
-
-        if (reader->HasData()) {
-            TPtr8 data ( (TUint8*) buf, (TInt) *len);
-            TInetAddr inetAddr;
-
-            reader->ReadData (data, &inetAddr);
-
-            *len = data.Length();
-            return PJ_SUCCESS;
-        }
-    }
-
-    TRequestStatus reqStatus;
-
-    TSockXfrLength recvLen;
-    TPtr8 data ( (TUint8*) buf, (TInt) *len, (TInt) *len);
-
-    rSock.Recv (data, flags, reqStatus, recvLen);
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus == KErrNone) {
-        //*len = (TInt)recvLen.Length();
-        *len = data.Length();
-        return PJ_SUCCESS;
-    } else {
-        *len = -1;
-        return PJ_RETURN_OS_ERROR (reqStatus.Int());
-    }
-}
-
-/*
- * Receive data.
- */
-PJ_DEF (pj_status_t) pj_sock_recvfrom (pj_sock_t sock,
-                                       void *buf,
-                                       pj_ssize_t *len,
-                                       unsigned flags,
-                                       pj_sockaddr_t *from,
-                                       int *fromlen)
-{
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (sock && buf && len && from && fromlen, PJ_EINVAL);
-    PJ_ASSERT_RETURN (*len > 0, PJ_EINVAL);
-    PJ_ASSERT_RETURN (*fromlen >= (int) sizeof (pj_sockaddr_in), PJ_EINVAL);
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-    RSocket &rSock = pjSock->Socket();
-
-    if (pjSock->Reader()) {
-        CPjSocketReader *reader = pjSock->Reader();
-
-        while (reader->IsActive() && !reader->HasData()) {
-            User::WaitForAnyRequest();
-        }
-
-        if (reader->HasData()) {
-            TPtr8 data ( (TUint8*) buf, (TInt) *len);
-            TInetAddr inetAddr;
-
-            reader->ReadData (data, &inetAddr);
-
-            *len = data.Length();
-
-            if (from && fromlen) {
-                return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) from,
-                                             fromlen);
-            } else {
-                return PJ_SUCCESS;
-            }
-        }
-    }
-
-    TInetAddr inetAddr;
-
-    TRequestStatus reqStatus;
-    TSockXfrLength recvLen;
-    TPtr8 data ( (TUint8*) buf, (TInt) *len, (TInt) *len);
-
-    rSock.RecvFrom (data, inetAddr, flags, reqStatus, recvLen);
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus == KErrNone) {
-        //*len = (TInt)recvLen.Length();
-        *len = data.Length();
-        return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) from, fromlen);
-    } else {
-        *len = -1;
-        *fromlen = -1;
-        return PJ_RETURN_OS_ERROR (reqStatus.Int());
-    }
-}
-
-/*
- * Get socket option.
- */
-PJ_DEF (pj_status_t) pj_sock_getsockopt (pj_sock_t sock,
-        pj_uint16_t level,
-        pj_uint16_t optname,
-        void *optval,
-        int *optlen)
-{
-    // Not supported for now.
-    PJ_UNUSED_ARG (sock);
-    PJ_UNUSED_ARG (level);
-    PJ_UNUSED_ARG (optname);
-    PJ_UNUSED_ARG (optval);
-    PJ_UNUSED_ARG (optlen);
-    return PJ_EINVALIDOP;
-}
-
-/*
- * Set socket option.
- */
-PJ_DEF (pj_status_t) pj_sock_setsockopt (pj_sock_t sock,
-        pj_uint16_t level,
-        pj_uint16_t optname,
-        const void *optval,
-        int optlen)
-{
-    // Not supported for now.
-    PJ_UNUSED_ARG (sock);
-    PJ_UNUSED_ARG (level);
-    PJ_UNUSED_ARG (optname);
-    PJ_UNUSED_ARG (optval);
-    PJ_UNUSED_ARG (optlen);
-    return PJ_EINVALIDOP;
-}
-
-/*
- * Connect socket.
- */
-PJ_DEF (pj_status_t) pj_sock_connect (pj_sock_t sock,
-                                      const pj_sockaddr_t *addr,
-                                      int namelen)
-{
-    pj_status_t status;
-
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (sock && addr && namelen, PJ_EINVAL);
-    PJ_ASSERT_RETURN ( ( (pj_sockaddr*) addr)->addr.sa_family == PJ_AF_INET,
-                       PJ_EINVAL);
-
-    // Return failure if access point is marked as down by app.
-    PJ_SYMBIAN_CHECK_CONNECTION();
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-    RSocket &rSock = pjSock->Socket();
-
-    TInetAddr inetAddr;
-    TRequestStatus reqStatus;
-
-    status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) addr, namelen, inetAddr);
-
-    if (status != PJ_SUCCESS)
-        return status;
-
-    rSock.Connect (inetAddr, reqStatus);
-
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus == KErrNone) {
-        pjSock->SetConnected (true);
-        return PJ_SUCCESS;
-    } else {
-        return PJ_RETURN_OS_ERROR (reqStatus.Int());
-    }
-}
-
-
-/*
- * Shutdown socket.
- */
-#if PJ_HAS_TCP
-PJ_DEF (pj_status_t) pj_sock_shutdown (pj_sock_t sock,
-                                       int how)
-{
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (sock, PJ_EINVAL);
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-    RSocket &rSock = pjSock->Socket();
-
-    RSocket::TShutdown aHow;
-
-    if (how == PJ_SD_RECEIVE)
-        aHow = RSocket::EStopInput;
-    else if (how == PJ_SHUT_WR)
-        aHow = RSocket::EStopOutput;
-    else
-        aHow = RSocket::ENormal;
-
-    TRequestStatus reqStatus;
-
-    rSock.Shutdown (aHow, reqStatus);
-
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus == KErrNone) {
-        return PJ_SUCCESS;
-    } else {
-        return PJ_RETURN_OS_ERROR (reqStatus.Int());
-    }
-}
-
-/*
- * Start listening to incoming connections.
- */
-PJ_DEF (pj_status_t) pj_sock_listen (pj_sock_t sock,
-                                     int backlog)
-{
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (sock && backlog, PJ_EINVAL);
-
-    CPjSocket *pjSock = (CPjSocket*) sock;
-    RSocket &rSock = pjSock->Socket();
-
-    TInt rc = rSock.Listen ( (TUint) backlog);
-
-    if (rc == KErrNone) {
-        return PJ_SUCCESS;
-    } else {
-        return PJ_RETURN_OS_ERROR (rc);
-    }
-}
-
-/*
- * Accept incoming connections
- */
-PJ_DEF (pj_status_t) pj_sock_accept (pj_sock_t serverfd,
-                                     pj_sock_t *newsock,
-                                     pj_sockaddr_t *addr,
-                                     int *addrlen)
-{
-    PJ_CHECK_STACK();
-
-    PJ_ASSERT_RETURN (serverfd && newsock, PJ_EINVAL);
-
-    CPjSocket *pjSock = (CPjSocket*) serverfd;
-    RSocket &rSock = pjSock->Socket();
-
-    // Create a 'blank' socket
-    RSocket newSock;
-    newSock.Open (PjSymbianOS::Instance()->SocketServ());
-
-    // Call Accept()
-    TRequestStatus reqStatus;
-
-    rSock.Accept (newSock, reqStatus);
-    User::WaitForRequest (reqStatus);
-
-    if (reqStatus != KErrNone) {
-        return PJ_RETURN_OS_ERROR (reqStatus.Int());
-    }
-
-    // Create PJ socket
-    CPjSocket *newPjSock = new CPjSocket (pjSock->GetAf(), newSock);
-
-    newPjSock->SetConnected (true);
-
-    *newsock = (pj_sock_t) newPjSock;
-
-    if (addr && addrlen) {
-        return pj_sock_getpeername (*newsock, addr, addrlen);
-    }
-
-    return PJ_SUCCESS;
-}
-
-#endif	/* PJ_HAS_TCP */
-
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer_symbian.cpp b/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer_symbian.cpp
deleted file mode 100644
index 4aff5f9564eed554d9d068ea04594cd4c5a7526d..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer_symbian.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-/* $Id: timer_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pj/timer.h>
-#include <pj/pool.h>
-#include <pj/assert.h>
-#include <pj/errno.h>
-#include <pj/lock.h>
-
-#include "os_symbian.h"
-
-
-#define DEFAULT_MAX_TIMED_OUT_PER_POLL  (64)
-
-
-/**
- * The implementation of timer heap.
- */
-
-struct pj_timer_heap_t {
-    /** Maximum size of the heap. */
-    pj_size_t max_size;
-
-    /** Current size of the heap. */
-    pj_size_t cur_size;
-
-    /** Max timed out entries to process per poll. */
-    unsigned max_entries_per_poll;
-};
-
-
-//////////////////////////////////////////////////////////////////////////////
-/**
- * Active object for each timer entry.
- */
-
-class CPjTimerEntry : public CActive
-{
-
-    public:
-        static CPjTimerEntry* NewL (pj_timer_heap_t *timer_heap,
-                                    pj_timer_entry *entry,
-                                    const pj_time_val *delay);
-
-        ~CPjTimerEntry();
-
-        virtual void RunL();
-        virtual void DoCancel();
-
-    private:
-        pj_timer_heap_t *timer_heap_;
-        pj_timer_entry  *entry_;
-        RTimer	     rtimer_;
-
-        CPjTimerEntry (pj_timer_heap_t *timer_heap, pj_timer_entry *entry);
-        void ConstructL (const pj_time_val *delay);
-};
-
-
-CPjTimerEntry::CPjTimerEntry (pj_timer_heap_t *timer_heap,
-                              pj_timer_entry *entry)
-        : CActive (PJ_SYMBIAN_TIMER_PRIORITY), timer_heap_ (timer_heap), entry_ (entry)
-{
-}
-
-CPjTimerEntry::~CPjTimerEntry()
-{
-    Cancel();
-    rtimer_.Close();
-}
-
-void CPjTimerEntry::ConstructL (const pj_time_val *delay)
-{
-    rtimer_.CreateLocal();
-    CActiveScheduler::Add (this);
-
-    pj_int32_t interval = PJ_TIME_VAL_MSEC (*delay) * 1000;
-
-    if (interval < 0) {
-        interval = 0;
-    }
-
-    rtimer_.After (iStatus, interval);
-
-    SetActive();
-}
-
-CPjTimerEntry* CPjTimerEntry::NewL (pj_timer_heap_t *timer_heap,
-                                    pj_timer_entry *entry,
-                                    const pj_time_val *delay)
-{
-    CPjTimerEntry *self = new CPjTimerEntry (timer_heap, entry);
-    CleanupStack::PushL (self);
-    self->ConstructL (delay);
-    CleanupStack::Pop (self);
-
-    return self;
-}
-
-void CPjTimerEntry::RunL()
-{
-    --timer_heap_->cur_size;
-    entry_->_timer_id = NULL;
-    entry_->cb (timer_heap_, entry_);
-
-    // Finger's crossed!
-    delete this;
-}
-
-void CPjTimerEntry::DoCancel()
-{
-    rtimer_.Cancel();
-}
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-
-/*
- * Calculate memory size required to create a timer heap.
- */
-PJ_DEF (pj_size_t) pj_timer_heap_mem_size (pj_size_t count)
-{
-    return /* size of the timer heap itself: */
-        sizeof (pj_timer_heap_t) +
-        /* size of each entry: */
-        (count+2) * (sizeof (pj_timer_entry*) +sizeof (pj_timer_id_t)) +
-        /* lock, pool etc: */
-        132;
-}
-
-/*
- * Create a new timer heap.
- */
-PJ_DEF (pj_status_t) pj_timer_heap_create (pj_pool_t *pool,
-        pj_size_t size,
-        pj_timer_heap_t **p_heap)
-{
-    pj_timer_heap_t *ht;
-
-    PJ_ASSERT_RETURN (pool && p_heap, PJ_EINVAL);
-
-    *p_heap = NULL;
-
-    /* Allocate timer heap data structure from the pool */
-    ht = PJ_POOL_ALLOC_T (pool, pj_timer_heap_t);
-
-    if (!ht)
-        return PJ_ENOMEM;
-
-    /* Initialize timer heap sizes */
-    ht->max_size = size;
-
-    ht->cur_size = 0;
-
-    ht->max_entries_per_poll = DEFAULT_MAX_TIMED_OUT_PER_POLL;
-
-    *p_heap = ht;
-
-    return PJ_SUCCESS;
-}
-
-PJ_DEF (void) pj_timer_heap_destroy (pj_timer_heap_t *ht)
-{
-    PJ_UNUSED_ARG (ht);
-}
-
-PJ_DEF (void) pj_timer_heap_set_lock (pj_timer_heap_t *ht,
-                                      pj_lock_t *lock,
-                                      pj_bool_t auto_del)
-{
-    PJ_UNUSED_ARG (ht);
-
-    if (auto_del)
-        pj_lock_destroy (lock);
-}
-
-
-PJ_DEF (unsigned) pj_timer_heap_set_max_timed_out_per_poll (pj_timer_heap_t *ht,
-        unsigned count)
-{
-    unsigned old_count = ht->max_entries_per_poll;
-    ht->max_entries_per_poll = count;
-    return old_count;
-}
-
-PJ_DEF (pj_timer_entry*) pj_timer_entry_init (pj_timer_entry *entry,
-        int id,
-        void *user_data,
-        pj_timer_heap_callback *cb)
-{
-    pj_assert (entry && cb);
-
-    entry->_timer_id = NULL;
-    entry->id = id;
-    entry->user_data = user_data;
-    entry->cb = cb;
-
-    return entry;
-}
-
-PJ_DEF (pj_status_t) pj_timer_heap_schedule (pj_timer_heap_t *ht,
-        pj_timer_entry *entry,
-        const pj_time_val *delay)
-{
-    CPjTimerEntry *timerObj;
-
-    PJ_ASSERT_RETURN (ht && entry && delay, PJ_EINVAL);
-    PJ_ASSERT_RETURN (entry->cb != NULL, PJ_EINVAL);
-
-    /* Prevent same entry from being scheduled more than once */
-    PJ_ASSERT_RETURN (entry->_timer_id == NULL, PJ_EINVALIDOP);
-
-    timerObj = CPjTimerEntry::NewL (ht, entry, delay);
-    entry->_timer_id = (void*) timerObj;
-
-    ++ht->cur_size;
-    return PJ_SUCCESS;
-}
-
-PJ_DEF (int) pj_timer_heap_cancel (pj_timer_heap_t *ht,
-                                   pj_timer_entry *entry)
-{
-    PJ_ASSERT_RETURN (ht && entry, PJ_EINVAL);
-
-    if (entry->_timer_id != NULL) {
-        CPjTimerEntry *timerObj = (CPjTimerEntry*) entry->_timer_id;
-        timerObj->Cancel();
-        delete timerObj;
-        entry->_timer_id = NULL;
-        --ht->cur_size;
-        return 1;
-    } else {
-        return 0;
-    }
-}
-
-PJ_DEF (unsigned) pj_timer_heap_poll (pj_timer_heap_t *ht,
-                                      pj_time_val *next_delay)
-{
-    /* Polling is not necessary on Symbian, since all async activities
-     * are registered to active scheduler.
-     */
-    PJ_UNUSED_ARG (ht);
-
-    if (next_delay) {
-        next_delay->sec = 1;
-        next_delay->msec = 0;
-    }
-
-    return 0;
-}
-
-PJ_DEF (pj_size_t) pj_timer_heap_count (pj_timer_heap_t *ht)
-{
-    PJ_ASSERT_RETURN (ht, 0);
-
-    return ht->cur_size;
-}
-
-PJ_DEF (pj_status_t) pj_timer_heap_earliest_time (pj_timer_heap_t * ht,
-        pj_time_val *timeval)
-{
-    /* We don't support this! */
-    PJ_UNUSED_ARG (ht);
-
-    timeval->sec = 1;
-    timeval->msec = 0;
-
-    return PJ_SUCCESS;
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/bin/pjmedia-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjmedia/bin/pjmedia-test-x86_64-unknown-linux-gnu
deleted file mode 100755
index e79b87acc0657fe03f984fa890304b3d4ef82de7..0000000000000000000000000000000000000000
Binary files a/sflphone-common/libs/pjproject-1.0.2/pjmedia/bin/pjmedia-test-x86_64-unknown-linux-gnu and /dev/null differ
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/Jbtest.dat b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/Jbtest.dat
deleted file mode 100644
index 7646b6f597305c3e2e252b930c4ad3f458dc16b8..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/Jbtest.dat
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-###############################################################################
-# This test demonstrates situation where there is no jitter. 
-# Jitter should go the minimum configured value.
-###############################################################################
-#
-#PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG
-
-#
-###############################################################################
-# This test demonstrates situation where there is no jitter, but with
-# addition of silence compression. The jitter value should also go
-# to the minimum.
-###############################################################################
-#
-#PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG /* Start silence */ GGGGGGGGGGGGGGGGGGGGG /* End silence */ PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG
-
-#
-###############################################################################
-# This test demonstrates situation where there's about one-three packets jitter
-# in the network, without packet lost.
-###############################################################################
-#
-#PGPGPPGGPPGGPPGGGGPG PGPGPPGGPPPGGPPGGGPG PGPGPPGGPPPGGPPGGGPG PGPGPPGGPPGGPPPGGGPG PGPGPPGGPPGGPPPGGGPG
-
-#
-###############################################################################
-# Two gets two puts, no jitter
-###############################################################################
-#
-#PPGGPPGGPPGGPPGGPPGG PPGGPPGGPPGGPPGGPPGG PPGGPPGGPPGGPPGGPPGG PPGGPPGGPPGGPPGGPPGG PPGGPPGGPPGGPPGGPPGG
-
-#
-###############################################################################
-# Three gets three puts, no packet lost
-###############################################################################
-#
-#PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG
-
-
-#
-###############################################################################
-# Three gets three puts, with packet lost
-###############################################################################
-#
-#PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG /* Lost */ GGGGGGGGGG PPPGGGPPPGGGPPPGGGPGPG
-
-
-#
-###############################################################################
-# Three gets three puts, then stable
-###############################################################################
-#
-PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PPPGGGPPPGGGPPPGGGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
-
-#
-###############################################################################
-# Some jitter
-###############################################################################
-#
-#PGPGPGPGPG /*Some frames missing here*/ GG /*Some frames arrive*/ PPPG /*Normal*/ PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-auto.mak
deleted file mode 100644
index 88526c7557229514b8c39702af29d1293afeb01f..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-auto.mak
+++ /dev/null
@@ -1,109 +0,0 @@
-# pjmedia/build/os-auto.mak.  Generated from os-auto.mak.in by configure.
-
-# PJMEDIA features exclusion
-export CFLAGS +=   
-
-# Define the desired sound device backend
-# Valid values are:
-#   - pa_unix:	    	PortAudio on Unix (OSS or ALSA)
-#   - pa_darwinos:  	PortAudio on MacOSX (CoreAudio)
-#   - pa_old_darwinos:  PortAudio on MacOSX (old CoreAudio, for OSX 10.2)
-#   - pa_win32:	    	PortAudio on Win32 (WMME)
-#   - ds:	    	Win32 DirectSound (dsound.c)
-#   - null:	    	Null sound device (nullsound.c)
-#   - external:		Link with no sounddev (app will provide)
-AC_PJMEDIA_SND=pa_unix
-
-# For Unix, specify if ALSA should be supported
-AC_PA_USE_ALSA=1
-
-# Additional PortAudio CFLAGS are in  -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN
-
-#
-# Codecs
-#
-AC_NO_G711_CODEC=
-AC_NO_L16_CODEC=
-AC_NO_GSM_CODEC=
-AC_NO_SPEEX_CODEC=
-AC_NO_ILBC_CODEC=
-AC_NO_G722_CODEC=
-
-export CODEC_OBJS=
-
-ifeq ($(AC_NO_G711_CODEC),1)
-export CFLAGS += -DPJMEDIA_HAS_G711_CODEC=0
-else
-export CODEC_OBJS +=
-endif
-
-ifeq ($(AC_NO_L16_CODEC),1)
-export CFLAGS += -DPJMEDIA_HAS_L16_CODEC=0
-else
-export CODEC_OBJS += l16.o
-endif
-
-ifeq ($(AC_NO_GSM_CODEC),1)
-export CFLAGS += -DPJMEDIA_HAS_GSM_CODEC=0
-else
-export CODEC_OBJS += gsm.o
-endif
-
-ifeq ($(AC_NO_SPEEX_CODEC),1)
-export CFLAGS += -DPJMEDIA_HAS_SPEEX_CODEC=0
-else
-export CFLAGS += -I$(THIRD_PARTY)/build/speex -I$(THIRD_PARTY)/speex/include
-export CODEC_OBJS += speex_codec.o
-
-ifneq (,1)
-export PJMEDIA_OBJS += echo_speex.o
-endif
-
-endif
-
-ifeq ($(AC_NO_ILBC_CODEC),1)
-export CFLAGS += -DPJMEDIA_HAS_ILBC_CODEC=0
-else
-export CODEC_OBJS += ilbc.o
-endif
-
-ifeq ($(AC_NO_G722_CODEC),1)
-export CFLAGS += -DPJMEDIA_HAS_G722_CODEC=0
-else
-export CODEC_OBJS += g722.o g722/g722_enc.o g722/g722_dec.o
-endif
-
-
-#
-# PortAudio
-#
-ifneq ($(findstring pa,$(AC_PJMEDIA_SND)),)
-export CFLAGS += -I$(THIRD_PARTY)/build/portaudio -I$(THIRD_PARTY)/portaudio/include -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_PORTAUDIO_SOUND
-export SOUND_OBJS = pasound.o
-endif
-
-#
-# Win32 DirectSound
-#
-ifeq ($(AC_PJMEDIA_SND),ds)
-export SOUND_OBJS = dsound.o
-export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_WIN32_DIRECT_SOUND
-endif
-
-#
-# Null sound device
-#
-ifeq ($(AC_PJMEDIA_SND),null)
-export SOUND_OBJS = nullsound.o
-export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_NULL_SOUND
-endif
-
-#
-# External sound device
-#
-ifeq ($(AC_PJMEDIA_SND),external)
-export SOUND_OBJS = 
-export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_EXTERNAL
-endif
-
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config_auto.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config_auto.h
deleted file mode 100644
index dce3d656a99f8fd0a857e40f4781068de96d3338..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config_auto.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* pjmedia/include/pjmedia-codec/config_auto.h.  Generated by configure.  */
-/* $Id: config_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __PJMEDIA_CODEC_CONFIG_AUTO_H_
-#define __PJMEDIA_CODEC_CONFIG_AUTO_H_
-
-/**
- * @file config_auto.h
- * @brief PJMEDIA-CODEC configuration as set by autoconf script
- */
-
-/*
- * Note:
- *	The configuration in config_site.h overrides any other settings,
- *	including the setting as detected by autoconf.
- */
-
-/* L16 codec */
-#ifndef PJMEDIA_HAS_L16_CODEC
-/* #undef PJMEDIA_HAS_L16_CODEC */
-#endif
-
-
-/* GSM codec */
-#ifndef PJMEDIA_HAS_GSM_CODEC
-/* #undef PJMEDIA_HAS_GSM_CODEC */
-#endif
-
-
-/* Speex codec */
-#ifndef PJMEDIA_HAS_SPEEX_CODEC
-/* #undef PJMEDIA_HAS_SPEEX_CODEC */
-#endif
-
-
-/* iLBC codec */
-#ifndef PJMEDIA_HAS_ILBC_CODEC
-/* #undef PJMEDIA_HAS_ILBC_CODEC */
-#endif
-
-
-/* G722 codec */
-#ifndef PJMEDIA_HAS_G722_CODEC
-/* #undef PJMEDIA_HAS_G722_CODEC */
-#endif
-
-
-#endif	/* __PJMEDIA_CODEC_CONFIG_AUTO_H_ */
-
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config_auto.h b/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config_auto.h
deleted file mode 100644
index e88f6b957d5632144858e0b6f1f5b2bda0f09cf3..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config_auto.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* pjmedia/include/pjmedia/config_auto.h.  Generated by configure.  */
-/* $Id: config_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __PJMEDIA_CONFIG_AUTO_H_
-#define __PJMEDIA_CONFIG_AUTO_H_
-
-/**
- * @file config_auto.h
- * @brief PJMEDIA configuration as set by autoconf script
- */
-
-/*
- * Note:
- *	The configuration in config_site.h overrides any other settings,
- *	including the setting as detected by autoconf.
- */
-
-/* G711 codec */
-#ifndef PJMEDIA_HAS_G711_CODEC
-/* #undef PJMEDIA_HAS_G711_CODEC */
-#endif
-
-
-#endif	/* __PJMEDIA_CONFIG_AUTO_H_ */
-
-
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/jbuf.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/jbuf.c
deleted file mode 100644
index 75c3e11e7dbc5fbed8168be1bb25488dea727ffd..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/jbuf.c
+++ /dev/null
@@ -1,673 +0,0 @@
-/* $Id: jbuf.c 2549 2009-03-23 13:30:26Z nanang $ */
-/* 
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 
- */
-/*
- * Based on implementation kindly contributed by Switchlab, Ltd.
- */
-#include <pjmedia/jbuf.h>
-#include <pjmedia/errno.h>
-#include <pj/pool.h>
-#include <pj/assert.h>
-#include <pj/log.h>
-#include <pj/math.h>
-#include <pj/string.h>
-
-
-#define THIS_FILE   "jbuf.c"
-
-#define SAFE_SHRINKING_DIFF	1
-#define MIN_SHRINK_GAP_MSEC	200
-
-typedef struct jb_framelist_t
-{
-    char	*flist_buffer;
-    int		*flist_frame_type;
-    pj_size_t	*flist_content_len;
-    pj_uint32_t	*flist_bit_info;
-    unsigned	 flist_frame_size;
-    unsigned	 flist_max_count;
-    unsigned	 flist_empty;
-    unsigned	 flist_head;
-    unsigned	 flist_tail;
-    unsigned	 flist_origin;
-} jb_framelist_t;
-
-
-struct pjmedia_jbuf
-{
-    pj_str_t	    name;		  // jitter buffer name
-    jb_framelist_t  jb_framelist;
-    pj_size_t	    jb_frame_size;	  // frame size	
-    unsigned	    jb_frame_ptime;	  // frame duration.
-    pj_size_t	    jb_max_count;	  // max frames in the jitter framelist->flist_buffer
-
-    int		    jb_level;		  // delay between source & destination
-					  // (calculated according of the number of get/put operations)
-    int		    jb_max_hist_level;    // max level during the last level calculations
-    int		    jb_stable_hist;	  // num of times the delay has	been lower then	the prefetch num
-    int		    jb_last_op;		  // last operation executed on	the framelist->flist_buffer (put/get)
-    int		    jb_last_seq_no;	  // seq no. of	the last frame inserted	to the framelist->flist_buffer
-    int		    jb_prefetch;	  // no. of frame to insert before removing some
-					  // (at the beginning of the framelist->flist_buffer operation)
-    int		    jb_prefetch_cnt;	  // prefetch counter
-    int		    jb_def_prefetch;	  // Default prefetch
-    int		    jb_min_prefetch;	  // Minimum allowable prefetch
-    int		    jb_max_prefetch;	  // Maximum allowable prefetch
-    int		    jb_status;		  // status is 'init' until the	first 'put' operation
-    pj_math_stat    jb_delay;		  // Delay statistics of jitter buffer (in frame unit)
-
-    unsigned	    jb_last_del_seq;	  // Seq # of last frame deleted
-    unsigned	    jb_min_shrink_gap;	  // How often can we shrink
-};
-
-
-#define JB_STATUS_INITIALIZING	0
-#define JB_STATUS_PROCESSING	1
-#define JB_STATUS_PREFETCHING	2
-
-/* Enabling this would log the jitter buffer state about once per 
- * second.
- */
-#if 1
-#  define TRACE__(args)	    PJ_LOG(5,args)
-#else
-#  define TRACE__(args)
-#endif
-
-
-static pj_status_t jb_framelist_init( pj_pool_t *pool,
-				      jb_framelist_t *framelist,
-				      unsigned frame_size,
-				      unsigned max_count) 
-{
-    PJ_ASSERT_RETURN(pool && framelist, PJ_EINVAL);
-
-    pj_bzero(framelist, sizeof(jb_framelist_t));
-
-    framelist->flist_frame_size = frame_size;
-    framelist->flist_max_count = max_count;
-    framelist->flist_buffer = (char*) 
-			      pj_pool_zalloc(pool,
-					     framelist->flist_frame_size * 
-					     framelist->flist_max_count);
-
-    framelist->flist_frame_type = (int*)
-	pj_pool_zalloc(pool, sizeof(framelist->flist_frame_type[0]) * 
-				framelist->flist_max_count);
-
-    framelist->flist_content_len = (pj_size_t*)
-	pj_pool_zalloc(pool, sizeof(framelist->flist_content_len[0]) * 
-				framelist->flist_max_count);
-
-    framelist->flist_bit_info = (pj_uint32_t*)
-	pj_pool_zalloc(pool, sizeof(framelist->flist_bit_info[0]) * 
-				framelist->flist_max_count);
-
-    framelist->flist_empty = 1;
-
-    return PJ_SUCCESS;
-
-}
-
-static pj_status_t jb_framelist_destroy(jb_framelist_t *framelist) 
-{
-    PJ_UNUSED_ARG(framelist);
-    return PJ_SUCCESS;
-}
-
-
-static unsigned jb_framelist_size(jb_framelist_t *framelist) 
-{
-    if (framelist->flist_tail == framelist->flist_head) {
-	return framelist->flist_empty ? 0 : framelist->flist_max_count;
-    } else {
-	return (framelist->flist_tail - framelist->flist_head + 
-		framelist->flist_max_count) % framelist->flist_max_count;
-    }
-}
-
-
-static pj_bool_t jb_framelist_get(jb_framelist_t *framelist,
-				  void *frame, pj_size_t *size,
-				  pjmedia_jb_frame_type *p_type,
-				  pj_uint32_t *bit_info) 
-{
-    if (!framelist->flist_empty) {
-	pj_memcpy(frame, 
-		  framelist->flist_buffer + 
-		    framelist->flist_head * framelist->flist_frame_size,
-		  framelist->flist_frame_size);
-	*p_type = (pjmedia_jb_frame_type) 
-		  framelist->flist_frame_type[framelist->flist_head];
-	if (size)
-	    *size   = framelist->flist_content_len[framelist->flist_head];
-	if (bit_info)
-	    *bit_info = framelist->flist_bit_info[framelist->flist_head];
-
-	pj_bzero(framelist->flist_buffer + 
-		    framelist->flist_head * framelist->flist_frame_size,
-		  framelist->flist_frame_size);
-	framelist->flist_frame_type[framelist->flist_head] = 
-	    PJMEDIA_JB_MISSING_FRAME;
-	framelist->flist_content_len[framelist->flist_head] = 0;
-
-	framelist->flist_origin++;
-	framelist->flist_head = (framelist->flist_head + 1 ) % 
-				framelist->flist_max_count;
-	if (framelist->flist_head == framelist->flist_tail) 
-	    framelist->flist_empty = PJ_TRUE;
-	
-	return PJ_TRUE;
-
-    } else {
-	pj_bzero(frame, framelist->flist_frame_size);
-	return PJ_FALSE;
-    }
-}
-
-
-static void jb_framelist_remove_head( jb_framelist_t *framelist,
-				      unsigned count) 
-{
-    unsigned cur_size;
-
-    cur_size = jb_framelist_size(framelist);
-    if (count > cur_size) 
-	count = cur_size;
-
-    if (count) {
-	// may be done in two steps if overlapping
-	unsigned step1,step2;
-	unsigned tmp = framelist->flist_head+count;
-
-	if (tmp > framelist->flist_max_count) {
-	    step1 = framelist->flist_max_count - framelist->flist_head;
-	    step2 = count-step1;
-	} else {
-	    step1 = count;
-	    step2 = 0;
-	}
-
-	pj_bzero(framelist->flist_buffer + 
-		    framelist->flist_head * framelist->flist_frame_size,
-	          step1*framelist->flist_frame_size);
-	pj_memset(framelist->flist_frame_type+framelist->flist_head,
-		  PJMEDIA_JB_MISSING_FRAME,
-		  step1*sizeof(framelist->flist_frame_type[0]));
-	pj_bzero(framelist->flist_content_len+framelist->flist_head,
-		  step1*sizeof(framelist->flist_content_len[0]));
-
-	if (step2) {
-	    pj_bzero( framelist->flist_buffer,
-		      step2*framelist->flist_frame_size);
-	    pj_memset(framelist->flist_frame_type,
-		      PJMEDIA_JB_MISSING_FRAME,
-		      step2*sizeof(framelist->flist_frame_type[0]));
-	    pj_bzero (framelist->flist_content_len,
-		      step2*sizeof(framelist->flist_content_len[0]));
-	}
-
-	// update pointers
-	framelist->flist_origin += count;
-	framelist->flist_head = (framelist->flist_head + count) % 
-			        framelist->flist_max_count;
-	if (framelist->flist_head == framelist->flist_tail) 
-	    framelist->flist_empty = PJ_TRUE;
-    }
-}
-
-
-static pj_bool_t jb_framelist_put_at(jb_framelist_t *framelist,
-				     unsigned index,
-				     const void *frame,
-				     unsigned frame_size,
-				     pj_uint32_t bit_info)
-{
-    unsigned where;
-
-    assert(frame_size <= framelist->flist_frame_size);
-
-    if (!framelist->flist_empty) {
-	unsigned max_index;
-	unsigned cur_size;
-
-	// too late
-	if (index < framelist->flist_origin) 
-	    return PJ_FALSE;
-
-	// too soon
-	max_index = framelist->flist_origin + framelist->flist_max_count - 1;
-	if (index > max_index)
-	    return PJ_FALSE;
-
-	where = (index - framelist->flist_origin + framelist->flist_head) % 
-	        framelist->flist_max_count;
-
-	// update framelist->flist_tail pointer
-	cur_size = jb_framelist_size(framelist);
-	if (index >= framelist->flist_origin + cur_size) {
-	    unsigned diff = (index - (framelist->flist_origin + cur_size));
-	    framelist->flist_tail = (framelist->flist_tail + diff + 1) % 
-				    framelist->flist_max_count;
-	}
-    } else {
-	// check if frame is not too late, but watch out for sequence restart.
-	if (index < framelist->flist_origin && 
-	    framelist->flist_origin - index < 0x7FFF) 
-	{
-	    return PJ_FALSE;
-	}
-
-	where = framelist->flist_tail;
-	framelist->flist_origin = index;
-	framelist->flist_tail = (framelist->flist_tail + 1) % 
-				framelist->flist_max_count;
-	framelist->flist_empty = PJ_FALSE;
-    }
-
-    pj_memcpy(framelist->flist_buffer + where * framelist->flist_frame_size, 
-	      frame, frame_size);
-
-    framelist->flist_frame_type[where] = PJMEDIA_JB_NORMAL_FRAME;
-    framelist->flist_content_len[where] = frame_size;
-    framelist->flist_bit_info[where] = bit_info;
-
-    return PJ_TRUE;
-}
-
-
-
-enum pjmedia_jb_op
-{
-    JB_OP_INIT  = -1,
-    JB_OP_PUT   = 1,
-    JB_OP_GET   = 2
-};
-
-
-PJ_DEF(pj_status_t) pjmedia_jbuf_create(pj_pool_t *pool, 
-					const pj_str_t *name,
-					unsigned frame_size, 
-					unsigned ptime,
-					unsigned max_count,
-					pjmedia_jbuf **p_jb)
-{
-    pjmedia_jbuf *jb;
-    pj_status_t status;
-
-    jb = PJ_POOL_ZALLOC_T(pool, pjmedia_jbuf);
-
-    status = jb_framelist_init(pool, &jb->jb_framelist, frame_size, max_count);
-    if (status != PJ_SUCCESS)
-	return status;
-
-    pj_strdup_with_null(pool, &jb->name, name);
-    jb->jb_frame_size	 = frame_size;
-    jb->jb_frame_ptime   = ptime;
-    jb->jb_last_seq_no	 = -1;
-    jb->jb_level	 = 0;
-    jb->jb_last_op	 = JB_OP_INIT;
-    jb->jb_prefetch	 = PJ_MIN(PJMEDIA_JB_DEFAULT_INIT_DELAY,max_count*4/5);
-    jb->jb_prefetch_cnt	 = 0;
-    jb->jb_min_prefetch  = 0;
-    jb->jb_max_prefetch  = max_count*4/5;
-    jb->jb_stable_hist	 = 0;
-    jb->jb_status	 = JB_STATUS_INITIALIZING;
-    jb->jb_max_hist_level = 0;
-    jb->jb_max_count	 = max_count;
-    jb->jb_min_shrink_gap= MIN_SHRINK_GAP_MSEC / ptime;
-
-    pj_math_stat_init(&jb->jb_delay);
-
-    *p_jb = jb;
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Set the jitter buffer to fixed delay mode. The default behavior
- * is to adapt the delay with actual packet delay.
- *
- */
-PJ_DEF(pj_status_t) pjmedia_jbuf_set_fixed( pjmedia_jbuf *jb,
-					    unsigned prefetch)
-{
-    PJ_ASSERT_RETURN(jb, PJ_EINVAL);
-    PJ_ASSERT_RETURN(prefetch <= jb->jb_max_count, PJ_EINVAL);
-
-    jb->jb_min_prefetch = jb->jb_max_prefetch = 
-	jb->jb_prefetch = jb->jb_def_prefetch = prefetch;
-
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Set the jitter buffer to adaptive mode.
- */
-PJ_DEF(pj_status_t) pjmedia_jbuf_set_adaptive( pjmedia_jbuf *jb,
-					       unsigned prefetch,
-					       unsigned min_prefetch,
-					       unsigned max_prefetch)
-{
-    PJ_ASSERT_RETURN(jb, PJ_EINVAL);
-    PJ_ASSERT_RETURN(min_prefetch < max_prefetch &&
-		     prefetch <= max_prefetch &&
-		     max_prefetch <= jb->jb_max_count,
-		     PJ_EINVAL);
-
-    jb->jb_prefetch = jb->jb_def_prefetch = prefetch;
-    jb->jb_min_prefetch = min_prefetch;
-    jb->jb_max_prefetch = max_prefetch;
-
-    return PJ_SUCCESS;
-}
-
-
-PJ_DEF(pj_status_t) pjmedia_jbuf_reset(pjmedia_jbuf *jb)
-{
-    jb->jb_last_seq_no	 = -1;
-    jb->jb_level	 = 0;
-    jb->jb_last_op	 = JB_OP_INIT;
-    jb->jb_prefetch_cnt	 = 0;
-    jb->jb_stable_hist	 = 0;
-    jb->jb_status	 = JB_STATUS_INITIALIZING;
-    jb->jb_max_hist_level = 0;
-
-    jb_framelist_remove_head(&jb->jb_framelist, 
-			     jb_framelist_size(&jb->jb_framelist));
-
-    pj_math_stat_init(&jb->jb_delay);
-    
-    return PJ_SUCCESS;
-}
-
-
-PJ_DEF(pj_status_t) pjmedia_jbuf_destroy(pjmedia_jbuf *jb)
-{
-    return jb_framelist_destroy(&jb->jb_framelist);
-}
-
-
-static void jbuf_calculate_jitter(pjmedia_jbuf *jb)
-{
-    int diff, cur_size;
-
-    cur_size = jb_framelist_size(&jb->jb_framelist);
-
-    /* Only apply burst-level calculation on PUT operation since if VAD is 
-     * active the burst-level may not be accurate.
-     */
-    if (jb->jb_last_op == JB_OP_PUT) {
-
-	jb->jb_max_hist_level = PJ_MAX(jb->jb_max_hist_level,jb->jb_level);
-
-	/* Level is decreasing */
-	if (jb->jb_level < jb->jb_prefetch) {
-
-	    enum { STABLE_HISTORY_LIMIT = 100 };
-	    
-	    jb->jb_stable_hist++;
-	    
-	    /* Only update the prefetch if 'stable' condition is reached 
-	     * (not just short time impulse)
-	     */
-	    if (jb->jb_stable_hist > STABLE_HISTORY_LIMIT) {
-		
-		diff = (jb->jb_prefetch - jb->jb_max_hist_level) / 3;
-
-		if (diff < 1)
-		    diff = 1;
-
-		/* Update max_hist_level. */
-		jb->jb_max_hist_level = jb->jb_prefetch;
-
-		jb->jb_prefetch -= diff;
-		if (jb->jb_prefetch < jb->jb_min_prefetch) 
-		    jb->jb_prefetch = jb->jb_min_prefetch;
-
-		jb->jb_stable_hist = 0;
-
-		TRACE__((jb->name.ptr,"jb updated(1), prefetch=%d, size=%d", 
-			 jb->jb_prefetch, cur_size));
-	    }
-	}
-
-	/* Level is increasing */
-	else if (jb->jb_level > jb->jb_prefetch) {
-
-	    /* Instaneous set prefetch */
-	    jb->jb_prefetch = PJ_MIN(jb->jb_max_hist_level,
-				     (int)(jb->jb_max_count*4/5));
-	    if (jb->jb_prefetch > jb->jb_max_prefetch)
-		jb->jb_prefetch = jb->jb_max_prefetch;
-
-	    jb->jb_stable_hist = 0;
-	    // Keep max_hist_level.
-	    //jb->jb_max_hist_level = 0;
-
-	    TRACE__((jb->name.ptr,"jb updated(2), prefetch=%d, size=%d", 
-		     jb->jb_prefetch, cur_size));
-	}
-
-	/* Level is unchanged */
-	else {
-	    jb->jb_stable_hist = 0;
-	}
-    }
-
-    /* These code is used for shortening the delay in the jitter buffer. */
-    // Shrinking based on max_hist_level (recent max level).
-    //diff = cur_size - jb->jb_prefetch;
-    diff = cur_size - jb->jb_max_hist_level;
-    if (diff > SAFE_SHRINKING_DIFF && 
-	jb->jb_framelist.flist_origin-jb->jb_last_del_seq > jb->jb_min_shrink_gap)
-    {
-	/* Shrink slowly */
-	diff = 1;
-
-	/* Drop frame(s)! */
-	jb_framelist_remove_head(&jb->jb_framelist, diff);
-	jb->jb_last_del_seq = jb->jb_framelist.flist_origin;
-
-	pj_math_stat_update(&jb->jb_delay, cur_size - diff);
-
-	TRACE__((jb->name.ptr, 
-		 "JB shrinking %d frame(s), size=%d", diff,
-		 jb_framelist_size(&jb->jb_framelist)));
-    } else {
-	pj_math_stat_update(&jb->jb_delay, cur_size);
-    }
-
-    jb->jb_level = 0;
-}
-
-PJ_INLINE(void) jbuf_update(pjmedia_jbuf *jb, int oper)
-{
-    if(jb->jb_last_op != oper) {
-	jbuf_calculate_jitter(jb);
-	jb->jb_last_op = oper;
-    }
-}
-
-PJ_DEF(void) pjmedia_jbuf_put_frame( pjmedia_jbuf *jb, 
-				     const void *frame, 
-				     pj_size_t frame_size, 
-				     int frame_seq)
-{
-    pjmedia_jbuf_put_frame2(jb, frame, frame_size, 0, frame_seq, NULL);
-}
-
-PJ_DEF(void) pjmedia_jbuf_put_frame2(pjmedia_jbuf *jb, 
-				     const void *frame, 
-				     pj_size_t frame_size, 
-				     pj_uint32_t bit_info,
-				     int frame_seq,
-				     pj_bool_t *discarded)
-{
-    pj_size_t min_frame_size;
-    int seq_diff;
-
-    if (jb->jb_last_seq_no == -1)	{
-	jb->jb_last_seq_no = frame_seq - 1;
-    }
-
-    seq_diff = frame_seq - jb->jb_last_seq_no;
-    jb->jb_last_seq_no = PJ_MAX(jb->jb_last_seq_no, frame_seq);
-    if (seq_diff > 0) jb->jb_level += seq_diff;
-
-    if(jb->jb_status ==	JB_STATUS_INITIALIZING) {
-	jb->jb_status = JB_STATUS_PROCESSING;
-	jb->jb_level = 0;
-    } else {
-	jbuf_update(jb, JB_OP_PUT);
-    }
-
-    min_frame_size = PJ_MIN(frame_size, jb->jb_frame_size);
-    if (seq_diff > 0) {
-
-	while (jb_framelist_put_at(&jb->jb_framelist, frame_seq, frame,
-				   min_frame_size, bit_info) == PJ_FALSE)
-	{
-	    jb_framelist_remove_head(&jb->jb_framelist,
-				     PJ_MAX(jb->jb_max_count/4,1) );
-	}
-
-	if (jb->jb_prefetch_cnt < jb->jb_prefetch) {
-	    jb->jb_prefetch_cnt += seq_diff;
-	    
-	    TRACE__((jb->name.ptr, "PUT prefetch_cnt=%d/%d", 
-		     jb->jb_prefetch_cnt, jb->jb_prefetch));
-
-	    if (jb->jb_status == JB_STATUS_PREFETCHING && 
-		jb->jb_prefetch_cnt >= jb->jb_prefetch)
-	    {
-		jb->jb_status = JB_STATUS_PROCESSING;
-	    }
-	}
-
-
-
-	if (discarded)
-	    *discarded = PJ_FALSE;
-    }
-    else
-    {
-	pj_bool_t res;
-	res = jb_framelist_put_at(&jb->jb_framelist,frame_seq,frame,
-				  min_frame_size, bit_info);
-	if (discarded)
-	    *discarded = !res;
-    }
-}
-
-/*
- * Get frame from jitter buffer.
- */
-PJ_DEF(void) pjmedia_jbuf_get_frame( pjmedia_jbuf *jb, 
-				     void *frame, 
-				     char *p_frame_type)
-{
-    pjmedia_jbuf_get_frame2(jb, frame, NULL, p_frame_type, NULL);
-}
-
-/*
- * Get frame from jitter buffer.
- */
-PJ_DEF(void) pjmedia_jbuf_get_frame2(pjmedia_jbuf *jb, 
-				     void *frame, 
-				     pj_size_t *size,
-				     char *p_frame_type,
-				     pj_uint32_t *bit_info)
-{
-    pjmedia_jb_frame_type ftype;
-
-    jb->jb_level++;
-
-    jbuf_update(jb, JB_OP_GET);
-
-    if (jb_framelist_size(&jb->jb_framelist) == 0) {
-	jb->jb_prefetch_cnt = 0;
-	if (jb->jb_def_prefetch)
-	    jb->jb_status = JB_STATUS_PREFETCHING;
-    }
-
-    if (jb->jb_status == JB_STATUS_PREFETCHING && 
-	jb->jb_prefetch_cnt < jb->jb_prefetch)
-    {
-	/* Can't return frame because jitter buffer is filling up
-	 * minimum prefetch.
-	 */
-	pj_bzero(frame, jb->jb_frame_size);
-	if (jb_framelist_size(&jb->jb_framelist) == 0)
-	    *p_frame_type = PJMEDIA_JB_ZERO_EMPTY_FRAME;
-	else
-	    *p_frame_type = PJMEDIA_JB_ZERO_PREFETCH_FRAME;
-
-	if (size)
-	    *size = 0;
-
-	TRACE__((jb->name.ptr, "GET prefetch_cnt=%d/%d",
-		 jb->jb_prefetch_cnt, jb->jb_prefetch));
-	return;
-    }
-
-    /* Retrieve a frame from frame list */
-    if (jb_framelist_get(&jb->jb_framelist,frame,size,&ftype,bit_info) ==
-	PJ_FALSE) 
-    {
-	/* Can't return frame because jitter buffer is empty! */
-	pj_bzero(frame, jb->jb_frame_size);
-	*p_frame_type = PJMEDIA_JB_ZERO_EMPTY_FRAME;
-	if (size)
-	    *size = 0;
-
-	return;
-    }
-
-    /* We've successfully retrieved a frame from the frame list, but
-     * the frame could be a blank frame!
-     */
-    if (ftype == PJMEDIA_JB_NORMAL_FRAME) 
-	*p_frame_type	= PJMEDIA_JB_NORMAL_FRAME;
-    else 
-	*p_frame_type	= PJMEDIA_JB_MISSING_FRAME;
-}
-
-/*
- * Get jitter buffer state.
- */
-PJ_DEF(pj_status_t) pjmedia_jbuf_get_state( pjmedia_jbuf *jb,
-					    pjmedia_jb_state *state )
-{
-    PJ_ASSERT_RETURN(jb && state, PJ_EINVAL);
-
-    state->frame_size = jb->jb_frame_size;
-    state->prefetch = jb->jb_prefetch;
-    state->min_prefetch = jb->jb_min_prefetch;
-    state->max_prefetch = jb->jb_max_prefetch;
-    state->size = jb_framelist_size(&jb->jb_framelist);
-    state->avg_delay = jb->jb_delay.mean * jb->jb_frame_ptime;
-    state->min_delay = jb->jb_delay.min * jb->jb_frame_ptime;
-    state->max_delay = jb->jb_delay.max * jb->jb_frame_ptime;
-    state->dev_delay = pj_math_stat_get_stddev(&jb->jb_delay) * 
-		       jb->jb_frame_ptime;
-
-    return PJ_SUCCESS;
-}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound.cpp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound.cpp
deleted file mode 100644
index 57e8ddbd6eb0078f1112d4c4e519a3282d0ca445..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound.cpp
+++ /dev/null
@@ -1,1038 +0,0 @@
-/* $Id: symbian_sound.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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.
-    pjmedia_dir		 	 dir;
-    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;
-    }
-}
-
-
-/*
- * Utility: print sound device error
- */
-static void snd_perror (const char *title, TInt rc)
-{
-    PJ_LOG (1, (THIS_FILE, "%s: error code %d", title, rc));
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//
-
-/*
- * Implementation: Symbian Input Stream.
- */
-
-class CPjAudioInputEngine : public CBase, 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();
-
-    private:
-        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_;
-
-        // cache variable
-        // to avoid calculating frame length repeatedly
-        TInt			  frameLen_;
-
-        // in some SymbianOS (e.g: OSv9.1), sometimes recorded size != requested framesize
-        // so let's provide a buffer to make sure the rec callback returns framesize as requested.
-        TUint8		     *frameRecBuf_;
-        TInt			  frameRecBufLen_;
-
-        CPjAudioInputEngine (pjmedia_snd_stream *parent_strm,
-                             pjmedia_snd_rec_cb rec_cb,
-                             void *user_data);
-        void ConstructL();
-        TPtr8 & GetFrame();
-
-    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), userData_ (user_data),
-        iInputStream_ (NULL), iStreamBuffer_ (NULL), iFramePtr_ (0, 0),
-        lastError_ (KErrNone), timeStamp_ (0),
-        frameLen_ (parent_strm->samples_per_frame * parent_strm->channel_count * BYTES_PER_SAMPLE),
-        frameRecBuf_ (NULL), frameRecBufLen_ (0)
-{
-}
-
-CPjAudioInputEngine::~CPjAudioInputEngine()
-{
-    Stop();
-
-    delete iStreamBuffer_;
-    iStreamBuffer_ = NULL;
-
-    delete [] frameRecBuf_;
-    frameRecBuf_ = NULL;
-    frameRecBufLen_ = 0;
-}
-
-void CPjAudioInputEngine::ConstructL()
-{
-    iStreamBuffer_ = HBufC8::NewL (frameLen_);
-    CleanupStack::PushL (iStreamBuffer_);
-
-    frameRecBuf_ = new TUint8[frameLen_*2];
-    CleanupStack::PushL (frameRecBuf_);
-}
-
-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->frameRecBuf_);
-    CleanupStack::Pop (self->iStreamBuffer_);
-    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);
-
-    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);
-
-    // 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_symbianos_poll (-1, 100);
-    }
-
-    if (iInputStream_) {
-        delete iInputStream_;
-        iInputStream_ = NULL;
-    }
-
-    state_ = STATE_INACTIVE;
-}
-
-
-TPtr8 & CPjAudioInputEngine::GetFrame()
-{
-    //iStreamBuffer_->Des().FillZ(frameLen_);
-    iFramePtr_.Set ( (TUint8*) (iStreamBuffer_->Ptr()), frameLen_, frameLen_);
-    return iFramePtr_;
-}
-
-void CPjAudioInputEngine::MaiscOpenComplete (TInt aError)
-{
-    lastError_ = aError;
-
-    if (aError != KErrNone) {
-        snd_perror ("Error in MaiscOpenComplete()", aError);
-        return;
-    }
-
-    // set stream priority to normal and time sensitive
-    iInputStream_->SetPriority (EPriorityNormal,
-                                EMdaPriorityPreferenceTime);
-
-    // Read the first frame.
-    TPtr8 & frm = GetFrame();
-
-    TRAPD (err2, iInputStream_->ReadL (frm));
-
-    if (err2) {
-        PJ_LOG (4, (THIS_FILE, "Exception in iInputStream_->ReadL()"));
-    }
-}
-
-void CPjAudioInputEngine::MaiscBufferCopied (TInt aError,
-        const TDesC8 &aBuffer)
-{
-    lastError_ = aError;
-
-    if (aError != KErrNone) {
-        snd_perror ("Error in MaiscBufferCopied()", aError);
-        return;
-    }
-
-    if (frameRecBufLen_ || aBuffer.Size() < frameLen_) {
-        pj_memcpy (frameRecBuf_ + frameRecBufLen_, (void*) aBuffer.Ptr(), aBuffer.Size());
-        frameRecBufLen_ += aBuffer.Size();
-    }
-
-    if (frameRecBufLen_) {
-        while (frameRecBufLen_ >= frameLen_) {
-            // Call the callback.
-            recCb_ (userData_, timeStamp_, frameRecBuf_, frameLen_);
-            // Increment timestamp.
-            timeStamp_ += parentStrm_->samples_per_frame;
-
-            frameRecBufLen_ -= frameLen_;
-            pj_memmove (frameRecBuf_, frameRecBuf_+frameLen_, frameRecBufLen_);
-        }
-    } else {
-        // Call the callback.
-        recCb_ (userData_, timeStamp_, (void*) aBuffer.Ptr(), aBuffer.Size());
-        // Increment timestamp.
-        timeStamp_ += parentStrm_->samples_per_frame;
-    }
-
-    // Record next frame
-    TPtr8 & frm = GetFrame();
-
-    TRAPD (err2, iInputStream_->ReadL (frm));
-
-    if (err2) {
-        PJ_LOG (4, (THIS_FILE, "Exception in iInputStream_->ReadL()"));
-    }
-}
-
-
-void CPjAudioInputEngine::MaiscRecordComplete (TInt aError)
-{
-    lastError_ = aError;
-    state_ = STATE_INACTIVE;
-
-    if (aError != KErrNone) {
-        snd_perror ("Error in MaiscRecordComplete()", aError);
-    }
-}
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-
-/*
- * Implementation: Symbian Output Stream.
- */
-
-class CPjAudioOutputEngine : public CBase, 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();
-
-    private:
-        State		     state_;
-        pjmedia_snd_stream	    *parentStrm_;
-        pjmedia_snd_play_cb	     playCb_;
-        void		    *userData_;
-        CMdaAudioOutputStream   *iOutputStream_;
-        TUint8		    *frameBuf_;
-        unsigned		     frameBufSize_;
-        TPtrC8		     frame_;
-        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);
-
-    // 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_symbianos_poll (-1, 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/2th of stream max volume
-        iOutputStream_->SetVolume (iOutputStream_->MaxVolume() /2);
-
-        // 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.
-        frame_.Set (frameBuf_, frameBufSize_);
-
-        iOutputStream_->WriteL (frame_);
-    } else {
-        snd_perror ("Error in MaoscOpenComplete()", aError);
-    }
-}
-
-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.
-        frame_.Set (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;
-        snd_perror ("Error in MaoscBufferCopied()", aError);
-    }
-}
-
-void CPjAudioOutputEngine::MaoscPlayComplete (TInt aError)
-{
-    lastError_ = aError;
-    state_ = STATE_INACTIVE;
-
-    if (aError != KErrNone) {
-        snd_perror ("Error in MaoscPlayComplete()", aError);
-    }
-}
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-
-
-/*
- * 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 */
-    if (index == (unsigned)-1)
-        index = 0;
-
-    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;
-
-    if (index==-1) index = 0;
-
-    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->dir = PJMEDIA_DIR_CAPTURE;
-
-    strm->pool = pool;
-
-    strm->clock_rate = clock_rate;
-
-    strm->channel_count = channel_count;
-
-    strm->samples_per_frame = samples_per_frame;
-
-    PJ_ASSERT_RETURN (bits_per_sample == 16, PJ_EINVAL);
-
-    PJ_ASSERT_RETURN (get_clock_rate_cap (clock_rate) != 0, PJ_EINVAL);
-
-    PJ_ASSERT_RETURN (get_channel_cap (channel_count) != 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;
-
-    if (index == -1) index = 0;
-
-    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->dir = PJMEDIA_DIR_PLAYBACK;
-
-    strm->pool = pool;
-
-    strm->clock_rate = clock_rate;
-
-    strm->channel_count = channel_count;
-
-    strm->samples_per_frame = samples_per_frame;
-
-    PJ_ASSERT_RETURN (bits_per_sample == 16, PJ_EINVAL);
-
-    PJ_ASSERT_RETURN (get_clock_rate_cap (clock_rate) != 0, PJ_EINVAL);
-
-    PJ_ASSERT_RETURN (get_channel_cap (channel_count) != 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;
-
-    if (rec_id == -1) rec_id = 0;
-
-    if (play_id == -1) play_id = 0;
-
-    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->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK;
-
-    strm->pool = pool;
-
-    strm->clock_rate = clock_rate;
-
-    strm->channel_count = channel_count;
-
-    strm->samples_per_frame = samples_per_frame;
-
-    PJ_ASSERT_RETURN (bits_per_sample == 16, PJ_EINVAL);
-
-    PJ_ASSERT_RETURN (get_clock_rate_cap (clock_rate) != 0, PJ_EINVAL);
-
-    PJ_ASSERT_RETURN (get_channel_cap (channel_count) != 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);
-    }
-
-    // Create the input stream.
-    TRAPD (err1, strm->inEngine = CPjAudioInputEngine::NewL (strm, rec_cb,
-                                  user_data));
-
-    if (err1 != KErrNone) {
-        strm->inEngine = NULL;
-        delete strm->outEngine;
-        strm->outEngine = NULL;
-        pj_pool_release (pool);
-        return PJ_RETURN_OS_ERROR (err1);
-    }
-
-    // Done.
-    *p_snd_strm = strm;
-
-    return PJ_SUCCESS;
-}
-
-/*
- * Get stream info.
- */
-PJ_DEF (pj_status_t) pjmedia_snd_stream_get_info (pjmedia_snd_stream *strm,
-        pjmedia_snd_stream_info *pi)
-{
-    PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL);
-
-    pj_bzero (pi, sizeof (*pi));
-    pi->dir = strm->dir;
-    pi->play_id = 0;
-    pi->rec_id = 0;
-    pi->clock_rate = strm->clock_rate;
-    pi->channel_count = strm->channel_count;
-    pi->samples_per_frame = strm->samples_per_frame;
-    pi->bits_per_sample = BYTES_PER_SAMPLE * 8;
-    // Symbian uses 4096 bytes buffer (~2048 samples/256 ms) for PCM rec & play.
-    // The latencies below are rounded up to be a multiplication of 80.
-    pi->rec_latency  = 2080;
-    pi->play_latency = 2080;
-
-    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->outEngine) {
-        status = stream->outEngine->StartPlay();
-
-        if (status != PJ_SUCCESS)
-            return status;
-    }
-
-    if (stream->inEngine) {
-        status = stream->inEngine->StartRecord();
-
-        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;
-}
-
-
-/*
- * Set sound latency.
- */
-PJ_DEF (pj_status_t) pjmedia_snd_set_latency (unsigned input_latency,
-        unsigned output_latency)
-{
-    /* Nothing to do */
-    PJ_UNUSED_ARG (input_latency);
-    PJ_UNUSED_ARG (output_latency);
-    return PJ_SUCCESS;
-}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound_aps.cpp b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound_aps.cpp
deleted file mode 100644
index 9dcaf6103093596dfe6da0b13367ce220a2807e9..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/symbian_sound_aps.cpp
+++ /dev/null
@@ -1,992 +0,0 @@
-/* $Id: symbian_sound_aps.cpp 2540 2009-03-23 13:18:19Z nanang $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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/alaw_ulaw.h>
-#include <pjmedia/errno.h>
-#include <pjmedia/symbian_sound_aps.h>
-#include <pj/assert.h>
-#include <pj/log.h>
-#include <pj/math.h>
-#include <pj/os.h>
-
-#include <e32msgqueue.h>
-#include <sounddevice.h>
-#include <APSClientSession.h>
-
-//////////////////////////////////////////////////////////////////////////////
-//
-
-#define THIS_FILE	    "symbian_sound_aps.cpp"
-
-#define BYTES_PER_SAMPLE    2
-#define POOL_NAME	    "SymbianSoundAps"
-#define POOL_SIZE	    512
-#define POOL_INC	    512
-
-#if 1
-#   define TRACE_(st) PJ_LOG(3, st)
-#else
-#   define TRACE_(st)
-#endif
-
-static pjmedia_snd_dev_info symbian_snd_dev_info = {
-    "Symbian Sound Device (APS)",
-    1,
-    1,
-    8000
-};
-
-/* App UID to open global APS queues to communicate with the APS server. */
-extern TPtrC		    APP_UID;
-
-/* Default setting for loudspeaker */
-static pj_bool_t act_loudspeaker = PJ_FALSE;
-
-/* Forward declaration of CPjAudioEngine */
-
-class CPjAudioEngine;
-
-/*
- * PJMEDIA Sound Stream instance
- */
-
-struct pjmedia_snd_stream {
-    // Pool
-    pj_pool_t			*pool;
-
-    // Common settings.
-    pjmedia_dir		 	 dir;
-    unsigned			 clock_rate;
-    unsigned			 channel_count;
-    unsigned			 samples_per_frame;
-
-    // Audio engine
-    CPjAudioEngine		*engine;
-};
-
-static pj_pool_factory *snd_pool_factory;
-
-
-/*
- * Utility: print sound device error
- */
-static void snd_perror (const char *title, TInt rc)
-{
-    PJ_LOG (1, (THIS_FILE, "%s (error code=%d)", title, rc));
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//
-
-/**
- * Abstract class for handler of callbacks from APS client.
- */
-
-class MQueueHandlerObserver
-{
-
-    public:
-        virtual void InputStreamInitialized (const TInt aStatus) = 0;
-        virtual void OutputStreamInitialized (const TInt aStatus) = 0;
-        virtual void NotifyError (const TInt aError) = 0;
-
-        virtual void RecCb (TAPSCommBuffer &buffer) = 0;
-        virtual void PlayCb (TAPSCommBuffer &buffer) = 0;
-};
-
-/**
- * Handler for communication and data queue.
- */
-
-class CQueueHandler : public CActive
-{
-
-    public:
-        // Types of queue handler
-        enum TQueueHandlerType {
-            ERecordCommQueue,
-            EPlayCommQueue,
-            ERecordQueue,
-            EPlayQueue
-        };
-
-        // The order corresponds to the APS Server state, do not change!
-        enum TState {
-            EAPSPlayerInitialize        = 1,
-            EAPSRecorderInitialize      = 2,
-            EAPSPlayData                = 3,
-            EAPSRecordData              = 4,
-            EAPSPlayerInitComplete      = 5,
-            EAPSRecorderInitComplete    = 6
-        };
-
-        static CQueueHandler* NewL (MQueueHandlerObserver* aObserver,
-                                    RMsgQueue<TAPSCommBuffer>* aQ,
-                                    TQueueHandlerType aType) {
-            CQueueHandler* self = new (ELeave) CQueueHandler (aObserver, aQ, aType);
-            CleanupStack::PushL (self);
-            self->ConstructL();
-            CleanupStack::Pop (self);
-            return self;
-        }
-
-        // Destructor
-        ~CQueueHandler() {
-            Cancel();
-        }
-
-        // Start listening queue event
-        void Start() {
-            iQ->NotifyDataAvailable (iStatus);
-            SetActive();
-        }
-
-    private:
-        // Constructor
-        CQueueHandler (MQueueHandlerObserver* aObserver,
-                       RMsgQueue<TAPSCommBuffer>* aQ,
-                       TQueueHandlerType aType)
-                : CActive (CActive::EPriorityHigh),
-                iQ (aQ), iObserver (aObserver), iType (aType) {
-            CActiveScheduler::Add (this);
-
-            // use lower priority for comm queues
-
-            if ( (iType == ERecordCommQueue) || (iType == EPlayCommQueue))
-                SetPriority (CActive::EPriorityStandard);
-        }
-
-        // Second phase constructor
-        void ConstructL() {}
-
-        // Inherited from CActive
-        void DoCancel() {
-            iQ->CancelDataAvailable();
-        }
-
-        void RunL() {
-            if (iStatus != KErrNone) {
-                iObserver->NotifyError (iStatus.Int());
-                return;
-            }
-
-            TAPSCommBuffer buffer;
-
-            TInt ret = iQ->Receive (buffer);
-
-            if (ret != KErrNone) {
-                iObserver->NotifyError (ret);
-                return;
-            }
-
-            switch (iType) {
-
-                case ERecordQueue:
-
-                    if (buffer.iCommand == EAPSRecordData) {
-                        iObserver->RecCb (buffer);
-                    }
-
-                    break;
-
-                    // Callbacks from the APS main thread
-
-                case EPlayCommQueue:
-
-                    switch (buffer.iCommand) {
-
-                        case EAPSPlayData:
-
-                            if (buffer.iStatus == KErrUnderflow) {
-                                iObserver->PlayCb (buffer);
-                            }
-
-                            break;
-
-                        case EAPSPlayerInitialize:
-                            iObserver->NotifyError (buffer.iStatus);
-                            break;
-
-                        case EAPSPlayerInitComplete:
-                            iObserver->OutputStreamInitialized (buffer.iStatus);
-                            break;
-
-                        case EAPSRecorderInitComplete:
-                            iObserver->InputStreamInitialized (buffer.iStatus);
-                            break;
-
-                        default:
-                            iObserver->NotifyError (buffer.iStatus);
-                            break;
-                    }
-
-                    break;
-
-                    // Callbacks from the APS recorder thread
-
-                case ERecordCommQueue:
-
-                    switch (buffer.iCommand) {
-                            // The APS recorder thread will only report errors
-                            // through this handler. All other callbacks will be
-                            // sent from the APS main thread through EPlayCommQueue
-
-                        case EAPSRecorderInitialize:
-
-                            if (buffer.iStatus == KErrNone) {
-                                iObserver->InputStreamInitialized (buffer.iStatus);
-                                break;
-                            }
-
-                        case EAPSRecordData:
-
-                            iObserver->NotifyError (buffer.iStatus);
-                            break;
-
-                        default:
-                            break;
-                    }
-
-                    break;
-
-                default:
-                    break;
-            }
-
-            // issue next request
-            iQ->NotifyDataAvailable (iStatus);
-
-            SetActive();
-        }
-
-        // Data
-        RMsgQueue<TAPSCommBuffer>	*iQ;   // (not owned)
-        MQueueHandlerObserver	*iObserver; // (not owned)
-        TQueueHandlerType            iType;
-};
-
-
-/*
- * Implementation: Symbian Input & Output Stream.
- */
-
-class CPjAudioEngine : public CBase, MQueueHandlerObserver
-{
-
-    public:
-        enum State {
-            STATE_NULL,
-            STATE_READY,
-            STATE_STREAMING
-        };
-
-        ~CPjAudioEngine();
-
-        static CPjAudioEngine *NewL (pjmedia_snd_stream *parent_strm,
-                                     pjmedia_snd_rec_cb rec_cb,
-                                     pjmedia_snd_play_cb play_cb,
-                                     void *user_data);
-
-        TInt StartL();
-        void Stop();
-
-        TInt ActivateSpeaker (TBool active);
-
-    private:
-        CPjAudioEngine (pjmedia_snd_stream *parent_strm,
-                        pjmedia_snd_rec_cb rec_cb,
-                        pjmedia_snd_play_cb play_cb,
-                        void *user_data);
-        void ConstructL();
-
-        TInt InitPlayL();
-        TInt InitRecL();
-        TInt StartStreamL();
-
-        // Inherited from MQueueHandlerObserver
-        virtual void InputStreamInitialized (const TInt aStatus);
-        virtual void OutputStreamInitialized (const TInt aStatus);
-        virtual void NotifyError (const TInt aError);
-
-        virtual void RecCb (TAPSCommBuffer &buffer);
-        virtual void PlayCb (TAPSCommBuffer &buffer);
-
-        State			 state_;
-        pjmedia_snd_stream		*parentStrm_;
-        pjmedia_snd_rec_cb		 recCb_;
-        pjmedia_snd_play_cb		 playCb_;
-        void			*userData_;
-        pj_uint32_t			 TsPlay_;
-        pj_uint32_t			 TsRec_;
-
-        RAPSSession                  iSession;
-        TAPSInitSettings             iSettings;
-        RMsgQueue<TAPSCommBuffer>    iReadQ;
-        RMsgQueue<TAPSCommBuffer>    iReadCommQ;
-        RMsgQueue<TAPSCommBuffer>    iWriteQ;
-        RMsgQueue<TAPSCommBuffer>    iWriteCommQ;
-
-        CQueueHandler		*iPlayCommHandler;
-        CQueueHandler		*iRecCommHandler;
-        CQueueHandler		*iRecHandler;
-
-        static pj_uint8_t		 aps_samples_per_frame;
-
-        pj_int16_t			*play_buf;
-        pj_uint16_t			 play_buf_len;
-        pj_uint16_t			 play_buf_start;
-        pj_int16_t			*rec_buf;
-        pj_uint16_t			 rec_buf_len;
-};
-
-
-pj_uint8_t CPjAudioEngine::aps_samples_per_frame = 0;
-
-
-CPjAudioEngine* CPjAudioEngine::NewL (pjmedia_snd_stream *parent_strm,
-                                      pjmedia_snd_rec_cb rec_cb,
-                                      pjmedia_snd_play_cb play_cb,
-                                      void *user_data)
-{
-    CPjAudioEngine* self = new (ELeave) CPjAudioEngine (parent_strm,
-            rec_cb, play_cb,
-            user_data);
-    CleanupStack::PushL (self);
-    self->ConstructL();
-    CleanupStack::Pop (self);
-    return self;
-}
-
-CPjAudioEngine::CPjAudioEngine (pjmedia_snd_stream *parent_strm,
-                                pjmedia_snd_rec_cb rec_cb,
-                                pjmedia_snd_play_cb play_cb,
-                                void *user_data)
-        : state_ (STATE_NULL),
-        parentStrm_ (parent_strm),
-        recCb_ (rec_cb),
-        playCb_ (play_cb),
-        userData_ (user_data),
-        iPlayCommHandler (0),
-        iRecCommHandler (0),
-        iRecHandler (0)
-{
-}
-
-CPjAudioEngine::~CPjAudioEngine()
-{
-    Stop();
-
-    delete iPlayCommHandler;
-    iPlayCommHandler = NULL;
-    delete iRecCommHandler;
-    iRecCommHandler = NULL;
-
-    // On some devices, immediate closing after stopping may cause APS server
-    // panic KERN-EXEC 0, so let's wait for sometime before really closing
-    // the client session.
-    TTime start, now;
-    enum { APS_CLOSE_WAIT_TIME = 200 }; /* in msecs */
-
-    start.UniversalTime();
-
-    do {
-        pj_symbianos_poll (-1, APS_CLOSE_WAIT_TIME);
-        now.UniversalTime();
-    } while (now.MicroSecondsFrom (start) < APS_CLOSE_WAIT_TIME * 1000);
-
-    iSession.Close();
-
-    if (state_ == STATE_READY) {
-        if (parentStrm_->dir != PJMEDIA_DIR_PLAYBACK) {
-            iReadQ.Close();
-            iReadCommQ.Close();
-        }
-
-        iWriteQ.Close();
-
-        iWriteCommQ.Close();
-    }
-}
-
-TInt CPjAudioEngine::InitPlayL()
-{
-    if (state_ == STATE_STREAMING || state_ == STATE_READY)
-        return 0;
-
-    TInt err = iSession.InitializePlayer (iSettings);
-
-    if (err != KErrNone) {
-        snd_perror ("Failed to initialize player", err);
-        return err;
-    }
-
-    // Open message queues for the output stream
-    TBuf<128> buf2 = iSettings.iGlobal;
-
-    buf2.Append (_L ("PlayQueue"));
-
-    TBuf<128> buf3 = iSettings.iGlobal;
-
-    buf3.Append (_L ("PlayCommQueue"));
-
-    while (iWriteQ.OpenGlobal (buf2))
-        User::After (10);
-
-    while (iWriteCommQ.OpenGlobal (buf3))
-        User::After (10);
-
-    // Construct message queue handler
-    iPlayCommHandler = CQueueHandler::NewL (this,
-                                            &iWriteCommQ,
-                                            CQueueHandler::EPlayCommQueue);
-
-    // Start observing APS callbacks on output stream message queue
-    iPlayCommHandler->Start();
-
-    return 0;
-}
-
-TInt CPjAudioEngine::InitRecL()
-{
-    if (state_ == STATE_STREAMING || state_ == STATE_READY)
-        return 0;
-
-    // Initialize input stream device
-    TInt err = iSession.InitializeRecorder (iSettings);
-
-    if (err != KErrNone) {
-        snd_perror ("Failed to initialize recorder", err);
-        return err;
-    }
-
-    TBuf<128> buf1 = iSettings.iGlobal;
-
-    buf1.Append (_L ("RecordQueue"));
-    TBuf<128> buf4 = iSettings.iGlobal;
-    buf4.Append (_L ("RecordCommQueue"));
-
-    // Must wait for APS thread to finish creating message queues
-    // before we can open and use them.
-
-    while (iReadQ.OpenGlobal (buf1))
-        User::After (10);
-
-    while (iReadCommQ.OpenGlobal (buf4))
-        User::After (10);
-
-    // Construct message queue handlers
-    iRecCommHandler = CQueueHandler::NewL (this,
-                                           &iReadCommQ,
-                                           CQueueHandler::ERecordCommQueue);
-
-    // Start observing APS callbacks from on input stream message queue
-    iRecCommHandler->Start();
-
-    return 0;
-}
-
-TInt CPjAudioEngine::StartL()
-{
-    TInt err = iSession.Connect();
-
-    if (err != KErrNone && err != KErrAlreadyExists)
-        return err;
-
-    if (state_ == STATE_READY)
-        return StartStreamL();
-
-    // Even if only capturer are opened, playback thread of APS Server need
-    // to be run(?). Since some messages will be delivered via play comm queue.
-    return InitPlayL();
-}
-
-void CPjAudioEngine::Stop()
-{
-    iSession.Stop();
-
-    delete iRecHandler;
-    iRecHandler = NULL;
-
-    state_ = STATE_READY;
-}
-
-void CPjAudioEngine::ConstructL()
-{
-    iSettings.iFourCC		    = TFourCC (KMCPFourCCIdG711);
-    iSettings.iGlobal		    = APP_UID;
-    iSettings.iPriority		    = TMdaPriority (100);
-    iSettings.iPreference	    = TMdaPriorityPreference (0x05210001);
-    iSettings.iSettings.iChannels   = EMMFMono;
-    iSettings.iSettings.iSampleRate = EMMFSampleRate8000Hz;
-    iSettings.iSettings.iVolume	    = 0;
-
-    /* play_buf size is samples per frame of parent stream. */
-    play_buf = (pj_int16_t*) pj_pool_alloc (parentStrm_->pool,
-                                            parentStrm_->samples_per_frame << 1);
-    play_buf_len = 0;
-    play_buf_start = 0;
-
-    /* rec_buf size is samples per frame of parent stream. */
-    rec_buf  = (pj_int16_t*) pj_pool_alloc (parentStrm_->pool,
-                                            parentStrm_->samples_per_frame << 1);
-    rec_buf_len = 0;
-}
-
-TInt CPjAudioEngine::StartStreamL()
-{
-    if (state_ == STATE_STREAMING)
-        return 0;
-
-    iSession.SetCng (EFalse);
-
-    iSession.SetVadMode (EFalse);
-
-    iSession.SetPlc (EFalse);
-
-    iSession.SetEncoderMode (EULawOr30ms);
-
-    iSession.SetDecoderMode (EULawOr30ms);
-
-    iSession.ActivateLoudspeaker (act_loudspeaker);
-
-    // Not only playback
-    if (parentStrm_->dir != PJMEDIA_DIR_PLAYBACK) {
-        iRecHandler = CQueueHandler::NewL (this, &iReadQ,
-                                           CQueueHandler::ERecordQueue);
-        iRecHandler->Start();
-        iSession.Read();
-        TRACE_ ( (THIS_FILE, "APS recorder started"));
-    }
-
-    // Not only capture
-    if (parentStrm_->dir != PJMEDIA_DIR_CAPTURE) {
-        iSession.Write();
-        TRACE_ ( (THIS_FILE, "APS player started"));
-    }
-
-    state_ = STATE_STREAMING;
-
-    return 0;
-}
-
-///////////////////////////////////////////////////////////
-// Inherited from MQueueHandlerObserver
-//
-
-void CPjAudioEngine::InputStreamInitialized (const TInt aStatus)
-{
-    TRACE_ ( (THIS_FILE, "InputStreamInitialized %d", aStatus));
-
-    state_ = STATE_READY;
-
-    if (aStatus == KErrNone) {
-        StartStreamL();
-    }
-}
-
-void CPjAudioEngine::OutputStreamInitialized (const TInt aStatus)
-{
-    TRACE_ ( (THIS_FILE, "OutputStreamInitialized %d", aStatus));
-
-    if (aStatus == KErrNone) {
-        if (parentStrm_->dir == PJMEDIA_DIR_PLAYBACK) {
-            state_ = STATE_READY;
-            // Only playback, start directly
-            StartStreamL();
-        } else
-            InitRecL();
-    }
-}
-
-void CPjAudioEngine::NotifyError (const TInt aError)
-{
-    snd_perror ("Error from CQueueHandler", aError);
-}
-
-void CPjAudioEngine::RecCb (TAPSCommBuffer &buffer)
-{
-    pj_assert (buffer.iBuffer[0] == 1 && buffer.iBuffer[1] == 0);
-
-    /* Detect the recorder G.711 frame size, player frame size will follow
-     * this recorder frame size.
-     */
-
-    if (CPjAudioEngine::aps_samples_per_frame == 0) {
-        CPjAudioEngine::aps_samples_per_frame = buffer.iBuffer.Length() < 160?
-                                                80 : 160;
-        TRACE_ ( (THIS_FILE, "Detected APS G.711 frame size = %u samples",
-                  CPjAudioEngine::aps_samples_per_frame));
-    }
-
-    /* Decode APS buffer (coded in G.711) and put the PCM result into rec_buf.
-     * Whenever rec_buf is full, call parent stream callback.
-     */
-    unsigned dec_len = 0;
-
-    while (dec_len < CPjAudioEngine::aps_samples_per_frame) {
-        unsigned tmp;
-
-        tmp = PJ_MIN (parentStrm_->samples_per_frame - rec_buf_len,
-                      CPjAudioEngine::aps_samples_per_frame - dec_len);
-        pjmedia_ulaw_decode (&rec_buf[rec_buf_len],
-                             buffer.iBuffer.Ptr() + 2 + dec_len,
-                             tmp);
-        rec_buf_len += tmp;
-        dec_len += tmp;
-
-        pj_assert (rec_buf_len <= parentStrm_->samples_per_frame);
-
-        if (rec_buf_len == parentStrm_->samples_per_frame) {
-            recCb_ (userData_, 0, rec_buf, rec_buf_len << 1);
-            rec_buf_len = 0;
-        }
-    }
-}
-
-void CPjAudioEngine::PlayCb (TAPSCommBuffer &buffer)
-{
-    buffer.iCommand = CQueueHandler::EAPSPlayData;
-    buffer.iStatus = 0;
-    buffer.iBuffer.Zero();
-    buffer.iBuffer.Append (1);
-    buffer.iBuffer.Append (0);
-
-    /* Send 10ms silence frame if frame size hasn't been known. */
-
-    if (CPjAudioEngine::aps_samples_per_frame == 0) {
-        pjmedia_zero_samples (play_buf, 80);
-        pjmedia_ulaw_encode ( (pj_uint8_t*) play_buf, play_buf, 80);
-        buffer.iBuffer.Append ( (TUint8*) play_buf, 80);
-        iWriteQ.Send (buffer);
-        return;
-    }
-
-    unsigned enc_len = 0;
-
-    /* Call parent stream callback to get PCM samples to play,
-     * encode the PCM samples into G.711 and put it into APS buffer.
-     */
-
-    while (enc_len < CPjAudioEngine::aps_samples_per_frame) {
-        if (play_buf_len == 0) {
-            playCb_ (userData_, 0, play_buf, parentStrm_->samples_per_frame<<1);
-            play_buf_len = parentStrm_->samples_per_frame;
-            play_buf_start = 0;
-        }
-
-        unsigned tmp;
-
-        tmp = PJ_MIN (play_buf_len,
-                      CPjAudioEngine::aps_samples_per_frame - enc_len);
-        pjmedia_ulaw_encode ( (pj_uint8_t*) &play_buf[play_buf_start],
-                              &play_buf[play_buf_start],
-                              tmp);
-        buffer.iBuffer.Append ( (TUint8*) &play_buf[play_buf_start], tmp);
-        enc_len += tmp;
-        play_buf_len -= tmp;
-        play_buf_start += tmp;
-    }
-
-    iWriteQ.Send (buffer);
-}
-
-//
-// End of inherited from MQueueHandlerObserver
-/////////////////////////////////////////////////////////////
-
-
-TInt CPjAudioEngine::ActivateSpeaker (TBool active)
-{
-    if (state_ == STATE_READY || state_ == STATE_STREAMING) {
-        iSession.ActivateLoudspeaker (active);
-        return KErrNone;
-    }
-
-    return KErrNotReady;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//
-
-
-/*
- * 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 */
-    if (index == (unsigned)-1)
-        index = 0;
-
-    PJ_ASSERT_RETURN (index==0, NULL);
-
-    return &symbian_snd_dev_info;
-}
-
-static pj_status_t sound_open (pjmedia_dir dir,
-                               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 (p_snd_strm, PJ_EINVAL);
-    PJ_ASSERT_RETURN (clock_rate == 8000 && channel_count == 1 &&
-                      bits_per_sample == 16, PJ_ENOTSUP);
-    PJ_ASSERT_RETURN ( (dir == PJMEDIA_DIR_CAPTURE_PLAYBACK && rec_cb && play_cb)
-                       || (dir == PJMEDIA_DIR_CAPTURE && rec_cb && !play_cb)
-                       || (dir == PJMEDIA_DIR_PLAYBACK && !rec_cb && play_cb),
-                       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->dir = dir;
-
-    strm->pool = pool;
-
-    strm->clock_rate = clock_rate;
-
-    strm->channel_count = channel_count;
-
-    strm->samples_per_frame = samples_per_frame;
-
-    // Create the audio engine.
-    TRAPD (err, strm->engine = CPjAudioEngine::NewL (strm, rec_cb, 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;
-}
-
-
-
-/*
- * 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)
-{
-    if (index < 0) index = 0;
-
-    PJ_ASSERT_RETURN (index == 0, PJ_EINVAL);
-
-    return sound_open (PJMEDIA_DIR_CAPTURE, clock_rate, channel_count,
-                       samples_per_frame, bits_per_sample, rec_cb, NULL,
-                       user_data, p_snd_strm);
-}
-
-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)
-{
-    if (index < 0) index = 0;
-
-    PJ_ASSERT_RETURN (index == 0, PJ_EINVAL);
-
-    return sound_open (PJMEDIA_DIR_PLAYBACK, clock_rate, channel_count,
-                       samples_per_frame, bits_per_sample, NULL, play_cb,
-                       user_data, p_snd_strm);
-}
-
-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)
-{
-    if (rec_id < 0) rec_id = 0;
-
-    if (play_id < 0) play_id = 0;
-
-    PJ_ASSERT_RETURN (play_id == 0 && rec_id == 0, PJ_EINVAL);
-
-    return sound_open (PJMEDIA_DIR_CAPTURE_PLAYBACK, clock_rate, channel_count,
-                       samples_per_frame, bits_per_sample, rec_cb, play_cb,
-                       user_data, p_snd_strm);
-}
-
-/*
- * Get stream info.
- */
-PJ_DEF (pj_status_t) pjmedia_snd_stream_get_info (pjmedia_snd_stream *strm,
-        pjmedia_snd_stream_info *pi)
-{
-    PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL);
-
-    pj_bzero (pi, sizeof (*pi));
-    pi->dir = strm->dir;
-    pi->play_id = 0;
-    pi->rec_id = 0;
-    pi->clock_rate = strm->clock_rate;
-    pi->channel_count = strm->channel_count;
-    pi->samples_per_frame = strm->samples_per_frame;
-    pi->bits_per_sample = BYTES_PER_SAMPLE * 8;
-    // latencies approximation (in samples)
-    pi->rec_latency  = strm->samples_per_frame * 2;
-    pi->play_latency = strm->samples_per_frame * 2;
-
-    return PJ_SUCCESS;
-}
-
-
-PJ_DEF (pj_status_t) pjmedia_snd_stream_start (pjmedia_snd_stream *stream)
-{
-    PJ_ASSERT_RETURN (stream != NULL, PJ_EINVAL);
-
-    if (stream->engine) {
-        TInt err = stream->engine->StartL();
-
-        if (err != KErrNone)
-            return PJ_RETURN_OS_ERROR (err);
-    }
-
-    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->engine) {
-        stream->engine->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->engine) {
-        delete stream->engine;
-        stream->engine = 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;
-}
-
-
-/*
- * Set sound latency.
- */
-PJ_DEF (pj_status_t) pjmedia_snd_set_latency (unsigned input_latency,
-        unsigned output_latency)
-{
-    /* Nothing to do */
-    PJ_UNUSED_ARG (input_latency);
-    PJ_UNUSED_ARG (output_latency);
-    return PJ_SUCCESS;
-}
-
-
-/*
- * Activate/deactivate loudspeaker.
- */
-PJ_DEF (pj_status_t) pjmedia_snd_aps_activate_loudspeaker (
-    pjmedia_snd_stream *stream,
-    pj_bool_t active)
-{
-    if (stream == NULL) {
-        act_loudspeaker = active;
-    } else {
-        if (stream->engine == NULL)
-            return PJ_EINVAL;
-
-        TInt err = stream->engine->ActivateSpeaker (active);
-
-        if (err != KErrNone)
-            return PJ_RETURN_OS_ERROR (err);
-    }
-
-    return PJ_SUCCESS;
-}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/jbuf_test.c b/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/jbuf_test.c
deleted file mode 100644
index c8a5681fdc4ecab99518f8b3e7c8554aea30830f..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/jbuf_test.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* $Id$ */
-/* 
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <stdio.h>
-#include <ctype.h>
-#include <pj/pool.h>
-#include "test.h"
-
-#define JB_INIT_PREFETCH    0
-#define JB_MIN_PREFETCH	    0
-#define JB_MAX_PREFETCH	    10
-#define JB_PTIME	    20
-#define JB_BUF_SIZE	    20
-
-#define REPORT
-//#define PRINT_COMMENT
-
-int jbuf_main(void)
-{
-    pjmedia_jbuf *jb;
-    FILE *input = fopen("JBTEST.DAT", "rt");
-    unsigned seq;
-    char line[1024 * 10], *p;
-    pj_pool_t *pool;
-    pjmedia_jb_state state;
-    pj_str_t jb_name = {"JBTEST", 6};
-
-    pj_init();
-    pool = pj_pool_create(mem, "JBPOOL", 256*16, 256*16, NULL);
-
-    pjmedia_jbuf_create(pool, &jb_name, 1, JB_PTIME, JB_BUF_SIZE, &jb);
-    pjmedia_jbuf_set_adaptive(jb, JB_INIT_PREFETCH, JB_MIN_PREFETCH, 
-			      JB_MAX_PREFETCH);
-
-    while ((p=fgets(line, sizeof(line), input)) != NULL) {
-
-	while (*p && isspace(*p))
-	    ++p;
-
-	if (!*p)
-	    continue;
-
-	if (*p == '#') {
-#ifdef PRINT_COMMENT
-	    printf("%s", p);
-#endif
-	    continue;
-	}
-
-	pjmedia_jbuf_reset(jb);
-	seq = 1;
-
-#ifdef REPORT
-	pjmedia_jbuf_get_state(jb, &state);
-	printf("Initial\tsize=%d\tprefetch=%d\tmin.pftch=%d\tmax.pftch=%d\n", 
-	    state.size, state.prefetch, state.min_prefetch, state.max_prefetch);
-#endif
-
-	while (*p) {
-	    int c;
-	    char frame[1];
-	    char f_type;
-	    
-	    c = *p++;
-	    if (isspace(c))
-		continue;
-	    
-	    if (c == '/') {
-		putchar('\n');
-
-		while (*++p && *p != '/')
-		    putchar(*p);
-
-		putchar('\n');
-
-		if (*++p == 0)
-		    break;
-
-		continue;
-	    }
-
-	    switch (toupper(c)) {
-	    case 'G':
-		pjmedia_jbuf_get_frame(jb, frame, &f_type);
-		break;
-	    case 'P':
-		pjmedia_jbuf_put_frame(jb, (void*)frame, 1, seq);
-		seq++;
-		break;
-	    case 'L':
-		seq++;
-		printf("Lost\n");
-		break;
-	    default:
-		printf("Unknown character '%c'\n", c);
-		break;
-	    }
-
-#ifdef REPORT
-	    if (toupper(c) != 'L') {
-		pjmedia_jbuf_get_state(jb, &state);
-		printf("seq=%d\t%c\tsize=%d\tprefetch=%d\n", 
-		       seq, toupper(c), state.size, state.prefetch);
-	    }
-#endif
-	}
-    }
-
-    pjmedia_jbuf_destroy(jb);
-
-    if (input != stdin)
-	fclose(input);
-
-    pj_pool_release(pool);
-    return 0;
-}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjnath-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjnath-test-x86_64-unknown-linux-gnu
deleted file mode 100755
index 04211592492fdd6811a6d506b60633266625aabb..0000000000000000000000000000000000000000
Binary files a/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjnath-test-x86_64-unknown-linux-gnu and /dev/null differ
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-client-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-client-x86_64-unknown-linux-gnu
deleted file mode 100755
index 1069246a783679a577d95a9863aabcb7ccf686af..0000000000000000000000000000000000000000
Binary files a/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-client-x86_64-unknown-linux-gnu and /dev/null differ
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-srv-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-srv-x86_64-unknown-linux-gnu
deleted file mode 100755
index 0d2af4648b03b5043df35934f540320bff1bd532..0000000000000000000000000000000000000000
Binary files a/sflphone-common/libs/pjproject-1.0.2/pjnath/bin/pjturn-srv-x86_64-unknown-linux-gnu and /dev/null differ
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu
deleted file mode 100755
index 3f1ed10dc8e3c7e2a38ef4bbd8cab83a25d611aa..0000000000000000000000000000000000000000
Binary files a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu and /dev/null differ
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/samples/hack b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/bin/samples/hack
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp
deleted file mode 100644
index 9ca242e83c8f355d783ffd36fae99d493e36538d..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp
+++ /dev/null
@@ -1,828 +0,0 @@
-// pjsua_wince.cpp : Defines the entry point for the application.
-//
-
-#include "stdafx.h"
-#include "pjsua_wince.h"
-#include <commctrl.h>
-#include <pjsua-lib/pjsua.h>
-
-#define MAX_LOADSTRING 100
-
-// Global Variables:
-static HINSTANCE    hInst;
-static HWND	    hMainWnd;
-static HWND	    hwndCB;
-static HWND	    hwndGlobalStatus, hwndURI, hwndCallStatus;
-static HWND	    hwndActionButton, hwndExitButton;
-
-
-
-//
-// Basic config.
-//
-#define SIP_PORT	5060
-
-
-//
-// Destination URI (to make call, or to subscribe presence)
-//
-#define SIP_DST_URI	"sip:192.168.0.7:5061"
-
-//
-// Account
-//
-#define HAS_SIP_ACCOUNT	0	// 0 to disable registration
-#define SIP_DOMAIN	"server"
-#define SIP_REALM	"server"
-#define SIP_USER	"user"
-#define SIP_PASSWD	"secret"
-
-//
-// Outbound proxy for all accounts
-//
-#define SIP_PROXY	NULL
-//#define SIP_PROXY	"sip:192.168.0.2;lr"
-
-
-//
-// Configure nameserver if DNS SRV is to be used with both SIP
-// or STUN (for STUN see other settings below)
-//
-#define NAMESERVER	NULL
-//#define NAMESERVER	"62.241.163.201"
-
-//
-// STUN server
-#if 1
-// Use this to have the STUN server resolved normally
-#   define STUN_DOMAIN	NULL
-#   define STUN_SERVER	"stun.fwdnet.net"
-#elif 0
-// Use this to have the STUN server resolved with DNS SRV
-#   define STUN_DOMAIN	"iptel.org"
-#   define STUN_SERVER	NULL
-#else
-// Use this to disable STUN
-#   define STUN_DOMAIN	NULL
-#   define STUN_SERVER	NULL
-#endif
-
-//
-// Use ICE?
-//
-#define USE_ICE		1
-
-
-//
-// Globals
-//
-static pj_pool_t   *g_pool;
-static pj_str_t	    g_local_uri;
-static int	    g_current_acc;
-static int	    g_current_call = PJSUA_INVALID_ID;
-static int	    g_current_action;
-
-enum {
-    ID_GLOBAL_STATUS	= 21,
-    ID_URI,
-    ID_CALL_STATUS,
-    ID_POLL_TIMER,
-};
-
-enum {
-    ID_MENU_NONE	= 64,
-    ID_MENU_CALL,
-    ID_MENU_ANSWER,
-    ID_MENU_DISCONNECT,
-    ID_BTN_ACTION,
-};
-
-
-// Forward declarations of functions included in this code module:
-static ATOM		MyRegisterClass	(HINSTANCE, LPTSTR);
-BOOL			InitInstance	(HINSTANCE, int);
-static void		OnCreate	(HWND hWnd);
-static LRESULT CALLBACK	WndProc	(HWND, UINT, WPARAM, LPARAM);
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-static void OnError (const wchar_t *title, pj_status_t status)
-{
-    char errmsg[PJ_ERR_MSG_SIZE];
-    PJ_DECL_UNICODE_TEMP_BUF (werrmsg, PJ_ERR_MSG_SIZE);
-
-    pj_strerror (status, errmsg, sizeof (errmsg));
-
-    MessageBox (NULL, PJ_STRING_TO_NATIVE (errmsg, werrmsg, PJ_ERR_MSG_SIZE),
-                title, MB_OK);
-}
-
-
-static void SetLocalURI (const char *uri, int len, bool enabled=true)
-{
-    wchar_t tmp[128];
-
-    if (len==-1) len=pj_ansi_strlen (uri);
-
-    pj_ansi_to_unicode (uri, len, tmp, PJ_ARRAY_SIZE (tmp));
-
-    SetDlgItemText (hMainWnd, ID_GLOBAL_STATUS, tmp);
-
-    EnableWindow (hwndGlobalStatus, enabled?TRUE:FALSE);
-}
-
-
-
-static void SetURI (const char *uri, int len, bool enabled=true)
-{
-    wchar_t tmp[128];
-
-    if (len==-1) len=pj_ansi_strlen (uri);
-
-    pj_ansi_to_unicode (uri, len, tmp, PJ_ARRAY_SIZE (tmp));
-
-    SetDlgItemText (hMainWnd, ID_URI, tmp);
-
-    EnableWindow (hwndURI, enabled?TRUE:FALSE);
-}
-
-
-static void SetCallStatus (const char *state, int len)
-{
-    wchar_t tmp[128];
-
-    if (len==-1) len=pj_ansi_strlen (state);
-
-    pj_ansi_to_unicode (state, len, tmp, PJ_ARRAY_SIZE (tmp));
-
-    SetDlgItemText (hMainWnd, ID_CALL_STATUS, tmp);
-}
-
-static void SetAction (int action, bool enable=true)
-{
-    HMENU hMenu;
-
-    hMenu = CommandBar_GetMenu (hwndCB, 0);
-
-    RemoveMenu (hMenu, ID_MENU_NONE, MF_BYCOMMAND);
-    RemoveMenu (hMenu, ID_MENU_CALL, MF_BYCOMMAND);
-    RemoveMenu (hMenu, ID_MENU_ANSWER, MF_BYCOMMAND);
-    RemoveMenu (hMenu, ID_MENU_DISCONNECT, MF_BYCOMMAND);
-
-    switch (action) {
-
-        case ID_MENU_NONE:
-            InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("None"));
-            SetWindowText (hwndActionButton, TEXT ("-"));
-            break;
-
-        case ID_MENU_CALL:
-            InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Call"));
-            SetWindowText (hwndActionButton, TEXT ("&Call"));
-            break;
-
-        case ID_MENU_ANSWER:
-            InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Answer"));
-            SetWindowText (hwndActionButton, TEXT ("&Answer"));
-            break;
-
-        case ID_MENU_DISCONNECT:
-            InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Hangup"));
-            SetWindowText (hwndActionButton, TEXT ("&Hangup"));
-            break;
-    }
-
-    EnableMenuItem (hMenu, action, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED));
-
-    DrawMenuBar (hMainWnd);
-
-    g_current_action = action;
-}
-
-
-/*
- * Handler when invite state has changed.
- */
-static void on_call_state (pjsua_call_id call_id, pjsip_event *e)
-{
-    pjsua_call_info call_info;
-
-    PJ_UNUSED_ARG (e);
-
-    pjsua_call_get_info (call_id, &call_info);
-
-    if (call_info.state == PJSIP_INV_STATE_DISCONNECTED) {
-
-        g_current_call = PJSUA_INVALID_ID;
-        SetURI (SIP_DST_URI, -1);
-        SetAction (ID_MENU_CALL);
-        //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen);
-        SetCallStatus (call_info.last_status_text.ptr, call_info.last_status_text.slen);
-
-    } else {
-        //if (g_current_call == PJSUA_INVALID_ID)
-        //    g_current_call = call_id;
-
-        if (call_info.remote_contact.slen)
-            SetURI (call_info.remote_contact.ptr, call_info.remote_contact.slen, false);
-        else
-            SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false);
-
-        if (call_info.state == PJSIP_INV_STATE_CONFIRMED)
-            SetAction (ID_MENU_DISCONNECT);
-
-        SetCallStatus (call_info.state_text.ptr, call_info.state_text.slen);
-    }
-}
-
-
-/*
- * Callback on media state changed event.
- * The action may connect the call to sound device, to file, or
- * to loop the call.
- */
-static void on_call_media_state (pjsua_call_id call_id)
-{
-    pjsua_call_info call_info;
-
-    pjsua_call_get_info (call_id, &call_info);
-
-    if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) {
-        pjsua_conf_connect (call_info.conf_slot, 0);
-        pjsua_conf_connect (0, call_info.conf_slot);
-    }
-}
-
-
-/**
- * Handler when there is incoming call.
- */
-static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id,
-                              pjsip_rx_data *rdata)
-{
-    pjsua_call_info call_info;
-
-    PJ_UNUSED_ARG (acc_id);
-    PJ_UNUSED_ARG (rdata);
-
-    if (g_current_call != PJSUA_INVALID_ID) {
-        pj_str_t reason;
-        reason = pj_str ("Another call is in progress");
-        pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, &reason, NULL);
-        return;
-    }
-
-    g_current_call = call_id;
-
-    pjsua_call_get_info (call_id, &call_info);
-
-    SetAction (ID_MENU_ANSWER);
-    SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false);
-    pjsua_call_answer (call_id, 200, NULL, NULL);
-}
-
-
-/*
- * Handler registration status has changed.
- */
-static void on_reg_state (pjsua_acc_id acc_id)
-{
-    PJ_UNUSED_ARG (acc_id);
-
-    // Log already written.
-}
-
-
-/*
- * Handler on buddy state changed.
- */
-static void on_buddy_state (pjsua_buddy_id buddy_id)
-{
-}
-
-
-/**
- * Incoming IM message (i.e. MESSAGE request)!
- */
-static void on_pager (pjsua_call_id call_id, const pj_str_t *from,
-                      const pj_str_t *to, const pj_str_t *contact,
-                      const pj_str_t *mime_type, const pj_str_t *text)
-{
-}
-
-
-/**
- * Received typing indication
- */
-static void on_typing (pjsua_call_id call_id, const pj_str_t *from,
-                       const pj_str_t *to, const pj_str_t *contact,
-                       pj_bool_t is_typing)
-{
-}
-
-
-static BOOL OnInitStack (void)
-{
-    pjsua_config	    cfg;
-    pjsua_logging_config    log_cfg;
-    pjsua_media_config	    media_cfg;
-    pjsua_transport_config  udp_cfg;
-    pjsua_transport_config  rtp_cfg;
-    pjsua_transport_id	    transport_id;
-    pjsua_transport_info    transport_info;
-    pj_str_t		    tmp;
-    pj_status_t status;
-
-    /* Create pjsua */
-    status = pjsua_create();
-
-    if (status != PJ_SUCCESS) {
-        OnError (TEXT ("Error creating pjsua"), status);
-        return FALSE;
-    }
-
-    /* Create global pool for application */
-    g_pool = pjsua_pool_create ("pjsua", 4000, 4000);
-
-    /* Init configs */
-    pjsua_config_default (&cfg);
-
-    pjsua_media_config_default (&media_cfg);
-
-    pjsua_transport_config_default (&udp_cfg);
-
-    udp_cfg.port = SIP_PORT;
-
-    pjsua_transport_config_default (&rtp_cfg);
-
-    rtp_cfg.port = 40000;
-
-    pjsua_logging_config_default (&log_cfg);
-
-    log_cfg.level = 5;
-
-    log_cfg.log_filename = pj_str ("\\pjsua.txt");
-
-    log_cfg.msg_logging = 1;
-
-    log_cfg.decor = pj_log_get_decor() | PJ_LOG_HAS_CR;
-
-    /* Setup media */
-    media_cfg.clock_rate = 8000;
-
-    media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE;
-
-    media_cfg.ec_tail_len = 256;
-
-    media_cfg.quality = 1;
-
-    media_cfg.ptime = 20;
-
-    media_cfg.enable_ice = USE_ICE;
-
-    /* Initialize application callbacks */
-    cfg.cb.on_call_state = &on_call_state;
-
-    cfg.cb.on_call_media_state = &on_call_media_state;
-
-    cfg.cb.on_incoming_call = &on_incoming_call;
-
-    cfg.cb.on_reg_state = &on_reg_state;
-
-    cfg.cb.on_buddy_state = &on_buddy_state;
-
-    cfg.cb.on_pager = &on_pager;
-
-    cfg.cb.on_typing = &on_typing;
-
-    if (SIP_PROXY) {
-        cfg.outbound_proxy_cnt = 1;
-        cfg.outbound_proxy[0] = pj_str (SIP_PROXY);
-    }
-
-    if (NAMESERVER) {
-        cfg.nameserver_count = 1;
-        cfg.nameserver[0] = pj_str (NAMESERVER);
-    }
-
-    if (NAMESERVER && STUN_DOMAIN) {
-        cfg.stun_domain = pj_str (STUN_DOMAIN);
-    } else if (STUN_SERVER) {
-        cfg.stun_host = pj_str (STUN_SERVER);
-    }
-
-
-    /* Initialize pjsua */
-    status = pjsua_init (&cfg, &log_cfg, &media_cfg);
-
-    if (status != PJ_SUCCESS) {
-        OnError (TEXT ("Initialization error"), status);
-        return FALSE;
-    }
-
-    /* Set codec priority */
-    pjsua_codec_set_priority (pj_cstr (&tmp, "pcmu"), 240);
-
-    pjsua_codec_set_priority (pj_cstr (&tmp, "pcma"), 230);
-
-    pjsua_codec_set_priority (pj_cstr (&tmp, "speex/8000"), 190);
-
-    pjsua_codec_set_priority (pj_cstr (&tmp, "ilbc"), 189);
-
-    pjsua_codec_set_priority (pj_cstr (&tmp, "speex/16000"), 180);
-
-    pjsua_codec_set_priority (pj_cstr (&tmp, "speex/32000"), 0);
-
-    pjsua_codec_set_priority (pj_cstr (&tmp, "gsm"), 100);
-
-
-    /* Add UDP transport and the corresponding PJSUA account */
-    status = pjsua_transport_create (PJSIP_TRANSPORT_UDP,
-                                     &udp_cfg, &transport_id);
-
-    if (status != PJ_SUCCESS) {
-        OnError (TEXT ("Error starting SIP transport"), status);
-        return FALSE;
-    }
-
-    pjsua_transport_get_info (transport_id, &transport_info);
-
-    g_local_uri.ptr = (char*) pj_pool_alloc (g_pool, 128);
-    g_local_uri.slen = pj_ansi_sprintf (g_local_uri.ptr,
-                                        "<sip:%.*s:%d>",
-                                        (int) transport_info.local_name.host.slen,
-                                        transport_info.local_name.host.ptr,
-                                        transport_info.local_name.port);
-
-
-    /* Add local account */
-    pjsua_acc_add_local (transport_id, PJ_TRUE, &g_current_acc);
-    pjsua_acc_set_online_status (g_current_acc, PJ_TRUE);
-
-    /* Add account */
-
-    if (HAS_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_REALM);
-        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, &g_current_acc);
-
-        if (status != PJ_SUCCESS) {
-            pjsua_destroy();
-            return PJ_FALSE;
-        }
-    }
-
-    /* Add buddy */
-    if (SIP_DST_URI) {
-        pjsua_buddy_config bcfg;
-
-        pjsua_buddy_config_default (&bcfg);
-        bcfg.uri = pj_str (SIP_DST_URI);
-        bcfg.subscribe = PJ_FALSE;
-
-        pjsua_buddy_add (&bcfg, NULL);
-    }
-
-    /* Start pjsua */
-    status = pjsua_start();
-
-    if (status != PJ_SUCCESS) {
-        OnError (TEXT ("Error starting pjsua"), status);
-        return FALSE;
-    }
-
-    return TRUE;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-int WINAPI WinMain (HINSTANCE hInstance,
-                    HINSTANCE hPrevInstance,
-                    LPTSTR    lpCmdLine,
-                    int       nCmdShow)
-{
-    MSG msg;
-    HACCEL hAccelTable;
-
-
-
-    // Perform application initialization:
-
-    if (!InitInstance (hInstance, nCmdShow)) {
-        return FALSE;
-    }
-
-    hAccelTable = LoadAccelerators (hInstance, (LPCTSTR) IDC_PJSUA_WINCE);
-
-
-    // Main message loop:
-
-    while (GetMessage (&msg, NULL, 0, 0)) {
-        if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg)) {
-            TranslateMessage (&msg);
-            DispatchMessage (&msg);
-        }
-    }
-
-    return msg.wParam;
-}
-
-static ATOM MyRegisterClass (HINSTANCE hInstance, LPTSTR szWindowClass)
-{
-    WNDCLASS wc;
-
-    wc.style		= CS_HREDRAW | CS_VREDRAW;
-    wc.lpfnWndProc	= (WNDPROC) WndProc;
-    wc.cbClsExtra	= 0;
-    wc.cbWndExtra	= 0;
-    wc.hInstance	= hInstance;
-    wc.hIcon		= LoadIcon (hInstance, MAKEINTRESOURCE (IDI_PJSUA_WINCE));
-    wc.hCursor		= 0;
-    wc.hbrBackground	= (HBRUSH) GetStockObject (WHITE_BRUSH);
-    wc.lpszMenuName	= 0;
-    wc.lpszClassName	= szWindowClass;
-
-    return RegisterClass (&wc);
-}
-
-
-/* Callback upon NAT detection completion */
-static void nat_detect_cb (const pj_stun_nat_detect_result *res)
-{
-    if (res->status != PJ_SUCCESS) {
-        char msg[250];
-        pj_ansi_snprintf (msg, sizeof (msg), "NAT detection failed: %s",
-                          res->status_text);
-        SetCallStatus (msg, pj_ansi_strlen (msg));
-    } else {
-        char msg[250];
-        pj_ansi_snprintf (msg, sizeof (msg), "NAT type is %s",
-                          res->nat_type_name);
-        SetCallStatus (msg, pj_ansi_strlen (msg));
-    }
-}
-
-
-BOOL InitInstance (HINSTANCE hInstance, int nCmdShow)
-{
-    HWND	hWnd;
-    TCHAR	szTitle[MAX_LOADSTRING];
-    TCHAR	szWindowClass[MAX_LOADSTRING];
-
-    hInst = hInstance;
-
-    /* Init stack */
-
-    if (OnInitStack() == FALSE)
-        return FALSE;
-
-    LoadString (hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING);
-
-    MyRegisterClass (hInstance, szWindowClass);
-
-    LoadString (hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
-
-    hWnd = CreateWindow (szWindowClass, szTitle, WS_VISIBLE,
-                         CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200,
-                         NULL, NULL, hInstance, NULL);
-
-    if (!hWnd) {
-        return FALSE;
-    }
-
-    hMainWnd = hWnd;
-
-    ShowWindow (hWnd, nCmdShow);
-    UpdateWindow (hWnd);
-
-    if (hwndCB)
-        CommandBar_Show (hwndCB, TRUE);
-
-    SetTimer (hMainWnd, ID_POLL_TIMER, 50, NULL);
-
-    pjsua_detect_nat_type();
-
-    return TRUE;
-}
-
-
-static void OnCreate (HWND hWnd)
-{
-    enum {
-        X = 10,
-        Y = 40,
-        W = 220,
-        H = 30,
-    };
-
-    DWORD dwStyle;
-
-    hMainWnd = hWnd;
-
-    hwndCB = CommandBar_Create (hInst, hWnd, 1);
-    CommandBar_InsertMenubar (hwndCB, hInst, IDM_MENU, 0);
-    CommandBar_AddAdornments (hwndCB, 0, 0);
-
-    // Create global status text
-    dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED | ES_LEFT;
-    hwndGlobalStatus = CreateWindow (
-                           TEXT ("EDIT"),  // Class name
-                           NULL,           // Window text
-                           dwStyle,        // Window style
-                           X,		// x-coordinate of the upper-left corner
-                           Y+0,            // y-coordinate of the upper-left corner
-                           W,		// Width of the window for the edit
-                           // control
-                           H-5,		// Height of the window for the edit
-                           // control
-                           hWnd,           // Window handle to the parent window
-                           (HMENU) ID_GLOBAL_STATUS, // Control identifier
-                           hInst,           // Instance handle
-                           NULL);          // Specify NULL for this parameter when
-    // you create a control
-    SetLocalURI (g_local_uri.ptr, g_local_uri.slen, false);
-
-
-    // Create URI edit
-    dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER;
-    hwndURI = CreateWindow (
-                  TEXT ("EDIT"),  // Class name
-                  NULL,		// Window text
-                  dwStyle,        // Window style
-                  X,  // x-coordinate of the upper-left corner
-                  Y+H,  // y-coordinate of the upper-left corner
-                  W,  // Width of the window for the edit
-                  // control
-                  H-5,  // Height of the window for the edit
-                  // control
-                  hWnd,           // Window handle to the parent window
-                  (HMENU) ID_URI, // Control identifier
-                  hInst,           // Instance handle
-                  NULL);          // Specify NULL for this parameter when
-    // you create a control
-
-    // Create action Button
-    hwndActionButton = CreateWindow (L"button", L"Action",
-                                     WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
-                                     X, Y+2*H,
-                                     60, H-5, hWnd,
-                                     (HMENU) ID_BTN_ACTION,
-                                     hInst, NULL);
-
-    // Create exit button
-    hwndExitButton = CreateWindow (L"button", L"E&xit",
-                                   WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
-                                   X+70, Y+2*H,
-                                   60, H-5, hWnd,
-                                   (HMENU) ID_EXIT,
-                                   hInst, NULL);
-
-
-    // Create call status edit
-    dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED;
-    hwndCallStatus = CreateWindow (
-                         TEXT ("EDIT"),  // Class name
-                         NULL,		// Window text
-                         dwStyle,        // Window style
-                         X,  // x-coordinate of the upper-left corner
-                         Y+3*H,  // y-coordinate of the upper-left corner
-                         W,  // Width of the window for the edit
-                         // control
-                         H-5,  // Height of the window for the edit
-                         // control
-                         hWnd,           // Window handle to the parent window
-                         (HMENU) ID_CALL_STATUS, // Control identifier
-                         hInst,           // Instance handle
-                         NULL);          // Specify NULL for this parameter when
-    // you create a control
-    SetCallStatus ("Ready", 5);
-    SetAction (ID_MENU_CALL);
-    SetURI (SIP_DST_URI, -1);
-    SetFocus (hWnd);
-
-}
-
-
-static void OnDestroy (void)
-{
-    pjsua_destroy();
-}
-
-static LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
-    int wmId, wmEvent;
-
-    switch (message) {
-
-        case WM_KEYUP:
-
-            if (wParam==114) {
-                wParam = ID_MENU_CALL;
-            } else if (wParam==115) {
-                if (g_current_call == PJSUA_INVALID_ID)
-                    wParam = ID_EXIT;
-                else
-                    wParam = ID_MENU_DISCONNECT;
-            } else
-                break;
-
-        case WM_COMMAND:
-            wmId    = LOWORD (wParam);
-
-            wmEvent = HIWORD (wParam);
-
-            if (wmId == ID_BTN_ACTION)
-                wmId = g_current_action;
-
-            switch (wmId) {
-
-                case ID_MENU_CALL:
-
-                    if (g_current_call != PJSUA_INVALID_ID) {
-                        MessageBox (NULL, TEXT ("Can not make call"),
-                                    TEXT ("You already have one call active"), MB_OK);
-                    }
-
-                    pj_str_t dst_uri;
-
-                    wchar_t text[256];
-                    char tmp[256];
-                    pj_status_t status;
-
-                    GetWindowText (hwndURI, text, PJ_ARRAY_SIZE (text));
-                    pj_unicode_to_ansi (text, pj_unicode_strlen (text),
-                                        tmp, sizeof (tmp));
-                    dst_uri.ptr = tmp;
-                    dst_uri.slen = pj_ansi_strlen (tmp);
-                    status = pjsua_call_make_call (g_current_acc,
-                                                   &dst_uri, 0, NULL,
-                                                   NULL, &g_current_call);
-
-                    if (status != PJ_SUCCESS)
-                        OnError (TEXT ("Unable to make call"), status);
-
-                    break;
-
-                case ID_MENU_ANSWER:
-                    if (g_current_call == PJSUA_INVALID_ID)
-                        MessageBox (NULL, TEXT ("Can not answer"),
-                                    TEXT ("There is no call!"), MB_OK);
-                    else
-                        pjsua_call_answer (g_current_call, 200, NULL, NULL);
-
-                    break;
-
-                case ID_MENU_DISCONNECT:
-                    if (g_current_call == PJSUA_INVALID_ID)
-                        MessageBox (NULL, TEXT ("Can not disconnect"),
-                                    TEXT ("There is no call!"), MB_OK);
-                    else
-                        pjsua_call_hangup (g_current_call, PJSIP_SC_DECLINE, NULL, NULL);
-
-                    break;
-
-                case ID_EXIT:
-                    DestroyWindow (hWnd);
-
-                    break;
-
-                default:
-                    return DefWindowProc (hWnd, message, wParam, lParam);
-            }
-
-            break;
-
-        case WM_CREATE:
-            OnCreate (hWnd);
-            break;
-
-        case WM_DESTROY:
-            OnDestroy();
-            CommandBar_Destroy (hwndCB);
-            PostQuitMessage (0);
-            break;
-
-        case WM_TIMER:
-            pjsua_handle_events (1);
-            break;
-
-        default:
-            return DefWindowProc (hWnd, message, wParam, lParam);
-    }
-
-    return 0;
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.cpp
deleted file mode 100644
index cc75d884ba8ed66ab5e30a943b74a3ec7d4f896e..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-// PocketPJ.cpp : Defines the class behaviors for the application.
-//
-
-#include "stdafx.h"
-#include "PocketPJ.h"
-#include "PocketPJDlg.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CPocketPJApp
-
-BEGIN_MESSAGE_MAP (CPocketPJApp, CWinApp)
-    //{{AFX_MSG_MAP(CPocketPJApp)
-    // NOTE - the ClassWizard will add and remove mapping macros here.
-    //    DO NOT EDIT what you see in these blocks of generated code!
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CPocketPJApp construction
-
-CPocketPJApp::CPocketPJApp()
-        : CWinApp()
-{
-    // TODO: add construction code here,
-    // Place all significant initialization in InitInstance
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only CPocketPJApp object
-
-CPocketPJApp theApp;
-
-/////////////////////////////////////////////////////////////////////////////
-// CPocketPJApp initialization
-
-BOOL CPocketPJApp::InitInstance()
-{
-    // Standard initialization
-    // If you are not using these features and wish to reduce the size
-    //  of your final executable, you should remove from the following
-    //  the specific initialization routines you do not need.
-
-    CPocketPJDlg dlg;
-    m_pMainWnd = &dlg;
-    int nResponse = dlg.DoModal();
-
-    if (nResponse == IDOK) {
-        // TODO: Place code here to handle when the dialog is
-        //  dismissed with OK
-    } else if (nResponse == IDCANCEL) {
-        // TODO: Place code here to handle when the dialog is
-        //  dismissed with Cancel
-    }
-
-    // Since the dialog has been closed, return FALSE so that we exit the
-    //  application, rather than start the application's message pump.
-    return FALSE;
-}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.cpp
deleted file mode 100644
index ca8014a245239e2c5c52747a5506cf68e8ad01db..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.cpp
+++ /dev/null
@@ -1,824 +0,0 @@
-// PocketPJDlg.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "PocketPJ.h"
-#include "PocketPJDlg.h"
-#include <iphlpapi.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-#define TIMER_ID    101
-static CPocketPJDlg *theDlg;
-
-/////////////////////////////////////////////////////////////////////////////
-// CPocketPJDlg dialog
-
-CPocketPJDlg::CPocketPJDlg (CWnd* pParent /*=NULL*/)
-        : CDialog (CPocketPJDlg::IDD, pParent), m_PopUp (NULL)
-{
-    //{{AFX_DATA_INIT(CPocketPJDlg)
-    // NOTE: the ClassWizard will add member initialization here
-    //}}AFX_DATA_INIT
-    // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
-    m_hIcon = AfxGetApp()->LoadIcon (IDR_MAINFRAME);
-
-    theDlg = this;
-
-    m_PopUp = new CPopUpWnd (this);
-    m_PopUp->Hide();
-
-    unsigned i;
-    m_PopUpCount = 0;
-
-    for (i=0; i<POPUP_MAX_TYPE; ++i) {
-        m_PopUpState[i] = FALSE;
-    }
-}
-
-void CPocketPJDlg::DoDataExchange (CDataExchange* pDX)
-{
-    CDialog::DoDataExchange (pDX);
-    //{{AFX_DATA_MAP(CPocketPJDlg)
-    DDX_Control (pDX, IDC_URL, m_Url);
-    DDX_Control (pDX, IDC_BUDDY_LIST, m_BuddyList);
-    DDX_Control (pDX, IDC_BTN_ACTION, m_BtnUrlAction);
-    DDX_Control (pDX, IDC_BTN_ACC, m_BtnAcc);
-    DDX_Control (pDX, IDC_ACC_ID, m_AccId);
-    //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP (CPocketPJDlg, CDialog)
-    //{{AFX_MSG_MAP(CPocketPJDlg)
-    ON_BN_CLICKED (IDC_BTN_ACC, OnBtnAcc)
-    ON_BN_CLICKED (IDC_BTN_ACTION, OnBtnAction)
-    ON_COMMAND (IDC_ACC_SETTINGS, OnSettings)
-    ON_COMMAND (IDC_URI_CALL, OnUriCall)
-    ON_WM_TIMER()
-    ON_COMMAND (IDC_URI_ADD_BUDDY, OnUriAddBuddy)
-    ON_COMMAND (IDC_URI_DEL_BUDDY, OnUriDelBuddy)
-    ON_COMMAND (IDC_ACC_ONLINE, OnAccOnline)
-    ON_COMMAND (IDC_ACC_INVISIBLE, OnAccInvisible)
-    ON_NOTIFY (NM_CLICK, IDC_BUDDY_LIST, OnClickBuddyList)
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-void CPocketPJDlg::Error (const CString &title, pj_status_t rc)
-{
-    char errmsg[PJ_ERR_MSG_SIZE];
-    wchar_t werrmsg[PJ_ERR_MSG_SIZE];
-
-    pj_strerror (rc, errmsg, sizeof (errmsg));
-    pj_ansi_to_unicode (errmsg, strlen (errmsg), werrmsg, PJ_ARRAY_SIZE (werrmsg));
-
-    AfxMessageBox (title + _T (": ") + werrmsg);
-}
-
-BOOL CPocketPJDlg::Restart()
-{
-    unsigned i;
-    pj_status_t status;
-
-    char ver[80];
-    sprintf (ver, "PocketPJ/%s", pj_get_version());
-
-    ShowWindow (SW_SHOW);
-    PopUp_Show (POPUP_REGISTRATION, ver,
-                "Starting up....", "", "", "", 0);
-
-    KillTimer (TIMER_ID);
-
-    // Destroy first.
-    PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Cleaning up..");
-    pjsua_destroy();
-
-    m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_OFFLINE)));
-    UpdateWindow();
-
-
-    // Create
-    PopUp_Show (POPUP_REGISTRATION, ver,
-                "Starting up....", "Creating stack..", "", "", 0);
-
-    status = pjsua_create();
-
-    if (status != PJ_SUCCESS) {
-        Error (_T ("Error in creating library"), status);
-        PopUp_Hide (POPUP_REGISTRATION);
-        return FALSE;
-    }
-
-    pjsua_config cfg;
-
-    pjsua_logging_config log_cfg;
-    pjsua_media_config media_cfg;
-
-    pjsua_config_default (&cfg);
-    cfg.max_calls = 1;
-    cfg.thread_cnt = 0;
-    cfg.user_agent = pj_str (ver);
-
-    cfg.cb.on_call_state = &on_call_state;
-    cfg.cb.on_call_media_state = &on_call_media_state;
-    cfg.cb.on_incoming_call = &on_incoming_call;
-    cfg.cb.on_reg_state = &on_reg_state;
-    cfg.cb.on_buddy_state = &on_buddy_state;
-    cfg.cb.on_pager = &on_pager;
-
-    /* Configure nameserver */
-    char nameserver[60];
-    {
-        FIXED_INFO fi;
-        ULONG len = sizeof (fi);
-        CString err;
-
-        PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Retrieving network parameters..");
-
-        if (GetNetworkParams (&fi, &len) != ERROR_SUCCESS) {
-            err = _T ("Info: Error querying network parameters. You must configure DNS server.");
-        } else if (fi.CurrentDnsServer == NULL) {
-            err = _T ("Info: DNS server not configured. You must configure DNS server.");
-        }
-
-        if (err.GetLength()) {
-            if (m_Cfg.m_DNS.GetLength()) {
-                pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_DNS, m_Cfg.m_DNS.GetLength(),
-                                     nameserver, sizeof (nameserver));
-                cfg.nameserver_count = 1;
-                cfg.nameserver[0] = pj_str (nameserver);
-            } else {
-                AfxMessageBox (err);
-                pjsua_destroy();
-                PopUp_Hide (POPUP_REGISTRATION);
-                return FALSE;
-            }
-        } else {
-            strcpy (nameserver, fi.CurrentDnsServer->IpAddress.String);
-            cfg.nameserver_count = 1;
-            cfg.nameserver[0] = pj_str (nameserver);
-        }
-    }
-
-    char tmp_stun[80];
-
-    if (m_Cfg.m_UseStun) {
-        pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_StunSrv, m_Cfg.m_StunSrv.GetLength(),
-                             tmp_stun, sizeof (tmp_stun));
-        cfg.stun_host = pj_str (tmp_stun);
-    }
-
-    pjsua_logging_config_default (&log_cfg);
-
-    log_cfg.log_filename = pj_str ("\\PocketPJ.TXT");
-
-    pjsua_media_config_default (&media_cfg);
-    media_cfg.clock_rate = 8000;
-    media_cfg.audio_frame_ptime = 40;
-    media_cfg.ec_tail_len = 0;
-    media_cfg.ilbc_mode = 30;
-    media_cfg.max_media_ports = 8;
-    media_cfg.quality = 5;
-    media_cfg.thread_cnt = 1;
-    media_cfg.enable_ice = m_Cfg.m_UseIce;
-    media_cfg.no_vad = !m_Cfg.m_VAD;
-
-    if (m_Cfg.m_EchoSuppress) {
-        media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE;
-        media_cfg.ec_tail_len = m_Cfg.m_EcTail;
-    }
-
-    // Init
-    PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Initializing..");
-
-    status = pjsua_init (&cfg, &log_cfg, &media_cfg);
-
-    if (status != PJ_SUCCESS) {
-        Error (_T ("Error initializing library"), status);
-        pjsua_destroy();
-        PopUp_Hide (POPUP_REGISTRATION);
-        return FALSE;
-    }
-
-    // Create one UDP transport
-    PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding UDP transport..");
-
-    pjsua_transport_id transport_id;
-
-    pjsua_transport_config udp_cfg;
-
-    pjsua_transport_config_default (&udp_cfg);
-
-    udp_cfg.port = 0;
-
-    status = pjsua_transport_create (PJSIP_TRANSPORT_UDP,
-                                     &udp_cfg, &transport_id);
-
-    if (status != PJ_SUCCESS) {
-        Error (_T ("Error creating UDP transport"), status);
-        pjsua_destroy();
-        PopUp_Hide (POPUP_REGISTRATION);
-        return FALSE;
-    }
-
-    if (m_Cfg.m_TCP) {
-        // Create one TCP transport
-        PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding TCP transport..");
-        pjsua_transport_id transport_id;
-        pjsua_transport_config tcp_cfg;
-
-        pjsua_transport_config_default (&tcp_cfg);
-        tcp_cfg.port = 0;
-        status = pjsua_transport_create (PJSIP_TRANSPORT_TCP,
-                                         &tcp_cfg, &transport_id);
-
-        if (status != PJ_SUCCESS) {
-            Error (_T ("Error creating TCP transport"), status);
-            pjsua_destroy();
-            PopUp_Hide (POPUP_REGISTRATION);
-            return FALSE;
-        }
-    }
-
-    // Adjust codecs priority
-    pj_str_t tmp;
-
-    pjsua_codec_set_priority (pj_cstr (&tmp, "*"), 0);
-
-    for (i=0; i< (unsigned) m_Cfg.m_Codecs.GetSize(); ++i) {
-        CString codec = m_Cfg.m_Codecs.GetAt (i);
-        char tmp_nam[80];
-
-        pj_unicode_to_ansi ( (LPCTSTR) codec, codec.GetLength(),
-                             tmp_nam, sizeof (tmp_nam));
-        pjsua_codec_set_priority (pj_cstr (&tmp, tmp_nam), 200-i);
-    }
-
-    // Start!
-    PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Starting..");
-
-    status = pjsua_start();
-
-    if (status != PJ_SUCCESS) {
-        Error (_T ("Error starting library"), status);
-        pjsua_destroy();
-        PopUp_Hide (POPUP_REGISTRATION);
-        return FALSE;
-    }
-
-    // Add account
-    PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding account..");
-
-    char domain[80], username[80], passwd[80];
-
-    char id[80], reg_uri[80];
-
-    pjsua_acc_config acc_cfg;
-
-    pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_Domain, m_Cfg.m_Domain.GetLength(),
-                         domain, sizeof (domain));
-
-    pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_User, m_Cfg.m_User.GetLength(),
-                         username, sizeof (username));
-
-    pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_Password, m_Cfg.m_Password.GetLength(),
-                         passwd, sizeof (passwd));
-
-    snprintf (id, sizeof (id), "<sip:%s@%s>", username, domain);
-
-    snprintf (reg_uri, sizeof (reg_uri), "sip:%s", domain);
-
-    pjsua_acc_config_default (&acc_cfg);
-
-    acc_cfg.id = pj_str (id);
-
-    acc_cfg.reg_uri = pj_str (reg_uri);
-
-    acc_cfg.cred_count = 1;
-
-    acc_cfg.cred_info[0].scheme = pj_str ("Digest");
-
-    acc_cfg.cred_info[0].realm = pj_str ("*");
-
-    acc_cfg.cred_info[0].username = pj_str (username);
-
-    acc_cfg.cred_info[0].data_type = 0;
-
-    acc_cfg.cred_info[0].data = pj_str (passwd);
-
-#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0)
-    acc_cfg.use_srtp = (m_Cfg.m_UseSrtp ? PJMEDIA_SRTP_OPTIONAL : PJMEDIA_SRTP_DISABLED);
-
-    acc_cfg.srtp_secure_signaling = 0;
-
-#endif
-
-    acc_cfg.publish_enabled = m_Cfg.m_UsePublish;
-
-    char route[80];
-
-    if (m_Cfg.m_TCP) {
-        snprintf (route, sizeof (route), "<sip:%s;lr;transport=tcp>", domain);
-        acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str (route);
-    } else {
-        snprintf (route, sizeof (route), "<sip:%s;lr>", domain);
-        acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str (route);
-    }
-
-    status = pjsua_acc_add (&acc_cfg, PJ_TRUE, &m_PjsuaAccId);
-
-    if (status != PJ_SUCCESS) {
-        Error (_T ("Invalid account settings"), status);
-        pjsua_destroy();
-        PopUp_Hide (POPUP_REGISTRATION);
-        return FALSE;
-    }
-
-    CString acc_text = m_Cfg.m_User + _T ("@") + m_Cfg.m_Domain;
-
-    m_AccId.SetWindowText (acc_text);
-
-    PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE1, acc_text);
-    PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE2, "Registering..");
-    PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "");
-
-    SetTimer (TIMER_ID, 100, NULL);
-    return TRUE;
-}
-
-
-void CPocketPJDlg::PopUp_Show (PopUpType type,
-                               const CString& title1,
-                               const CString& title2,
-                               const CString& title3,
-                               const CString& btn1,
-                               const CString& btn2,
-                               unsigned userData)
-{
-    if (!m_PopUpState[type])
-        ++m_PopUpCount;
-
-    m_PopUpState[type] = TRUE;
-
-    m_PopUpContent[type].m_Title1 = title1;
-
-    m_PopUpContent[type].m_Title2 = title2;
-
-    m_PopUpContent[type].m_Title3 = title3;
-
-    m_PopUpContent[type].m_Btn1 = btn1;
-
-    m_PopUpContent[type].m_Btn2 = btn2;
-
-    m_PopUp->SetContent (m_PopUpContent[type]);
-
-    m_PopUp->Show();
-}
-
-void CPocketPJDlg::PopUp_Modify (PopUpType type,
-                                 PopUpElement el,
-                                 const CString& text)
-{
-    switch (el) {
-
-        case POPUP_EL_TITLE1:
-            m_PopUpContent[type].m_Title1 = text;
-            break;
-
-        case POPUP_EL_TITLE2:
-            m_PopUpContent[type].m_Title2 = text;
-            break;
-
-        case POPUP_EL_TITLE3:
-            m_PopUpContent[type].m_Title3 = text;
-            break;
-
-        case POPUP_EL_BUTTON1:
-            m_PopUpContent[type].m_Btn1 = text;
-            break;
-
-        case POPUP_EL_BUTTON2:
-            m_PopUpContent[type].m_Btn1 = text;
-            break;
-    }
-
-    m_PopUp->SetContent (m_PopUpContent[type]);
-}
-
-void CPocketPJDlg::PopUp_Hide (PopUpType type)
-{
-    if (m_PopUpState[type])
-        --m_PopUpCount;
-
-    m_PopUpState[type] = FALSE;
-
-    if (m_PopUpCount == 0) {
-        m_PopUp->Hide();
-        UpdateWindow();
-    } else {
-        for (int i=POPUP_MAX_TYPE-1; i>=0; --i) {
-            if (m_PopUpState[i]) {
-                m_PopUp->SetContent (m_PopUpContent[i]);
-                break;
-            }
-        }
-    }
-}
-
-void CPocketPJDlg::OnCallState()
-{
-    pjsua_call_info ci;
-
-    pjsua_call_get_info (0, &ci);
-
-    switch (ci.state) {
-
-        case PJSIP_INV_STATE_NULL:	    /**< Before INVITE is sent or received  */
-            break;
-
-        case PJSIP_INV_STATE_CALLING:   /**< After INVITE is sent		    */
-            PopUp_Show (POPUP_CALL, "Calling..", ci.remote_info.ptr, "",
-                        "", "Hangup", 0);
-            break;
-
-        case PJSIP_INV_STATE_INCOMING:  /**< After INVITE is received.	    */
-            PopUp_Show (POPUP_CALL, "Incoming call..", ci.remote_info.ptr, "",
-                        "Answer", "Hangup", 0);
-            pjsua_call_answer (0, 180, NULL, NULL);
-
-            if (m_Cfg.m_AutoAnswer)
-                OnPopUpButton (1);
-
-            break;
-
-        case PJSIP_INV_STATE_EARLY:	    /**< After response with To tag.	    */
-
-        case PJSIP_INV_STATE_CONNECTING:/**< After 2xx is sent/received.	    */
-
-        case PJSIP_INV_STATE_CONFIRMED: { /**< After ACK is sent/received.	    */
-            CString stateText = ci.state_text.ptr;
-            PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, stateText);
-        }
-
-        break;
-
-        case PJSIP_INV_STATE_DISCONNECTED:/**< Session is terminated.	    */
-            PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, "Disconnected");
-            PopUp_Hide (POPUP_CALL);
-            break;
-    }
-}
-
-void CPocketPJDlg::on_call_state (pjsua_call_id call_id, pjsip_event *e)
-{
-    theDlg->OnCallState();
-}
-
-void CPocketPJDlg::on_call_media_state (pjsua_call_id call_id)
-{
-    pjsua_call_info call_info;
-
-    pjsua_call_get_info (call_id, &call_info);
-
-    if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) {
-        pjsua_conf_connect (call_info.conf_slot, 0);
-        pjsua_conf_connect (0, call_info.conf_slot);
-    }
-}
-
-void CPocketPJDlg::on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id,
-                                     pjsip_rx_data *rdata)
-{
-}
-
-void CPocketPJDlg::OnRegState()
-{
-    pjsua_acc_info ai;
-    pjsua_acc_get_info (m_PjsuaAccId, &ai);
-
-    CString acc_text = m_Cfg.m_User + _T ("@") + m_Cfg.m_Domain;
-
-    if (ai.expires>0 && ai.status/100==2) {
-        /* Registration success */
-        HBITMAP old = m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_ONLINE)));
-        acc_text += " (OK)";
-        m_AccId.SetWindowText (acc_text);
-    } else if (ai.status/100 != 2) {
-        acc_text += " (err)";
-        Error (_T ("SIP registration error"), PJSIP_ERRNO_FROM_SIP_STATUS (ai.status));
-        m_AccId.SetWindowText (acc_text);
-    }
-
-    PopUp_Hide (POPUP_REGISTRATION);
-}
-
-void CPocketPJDlg::on_reg_state (pjsua_acc_id acc_id)
-{
-    theDlg->OnRegState();
-}
-
-void CPocketPJDlg::on_buddy_state (pjsua_buddy_id buddy_id)
-{
-    theDlg->RedrawBuddyList();
-}
-
-void CPocketPJDlg::on_pager (pjsua_call_id call_id, const pj_str_t *from,
-                             const pj_str_t *to, const pj_str_t *contact,
-                             const pj_str_t *mime_type, const pj_str_t *text)
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CPocketPJDlg message handlers
-
-BOOL CPocketPJDlg::OnInitDialog()
-{
-    CDialog::OnInitDialog();
-
-    // Set the icon for this dialog.  The framework does this automatically
-    //  when the application's main window is not a dialog
-    SetIcon (m_hIcon, TRUE);			// Set big icon
-    SetIcon (m_hIcon, FALSE);		// Set small icon
-
-    CenterWindow (GetDesktopWindow());	// center to the hpc screen
-
-    // TODO: Add extra initialization here
-
-    m_Cfg.LoadRegistry();
-    //ShowWindow(SW_SHOW);
-    m_AccId.SetWindowText (m_Cfg.m_User);
-
-    CImageList *il = new CImageList;
-    VERIFY (il->Create (16, 16, ILC_COLOR|ILC_MASK, 2, 4));
-
-    CBitmap *bmp = new CBitmap;
-    bmp->LoadBitmap (MAKEINTRESOURCE (IDB_BLANK));
-    il->Add (bmp, RGB (255,255,255));
-    bmp = new CBitmap;
-    bmp->LoadBitmap (MAKEINTRESOURCE (IDB_ONLINE));
-    il->Add (bmp, RGB (255,255,255));
-
-    m_BuddyList.SetImageList (il, LVSIL_SMALL);
-
-    if (m_Cfg.m_Domain.GetLength() ==0 || Restart() == FALSE) {
-        for (;;) {
-            CSettingsDlg dlg (m_Cfg);
-
-            if (dlg.DoModal() != IDOK) {
-                EndDialog (IDOK);
-                return TRUE;
-            }
-
-            m_Cfg.SaveRegistry();
-
-            if (Restart())
-                break;
-        }
-    }
-
-    RedrawBuddyList();
-
-    return TRUE;  // return TRUE  unless you set the focus to a control
-}
-
-
-
-void CPocketPJDlg::OnBtnAcc()
-{
-    CMenu menu;
-    VERIFY (menu.LoadMenu (IDR_ACC_MENU));
-    CMenu* pPopup = menu.GetSubMenu (0);
-    ASSERT (pPopup != NULL);
-
-    RECT r;
-    m_BtnAcc.GetWindowRect (&r);
-    pPopup->TrackPopupMenu (TPM_LEFTALIGN, r.left+4, r.top+4, this);
-}
-
-void CPocketPJDlg::OnBtnAction()
-{
-    CMenu menu;
-    VERIFY (menu.LoadMenu (IDR_URI_MENU));
-    CMenu* pPopup = menu.GetSubMenu (0);
-    ASSERT (pPopup != NULL);
-
-    RECT r;
-    this->m_BtnUrlAction.GetWindowRect (&r);
-    pPopup->TrackPopupMenu (TPM_LEFTALIGN, r.left+4, r.top+4, this);
-}
-
-void CPocketPJDlg::OnSettings()
-{
-    for (;;) {
-        CSettingsDlg dlg (m_Cfg);
-
-        if (dlg.DoModal() != IDOK) {
-            return;
-        }
-
-        m_Cfg.SaveRegistry();
-
-        if (Restart())
-            break;
-    }
-}
-
-void CPocketPJDlg::OnOK()
-{
-    if (AfxMessageBox (_T ("Quit PocketPJ?"), MB_YESNO) ==IDYES) {
-        KillTimer (TIMER_ID);
-        PopUp_Show (POPUP_REGISTRATION, "", "Shutting down..", "", "", "", 0);
-        pjsua_destroy();
-        CDialog::OnOK();
-        PopUp_Hide (POPUP_REGISTRATION);
-        m_Cfg.SaveRegistry();
-        return;
-    }
-}
-
-void CPocketPJDlg::OnTimer (UINT nIDEvent)
-{
-    pjsua_handle_events (10);
-    CDialog::OnTimer (nIDEvent);
-}
-
-int  CPocketPJDlg::FindBuddyInPjsua (const CString &Uri)
-{
-    char uri[80];
-    pjsua_buddy_id  id[128];
-    unsigned i, count = PJ_ARRAY_SIZE (id);
-
-    if (pjsua_enum_buddies (id, &count) != PJ_SUCCESS)
-        return PJSUA_INVALID_ID;
-
-    if (count==0)
-        return PJSUA_INVALID_ID;
-
-    pj_unicode_to_ansi ( (LPCTSTR) Uri, Uri.GetLength(), uri, sizeof (uri));
-
-    for (i=0; i<count; ++i) {
-        pjsua_buddy_info bi;
-        pjsua_buddy_get_info (id[i], &bi);
-
-        if (pj_strcmp2 (&bi.uri, uri) ==0)
-            return i;
-    }
-
-    return PJSUA_INVALID_ID;
-}
-
-int  CPocketPJDlg::FindBuddyInCfg (const CString &uri)
-{
-    int i;
-
-    for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) {
-        if (m_Cfg.m_BuddyList.GetAt (0) == uri) {
-            return i;
-        }
-    }
-
-    return -1;
-}
-
-void CPocketPJDlg::RedrawBuddyList()
-{
-    int i;
-
-    m_BuddyList.DeleteAllItems();
-
-    for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) {
-        int isOnline;
-        int id;
-
-        id = FindBuddyInPjsua (m_Cfg.m_BuddyList.GetAt (i));
-
-        if (id != PJSUA_INVALID_ID) {
-            pjsua_buddy_info bi;
-            pjsua_buddy_get_info (id, &bi);
-            isOnline = (bi.status == PJSUA_BUDDY_STATUS_ONLINE);
-        } else {
-            isOnline = 0;
-        }
-
-        LVITEM lvi;
-
-        memset (&lvi, 0, sizeof (lvi));
-        lvi.mask = LVIF_TEXT  | LVIF_IMAGE;
-        lvi.iItem = i;
-        lvi.iImage = isOnline;
-        lvi.pszText = (LPTSTR) (LPCTSTR) m_Cfg.m_BuddyList.GetAt (i);
-
-        m_BuddyList.InsertItem (&lvi);
-    }
-}
-
-void CPocketPJDlg::OnUriCall()
-{
-    char tmp[120];
-    CString uri;
-    pj_status_t status;
-
-    m_Url.GetWindowText (uri);
-    pj_unicode_to_ansi ( (LPCTSTR) uri, uri.GetLength(), tmp, sizeof (tmp));
-
-    if ( (status=pjsua_verify_sip_url (tmp)) != PJ_SUCCESS) {
-        Error ("The URL is not valid SIP URL", status);
-        return;
-    }
-
-    pj_str_t dest_uri = pj_str (tmp);
-
-    pjsua_call_id call_id;
-
-    status = pjsua_call_make_call (m_PjsuaAccId, &dest_uri, 0, NULL, NULL, &call_id);
-
-    if (status != PJ_SUCCESS)
-        Error ("Unable to make call", status);
-}
-
-void CPocketPJDlg::OnUriAddBuddy()
-{
-    int i;
-    char tmp[120];
-    CString uri;
-    pj_status_t status;
-
-    m_Url.GetWindowText (uri);
-    pj_unicode_to_ansi ( (LPCTSTR) uri, uri.GetLength(), tmp, sizeof (tmp));
-
-    if ( (status=pjsua_verify_sip_url (tmp)) != PJ_SUCCESS) {
-        Error ("The URL is not valid SIP URL", status);
-        return;
-    }
-
-    for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) {
-        if (m_Cfg.m_BuddyList.GetAt (0) == uri) {
-            AfxMessageBox (_T ("The URI is already in the buddy list"));
-            return;
-        }
-    }
-
-    m_Cfg.m_BuddyList.Add (uri);
-
-    RedrawBuddyList();
-}
-
-void CPocketPJDlg::OnUriDelBuddy()
-{
-    CString uri;
-
-    m_Url.GetWindowText (uri);
-    int i = FindBuddyInCfg (uri);
-
-    if (i<0) {
-        /* Buddy not found */
-        return;
-    }
-
-    m_Cfg.m_BuddyList.RemoveAt (i);
-
-    RedrawBuddyList();
-    AfxMessageBox (_T ("Buddy " + uri + " deleted"));
-}
-
-void CPocketPJDlg::OnAccOnline()
-{
-    pjsua_acc_set_online_status (m_PjsuaAccId, PJ_TRUE);
-    m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_ONLINE)));
-}
-
-void CPocketPJDlg::OnAccInvisible()
-{
-    pjsua_acc_set_online_status (m_PjsuaAccId, PJ_FALSE);
-    m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_INVISIBLE)));
-}
-
-void CPocketPJDlg::OnPopUpButton (int btnNo)
-{
-    if (btnNo == 1) {
-        pjsua_call_answer (0, 200, NULL, 0);
-        PopUp_Modify (POPUP_CALL, POPUP_EL_BUTTON1, "");
-    } else if (btnNo == 2) {
-        // Hangup button
-        PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE2, "Hang up..");
-        PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, "");
-        pjsua_call_hangup (0, PJSIP_SC_DECLINE, 0, 0);
-    }
-}
-
-void CPocketPJDlg::OnClickBuddyList (NMHDR* pNMHDR, LRESULT* pResult)
-{
-    POSITION pos = m_BuddyList.GetFirstSelectedItemPosition();
-
-    if (pos != NULL) {
-        int iItem = m_BuddyList.GetNextSelectedItem (pos);
-        CString uri = m_BuddyList.GetItemText (iItem, 0);
-        m_Url.SetWindowText (uri);
-    }
-
-    *pResult = 0;
-}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.cpp
deleted file mode 100644
index a92d2454e21f48256aa624a55358b576c276ebc3..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.cpp
+++ /dev/null
@@ -1,250 +0,0 @@
-#include "stdafx.h"
-#include "PopUpWnd.h"
-#include "resource.h"
-#include "PocketPJDlg.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-#define IDC_BTN1     10
-#define IDC_BTN2     11
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CPopUpWnd
-
-CPopUpWnd::CPopUpWnd (CPocketPJDlg* pParent)
-{
-    Create (pParent);
-}
-
-CPopUpWnd::~CPopUpWnd()
-{
-    DestroyWindow();
-}
-
-BOOL CPopUpWnd::Create (CPocketPJDlg* pParent)
-{
-    BOOL bSuccess;
-
-    m_ParentWnd = pParent;
-
-    // Register window class
-    CString csClassName = AfxRegisterWndClass (CS_HREDRAW|CS_VREDRAW,
-                          0,
-                          CBrush (::GetSysColor (COLOR_BTNFACE)));
-
-    // Create popup window
-    bSuccess = CreateEx (WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style
-                         csClassName,                       // Classname
-                         _T ("PocketPJ"),                   // Title
-                         WS_POPUP|WS_BORDER|WS_CAPTION,     // style
-                         0,0,                               // position - updated soon.
-                         1,1,				   // Size - updated soon
-                         pParent->GetSafeHwnd(),            // handle to parent
-                         0,                                 // No menu
-                         NULL);
-
-    if (!bSuccess)
-        return FALSE;
-
-    ShowWindow (SW_HIDE);
-
-    // Now create the controls
-    CRect TempRect (0,0,10,10);
-
-    /* |SS_LEFTNOWORDWRAP */
-    bSuccess = m_Title1.Create (_T ("Title1"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX,
-                                TempRect, this, IDC_TITLE1);
-
-    if (!bSuccess)
-        return FALSE;
-
-    bSuccess = m_Title2.Create (_T ("Title2"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX,
-                                TempRect, this, IDC_TITLE2);
-
-    if (!bSuccess)
-        return FALSE;
-
-    bSuccess = m_Title3.Create (_T ("Title3"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX,
-                                TempRect, this, IDC_TITLE3);
-
-    if (!bSuccess)
-        return FALSE;
-
-    bSuccess = m_Btn1.Create (_T ("Button1"),
-                              WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON,
-                              TempRect, this, IDC_BTN1);
-
-    if (!bSuccess)
-        return FALSE;
-
-    bSuccess = m_Btn2.Create (_T ("Button2"),
-                              WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON,
-                              TempRect, this, IDC_BTN2);
-
-    if (!bSuccess)
-        return FALSE;
-
-    CFont *ft1 = new CFont,
-    *ft2 = new CFont,
-    *ft3 = new CFont;
-
-
-    LOGFONT lf;
-
-    memset (&lf, 0, sizeof (LOGFONT));
-
-    lf.lfHeight = 12;
-
-    lstrcpy (lf.lfFaceName, _T ("Arial"));
-
-    VERIFY (ft1->CreateFontIndirect (&lf));
-
-    VERIFY (ft3->CreateFontIndirect (&lf));
-
-    lf.lfHeight = 20;
-
-    VERIFY (ft2->CreateFontIndirect (&lf));
-
-    m_Title1.SetFont (ft1, TRUE);
-
-    m_Title2.SetFont (ft2, TRUE);
-
-    m_Title3.SetFont (ft3, TRUE);
-
-
-    SetWindowSize();
-
-    // Center and show window
-    CenterWindow();
-
-    Show();
-
-    return TRUE;
-}
-
-void CPopUpWnd::SetContent (const CPopUpContent &content)
-{
-    m_Title1.SetWindowText (content.m_Title1);
-    m_Title2.SetWindowText (content.m_Title2);
-    m_Title3.SetWindowText (content.m_Title3);
-
-    if (content.m_Btn1 != "") {
-        m_Btn1.SetWindowText (content.m_Btn1);
-        m_Btn1.ShowWindow (SW_SHOW);
-    } else {
-        m_Btn1.ShowWindow (SW_HIDE);
-    }
-
-    if (content.m_Btn2 != "") {
-        m_Btn2.SetWindowText (content.m_Btn2);
-        m_Btn2.ShowWindow (SW_SHOW);
-    } else {
-        m_Btn2.ShowWindow (SW_HIDE);
-    }
-
-    UpdateWindow();
-
-    ShowWindow (SW_SHOW);
-}
-
-void CPopUpWnd::SetWindowSize (int width, int height)
-{
-    enum { H1 = 16, H2 = 40, H3 = 16, S = 5, G = 10, BW=60, BH=20, BG=40};
-
-    CRect rootRect (0, 0, 320, 240);
-    int Y;
-
-    MoveWindow ( (rootRect.Width() - width) /2, (rootRect.Height() - height) /2,
-                 width, height);
-
-    m_Title1.MoveWindow (10, Y=S, width-20, H1);
-    m_Title2.MoveWindow (10, Y+=H1+G, width-20, H2);
-    m_Title3.MoveWindow (10, Y+=H2+G, width-20, H3);
-
-    m_Btn1.MoveWindow ( (width-2*BW-BG) /2, Y+=H3+G, BW, BH);
-    m_Btn2.MoveWindow ( (width-2*BW-BG) /2+BW+BG, Y, BW, BH);
-}
-
-void CPopUpWnd::Hide()
-{
-    if (!::IsWindow (GetSafeHwnd()))
-        return;
-
-    if (IsWindowVisible()) {
-        ShowWindow (SW_HIDE);
-        ModifyStyle (WS_VISIBLE, 0);
-    }
-}
-
-void CPopUpWnd::Show()
-{
-    if (!::IsWindow (GetSafeHwnd()))
-        return;
-
-    ModifyStyle (0, WS_VISIBLE);
-
-    ShowWindow (SW_SHOWNA);
-
-    RedrawWindow (NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW);
-}
-
-BEGIN_MESSAGE_MAP (CPopUpWnd, CWnd)
-    //{{AFX_MSG_MAP(CPopUpWnd)
-    ON_WM_ERASEBKGND()
-    //}}AFX_MSG_MAP
-    ON_BN_CLICKED (IDC_BTN1, OnCancel1)
-    ON_BN_CLICKED (IDC_BTN2, OnCancel2)
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CPopUpWnd message handlers
-
-BOOL CPopUpWnd::OnEraseBkgnd (CDC* pDC)
-{
-    CBrush backBrush;
-    backBrush.CreateSolidBrush (RGB (255,255,255));
-    CBrush* pOldBrush = pDC->SelectObject (&backBrush);
-
-    CRect rect;
-    pDC->GetClipBox (&rect);    // Erase the area needed
-    pDC->PatBlt (rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
-    pDC->SelectObject (pOldBrush);
-
-    return TRUE;
-}
-
-void CPopUpWnd::OnCancel1()
-{
-    m_ParentWnd->OnPopUpButton (1);
-}
-
-
-void CPopUpWnd::OnCancel2()
-{
-    m_ParentWnd->OnPopUpButton (2);
-}
-
-
-BOOL CPopUpWnd::DestroyWindow()
-{
-    return CWnd::DestroyWindow();
-}
-
-void CPopUpWnd::PeekAndPump()
-{
-    MSG msg;
-
-    while (::PeekMessage (&msg, NULL,0,0,PM_NOREMOVE)) {
-        if (!AfxGetApp()->PumpMessage()) {
-            ::PostQuitMessage (0);
-            return;
-        }
-    }
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.cpp
deleted file mode 100644
index 6d963f81fa3ec9b2ec11faf8c56bd006f3464868..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.cpp
+++ /dev/null
@@ -1,418 +0,0 @@
-// SettingsDlg.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "PocketPJ.h"
-#include "SettingsDlg.h"
-#include <pjsua-lib/pjsua.h>
-#include <atlbase.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-#define REG_PATH	_T("pjsip.org\\PocketPC")
-#define REG_DOMAIN	_T("Domain")
-#define REG_USER	_T("User")
-#define REG_PASSWD	_T("Data")
-#define REG_USE_STUN	_T("UseSTUN")
-#define REG_STUN_SRV	_T("STUNSrv")
-#define REG_DNS		_T("DNS")
-#define REG_USE_ICE	_T("UseICE")
-#define REG_USE_SRTP	_T("UseSRTP")
-#define REG_USE_PUBLISH	_T("UsePUBLISH")
-#define REG_BUDDY_CNT	_T("BuddyCnt")
-#define REG_BUDDY_X	_T("Buddy%u")
-#define REG_ENABLE_EC	_T("EnableEC")
-#define REG_EC_TAIL	_T("ECTail")
-#define REG_ENABLE_VAD	_T("EnableVAD")
-#define REG_ENABLE_TCP	_T("EnableTCP")
-#define REG_CODEC_CNT	_T("CodecCnt")
-#define REG_CODEC_X	_T("Codec%u")
-#define REG_AUTO_ANSWER	_T("AutoAnswer")
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Settings
-CPocketPJSettings::CPocketPJSettings()
-        : m_UseStun (FALSE), m_UseIce (FALSE), m_UseSrtp (FALSE), m_UsePublish (FALSE),
-        m_EchoSuppress (TRUE), m_EcTail (200), m_TCP (FALSE), m_VAD (FALSE),
-        m_AutoAnswer (FALSE)
-{
-    /* Init codec list */
-#if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC
-    m_Codecs.Add (_T ("GSM"));
-#endif
-#if defined(PJMEDIA_HAS_G711_CODEC) && PJMEDIA_HAS_G711_CODEC
-    m_Codecs.Add (_T ("PCMU"));
-    m_Codecs.Add (_T ("PCMA"));
-#endif
-#if defined(PJMEDIA_HAS_SPEEX_CODEC) && PJMEDIA_HAS_SPEEX_CODEC
-    m_Codecs.Add (_T ("Speex"));
-#endif
-}
-
-// Load from registry
-void CPocketPJSettings::LoadRegistry()
-{
-    CRegKey key;
-    wchar_t textVal[256];
-    DWORD dwordVal;
-    DWORD cbData;
-
-
-    if (key.Open (HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS)
-        return;
-
-    cbData = sizeof (textVal);
-
-    if (key.QueryValue (textVal, REG_DOMAIN, &cbData) == ERROR_SUCCESS) {
-        m_Domain = textVal;
-    }
-
-    cbData = sizeof (textVal);
-
-    if (key.QueryValue (textVal, REG_USER, &cbData) == ERROR_SUCCESS) {
-        m_User = textVal;
-    }
-
-    cbData = sizeof (textVal);
-
-    if (key.QueryValue (textVal, REG_PASSWD, &cbData) == ERROR_SUCCESS) {
-        m_Password = textVal;
-    }
-
-    cbData = sizeof (textVal);
-
-    if (key.QueryValue (textVal, REG_STUN_SRV, &cbData) == ERROR_SUCCESS) {
-        m_StunSrv = textVal;
-    }
-
-    cbData = sizeof (textVal);
-
-    if (key.QueryValue (textVal, REG_DNS, &cbData) == ERROR_SUCCESS) {
-        m_DNS = textVal;
-    }
-
-    dwordVal = 0;
-
-    if (key.QueryValue (dwordVal, REG_USE_STUN) == ERROR_SUCCESS) {
-        m_UseStun = dwordVal != 0;
-    }
-
-    if (key.QueryValue (dwordVal, REG_USE_ICE) == ERROR_SUCCESS) {
-        m_UseIce = dwordVal != 0;
-    }
-
-
-    if (key.QueryValue (dwordVal, REG_USE_SRTP) == ERROR_SUCCESS) {
-        m_UseSrtp = dwordVal != 0;
-    }
-
-
-    cbData = sizeof (dwordVal);
-
-    if (key.QueryValue (dwordVal, REG_USE_PUBLISH) == ERROR_SUCCESS) {
-        m_UsePublish = dwordVal != 0;
-    }
-
-    cbData = sizeof (dwordVal);
-
-    if (key.QueryValue (dwordVal, REG_ENABLE_EC) == ERROR_SUCCESS) {
-        m_EchoSuppress = dwordVal != 0;
-    }
-
-    cbData = sizeof (dwordVal);
-
-    if (key.QueryValue (dwordVal, REG_EC_TAIL) == ERROR_SUCCESS) {
-        m_EcTail = dwordVal;
-    }
-
-    cbData = sizeof (dwordVal);
-
-    if (key.QueryValue (dwordVal, REG_ENABLE_TCP) == ERROR_SUCCESS) {
-        m_TCP = dwordVal != 0;
-    }
-
-    cbData = sizeof (dwordVal);
-
-    if (key.QueryValue (dwordVal, REG_ENABLE_VAD) == ERROR_SUCCESS) {
-        m_VAD = dwordVal != 0;
-    }
-
-    cbData = sizeof (dwordVal);
-
-    if (key.QueryValue (dwordVal, REG_AUTO_ANSWER) == ERROR_SUCCESS) {
-        m_AutoAnswer = dwordVal != 0;
-    }
-
-    m_BuddyList.RemoveAll();
-
-    DWORD buddyCount = 0;
-    cbData = sizeof (dwordVal);
-
-    if (key.QueryValue (dwordVal, REG_BUDDY_CNT) == ERROR_SUCCESS) {
-        buddyCount = dwordVal;
-    }
-
-    unsigned i;
-
-    for (i=0; i<buddyCount; ++i) {
-        CString entry;
-        entry.Format (REG_BUDDY_X, i);
-
-        cbData = sizeof (textVal);
-
-        if (key.QueryValue (textVal, entry, &cbData) == ERROR_SUCCESS) {
-            m_BuddyList.Add (textVal);
-        }
-    }
-
-    DWORD codecCount = 0;
-
-    cbData = sizeof (dwordVal);
-
-    if (key.QueryValue (codecCount, REG_CODEC_CNT) == ERROR_SUCCESS) {
-
-        m_Codecs.RemoveAll();
-
-        for (i=0; i<codecCount; ++i) {
-            CString entry;
-            entry.Format (REG_CODEC_X, i);
-
-            cbData = sizeof (textVal);
-
-            if (key.QueryValue (textVal, entry, &cbData) == ERROR_SUCCESS) {
-                m_Codecs.Add (textVal);
-            }
-        }
-    }
-
-    key.Close();
-}
-
-// Save to registry
-void CPocketPJSettings::SaveRegistry()
-{
-    CRegKey key;
-
-    if (key.Create (HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS)
-        return;
-
-    key.SetValue (m_Domain, REG_DOMAIN);
-
-    key.SetValue (m_User, REG_USER);
-
-    key.SetValue (m_Password, REG_PASSWD);
-
-    key.SetValue (m_StunSrv, REG_STUN_SRV);
-
-    key.SetValue (m_DNS, REG_DNS);
-
-    key.SetValue (m_UseStun, REG_USE_STUN);
-
-    key.SetValue (m_UseIce, REG_USE_ICE);
-
-    key.SetValue (m_UseSrtp, REG_USE_SRTP);
-
-    key.SetValue (m_UsePublish, REG_USE_PUBLISH);
-
-    key.SetValue (m_EchoSuppress, REG_ENABLE_EC);
-
-    key.SetValue (m_EcTail, REG_EC_TAIL);
-
-    key.SetValue (m_TCP, REG_ENABLE_TCP);
-
-    key.SetValue (m_VAD, REG_ENABLE_VAD);
-
-    key.SetValue (m_AutoAnswer, REG_AUTO_ANSWER);
-
-    key.SetValue (m_BuddyList.GetSize(), REG_BUDDY_CNT);
-
-    int i;
-
-    for (i=0; i<m_BuddyList.GetSize(); ++i) {
-        CString entry;
-        entry.Format (REG_BUDDY_X, i);
-        key.SetValue (m_BuddyList.GetAt (i), entry);
-    }
-
-    DWORD N = m_Codecs.GetSize();
-
-    key.SetValue (N, REG_CODEC_CNT);
-
-    for (i=0; i<m_Codecs.GetSize(); ++i) {
-        CString entry;
-        entry.Format (REG_CODEC_X, i);
-        key.SetValue (m_Codecs.GetAt (i), entry);
-    }
-
-    key.Close();
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CSettingsDlg dialog
-
-
-CSettingsDlg::CSettingsDlg (CPocketPJSettings &cfg, CWnd* pParent)
-        : CDialog (CSettingsDlg::IDD, pParent), m_Cfg (cfg)
-{
-    //{{AFX_DATA_INIT(CSettingsDlg)
-    m_Domain = _T ("");
-    m_ICE = FALSE;
-    m_Passwd = _T ("");
-    m_PUBLISH = FALSE;
-    m_SRTP = FALSE;
-    m_STUN = FALSE;
-    m_StunSrv = _T ("");
-    m_User = _T ("");
-    m_Dns = _T ("");
-    m_EchoSuppress = FALSE;
-    m_EcTail = _T ("");
-    m_TCP = FALSE;
-    m_VAD = FALSE;
-    m_AutoAnswer = FALSE;
-    //}}AFX_DATA_INIT
-
-    m_Domain    = m_Cfg.m_Domain;
-    m_ICE	    = m_Cfg.m_UseIce;
-    m_Passwd    = m_Cfg.m_Password;
-    m_PUBLISH   = m_Cfg.m_UsePublish;
-    m_SRTP	    = m_Cfg.m_UseSrtp;
-    m_STUN	    = m_Cfg.m_UseStun;
-    m_StunSrv   = m_Cfg.m_StunSrv;
-    m_User	    = m_Cfg.m_User;
-    m_Dns	    = m_Cfg.m_DNS;
-    m_EchoSuppress = m_Cfg.m_EchoSuppress;
-    m_TCP	    = m_Cfg.m_TCP;
-    m_VAD	    = m_Cfg.m_VAD;
-    m_AutoAnswer= m_Cfg.m_AutoAnswer;
-
-    CString s;
-    s.Format (_T ("%d"), m_Cfg.m_EcTail);
-    m_EcTail    = s;
-
-}
-
-
-void CSettingsDlg::DoDataExchange (CDataExchange* pDX)
-{
-    CDialog::DoDataExchange (pDX);
-    //{{AFX_DATA_MAP(CSettingsDlg)
-    DDX_Control (pDX, IDC_CODECS, m_Codecs);
-    DDX_Text (pDX, IDC_DOMAIN, m_Domain);
-    DDX_Check (pDX, IDC_ICE, m_ICE);
-    DDX_Text (pDX, IDC_PASSWD, m_Passwd);
-    DDX_Check (pDX, IDC_PUBLISH, m_PUBLISH);
-    DDX_Check (pDX, IDC_SRTP, m_SRTP);
-    DDX_Check (pDX, IDC_STUN, m_STUN);
-    DDX_Text (pDX, IDC_STUN_SRV, m_StunSrv);
-    DDX_Text (pDX, IDC_USER, m_User);
-    DDX_Text (pDX, IDC_DNS, m_Dns);
-    DDX_Check (pDX, IDC_ECHO_SUPPRESS, m_EchoSuppress);
-    DDX_Text (pDX, IDC_EC_TAIL, m_EcTail);
-    DDX_Check (pDX, IDC_TCP, m_TCP);
-    DDX_Check (pDX, IDC_VAD, m_VAD);
-    DDX_Check (pDX, IDC_AA, m_AutoAnswer);
-    //}}AFX_DATA_MAP
-
-
-    if (m_Codecs.GetCount() == 0) {
-        int i;
-
-        for (i=0; i<m_Cfg.m_Codecs.GetSize(); ++i) {
-            m_Codecs.AddString (m_Cfg.m_Codecs.GetAt (i));
-        }
-
-        m_Codecs.SetCurSel (0);
-    }
-}
-
-
-BEGIN_MESSAGE_MAP (CSettingsDlg, CDialog)
-    //{{AFX_MSG_MAP(CSettingsDlg)
-    ON_BN_CLICKED (IDC_STUN, OnStun)
-    ON_BN_CLICKED (IDC_ECHO_SUPPRESS, OnEchoSuppress)
-    ON_CBN_SELCHANGE (IDC_CODECS, OnSelchangeCodecs)
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CSettingsDlg message handlers
-
-int CSettingsDlg::DoModal()
-{
-    int rc = CDialog::DoModal();
-
-    return rc;
-}
-
-void CSettingsDlg::OnStun()
-{
-}
-
-void CSettingsDlg::OnEchoSuppress()
-{
-}
-
-void CSettingsDlg::OnSelchangeCodecs()
-{
-    int cur = m_Codecs.GetCurSel();
-
-    if (cur < 1)
-        return;
-
-    CString codec;
-
-    DWORD N;
-
-    m_Codecs.GetLBText (cur, codec);
-
-    N = m_Codecs.GetCount();
-
-    m_Codecs.DeleteString (cur);
-
-    N = m_Codecs.GetCount();
-
-    m_Codecs.InsertString (0, codec);
-
-    N = m_Codecs.GetCount();
-
-    m_Codecs.SetCurSel (0);
-}
-
-
-void CSettingsDlg::OnOK()
-{
-    UpdateData (TRUE);
-
-    m_Cfg.m_Domain	= m_Domain;
-    m_Cfg.m_UseIce	= m_ICE != 0;
-    m_Cfg.m_Password	= m_Passwd;
-    m_Cfg.m_UsePublish	= m_PUBLISH != 0;
-    m_Cfg.m_UseSrtp	= m_SRTP != 0;
-    m_Cfg.m_UseStun	= m_STUN != 0;
-    m_Cfg.m_StunSrv	= m_StunSrv;
-    m_Cfg.m_User	= m_User;
-    m_Cfg.m_DNS		= m_Dns;
-    m_Cfg.m_EchoSuppress= m_EchoSuppress != 0;
-    m_Cfg.m_EcTail	= _ttoi (m_EcTail);
-    m_Cfg.m_TCP		= m_TCP != 0;
-    m_Cfg.m_VAD		= m_VAD != 0;
-    m_Cfg.m_AutoAnswer	= m_AutoAnswer != 0;
-
-    unsigned i;
-    m_Cfg.m_Codecs.RemoveAll();
-    DWORD N = m_Codecs.GetCount();
-
-    for (i=0; i<N; ++i) {
-        CString codec;
-        m_Codecs.GetLBText (i, codec);
-        m_Cfg.m_Codecs.Add (codec);
-    }
-
-    CDialog::OnOK();
-}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.cpp
deleted file mode 100644
index 6e790f246d61316afcd7f7edcd995f0af709dbc4..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.cpp
+++ /dev/null
@@ -1,1000 +0,0 @@
-/* $Id: ua.cpp 2482 2009-03-02 15:50:12Z nanang $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pjsua-lib/pjsua.h>
-#include <pjsua-lib/pjsua_internal.h>
-#include "ua.h"
-
-#define THIS_FILE	"symbian_ua.cpp"
-#define LOG_LEVEL	3
-
-//
-// Basic config.
-//
-#define SIP_PORT	5060
-
-
-//
-// Destination URI (to make call, or to subscribe presence)
-//
-#define SIP_DST_URI	"sip:100@pjsip.lab"
-
-//
-// Account
-//
-#define HAS_SIP_ACCOUNT	0	// 1 to enable registration
-#define SIP_DOMAIN	"pjsip.lab"
-#define SIP_USER	"400"
-#define SIP_PASSWD	"400"
-
-//
-// Outbound proxy for all accounts
-//
-#define SIP_PROXY	NULL
-//#define SIP_PROXY	"<sip:192.168.0.8;lr>"
-
-
-//
-// Configure nameserver if DNS SRV is to be used with both SIP
-// or STUN (for STUN see other settings below)
-//
-#define NAMESERVER	NULL
-//#define NAMESERVER	"192.168.0.2"
-
-//
-// STUN server
-#if 0
-// Use this to have the STUN server resolved normally
-#   define STUN_DOMAIN	NULL
-#   define STUN_SERVER	"stun.pjsip.org"
-#elif 0
-// Use this to have the STUN server resolved with DNS SRV
-#   define STUN_DOMAIN	"pjsip.org"
-#   define STUN_SERVER	NULL
-#else
-// Use this to disable STUN
-#   define STUN_DOMAIN	NULL
-#   define STUN_SERVER	NULL
-#endif
-
-//
-// Use ICE?
-//
-#define USE_ICE		1
-
-//
-// Use SRTP?
-//
-#define USE_SRTP 	PJSUA_DEFAULT_USE_SRTP
-
-//
-// Globals
-//
-static pjsua_acc_id g_acc_id = PJSUA_INVALID_ID;
-static pjsua_call_id g_call_id = PJSUA_INVALID_ID;
-static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID;
-
-
-/* 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);
-
-    if (g_call_id != PJSUA_INVALID_ID) {
-        pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, NULL, NULL);
-        return;
-    }
-
-    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));
-
-    g_call_id = call_id;
-
-    /* Automatically answer incoming calls with 180/Ringing */
-    pjsua_call_answer (call_id, 180, 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);
-
-    if (ci.state == PJSIP_INV_STATE_DISCONNECTED) {
-        if (call_id == g_call_id)
-            g_call_id = PJSUA_INVALID_ID;
-    } else if (ci.state != PJSIP_INV_STATE_INCOMING) {
-        if (g_call_id == PJSUA_INVALID_ID)
-            g_call_id = call_id;
-    }
-
-    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);
-    }
-}
-
-
-/* Handler on buddy state changed. */
-static void on_buddy_state (pjsua_buddy_id buddy_id)
-{
-    pjsua_buddy_info info;
-    pjsua_buddy_get_info (buddy_id, &info);
-
-    PJ_LOG (3, (THIS_FILE, "%.*s status is %.*s",
-                (int) info.uri.slen,
-                info.uri.ptr,
-                (int) info.status_text.slen,
-                info.status_text.ptr));
-}
-
-
-/* Incoming IM message (i.e. MESSAGE request)!  */
-static void on_pager (pjsua_call_id call_id, const pj_str_t *from,
-                      const pj_str_t *to, const pj_str_t *contact,
-                      const pj_str_t *mime_type, const pj_str_t *text)
-{
-    /* Note: call index may be -1 */
-    PJ_UNUSED_ARG (call_id);
-    PJ_UNUSED_ARG (to);
-    PJ_UNUSED_ARG (contact);
-    PJ_UNUSED_ARG (mime_type);
-
-    PJ_LOG (3, (THIS_FILE,"MESSAGE from %.*s: %.*s",
-                (int) from->slen, from->ptr,
-                (int) text->slen, text->ptr));
-}
-
-
-/* Received typing indication  */
-static void on_typing (pjsua_call_id call_id, const pj_str_t *from,
-                       const pj_str_t *to, const pj_str_t *contact,
-                       pj_bool_t is_typing)
-{
-    PJ_UNUSED_ARG (call_id);
-    PJ_UNUSED_ARG (to);
-    PJ_UNUSED_ARG (contact);
-
-    PJ_LOG (3, (THIS_FILE, "IM indication: %.*s %s",
-                (int) from->slen, from->ptr,
-                (is_typing?"is typing..":"has stopped typing")));
-}
-
-
-/* Call transfer request status. */
-static void on_call_transfer_status (pjsua_call_id call_id,
-                                     int status_code,
-                                     const pj_str_t *status_text,
-                                     pj_bool_t final,
-                                     pj_bool_t *p_cont)
-{
-    PJ_LOG (3, (THIS_FILE, "Call %d: transfer status=%d (%.*s) %s",
-                call_id, status_code,
-                (int) status_text->slen, status_text->ptr,
-                (final ? "[final]" : "")));
-
-    if (status_code/100 == 2) {
-        PJ_LOG (3, (THIS_FILE,
-                    "Call %d: call transfered successfully, disconnecting call",
-                    call_id));
-        pjsua_call_hangup (call_id, PJSIP_SC_GONE, NULL, NULL);
-        *p_cont = PJ_FALSE;
-    }
-}
-
-
-/* NAT detection result */
-static void on_nat_detect (const pj_stun_nat_detect_result *res)
-{
-    if (res->status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "NAT detection failed", res->status);
-    } else {
-        PJ_LOG (3, (THIS_FILE, "NAT detected as %s", res->nat_type_name));
-    }
-}
-
-/* Notification that call is being replaced. */
-static void on_call_replaced (pjsua_call_id old_call_id,
-                              pjsua_call_id new_call_id)
-{
-    pjsua_call_info old_ci, new_ci;
-
-    pjsua_call_get_info (old_call_id, &old_ci);
-    pjsua_call_get_info (new_call_id, &new_ci);
-
-    PJ_LOG (3, (THIS_FILE, "Call %d with %.*s is being replaced by "
-                "call %d with %.*s",
-                old_call_id,
-                (int) old_ci.remote_info.slen, old_ci.remote_info.ptr,
-                new_call_id,
-                (int) new_ci.remote_info.slen, new_ci.remote_info.ptr));
-}
-
-
-//#include<e32debug.h>
-
-/* Logging callback */
-static void log_writer (int level, const char *buf, int len)
-{
-    static 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);
-    //RDebug::Print(aBuf);
-    console->Write (aBuf);
-
-}
-
-/*
- * app_startup()
- *
- * url may contain URL to call.
- */
-static pj_status_t app_startup()
-{
-    pj_status_t status;
-
-    /* Redirect log before pjsua_init() */
-    pj_log_set_log_func (&log_writer);
-
-    /* Set log level */
-    pj_log_set_level (LOG_LEVEL);
-
-    /* Create pjsua first! */
-    status = pjsua_create();
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "pjsua_create() error", status);
-        return status;
-    }
-
-    /* Init pjsua */
-    pjsua_config cfg;
-
-    pjsua_logging_config log_cfg;
-
-    pjsua_media_config med_cfg;
-
-    pjsua_config_default (&cfg);
-
-    cfg.max_calls = 2;
-
-    cfg.thread_cnt = 0; // Disable threading on Symbian
-
-    cfg.use_srtp = USE_SRTP;
-
-    cfg.srtp_secure_signaling = 0;
-
-    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;
-
-    cfg.cb.on_buddy_state = &on_buddy_state;
-
-    cfg.cb.on_pager = &on_pager;
-
-    cfg.cb.on_typing = &on_typing;
-
-    cfg.cb.on_call_transfer_status = &on_call_transfer_status;
-
-    cfg.cb.on_call_replaced = &on_call_replaced;
-
-    cfg.cb.on_nat_detect = &on_nat_detect;
-
-    if (SIP_PROXY) {
-        cfg.outbound_proxy_cnt = 1;
-        cfg.outbound_proxy[0] = pj_str (SIP_PROXY);
-    }
-
-    if (NAMESERVER) {
-        cfg.nameserver_count = 1;
-        cfg.nameserver[0] = pj_str (NAMESERVER);
-    }
-
-    if (NAMESERVER && STUN_DOMAIN) {
-        cfg.stun_domain = pj_str (STUN_DOMAIN);
-    } else if (STUN_SERVER) {
-        cfg.stun_host = pj_str (STUN_SERVER);
-    }
-
-
-    pjsua_logging_config_default (&log_cfg);
-
-    log_cfg.level = LOG_LEVEL;
-    log_cfg.console_level = LOG_LEVEL;
-    log_cfg.cb = &log_writer;
-    //log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log");
-
-    pjsua_media_config_default (&med_cfg);
-    med_cfg.thread_cnt = 0; // Disable threading on Symbian
-    med_cfg.has_ioqueue = PJ_FALSE;
-    med_cfg.clock_rate = 8000;
-#if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1)
-    med_cfg.audio_frame_ptime = 20;
-#else
-    med_cfg.audio_frame_ptime = 40;
-#endif
-    med_cfg.ec_tail_len = 0;
-    med_cfg.enable_ice = USE_ICE;
-    med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed
-
-    status = pjsua_init (&cfg, &log_cfg, &med_cfg);
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "pjsua_init() error", status);
-        pjsua_destroy();
-        return status;
-    }
-
-    /* Adjust Speex priority and enable only the narrowband */
-    {
-        pj_str_t codec_id = pj_str ("speex/8000");
-        pjmedia_codec_mgr_set_codec_priority (
-            pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt),
-            &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1);
-
-        codec_id = pj_str ("speex/16000");
-        pjmedia_codec_mgr_set_codec_priority (
-            pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt),
-            &codec_id, PJMEDIA_CODEC_PRIO_DISABLED);
-
-        codec_id = pj_str ("speex/32000");
-        pjmedia_codec_mgr_set_codec_priority (
-            pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt),
-            &codec_id, PJMEDIA_CODEC_PRIO_DISABLED);
-    }
-
-    /* Add UDP transport. */
-    pjsua_transport_config tcfg;
-
-    pjsua_transport_id tid;
-
-    pjsua_transport_config_default (&tcfg);
-
-    tcfg.port = SIP_PORT;
-
-    status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, &tcfg, &tid);
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "Error creating transport", status);
-        pjsua_destroy();
-        return status;
-    }
-
-    /* Add account for the transport */
-    pjsua_acc_add_local (tid, PJ_TRUE, &g_acc_id);
-
-
-    /* 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. */
-    if (HAS_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 ("*");
-        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, &g_acc_id);
-
-        if (status != PJ_SUCCESS) {
-            pjsua_perror (THIS_FILE, "Error adding account", status);
-            pjsua_destroy();
-            return status;
-        }
-    }
-
-    if (SIP_DST_URI) {
-        pjsua_buddy_config bcfg;
-
-        pjsua_buddy_config_default (&bcfg);
-        bcfg.uri = pj_str (SIP_DST_URI);
-        bcfg.subscribe = PJ_FALSE;
-
-        pjsua_buddy_add (&bcfg, &g_buddy_id);
-    }
-
-    return PJ_SUCCESS;
-}
-
-
-////////////////////////////////////////////////////////////////////////////
-/*
- * The interractive console UI
- */
-#include <e32base.h>
-
-class ConsoleUI : public CActive
-{
-
-    public:
-        ConsoleUI (CConsoleBase *con);
-        ~ConsoleUI();
-
-        // Run console UI
-        void Run();
-
-        // Stop
-        void Stop();
-
-    protected:
-        // Cancel asynchronous read.
-        void DoCancel();
-
-        // Implementation: called when read has completed.
-        void RunL();
-
-    private:
-        CConsoleBase *con_;
-};
-
-
-ConsoleUI::ConsoleUI (CConsoleBase *con)
-        : CActive (EPriorityStandard), con_ (con)
-{
-    CActiveScheduler::Add (this);
-}
-
-ConsoleUI::~ConsoleUI()
-{
-    Stop();
-}
-
-// Run console UI
-void ConsoleUI::Run()
-{
-    con_->Read (iStatus);
-    SetActive();
-}
-
-// Stop console UI
-void ConsoleUI::Stop()
-{
-    Cancel();
-}
-
-// Cancel asynchronous read.
-void ConsoleUI::DoCancel()
-{
-    con_->ReadCancel();
-}
-
-static void PrintMenu()
-{
-    PJ_LOG (3, (THIS_FILE, "\n\n"
-                "Menu:\n"
-                "  d    Dump states\n"
-                "  D    Dump states detail\n"
-                "  P    Dump pool factory\n"
-                "  l    Start loopback audio device\n"
-                "  L    Stop loopback audio device\n"
-                "  m    Call " SIP_DST_URI "\n"
-                "  a    Answer call\n"
-                "  g    Hangup all calls\n"
-                "  s    Subscribe " SIP_DST_URI "\n"
-                "  S    Unsubscribe presence\n"
-                "  o    Set account online\n"
-                "  O    Set account offline\n"
-                "  w    Quit\n"));
-}
-
-// Implementation: called when read has completed.
-void ConsoleUI::RunL()
-{
-    TKeyCode kc = con_->KeyCode();
-    pj_bool_t reschedule = PJ_TRUE;
-
-    switch (kc) {
-
-        case 'w':
-            CActiveScheduler::Stop();
-            reschedule = PJ_FALSE;
-            break;
-
-        case 'D':
-
-        case 'd':
-            pjsua_dump (kc == 'D');
-            break;
-
-        case 'p':
-
-        case 'P':
-            pj_pool_factory_dump (pjsua_get_pool_factory(), PJ_TRUE);
-            break;
-
-        case 'l':
-            pjsua_conf_connect (0, 0);
-            break;
-
-        case 'L':
-            pjsua_conf_disconnect (0, 0);
-            break;
-
-        case 'm':
-
-            if (g_call_id != PJSUA_INVALID_ID) {
-                PJ_LOG (3, (THIS_FILE, "Another call is active"));
-                break;
-            }
-
-            if (pjsua_verify_sip_url (SIP_DST_URI) == PJ_SUCCESS) {
-                pj_str_t dst = pj_str (SIP_DST_URI);
-                pjsua_call_make_call (g_acc_id, &dst, 0, NULL,
-                                      NULL, &g_call_id);
-            } else {
-                PJ_LOG (3, (THIS_FILE, "Invalid SIP URI"));
-            }
-
-            break;
-
-        case 'a':
-
-            if (g_call_id != PJSUA_INVALID_ID)
-                pjsua_call_answer (g_call_id, 200, NULL, NULL);
-
-            break;
-
-        case 'g':
-            pjsua_call_hangup_all();
-
-            break;
-
-        case 's':
-
-        case 'S':
-            if (g_buddy_id != PJSUA_INVALID_ID)
-                pjsua_buddy_subscribe_pres (g_buddy_id, kc=='s');
-
-            break;
-
-        case 'o':
-
-        case 'O':
-            pjsua_acc_set_online_status (g_acc_id, kc=='o');
-
-            break;
-
-        default:
-            PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed",
-                        kc, kc));
-
-            break;
-    }
-
-    PrintMenu();
-
-    if (reschedule)
-        Run();
-}
-
-#if 0
-// IP networking related testing
-static pj_status_t test_addr (void)
-{
-    int af;
-    unsigned i, count;
-    pj_addrinfo ai[8];
-    pj_sockaddr ifs[8];
-    const pj_str_t *hostname;
-    pj_hostent he;
-    pj_status_t status;
-
-    pj_log_set_log_func (&log_writer);
-
-    status = pj_init();
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "pj_init() error", status);
-        return status;
-    }
-
-    af = pj_AF_INET();
-
-#if 0
-    pj_in_addr in_addr;
-    pj_str_t aa = pj_str ("1.1.1.1");
-    in_addr = pj_inet_addr (&aa);
-    char *the_addr = pj_inet_ntoa (in_addr);
-    PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr));
-
-    aa = pj_str ("192.168.0.15");
-    in_addr = pj_inet_addr (&aa);
-    the_addr = pj_inet_ntoa (in_addr);
-    PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr));
-
-    aa = pj_str ("2.2.2.2");
-    in_addr = pj_inet_addr (&aa);
-    the_addr = pj_inet_ntoa (in_addr);
-    PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr));
-
-    return -1;
-#endif
-
-    // Hostname
-    hostname = pj_gethostname();
-
-    if (hostname == NULL) {
-        status = PJ_ERESOLVE;
-        pjsua_perror (THIS_FILE, "pj_gethostname() error", status);
-        goto on_return;
-    }
-
-    PJ_LOG (3, (THIS_FILE, "Hostname: %.*s", hostname->slen, hostname->ptr));
-
-    // Gethostbyname
-    status = pj_gethostbyname (hostname, &he);
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "pj_gethostbyname() error", status);
-    } else {
-        PJ_LOG (3, (THIS_FILE, "gethostbyname: %s",
-                    pj_inet_ntoa (* (pj_in_addr*) he.h_addr)));
-    }
-
-    // Getaddrinfo
-    count = PJ_ARRAY_SIZE (ai);
-
-    status = pj_getaddrinfo (af, hostname, &count, ai);
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "pj_getaddrinfo() error", status);
-    } else {
-        for (i=0; i<count; ++i) {
-            char ipaddr[PJ_INET6_ADDRSTRLEN+2];
-            PJ_LOG (3, (THIS_FILE, "Addrinfo: %s",
-                        pj_sockaddr_print (&ai[i].ai_addr, ipaddr, sizeof (ipaddr), 2)));
-        }
-    }
-
-    // Enum interface
-    count = PJ_ARRAY_SIZE (ifs);
-
-    status = pj_enum_ip_interface (af, &count, ifs);
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "pj_enum_ip_interface() error", status);
-    } else {
-        for (i=0; i<count; ++i) {
-            char ipaddr[PJ_INET6_ADDRSTRLEN+2];
-            PJ_LOG (3, (THIS_FILE, "Interface: %s",
-                        pj_sockaddr_print (&ifs[i], ipaddr, sizeof (ipaddr), 2)));
-        }
-    }
-
-    // Get default iinterface
-    status = pj_getdefaultipinterface (af, &ifs[0]);
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "pj_getdefaultipinterface() error", status);
-    } else {
-        char ipaddr[PJ_INET6_ADDRSTRLEN+2];
-        PJ_LOG (3, (THIS_FILE, "Default IP: %s",
-                    pj_sockaddr_print (&ifs[0], ipaddr, sizeof (ipaddr), 2)));
-    }
-
-    // Get default IP address
-    status = pj_gethostip (af, &ifs[0]);
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "pj_gethostip() error", status);
-    } else {
-        char ipaddr[PJ_INET6_ADDRSTRLEN+2];
-        PJ_LOG (3, (THIS_FILE, "Host IP: %s",
-                    pj_sockaddr_print (&ifs[0], ipaddr, sizeof (ipaddr), 2)));
-    }
-
-    status = -1;
-
-on_return:
-    pj_shutdown();
-    return status;
-}
-
-#endif
-
-
-#include <es_sock.h>
-
-#if 0
-// Force network connection to use the first IAP,
-// this is useful for debugging on emulator without GUI.
-// Include commdb.lib & apengine.lib in symbian_ua.mmp file
-// if this is enabled.
-
-#include <apdatahandler.h>
-
-inline void ForceUseFirstIAP()
-{
-    TUint32 rank = 1;
-    TUint32 bearers;
-    TUint32 prompt;
-    TUint32 iap;
-
-    CCommsDatabase* commDb = CCommsDatabase::NewL (EDatabaseTypeIAP);
-    CleanupStack::PushL (commDb);
-
-    CApDataHandler* apDataHandler = CApDataHandler::NewLC (*commDb);
-
-    TCommDbConnectionDirection direction = ECommDbConnectionDirectionOutgoing;
-    apDataHandler->GetPreferredIfDbIapTypeL (rank, direction, bearers, prompt, iap);
-    prompt = ECommDbDialogPrefDoNotPrompt;
-    apDataHandler->SetPreferredIfDbIapTypeL (rank, direction, bearers, (TCommDbDialogPref) prompt, iap, ETrue);
-    CleanupStack::PopAndDestroy (2); // apDataHandler, commDb
-}
-
-static void SelectIAP()
-{
-    ForceUseFirstIAP();
-}
-
-#else
-
-static void SelectIAP()
-{
-}
-
-#endif
-
-
-// Class CConnMon to monitor network connection (RConnection). Whenever
-// the connection is down, it will notify PJLIB and restart PJSUA-LIB.
-
-class CConnMon : public CActive
-{
-
-    public:
-        static CConnMon* NewL (RConnection &conn, RSocketServ &sserver) {
-            CConnMon *self = new (ELeave) CConnMon (conn, sserver);
-            CleanupStack::PushL (self);
-            self->ConstructL();
-            CleanupStack::Pop (self);
-            return self;
-        }
-
-        void Start() {
-            conn_.ProgressNotification (nif_progress_, iStatus);
-            SetActive();
-        }
-
-        void Stop() {
-            Cancel();
-        }
-
-        ~CConnMon() {
-            Stop();
-        }
-
-    private:
-        CConnMon (RConnection &conn, RSocketServ &sserver) :
-                CActive (EPriorityHigh),
-                conn_ (conn),
-                sserver_ (sserver) {
-            CActiveScheduler::Add (this);
-        }
-
-        void ConstructL() {}
-
-        void DoCancel() {
-            conn_.CancelProgressNotification();
-        }
-
-        void RunL() {
-            int stage = nif_progress_().iStage;
-
-            if (stage == KLinkLayerClosed) {
-                pj_status_t status;
-                TInt err;
-
-                // Tell pjlib that connection is down.
-                pj_symbianos_set_connection_status (PJ_FALSE);
-
-                PJ_LOG (3, (THIS_FILE, "RConnection closed, restarting PJSUA.."));
-
-                // Destroy pjsua
-                pjsua_destroy();
-                PJ_LOG (3, (THIS_FILE, "PJSUA destroyed."));
-
-                // Reopen the connection
-                err = conn_.Open (sserver_);
-
-                if (err == KErrNone)
-                    err = conn_.Start();
-
-                if (err != KErrNone) {
-                    CActiveScheduler::Stop();
-                    return;
-                }
-
-                // Reinit Symbian OS param before pj_init()
-                pj_symbianos_params sym_params;
-
-                pj_bzero (&sym_params, sizeof (sym_params));
-
-                sym_params.rsocketserv = &sserver_;
-
-                sym_params.rconnection = &conn_;
-
-                pj_symbianos_set_params (&sym_params);
-
-                // Reinit pjsua
-                status = app_startup();
-
-                if (status != PJ_SUCCESS) {
-                    pjsua_perror (THIS_FILE, "app_startup() error", status);
-                    CActiveScheduler::Stop();
-                    return;
-                }
-
-                PJ_LOG (3, (THIS_FILE, "PJSUA restarted."));
-
-                PrintMenu();
-            }
-
-            Start();
-        }
-
-        RConnection& conn_;
-        RSocketServ& sserver_;
-        TNifProgressBuf nif_progress_;
-};
-
-////////////////////////////////////////////////////////////////////////////
-int ua_main()
-{
-    RSocketServ aSocketServer;
-    RConnection aConn;
-    TInt err;
-    pj_symbianos_params sym_params;
-    pj_status_t status;
-
-    SelectIAP();
-
-    // Initialize RSocketServ
-
-    if ( (err=aSocketServer.Connect()) != KErrNone)
-        return PJ_STATUS_FROM_OS (err);
-
-    // Open up a connection
-    if ( (err=aConn.Open (aSocketServer)) != KErrNone) {
-        aSocketServer.Close();
-        return PJ_STATUS_FROM_OS (err);
-    }
-
-    if ( (err=aConn.Start()) != KErrNone) {
-        aSocketServer.Close();
-        return PJ_STATUS_FROM_OS (err);
-    }
-
-    // Set Symbian OS parameters in pjlib.
-    // This must be done before pj_init() is called.
-    pj_bzero (&sym_params, sizeof (sym_params));
-
-    sym_params.rsocketserv = &aSocketServer;
-
-    sym_params.rconnection = &aConn;
-
-    pj_symbianos_set_params (&sym_params);
-
-    // Initialize pjsua
-    status  = app_startup();
-
-    //status = test_addr();
-    if (status != PJ_SUCCESS) {
-        aConn.Close();
-        aSocketServer.Close();
-        return status;
-    }
-
-
-    // Run the UI
-    ConsoleUI *con = new ConsoleUI (console);
-
-    con->Run();
-
-    PrintMenu();
-
-    // Init & start connection monitor
-    CConnMon *connmon = CConnMon::NewL (aConn, aSocketServer);
-
-    connmon->Start();
-
-    CActiveScheduler::Start();
-
-    delete connmon;
-
-    delete con;
-
-    // Dump memory statistics
-    PJ_LOG (3, (THIS_FILE, "Max heap usage: %u.%03uMB",
-                pjsua_var.cp.peak_used_size / 1000000,
-                (pjsua_var.cp.peak_used_size % 1000000) /1000));
-
-    // check max stack usage
-#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0
-    pj_thread_t* this_thread = pj_thread_this();
-
-    if (!this_thread)
-        return status;
-
-    const char* max_stack_file;
-
-    int max_stack_line;
-
-    status = pj_thread_get_stack_info (this_thread, &max_stack_file, &max_stack_line);
-
-    PJ_LOG (3, (THIS_FILE, "Max stack usage: %u at %s:%d",
-                pj_thread_get_stack_max_usage (this_thread),
-                max_stack_file, max_stack_line));
-
-#endif
-
-    // Shutdown pjsua
-    pjsua_destroy();
-
-    // Close connection and socket server
-    aConn.Close();
-
-    aSocketServer.Close();
-
-    return status;
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp
deleted file mode 100644
index 69d842c37df7062f36df385435f9c5b97caf0431..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
-========================================================================
- Name        : Symbian_ua_guiSettingItemListSettings.cpp
- Author      : nanang
- Copyright   : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-/**
- *	Generated helper class which manages the settings contained
- *	in 'symbian_ua_guiSettingItemList'.  Each CAknSettingItem maintains
- *	a reference to data in this class so that changes in the setting
- *	item list can be synchronized with this storage.
- */
-
-// [[[ begin generated region: do not modify [Generated Includes]
-#include <e32base.h>
-#include <stringloader.h>
-#include <barsread.h>
-#include <symbian_ua_gui.rsg>
-#include "Symbian_ua_guiSettingItemListSettings.h"
-// ]]] end generated region [Generated Includes]
-
-/**
- * C/C++ constructor for settings data, cannot throw
- */
-TSymbian_ua_guiSettingItemListSettings::TSymbian_ua_guiSettingItemListSettings()
-{
-}
-
-/**
- * Two-phase constructor for settings data
- */
-TSymbian_ua_guiSettingItemListSettings* TSymbian_ua_guiSettingItemListSettings::NewL()
-{
-    TSymbian_ua_guiSettingItemListSettings* data = new (ELeave) TSymbian_ua_guiSettingItemListSettings;
-    CleanupStack::PushL (data);
-    data->ConstructL();
-    CleanupStack::Pop (data);
-    return data;
-}
-
-/**
- *	Second phase for initializing settings data
- */
-void TSymbian_ua_guiSettingItemListSettings::ConstructL()
-{
-    // [[[ begin generated region: do not modify [Generated Initializers]
-    {
-        HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR);
-        SetEd_registrar (text->Des());
-        CleanupStack::PopAndDestroy (text);
-    }
-
-    {
-        HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER);
-        SetEd_user (text->Des());
-        CleanupStack::PopAndDestroy (text);
-    }
-
-    SetB_srtp (0);
-    SetB_ice (0);
-    {
-        HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER);
-        SetEd_stun_server (text->Des());
-        CleanupStack::PopAndDestroy (text);
-    }
-
-    // ]]] end generated region [Generated Initializers]
-
-}
-
-// [[[ begin generated region: do not modify [Generated Contents]
-TDes& TSymbian_ua_guiSettingItemListSettings::Ed_registrar()
-{
-    return iEd_registrar;
-}
-
-void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar (const TDesC& aValue)
-{
-    if (aValue.Length() < KEd_registrarMaxLength)
-        iEd_registrar.Copy (aValue);
-    else
-        iEd_registrar.Copy (aValue.Ptr(), KEd_registrarMaxLength);
-}
-
-TDes& TSymbian_ua_guiSettingItemListSettings::Ed_user()
-{
-    return iEd_user;
-}
-
-void TSymbian_ua_guiSettingItemListSettings::SetEd_user (const TDesC& aValue)
-{
-    if (aValue.Length() < KEd_userMaxLength)
-        iEd_user.Copy (aValue);
-    else
-        iEd_user.Copy (aValue.Ptr(), KEd_userMaxLength);
-}
-
-TDes& TSymbian_ua_guiSettingItemListSettings::Ed_password()
-{
-    return iEd_password;
-}
-
-void TSymbian_ua_guiSettingItemListSettings::SetEd_password (const TDesC& aValue)
-{
-    if (aValue.Length() < KEd_passwordMaxLength)
-        iEd_password.Copy (aValue);
-    else
-        iEd_password.Copy (aValue.Ptr(), KEd_passwordMaxLength);
-}
-
-TBool& TSymbian_ua_guiSettingItemListSettings::B_srtp()
-{
-    return iB_srtp;
-}
-
-void TSymbian_ua_guiSettingItemListSettings::SetB_srtp (const TBool& aValue)
-{
-    iB_srtp = aValue;
-}
-
-TBool& TSymbian_ua_guiSettingItemListSettings::B_ice()
-{
-    return iB_ice;
-}
-
-void TSymbian_ua_guiSettingItemListSettings::SetB_ice (const TBool& aValue)
-{
-    iB_ice = aValue;
-}
-
-TDes& TSymbian_ua_guiSettingItemListSettings::Ed_stun_server()
-{
-    return iEd_stun_server;
-}
-
-void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server (const TDesC& aValue)
-{
-    if (aValue.Length() < KEd_stun_serverMaxLength)
-        iEd_stun_server.Copy (aValue);
-    else
-        iEd_stun_server.Copy (aValue.Ptr(), KEd_stun_serverMaxLength);
-}
-
-// ]]] end generated region [Generated Contents]
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp
deleted file mode 100644
index 1e56a4f9fe5f534dd8c26789f89c068b324c340b..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp
+++ /dev/null
@@ -1,564 +0,0 @@
-/* $Id: ua.cpp 1793 2008-02-14 13:39:24Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pjsua-lib/pjsua.h>
-#include <pjsua-lib/pjsua_internal.h>
-#include <es_sock.h>
-#include "symbian_ua.h"
-
-#define THIS_FILE	"symbian_ua.cpp"
-#define LOG_LEVEL	3
-
-#define SIP_PORT	5060
-#define USE_ICE		0
-#define USE_SRTP	PJSUA_DEFAULT_USE_SRTP
-
-static RSocketServ aSocketServer;
-static RConnection aConn;
-
-static pjsua_acc_id g_acc_id = PJSUA_INVALID_ID;
-static pjsua_call_id g_call_id = PJSUA_INVALID_ID;
-static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID;
-
-static symbian_ua_info_cb_t g_cb =  {NULL, NULL, NULL, NULL, NULL};
-
-static void log_writer (int level, const char *buf, int len)
-{
-    static wchar_t buf16[PJ_LOG_MAX_SIZE];
-
-    PJ_UNUSED_ARG (level);
-
-    if (!g_cb.on_info)
-        return;
-
-    pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16));
-
-    g_cb.on_info (buf16);
-}
-
-static void on_reg_state (pjsua_acc_id acc_id)
-{
-    pjsua_acc_info acc_info;
-    pj_status_t status;
-
-    status = pjsua_acc_get_info (acc_id, &acc_info);
-
-    if (status != PJ_SUCCESS)
-        return;
-
-    if (acc_info.status == 200) {
-        if (acc_info.expires) {
-            PJ_LOG (3, (THIS_FILE, "Registration success!"));
-
-            if (g_cb.on_reg_state) g_cb.on_reg_state (true);
-        } else {
-            PJ_LOG (3, (THIS_FILE, "Unregistration success!"));
-
-            if (g_cb.on_unreg_state) g_cb.on_unreg_state (true);
-        }
-    } else {
-        if (acc_info.expires) {
-            PJ_LOG (3, (THIS_FILE, "Registration failed!"));
-
-            if (g_cb.on_reg_state) g_cb.on_reg_state (false);
-        } else {
-            PJ_LOG (3, (THIS_FILE, "Unregistration failed!"));
-
-            if (g_cb.on_unreg_state) g_cb.on_unreg_state (false);
-        }
-    }
-}
-
-/* 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);
-
-    if (g_call_id != PJSUA_INVALID_ID) {
-        pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, NULL, NULL);
-        return;
-    }
-
-    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));
-
-    g_call_id = call_id;
-
-    /* Automatically answer incoming calls with 180/Ringing */
-    pjsua_call_answer (call_id, 180, NULL, NULL);
-
-    if (g_cb.on_incoming_call) {
-        static wchar_t disp[256];
-        static wchar_t uri[PJSIP_MAX_URL_SIZE];
-
-        pj_ansi_to_unicode (ci.remote_info.ptr, ci.remote_info.slen,
-                            disp, PJ_ARRAY_SIZE (disp));
-        pj_ansi_to_unicode (ci.remote_contact.ptr, ci.remote_contact.slen,
-                            uri, PJ_ARRAY_SIZE (uri));
-
-        g_cb.on_incoming_call (disp, uri);
-    }
-}
-
-/* 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);
-
-    if (ci.state == PJSIP_INV_STATE_DISCONNECTED) {
-        if (call_id == g_call_id)
-            g_call_id = PJSUA_INVALID_ID;
-
-        if (g_cb.on_call_end) {
-            static wchar_t reason[256];
-            pj_ansi_to_unicode (ci.last_status_text.ptr, ci.last_status_text.slen,
-                                reason, PJ_ARRAY_SIZE (reason));
-            g_cb.on_call_end (reason);
-        }
-
-    } else if (ci.state != PJSIP_INV_STATE_INCOMING) {
-        if (g_call_id == PJSUA_INVALID_ID)
-            g_call_id = call_id;
-    }
-
-    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);
-    }
-}
-
-
-/* Handler on buddy state changed. */
-static void on_buddy_state (pjsua_buddy_id buddy_id)
-{
-    pjsua_buddy_info info;
-    pjsua_buddy_get_info (buddy_id, &info);
-
-    PJ_LOG (3, (THIS_FILE, "%.*s status is %.*s",
-                (int) info.uri.slen,
-                info.uri.ptr,
-                (int) info.status_text.slen,
-                info.status_text.ptr));
-}
-
-
-/* Incoming IM message (i.e. MESSAGE request)!  */
-static void on_pager (pjsua_call_id call_id, const pj_str_t *from,
-                      const pj_str_t *to, const pj_str_t *contact,
-                      const pj_str_t *mime_type, const pj_str_t *text)
-{
-    /* Note: call index may be -1 */
-    PJ_UNUSED_ARG (call_id);
-    PJ_UNUSED_ARG (to);
-    PJ_UNUSED_ARG (contact);
-    PJ_UNUSED_ARG (mime_type);
-
-    PJ_LOG (3, (THIS_FILE,"MESSAGE from %.*s: %.*s",
-                (int) from->slen, from->ptr,
-                (int) text->slen, text->ptr));
-}
-
-
-/* Received typing indication  */
-static void on_typing (pjsua_call_id call_id, const pj_str_t *from,
-                       const pj_str_t *to, const pj_str_t *contact,
-                       pj_bool_t is_typing)
-{
-    PJ_UNUSED_ARG (call_id);
-    PJ_UNUSED_ARG (to);
-    PJ_UNUSED_ARG (contact);
-
-    PJ_LOG (3, (THIS_FILE, "IM indication: %.*s %s",
-                (int) from->slen, from->ptr,
-                (is_typing?"is typing..":"has stopped typing")));
-}
-
-
-/* Call transfer request status. */
-static void on_call_transfer_status (pjsua_call_id call_id,
-                                     int status_code,
-                                     const pj_str_t *status_text,
-                                     pj_bool_t final,
-                                     pj_bool_t *p_cont)
-{
-    PJ_LOG (3, (THIS_FILE, "Call %d: transfer status=%d (%.*s) %s",
-                call_id, status_code,
-                (int) status_text->slen, status_text->ptr,
-                (final ? "[final]" : "")));
-
-    if (status_code/100 == 2) {
-        PJ_LOG (3, (THIS_FILE,
-                    "Call %d: call transfered successfully, disconnecting call",
-                    call_id));
-        pjsua_call_hangup (call_id, PJSIP_SC_GONE, NULL, NULL);
-        *p_cont = PJ_FALSE;
-    }
-}
-
-
-/* NAT detection result */
-static void on_nat_detect (const pj_stun_nat_detect_result *res)
-{
-    if (res->status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "NAT detection failed", res->status);
-    } else {
-        PJ_LOG (3, (THIS_FILE, "NAT detected as %s", res->nat_type_name));
-    }
-}
-
-/* Notification that call is being replaced. */
-static void on_call_replaced (pjsua_call_id old_call_id,
-                              pjsua_call_id new_call_id)
-{
-    pjsua_call_info old_ci, new_ci;
-
-    pjsua_call_get_info (old_call_id, &old_ci);
-    pjsua_call_get_info (new_call_id, &new_ci);
-
-    PJ_LOG (3, (THIS_FILE, "Call %d with %.*s is being replaced by "
-                "call %d with %.*s",
-                old_call_id,
-                (int) old_ci.remote_info.slen, old_ci.remote_info.ptr,
-                new_call_id,
-                (int) new_ci.remote_info.slen, new_ci.remote_info.ptr));
-}
-
-int symbian_ua_init()
-{
-    TInt err;
-    pj_symbianos_params sym_params;
-    pj_status_t status;
-
-    // Initialize RSocketServ
-
-    if ( (err=aSocketServer.Connect()) != KErrNone)
-        return PJ_STATUS_FROM_OS (err);
-
-    // Open up a connection
-    if ( (err=aConn.Open (aSocketServer)) != KErrNone) {
-        aSocketServer.Close();
-        return PJ_STATUS_FROM_OS (err);
-    }
-
-    if ( (err=aConn.Start()) != KErrNone) {
-        aConn.Close();
-        aSocketServer.Close();
-        return PJ_STATUS_FROM_OS (err);
-    }
-
-    // Set Symbian OS parameters in pjlib.
-    // This must be done before pj_init() is called.
-    pj_bzero (&sym_params, sizeof (sym_params));
-
-    sym_params.rsocketserv = &aSocketServer;
-
-    sym_params.rconnection = &aConn;
-
-    pj_symbianos_set_params (&sym_params);
-
-    /* Redirect log before pjsua_init() */
-    pj_log_set_log_func (&log_writer);
-
-    /* Set log level */
-    pj_log_set_level (LOG_LEVEL);
-
-    /* Create pjsua first! */
-    status = pjsua_create();
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "pjsua_create() error", status);
-        return status;
-    }
-
-    /* Init pjsua */
-    pjsua_config cfg;
-
-    pjsua_config_default (&cfg);
-
-    cfg.max_calls = 2;
-
-    cfg.thread_cnt = 0; // Disable threading on Symbian
-
-    cfg.use_srtp = USE_SRTP;
-
-    cfg.srtp_secure_signaling = 0;
-
-    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;
-
-    cfg.cb.on_buddy_state = &on_buddy_state;
-
-    cfg.cb.on_pager = &on_pager;
-
-    cfg.cb.on_typing = &on_typing;
-
-    cfg.cb.on_call_transfer_status = &on_call_transfer_status;
-
-    cfg.cb.on_call_replaced = &on_call_replaced;
-
-    cfg.cb.on_nat_detect = &on_nat_detect;
-
-    cfg.cb.on_reg_state = &on_reg_state;
-
-    pjsua_media_config med_cfg;
-
-    pjsua_media_config_default (&med_cfg);
-
-    med_cfg.thread_cnt = 0; // Disable threading on Symbian
-
-    med_cfg.has_ioqueue = PJ_FALSE;
-
-    med_cfg.clock_rate = 8000;
-
-#if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1)
-    med_cfg.audio_frame_ptime = 20;
-
-#else
-    med_cfg.audio_frame_ptime = 40;
-
-#endif
-    med_cfg.ec_tail_len = 0;
-
-    med_cfg.enable_ice = USE_ICE;
-
-    med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed
-
-    pjsua_logging_config log_cfg;
-
-    pjsua_logging_config_default (&log_cfg);
-
-    log_cfg.console_level = LOG_LEVEL;
-
-    log_cfg.cb = &log_writer;
-
-    log_cfg.decor = 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 tcfg;
-
-    pjsua_transport_id tid;
-
-    pjsua_transport_config_default (&tcfg);
-
-    tcfg.port = SIP_PORT;
-
-    status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, &tcfg, &tid);
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "Error creating transport", status);
-        pjsua_destroy();
-        return status;
-    }
-
-    /* Add account for the transport */
-    pjsua_acc_add_local (tid, PJ_TRUE, &g_acc_id);
-
-    /* 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;
-    }
-
-    /* Adjust Speex priority and enable only the narrowband */
-    {
-        pj_str_t codec_id = pj_str ("speex/8000");
-        pjmedia_codec_mgr_set_codec_priority (
-            pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt),
-            &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1);
-
-        codec_id = pj_str ("speex/16000");
-        pjmedia_codec_mgr_set_codec_priority (
-            pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt),
-            &codec_id, PJMEDIA_CODEC_PRIO_DISABLED);
-
-        codec_id = pj_str ("speex/32000");
-        pjmedia_codec_mgr_set_codec_priority (
-            pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt),
-            &codec_id, PJMEDIA_CODEC_PRIO_DISABLED);
-    }
-
-    return PJ_SUCCESS;
-}
-
-
-int symbian_ua_destroy()
-{
-    // Shutdown pjsua
-    pjsua_destroy();
-
-    // Close connection and socket server
-    aConn.Close();
-    aSocketServer.Close();
-
-    CloseSTDLIB();
-
-    return PJ_SUCCESS;
-}
-
-void symbian_ua_set_info_callback (const symbian_ua_info_cb_t *cb)
-{
-    if (cb)
-        g_cb = *cb;
-    else
-        pj_bzero (&g_cb, sizeof (g_cb));
-}
-
-int symbian_ua_set_account (const char *domain, const char *username,
-                            const char *password,
-                            bool use_srtp, bool use_ice)
-{
-    pj_status_t status;
-
-    PJ_ASSERT_RETURN (username && password && domain, PJ_EINVAL);
-    PJ_UNUSED_ARG (use_srtp);
-    PJ_UNUSED_ARG (use_ice);
-
-    if (domain[0] == 0) {
-        pjsua_acc_info acc_info;
-        pj_status_t status;
-
-        status = pjsua_acc_get_info (g_acc_id, &acc_info);
-
-        if (status != PJ_SUCCESS)
-            return status;
-
-        if (acc_info.status == 200) {
-            PJ_LOG (3, (THIS_FILE, "Unregistering.."));
-            pjsua_acc_set_registration (g_acc_id, PJ_FALSE);
-            g_acc_id = 0;
-        }
-
-        return PJ_SUCCESS;
-    }
-
-    if (pjsua_acc_get_count() > 1) {
-        status = pjsua_acc_del (g_acc_id);
-
-        if (status != PJ_SUCCESS) {
-            pjsua_perror (THIS_FILE, "Error removing account", status);
-            return status;
-        }
-
-        g_acc_id = 0;
-    }
-
-    pjsua_acc_config cfg;
-
-    char tmp_id[PJSIP_MAX_URL_SIZE];
-    char tmp_reg_uri[PJSIP_MAX_URL_SIZE];
-
-    if (!pj_ansi_strnicmp (domain, "sip:", 4)) {
-        domain += 4;
-    }
-
-    pjsua_acc_config_default (&cfg);
-
-    pj_ansi_sprintf (tmp_id, "sip:%s@%s", username, domain);
-    cfg.id = pj_str (tmp_id);
-    pj_ansi_sprintf (tmp_reg_uri, "sip:%s", domain);
-    cfg.reg_uri = pj_str (tmp_reg_uri);
-    cfg.cred_count = 1;
-    cfg.cred_info[0].realm = pj_str ("*");
-    cfg.cred_info[0].scheme = pj_str ("digest");
-    cfg.cred_info[0].username = pj_str ( (char*) username);
-    cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
-    cfg.cred_info[0].data = pj_str ( (char*) password);
-
-    status = pjsua_acc_add (&cfg, PJ_TRUE, &g_acc_id);
-
-    if (status != PJ_SUCCESS) {
-        pjsua_perror (THIS_FILE, "Error setting account", status);
-        pjsua_destroy();
-        return status;
-    }
-
-    return PJ_SUCCESS;
-}
-
-int symbian_ua_makecall (const char* dest_url)
-{
-    if (pjsua_verify_sip_url (dest_url) == PJ_SUCCESS) {
-        pj_str_t dst = pj_str ( (char*) dest_url);
-        pjsua_call_make_call (g_acc_id, &dst, 0, NULL,
-                              NULL, &g_call_id);
-
-        return PJ_SUCCESS;
-    }
-
-    return PJ_EINVAL;
-}
-
-int symbian_ua_endcall()
-{
-    pjsua_call_hangup_all();
-
-    return PJ_SUCCESS;
-}
-
-bool symbian_ua_anycall()
-{
-    return (pjsua_call_get_count() >0);
-}
-
-int symbian_ua_answercall()
-{
-    PJ_ASSERT_RETURN (g_call_id != PJSUA_INVALID_ID, PJ_EINVAL);
-
-    return pjsua_call_answer (g_call_id, 200, NULL, NULL);
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp
deleted file mode 100644
index ab66bb27805fcce63c3a2a661ffca137f37d260c..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
-========================================================================
- Name        : symbian_ua_guiAppUi.cpp
- Author      : nanang
- Copyright   : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <eikmenub.h>
-#include <akncontext.h>
-#include <akntitle.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_guiAppUi.h"
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiContainer.hrh"
-#include "symbian_ua_guiSettingItemList.hrh"
-#include "symbian_ua_guiContainerView.h"
-#include "symbian_ua_guiSettingItemListView.h"
-// ]]] end generated region [Generated User Includes]
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-#include "symbian_ua.h"
-
-/**
- * Construct the Csymbian_ua_guiAppUi instance
- */
-Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer (0)
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * The appui's destructor removes the container from the control
- * stack and destroys it.
- */
-Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    TRAPD (err_Dlg_wait_init, RemoveDlg_wait_initL());
-    // ]]] end generated region [Generated Contents]
-}
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiAppUi::InitializeContainersL()
-{
-    iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL();
-    AddViewL (iSymbian_ua_guiContainerView);
-    iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL();
-    AddViewL (iSymbian_ua_guiSettingItemListView);
-    SetDefaultViewL (*iSymbian_ua_guiSettingItemListView);
-}
-
-// ]]] end generated function
-
-/**
- * Handle a command for this appui (override)
- * @param aCommand command id to be handled
- */
-void Csymbian_ua_guiAppUi::HandleCommandL (TInt aCommand)
-{
-    // [[[ begin generated region: do not modify [Generated Code]
-    TBool commandHandled = EFalse;
-
-    switch (aCommand) { // code to dispatch to the AppUi's menu and CBA commands is generated here
-
-        default:
-            break;
-    }
-
-
-    if (!commandHandled) {
-        if (aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit) {
-            symbian_ua_destroy();
-            Exit();
-        }
-    }
-
-    // ]]] end generated region [Generated Code]
-
-}
-
-/**
- * Override of the HandleResourceChangeL virtual function
- */
-void Csymbian_ua_guiAppUi::HandleResourceChangeL (TInt aType)
-{
-    CAknViewAppUi::HandleResourceChangeL (aType);
-    // [[[ begin generated region: do not modify [Generated Code]
-    // ]]] end generated region [Generated Code]
-
-}
-
-/**
- * Override of the HandleKeyEventL virtual function
- * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not
- * @param aKeyEvent
- * @param aType
- */
-TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL (
-    const TKeyEvent& aKeyEvent,
-    TEventCode aType)
-{
-    // The inherited HandleKeyEventL is private and cannot be called
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-    return EKeyWasNotConsumed;
-}
-
-/**
- * Override of the HandleViewDeactivation virtual function
- *
- * @param aViewIdToBeDeactivated
- * @param aNewlyActivatedViewId
- */
-void Csymbian_ua_guiAppUi::HandleViewDeactivation (
-    const TVwsViewId& aViewIdToBeDeactivated,
-    const TVwsViewId& aNewlyActivatedViewId)
-{
-    CAknViewAppUi::HandleViewDeactivation (
-        aViewIdToBeDeactivated,
-        aNewlyActivatedViewId);
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * @brief Completes the second phase of Symbian object construction.
- * Put initialization code that could leave here.
- */
-void Csymbian_ua_guiAppUi::ConstructL()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    BaseConstructL (EAknEnableSkin);
-    InitializeContainersL();
-    // ]]] end generated region [Generated Contents]
-
-    // Create private folder
-    RProcess process;
-    TFileName path;
-
-    path.Copy (process.FileName().Left (2));
-
-    if (path.Compare (_L ("c")) || path.Compare (_L ("C")))
-        CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC);
-    else if (path.Compare (_L ("e")) || path.Compare (_L ("E")))
-        CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE);
-
-    // Init PJSUA
-    if (symbian_ua_init() != 0) {
-        symbian_ua_destroy();
-        Exit();
-    }
-
-    ExecuteDlg_wait_initLD();
-
-    CTimer::ConstructL();
-    CActiveScheduler::Add (this);
-    After (4000000);
-}
-
-/**
- * Override of the HandleApplicationSpecificEventL virtual function
- */
-void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL (
-    TInt aType,
-    const TWsEvent& anEvent)
-{
-    CAknViewAppUi::HandleApplicationSpecificEventL (aType, anEvent);
-    // [[[ begin generated region: do not modify [Generated Code]
-    // ]]] end generated region [Generated Code]
-
-}
-
-/**
- * Handle the applicationSpecificEvent event.
- */
-void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL (
-    TInt /* aType */,
-    const TWsEvent& /* anEvent */)
-{
-    // TODO: implement applicationSpecificEvent event handler
-}
-
-// [[[ begin generated function: do not modify
-/**
- * Execute the wait dialog for dlg_wait_init. This routine returns
- * while the dialog is showing. It will be closed and destroyed when
- * RemoveDlg_wait_initL() or the user selects the Cancel soft key.
- * @param aOverrideText optional override text. When null the text configured
- * in the UI Designer is used.
- */
-void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD (const TDesC* aOverrideText)
-{
-    iDlg_wait_init = new (ELeave) CAknWaitDialog (
-        reinterpret_cast< CEikDialog** > (&iDlg_wait_init), EFalse);
-
-    if (aOverrideText != NULL) {
-        iDlg_wait_init->SetTextL (*aOverrideText);
-    }
-
-    iDlg_wait_init->ExecuteLD (R_APPLICATION_DLG_WAIT_INIT);
-
-    iDlg_wait_initCallback = new (ELeave) CProgressDialogCallback (
-        this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL);
-    iDlg_wait_init->SetCallback (iDlg_wait_initCallback);
-}
-
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-/**
- * Close and dispose of the wait dialog for dlg_wait_init
- */
-void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL()
-{
-    if (iDlg_wait_init != NULL) {
-        iDlg_wait_init->SetCallback (NULL);
-        iDlg_wait_init->ProcessFinishedL();    // deletes the dialog
-        iDlg_wait_init = NULL;
-    }
-
-    delete iDlg_wait_initCallback;
-
-    iDlg_wait_initCallback = NULL;
-
-}
-
-// ]]] end generated function
-
-/**
- * Handle the canceled event.
- */
-void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL (CAknProgressDialog* /* aDialog */)
-{
-    // TODO: implement canceled event handler
-
-}
-
-void Csymbian_ua_guiAppUi::RunL()
-{
-    RemoveDlg_wait_initL();
-    iSymbian_ua_guiSettingItemListView->HandleCommandL (EAknSoftkeySave);
-}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp
deleted file mode 100644
index 1ff6ff8bd9484cc2ed32a7d5af13a3deb486a0dd..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
-========================================================================
- Name        : symbian_ua_guiContainer.cpp
- Author      : nanang
- Copyright   : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <barsread.h>
-#include <stringloader.h>
-#include <eiklabel.h>
-#include <eikenv.h>
-#include <gdi.h>
-#include <eikedwin.h>
-#include <aknviewappui.h>
-#include <eikappui.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_guiContainer.h"
-#include "symbian_ua_guiContainerView.h"
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiContainer.hrh"
-#include "symbian_ua_guiSettingItemList.hrh"
-// ]]] end generated region [Generated User Includes]
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-/**
- * First phase of Symbian two-phase construction. Should not
- * contain any code that could leave.
- */
-CSymbian_ua_guiContainer::CSymbian_ua_guiContainer()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    iLabel1 = NULL;
-    iEd_url = NULL;
-    iEd_info = NULL;
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * Destroy child controls.
- */
-CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    delete iLabel1;
-    iLabel1 = NULL;
-    delete iEd_url;
-    iEd_url = NULL;
-    delete iEd_info;
-    iEd_info = NULL;
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * Construct the control (first phase).
- *  Creates an instance and initializes it.
- *  Instance is not left on cleanup stack.
- * @param aRect bounding rectangle
- * @param aParent owning parent, or NULL
- * @param aCommandObserver command observer
- * @return initialized instance of CSymbian_ua_guiContainer
- */
-CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL (
-    const TRect& aRect,
-    const CCoeControl* aParent,
-    MEikCommandObserver* aCommandObserver)
-{
-    CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC (
-                                         aRect,
-                                         aParent,
-                                         aCommandObserver);
-    CleanupStack::Pop (self);
-    return self;
-}
-
-/**
- * Construct the control (first phase).
- *  Creates an instance and initializes it.
- *  Instance is left on cleanup stack.
- * @param aRect The rectangle for this window
- * @param aParent owning parent, or NULL
- * @param aCommandObserver command observer
- * @return new instance of CSymbian_ua_guiContainer
- */
-CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC (
-    const TRect& aRect,
-    const CCoeControl* aParent,
-    MEikCommandObserver* aCommandObserver)
-{
-    CSymbian_ua_guiContainer* self = new (ELeave) CSymbian_ua_guiContainer();
-    CleanupStack::PushL (self);
-    self->ConstructL (aRect, aParent, aCommandObserver);
-    return self;
-}
-
-/**
- * Construct the control (second phase).
- *  Creates a window to contain the controls and activates it.
- * @param aRect bounding rectangle
- * @param aCommandObserver command observer
- * @param aParent owning parent, or NULL
- */
-void CSymbian_ua_guiContainer::ConstructL (
-    const TRect& aRect,
-    const CCoeControl* aParent,
-    MEikCommandObserver* aCommandObserver)
-{
-    if (aParent == NULL) {
-        CreateWindowL();
-    } else {
-        SetContainerWindowL (*aParent);
-    }
-
-    iFocusControl = NULL;
-
-    iCommandObserver = aCommandObserver;
-    InitializeControlsL();
-    SetRect (aRect);
-    ActivateL();
-    // [[[ begin generated region: do not modify [Post-ActivateL initializations]
-    // ]]] end generated region [Post-ActivateL initializations]
-
-}
-
-/**
-* Return the number of controls in the container (override)
-* @return count
-*/
-TInt CSymbian_ua_guiContainer::CountComponentControls() const
-{
-    return (int) ELastControl;
-}
-
-/**
-* Get the control with the given index (override)
-* @param aIndex Control index [0...n) (limited by #CountComponentControls)
-* @return Pointer to control
-*/
-CCoeControl* CSymbian_ua_guiContainer::ComponentControl (TInt aIndex) const
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    switch (aIndex) {
-
-        case ELabel1:
-            return iLabel1;
-
-        case EEd_url:
-            return iEd_url;
-
-        case EEd_info:
-            return iEd_info;
-    }
-
-    // ]]] end generated region [Generated Contents]
-
-    // handle any user controls here...
-
-    return NULL;
-}
-
-/**
- *	Handle resizing of the container. This implementation will lay out
- *  full-sized controls like list boxes for any screen size, and will layout
- *  labels, editors, etc. to the size they were given in the UI designer.
- *  This code will need to be modified to adjust arbitrary controls to
- *  any screen size.
- */
-void CSymbian_ua_guiContainer::SizeChanged()
-{
-    CCoeControl::SizeChanged();
-    LayoutControls();
-    // [[[ begin generated region: do not modify [Generated Contents]
-
-    // ]]] end generated region [Generated Contents]
-
-}
-
-// [[[ begin generated function: do not modify
-/**
- * Layout components as specified in the UI Designer
- */
-void CSymbian_ua_guiContainer::LayoutControls()
-{
-    iLabel1->SetExtent (TPoint (2, 23), TSize (32, 28));
-    iEd_url->SetExtent (TPoint (49, 25), TSize (197, 28));
-    iEd_info->SetExtent (TPoint (3, 78), TSize (235, 143));
-}
-
-// ]]] end generated function
-
-/**
- *	Handle key events.
- */
-TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL (
-    const TKeyEvent& aKeyEvent,
-    TEventCode aType)
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-
-    // ]]] end generated region [Generated Contents]
-
-    if (iFocusControl != NULL
-            && iFocusControl->OfferKeyEventL (aKeyEvent, aType) == EKeyWasConsumed) {
-        return EKeyWasConsumed;
-    }
-
-    return CCoeControl::OfferKeyEventL (aKeyEvent, aType);
-}
-
-// [[[ begin generated function: do not modify
-/**
- *	Initialize each control upon creation.
- */
-void CSymbian_ua_guiContainer::InitializeControlsL()
-{
-    iLabel1 = new (ELeave) CEikLabel;
-    iLabel1->SetContainerWindowL (*this);
-    {
-        TResourceReader reader;
-        iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1);
-        iLabel1->ConstructFromResourceL (reader);
-        CleanupStack::PopAndDestroy(); // reader internal state
-    }
-
-    iEd_url = new (ELeave) CEikEdwin;
-    iEd_url->SetContainerWindowL (*this);
-    {
-        TResourceReader reader;
-        iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL);
-        iEd_url->ConstructFromResourceL (reader);
-        CleanupStack::PopAndDestroy(); // reader internal state
-    }
-
-    {
-        HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2);
-        iEd_url->SetTextL (text);
-        CleanupStack::PopAndDestroy (text);
-    }
-
-    iEd_info = new (ELeave) CEikEdwin;
-    iEd_info->SetContainerWindowL (*this);
-    {
-        TResourceReader reader;
-        iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO);
-        iEd_info->ConstructFromResourceL (reader);
-        CleanupStack::PopAndDestroy(); // reader internal state
-    }
-
-    {
-        HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2);
-        iEd_info->SetTextL (text);
-        CleanupStack::PopAndDestroy (text);
-    }
-
-    iEd_url->SetFocus (ETrue);
-    iFocusControl = iEd_url;
-
-}
-
-// ]]] end generated function
-
-/**
- * Handle global resource changes, such as scalable UI or skin events (override)
- */
-void CSymbian_ua_guiContainer::HandleResourceChange (TInt aType)
-{
-    CCoeControl::HandleResourceChange (aType);
-    SetRect (iAvkonViewAppUi->View (TUid::Uid (ESymbian_ua_guiContainerViewId))->ClientRect());
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- *	Draw container contents.
- */
-void CSymbian_ua_guiContainer::Draw (const TRect& aRect) const
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    CWindowGc& gc = SystemGc();
-    gc.Clear (aRect);
-
-    // ]]] end generated region [Generated Contents]
-
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp
deleted file mode 100644
index a01d8f353c10d8e10622026ad2c9fcb7c0ee9973..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp
+++ /dev/null
@@ -1,489 +0,0 @@
-/*
-========================================================================
- Name        : symbian_ua_guiContainerView.cpp
- Author      : nanang
- Copyright   : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <aknviewappui.h>
-#include <eikmenub.h>
-#include <avkon.hrh>
-#include <barsread.h>
-#include <stringloader.h>
-#include <eiklabel.h>
-#include <eikenv.h>
-#include <gdi.h>
-#include <eikedwin.h>
-#include <akncontext.h>
-#include <akntitle.h>
-#include <eikbtgpc.h>
-#include <aknnotewrappers.h>
-#include <aknquerydialog.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiContainerView.h"
-#include "symbian_ua_guiContainer.hrh"
-#include "symbian_ua_guiSettingItemList.hrh"
-#include "symbian_ua_guiContainer.h"
-// ]]] end generated region [Generated User Includes]
-
-#include <utf.h>
-#include "symbian_ua.h"
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-Csymbian_ua_guiContainerView *myinstance = NULL;
-_LIT (KStCall, "Call");
-_LIT (KStHangUp, "Hang Up");
-
-void on_info (const wchar_t* buf)
-{
-    TPtrC aBuf ( (const TUint16*) buf);
-
-    if (myinstance)
-        myinstance->PutMessage (aBuf);
-}
-
-void on_incoming_call (const wchar_t* caller_disp, const wchar_t* caller_uri)
-{
-    TBuf<512> buf;
-    TPtrC aDisp ( (const TUint16*) caller_disp);
-    TPtrC aUri ( (const TUint16*) caller_uri);
-    _LIT (KFormat, "Incoming call from %S, accept?");
-
-    buf.Format (KFormat, &aDisp);
-
-    if (Csymbian_ua_guiContainerView::RunQry_accept_callL (&buf) == EAknSoftkeyYes) {
-        CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
-
-        if (cba != NULL) {
-            TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp));
-            cba->DrawDeferred();
-        }
-
-        symbian_ua_answercall();
-    } else {
-        symbian_ua_endcall();
-    }
-}
-
-void on_call_end (const wchar_t* reason)
-{
-    TPtrC aReason ( (const TUint16*) reason);
-
-    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
-
-    if (cba != NULL) {
-        TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall));
-        cba->DrawDeferred();
-    }
-
-    Csymbian_ua_guiContainerView::RunNote_infoL (&aReason);
-}
-
-void on_reg_state (bool success)
-{
-    if (success)
-        Csymbian_ua_guiContainerView::RunNote_infoL();
-    else
-        Csymbian_ua_guiContainerView::RunNote_warningL();
-}
-
-void on_unreg_state (bool success)
-{
-    TPtrC st_success (_L ("Unregistration Success!"));
-    TPtrC st_failed (_L ("Unregistration Failed!"));
-
-    if (success)
-        Csymbian_ua_guiContainerView::RunNote_infoL (&st_success);
-    else
-        Csymbian_ua_guiContainerView::RunNote_warningL (&st_failed);
-}
-
-void Csymbian_ua_guiContainerView::PutMessage (const TDesC &msg)
-{
-    if (!iSymbian_ua_guiContainer)
-        return;
-
-    CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_info);
-
-    obj_info->SetTextL (&msg);
-
-    obj_info->DrawDeferred();
-}
-
-/**
- * First phase of Symbian two-phase construction. Should not contain any
- * code that could leave.
- */
-Csymbian_ua_guiContainerView::Csymbian_ua_guiContainerView()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    iSymbian_ua_guiContainer = NULL;
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * The view's destructor removes the container from the control
- * stack and destroys it.
- */
-Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    delete iSymbian_ua_guiContainer;
-    iSymbian_ua_guiContainer = NULL;
-    // ]]] end generated region [Generated Contents]
-
-    symbian_ua_set_info_callback (NULL);
-    myinstance = NULL;
-}
-
-/**
- * Symbian two-phase constructor.
- * This creates an instance then calls the second-phase constructor
- * without leaving the instance on the cleanup stack.
- * @return new instance of Csymbian_ua_guiContainerView
- */
-Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL()
-{
-    Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC();
-    CleanupStack::Pop (self);
-    return self;
-}
-
-/**
- * Symbian two-phase constructor.
- * This creates an instance, pushes it on the cleanup stack,
- * then calls the second-phase constructor.
- * @return new instance of Csymbian_ua_guiContainerView
- */
-Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewLC()
-{
-    Csymbian_ua_guiContainerView* self = new (ELeave) Csymbian_ua_guiContainerView();
-    CleanupStack::PushL (self);
-    self->ConstructL();
-    return self;
-}
-
-
-/**
- * Second-phase constructor for view.
- * Initialize contents from resource.
- */
-void Csymbian_ua_guiContainerView::ConstructL()
-{
-    // [[[ begin generated region: do not modify [Generated Code]
-    BaseConstructL (R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW);
-    // ]]] end generated region [Generated Code]
-
-    // add your own initialization code here
-    symbian_ua_info_cb_t cb;
-    Mem::FillZ (&cb, sizeof (cb));
-
-    cb.on_info = &on_info;
-    cb.on_incoming_call = &on_incoming_call;
-    cb.on_reg_state = &on_reg_state;
-    cb.on_unreg_state = &on_unreg_state;
-    cb.on_call_end = &on_call_end;
-
-    symbian_ua_set_info_callback (&cb);
-    myinstance = this;
-}
-
-/**
- * @return The UID for this view
- */
-TUid Csymbian_ua_guiContainerView::Id() const
-{
-    return TUid::Uid (ESymbian_ua_guiContainerViewId);
-}
-
-/**
- * Handle a command for this view (override)
- * @param aCommand command id to be handled
- */
-void Csymbian_ua_guiContainerView::HandleCommandL (TInt aCommand)
-{
-    // [[[ begin generated region: do not modify [Generated Code]
-    TBool commandHandled = EFalse;
-
-    switch (aCommand) {	// code to dispatch to the AknView's menu and CBA commands is generated here
-
-        case ESymbian_ua_guiContainerViewControlPaneRightId:
-            commandHandled = CallSoftKeyPressedL (aCommand);
-            break;
-
-        case ESymbian_ua_guiContainerViewSettingMenuItemCommand:
-            commandHandled = HandleSettingMenuItemSelectedL (aCommand);
-            break;
-
-        default:
-            break;
-    }
-
-
-    if (!commandHandled) {
-
-        if (aCommand == ESymbian_ua_guiContainerViewControlPaneRightId) {
-            AppUi()->HandleCommandL (EEikCmdExit);
-        }
-
-    }
-
-    // ]]] end generated region [Generated Code]
-
-}
-
-/**
- *	Handles user actions during activation of the view,
- *	such as initializing the content.
- */
-void Csymbian_ua_guiContainerView::DoActivateL (
-    const TVwsViewId& /*aPrevViewId*/,
-    TUid /*aCustomMessageId*/,
-    const TDesC8& /*aCustomMessage*/)
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    SetupStatusPaneL();
-
-    CEikButtonGroupContainer* cba = AppUi()->Cba();
-
-    if (cba != NULL) {
-        cba->MakeVisible (EFalse);
-    }
-
-    if (iSymbian_ua_guiContainer == NULL) {
-        iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL (ClientRect(), NULL, this);
-        iSymbian_ua_guiContainer->SetMopParent (this);
-        AppUi()->AddToStackL (*this, iSymbian_ua_guiContainer);
-    }
-
-    // ]]] end generated region [Generated Contents]
-
-    cba = CEikButtonGroupContainer::Current();
-
-    if (cba != NULL) {
-        if (symbian_ua_anycall())
-            cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp);
-        else
-            cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall);
-    }
-
-}
-
-/**
- */
-void Csymbian_ua_guiContainerView::DoDeactivate()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    CleanupStatusPane();
-
-    CEikButtonGroupContainer* cba = AppUi()->Cba();
-
-    if (cba != NULL) {
-        cba->MakeVisible (ETrue);
-        cba->DrawDeferred();
-    }
-
-    if (iSymbian_ua_guiContainer != NULL) {
-        AppUi()->RemoveFromViewStack (*this, iSymbian_ua_guiContainer);
-        delete iSymbian_ua_guiContainer;
-        iSymbian_ua_guiContainer = NULL;
-    }
-
-    // ]]] end generated region [Generated Contents]
-
-}
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiContainerView::SetupStatusPaneL()
-{
-    // reset the context pane
-    TUid contextPaneUid = TUid::Uid (EEikStatusPaneUidContext);
-    CEikStatusPaneBase::TPaneCapabilities subPaneContext =
-        StatusPane()->PaneCapabilities (contextPaneUid);
-
-    if (subPaneContext.IsPresent() && subPaneContext.IsAppOwned()) {
-        CAknContextPane* context = static_cast< CAknContextPane* > (
-                                       StatusPane()->ControlL (contextPaneUid));
-        context->SetPictureToDefaultL();
-    }
-
-    // setup the title pane
-    TUid titlePaneUid = TUid::Uid (EEikStatusPaneUidTitle);
-
-    CEikStatusPaneBase::TPaneCapabilities subPaneTitle =
-        StatusPane()->PaneCapabilities (titlePaneUid);
-
-    if (subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned()) {
-        CAknTitlePane* title = static_cast< CAknTitlePane* > (
-                                   StatusPane()->ControlL (titlePaneUid));
-        TResourceReader reader;
-        iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE);
-        title->SetFromResourceL (reader);
-        CleanupStack::PopAndDestroy(); // reader internal state
-    }
-
-}
-
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiContainerView::CleanupStatusPane()
-{
-}
-
-// ]]] end generated function
-
-/**
- * Handle status pane size change for this view (override)
- */
-void Csymbian_ua_guiContainerView::HandleStatusPaneSizeChange()
-{
-    CAknView::HandleStatusPaneSizeChange();
-
-    // this may fail, but we're not able to propagate exceptions here
-    TInt result;
-    TRAP (result, SetupStatusPaneL());
-}
-
-/**
- * Handle the rightSoftKeyPressed event.
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL (TInt aCommand)
-{
-    CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_url);
-    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
-
-    if (symbian_ua_anycall()) {
-        symbian_ua_endcall();
-        return ETrue;
-    }
-
-    PutMessage (_L ("Making call..."));
-
-    if (cba != NULL) {
-        cba->SetCommandL (aCommand, KStHangUp);
-        cba->DrawDeferred();
-    }
-
-
-    TUint8 url[256];
-
-    TPtr8 aUrl (url, 256);
-
-    HBufC *buf = obj_url->GetTextInHBufL();
-    CnvUtfConverter::ConvertFromUnicodeToUtf8 (aUrl, *buf);
-    delete buf;
-
-    if (symbian_ua_makecall ( (char *) aUrl.PtrZ()) != 0) {
-        PutMessage (_L ("Making call failed!"));
-
-        if (cba != NULL) {
-            cba->SetCommandL (aCommand, KStCall);
-            cba->DrawDeferred();
-        }
-    }
-
-    return ETrue;
-}
-
-/**
- * Handle the selected event.
- * @param aCommand the command id invoked
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL (TInt aCommand)
-{
-    AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiSettingItemListViewId));
-    return ETrue;
-}
-
-// [[[ begin generated function: do not modify
-/**
- * Show the popup note for note_error
- * @param aOverrideText optional override text
- */
-void Csymbian_ua_guiContainerView::RunNote_errorL (const TDesC* aOverrideText)
-{
-    CAknErrorNote* note = new (ELeave) CAknErrorNote();
-
-    if (aOverrideText == NULL) {
-        HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR);
-        note->ExecuteLD (*noteText);
-        CleanupStack::PopAndDestroy (noteText);
-    } else {
-        note->ExecuteLD (*aOverrideText);
-    }
-}
-
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-/**
- * Show the popup note for note_info
- * @param aOverrideText optional override text
- */
-void Csymbian_ua_guiContainerView::RunNote_infoL (const TDesC* aOverrideText)
-{
-    CAknInformationNote* note = new (ELeave) CAknInformationNote();
-
-    if (aOverrideText == NULL) {
-        HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO);
-        note->ExecuteLD (*noteText);
-        CleanupStack::PopAndDestroy (noteText);
-    } else {
-        note->ExecuteLD (*aOverrideText);
-    }
-}
-
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-/**
- * Show the popup note for note_warning
- * @param aOverrideText optional override text
- */
-void Csymbian_ua_guiContainerView::RunNote_warningL (const TDesC* aOverrideText)
-{
-    CAknWarningNote* note = new (ELeave) CAknWarningNote();
-
-    if (aOverrideText == NULL) {
-        HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING);
-        note->ExecuteLD (*noteText);
-        CleanupStack::PopAndDestroy (noteText);
-    } else {
-        note->ExecuteLD (*aOverrideText);
-    }
-}
-
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-/**
- * Show the popup dialog for qry_accept_call
- * @param aOverrideText optional override text
- * @return EAknSoftkeyYes (left soft key id) or 0
- */
-TInt Csymbian_ua_guiContainerView::RunQry_accept_callL (const TDesC* aOverrideText)
-{
-
-    CAknQueryDialog* queryDialog = CAknQueryDialog::NewL();
-
-    if (aOverrideText != NULL) {
-        queryDialog->SetPromptL (*aOverrideText);
-    }
-
-    return queryDialog->ExecuteLD (R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL);
-}
-
-// ]]] end generated function
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp
deleted file mode 100644
index 15fba37ca33e2d2bcddce2b6c92a7d8e0621c144..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
-========================================================================
- Name        : symbian_ua_guiSettingItemList.cpp
- Author      : nanang
- Copyright   : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <avkon.hrh>
-#include <avkon.rsg>
-#include <eikmenup.h>
-#include <aknappui.h>
-#include <eikcmobs.h>
-#include <barsread.h>
-#include <stringloader.h>
-#include <gdi.h>
-#include <eikedwin.h>
-#include <eikenv.h>
-#include <eikseced.h>
-#include <aknpopupfieldtext.h>
-#include <eikappui.h>
-#include <aknviewappui.h>
-#include <akntextsettingpage.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_guiSettingItemList.h"
-#include "Symbian_ua_guiSettingItemListSettings.h"
-#include "symbian_ua_guiSettingItemList.hrh"
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiSettingItemListView.h"
-// ]]] end generated region [Generated User Includes]
-
-
-#include <s32stor.h>
-#include <s32file.h>
-
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-
-_LIT (KtxDicFileName			,"settings.ini");
-
-const TInt KRegistrar		= 2;
-const TInt KUsername		= 3;
-const TInt KPassword		= 4;
-const TInt KStunServer		= 5;
-const TInt KSrtp			= 6;
-const TInt KIce				= 7;
-
-/**
- * Construct the CSymbian_ua_guiSettingItemList instance
- * @param aCommandObserver command observer
- */
-CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList (
-    TSymbian_ua_guiSettingItemListSettings& aSettings,
-    MEikCommandObserver* aCommandObserver)
-        : iSettings (aSettings), iCommandObserver (aCommandObserver)
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * Destroy any instance variables
- */
-CSymbian_ua_guiSettingItemList::~CSymbian_ua_guiSettingItemList()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * Handle system notification that the container's size has changed.
- */
-void CSymbian_ua_guiSettingItemList::SizeChanged()
-{
-    if (ListBox()) {
-        ListBox()->SetRect (Rect());
-    }
-}
-
-/**
- * Create one setting item at a time, identified by id.
- * CAknSettingItemList calls this method and takes ownership
- * of the returned value.  The CAknSettingItem object owns
- * a reference to the underlying data, which EditItemL() uses
- * to edit and store the value.
- */
-CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL (TInt aId)
-{
-    switch (aId) {
-            // [[[ begin generated region: do not modify [Initializers]
-
-        case ESymbian_ua_guiSettingItemListViewEd_registrar: {
-            CAknTextSettingItem* item = new (ELeave)
-            CAknTextSettingItem (
-                aId,
-                iSettings.Ed_registrar());
-            item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed);
-            return item;
-        }
-
-        case ESymbian_ua_guiSettingItemListViewEd_user: {
-            CAknTextSettingItem* item = new (ELeave)
-            CAknTextSettingItem (
-                aId,
-                iSettings.Ed_user());
-            item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed);
-            return item;
-        }
-
-        case ESymbian_ua_guiSettingItemListViewEd_password: {
-            CAknPasswordSettingItem* item = new (ELeave)
-            CAknPasswordSettingItem (
-                aId,
-                CAknPasswordSettingItem::EAlpha,
-                iSettings.Ed_password());
-            item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed);
-            return item;
-        }
-
-        case ESymbian_ua_guiSettingItemListViewB_srtp: {
-            CAknBinaryPopupSettingItem* item = new (ELeave)
-            CAknBinaryPopupSettingItem (
-                aId,
-                iSettings.B_srtp());
-            item->SetHidden (ETrue);
-            return item;
-        }
-
-        case ESymbian_ua_guiSettingItemListViewB_ice: {
-            CAknBinaryPopupSettingItem* item = new (ELeave)
-            CAknBinaryPopupSettingItem (
-                aId,
-                iSettings.B_ice());
-            item->SetHidden (ETrue);
-            return item;
-        }
-
-        case ESymbian_ua_guiSettingItemListViewEd_stun_server: {
-            CAknTextSettingItem* item = new (ELeave)
-            CAknTextSettingItem (
-                aId,
-                iSettings.Ed_stun_server());
-            item->SetHidden (ETrue);
-            return item;
-        }
-
-        // ]]] end generated region [Initializers]
-
-    }
-
-    return NULL;
-}
-
-/**
- * Edit the setting item identified by the given id and store
- * the changes into the store.
- * @param aIndex the index of the setting item in SettingItemArray()
- * @param aCalledFromMenu true: a menu item invoked editing, thus
- *	always show the edit page and interactively edit the item;
- *	false: change the item in place if possible, else show the edit page
- */
-void CSymbian_ua_guiSettingItemList::EditItemL (TInt aIndex, TBool aCalledFromMenu)
-{
-    CAknSettingItem* item = (*SettingItemArray()) [aIndex];
-
-    switch (item->Identifier()) {
-            // [[[ begin generated region: do not modify [Editing Started Invoker]
-            // ]]] end generated region [Editing Started Invoker]
-
-    }
-
-    CAknSettingItemList::EditItemL (aIndex, aCalledFromMenu);
-
-    TBool storeValue = ETrue;
-
-    switch (item->Identifier()) {
-            // [[[ begin generated region: do not modify [Editing Stopped Invoker]
-            // ]]] end generated region [Editing Stopped Invoker]
-
-    }
-
-    if (storeValue) {
-        item->StoreL();
-        SaveSettingValuesL();
-    }
-}
-
-/**
- *	Handle the "Change" option on the Options menu.  This is an
- *	alternative to the Selection key that forces the settings page
- *	to come up rather than changing the value in place (if possible).
- */
-void CSymbian_ua_guiSettingItemList::ChangeSelectedItemL()
-{
-    if (ListBox()->CurrentItemIndex() >= 0) {
-        EditItemL (ListBox()->CurrentItemIndex(), ETrue);
-    }
-}
-
-/**
- *	Load the initial contents of the setting items.  By default,
- *	the setting items are populated with the default values from
- * 	the design.  You can override those values here.
- *	<p>
- *	Note: this call alone does not update the UI.
- *	LoadSettingsL() must be called afterwards.
- */
-void CSymbian_ua_guiSettingItemList::LoadSettingValuesL()
-{
-    // load values into iSettings
-
-    TFileName path;
-    TFileName pathWithoutDrive;
-    CEikonEnv::Static()->FsSession().PrivatePath (pathWithoutDrive);
-
-    // Extract drive letter into appDrive:
-#ifdef __WINS__
-    path.Copy (_L ("c:"));
-#else
-    RProcess process;
-    path.Copy (process.FileName().Left (2));
-#endif
-
-    path.Append (pathWithoutDrive);
-    path.Append (KtxDicFileName);
-
-    TFindFile AufFolder (CCoeEnv::Static()->FsSession());
-
-    if (KErrNone == AufFolder.FindByDir (path, KNullDesC)) {
-        CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC (CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid (1));
-        TUid FileUid;
-
-        FileUid.iUid = KRegistrar;
-
-        if (MyDStore->IsPresentL (FileUid)) {
-            RDictionaryReadStream in;
-            in.OpenLC (*MyDStore,FileUid);
-            in >> iSettings.Ed_registrar();
-            CleanupStack::PopAndDestroy (1);// in
-        }
-
-        FileUid.iUid = KUsername;
-
-        if (MyDStore->IsPresentL (FileUid)) {
-            RDictionaryReadStream in;
-            in.OpenLC (*MyDStore,FileUid);
-            in >> iSettings.Ed_user();
-            CleanupStack::PopAndDestroy (1);// in
-        }
-
-        FileUid.iUid = KPassword;
-
-        if (MyDStore->IsPresentL (FileUid)) {
-            RDictionaryReadStream in;
-            in.OpenLC (*MyDStore,FileUid);
-            in >> iSettings.Ed_password();
-            CleanupStack::PopAndDestroy (1);// in
-        }
-
-        FileUid.iUid = KStunServer;
-
-        if (MyDStore->IsPresentL (FileUid)) {
-            RDictionaryReadStream in;
-            in.OpenLC (*MyDStore,FileUid);
-            in >> iSettings.Ed_stun_server();
-            CleanupStack::PopAndDestroy (1);// in
-        }
-
-        FileUid.iUid = KSrtp;
-
-        if (MyDStore->IsPresentL (FileUid)) {
-            RDictionaryReadStream in;
-            in.OpenLC (*MyDStore,FileUid);
-            iSettings.SetB_srtp ( (TBool) in.ReadInt32L());
-            CleanupStack::PopAndDestroy (1);// in
-        }
-
-        FileUid.iUid = KIce;
-
-        if (MyDStore->IsPresentL (FileUid)) {
-            RDictionaryReadStream in;
-            in.OpenLC (*MyDStore,FileUid);
-            iSettings.SetB_ice ( (TBool) in.ReadInt32L());
-            CleanupStack::PopAndDestroy (1);// in
-        }
-
-        CleanupStack::PopAndDestroy (1);// Store
-    }
-
-}
-
-/**
- *	Save the contents of the setting items.  Note, this is called
- *	whenever an item is changed and stored to the model, so it
- *	may be called multiple times or not at all.
- */
-void CSymbian_ua_guiSettingItemList::SaveSettingValuesL()
-{
-    // store values from iSettings
-
-    TFileName path;
-    TFileName pathWithoutDrive;
-    CEikonEnv::Static()->FsSession().PrivatePath (pathWithoutDrive);
-
-    // Extract drive letter into appDrive:
-#ifdef __WINS__
-    path.Copy (_L ("c:"));
-#else
-    RProcess process;
-    path.Copy (process.FileName().Left (2));
-
-    if (path.Compare (_L ("c")) || path.Compare (_L ("C")))
-        CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC);
-    else if (path.Compare (_L ("e")) || path.Compare (_L ("E")))
-        CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE);
-
-#endif
-
-    path.Append (pathWithoutDrive);
-
-    path.Append (KtxDicFileName);
-
-    TFindFile AufFolder (CCoeEnv::Static()->FsSession());
-
-    if (KErrNone == AufFolder.FindByDir (path, KNullDesC)) {
-        User::LeaveIfError (CCoeEnv::Static()->FsSession().Delete (AufFolder.File()));
-    }
-
-    CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC (CCoeEnv::Static()->FsSession(),path, TUid::Uid (1));
-
-    TUid FileUid = {0x0};
-
-    FileUid.iUid = KRegistrar;
-    RDictionaryWriteStream out1;
-    out1.AssignLC (*MyDStore,FileUid);
-    out1 << iSettings.Ed_registrar();
-    out1.CommitL();
-    CleanupStack::PopAndDestroy (1);// out2
-
-    FileUid.iUid = KUsername;
-    RDictionaryWriteStream out2;
-    out2.AssignLC (*MyDStore,FileUid);
-    out2 << iSettings.Ed_user();
-    out2.CommitL();
-    CleanupStack::PopAndDestroy (1);// out2
-
-    FileUid.iUid = KPassword;
-    RDictionaryWriteStream out3;
-    out3.AssignLC (*MyDStore,FileUid);
-    out3 << iSettings.Ed_password();
-    out3.CommitL();
-    CleanupStack::PopAndDestroy (1);// out2
-
-    FileUid.iUid = KStunServer;
-    RDictionaryWriteStream out4;
-    out4.AssignLC (*MyDStore,FileUid);
-    out4 << iSettings.Ed_stun_server();
-    out4.CommitL();
-    CleanupStack::PopAndDestroy (1);// out2
-
-    FileUid.iUid = KSrtp;
-    RDictionaryWriteStream out5;
-    out5.AssignLC (*MyDStore,FileUid);
-    out5.WriteInt32L (iSettings.B_srtp());
-    out5.CommitL();
-    CleanupStack::PopAndDestroy (1);// out1
-
-    FileUid.iUid = KIce;
-    RDictionaryWriteStream out6;
-    out6.AssignLC (*MyDStore,FileUid);
-    out6.WriteInt32L (iSettings.B_ice());
-    out6.CommitL();
-    CleanupStack::PopAndDestroy (1);// out1
-
-    MyDStore->CommitL();
-    CleanupStack::PopAndDestroy (1);// Store
-
-}
-
-
-/**
- * Handle global resource changes, such as scalable UI or skin events (override)
- */
-void CSymbian_ua_guiSettingItemList::HandleResourceChange (TInt aType)
-{
-    CAknSettingItemList::HandleResourceChange (aType);
-    SetRect (iAvkonViewAppUi->View (TUid::Uid (ESymbian_ua_guiSettingItemListViewId))->ClientRect());
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * Handle key event (override)
- * @param aKeyEvent key event
- * @param aType event code
- * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed
- */
-TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL (
-    const TKeyEvent& aKeyEvent,
-    TEventCode aType)
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-    if (aKeyEvent.iCode == EKeyLeftArrow
-            || aKeyEvent.iCode == EKeyRightArrow) {
-        // allow the tab control to get the arrow keys
-        return EKeyWasNotConsumed;
-    }
-
-    return CAknSettingItemList::OfferKeyEventL (aKeyEvent, aType);
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp
deleted file mode 100644
index 2a158b4bb501e994f02206f14f4330c86a027094..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
-========================================================================
- Name        : symbian_ua_guiSettingItemListView.cpp
- Author      : nanang
- Copyright   : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <aknviewappui.h>
-#include <eikmenub.h>
-#include <avkon.hrh>
-#include <akncontext.h>
-#include <akntitle.h>
-#include <stringloader.h>
-#include <barsread.h>
-#include <eikbtgpc.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiSettingItemListView.h"
-#include "symbian_ua_guiContainer.hrh"
-#include "symbian_ua_guiSettingItemList.hrh"
-#include "symbian_ua_guiSettingItemList.h"
-// ]]] end generated region [Generated User Includes]
-
-#include "symbian_ua.h"
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-/**
- * First phase of Symbian two-phase construction. Should not contain any
- * code that could leave.
- */
-Csymbian_ua_guiSettingItemListView::Csymbian_ua_guiSettingItemListView()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * The view's destructor removes the container from the control
- * stack and destroys it.
- */
-Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- * Symbian two-phase constructor.
- * This creates an instance then calls the second-phase constructor
- * without leaving the instance on the cleanup stack.
- * @return new instance of Csymbian_ua_guiSettingItemListView
- */
-Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL()
-{
-    Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC();
-    CleanupStack::Pop (self);
-    return self;
-}
-
-/**
- * Symbian two-phase constructor.
- * This creates an instance, pushes it on the cleanup stack,
- * then calls the second-phase constructor.
- * @return new instance of Csymbian_ua_guiSettingItemListView
- */
-Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewLC()
-{
-    Csymbian_ua_guiSettingItemListView* self = new (ELeave) Csymbian_ua_guiSettingItemListView();
-    CleanupStack::PushL (self);
-    self->ConstructL();
-    return self;
-}
-
-
-/**
- * Second-phase constructor for view.
- * Initialize contents from resource.
- */
-void Csymbian_ua_guiSettingItemListView::ConstructL()
-{
-    // [[[ begin generated region: do not modify [Generated Code]
-    BaseConstructL (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW);
-    // ]]] end generated region [Generated Code]
-
-    // add your own initialization code here
-}
-
-/**
- * @return The UID for this view
- */
-TUid Csymbian_ua_guiSettingItemListView::Id() const
-{
-    return TUid::Uid (ESymbian_ua_guiSettingItemListViewId);
-}
-
-/**
- * Handle a command for this view (override)
- * @param aCommand command id to be handled
- */
-void Csymbian_ua_guiSettingItemListView::HandleCommandL (TInt aCommand)
-{
-    // [[[ begin generated region: do not modify [Generated Code]
-    TBool commandHandled = EFalse;
-
-    switch (aCommand) {	// code to dispatch to the AknView's menu and CBA commands is generated here
-
-        case EAknSoftkeySave:
-            commandHandled = HandleControlPaneRightSoftKeyPressedL (aCommand);
-            break;
-
-        case ESymbian_ua_guiSettingItemListViewMenuItem1Command:
-            commandHandled = HandleChangeSelectedSettingItemL (aCommand);
-            break;
-
-        default:
-            break;
-    }
-
-
-    if (!commandHandled) {
-
-    }
-
-    // ]]] end generated region [Generated Code]
-
-}
-
-/**
- *	Handles user actions during activation of the view,
- *	such as initializing the content.
- */
-void Csymbian_ua_guiSettingItemListView::DoActivateL (
-    const TVwsViewId& /*aPrevViewId*/,
-    TUid /*aCustomMessageId*/,
-    const TDesC8& /*aCustomMessage*/)
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    SetupStatusPaneL();
-
-    CEikButtonGroupContainer* cba = AppUi()->Cba();
-
-    if (cba != NULL) {
-        cba->MakeVisible (EFalse);
-    }
-
-    if (iSymbian_ua_guiSettingItemList == NULL) {
-        iSettings = TSymbian_ua_guiSettingItemListSettings::NewL();
-        iSymbian_ua_guiSettingItemList = new (ELeave) CSymbian_ua_guiSettingItemList (*iSettings, this);
-        iSymbian_ua_guiSettingItemList->SetMopParent (this);
-        iSymbian_ua_guiSettingItemList->ConstructFromResourceL (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST);
-        iSymbian_ua_guiSettingItemList->ActivateL();
-        iSymbian_ua_guiSettingItemList->LoadSettingValuesL();
-        iSymbian_ua_guiSettingItemList->LoadSettingsL();
-        AppUi()->AddToStackL (*this, iSymbian_ua_guiSettingItemList);
-    }
-
-    // ]]] end generated region [Generated Contents]
-
-}
-
-/**
- */
-void Csymbian_ua_guiSettingItemListView::DoDeactivate()
-{
-    // [[[ begin generated region: do not modify [Generated Contents]
-    CleanupStatusPane();
-
-    CEikButtonGroupContainer* cba = AppUi()->Cba();
-
-    if (cba != NULL) {
-        cba->MakeVisible (ETrue);
-        cba->DrawDeferred();
-    }
-
-    if (iSymbian_ua_guiSettingItemList != NULL) {
-        AppUi()->RemoveFromStack (iSymbian_ua_guiSettingItemList);
-        delete iSymbian_ua_guiSettingItemList;
-        iSymbian_ua_guiSettingItemList = NULL;
-        delete iSettings;
-        iSettings = NULL;
-    }
-
-    // ]]] end generated region [Generated Contents]
-
-}
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiSettingItemListView::SetupStatusPaneL()
-{
-    // reset the context pane
-    TUid contextPaneUid = TUid::Uid (EEikStatusPaneUidContext);
-    CEikStatusPaneBase::TPaneCapabilities subPaneContext =
-        StatusPane()->PaneCapabilities (contextPaneUid);
-
-    if (subPaneContext.IsPresent() && subPaneContext.IsAppOwned()) {
-        CAknContextPane* context = static_cast< CAknContextPane* > (
-                                       StatusPane()->ControlL (contextPaneUid));
-        context->SetPictureToDefaultL();
-    }
-
-    // setup the title pane
-    TUid titlePaneUid = TUid::Uid (EEikStatusPaneUidTitle);
-
-    CEikStatusPaneBase::TPaneCapabilities subPaneTitle =
-        StatusPane()->PaneCapabilities (titlePaneUid);
-
-    if (subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned()) {
-        CAknTitlePane* title = static_cast< CAknTitlePane* > (
-                                   StatusPane()->ControlL (titlePaneUid));
-        TResourceReader reader;
-        iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE);
-        title->SetFromResourceL (reader);
-        CleanupStack::PopAndDestroy(); // reader internal state
-    }
-
-}
-
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiSettingItemListView::CleanupStatusPane()
-{
-}
-
-// ]]] end generated function
-
-/**
- * Handle status pane size change for this view (override)
- */
-void Csymbian_ua_guiSettingItemListView::HandleStatusPaneSizeChange()
-{
-    CAknView::HandleStatusPaneSizeChange();
-
-    // this may fail, but we're not able to propagate exceptions here
-    TInt result;
-    TRAP (result, SetupStatusPaneL());
-}
-
-/**
- * Handle the selected event.
- * @param aCommand the command id invoked
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL (TInt aCommand)
-{
-    iSymbian_ua_guiSettingItemList->ChangeSelectedItemL();
-    return ETrue;
-}
-
-/**
- * Handle the rightSoftKeyPressed event.
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL (TInt aCommand)
-{
-    TUint8 domain[256] = {0};
-    TPtr8 cDomain (domain, sizeof (domain));
-    TUint8 user[64] = {0};
-    TPtr8 cUser (user, sizeof (user));
-    TUint8 pass[64] = {0};
-    TPtr8 cPass (pass, sizeof (pass));
-
-    cDomain.Copy (iSettings->Ed_registrar());
-    cUser.Copy (iSettings->Ed_user());
-    cPass.Copy (iSettings->Ed_password());
-    symbian_ua_set_account ( (char*) domain, (char*) user, (char*) pass, false, false);
-
-    AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiContainerViewId));
-    return ETrue;
-}
-
-/**
- * Handle the selected event.
- * @param aCommand the command id invoked
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL (TInt aCommand)
-{
-    AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiContainerViewId));
-    return ETrue;
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/app_main.cpp b/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/app_main.cpp
deleted file mode 100644
index f0168a54bfc231bb51308ae5931857a4f59114c7..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/app_main.cpp
+++ /dev/null
@@ -1,398 +0,0 @@
-/* $Id: app_main.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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/delaybuf.h>
-#include <pjmedia/sound.h>
-#include <pj/errno.h>
-#include <pj/os.h>
-#include <pj/log.h>
-#include <pj/string.h>
-#include <pj/unicode.h>
-#include <e32cons.h>
-
-#define THIS_FILE		"app_main.cpp"
-#define CLOCK_RATE		8000
-#define CHANNEL_COUNT		1
-#define PTIME			20
-#define SAMPLES_PER_FRAME	(CLOCK_RATE*PTIME/1000)
-#define BITS_PER_SAMPLE		16
-
-extern CConsoleBase* console;
-
-static pj_caching_pool cp;
-static pjmedia_snd_stream *strm;
-static unsigned rec_cnt, play_cnt;
-static pj_time_val t_start;
-
-pj_pool_t *pool;
-pjmedia_delay_buf *delaybuf;
-
-/* Logging callback */
-static void log_writer (int level, const char *buf, unsigned len)
-{
-    static 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);
-}
-
-/* perror util */
-static void app_perror (const char *title, pj_status_t status)
-{
-    char errmsg[PJ_ERR_MSG_SIZE];
-    pj_strerror (status, errmsg, sizeof (errmsg));
-    PJ_LOG (1, (THIS_FILE, "Error: %s: %s", title, errmsg));
-}
-
-/* Application init */
-static pj_status_t app_init()
-{
-    unsigned i, count;
-    pj_status_t status;
-
-    /* Redirect log */
-    pj_log_set_log_func ( (void (*) (int,const char*,int)) &log_writer);
-    pj_log_set_decor (PJ_LOG_HAS_NEWLINE);
-    pj_log_set_level (3);
-
-    /* Init pjlib */
-    status = pj_init();
-
-    if (status != PJ_SUCCESS) {
-        app_perror ("pj_init()", status);
-        return status;
-    }
-
-    pj_caching_pool_init (&cp, NULL, 0);
-
-    /* Init sound subsystem */
-    status = pjmedia_snd_init (&cp.factory);
-
-    if (status != PJ_SUCCESS) {
-        app_perror ("pjmedia_snd_init()", status);
-        pj_caching_pool_destroy (&cp);
-        pj_shutdown();
-        return status;
-    }
-
-    count = pjmedia_snd_get_dev_count();
-
-    PJ_LOG (3, (THIS_FILE, "Device count: %d", count));
-
-    for (i=0; i<count; ++i) {
-        const pjmedia_snd_dev_info *info;
-
-        info = pjmedia_snd_get_dev_info (i);
-        PJ_LOG (3, (THIS_FILE, "%d: %s %d/%d %dHz",
-                    i, info->name, info->input_count, info->output_count,
-                    info->default_samples_per_sec));
-    }
-
-    /* Create pool */
-    pool = pj_pool_create (&cp.factory, THIS_FILE, 512, 512, NULL);
-
-    if (pool == NULL) {
-        app_perror ("pj_pool_create()", status);
-        pj_caching_pool_destroy (&cp);
-        pj_shutdown();
-        return status;
-    }
-
-    /* Init delay buffer */
-    status = pjmedia_delay_buf_create (pool, THIS_FILE, CLOCK_RATE,
-                                       SAMPLES_PER_FRAME, CHANNEL_COUNT,
-                                       0, 0, &delaybuf);
-
-    if (status != PJ_SUCCESS) {
-        app_perror ("pjmedia_delay_buf_create()", status);
-        //pj_caching_pool_destroy(&cp);
-        //pj_shutdown();
-        //return status;
-    }
-
-    return PJ_SUCCESS;
-}
-
-
-/* Sound capture callback */
-static pj_status_t rec_cb (void *user_data,
-                           pj_uint32_t timestamp,
-                           void *input,
-                           unsigned size)
-{
-    PJ_UNUSED_ARG (user_data);
-    PJ_UNUSED_ARG (timestamp);
-    PJ_UNUSED_ARG (size);
-
-    pjmedia_delay_buf_put (delaybuf, (pj_int16_t*) input);
-
-    if (size != SAMPLES_PER_FRAME*2) {
-        PJ_LOG (3, (THIS_FILE, "Size captured = %u",
-                    size));
-    }
-
-    ++rec_cnt;
-
-    return PJ_SUCCESS;
-}
-
-/* Play cb */
-static pj_status_t play_cb (void *user_data,
-                            pj_uint32_t timestamp,
-                            void *output,
-                            unsigned size)
-{
-    PJ_UNUSED_ARG (user_data);
-    PJ_UNUSED_ARG (timestamp);
-    PJ_UNUSED_ARG (size);
-
-    pjmedia_delay_buf_get (delaybuf, (pj_int16_t*) output);
-
-    ++play_cnt;
-    return PJ_SUCCESS;
-}
-
-/* Start sound */
-static pj_status_t snd_start (unsigned flag)
-{
-    pj_status_t status;
-
-    if (strm != NULL) {
-        app_perror ("snd already open", PJ_EINVALIDOP);
-        return PJ_EINVALIDOP;
-    }
-
-    if (flag==PJMEDIA_DIR_CAPTURE_PLAYBACK)
-        status = pjmedia_snd_open (-1, -1, CLOCK_RATE, CHANNEL_COUNT,
-                                   SAMPLES_PER_FRAME, BITS_PER_SAMPLE,
-                                   &rec_cb, &play_cb, NULL, &strm);
-    else if (flag==PJMEDIA_DIR_CAPTURE)
-        status = pjmedia_snd_open_rec (-1, CLOCK_RATE, CHANNEL_COUNT,
-                                       SAMPLES_PER_FRAME, BITS_PER_SAMPLE,
-                                       &rec_cb, NULL, &strm);
-    else
-        status = pjmedia_snd_open_player (-1, CLOCK_RATE, CHANNEL_COUNT,
-                                          SAMPLES_PER_FRAME, BITS_PER_SAMPLE,
-                                          &play_cb, NULL, &strm);
-
-    if (status != PJ_SUCCESS) {
-        app_perror ("snd open", status);
-        return status;
-    }
-
-    rec_cnt = play_cnt = 0;
-
-    pj_gettimeofday (&t_start);
-
-    pjmedia_delay_buf_reset (delaybuf);
-
-    status = pjmedia_snd_stream_start (strm);
-
-    if (status != PJ_SUCCESS) {
-        app_perror ("snd start", status);
-        pjmedia_snd_stream_close (strm);
-        strm = NULL;
-        return status;
-    }
-
-    return PJ_SUCCESS;
-}
-
-/* Stop sound */
-static pj_status_t snd_stop()
-{
-    pj_time_val now;
-    pj_status_t status;
-
-    if (strm == NULL) {
-        app_perror ("snd not open", PJ_EINVALIDOP);
-        return PJ_EINVALIDOP;
-    }
-
-    status = pjmedia_snd_stream_close (strm);
-
-    strm = NULL;
-
-    pj_gettimeofday (&now);
-    PJ_TIME_VAL_SUB (now, t_start);
-
-    PJ_LOG (3, (THIS_FILE, "Duration: %d.%03d", now.sec, now.msec));
-    PJ_LOG (3, (THIS_FILE, "Captured: %d", rec_cnt));
-    PJ_LOG (3, (THIS_FILE, "Played: %d", play_cnt));
-
-    return status;
-}
-
-/* Shutdown application */
-static void app_fini()
-{
-    if (strm)
-        snd_stop();
-
-    pjmedia_snd_deinit();
-
-    pjmedia_delay_buf_destroy (delaybuf);
-
-    pj_pool_release (pool);
-
-    pj_caching_pool_destroy (&cp);
-
-    pj_shutdown();
-}
-
-
-////////////////////////////////////////////////////////////////////////////
-/*
- * The interractive console UI
- */
-#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 (EPriorityHigh), 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();
-}
-
-static void PrintMenu()
-{
-    PJ_LOG (3, (THIS_FILE, "\n\n"
-                "Menu:\n"
-                "  a    Start bidir sound\n"
-                "  t    Start recorder\n"
-                "  p    Start player\n"
-                "  d    Stop & close sound\n"
-                "  w    Quit\n"));
-}
-
-// Implementation: called when read has completed.
-void ConsoleUI::RunL()
-{
-    TKeyCode kc = con_->KeyCode();
-    pj_bool_t reschedule = PJ_TRUE;
-
-    switch (kc) {
-
-        case 'w':
-            asw_->AsyncStop();
-            reschedule = PJ_FALSE;
-            break;
-
-        case 'a':
-            snd_start (PJMEDIA_DIR_CAPTURE_PLAYBACK);
-            break;
-
-        case 't':
-            snd_start (PJMEDIA_DIR_CAPTURE);
-            break;
-
-        case 'p':
-            snd_start (PJMEDIA_DIR_PLAYBACK);
-            break;
-
-        case 'd':
-            snd_stop();
-            break;
-
-        default:
-            PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed",
-                        kc, kc));
-            break;
-    }
-
-    PrintMenu();
-
-    if (reschedule)
-        Run();
-}
-
-
-////////////////////////////////////////////////////////////////////////////
-int app_main()
-{
-    if (app_init() != PJ_SUCCESS)
-        return -1;
-
-    // Run the UI
-    CActiveSchedulerWait *asw = new CActiveSchedulerWait;
-
-    ConsoleUI *con = new ConsoleUI (asw, console);
-
-    con->Run();
-
-    PrintMenu();
-
-    asw->Start();
-
-    delete con;
-
-    delete asw;
-
-    app_fini();
-
-    return 0;
-}
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/bin/pjsip-test-x86_64-unknown-linux-gnu b/sflphone-common/libs/pjproject-1.0.2/pjsip/bin/pjsip-test-x86_64-unknown-linux-gnu
deleted file mode 100755
index 45542bd1c516ee8b685b2f16469808270c040be0..0000000000000000000000000000000000000000
Binary files a/sflphone-common/libs/pjproject-1.0.2/pjsip/bin/pjsip-test-x86_64-unknown-linux-gnu and /dev/null differ
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-auto.mak
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h b/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h
deleted file mode 100644
index ff184d20d616b16ad37f2b09f6d43c1ac2b9f35b..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* pjsip/include/pjsip/sip_autoconf.h.  Generated by configure.  */
-/* $Id: sip_autoconf.h.in 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __PJSIP_SIP_AUTOCONF_H__
-#define __PJSIP_SIP_AUTOCONF_H__
-
-/**
- * @file sip_autoconf.h
- * @brief Describes operating system specifics (automatically detected by
- *        autoconf)
- */
-
-/**
- * Enable/disable TLS transport, as configured by autoconf.
- * But only do this if user doesn't explicitly configure in pj/config_site.h.
- */
-#ifndef PJSIP_HAS_TLS_TRANSPORT
-/* #undef PJSIP_HAS_TLS_TRANSPORT */
-#endif
-
-
-#endif	/* __PJSIP_SIP_AUTOCONF_H__ */
-
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-auto.mak
deleted file mode 100644
index 16e37e22b0f30fdb29d2b9a6f62255d41e3bc2d0..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-auto.mak
+++ /dev/null
@@ -1,16 +0,0 @@
-
-ifneq (,1)
-DIRS += gsm
-endif
-
-ifneq (,1)
-DIRS += ilbc
-endif
-
-ifneq (,1)
-DIRS += speex
-endif
-
-ifneq ($(findstring pa,pa_unix),)
-DIRS += portaudio
-endif
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-auto.mak b/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-auto.mak
deleted file mode 100644
index 79022f6df192d1ccb21fc34000725dd8e694aa22..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-auto.mak
+++ /dev/null
@@ -1,79 +0,0 @@
-# third_party/build/portaudio/os-auto.mak.  Generated from os-auto.mak.in by configure.
-
-# Define the desired sound device backend
-# Valid values are:
-#   - pa_unix:	    	PortAudio on Unix (OSS or ALSA)
-#   - pa_darwinos:  	PortAudio on MacOSX (CoreAudio)
-#   - pa_old_darwinos:  PortAudio on MacOSX (old CoreAudio, for OSX 10.2)
-#   - pa_win32:	    	PortAudio on Win32 (WMME)
-#
-# There are other values below, but these are handled by PJMEDIA's Makefile
-#   - ds:	    	Win32 DirectSound (dsound.c)
-#   - null:	    	Null sound device (nullsound.c)
-AC_PJMEDIA_SND=pa_unix
-
-# For Unix, specify if ALSA should be supported
-AC_PA_USE_ALSA=1
-
-# For Unix, specify if OSS should be supported
-AC_PA_USE_OSS=1
-
-# Additional PortAudio CFLAGS are in  -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN
-
-
-#
-# PortAudio on Unix
-#
-ifeq ($(AC_PJMEDIA_SND),pa_unix)
-# Host APIs and utils
-export PORTAUDIO_OBJS += pa_unix_hostapis.o pa_unix_util.o
-
-# Include ALSA?
-ifeq ($(AC_PA_USE_ALSA),1)
-export CFLAGS += -DPA_USE_ALSA=1
-export PORTAUDIO_OBJS += pa_linux_alsa.o
-endif
-
-export CFLAGS +=  -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN
-endif
-
-# Include OSS?
-ifeq ($(AC_PA_USE_OSS),1)
-export CFLAGS += -DPA_USE_OSS=1
-export PORTAUDIO_OBJS += pa_unix_oss.o
-endif
-
-#
-# PortAudio on MacOS X (using current PortAudio)
-#
-ifeq ($(AC_PJMEDIA_SND),pa_darwinos)
-export PORTAUDIO_OBJS +=pa_mac_hostapis.o \
-			pa_unix_util.o \
-			pa_mac_core.o \
-			pa_mac_core_blocking.o \
-			pa_mac_core_utilities.o \
-			pa_ringbuffer.o
-export CFLAGS += -DPA_USE_COREAUDIO=1
-export CFLAGS +=  -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN
-endif
-
-#
-# PortAudio on MacOS X (using old PortAudio, for MacOS X 10.2.x)
-#
-ifeq ($(AC_PJMEDIA_SND),pa_old_darwinos)
-export PORTAUDIO_OBJS +=pa_mac_hostapis.o \
-			pa_unix_util.o \
-			pa_mac_core_old.o 
-export CFLAGS += -DPA_USE_COREAUDIO=1
-export CFLAGS +=  -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN
-endif
-
-#
-#
-# PortAudio on Win32 (WMME)
-#
-ifeq ($(AC_PJMEDIA_SND),pa_win32)
-export PORTAUDIO_OBJS += pa_win_hostapis.o pa_win_util.o \
-		       pa_win_wmme.o pa_win_waveformat.o
-export CFLAGS += -DPA_NO_ASIO -DPA_NO_DS
-endif
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp b/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp
deleted file mode 100644
index 0653b138b06b8af86dcc82464d605d4e3eac2922..0000000000000000000000000000000000000000
--- a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp
+++ /dev/null
@@ -1,2133 +0,0 @@
-/*
- * Portable Audio I/O Library WASAPI implementation
- * Copyright (c) 2006-2007 David Viens
- *
- * Based on the Open Source API proposed by Ross Bencina
- * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however,
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also
- * requested that these non-binding requests be included along with the
- * license above.
- */
-
-/** @file
- @ingroup hostapi_src
- @brief WASAPI implementation of support for a host API.
-
- @note pa_wasapi currently requires VC 2005, and the latest Vista SDK
-*/
-
-#if _MSC_VER >= 1400
-#include <windows.h>
-#include <MMReg.h>  //must be before other Wasapi headers
-#include <strsafe.h>
-#include <mmdeviceapi.h>
-#include <Avrt.h>
-#include <audioclient.h>
-#include <Endpointvolume.h>
-
-#include <KsMedia.h>
-#include <functiondiscoverykeys.h>  // PKEY_Device_FriendlyName
-#endif
-
-#include "pa_util.h"
-#include "pa_allocation.h"
-#include "pa_hostapi.h"
-#include "pa_stream.h"
-#include "pa_cpuload.h"
-#include "pa_process.h"
-#include "pa_debugprint.h"
-
-
-/*
-  davidv : work in progress. try using with 48000 , then 44100
-  and shared mode FIRST.
- */
-
-#define PORTAUDIO_SHAREMODE     AUDCLNT_SHAREMODE_SHARED
-//#define PORTAUDIO_SHAREMODE   AUDCLNT_SHAREMODE_EXCLUSIVE
-
-
-
-/* prototypes for functions declared in this file */
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif /* __cplusplus */
-
-    PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index);
-
-#ifdef __cplusplus
-}
-
-#endif /* __cplusplus */
-
-
-
-
-static void Terminate (struct PaUtilHostApiRepresentation *hostApi);
-static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi,
-                                  const PaStreamParameters *inputParameters,
-                                  const PaStreamParameters *outputParameters,
-                                  double sampleRate);
-static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
-                           PaStream** s,
-                           const PaStreamParameters *inputParameters,
-                           const PaStreamParameters *outputParameters,
-                           double sampleRate,
-                           unsigned long framesPerBuffer,
-                           PaStreamFlags streamFlags,
-                           PaStreamCallback *streamCallback,
-                           void *userData);
-static PaError CloseStream (PaStream* stream);
-static PaError StartStream (PaStream *stream);
-static PaError StopStream (PaStream *stream);
-static PaError AbortStream (PaStream *stream);
-static PaError IsStreamStopped (PaStream *s);
-static PaError IsStreamActive (PaStream *stream);
-static PaTime GetStreamTime (PaStream *stream);
-static double GetStreamCpuLoad (PaStream* stream);
-static PaError ReadStream (PaStream* stream, void *buffer, unsigned long frames);
-static PaError WriteStream (PaStream* stream, const void *buffer, unsigned long frames);
-static signed long GetStreamReadAvailable (PaStream* stream);
-static signed long GetStreamWriteAvailable (PaStream* stream);
-
-
-/* IMPLEMENT ME: a macro like the following one should be used for reporting
- host errors */
-#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \
-    PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText )
-
-/* PaWinWasapiHostApiRepresentation - host api datastructure specific to this implementation */
-
-
-
-//dummy entry point for other compilers and sdks
-//currently built using RC1 SDK (5600)
-#if _MSC_VER < 1400
-
-PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex)
-{
-    return paNoError;
-}
-
-#else
-
-
-
-
-#define MAX_STR_LEN 512
-
-/*
- These are fields that can be gathered from IDevice
- and IAudioDevice PRIOR to Initialize, and done in first pass
- i assume that neither of these will cause the Driver to "load",
- but again, who knows how they implement their stuff
- */
-
-typedef struct PaWinWasapiDeviceInfo {
-    //hmm is it wise to keep a reference until Terminate?
-    //TODO Check if that interface requires the driver to be loaded!
-    IMMDevice * device;
-
-    //Fields filled from IDevice
-    //from GetId
-    WCHAR szDeviceID[MAX_STR_LEN];
-    //from GetState
-    DWORD state;
-
-    //Fields filled from IMMEndpoint'sGetDataFlow
-    EDataFlow  flow;
-
-    //Fields filled from IAudioDevice (_prior_ to Initialize)
-    //from GetDevicePeriod(
-    REFERENCE_TIME  DefaultDevicePeriod;
-    REFERENCE_TIME  MinimumDevicePeriod;
-    //from GetMixFormat
-    WAVEFORMATEX   *MixFormat;//needs to be CoTaskMemFree'd after use!
-
-} PaWinWasapiDeviceInfo;
-
-
-typedef struct {
-    PaUtilHostApiRepresentation inheritedHostApiRep;
-    PaUtilStreamInterface callbackStreamInterface;
-    PaUtilStreamInterface blockingStreamInterface;
-
-    PaUtilAllocationGroup *allocations;
-
-    /* implementation specific data goes here */
-
-    //in case we later need the synch
-    IMMDeviceEnumerator * enumerator;
-
-    //this is the REAL number of devices, whether they are usefull to PA or not!
-    UINT deviceCount;
-
-    WCHAR defaultRenderer [MAX_STR_LEN];
-    WCHAR defaultCapturer [MAX_STR_LEN];
-
-    PaWinWasapiDeviceInfo   *devInfo;
-}PaWinWasapiHostApiRepresentation;
-
-
-/* PaWinWasapiStream - a stream data structure specifically for this implementation */
-
-typedef struct PaWinWasapiSubStream {
-    IAudioClient        *client;
-    WAVEFORMATEXTENSIBLE wavex;
-    UINT32               bufferSize;
-    REFERENCE_TIME       latency;
-    REFERENCE_TIME       period;
-    unsigned long framesPerHostCallback; /* just an example */
-}PaWinWasapiSubStream;
-
-typedef struct PaWinWasapiStream { /* IMPLEMENT ME: rename this */
-    PaUtilStreamRepresentation streamRepresentation;
-    PaUtilCpuLoadMeasurer cpuLoadMeasurer;
-    PaUtilBufferProcessor bufferProcessor;
-
-    /* IMPLEMENT ME:
-            - implementation specific data goes here
-    */
-
-
-    //input
-    PaWinWasapiSubStream in;
-    IAudioCaptureClient *cclient;
-    IAudioEndpointVolume *inVol;
-    //output
-    PaWinWasapiSubStream out;
-    IAudioRenderClient  *rclient;
-    IAudioEndpointVolume *outVol;
-
-    bool running;
-    bool closeRequest;
-
-    DWORD dwThreadId;
-    HANDLE hThread;
-    HANDLE hNotificationEvent;
-
-    GUID  session;
-
-}PaWinWasapiStream;
-
-#define PRINT(x) PA_DEBUG(x);
-
-void
-logAUDCLNT_E (HRESULT res)
-{
-
-    char *text = 0;
-
-    switch (res) {
-
-        case S_OK:
-            return;
-            break;
-
-        case E_POINTER                              :
-            text ="E_POINTER";
-            break;
-
-        case E_INVALIDARG                           :
-            text ="E_INVALIDARG";
-            break;
-
-        case AUDCLNT_E_NOT_INITIALIZED              :
-            text ="AUDCLNT_E_NOT_INITIALIZED";
-            break;
-
-        case AUDCLNT_E_ALREADY_INITIALIZED          :
-            text ="AUDCLNT_E_ALREADY_INITIALIZED";
-            break;
-
-        case AUDCLNT_E_WRONG_ENDPOINT_TYPE          :
-            text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE";
-            break;
-
-        case AUDCLNT_E_DEVICE_INVALIDATED           :
-            text ="AUDCLNT_E_DEVICE_INVALIDATED";
-            break;
-
-        case AUDCLNT_E_NOT_STOPPED                  :
-            text ="AUDCLNT_E_NOT_STOPPED";
-            break;
-
-        case AUDCLNT_E_BUFFER_TOO_LARGE             :
-            text ="AUDCLNT_E_BUFFER_TOO_LARGE";
-            break;
-
-        case AUDCLNT_E_OUT_OF_ORDER                 :
-            text ="AUDCLNT_E_OUT_OF_ORDER";
-            break;
-
-        case AUDCLNT_E_UNSUPPORTED_FORMAT           :
-            text ="AUDCLNT_E_UNSUPPORTED_FORMAT";
-            break;
-
-        case AUDCLNT_E_INVALID_SIZE                 :
-            text ="AUDCLNT_E_INVALID_SIZE";
-            break;
-
-        case AUDCLNT_E_DEVICE_IN_USE                :
-            text ="AUDCLNT_E_DEVICE_IN_USE";
-            break;
-
-        case AUDCLNT_E_BUFFER_OPERATION_PENDING     :
-            text ="AUDCLNT_E_BUFFER_OPERATION_PENDING";
-            break;
-
-        case AUDCLNT_E_THREAD_NOT_REGISTERED        :
-            text ="AUDCLNT_E_THREAD_NOT_REGISTERED";
-            break;
-
-        case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED   :
-            text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED";
-            break;
-
-        case AUDCLNT_E_ENDPOINT_CREATE_FAILED       :
-            text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED";
-            break;
-
-        case AUDCLNT_E_SERVICE_NOT_RUNNING          :
-            text ="AUDCLNT_E_SERVICE_NOT_RUNNING";
-            break;
-            //  case AUDCLNT_E_CPUUSAGE_EXCEEDED            :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break;
-            //Header error?
-
-        case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED     :
-            text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED";
-            break;
-
-        case AUDCLNT_E_EXCLUSIVE_MODE_ONLY          :
-            text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY";
-            break;
-
-        case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL :
-            text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL";
-            break;
-
-        case AUDCLNT_E_EVENTHANDLE_NOT_SET          :
-            text ="AUDCLNT_E_EVENTHANDLE_NOT_SET";
-            break;
-
-        case AUDCLNT_E_INCORRECT_BUFFER_SIZE        :
-            text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE";
-            break;
-
-        case AUDCLNT_E_BUFFER_SIZE_ERROR            :
-            text ="AUDCLNT_E_BUFFER_SIZE_ERROR";
-            break;
-
-        case AUDCLNT_S_BUFFER_EMPTY                 :
-            text ="AUDCLNT_S_BUFFER_EMPTY";
-            break;
-
-        case AUDCLNT_S_THREAD_ALREADY_REGISTERED    :
-            text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED";
-            break;
-
-        default:
-            text =" dunno!";
-            return ;
-            break;
-
-    }
-
-    PRINT ( ("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text));
-}
-
-inline double
-nano100ToMillis (const REFERENCE_TIME &ref)
-{
-    //  1 nano = 0.000000001 seconds
-    //100 nano = 0.0000001   seconds
-    //100 nano = 0.0001   milliseconds
-    return ( (double) ref) *0.0001;
-}
-
-inline double
-nano100ToSeconds (const REFERENCE_TIME &ref)
-{
-    //  1 nano = 0.000000001 seconds
-    //100 nano = 0.0000001   seconds
-    //100 nano = 0.0001   milliseconds
-    return ( (double) ref) *0.0000001;
-}
-
-#ifndef IF_FAILED_JUMP
-#define IF_FAILED_JUMP(hr, label) if(FAILED(hr)) goto label;
-#endif
-
-
-
-//AVRT is the new "multimedia schedulling stuff"
-
-typedef BOOL (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER);
-typedef BOOL (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE);
-typedef BOOL (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE);
-typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics) (LPCTSTR,LPDWORD);
-typedef BOOL (WINAPI *FAvSetMmThreadPriority) (HANDLE,AVRT_PRIORITY);
-
-HMODULE  hDInputDLL = 0;
-FAvRtCreateThreadOrderingGroup pAvRtCreateThreadOrderingGroup=0;
-FAvRtDeleteThreadOrderingGroup pAvRtDeleteThreadOrderingGroup=0;
-FAvRtWaitOnThreadOrderingGroup pAvRtWaitOnThreadOrderingGroup=0;
-FAvSetMmThreadCharacteristics  pAvSetMmThreadCharacteristics=0;
-FAvSetMmThreadPriority         pAvSetMmThreadPriority=0;
-
-
-
-#define setupPTR(fun, type, name)  {                                                        \
-                                        fun = (type) GetProcAddress(hDInputDLL,name);       \
-                                        if(fun == NULL) {                                   \
-                                            PRINT(("GetProcAddr failed for %s" ,name));     \
-                                            return false;                                   \
-                                        }                                                   \
-                                    }                                                       \
- 
-bool
-setupAVRT()
-{
-
-    hDInputDLL = LoadLibraryA ("avrt.dll");
-
-    if (hDInputDLL == NULL)
-        return false;
-
-    setupPTR (pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup");
-
-    setupPTR (pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup");
-
-    setupPTR (pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup");
-
-    setupPTR (pAvSetMmThreadCharacteristics,  FAvSetMmThreadCharacteristics,  "AvSetMmThreadCharacteristicsA");
-
-    setupPTR (pAvSetMmThreadPriority,         FAvSetMmThreadPriority,         "AvSetMmThreadPriority");
-
-    return true;
-}
-
-
-
-PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex)
-{
-    if (!setupAVRT()) {
-        PRINT ( ("Windows WASAPI : No AVRT! (not VISTA?)"));
-        return paNoError;
-    }
-
-    CoInitialize (NULL);
-
-    PaError result = paNoError;
-    PaWinWasapiHostApiRepresentation *paWasapi;
-    PaDeviceInfo *deviceInfoArray;
-
-    paWasapi = (PaWinWasapiHostApiRepresentation*) PaUtil_AllocateMemory (sizeof (PaWinWasapiHostApiRepresentation));
-
-    if (!paWasapi) {
-        result = paInsufficientMemory;
-        goto error;
-    }
-
-    paWasapi->allocations = PaUtil_CreateAllocationGroup();
-
-    if (!paWasapi->allocations) {
-        result = paInsufficientMemory;
-        goto error;
-    }
-
-    *hostApi = &paWasapi->inheritedHostApiRep;
-
-    (*hostApi)->info.structVersion = 1;
-    (*hostApi)->info.type = paWASAPI;
-    (*hostApi)->info.name = "Windows WASAPI";
-    (*hostApi)->info.deviceCount = 0;   //so far, we must investigate each
-    (*hostApi)->info.defaultInputDevice  = paNoDevice;  /* IMPLEMENT ME */
-    (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */
-
-
-    HRESULT hResult = S_OK;
-    IMMDeviceCollection* spEndpoints=0;
-    paWasapi->enumerator = 0;
-
-    hResult = CoCreateInstance (
-                  __uuidof (MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER,
-                  __uuidof (IMMDeviceEnumerator),
-                  (void**) &paWasapi->enumerator);
-
-    IF_FAILED_JUMP (hResult, error);
-
-    //getting default device ids in the eMultimedia "role"
-    {
-        {
-            IMMDevice* defaultRenderer=0;
-            hResult = paWasapi->enumerator->GetDefaultAudioEndpoint (eRender, eMultimedia, &defaultRenderer);
-            IF_FAILED_JUMP (hResult, error);
-            WCHAR* pszDeviceId = NULL;
-            hResult = defaultRenderer->GetId (&pszDeviceId);
-            IF_FAILED_JUMP (hResult, error);
-            StringCchCopyW (paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId);
-            CoTaskMemFree (pszDeviceId);
-            defaultRenderer->Release();
-        }
-
-        {
-            IMMDevice* defaultCapturer=0;
-            hResult = paWasapi->enumerator->GetDefaultAudioEndpoint (eCapture, eMultimedia, &defaultCapturer);
-            IF_FAILED_JUMP (hResult, error);
-            WCHAR* pszDeviceId = NULL;
-            hResult = defaultCapturer->GetId (&pszDeviceId);
-            IF_FAILED_JUMP (hResult, error);
-            StringCchCopyW (paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId);
-            CoTaskMemFree (pszDeviceId);
-            defaultCapturer->Release();
-        }
-    }
-
-
-    hResult = paWasapi->enumerator->EnumAudioEndpoints (eAll, DEVICE_STATE_ACTIVE, &spEndpoints);
-    IF_FAILED_JUMP (hResult, error);
-
-    hResult = spEndpoints->GetCount (&paWasapi->deviceCount);
-    IF_FAILED_JUMP (hResult, error);
-
-    paWasapi->devInfo = new PaWinWasapiDeviceInfo[paWasapi->deviceCount];
-    {
-        for (size_t step=0;step<paWasapi->deviceCount;++step)
-            memset (&paWasapi->devInfo[step],0,sizeof (PaWinWasapiDeviceInfo));
-    }
-
-
-
-    if (paWasapi->deviceCount > 0) {
-        (*hostApi)->deviceInfos = (PaDeviceInfo**) PaUtil_GroupAllocateMemory (
-                                      paWasapi->allocations, sizeof (PaDeviceInfo*) * paWasapi->deviceCount);
-
-        if (! (*hostApi)->deviceInfos) {
-            result = paInsufficientMemory;
-            goto error;
-        }
-
-        /* allocate all device info structs in a contiguous block */
-        deviceInfoArray = (PaDeviceInfo*) PaUtil_GroupAllocateMemory (
-                              paWasapi->allocations, sizeof (PaDeviceInfo) * paWasapi->deviceCount);
-
-        if (!deviceInfoArray) {
-            result = paInsufficientMemory;
-            goto error;
-        }
-
-        for (UINT i=0; i < paWasapi->deviceCount; ++i) {
-
-            PA_DEBUG ( ("i:%d\n",i));
-            PaDeviceInfo *deviceInfo = &deviceInfoArray[i];
-            deviceInfo->structVersion = 2;
-            deviceInfo->hostApi = hostApiIndex;
-
-            hResult = spEndpoints->Item (i, &paWasapi->devInfo[i].device);
-            IF_FAILED_JUMP (hResult, error);
-
-            //getting ID
-            {
-                WCHAR* pszDeviceId = NULL;
-                hResult = paWasapi->devInfo[i].device->GetId (&pszDeviceId);
-                IF_FAILED_JUMP (hResult, error);
-                StringCchCopyW (paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId);
-                CoTaskMemFree (pszDeviceId);
-
-                if (lstrcmpW (paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer) ==0) {
-                    //we found the default input!
-                    (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount;
-                }
-
-                if (lstrcmpW (paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer) ==0) {
-                    //we found the default output!
-                    (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount;
-                }
-            }
-
-            DWORD state=0;
-            hResult = paWasapi->devInfo[i].device->GetState (&paWasapi->devInfo[i].state);
-            IF_FAILED_JUMP (hResult, error);
-
-            if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE) {
-                PRINT ( ("WASAPI device:%d is not currently available (state:%d)\n",i,state));
-                //spDevice->Release();
-                //continue;
-            }
-
-            {
-                IPropertyStore* spProperties;
-                hResult = paWasapi->devInfo[i].device->OpenPropertyStore (STGM_READ, &spProperties);
-                IF_FAILED_JUMP (hResult, error);
-
-                //getting "Friendly" Name
-                {
-                    PROPVARIANT value;
-                    PropVariantInit (&value);
-                    hResult = spProperties->GetValue (PKEY_Device_FriendlyName, &value);
-                    IF_FAILED_JUMP (hResult, error);
-                    deviceInfo->name = 0;
-                    char* deviceName = (char*) PaUtil_GroupAllocateMemory (paWasapi->allocations, MAX_STR_LEN + 1);
-
-                    if (!deviceName) {
-                        result = paInsufficientMemory;
-                        goto error;
-                    }
-
-                    if (value.pwszVal)
-                        wcstombs (deviceName,   value.pwszVal,MAX_STR_LEN-1); //todo proper size
-                    else {
-                        sprintf (deviceName,"baddev%d",i);
-                    }
-
-                    deviceInfo->name = deviceName;
-
-                    PropVariantClear (&value);
-                }
-
-#if 0
-                DWORD numProps = 0;
-                hResult = spProperties->GetCount (&numProps);
-                IF_FAILED_JUMP (hResult, error);
-                {
-                    for (DWORD i=0;i<numProps;++i) {
-                        PROPERTYKEY pkey;
-                        hResult = spProperties->GetAt (i,&pkey);
-
-                        PROPVARIANT value;
-                        PropVariantInit (&value);
-                        hResult = spProperties->GetValue (pkey, &value);
-
-                        switch (value.vt) {
-
-                            case 11:
-                                PRINT ( ("property*%u*\n",value.ulVal));
-                                break;
-
-                            case 19:
-                                PRINT ( ("property*%d*\n",value.boolVal));
-                                break;
-
-                            case 31: {
-                                char temp[512];
-                                wcstombs (temp,    value.pwszVal,MAX_STR_LEN-1);
-                                PRINT ( ("property*%s*\n",temp));
-                            }
-
-                            break;
-
-                            default:
-                                break;
-                        }
-
-                        PropVariantClear (&value);
-                    }
-                }
-
-#endif
-
-                /*  These look interresting... but they are undocumented
-                PKEY_AudioEndpoint_FormFactor
-                PKEY_AudioEndpoint_ControlPanelPageProvider
-                PKEY_AudioEndpoint_Association
-                PKEY_AudioEndpoint_PhysicalSpeakerConfig
-                PKEY_AudioEngine_DeviceFormat
-                */
-                spProperties->Release();
-            }
-
-
-            //getting the Endpoint data
-            {
-                IMMEndpoint *endpoint=0;
-                hResult = paWasapi->devInfo[i].device->QueryInterface (__uuidof (IMMEndpoint), (void **) &endpoint);
-
-                if (SUCCEEDED (hResult)) {
-                    hResult = endpoint->GetDataFlow (&paWasapi->devInfo[i].flow);
-                    endpoint->Release();
-                }
-            }
-
-            //Getting a temporary IAudioDevice for more fields
-            //we make sure NOT to call Initialize yet!
-            {
-                IAudioClient *myClient=0;
-
-                hResult = paWasapi->devInfo[i].device->Activate (__uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient);
-                IF_FAILED_JUMP (hResult, error);
-
-                hResult = myClient->GetDevicePeriod (
-                              &paWasapi->devInfo[i].DefaultDevicePeriod,
-                              &paWasapi->devInfo[i].MinimumDevicePeriod);
-                IF_FAILED_JUMP (hResult, error);
-
-                hResult = myClient->GetMixFormat (&paWasapi->devInfo[i].MixFormat);
-
-                if (hResult != S_OK) {
-                    /*davidv: this happened with my hardware, previously for that same device in DirectSound:
-                      Digital Output (Realtek AC'97 Audio)'s GUID: {0x38f2cf50,0x7b4c,0x4740,0x86,0xeb,0xd4,0x38,0x66,0xd8,0xc8, 0x9f}
-                      so something must be _really_ wrong with this device, TODO handle this better. We kind of need GetMixFormat*/
-                    logAUDCLNT_E (hResult);
-                    goto error;
-                }
-
-                myClient->Release();
-            }
-
-            //we can now fill in portaudio device data
-            deviceInfo->maxInputChannels  = 0;  //for now
-
-            deviceInfo->maxOutputChannels = 0;  //for now
-
-            switch (paWasapi->devInfo[i].flow) {
-
-                case eRender:
-                    //hum not exaclty maximum, more like "default"
-                    deviceInfo->maxOutputChannels = paWasapi->devInfo[i].MixFormat->nChannels;
-
-                    deviceInfo->defaultHighOutputLatency = nano100ToSeconds (paWasapi->devInfo[i].DefaultDevicePeriod);
-                    deviceInfo->defaultLowOutputLatency  = nano100ToSeconds (paWasapi->devInfo[i].MinimumDevicePeriod);
-                    break;
-
-                case eCapture:
-                    //hum not exaclty maximum, more like "default"
-                    deviceInfo->maxInputChannels  = paWasapi->devInfo[i].MixFormat->nChannels;
-
-                    deviceInfo->defaultHighInputLatency = nano100ToSeconds (paWasapi->devInfo[i].DefaultDevicePeriod);
-                    deviceInfo->defaultLowInputLatency  = nano100ToSeconds (paWasapi->devInfo[i].MinimumDevicePeriod);
-                    break;
-
-                default:
-                    PRINT ( ("WASAPI device:%d bad Data FLow! \n",i));
-                    goto error;
-                    break;
-            }
-
-            deviceInfo->defaultSampleRate = (double) paWasapi->devInfo[i].MixFormat->nSamplesPerSec;
-
-            (*hostApi)->deviceInfos[i] = deviceInfo;
-            ++ (*hostApi)->info.deviceCount;
-        }
-    }
-
-    spEndpoints->Release();
-
-    (*hostApi)->Terminate = Terminate;
-    (*hostApi)->OpenStream = OpenStream;
-    (*hostApi)->IsFormatSupported = IsFormatSupported;
-
-    PaUtil_InitializeStreamInterface (&paWasapi->callbackStreamInterface, CloseStream, StartStream,
-                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,
-                                      GetStreamTime, GetStreamCpuLoad,
-                                      PaUtil_DummyRead, PaUtil_DummyWrite,
-                                      PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable);
-
-    PaUtil_InitializeStreamInterface (&paWasapi->blockingStreamInterface, CloseStream, StartStream,
-                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,
-                                      GetStreamTime, PaUtil_DummyGetCpuLoad,
-                                      ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable);
-
-    return result;
-
-error:
-
-    if (spEndpoints)
-        spEndpoints->Release();
-
-    if (paWasapi->enumerator)
-        paWasapi->enumerator->Release();
-
-    if (paWasapi) {
-        if (paWasapi->allocations) {
-            PaUtil_FreeAllAllocations (paWasapi->allocations);
-            PaUtil_DestroyAllocationGroup (paWasapi->allocations);
-        }
-
-        PaUtil_FreeMemory (paWasapi);
-    }
-
-    return result;
-}
-
-
-static void Terminate (struct PaUtilHostApiRepresentation *hostApi)
-{
-    PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi;
-
-    paWasapi->enumerator->Release();
-
-    for (UINT i=0;i<paWasapi->deviceCount;++i) {
-        PaWinWasapiDeviceInfo *info = &paWasapi->devInfo[i];
-
-        if (info->device)
-            info->device->Release();
-
-        if (info->MixFormat)
-            CoTaskMemFree (info->MixFormat);
-    }
-
-    delete [] paWasapi->devInfo;
-
-    CoUninitialize();
-
-    if (paWasapi->allocations) {
-        PaUtil_FreeAllAllocations (paWasapi->allocations);
-        PaUtil_DestroyAllocationGroup (paWasapi->allocations);
-    }
-
-    PaUtil_FreeMemory (paWasapi);
-}
-
-static void
-LogWAVEFORMATEXTENSIBLE (const WAVEFORMATEXTENSIBLE *in)
-{
-
-    const WAVEFORMATEX *old = (WAVEFORMATEX *) in;
-
-    switch (old->wFormatTag) {
-
-        case WAVE_FORMAT_EXTENSIBLE: {
-
-            PRINT ( ("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n"));
-
-            if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) {
-                PRINT ( ("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n"));
-            } else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) {
-                PRINT ( ("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n"));
-            } else {
-                PRINT ( ("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n",
-                         in->SubFormat.Data1,
-                         in->SubFormat.Data2,
-                         in->SubFormat.Data3,
-                         (int) in->SubFormat.Data4[0],
-                         (int) in->SubFormat.Data4[1],
-                         (int) in->SubFormat.Data4[2],
-                         (int) in->SubFormat.Data4[3],
-                         (int) in->SubFormat.Data4[4],
-                         (int) in->SubFormat.Data4[5],
-                         (int) in->SubFormat.Data4[6],
-                         (int) in->SubFormat.Data4[7]));
-            }
-
-            PRINT ( ("Samples.wValidBitsPerSample=%d\n",  in->Samples.wValidBitsPerSample));
-
-            PRINT ( ("dwChannelMask=0x%X\n",in->dwChannelMask));
-        }
-
-        break;
-
-        case WAVE_FORMAT_PCM:
-            PRINT ( ("wFormatTag=WAVE_FORMAT_PCM\n"));
-            break;
-
-        case WAVE_FORMAT_IEEE_FLOAT:
-            PRINT ( ("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n"));
-            break;
-
-        default :
-            PRINT ( ("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag));
-            break;
-    }
-
-    PRINT ( ("nChannels      =%d\n",old->nChannels));
-
-    PRINT ( ("nSamplesPerSec =%d\n",old->nSamplesPerSec));
-    PRINT ( ("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec));
-    PRINT ( ("nBlockAlign    =%d\n",old->nBlockAlign));
-    PRINT ( ("wBitsPerSample =%d\n",old->wBitsPerSample));
-    PRINT ( ("cbSize         =%d\n",old->cbSize));
-}
-
-
-
-/*
- WAVEFORMATXXX is always interleaved
- */
-static PaSampleFormat
-waveformatToPaFormat (const WAVEFORMATEXTENSIBLE *in)
-{
-
-    const WAVEFORMATEX *old = (WAVEFORMATEX*) in;
-
-    switch (old->wFormatTag) {
-
-        case WAVE_FORMAT_EXTENSIBLE: {
-            if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) {
-                if (in->Samples.wValidBitsPerSample == 32)
-                    return paFloat32;
-                else
-                    return paCustomFormat;
-            } else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) {
-                switch (old->wBitsPerSample) {
-
-                    case 32:
-                        return paInt32;
-                        break;
-
-                    case 24:
-                        return paInt24;
-                        break;
-
-                    case  8:
-                        return paUInt8;
-                        break;
-
-                    case 16:
-                        return paInt16;
-                        break;
-
-                    default:
-                        return paCustomFormat;
-                        break;
-                }
-            } else
-                return paCustomFormat;
-        }
-
-        break;
-
-        case WAVE_FORMAT_IEEE_FLOAT:
-            return paFloat32;
-            break;
-
-        case WAVE_FORMAT_PCM: {
-            switch (old->wBitsPerSample) {
-
-                case 32:
-                    return paInt32;
-                    break;
-
-                case 24:
-                    return paInt24;
-                    break;
-
-                case  8:
-                    return paUInt8;
-                    break;
-
-                case 16:
-                    return paInt16;
-                    break;
-
-                default:
-                    return paCustomFormat;
-                    break;
-            }
-        }
-
-        break;
-
-        default:
-            return paCustomFormat;
-            break;
-    }
-
-    return paCustomFormat;
-}
-
-
-
-static PaError
-waveformatFromParams (WAVEFORMATEXTENSIBLE*wavex,
-                      const PaStreamParameters * params,
-                      double sampleRate)
-{
-
-    size_t bytesPerSample = 0;
-
-    switch (params->sampleFormat & ~paNonInterleaved) {
-
-        case paFloat32:
-
-        case paInt32:
-            bytesPerSample=4;
-            break;
-
-        case paInt16:
-            bytesPerSample=2;
-            break;
-
-        case paInt24:
-            bytesPerSample=3;
-            break;
-
-        case paInt8:
-
-        case paUInt8:
-            bytesPerSample=1;
-            break;
-
-        case paCustomFormat:
-
-        default:
-            return paSampleFormatNotSupported;
-            break;
-    }
-
-    memset (wavex,0,sizeof (WAVEFORMATEXTENSIBLE));
-
-    WAVEFORMATEX *old    = (WAVEFORMATEX *) wavex;
-    old->nChannels       = (WORD) params->channelCount;
-    old->nSamplesPerSec  = (DWORD) sampleRate;
-    old->wBitsPerSample  = (WORD) (bytesPerSample*8);
-    old->nAvgBytesPerSec = (DWORD) (old->nSamplesPerSec * old->nChannels * bytesPerSample);
-    old->nBlockAlign     = (WORD) (old->nChannels * bytesPerSample);
-
-    //WAVEFORMATEX
-
-    if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)) {
-        old->cbSize          = 0;
-        old->wFormatTag      = WAVE_FORMAT_PCM;
-    }
-
-    //WAVEFORMATEXTENSIBLE
-    else {
-        old->wFormatTag = WAVE_FORMAT_EXTENSIBLE;
-
-        old->cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX);
-
-        if ( (params->sampleFormat & ~paNonInterleaved) == paFloat32)
-            wavex->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
-        else
-            wavex->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
-
-        wavex->Samples.wValidBitsPerSample = old->wBitsPerSample; //no extra padding!
-
-        switch (params->channelCount) {
-
-            case 1:
-                wavex->dwChannelMask = SPEAKER_FRONT_CENTER;
-                break;
-
-            case 2:
-                wavex->dwChannelMask = 0x1 | 0x2;
-                break;
-
-            case 4:
-                wavex->dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20;
-                break;
-
-            case 6:
-                wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20;
-                break;
-
-            case 8:
-                wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80;
-                break;
-
-            default:
-                wavex->dwChannelMask = 0;
-                break;
-        }
-    }
-
-    return paNoError;
-}
-
-
-
-
-
-
-/*
-#define paFloat32        ((PaSampleFormat) 0x00000001) 
-#define paInt32          ((PaSampleFormat) 0x00000002)
-#define paInt24          ((PaSampleFormat) 0x00000004) 
-#define paInt16          ((PaSampleFormat) 0x00000008) 
-*/
-//lifted from pa_wdmks
-static void wasapiFillWFEXT (WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount)
-{
-    PA_DEBUG ( ("sampleFormat = %lx\n" , sampleFormat));
-    PA_DEBUG ( ("sampleRate = %f\n" , sampleRate));
-    PA_DEBUG ( ("chanelCount = %d\n", channelCount));
-
-    pwfext->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
-    pwfext->Format.nChannels = channelCount;
-    pwfext->Format.nSamplesPerSec = (int) sampleRate;
-
-    if (channelCount == 1)
-        pwfext->dwChannelMask = KSAUDIO_SPEAKER_DIRECTOUT;
-    else
-        pwfext->dwChannelMask = KSAUDIO_SPEAKER_STEREO;
-
-    if (sampleFormat == paFloat32) {
-        pwfext->Format.nBlockAlign = channelCount * 4;
-        pwfext->Format.wBitsPerSample = 32;
-        pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX);
-        pwfext->Samples.wValidBitsPerSample = 32;
-        pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
-    } else if (sampleFormat == paInt32) {
-        pwfext->Format.nBlockAlign = channelCount * 4;
-        pwfext->Format.wBitsPerSample = 32;
-        pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX);
-        pwfext->Samples.wValidBitsPerSample = 32;
-        pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
-    } else if (sampleFormat == paInt24) {
-        pwfext->Format.nBlockAlign = channelCount * 3;
-        pwfext->Format.wBitsPerSample = 24;
-        pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX);
-        pwfext->Samples.wValidBitsPerSample = 24;
-        pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
-    } else if (sampleFormat == paInt16) {
-        pwfext->Format.nBlockAlign = channelCount * 2;
-        pwfext->Format.wBitsPerSample = 16;
-        pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX);
-        pwfext->Samples.wValidBitsPerSample = 16;
-        pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
-    }
-
-    pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign;
-}
-
-
-
-/*
-#define FORMATTESTS 4
-const int BestToWorst[FORMATTESTS]={paFloat32,paInt32,paInt24,paInt16};
-*/
-
-#define FORMATTESTS 3
-const int BestToWorst[FORMATTESTS]={paFloat32,paInt24,paInt16};
-
-
-static PaError
-GetClosestFormat (IAudioClient * myClient, double sampleRate,const  PaStreamParameters * params,
-                  AUDCLNT_SHAREMODE *shareMode, WAVEFORMATEXTENSIBLE *outWavex)
-{
-    //TODO we should try exclusive first and shared after
-    *shareMode = PORTAUDIO_SHAREMODE;
-
-    PaError answer = paInvalidSampleRate;
-
-    waveformatFromParams (outWavex,params,sampleRate);
-    WAVEFORMATEX *sharedClosestMatch=0;
-    HRESULT hResult=!S_OK;
-
-    if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)
-        hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) outWavex,NULL);
-    else
-        hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &outWavex,&sharedClosestMatch);
-
-    if (hResult == S_OK)
-        answer = paFormatIsSupported;
-    else if (sharedClosestMatch) {
-        WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*) sharedClosestMatch;
-
-        int closestMatchSR = (int) sharedClosestMatch->nSamplesPerSec;
-
-        if (sharedClosestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE)
-            memcpy (outWavex,sharedClosestMatch,sizeof (WAVEFORMATEXTENSIBLE));
-        else
-            memcpy (outWavex,sharedClosestMatch,sizeof (WAVEFORMATEX));
-
-        CoTaskMemFree (sharedClosestMatch);
-
-        if ( (int) sampleRate == closestMatchSR)
-            answer = paFormatIsSupported;
-        else
-            answer = paInvalidSampleRate;
-
-    } else {
-
-        //it doesnt suggest anything?? ok lets show it the MENU!
-
-        //ok fun time as with pa_win_mme, we know only a refusal of the user-requested
-        //sampleRate+num Channel is disastrous, as the portaudio buffer processor converts between anything
-        //so lets only use the number
-        for (int i=0;i<FORMATTESTS;++i) {
-            WAVEFORMATEXTENSIBLE ext;
-            wasapiFillWFEXT (&ext,BestToWorst[i],sampleRate,params->channelCount);
-
-            if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)
-                hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) &ext,NULL);
-            else
-                hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &ext,&sharedClosestMatch);
-
-            if (hResult == S_OK) {
-                memcpy (outWavex,&ext,sizeof (WAVEFORMATEXTENSIBLE));
-                answer = paFormatIsSupported;
-                break;
-            }
-        }
-
-        if (answer!=paFormatIsSupported) {
-            //try MIX format?
-            //why did it HAVE to come to this ....
-            WAVEFORMATEX pcm16WaveFormat;
-            memset (&pcm16WaveFormat,0,sizeof (WAVEFORMATEX));
-            pcm16WaveFormat.wFormatTag = WAVE_FORMAT_PCM;
-            pcm16WaveFormat.nChannels = 2;
-            pcm16WaveFormat.nSamplesPerSec = (DWORD) sampleRate;
-            pcm16WaveFormat.nBlockAlign = 4;
-            pcm16WaveFormat.nAvgBytesPerSec = pcm16WaveFormat.nSamplesPerSec*pcm16WaveFormat.nBlockAlign;
-            pcm16WaveFormat.wBitsPerSample = 16;
-            pcm16WaveFormat.cbSize = 0;
-
-            if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)
-                hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) &pcm16WaveFormat,NULL);
-            else
-                hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &pcm16WaveFormat,&sharedClosestMatch);
-
-            if (hResult == S_OK) {
-                memcpy (outWavex,&pcm16WaveFormat,sizeof (WAVEFORMATEX));
-                answer = paFormatIsSupported;
-            }
-        }
-
-        logAUDCLNT_E (hResult);
-    }
-
-    return answer;
-}
-
-
-static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi,
-                                  const  PaStreamParameters *inputParameters,
-                                  const  PaStreamParameters *outputParameters,
-                                  double sampleRate)
-{
-
-    int inputChannelCount, outputChannelCount;
-    PaSampleFormat inputSampleFormat, outputSampleFormat;
-
-    if (inputParameters) {
-        inputChannelCount = inputParameters->channelCount;
-        inputSampleFormat = inputParameters->sampleFormat;
-
-        /* all standard sample formats are supported by the buffer adapter,
-            this implementation doesn't support any custom sample formats */
-
-        if (inputSampleFormat & paCustomFormat)
-            return paSampleFormatNotSupported;
-
-        /* unless alternate device specification is supported, reject the use of
-            paUseHostApiSpecificDeviceSpecification */
-
-        if (inputParameters->device == paUseHostApiSpecificDeviceSpecification)
-            return paInvalidDevice;
-
-        /* check that input device can support inputChannelCount */
-        if (inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels)
-            return paInvalidChannelCount;
-
-        /* validate inputStreamInfo */
-        if (inputParameters->hostApiSpecificStreamInfo)
-            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-
-
-        PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi;
-
-
-        IAudioClient *myClient=0;
-
-        HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate (
-                              __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient);
-
-        if (hResult != S_OK) {
-            logAUDCLNT_E (hResult);
-            return paInvalidDevice;
-        }
-
-        WAVEFORMATEXTENSIBLE wavex;
-
-        AUDCLNT_SHAREMODE shareMode;
-        PaError answer = GetClosestFormat (myClient,sampleRate,inputParameters,&shareMode,&wavex);
-        myClient->Release();
-
-        if (answer !=paFormatIsSupported)
-            return answer;
-    } else {
-        inputChannelCount = 0;
-    }
-
-    if (outputParameters) {
-        outputChannelCount = outputParameters->channelCount;
-        outputSampleFormat = outputParameters->sampleFormat;
-
-        /* all standard sample formats are supported by the buffer adapter,
-            this implementation doesn't support any custom sample formats */
-
-        if (outputSampleFormat & paCustomFormat)
-            return paSampleFormatNotSupported;
-
-        /* unless alternate device specification is supported, reject the use of
-            paUseHostApiSpecificDeviceSpecification */
-
-        if (outputParameters->device == paUseHostApiSpecificDeviceSpecification)
-            return paInvalidDevice;
-
-        /* check that output device can support outputChannelCount */
-        if (outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels)
-            return paInvalidChannelCount;
-
-        /* validate outputStreamInfo */
-        if (outputParameters->hostApiSpecificStreamInfo)
-            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-
-
-        PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi;
-
-        IAudioClient *myClient=0;
-
-        HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate (
-                              __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient);
-
-        if (hResult != S_OK) {
-            logAUDCLNT_E (hResult);
-            return paInvalidDevice;
-        }
-
-        WAVEFORMATEXTENSIBLE wavex;
-
-        AUDCLNT_SHAREMODE shareMode;
-        PaError answer = GetClosestFormat (myClient,sampleRate,outputParameters,&shareMode,&wavex);
-        myClient->Release();
-
-        if (answer !=paFormatIsSupported)
-            return answer;
-    } else {
-        outputChannelCount = 0;
-    }
-
-
-    return paFormatIsSupported;
-}
-
-
-
-/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */
-
-static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
-                           PaStream** s,
-                           const PaStreamParameters *inputParameters,
-                           const PaStreamParameters *outputParameters,
-                           double sampleRate,
-                           unsigned long framesPerBuffer,
-                           PaStreamFlags streamFlags,
-                           PaStreamCallback *streamCallback,
-                           void *userData)
-{
-    PaError result = paNoError;
-    PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi;
-    PaWinWasapiStream *stream = 0;
-    int inputChannelCount, outputChannelCount;
-    PaSampleFormat inputSampleFormat, outputSampleFormat;
-    PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;
-
-
-    stream = (PaWinWasapiStream*) PaUtil_AllocateMemory (sizeof (PaWinWasapiStream));
-
-    if (!stream) {
-        result = paInsufficientMemory;
-        goto error;
-    }
-
-    if (inputParameters) {
-        inputChannelCount = inputParameters->channelCount;
-        inputSampleFormat = inputParameters->sampleFormat;
-
-        /* unless alternate device specification is supported, reject the use of
-            paUseHostApiSpecificDeviceSpecification */
-
-        if (inputParameters->device == paUseHostApiSpecificDeviceSpecification)
-            return paInvalidDevice;
-
-        /* check that input device can support inputChannelCount */
-        if (inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels)
-            return paInvalidChannelCount;
-
-        /* validate inputStreamInfo */
-        if (inputParameters->hostApiSpecificStreamInfo)
-            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-
-
-        PaWinWasapiDeviceInfo &info = paWasapi->devInfo[inputParameters->device];
-
-        HRESULT hResult = info.device->Activate (
-                              __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL,
-                              (void**) &stream->in.client);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        hResult = info.device->Activate (
-                      __uuidof (IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL,
-                      (void**) &stream->inVol);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        AUDCLNT_SHAREMODE shareMode;
-
-        PaError answer = GetClosestFormat (stream->in.client,sampleRate,inputParameters,&shareMode,&stream->in.wavex);
-
-        if (answer !=paFormatIsSupported)
-            return answer;
-
-        //stream->out.period = info.DefaultDevicePeriod;
-        stream->in.period = info.MinimumDevicePeriod;
-
-        hResult = stream->in.client->Initialize (
-                      shareMode,
-                      0,  //no flags
-                      stream->in.period,
-                      0,//stream->out.period,
-                      (WAVEFORMATEX*) &stream->in.wavex,
-                      &stream->session
-                  );
-
-        if (hResult != S_OK) {
-            logAUDCLNT_E (hResult);
-            return paInvalidDevice;
-        }
-
-        hResult = stream->in.client->GetBufferSize (&stream->in.bufferSize);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        hResult = stream->in.client->GetStreamLatency (&stream->in.latency);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        double periodsPerSecond = 1.0/nano100ToSeconds (stream->in.period);
-
-        double samplesPerPeriod = (double) (stream->in.wavex.Format.nSamplesPerSec) /periodsPerSecond;
-
-        //this is the number of samples that are required at each period
-        stream->in.framesPerHostCallback = (unsigned long) samplesPerPeriod;//unrelated to channels
-
-        /* IMPLEMENT ME - establish which  host formats are available */
-        hostInputSampleFormat =
-            PaUtil_SelectClosestAvailableFormat (waveformatToPaFormat (&stream->in.wavex), inputSampleFormat);
-    } else {
-        inputChannelCount = 0;
-        inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */
-    }
-
-    if (outputParameters) {
-        outputChannelCount = outputParameters->channelCount;
-        outputSampleFormat = outputParameters->sampleFormat;
-
-        /* unless alternate device specification is supported, reject the use of
-            paUseHostApiSpecificDeviceSpecification */
-
-        if (outputParameters->device == paUseHostApiSpecificDeviceSpecification)
-            return paInvalidDevice;
-
-        /* check that output device can support inputChannelCount */
-        if (outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels)
-            return paInvalidChannelCount;
-
-        /* validate outputStreamInfo */
-        if (outputParameters->hostApiSpecificStreamInfo)
-            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-
-
-        PaWinWasapiDeviceInfo &info = paWasapi->devInfo[outputParameters->device];
-
-        HRESULT hResult = info.device->Activate (
-                              __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL,
-                              (void**) &stream->out.client);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        AUDCLNT_SHAREMODE shareMode;
-
-        PaError answer = GetClosestFormat (stream->out.client,sampleRate,outputParameters,&shareMode,&stream->out.wavex);
-
-        if (answer !=paFormatIsSupported)
-            return answer;
-
-        LogWAVEFORMATEXTENSIBLE (&stream->out.wavex);
-
-        // stream->out.period = info.DefaultDevicePeriod;
-        stream->out.period = info.MinimumDevicePeriod;
-
-        /*For an exclusive-mode stream that uses event-driven buffering,
-        the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration,
-        and the values of these two parameters must be equal */
-        if (shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) {
-            hResult = stream->out.client->Initialize (
-                          shareMode,
-                          AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
-                          stream->out.period,
-                          stream->out.period,
-                          (WAVEFORMATEX*) &stream->out.wavex,
-                          &stream->session
-                      );
-        } else {
-            hResult = stream->out.client->Initialize (
-                          shareMode,
-                          AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
-                          0,
-                          0,
-                          (WAVEFORMATEX*) &stream->out.wavex,
-                          &stream->session
-                      );
-        }
-
-
-        if (hResult != S_OK) {
-            logAUDCLNT_E (hResult);
-            return paInvalidDevice;
-        }
-
-        hResult = info.device->Activate (
-
-                      __uuidof (IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL,
-                      (void**) &stream->outVol);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        hResult = stream->out.client->GetBufferSize (&stream->out.bufferSize);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        hResult = stream->out.client->GetStreamLatency (&stream->out.latency);
-
-        if (hResult != S_OK)
-            return paInvalidDevice;
-
-        double periodsPerSecond = 1.0/nano100ToSeconds (stream->out.period);
-
-        double samplesPerPeriod = (double) (stream->out.wavex.Format.nSamplesPerSec) /periodsPerSecond;
-
-        //this is the number of samples that are required at each period
-        stream->out.framesPerHostCallback = stream->out.bufferSize; //(unsigned long)samplesPerPeriod;//unrelated to channels
-
-        /* IMPLEMENT ME - establish which  host formats are available */
-        hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat (waveformatToPaFormat (&stream->out.wavex), outputSampleFormat);
-    } else {
-        outputChannelCount = 0;
-        outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */
-    }
-
-
-
-    /*
-        IMPLEMENT ME:
-
-        ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? )
-
-            - check that input device can support inputSampleFormat, or that
-                we have the capability to convert from outputSampleFormat to
-                a native format
-
-            - check that output device can support outputSampleFormat, or that
-                we have the capability to convert from outputSampleFormat to
-                a native format
-
-            - if a full duplex stream is requested, check that the combination
-                of input and output parameters is supported
-
-            - check that the device supports sampleRate
-
-            - alter sampleRate to a close allowable rate if possible / necessary
-
-            - validate suggestedInputLatency and suggestedOutputLatency parameters,
-                use default values where necessary
-    */
-
-
-
-    /* validate platform specific flags */
-    if ( (streamFlags & paPlatformSpecificFlags) != 0)
-        return paInvalidFlag; /* unexpected platform specific flag */
-
-
-
-    if (streamCallback) {
-        PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation,
-                                               &paWasapi->callbackStreamInterface, streamCallback, userData);
-    } else {
-        PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation,
-                                               &paWasapi->blockingStreamInterface, streamCallback, userData);
-    }
-
-    PaUtil_InitializeCpuLoadMeasurer (&stream->cpuLoadMeasurer, sampleRate);
-
-
-    if (outputParameters && inputParameters) {
-
-        //serious problem #1
-        if (stream->in.period != stream->out.period) {
-            PRINT ( ("OpenStream: period discrepancy\n"));
-            goto error;
-        }
-
-        //serious problem #2
-        if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback) {
-            PRINT ( ("OpenStream: framesPerHostCallback discrepancy\n"));
-            goto error;
-        }
-    }
-
-    unsigned long framesPerHostCallback = (outputParameters) ?
-
-                                          stream->out.framesPerHostCallback:
-                                          stream->in.framesPerHostCallback;
-
-    /* we assume a fixed host buffer size in this example, but the buffer processor
-        can also support bounded and unknown host buffer sizes by passing
-        paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of
-        paUtilFixedHostBufferSize below. */
-
-    result =  PaUtil_InitializeBufferProcessor (&stream->bufferProcessor,
-              inputChannelCount, inputSampleFormat, hostInputSampleFormat,
-              outputChannelCount, outputSampleFormat, hostOutputSampleFormat,
-              sampleRate, streamFlags, framesPerBuffer,
-              framesPerHostCallback, paUtilFixedHostBufferSize,
-              streamCallback, userData);
-
-    if (result != paNoError)
-        goto error;
-
-
-    /*
-        IMPLEMENT ME: initialise the following fields with estimated or actual
-        values.
-    */
-    stream->streamRepresentation.streamInfo.inputLatency =
-        PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor)
-        + ( (inputParameters) ?nano100ToSeconds (stream->in.latency) :0);
-
-    stream->streamRepresentation.streamInfo.outputLatency =
-        PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor)
-        + ( (outputParameters) ?nano100ToSeconds (stream->out.latency) :0);
-
-    stream->streamRepresentation.streamInfo.sampleRate = sampleRate;
-
-
-    *s = (PaStream*) stream;
-
-
-    return result;
-
-error:
-    if (stream)
-        PaUtil_FreeMemory (stream);
-
-    return result;
-}
-
-
-
-/*
-    When CloseStream() is called, the multi-api layer ensures that
-    the stream has already been stopped or aborted.
-*/
-
-#define SAFE_RELEASE(punk)  \
-              if ((punk) != NULL)  \
-                { (punk)->Release(); (punk) = NULL; }
-
-static PaError CloseStream (PaStream* s)
-{
-    PaError result = paNoError;
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    /*
-        IMPLEMENT ME:
-            - additional stream closing + cleanup
-    */
-
-    SAFE_RELEASE (stream->out.client);
-    SAFE_RELEASE (stream->in.client);
-    SAFE_RELEASE (stream->cclient);
-    SAFE_RELEASE (stream->rclient);
-    SAFE_RELEASE (stream->inVol);
-    SAFE_RELEASE (stream->outVol);
-    CloseHandle (stream->hThread);
-    CloseHandle (stream->hNotificationEvent);
-
-    PaUtil_TerminateBufferProcessor (&stream->bufferProcessor);
-    PaUtil_TerminateStreamRepresentation (&stream->streamRepresentation);
-    PaUtil_FreeMemory (stream);
-
-    return result;
-}
-
-DWORD WINAPI ProcThread (void *client);
-
-static PaError StartStream (PaStream *s)
-{
-    PaError result = paNoError;
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    PaUtil_ResetBufferProcessor (&stream->bufferProcessor);
-
-    HRESULT hResult=S_OK;
-
-    if (stream->out.client) {
-        hResult = stream->out.client->GetService (__uuidof (IAudioRenderClient), (void**) &stream->rclient);
-        logAUDCLNT_E (hResult);
-
-        if (hResult!=S_OK)
-            return paUnanticipatedHostError;
-    }
-
-    if (stream->in.client) {
-        hResult = stream->in.client->GetService (__uuidof (IAudioCaptureClient), (void**) &stream->cclient);
-        logAUDCLNT_E (hResult);
-
-        if (hResult!=S_OK)
-            return paUnanticipatedHostError;
-    }
-
-    // Create a thread for this client.
-    stream->hThread = CreateThread (
-                          NULL,              // no security attribute
-                          0,                 // default stack size
-                          ProcThread,
-                          (LPVOID) stream,    // thread parameter
-                          0,                 // not suspended
-                          &stream->dwThreadId);      // returns thread ID
-
-    if (stream->hThread == NULL)
-        return paUnanticipatedHostError;
-
-    return paNoError;
-}
-
-
-static PaError StopStream (PaStream *s)
-{
-    PaError result = paNoError;
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    /* suppress unused variable warnings */
-    stream->closeRequest = true;
-    //todo something MUCH better than this
-
-    while (stream->closeRequest)
-        Sleep (100);
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior */
-
-    stream->running = false;
-
-    return result;
-}
-
-
-static PaError AbortStream (PaStream *s)
-{
-    PaError result = paNoError;
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    /* suppress unused variable warnings */
-    stream->closeRequest = true;
-    //todo something MUCH better than this
-
-    while (stream->closeRequest)
-        Sleep (100);
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior */
-
-    return result;
-}
-
-
-static PaError IsStreamStopped (PaStream *s)
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    return !stream->running;
-}
-
-
-static PaError IsStreamActive (PaStream *s)
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-    return stream->running;
-}
-
-
-static PaTime GetStreamTime (PaStream *s)
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    /* suppress unused variable warnings */
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-    //this is lame ds and mme does the same thing, quite useless method imho
-    //why dont we fetch the time in the pa callbacks?
-    //at least its doing to be clocked to something
-    return PaUtil_GetTime();
-}
-
-
-static double GetStreamCpuLoad (PaStream* s)
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    return PaUtil_GetCpuLoad (&stream->cpuLoadMeasurer);
-}
-
-
-/*
-    As separate stream interfaces are used for blocking and callback
-    streams, the following functions can be guaranteed to only be called
-    for blocking streams.
-*/
-
-static PaError ReadStream (PaStream* s,
-                           void *buffer,
-                           unsigned long frames)
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    /* suppress unused variable warnings */
-    (void) buffer;
-    (void) frames;
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-    return paNoError;
-}
-
-
-static PaError WriteStream (PaStream* s,
-                            const void *buffer,
-                            unsigned long frames)
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    /* suppress unused variable warnings */
-    (void) buffer;
-    (void) frames;
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-    return paNoError;
-}
-
-
-static signed long GetStreamReadAvailable (PaStream* s)
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    /* suppress unused variable warnings */
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-    return 0;
-}
-
-
-static signed long GetStreamWriteAvailable (PaStream* s)
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) s;
-
-    /* suppress unused variable warnings */
-    (void) stream;
-
-    /* IMPLEMENT ME, see portaudio.h for required behavior*/
-
-    return 0;
-}
-
-
-
-/*
-    ExampleHostProcessingLoop() illustrates the kind of processing which may
-    occur in a host implementation.
-
-*/
-static void WaspiHostProcessingLoop (void *inputBuffer,  long inputFrames,
-                                     void *outputBuffer, long outputFrames,
-                                     void *userData)
-{
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) userData;
-    PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */
-    int callbackResult;
-    unsigned long framesProcessed;
-
-    PaUtil_BeginCpuLoadMeasurement (&stream->cpuLoadMeasurer);
-
-
-    /*
-        IMPLEMENT ME:
-            - generate timing information
-            - handle buffer slips
-    */
-
-    /*
-        If you need to byte swap or shift inputBuffer to convert it into a
-        portaudio format, do it here.
-    */
-
-
-
-    PaUtil_BeginBufferProcessing (&stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */);
-
-    /*
-        depending on whether the host buffers are interleaved, non-interleaved
-        or a mixture, you will want to call PaUtil_SetInterleaved*Channels(),
-        PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here.
-    */
-
-    if (stream->bufferProcessor.inputChannelCount > 0) {
-        PaUtil_SetInputFrameCount (&stream->bufferProcessor, inputFrames);
-        PaUtil_SetInterleavedInputChannels (&stream->bufferProcessor,
-                                            0, /* first channel of inputBuffer is channel 0 */
-                                            inputBuffer,
-                                            0);  /* 0 - use inputChannelCount passed to init buffer processor */
-    }
-
-    if (stream->bufferProcessor.outputChannelCount > 0) {
-        PaUtil_SetOutputFrameCount (&stream->bufferProcessor, outputFrames);
-        PaUtil_SetInterleavedOutputChannels (&stream->bufferProcessor,
-                                             0, /* first channel of outputBuffer is channel 0 */
-                                             outputBuffer,
-                                             0);  /* 0 - use outputChannelCount passed to init buffer processor */
-    }
-
-    /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing()
-        in general you would pass paContinue for normal operation, and
-        paComplete to drain the buffer processor's internal output buffer.
-        You can check whether the buffer processor's output buffer is empty
-        using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor )
-    */
-    callbackResult = paContinue;
-
-    framesProcessed = PaUtil_EndBufferProcessing (&stream->bufferProcessor, &callbackResult);
-
-
-    /*
-        If you need to byte swap or shift outputBuffer to convert it to
-        host format, do it here.
-    */
-
-    PaUtil_EndCpuLoadMeasurement (&stream->cpuLoadMeasurer, framesProcessed);
-
-
-    if (callbackResult == paContinue) {
-        /* nothing special to do */
-    } else if (callbackResult == paAbort) {
-        /* IMPLEMENT ME - finish playback immediately  */
-
-        /* once finished, call the finished callback */
-        if (stream->streamRepresentation.streamFinishedCallback != 0)
-            stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData);
-    } else {
-        /* User callback has asked us to stop with paComplete or other non-zero value */
-
-        /* IMPLEMENT ME - finish playback once currently queued audio has completed  */
-
-        /* once finished, call the finished callback */
-        if (stream->streamRepresentation.streamFinishedCallback != 0)
-            stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData);
-    }
-}
-
-
-void
-MMCSS_activate()
-{
-
-    DWORD stuff=0;
-    HANDLE thCarac = pAvSetMmThreadCharacteristics ("Pro Audio",&stuff);
-
-    if (!thCarac) {
-        PRINT ( ("AvSetMmThreadCharacteristics failed!\n"));
-    }
-
-    BOOL prio = pAvSetMmThreadPriority (thCarac,AVRT_PRIORITY_NORMAL);
-
-    if (!prio) {
-        PRINT ( ("AvSetMmThreadPriority failed!\n"));
-    }
-
-    //debug
-    {
-        HANDLE hh       = GetCurrentThread();
-        int  currprio   = GetThreadPriority (hh);
-        DWORD currclass = GetPriorityClass (GetCurrentProcess());
-        PRINT ( ("currprio 0x%X currclass 0x%X\n",currprio,currclass));
-    }
-}
-
-
-DWORD WINAPI
-ProcThread (void* param)
-{
-    HRESULT hResult;
-    MMCSS_activate();
-
-    PaWinWasapiStream *stream = (PaWinWasapiStream*) param;
-
-    stream->hNotificationEvent = CreateEvent (NULL,
-                                 FALSE,  //bManualReset are we sure??
-                                 FALSE,
-                                 "PAWASA");
-    hResult = stream->out.client->SetEventHandle (stream->hNotificationEvent);
-
-    if (hResult != S_OK)
-        logAUDCLNT_E (hResult);
-
-    if (stream->out.client) {
-        hResult = stream->out.client->Start();
-
-        if (hResult != S_OK)
-            logAUDCLNT_E (hResult);
-    }
-
-    stream->running = true;
-
-    bool bOne = false;
-
-    while (!stream->closeRequest) {
-        //lets wait but have a 1 second timeout
-        DWORD dwResult = WaitForSingleObject (stream->hNotificationEvent, 1000);
-
-        switch (dwResult) {
-
-            case WAIT_OBJECT_0: {
-
-                unsigned long usingBS = stream->out.framesPerHostCallback;
-
-                BYTE* indata  = 0;
-                BYTE* outdata = 0;
-
-                hResult = stream->rclient->GetBuffer (usingBS, &outdata);
-
-                if (hResult != S_OK || !outdata) {
-                    //logAUDCLNT_E(hResult);
-                    //most probably shared mode and hResult=AUDCLNT_E_BUFFER_TOO_LARGE
-                    UINT32 padding = 0;
-                    hResult = stream->out.client->GetCurrentPadding (&padding);
-
-                    if (padding == 0)
-                        break;
-
-                    usingBS = usingBS-padding;
-
-                    if (usingBS == 0)
-                        break;//huh?
-
-                    hResult = stream->rclient->GetBuffer (usingBS, &outdata);
-
-                    if (hResult != S_OK) //what can we do NOW??
-                        break;
-
-                    //logAUDCLNT_E(hResult);
-                }
-
-                WaspiHostProcessingLoop (indata, usingBS ,outdata, usingBS, stream);
-
-                hResult = stream->rclient->ReleaseBuffer (usingBS, 0);
-
-                if (hResult != S_OK)
-                    logAUDCLNT_E (hResult);
-
-                /*	This was suggested, but in my tests it doesnt seem to improve the
-                   locking behaviour some drivers have running in exclusive mode.
-                   if(!ResetEvent(stream->hNotificationEvent)){
-                   	logAUDCLNT_E(hResult);
-                   }
-                */
-
-            }
-
-            break;
-
-        }
-    }
-
-    stream->out.client->Stop();
-
-    stream->closeRequest = false;
-
-    return 0;
-}
-
-
-
-
-#endif //VC 2005
-
-
-
-
-#if 0
-
-if (bFirst)
-{
-    float masteur;
-    hResult = stream->outVol->GetMasterVolumeLevelScalar (&masteur);
-
-    if (hResult != S_OK)
-        logAUDCLNT_E (hResult);
-
-    float chan1, chan2;
-
-    hResult = stream->outVol->GetChannelVolumeLevelScalar (0, &chan1);
-
-    if (hResult != S_OK)
-        logAUDCLNT_E (hResult);
-
-    hResult = stream->outVol->GetChannelVolumeLevelScalar (1, &chan2);
-
-    if (hResult != S_OK)
-        logAUDCLNT_E (hResult);
-
-    BOOL bMute;
-
-    hResult = stream->outVol->GetMute (&bMute);
-
-    if (hResult != S_OK)
-        logAUDCLNT_E (hResult);
-
-    stream->outVol->SetMasterVolumeLevelScalar (0.5, NULL);
-
-    stream->outVol->SetChannelVolumeLevelScalar (0, 0.5, NULL);
-
-    stream->outVol->SetChannelVolumeLevelScalar (1, 0.5, NULL);
-
-    stream->outVol->SetMute (FALSE, NULL);
-
-    bFirst = false;
-}
-#endif
\ No newline at end of file
diff --git a/sflphone-common/libs/pjproject-1.0.2/COPYING b/sflphone-common/libs/pjproject-1.0.3/COPYING
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/COPYING
rename to sflphone-common/libs/pjproject-1.0.3/COPYING
diff --git a/sflphone-common/libs/pjproject-1.0.2/INSTALL.txt b/sflphone-common/libs/pjproject-1.0.3/INSTALL.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/INSTALL.txt
rename to sflphone-common/libs/pjproject-1.0.3/INSTALL.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/Makefile b/sflphone-common/libs/pjproject-1.0.3/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/README-RTEMS b/sflphone-common/libs/pjproject-1.0.3/README-RTEMS
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/README-RTEMS
rename to sflphone-common/libs/pjproject-1.0.3/README-RTEMS
diff --git a/sflphone-common/libs/pjproject-1.0.2/README.txt b/sflphone-common/libs/pjproject-1.0.3/README.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/README.txt
rename to sflphone-common/libs/pjproject-1.0.3/README.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/aconfigure b/sflphone-common/libs/pjproject-1.0.3/aconfigure
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/aconfigure
rename to sflphone-common/libs/pjproject-1.0.3/aconfigure
diff --git a/sflphone-common/libs/pjproject-1.0.2/aconfigure.ac b/sflphone-common/libs/pjproject-1.0.3/aconfigure.ac
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/aconfigure.ac
rename to sflphone-common/libs/pjproject-1.0.3/aconfigure.ac
diff --git a/sflphone-common/libs/pjproject-1.0.2/autogen.sh b/sflphone-common/libs/pjproject-1.0.3/autogen.sh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/autogen.sh
rename to sflphone-common/libs/pjproject-1.0.3/autogen.sh
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.mak.in b/sflphone-common/libs/pjproject-1.0.3/build.mak.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.mak.in
rename to sflphone-common/libs/pjproject-1.0.3/build.mak.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/00.bat b/sflphone-common/libs/pjproject-1.0.3/build.symbian/00.bat
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/00.bat
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/00.bat
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/01.bat b/sflphone-common/libs/pjproject-1.0.3/build.symbian/01.bat
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/01.bat
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/01.bat
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/bld.inf b/sflphone-common/libs/pjproject-1.0.3/build.symbian/bld.inf
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/bld.inf
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/bld.inf
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/libgsmcodec.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/libgsmcodec.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/libgsmcodec.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/libgsmcodec.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/libspeexcodec.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/libspeexcodec.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/libspeexcodec.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/libspeexcodec.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/libsrtp.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/libsrtp.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/libsrtp.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/libsrtp.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/makedef.sh b/sflphone-common/libs/pjproject-1.0.3/build.symbian/makedef.sh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/makedef.sh
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/makedef.sh
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/null_audio.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/null_audio.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/null_audio.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/null_audio.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/null_audioU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/null_audioU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/null_audioU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/null_audioU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlib.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlib.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlibU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlibU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlibU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlibU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_test.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlib_test.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_test.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlib_test.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_util.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlib_util.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_util.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlib_util.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_utilU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlib_utilU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjlib_utilU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjlib_utilU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjmedia.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjmedia.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjmedia.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjmedia.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjmediaU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjmediaU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjmediaU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjmediaU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjnath.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjnath.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjnath.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjnath.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjnathU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjnathU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjnathU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjnathU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjproject.cww b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjproject.cww
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjproject.cww
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjproject.cww
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsdp.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsdp.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsdp.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsdp.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsdpU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsdpU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsdpU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsdpU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsipU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsipU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsipU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsipU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_simple.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip_simple.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_simple.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip_simple.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_simpleU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip_simpleU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_simpleU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip_simpleU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_ua.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip_ua.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_ua.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip_ua.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_uaU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip_uaU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsip_uaU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsip_uaU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjstun_client.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjstun_client.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjstun_client.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjstun_client.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsua_lib.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsua_lib.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsua_lib.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsua_lib.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsua_libU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsua_libU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/pjsua_libU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/pjsua_libU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audio.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_audio.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audio.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_audio.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audioU.def b/sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_audioU.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audioU.def
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_audioU.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audio_aps.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_audio_aps.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_audio_aps.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_audio_aps.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_ua.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_ua.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua_udeb.pkg b/sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_ua_udeb.pkg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua_udeb.pkg
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_ua_udeb.pkg
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua_urel.pkg b/sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_ua_urel.pkg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/symbian_ua_urel.pkg
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/symbian_ua_urel.pkg
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/symsndtest.mmp b/sflphone-common/libs/pjproject-1.0.3/build.symbian/symsndtest.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/symsndtest.mmp
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/symsndtest.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/build.symbian/symsndtest.pkg b/sflphone-common/libs/pjproject-1.0.3/build.symbian/symsndtest.pkg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build.symbian/symsndtest.pkg
rename to sflphone-common/libs/pjproject-1.0.3/build.symbian/symsndtest.pkg
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/cc-gcc.mak b/sflphone-common/libs/pjproject-1.0.3/build/cc-gcc.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/cc-gcc.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/cc-gcc.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/cc-vc.mak b/sflphone-common/libs/pjproject-1.0.3/build/cc-vc.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/cc-vc.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/cc-vc.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/common.mak b/sflphone-common/libs/pjproject-1.0.3/build/common.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/common.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/common.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/host-mingw.mak b/sflphone-common/libs/pjproject-1.0.3/build/host-mingw.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/host-mingw.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/host-mingw.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/host-unix.mak b/sflphone-common/libs/pjproject-1.0.3/build/host-unix.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/host-unix.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/host-unix.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/host-win32.mak b/sflphone-common/libs/pjproject-1.0.3/build/host-win32.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/host-win32.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/host-win32.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/m-alpha.mak b/sflphone-common/libs/pjproject-1.0.3/build/m-alpha.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/m-alpha.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/m-alpha.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/m-arm.mak b/sflphone-common/libs/pjproject-1.0.3/build/m-arm.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/m-arm.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/m-arm.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/m-auto.mak b/sflphone-common/libs/pjproject-1.0.3/build/m-auto.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/m-auto.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/m-auto.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/m-i386.mak b/sflphone-common/libs/pjproject-1.0.3/build/m-i386.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/m-i386.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/m-i386.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/m-m68k.mak b/sflphone-common/libs/pjproject-1.0.3/build/m-m68k.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/m-m68k.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/m-m68k.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/m-mpc860.mak b/sflphone-common/libs/pjproject-1.0.3/build/m-mpc860.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/m-mpc860.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/m-mpc860.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/m-powerpc.mak b/sflphone-common/libs/pjproject-1.0.3/build/m-powerpc.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/m-powerpc.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/m-powerpc.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/m-sparc.mak b/sflphone-common/libs/pjproject-1.0.3/build/m-sparc.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/m-sparc.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/m-sparc.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/m-x86_64.mak b/sflphone-common/libs/pjproject-1.0.3/build/m-x86_64.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/m-x86_64.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/m-x86_64.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.3/build/os-auto.mak.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/os-auto.mak.in
rename to sflphone-common/libs/pjproject-1.0.3/build/os-auto.mak.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-darwinos.mak b/sflphone-common/libs/pjproject-1.0.3/build/os-darwinos.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/os-darwinos.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/os-darwinos.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-linux-kernel.mak b/sflphone-common/libs/pjproject-1.0.3/build/os-linux-kernel.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/os-linux-kernel.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/os-linux-kernel.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-linux.mak b/sflphone-common/libs/pjproject-1.0.3/build/os-linux.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/os-linux.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/os-linux.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-palmos.mak b/sflphone-common/libs/pjproject-1.0.3/build/os-palmos.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/os-palmos.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/os-palmos.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.3/build/os-rtems.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/os-rtems.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/os-rtems.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-sunos.mak b/sflphone-common/libs/pjproject-1.0.3/build/os-sunos.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/os-sunos.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/os-sunos.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.3/build/os-win32.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/os-win32.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/os-win32.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/build/rules.mak b/sflphone-common/libs/pjproject-1.0.3/build/rules.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/build/rules.mak
rename to sflphone-common/libs/pjproject-1.0.3/build/rules.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/c++-build.mak b/sflphone-common/libs/pjproject-1.0.3/c++-build.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/c++-build.mak
rename to sflphone-common/libs/pjproject-1.0.3/c++-build.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/configure b/sflphone-common/libs/pjproject-1.0.3/configure
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/configure
rename to sflphone-common/libs/pjproject-1.0.3/configure
diff --git a/sflphone-common/libs/pjproject-1.0.2/configure-legacy b/sflphone-common/libs/pjproject-1.0.3/configure-legacy
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/configure-legacy
rename to sflphone-common/libs/pjproject-1.0.3/configure-legacy
diff --git a/sflphone-common/libs/pjproject-1.0.2/install-sh b/sflphone-common/libs/pjproject-1.0.3/install-sh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/install-sh
rename to sflphone-common/libs/pjproject-1.0.3/install-sh
diff --git a/sflphone-common/libs/pjproject-1.0.2/libpj-sfl.pc.in b/sflphone-common/libs/pjproject-1.0.3/libpj-sfl.pc.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/libpj-sfl.pc.in
rename to sflphone-common/libs/pjproject-1.0.3/libpj-sfl.pc.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/Makefile b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/os-auto.mak.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-auto.mak.in
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/os-auto.mak.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/os-rtems.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/os-rtems.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/os-rtems.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.dsp b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.dsw b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util.dsw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.dsw
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util.dsw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util_test.dsp b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util_test.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util_test.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util_test.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util_test.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util_test.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/pjlib_util_test.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/pjlib_util_test.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_test_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/wince-evc4/pjlib_util_test_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_test_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/wince-evc4/pjlib_util_test_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/wince-evc4/pjlib_util_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/wince-evc4/pjlib_util_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_wince.vcw b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/wince-evc4/pjlib_util_wince.vcw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/build/wince-evc4/pjlib_util_wince.vcw
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/build/wince-evc4/pjlib_util_wince.vcw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/docs/doxygen.cfg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/doxygen.cfg
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/docs/doxygen.cfg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/doxygen.css b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/docs/doxygen.css
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/doxygen.css
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/docs/doxygen.css
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/footer.html b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/docs/footer.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/footer.html
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/docs/footer.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/header.html b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/docs/header.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/docs/header.html
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/docs/header.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/base64.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/base64.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/base64.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/base64.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/config.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/config.h
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/config.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/config.h
index 84259301c0dac413dc4510a52d7398234373866f..f1e5b1e9937d7317795ef6342d8fed0efea112aa 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/config.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/config.h
@@ -1,5 +1,5 @@
 /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #ifndef __PJLIB_UTIL_CONFIG_H__
 #define __PJLIB_UTIL_CONFIG_H__
@@ -59,7 +59,7 @@
  * (the #pj_dns_packet_dup() function).
  *
  * Generally name compression is desired, since it saves some memory (see
- * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of
+ * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of 
  * a little processing overhead to perform name scanning and also a little
  * bit more stack usage (8 bytes per entry on 32bit platform).
  *
@@ -84,7 +84,7 @@
 
 
 /**
- * Default retransmission delay, in miliseconds. The combination of
+ * Default retransmission delay, in miliseconds. The combination of 
  * retransmission delay and count determines the query timeout.
  *
  * Default: 2000 (2 seconds, according to RFC 1035)
@@ -106,8 +106,8 @@
 
 
 /**
- * Maximum life-time of DNS response in the resolver response cache,
- * in seconds. If the value is zero, then DNS response caching will be
+ * Maximum life-time of DNS response in the resolver response cache, 
+ * in seconds. If the value is zero, then DNS response caching will be 
  * disabled.
  *
  * Default is 300 seconds (5 minutes).
@@ -120,8 +120,8 @@
 
 /**
  * The life-time of invalid DNS response in the resolver response cache.
- * An invalid DNS response is a response which RCODE is non-zero and
- * response without any answer section. These responses can be put in
+ * An invalid DNS response is a response which RCODE is non-zero and 
+ * response without any answer section. These responses can be put in 
  * the cache too to minimize message round-trip.
  *
  * Default: 60 (one minute).
@@ -133,7 +133,7 @@
 #endif
 
 /**
- * The interval on which nameservers which are known to be good to be
+ * The interval on which nameservers which are known to be good to be 
  * probed again to determine whether they are still good. Note that
  * this applies to both active nameserver (the one currently being used)
  * and idle nameservers (good nameservers that are not currently selected).
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/crc32.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/crc32.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/crc32.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/crc32.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/dns.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/dns.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/dns.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/dns.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/dns_server.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/dns_server.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/dns_server.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/dns_server.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/errno.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/errno.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/errno.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/errno.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/getopt.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/getopt.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/getopt.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/getopt.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/hmac_md5.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/hmac_md5.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/hmac_md5.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/hmac_md5.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/hmac_sha1.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/hmac_sha1.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/hmac_sha1.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/hmac_sha1.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/md5.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/md5.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/md5.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/md5.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/pcap.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/pcap.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/pcap.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/pcap.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/resolver.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/resolver.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/resolver.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/resolver.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/scanner.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/scanner.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner_cis_bitwise.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/scanner_cis_bitwise.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner_cis_bitwise.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/scanner_cis_bitwise.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner_cis_uint.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/scanner_cis_uint.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/scanner_cis_uint.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/scanner_cis_uint.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/sha1.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/sha1.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/sha1.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/sha1.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/srv_resolver.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/srv_resolver.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/srv_resolver.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/srv_resolver.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/string.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/string.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/string.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/string.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/stun_simple.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/stun_simple.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/stun_simple.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/stun_simple.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/types.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/types.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/xml.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/xml.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/include/pjlib-util/xml.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/include/pjlib-util/xml.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/encryption.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/encryption.c
similarity index 94%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/encryption.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/encryption.c
index 50fd1dd296027c71c206a3b5bebde5e2796e5555..9553892f894b5530cf768c8422b5d019f898e367 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/encryption.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/encryption.c
@@ -1,4 +1,4 @@
-/* $Id: encryption.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: encryption.c 2809 2009-06-25 12:46:00Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -64,10 +64,13 @@ static void digest_to_hex(const pj_uint8_t digest[PJ_SHA1_DIGEST_SIZE],
 
 static int sha1_test1(void)
 {
+    enum { MILLION = 1000000 };
     int k;
     pj_sha1_context context;
     pj_uint8_t digest[20];
     char output[80];
+    pj_pool_t *pool;
+    pj_uint8_t *block;
 
     PJ_LOG(3, (THIS_FILE, "  SHA1 test vector 1 from sha1.c.."));
     
@@ -86,7 +89,7 @@ static int sha1_test1(void)
 
     /* million 'a' vector we feed separately */
     pj_sha1_init(&context);
-    for (k = 0; k < 1000000; k++)
+    for (k = 0; k < MILLION; k++)
         pj_sha1_update(&context, (pj_uint8_t*)"a", 1);
     pj_sha1_final(&context, digest);
     digest_to_hex(digest, output);
@@ -95,6 +98,32 @@ static int sha1_test1(void)
         return -20;
     }
 
+    /* million 'a' test, using block */
+    pool = pj_pool_create(mem, "sha1test", 256, 512, NULL);
+    block = (pj_uint8_t*)pj_pool_alloc(pool, MILLION);
+    pj_memset(block, 'a', MILLION);
+
+    pj_sha1_init(&context);
+    pj_sha1_update(&context, block, MILLION);
+    pj_sha1_final(&context, digest);
+    digest_to_hex(digest, output);
+    if (strcmp(output, sha1_test_results[2])) {
+	pj_pool_release(pool);
+	PJ_LOG(3, (THIS_FILE, "    incorrect hash result for block update!"));
+        return -21;
+    }
+
+    /* verify that original buffer was not modified */
+    for (k=0; k<MILLION; ++k) {
+	if (block[k] != 'a') {
+	    pj_pool_release(pool);
+	    PJ_LOG(3, (THIS_FILE, "    block was modified!"));
+	    return -22;
+	}
+    }
+
+    pj_pool_release(pool);
+
     /* success */
     return(0);
 }
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/main.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/main.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main_rtems.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/main_rtems.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main_rtems.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/main_rtems.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/main_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/main_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/main_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/resolver_test.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/resolver_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/resolver_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/resolver_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/stun.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/stun.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/stun.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/stun.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/test.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/test.h b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/test.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/test.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/test.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/xml.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/xml.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util-test/xml.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util-test/xml.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/base64.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/base64.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/base64.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/base64.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/crc32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/crc32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/crc32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/crc32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/dns.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/dns.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns_dump.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/dns_dump.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns_dump.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/dns_dump.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns_server.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/dns_server.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/dns_server.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/dns_server.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/errno.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/errno.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/errno.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/errno.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/getopt.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/getopt.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/getopt.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/getopt.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/hmac_md5.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/hmac_md5.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/hmac_md5.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/hmac_md5.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/hmac_sha1.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/hmac_sha1.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/hmac_sha1.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/hmac_sha1.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/md5.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/md5.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/md5.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/md5.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/pcap.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/pcap.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/pcap.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/pcap.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/resolver.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/resolver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/resolver.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/resolver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/scanner.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/scanner.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner_cis_uint.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/scanner_cis_uint.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/scanner_cis_uint.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/scanner_cis_uint.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/sha1.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/sha1.c
similarity index 96%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/sha1.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/sha1.c
index 3cb20f6463f7319fa3ba57ad48abb219e668e6da..a591449b0bc450d11b27a1cbb46224068e96f677 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/sha1.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/sha1.c
@@ -1,4 +1,4 @@
-/* $Id: sha1.c 1001 2007-02-25 15:38:32Z bennylp $ */
+/* $Id: sha1.c 2809 2009-06-25 12:46:00Z bennylp $ */
 /*
  * Modified 2/07
  * By Benny Prijono <benny@prijono.org>
@@ -105,7 +105,7 @@ A million repetitions of "a"
 #undef SHA1HANDSOFF
 
 
-static void SHA1_Transform(pj_uint32_t state[5], const pj_uint8_t buffer[64]);
+static void SHA1_Transform(pj_uint32_t state[5], pj_uint8_t buffer[64]);
 
 #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
 
@@ -131,7 +131,7 @@ static void SHA1_Transform(pj_uint32_t state[5], const pj_uint8_t buffer[64]);
 
 
 /* Hash a single 512-bit block. This is the core of the algorithm. */
-static void SHA1_Transform(pj_uint32_t state[5], const pj_uint8_t buffer[64])
+static void SHA1_Transform(pj_uint32_t state[5], pj_uint8_t buffer[64])
 {
     pj_uint32_t a, b, c, d, e;
     typedef union {
@@ -214,8 +214,10 @@ PJ_DEF(void) pj_sha1_update(pj_sha1_context* context,
     if ((j + len) > 63) {
         pj_memcpy(&context->buffer[j], data, (i = 64-j));
         SHA1_Transform(context->state, context->buffer);
-        for ( ; i + 63 < len; i += 64) {
-            SHA1_Transform(context->state, data + i);
+        for ( ; i + 63 < len; i += 64) {
+	    pj_uint8_t tmp[64];
+	    pj_memcpy(tmp, data + i, 64);
+            SHA1_Transform(context->state, tmp);
         }
         j = 0;
     }
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/srv_resolver.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/srv_resolver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/srv_resolver.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/srv_resolver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/string.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/string.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/string.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/string.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/stun_simple.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/stun_simple.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/stun_simple.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/stun_simple.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/stun_simple_client.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/stun_simple_client.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/stun_simple_client.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/stun_simple_client.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/symbols.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/symbols.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/symbols.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/symbols.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/xml.c b/sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/xml.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib-util/src/pjlib-util/xml.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib-util/src/pjlib-util/xml.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/Makefile b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-auto.mak.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-auto.mak.in
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-auto.mak.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-darwinos.mak b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-darwinos.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-darwinos.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-darwinos.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-linux-kernel.mak b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-linux-kernel.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-linux-kernel.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-linux-kernel.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-linux.mak b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-linux.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-linux.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-linux.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-rtems.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-rtems.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-rtems.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-sunos.mak b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-sunos.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-sunos.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-sunos.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-win32.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/os-win32.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/os-win32.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib++-test.dsp b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib++-test.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib++-test.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib++-test.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib++.dsp b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib++.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib++.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib++.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.dsp b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.dsw b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib.dsw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.dsw
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib.dsw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_samples.dsp b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib_samples.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_samples.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib_samples.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_samples.mak b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib_samples.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_samples.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib_samples.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_test.dsp b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib_test.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_test.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib_test.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_test.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib_test.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/pjlib_test.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/pjlib_test.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_test_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/wince-evc4/pjlib_test_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_test_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/wince-evc4/pjlib_test_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/wince-evc4/pjlib_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/wince-evc4/pjlib_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_wince.vcw b/sflphone-common/libs/pjproject-1.0.3/pjlib/build/wince-evc4/pjlib_wince.vcw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/build/wince-evc4/pjlib_wince.vcw
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/build/wince-evc4/pjlib_wince.vcw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.3/pjlib/docs/doxygen.cfg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/docs/doxygen.cfg
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/docs/doxygen.cfg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/docs/doxygen.css b/sflphone-common/libs/pjproject-1.0.3/pjlib/docs/doxygen.css
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/docs/doxygen.css
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/docs/doxygen.css
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/docs/footer.html b/sflphone-common/libs/pjproject-1.0.3/pjlib/docs/footer.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/docs/footer.html
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/docs/footer.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/docs/header.html b/sflphone-common/libs/pjproject-1.0.3/pjlib/docs/header.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/docs/header.html
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/docs/header.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/file.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/file.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/file.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/file.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/hash.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/hash.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/hash.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/hash.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/list.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/list.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/list.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/list.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/lock.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/lock.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/lock.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/lock.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/os.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/os.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/os.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/os.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/pool.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/pool.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/pool.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/pool.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/proactor.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/proactor.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/proactor.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/proactor.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/scanner.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/scanner.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/scanner.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/scanner.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/sock.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/sock.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/sock.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/sock.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/string.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/string.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/string.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/string.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/timer.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/timer.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/timer.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/timer.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/tree.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/tree.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/tree.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/tree.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/types.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/types.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj++/types.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj++/types.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/activesock.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/activesock.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/activesock.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/activesock.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/addr_resolv.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/addr_resolv.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/addr_resolv.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/addr_resolv.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/array.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/array.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/array.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/array.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/assert.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/assert.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/assert.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/assert.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/assert.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/assert.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/assert.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/assert.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_armcc.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_armcc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_armcc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_armcc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_codew.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_codew.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_codew.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_codew.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_gcc.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_gcc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_gcc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_gcc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_gcce.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_gcce.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_gcce.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_gcce.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_msvc.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_msvc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_msvc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_msvc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_mwcc.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_mwcc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/cc_mwcc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/cc_mwcc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/ctype.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/ctype.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/ctype.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/ctype.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/errno.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/errno.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/errno.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/errno.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/high_precision.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/high_precision.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/high_precision.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/high_precision.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_alpha.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_alpha.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_alpha.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_alpha.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_armv4.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_armv4.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_armv4.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_armv4.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h.in b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_auto.h.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_auto.h.in
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_auto.h.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_i386.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_i386.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_i386.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_i386.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_m68k.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_m68k.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_m68k.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_m68k.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_powerpc.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_powerpc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_powerpc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_powerpc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_sparc.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_sparc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_sparc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_sparc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_x86_64.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_x86_64.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/m_x86_64.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/m_x86_64.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/malloc.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/malloc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/malloc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/malloc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_auto.h.in b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_auto.h.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_auto.h.in
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_auto.h.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_darwinos.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_darwinos.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_darwinos.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_darwinos.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_linux.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_linux.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_linux.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_linux.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_linux_kernel.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_linux_kernel.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_linux_kernel.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_linux_kernel.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_palmos.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_palmos.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_palmos.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_palmos.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_rtems.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_rtems.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_rtems.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_rtems.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_sunos.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_sunos.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_sunos.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_sunos.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_symbian.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_symbian.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_symbian.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_symbian.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_win32.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_win32.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_win32.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_win32.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_win32_wince.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_win32_wince.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/os_win32_wince.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/os_win32_wince.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/rand.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/rand.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/rand.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/rand.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/setjmp.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/setjmp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/setjmp.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/setjmp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/size_t.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/size_t.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/size_t.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/size_t.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/socket.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/socket.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/socket.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/socket.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/stdarg.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/stdarg.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/stdarg.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/stdarg.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/stdfileio.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/stdfileio.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/stdfileio.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/stdfileio.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/string.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/string.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/string.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/string.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/time.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/time.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/compat/time.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/compat/time.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/config.h
similarity index 92%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/config.h
index 70120c9f96f8d5d8aaec4fd505d8ae28b5c1aac5..2d0e1639273af5ca9966ee2f72c88a935b89d399 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/config.h
@@ -1,5 +1,5 @@
 /* $Id: config.h 2527 2009-03-23 11:57:55Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #ifndef __PJ_CONFIG_H__
 #define __PJ_CONFIG_H__
@@ -49,78 +49,78 @@
  * Include target OS specific configuration.
  */
 #if defined(PJ_AUTOCONF)
-/*
- * Autoconf
- */
+    /*
+     * Autoconf
+     */
 #   include <pj/compat/os_auto.h>
 
 #elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
-/*
- * SymbianOS
- */
+    /*
+     * SymbianOS
+     */
 #  include <pj/compat/os_symbian.h>
 
 #elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE)
-/*
- * Windows CE
- */
+    /*
+     * Windows CE
+     */
 #   undef PJ_WIN32_WINCE
 #   define PJ_WIN32_WINCE   1
 #   include <pj/compat/os_win32_wince.h>
 
-/* Also define Win32 */
+    /* Also define Win32 */
 #   define PJ_WIN32 1
 
 #elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \
 	defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__)
-/*
- * Win32
- */
+    /*
+     * Win32
+     */
 #   undef PJ_WIN32
 #   define PJ_WIN32 1
 #   include <pj/compat/os_win32.h>
 
 #elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0
-/*
- * Linux kernel
- */
+    /*
+     * Linux kernel
+     */
 #  include <pj/compat/os_linux_kernel.h>
 
 #elif defined(PJ_LINUX) || defined(linux) || defined(__linux)
-/*
- * Linux
- */
+    /*
+     * Linux
+     */
 #   undef PJ_LINUX
 #   define PJ_LINUX	    1
 #   include <pj/compat/os_linux.h>
 
 #elif defined(PJ_PALMOS) && PJ_PALMOS!=0
-/*
- * Palm
- */
+    /*
+     * Palm
+     */
 #  include <pj/compat/os_palmos.h>
 
 #elif defined(PJ_SUNOS) || defined(sun) || defined(__sun)
-/*
- * SunOS
- */
+    /*
+     * SunOS
+     */
 #   undef PJ_SUNOS
 #   define PJ_SUNOS	    1
 #   include <pj/compat/os_sunos.h>
 
 #elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \
       defined (__APPLE__) || defined (__MACH__)
-/*
- * MacOS X
- */
+    /*
+     * MacOS X
+     */
 #   undef PJ_DARWINOS
 #   define PJ_DARWINOS	    1
 #   include <pj/compat/os_darwinos.h>
 
 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0
-/*
- * RTEMS
- */
+    /*
+     * RTEMS
+     */
 #  include <pj/compat/os_rtems.h>
 #else
 #   error "Please specify target os."
@@ -131,17 +131,17 @@
  * Target machine specific configuration.
  */
 #if defined(PJ_AUTOCONF)
-/*
- * Autoconf configured
- */
+    /*
+     * Autoconf configured
+     */
 #include <pj/compat/m_auto.h>
 
 #elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \
 	defined(_X86_) || defined(x86) || defined(__i386__) || \
 	defined(__i386) || defined(_M_IX86) || defined(__I86__)
-/*
- * Generic i386 processor family, little-endian
- */
+    /*
+     * Generic i386 processor family, little-endian
+     */
 #   undef PJ_M_I386
 #   define PJ_M_I386		1
 #   define PJ_M_NAME		"i386"
@@ -152,9 +152,9 @@
 
 #elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \
 	defined(__x86_64__) || defined(__x86_64)
-/*
- * AMD 64bit processor, little endian
- */
+    /*
+     * AMD 64bit processor, little endian
+     */
 #   undef PJ_M_X86_64
 #   define PJ_M_X86_64		1
 #   define PJ_M_NAME		"x86_64"
@@ -164,9 +164,9 @@
 
 #elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \
 	defined(__IA64__) || defined( 	_M_IA64)
-/*
- * Intel IA64 processor, little endian
- */
+    /*
+     * Intel IA64 processor, little endian
+     */
 #   undef PJ_M_IA64
 #   define PJ_M_IA64		1
 #   define PJ_M_NAME		"ia64"
@@ -176,9 +176,9 @@
 
 #elif defined (PJ_M_M68K) && PJ_M_M68K != 0
 
-/*
- * Motorola m64k processor, little endian
- */
+    /*
+     * Motorola m64k processor, little endian
+     */
 #   undef PJ_M_M68K
 #   define PJ_M_M68K		1
 #   define PJ_M_NAME		"m68k"
@@ -189,9 +189,9 @@
 
 #elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \
 	defined (_M_ALPHA)
-/*
- * DEC Alpha processor, little endian
- */
+    /*
+     * DEC Alpha processor, little endian
+     */
 #   undef PJ_M_ALPHA
 #   define PJ_M_ALPHA		1
 #   define PJ_M_NAME		"alpha"
@@ -202,9 +202,9 @@
 
 #elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \
 	defined(__MIPS__) || defined(MIPS) || defined(_MIPS_)
-/*
- * MIPS, default to little endian
- */
+    /*
+     * MIPS, default to little endian
+     */
 #   undef PJ_M_MIPS
 #   define PJ_M_MIPS		1
 #   define PJ_M_NAME		"mips"
@@ -216,9 +216,9 @@
 
 
 #elif defined (PJ_M_SPARC) || defined( 	__sparc__) || defined(__sparc)
-/*
- * Sun Sparc, big endian
- */
+    /*
+     * Sun Sparc, big endian
+     */
 #   undef PJ_M_SPARC
 #   define PJ_M_SPARC		1
 #   define PJ_M_NAME		"sparc"
@@ -228,9 +228,9 @@
 
 #elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) ||  \
 	defined(ARMV4) || defined(__arm__)
-/*
- * ARM, default to little endian
- */
+    /*
+     * ARM, default to little endian
+     */
 #   undef PJ_M_ARMV4
 #   define PJ_M_ARMV4		1
 #   define PJ_M_NAME		"armv4"
@@ -243,9 +243,9 @@
 #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \
 	defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \
 	defined(_ARCH_PPC)
-/*
- * PowerPC, big endian
- */
+    /*
+     * PowerPC, big endian
+     */
 #   undef PJ_M_POWERPC
 #   define PJ_M_POWERPC		1
 #   define PJ_M_NAME		"powerpc"
@@ -255,16 +255,16 @@
 
 #elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \
       defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2)
-/*
- * Nios2, little endian
- */
+    /*
+     * Nios2, little endian
+     */
 #   undef PJ_M_NIOS2
 #   define PJ_M_NIOS2		1
 #   define PJ_M_NAME		"nios2"
 #   define PJ_HAS_PENTIUM	0
 #   define PJ_IS_LITTLE_ENDIAN	1
 #   define PJ_IS_BIG_ENDIAN	0
-
+		
 #else
 #   error "Please specify target machine."
 #endif
@@ -408,7 +408,7 @@
  * in the application.
  *
  * This will slow down pool creation and destruction and will add
- * few bytes of overhead, so application would normally want to
+ * few bytes of overhead, so application would normally want to 
  * disable this feature on release build.
  *
  * Default: 0
@@ -437,14 +437,14 @@
  *
  * Default: 8192
  */
-#ifndef PJ_THREAD_DEFAULT_STACK_SIZE
+#ifndef PJ_THREAD_DEFAULT_STACK_SIZE 
 #  define PJ_THREAD_DEFAULT_STACK_SIZE    8192
 #endif
 
 
 /**
- * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of
- * the stack. The OS implementation may check that no stack overflow
+ * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of 
+ * the stack. The OS implementation may check that no stack overflow 
  * occurs, and it also may collect statistic about stack usage. Note
  * that this will increase the footprint of the libraries since it
  * tracks the filename and line number of each functions.
@@ -474,7 +474,7 @@
 #endif
 
 /**
- * Support IPv6 in the library. If this support is disabled, some IPv6
+ * Support IPv6 in the library. If this support is disabled, some IPv6 
  * related functions will return PJ_EIPV6NOTSUP.
  *
  * Default: 0 (disabled, for now)
@@ -483,21 +483,21 @@
 #  define PJ_HAS_IPV6		    0
 #endif
 
-/**
-* Maximum hostname length.
-* Libraries sometimes needs to make copy of an address to stack buffer;
-* the value here affects the stack usage.
-*
-* Default: 128
-*/
+ /**
+ * Maximum hostname length.
+ * Libraries sometimes needs to make copy of an address to stack buffer;
+ * the value here affects the stack usage.
+ *
+ * Default: 128
+ */
 #ifndef PJ_MAX_HOSTNAME
 #  define PJ_MAX_HOSTNAME	    (128)
 #endif
 
 /**
  * Constants for declaring the maximum handles that can be supported by
- * a single IOQ framework. This constant might not be relevant to the
- * underlying I/O queue impelementation, but still, developers should be
+ * a single IOQ framework. This constant might not be relevant to the 
+ * underlying I/O queue impelementation, but still, developers should be 
  * aware of this constant, to make sure that the program will not break when
  * the underlying implementation changes.
  */
@@ -511,8 +511,8 @@
  * things to ensure thread safety of handle unregistration operation by
  * employing reference counter to each handle.
  *
- * In addition, the ioqueue will preallocate memory for the handles,
- * according to the maximum number of handles that is specified during
+ * In addition, the ioqueue will preallocate memory for the handles, 
+ * according to the maximum number of handles that is specified during 
  * ioqueue creation.
  *
  * All applications would normally want this enabled, but you may disable
@@ -533,7 +533,7 @@
  * concurrently/in parallel. The default is yes, which means that if there
  * are more than one pending operations complete simultaneously, more
  * than one threads may call the key's callback at the same time. This
- * generally would promote good scalability for application, at the
+ * generally would promote good scalability for application, at the 
  * expense of more complexity to manage the concurrent accesses.
  *
  * Please see the ioqueue documentation for more info.
@@ -588,14 +588,14 @@
  * set to value lower than FD_SETSIZE.
  */
 #if PJ_FD_SETSIZE_SETABLE
-/* Only override FD_SETSIZE if the value has not been set */
+    /* Only override FD_SETSIZE if the value has not been set */
 #   ifndef FD_SETSIZE
 #	define FD_SETSIZE		PJ_IOQUEUE_MAX_HANDLES
 #   endif
 #else
-/* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES
- * is lower than FD_SETSIZE value.
- */
+    /* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES
+     * is lower than FD_SETSIZE value.
+     */
 #   ifdef FD_SETSIZE
 #	if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE
 #	    error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE"
@@ -712,7 +712,7 @@
 #ifndef PJ_NATIVE_ERR_POSITIVE
 #   define PJ_NATIVE_ERR_POSITIVE   1
 #endif
-
+ 
 /**
  * Include error message string in the library (pj_strerror()).
  * This is very much desirable!
@@ -729,7 +729,7 @@
  * functions to compare alnum strings. On some systems, they're faster
  * then stricmp/strcasecmp, but they can be slower on other systems.
  * When disabled, pjlib will fallback to stricmp/strnicmp.
- *
+ * 
  * Default: 0
  */
 #ifndef PJ_HAS_STRICMP_ALNUM
@@ -749,7 +749,7 @@
  *
  * The libraries support generation of dynamic link libraries for
  * Symbian ABIv2 target (.dso/Dynamic Shared Object files, in Symbian
- * terms). Similar procedures may be applied for Win32 DLL with some
+ * terms). Similar procedures may be applied for Win32 DLL with some 
  * modification.
  *
  * Depending on the platforms, these steps may be necessary in order to
@@ -757,7 +757,7 @@
  *  - Create the (Visual Studio) projects to produce DLL output. PJLIB
  *    does not provide ready to use project files to produce DLL, so
  *    you need to create these projects yourself. For Symbian, the MMP
- *    files have been setup to produce DSO files for targets that
+ *    files have been setup to produce DSO files for targets that 
  *    require them.
  *  - In the (Visual Studio) projects, some macros need to be declared
  *    so that appropriate modifiers are added to symbol declarations
@@ -766,49 +766,49 @@
  *    MMP files.
  *  - Some build systems require .DEF file to be specified when creating
  *    the DLL. For Symbian, .DEF files are included in pjlib distribution,
- *    in <tt>pjlib/build.symbian</tt> directory. These DEF files are
+ *    in <tt>pjlib/build.symbian</tt> directory. These DEF files are 
  *    created by running <tt>./makedef.sh all</tt> from this directory,
  *    inside Mingw.
  *
  * Macros related for building DLL/DSO files:
  *  - For platforms that supports dynamic link libraries generation,
  *    it must declare <tt>PJ_EXPORT_SPECIFIER</tt> macro which value contains
- *    the prefix to be added to symbol definition, to export this
+ *    the prefix to be added to symbol definition, to export this 
  *    symbol in the DLL/DSO. For example, on Win32/Visual Studio, the
- *    value of this macro is \a __declspec(dllexport), and for ARM
- *    ABIv2/Symbian, the value is \a EXPORT_C.
+ *    value of this macro is \a __declspec(dllexport), and for ARM 
+ *    ABIv2/Symbian, the value is \a EXPORT_C. 
  *  - For platforms that supports linking with dynamic link libraries,
  *    it must declare <tt>PJ_IMPORT_SPECIFIER</tt> macro which value contains
- *    the prefix to be added to symbol declaration, to import this
+ *    the prefix to be added to symbol declaration, to import this 
  *    symbol from a DLL/DSO. For example, on Win32/Visual Studio, the
- *    value of this macro is \a __declspec(dllimport), and for ARM
- *    ABIv2/Symbian, the value is \a IMPORT_C.
- *  - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt>
+ *    value of this macro is \a __declspec(dllimport), and for ARM 
+ *    ABIv2/Symbian, the value is \a IMPORT_C. 
+ *  - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt> 
  *    macros above can be declared in your \a config_site.h if they are not
  *    declared by pjlib.
- *  - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and
- *    <tt>PJ_EXPORTING</tt> macros must be declared, so that
+ *  - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and 
+ *    <tt>PJ_EXPORTING</tt> macros must be declared, so that 
  *     <tt>PJ_EXPORT_SPECIFIER</tt> modifier will be added into function
  *    definition.
  *  - When application wants to link dynamically with PJLIB, then it
  *    must declare <tt>PJ_DLL</tt> macro when using/including PJLIB header,
- *    so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into
+ *    so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into 
  *    symbol declarations.
  *
  * When <b>PJ_DLL</b> macro is not declared, static linking is assumed.
  *
  * For example, here are some settings to produce DLLs with Visual Studio
  * on Windows/Win32:
- *  - Create Visual Studio projects to produce DLL. Add the appropriate
+ *  - Create Visual Studio projects to produce DLL. Add the appropriate 
  *    project dependencies to avoid link errors.
- *  - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt>
+ *  - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt> 
  *    macros.
  *  - Declare these macros in your <tt>config_site.h</tt>:
  \verbatim
 	#define PJ_EXPORT_SPECIFIER  __declspec(dllexport)
 	#define PJ_IMPORT_SPECIFIER  __declspec(dllimport)
  \endverbatim
- *  - And in the application (that links with the DLL) project, add
+ *  - And in the application (that links with the DLL) project, add 
  *    <tt>PJ_DLL</tt> in the macro declarations.
  */
 
@@ -832,7 +832,7 @@
  * is built as dynamic library.
  *
  * This macro should have been added by platform specific headers,
- * if the platform supports building dynamic library target.
+ * if the platform supports building dynamic library target. 
  */
 #ifndef PJ_EXPORT_DECL_SPECIFIER
 #   define PJ_EXPORT_DECL_SPECIFIER
@@ -845,7 +845,7 @@
  * is built as dynamic library.
  *
  * This macro should have been added by platform specific headers,
- * if the platform supports building dynamic library target.
+ * if the platform supports building dynamic library target. 
  */
 #ifndef PJ_EXPORT_DEF_SPECIFIER
 #   define PJ_EXPORT_DEF_SPECIFIER
@@ -940,7 +940,7 @@
  * @def PJ_DECL_DATA(type)
  * @param type The data type.
  * Declare a global data.
- */
+ */ 
 #if defined(PJ_DLL)
 #   if defined(PJ_EXPORTING)
 #	define PJ_DECL_DATA(type)   PJ_EXPORT_DECL_SPECIFIER extern type
@@ -956,7 +956,7 @@
  * @def PJ_DEF_DATA(type)
  * @param type The data type.
  * Define a global data.
- */
+ */ 
 #if defined(PJ_DLL) && defined(PJ_EXPORTING)
 #   define PJ_DEF_DATA(type)	    PJ_EXPORT_DEF_SPECIFIER type
 #elif !defined(PJ_DEF_DATA)
@@ -1046,19 +1046,19 @@ PJ_BEGIN_DECL
 /**
  * PJLIB version string constant. @see pj_get_version()
  */
-PJ_DECL_DATA (const char*) PJ_VERSION;
+PJ_DECL_DATA(const char*) PJ_VERSION;
 
 /**
  * Get PJLIB version string.
  *
  * @return #PJ_VERSION constant.
  */
-PJ_DECL (const char*) pj_get_version (void);
+PJ_DECL(const char*) pj_get_version(void);
 
 /**
  * Dump configuration to log with verbosity equal to info(3).
  */
-PJ_DECL (void) pj_dump_config (void);
+PJ_DECL(void) pj_dump_config(void);
 
 PJ_END_DECL
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config_site_sample.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/config_site_sample.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/config_site_sample.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/config_site_sample.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ctype.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/ctype.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ctype.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/ctype.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/doxygen.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/doxygen.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/doxygen.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/doxygen.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/errno.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/errno.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/errno.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/errno.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/except.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/except.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/except.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/except.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/fifobuf.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/fifobuf.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/fifobuf.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/fifobuf.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/file_access.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/file_access.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/file_access.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/file_access.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/file_io.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/file_io.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/file_io.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/file_io.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/guid.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/guid.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/guid.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/guid.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/hash.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/hash.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/hash.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/hash.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ioqueue.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/ioqueue.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ioqueue.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/ioqueue.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ip_helper.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/ip_helper.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/ip_helper.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/ip_helper.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/list.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/list.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/list.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/list.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/list_i.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/list_i.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/list_i.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/list_i.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/lock.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/lock.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/lock.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/lock.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/log.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/log.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/log.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/log.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/math.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/math.h
similarity index 96%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/math.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/math.h
index 93ba2d997782f5785db0684c12f5d54f054e96f2..9d0209589a19acf025b5f1c7aa2d167703c84f9c 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/math.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/math.h
@@ -1,4 +1,4 @@
-/* $Id: math.h 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: math.h 2818 2009-06-25 13:27:02Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -140,7 +140,9 @@ PJ_INLINE(void) pj_math_stat_update(pj_math_stat *stat, int val)
 #if PJ_HAS_FLOATING_POINT
     delta = val - stat->fmean_;
     stat->fmean_ += delta/stat->n;
-    stat->mean = (int) stat->fmean_;
+    
+    /* Return mean value with 'rounding' */
+    stat->mean = (int) (stat->fmean_ + 0.5);
 
     stat->m2_ += (int)(delta * (val-stat->fmean_));
 #else
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/os.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/os.h
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/os.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/os.h
index 9e221e8ee0959a1aa16b93a7f14431e706167505..b85af2a22e78827098804baf16b9025f8a0ef351 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/os.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/os.h
@@ -1,4 +1,4 @@
-/* $Id: os.h 2482 2009-03-02 15:50:12Z nanang $ */
+/* $Id: os.h 2805 2009-06-25 12:29:04Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -1267,6 +1267,12 @@ PJ_DECL(pj_time_val) pj_elapsed_time( const pj_timestamp *start,
 PJ_DECL(pj_uint32_t) pj_elapsed_msec( const pj_timestamp *start,
                                       const pj_timestamp *stop );
 
+/**
+ * Variant of #pj_elapsed_msec() which returns 64bit value.
+ */
+PJ_DECL(pj_uint64_t) pj_elapsed_msec64(const pj_timestamp *start,
+                                       const pj_timestamp *stop );
+
 /**
  * Calculate the elapsed time in 32-bit microseconds.
  * This function calculates the elapsed time using highest precision
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/pool.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/pool.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_alt.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/pool_alt.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_alt.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/pool_alt.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_buf.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/pool_buf.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_buf.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/pool_buf.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_i.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/pool_i.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/pool_i.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/pool_i.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/rand.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/rand.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/rand.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/rand.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/rbtree.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/rbtree.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/rbtree.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/rbtree.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/sock.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/sock.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/sock.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/sock.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/sock_select.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/sock_select.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/sock_select.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/sock_select.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/string.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/string.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/string.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/string.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/string_i.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/string_i.h
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/string_i.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/string_i.h
index 495a7995735f4a1f3fa69a6d1a52ee1e5bdede71..d99c13bd8b912fce84a0ea78571cd7d71da91c42 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/string_i.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/string_i.h
@@ -1,4 +1,4 @@
-/* $Id: string_i.h 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: string_i.h 2819 2009-06-25 13:29:52Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -32,6 +32,10 @@ PJ_IDEF(pj_str_t*) pj_strdup(pj_pool_t *pool,
 			      pj_str_t *dst,
 			      const pj_str_t *src)
 {
+    /* Without this, destination will be corrupted */
+    if (dst == src)
+	return dst;
+
     if (src->slen) {
 	dst->ptr = (char*)pj_pool_alloc(pool, src->slen);
 	pj_memcpy(dst->ptr, src->ptr, src->slen);
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/timer.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/timer.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/timer.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/timer.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/types.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/types.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/unicode.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/unicode.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pj/unicode.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pj/unicode.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pjlib++.hpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pjlib++.hpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pjlib++.hpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pjlib++.hpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/include/pjlib.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/include/pjlib.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/include/pjlib.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/include/pjlib.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/activesock.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/activesock.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/activesock.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/activesock.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/addr_resolv_linux_kernel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_linux_kernel.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/addr_resolv_linux_kernel.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_sock.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/addr_resolv_sock.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/addr_resolv_sock.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/addr_resolv_sock.c
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/addr_resolv_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/addr_resolv_symbian.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8c96d462795c078af8a4be8192c851dda1383afc
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/addr_resolv_symbian.cpp
@@ -0,0 +1,196 @@
+/* $Id: addr_resolv_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pj/addr_resolv.h>
+#include <pj/assert.h>
+#include <pj/errno.h>
+#include <pj/ip_helper.h>
+#include <pj/log.h>
+#include <pj/sock.h>
+#include <pj/string.h>
+#include <pj/unicode.h>
+
+#include "os_symbian.h"
+ 
+#define THIS_FILE 	"addr_resolv_symbian.cpp"
+#define TRACE_ME	0
+
+
+// PJLIB API: resolve hostname
+PJ_DEF(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he)
+{
+    static pj_addrinfo ai;
+    static char *aliases[2];
+    static char *addrlist[2];
+    unsigned count = 1;
+    pj_status_t status;
+    
+    status = pj_getaddrinfo(PJ_AF_INET, name, &count, &ai);
+    if (status != PJ_SUCCESS)
+    	return status;
+    
+    aliases[0] = ai.ai_canonname;
+    aliases[1] = NULL;
+    
+    addrlist[0] = (char*) &ai.ai_addr.ipv4.sin_addr;
+    addrlist[1] = NULL;
+    
+    pj_bzero(he, sizeof(*he));
+    he->h_name = aliases[0];
+    he->h_aliases = aliases;
+    he->h_addrtype = PJ_AF_INET;
+    he->h_length = 4;
+    he->h_addr_list = addrlist;
+    
+    return PJ_SUCCESS;
+}
+
+
+// Resolve for specific address family
+static pj_status_t getaddrinfo_by_af(int af, const pj_str_t *name,
+				     unsigned *count, pj_addrinfo ai[]) 
+{
+    unsigned i;
+    pj_status_t status;
+    
+    PJ_ASSERT_RETURN(name && count && ai, PJ_EINVAL);
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+	
+    // Get resolver for the specified address family
+    RHostResolver &resv = PjSymbianOS::Instance()->GetResolver(af);
+
+    // Convert name to Unicode
+    wchar_t name16[PJ_MAX_HOSTNAME];
+    pj_ansi_to_unicode(name->ptr, name->slen, name16, PJ_ARRAY_SIZE(name16));
+    TPtrC16 data((const TUint16*)name16);
+
+    // Resolve!
+    TNameEntry nameEntry;
+    TRequestStatus reqStatus;
+    
+    resv.GetByName(data, nameEntry, reqStatus);
+    User::WaitForRequest(reqStatus);
+    
+    // Iterate each result
+    i = 0;
+    while (reqStatus == KErrNone && i < *count) {
+    	
+		// Get the resolved TInetAddr
+		TInetAddr inetAddr(nameEntry().iAddr);
+		int addrlen;
+
+#if TRACE_ME
+		if (1) {
+			pj_sockaddr a;
+			char ipaddr[PJ_INET6_ADDRSTRLEN+2];
+			int namelen;
+			
+			namelen = sizeof(pj_sockaddr);
+			if (PjSymbianOS::Addr2pj(inetAddr, a, &namelen, 
+									 PJ_FALSE) == PJ_SUCCESS) 
+			{
+				PJ_LOG(5,(THIS_FILE, "resolve %.*s: %s", 
+						(int)name->slen, name->ptr,
+						pj_sockaddr_print(&a, ipaddr, sizeof(ipaddr), 2)));
+			}
+		}
+#endif
+		
+		// Ignore if this is not the same address family
+		// Not a good idea, as Symbian mapps IPv4 to IPv6.
+		//fam = inetAddr.Family();
+		//if (fam != af) {
+		//    resv.Next(nameEntry, reqStatus);
+		//    User::WaitForRequest(reqStatus);
+		//    continue;
+		//}
+		
+		// Convert IP address first to get IPv4 mapped address
+		addrlen = sizeof(ai[i].ai_addr);
+		status = PjSymbianOS::Addr2pj(inetAddr, ai[i].ai_addr, 
+									  &addrlen, PJ_TRUE);
+		if (status != PJ_SUCCESS)
+		    return status;
+		
+		// Ignore if address family doesn't match
+		if (ai[i].ai_addr.addr.sa_family != af) {
+		    resv.Next(nameEntry, reqStatus);
+		    User::WaitForRequest(reqStatus);
+		    continue;
+		}
+
+		// Convert the official address to ANSI.
+		pj_unicode_to_ansi((const wchar_t*)nameEntry().iName.Ptr(), 
+				   nameEntry().iName.Length(),
+			       	   ai[i].ai_canonname, sizeof(ai[i].ai_canonname));
+	
+		// Next
+		++i;
+		resv.Next(nameEntry, reqStatus);
+		User::WaitForRequest(reqStatus);
+    }
+
+    *count = i;
+    return PJ_SUCCESS;
+}
+
+/* Resolve IPv4/IPv6 address */
+PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename,
+				   unsigned *count, pj_addrinfo ai[]) 
+{
+    unsigned start;
+    pj_status_t status;
+    
+    PJ_ASSERT_RETURN(af==PJ_AF_INET || af==PJ_AF_INET6 || af==PJ_AF_UNSPEC,
+    		     PJ_EAFNOTSUP);
+    PJ_ASSERT_RETURN(nodename && count && *count && ai, PJ_EINVAL);
+    
+    start = 0;
+    
+    if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) {
+        unsigned max = *count;
+    	status = getaddrinfo_by_af(PJ_AF_INET6, nodename, 
+    				   &max, &ai[start]);
+    	if (status == PJ_SUCCESS) {
+    	    (*count) -= max;
+    	    start += max;
+    	}
+    }
+    
+    if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) {
+        unsigned max = *count;
+    	status = getaddrinfo_by_af(PJ_AF_INET, nodename, 
+    				   &max, &ai[start]);
+    	if (status == PJ_SUCCESS) {
+    	    (*count) -= max;
+    	    start += max;
+    	}
+    }
+    
+    *count = start;
+    
+    if (*count) {
+    	return PJ_SUCCESS;
+    } else {
+    	return status!=PJ_SUCCESS ? status : PJ_ENOTFOUND;
+    }
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/array.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/array.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/array.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/array.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/longjmp_i386.S b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/longjmp_i386.S
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/longjmp_i386.S
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/longjmp_i386.S
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/setjmp_i386.S b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/setjmp_i386.S
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/setjmp_i386.S
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/setjmp_i386.S
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/sigjmp.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/sigjmp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/sigjmp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/sigjmp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/string.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/string.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/string.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/string.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/string_compat.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/string_compat.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/compat/string_compat.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/compat/string_compat.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/config.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/config.c
similarity index 97%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/config.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/config.c
index f2beb56635399cfc789ea6a03ca35137c457c5b7..6c8d6df3c56493d874f974829db4c9cc87312408 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/config.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/config.c
@@ -1,4 +1,4 @@
-/* $Id: config.c 2551 2009-03-25 12:13:09Z bennylp $ */
+/* $Id: config.c 2828 2009-07-02 14:50:38Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -22,7 +22,7 @@
 #include <pj/ioqueue.h>
 
 static const char *id = "config.c";
-PJ_DEF_DATA(const char*) PJ_VERSION = "1.0.2";
+PJ_DEF_DATA(const char*) PJ_VERSION = "1.0.3";
 
 /*
  * Get PJLIB version string.
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ctype.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ctype.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ctype.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ctype.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/errno.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/errno.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/errno.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/errno.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/except.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/except.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/except.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/except.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/exception_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/exception_symbian.cpp
similarity index 70%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/exception_symbian.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/exception_symbian.cpp
index 14ded02ed9c7f93154068aef65904015728dc4b1..e54cebddf940cd73896ee81e1f59afad48d16d74 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/exception_symbian.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/exception_symbian.cpp
@@ -1,5 +1,5 @@
 /* $Id: exception_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #include <pj/except.h>
 #include <pj/os.h>
@@ -25,19 +25,19 @@
 
 
 #if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0
-static const char *exception_id_names[PJ_MAX_EXCEPTION_ID];
+    static const char *exception_id_names[PJ_MAX_EXCEPTION_ID];
 #else
-/*
- * Start from 1 (not 0)!!!
- * Exception 0 is reserved for normal path of setjmp()!!!
- */
-static int last_exception_id = 1;
+    /*
+     * Start from 1 (not 0)!!!
+     * Exception 0 is reserved for normal path of setjmp()!!!
+     */
+    static int last_exception_id = 1;
 #endif  /* PJ_HAS_EXCEPTION_NAMES */
 
 
 #if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0
-PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name,
-        pj_exception_id_t *id)
+PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name,
+                                           pj_exception_id_t *id)
 {
     unsigned i;
 
@@ -47,7 +47,6 @@ PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name,
      * Start from 1 (not 0)!!!
      * Exception 0 is reserved for normal path of setjmp()!!!
      */
-
     for (i=1; i<PJ_MAX_EXCEPTION_ID; ++i) {
         if (exception_id_names[i] == NULL) {
             exception_id_names[i] = name;
@@ -58,18 +57,17 @@ PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name,
     }
 
     pj_leave_critical_section();
-
     return PJ_ETOOMANY;
 }
 
-PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id)
+PJ_DEF(pj_status_t) pj_exception_id_free( pj_exception_id_t id )
 {
     /*
      * Start from 1 (not 0)!!!
      * Exception 0 is reserved for normal path of setjmp()!!!
      */
-    PJ_ASSERT_RETURN (id>0 && id<PJ_MAX_EXCEPTION_ID, PJ_EINVAL);
-
+    PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, PJ_EINVAL);
+    
     pj_enter_critical_section();
     exception_id_names[id] = NULL;
     pj_leave_critical_section();
@@ -78,13 +76,13 @@ PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id)
 
 }
 
-PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id)
+PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id)
 {
     /*
      * Start from 1 (not 0)!!!
      * Exception 0 is reserved for normal path of setjmp()!!!
      */
-    PJ_ASSERT_RETURN (id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>");
+    PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>");
 
     if (exception_id_names[id] == NULL)
         return "<Unallocated ID>";
@@ -93,21 +91,21 @@ PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id)
 }
 
 #else   /* PJ_HAS_EXCEPTION_NAMES */
-PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name,
-        pj_exception_id_t *id)
+PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name,
+                                           pj_exception_id_t *id)
 {
-    PJ_ASSERT_RETURN (last_exception_id < PJ_MAX_EXCEPTION_ID-1, PJ_ETOOMANY);
+    PJ_ASSERT_RETURN(last_exception_id < PJ_MAX_EXCEPTION_ID-1, PJ_ETOOMANY);
 
     *id = last_exception_id++;
     return PJ_SUCCESS;
 }
 
-PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id)
+PJ_DEF(pj_status_t) pj_exception_id_free( pj_exception_id_t id )
 {
     return PJ_SUCCESS;
 }
 
-PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id)
+PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id)
 {
     return "";
 }
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/extra-exports.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/extra-exports.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/extra-exports.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/extra-exports.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/fifobuf.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/fifobuf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/fifobuf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/fifobuf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_access_unistd.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/file_access_unistd.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_access_unistd.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/file_access_unistd.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_access_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/file_access_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_access_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/file_access_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_io_ansi.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/file_io_ansi.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_io_ansi.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/file_io_ansi.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_io_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/file_io_win32.c
similarity index 93%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_io_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/file_io_win32.c
index 82269bc3ed6a6e3784256b4de3ca490dfec1f9d8..e5d6d857336d49aaba98d47d77f40d7618bd63af 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/file_io_win32.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/file_io_win32.c
@@ -1,4 +1,4 @@
-/* $Id: file_io_win32.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: file_io_win32.c 2807 2009-06-25 12:33:59Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -59,7 +59,15 @@ PJ_DEF(pj_status_t) pj_file_open( pj_pool_t *pool,
     if ((flags & PJ_O_WRONLY) == PJ_O_WRONLY) {
         dwDesiredAccess |= GENERIC_WRITE;
         if ((flags & PJ_O_APPEND) == PJ_O_APPEND) {
+#if !defined(PJ_WIN32_WINCE) || !PJ_WIN32_WINCE
+	    /* FILE_APPEND_DATA is invalid on WM2003 and WM5, but it seems
+	     * to be working on WM6. All are tested on emulator though.
+	     * Removing this also seem to work (i.e. data is appended), so
+	     * I guess this flag is "optional".
+	     * See http://trac.pjsip.org/repos/ticket/825
+	     */
             dwDesiredAccess |= FILE_APPEND_DATA;
+#endif
 	    dwCreationDisposition |= OPEN_ALWAYS;
         } else {
             dwDesiredAccess &= ~(FILE_APPEND_DATA);
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/guid.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/guid.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_simple.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/guid_simple.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_simple.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/guid_simple.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_uuid.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/guid_uuid.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_uuid.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/guid_uuid.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/guid_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/guid_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/guid_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/hash.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/hash.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/hash.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/hash.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_common_abs.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_common_abs.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_common_abs.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_common_abs.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_common_abs.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_common_abs.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_common_abs.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_common_abs.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_dummy.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_dummy.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_dummy.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_dummy.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_epoll.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_epoll.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_epoll.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_epoll.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_linux_kernel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_linux_kernel.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_linux_kernel.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_select.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_select.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_select.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_select.c
index e6ed8c1de0f5e45bab5e7cbfc5fa7db32e31fc2a..e64037ceac2f9b130771f67f6631c3b1d7de0f7f 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_select.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_select.c
@@ -1,4 +1,4 @@
-/* $Id: ioqueue_select.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: ioqueue_select.c 2806 2009-06-25 12:31:52Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -727,7 +727,8 @@ PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioqueue, const pj_time_val *timeout)
 
         /* Scan for readable socket. */
 	if ((key_has_pending_read(h) || key_has_pending_accept(h))
-            && PJ_FD_ISSET(h->fd, &rfdset) && !IS_CLOSING(h))
+            && PJ_FD_ISSET(h->fd, &rfdset) && !IS_CLOSING(h) &&
+	    counter<count)
         {
 #if PJ_IOQUEUE_HAS_SAFE_UNREG
 	    increment_counter(h);
@@ -739,7 +740,7 @@ PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioqueue, const pj_time_val *timeout)
 
 #if PJ_HAS_TCP
         if (key_has_pending_connect(h) && PJ_FD_ISSET(h->fd, &xfdset) &&
-	    !IS_CLOSING(h)) 
+	    !IS_CLOSING(h) && counter<count) 
 	{
 #if PJ_IOQUEUE_HAS_SAFE_UNREG
 	    increment_counter(h);
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_symbian.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..981baf270954c2b17c79dff56ead6ca9f7ee1d5e
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_symbian.cpp
@@ -0,0 +1,852 @@
+/* $Id: ioqueue_symbian.cpp 2804 2009-06-25 12:26:15Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pj/ioqueue.h>
+#include <pj/assert.h>
+#include <pj/errno.h>
+#include <pj/list.h>
+#include <pj/lock.h>
+#include <pj/pool.h>
+#include <pj/string.h>
+
+#include "os_symbian.h"
+
+class CIoqueueCallback;
+
+/*
+ * IO Queue structure.
+ */
+struct pj_ioqueue_t
+{
+    int		     eventCount;
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Class to encapsulate asynchronous socket operation.
+//
+class CIoqueueCallback : public CActive
+{
+public:
+    static CIoqueueCallback* NewL(pj_ioqueue_t *ioqueue,
+				  pj_ioqueue_key_t *key, 
+				  pj_sock_t sock, 
+				  const pj_ioqueue_callback *cb, 
+				  void *user_data);
+
+    //
+    // Start asynchronous recv() operation
+    //
+    pj_status_t StartRead(pj_ioqueue_op_key_t *op_key, 
+			  void *buf, pj_ssize_t *size, unsigned flags,
+			  pj_sockaddr_t *addr, int *addrlen);
+
+    //
+    // Start asynchronous accept() operation.
+    //
+    pj_status_t StartAccept(pj_ioqueue_op_key_t *op_key,
+			    pj_sock_t *new_sock,
+			    pj_sockaddr_t *local,
+			    pj_sockaddr_t *remote,
+			    int *addrlen );
+
+    //
+    // Completion callback.
+    //
+    void RunL();
+
+    //
+    // CActive's DoCancel()
+    //
+    void DoCancel();
+
+    //
+    // Cancel operation and call callback.
+    //
+    void CancelOperation(pj_ioqueue_op_key_t *op_key, 
+			 pj_ssize_t bytes_status);
+
+    //
+    // Accessors
+    //
+    void* get_user_data() const
+    {
+	return user_data_;
+    }
+    void set_user_data(void *user_data)
+    {
+	user_data_ = user_data;
+    }
+    pj_ioqueue_op_key_t *get_op_key() const
+    {
+	return pending_data_.common_.op_key_;
+    }
+    CPjSocket* get_pj_socket()
+    {
+	return sock_;
+    }
+
+private:
+    // Type of pending operation.
+    enum Type {
+	TYPE_NONE,
+	TYPE_READ,
+	TYPE_ACCEPT,
+    };
+
+    // Static data.
+    pj_ioqueue_t		*ioqueue_;
+    pj_ioqueue_key_t		*key_;
+    CPjSocket			*sock_;
+    pj_ioqueue_callback		 cb_;
+    void			*user_data_;
+
+    // Symbian data.
+    TPtr8			 aBufferPtr_;
+    TInetAddr			 aAddress_;
+
+    // Application data.
+    Type			 type_;
+
+    union Pending_Data
+    {
+	struct Common
+	{
+	    pj_ioqueue_op_key_t	*op_key_;
+	} common_;
+
+	struct Pending_Read
+	{
+	    pj_ioqueue_op_key_t	*op_key_;
+	    pj_sockaddr_t	*addr_;
+	    int			*addrlen_;
+	} read_;
+
+	struct Pending_Accept
+	{
+	    pj_ioqueue_op_key_t *op_key_;
+	    pj_sock_t		*new_sock_;
+	    pj_sockaddr_t	*local_;
+	    pj_sockaddr_t	*remote_;
+	    int			*addrlen_;
+	} accept_;
+    };
+
+    union Pending_Data		 pending_data_;
+    RSocket			blank_sock_;
+
+    CIoqueueCallback(pj_ioqueue_t *ioqueue,
+		     pj_ioqueue_key_t *key, pj_sock_t sock, 
+		     const pj_ioqueue_callback *cb, void *user_data)
+    : CActive(CActive::EPriorityStandard),
+	  ioqueue_(ioqueue), key_(key), sock_((CPjSocket*)sock), 
+	  user_data_(user_data), aBufferPtr_(NULL, 0), type_(TYPE_NONE)
+    {
+    	pj_memcpy(&cb_, cb, sizeof(*cb));
+    }
+
+
+    void ConstructL()
+    {
+	CActiveScheduler::Add(this);
+    }
+    
+    void HandleReadCompletion();
+    CPjSocket *HandleAcceptCompletion();
+};
+
+
+CIoqueueCallback* CIoqueueCallback::NewL(pj_ioqueue_t *ioqueue,
+					 pj_ioqueue_key_t *key, 
+					 pj_sock_t sock, 
+					 const pj_ioqueue_callback *cb, 
+					 void *user_data)
+{
+    CIoqueueCallback *self = new CIoqueueCallback(ioqueue, key, sock, 
+						  cb, user_data);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    return self;
+}
+
+
+//
+// Start asynchronous recv() operation
+//
+pj_status_t CIoqueueCallback::StartRead(pj_ioqueue_op_key_t *op_key, 
+					void *buf, pj_ssize_t *size, 
+					unsigned flags,
+					pj_sockaddr_t *addr, int *addrlen)
+{
+    PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY);
+    PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY);
+
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
+
+    pending_data_.read_.op_key_ = op_key;
+    pending_data_.read_.addr_ = addr;
+    pending_data_.read_.addrlen_ = addrlen;
+
+    aBufferPtr_.Set((TUint8*)buf, 0, (TInt)*size);
+
+    type_ = TYPE_READ;
+    if (addr && addrlen) {
+	sock_->Socket().RecvFrom(aBufferPtr_, aAddress_, flags, iStatus);
+    } else {
+	aAddress_.SetAddress(0);
+	aAddress_.SetPort(0);
+
+	if (sock_->IsDatagram()) {
+	    sock_->Socket().Recv(aBufferPtr_, flags, iStatus);
+	} else {
+	    // Using static like this is not pretty, but we don't need to use
+	    // the value anyway, hence doing it like this is probably most
+	    // optimal.
+	    static TSockXfrLength len;
+	    sock_->Socket().RecvOneOrMore(aBufferPtr_, flags, iStatus, len);
+	}
+    }
+
+    SetActive();
+    return PJ_EPENDING;
+}
+
+
+//
+// Start asynchronous accept() operation.
+//
+pj_status_t CIoqueueCallback::StartAccept(pj_ioqueue_op_key_t *op_key,
+					  pj_sock_t *new_sock,
+					  pj_sockaddr_t *local,
+					  pj_sockaddr_t *remote,
+					  int *addrlen )
+{
+    PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY);
+    PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY);
+
+    // addrlen must be specified if local or remote is specified
+    PJ_ASSERT_RETURN((!local && !remote) ||
+    		     (addrlen && *addrlen), PJ_EINVAL);
+    
+    pending_data_.accept_.op_key_ = op_key;
+    pending_data_.accept_.new_sock_ = new_sock;
+    pending_data_.accept_.local_ = local;
+    pending_data_.accept_.remote_ = remote;
+    pending_data_.accept_.addrlen_ = addrlen;
+
+    // Create blank socket
+    blank_sock_.Open(PjSymbianOS::Instance()->SocketServ());
+
+    type_ = TYPE_ACCEPT;
+    sock_->Socket().Accept(blank_sock_, iStatus);
+
+    SetActive();
+    return PJ_EPENDING;
+}
+
+
+//
+// Handle asynchronous RecvFrom() completion
+//
+void CIoqueueCallback::HandleReadCompletion() 
+{
+    if (pending_data_.read_.addr_ && pending_data_.read_.addrlen_) {
+	PjSymbianOS::Addr2pj(aAddress_, 
+			     *(pj_sockaddr*)pending_data_.read_.addr_,
+			     pending_data_.read_.addrlen_);
+	pending_data_.read_.addr_ = NULL;
+	pending_data_.read_.addrlen_ = NULL;
+    }
+	
+    pending_data_.read_.op_key_ = NULL;
+}
+
+
+//
+// Handle asynchronous Accept() completion.
+//
+CPjSocket *CIoqueueCallback::HandleAcceptCompletion() 
+{
+	CPjSocket *pjNewSock = new CPjSocket(get_pj_socket()->GetAf(), 
+					     get_pj_socket()->GetSockType(),
+					     blank_sock_);
+	int addrlen = 0;
+	
+	if (pending_data_.accept_.new_sock_) {
+	    *pending_data_.accept_.new_sock_ = (pj_sock_t)pjNewSock;
+	    pending_data_.accept_.new_sock_ = NULL;
+	}
+
+	if (pending_data_.accept_.local_) {
+	    TInetAddr aAddr;
+	    pj_sockaddr *ptr_sockaddr;
+	    
+	    blank_sock_.LocalName(aAddr);
+	    ptr_sockaddr = (pj_sockaddr*)pending_data_.accept_.local_;
+	    addrlen = *pending_data_.accept_.addrlen_;
+	    PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr, &addrlen);
+	    pending_data_.accept_.local_ = NULL;
+	}
+
+	if (pending_data_.accept_.remote_) {
+	    TInetAddr aAddr;
+	    pj_sockaddr *ptr_sockaddr;
+
+	    blank_sock_.RemoteName(aAddr);
+	    ptr_sockaddr = (pj_sockaddr*)pending_data_.accept_.remote_;
+	    addrlen = *pending_data_.accept_.addrlen_;
+	    PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr, &addrlen);
+	    pending_data_.accept_.remote_ = NULL;
+	}
+
+	if (pending_data_.accept_.addrlen_) {
+	    if (addrlen == 0) {
+	    	if (pjNewSock->GetAf() == PJ_AF_INET)
+	    	    addrlen = sizeof(pj_sockaddr_in);
+	    	else if (pjNewSock->GetAf() == PJ_AF_INET6)
+	    	    addrlen = sizeof(pj_sockaddr_in6);
+	    	else {
+	    	    pj_assert(!"Unsupported address family");
+	    	}
+	    }
+	    *pending_data_.accept_.addrlen_ = addrlen;
+	    pending_data_.accept_.addrlen_ = NULL;
+	}
+	
+	return pjNewSock;
+}
+
+
+//
+// Completion callback.
+//
+void CIoqueueCallback::RunL()
+{
+    Type cur_type = type_;
+
+    type_ = TYPE_NONE;
+
+    if (cur_type == TYPE_READ) {
+	//
+	// Completion of asynchronous RecvFrom()
+	//
+
+	/* Clear op_key (save it to temp variable first!) */
+	pj_ioqueue_op_key_t	*op_key = pending_data_.read_.op_key_;
+	pending_data_.read_.op_key_ = NULL;
+
+	// Handle failure condition
+	if (iStatus != KErrNone) {
+	    if (cb_.on_read_complete) {
+	    	cb_.on_read_complete( key_, op_key, 
+				      -PJ_RETURN_OS_ERROR(iStatus.Int()));
+	    }
+	    return;
+	}
+
+	HandleReadCompletion();
+
+	/* Call callback */
+	if (cb_.on_read_complete) {
+	    cb_.on_read_complete(key_, op_key, aBufferPtr_.Length());
+	}
+
+    } else if (cur_type == TYPE_ACCEPT) {
+	//
+	// Completion of asynchronous Accept()
+	//
+	
+	/* Clear op_key (save it to temp variable first!) */
+	pj_ioqueue_op_key_t	*op_key = pending_data_.read_.op_key_;
+	pending_data_.read_.op_key_ = NULL;
+
+	// Handle failure condition
+	if (iStatus != KErrNone) {
+	    if (pending_data_.accept_.new_sock_)
+		*pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET;
+	    
+	    if (cb_.on_accept_complete) {
+	    	cb_.on_accept_complete( key_, op_key, PJ_INVALID_SOCKET,
+				        -PJ_RETURN_OS_ERROR(iStatus.Int()));
+	    }
+	    return;
+	}
+
+	CPjSocket *pjNewSock = HandleAcceptCompletion();
+	
+	// Call callback.
+	if (cb_.on_accept_complete) {
+	    cb_.on_accept_complete( key_, op_key, (pj_sock_t)pjNewSock, 
+				    PJ_SUCCESS);
+	}
+    }
+
+    ioqueue_->eventCount++;
+}
+
+//
+// CActive's DoCancel()
+//
+void CIoqueueCallback::DoCancel()
+{
+    if (type_ == TYPE_READ)
+	sock_->Socket().CancelRecv();
+    else if (type_ == TYPE_ACCEPT)
+	sock_->Socket().CancelAccept();
+
+    type_ = TYPE_NONE;
+    pending_data_.common_.op_key_ = NULL;
+}
+
+//
+// Cancel operation and call callback.
+//
+void CIoqueueCallback::CancelOperation(pj_ioqueue_op_key_t *op_key, 
+				       pj_ssize_t bytes_status)
+{
+    Type cur_type = type_;
+
+    pj_assert(op_key == pending_data_.common_.op_key_);
+
+    Cancel();
+
+    if (cur_type == TYPE_READ) {
+    	if (cb_.on_read_complete)
+    	    cb_.on_read_complete(key_, op_key, bytes_status);
+    } else if (cur_type == TYPE_ACCEPT)
+	;    
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+/*
+ * IO Queue key structure.
+ */
+struct pj_ioqueue_key_t
+{
+    CIoqueueCallback	*cbObj;
+};
+
+
+/*
+ * Return the name of the ioqueue implementation.
+ */
+PJ_DEF(const char*) pj_ioqueue_name(void)
+{
+    return "ioqueue-symbian";
+}
+
+
+/*
+ * Create a new I/O Queue framework.
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_create(	pj_pool_t *pool, 
+					pj_size_t max_fd,
+					pj_ioqueue_t **p_ioqueue)
+{
+    pj_ioqueue_t *ioq;
+
+    PJ_UNUSED_ARG(max_fd);
+
+    ioq = PJ_POOL_ZALLOC_T(pool, pj_ioqueue_t);
+    *p_ioqueue = ioq;
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Destroy the I/O queue.
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_destroy( pj_ioqueue_t *ioq )
+{
+    PJ_UNUSED_ARG(ioq);
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Set the lock object to be used by the I/O Queue. 
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_set_lock( pj_ioqueue_t *ioq, 
+					 pj_lock_t *lock,
+					 pj_bool_t auto_delete )
+{
+    /* Don't really need lock for now */
+    PJ_UNUSED_ARG(ioq);
+    
+    if (auto_delete) {
+	pj_lock_destroy(lock);
+    }
+
+    return PJ_SUCCESS;
+}
+
+PJ_DEF(pj_status_t) pj_ioqueue_set_default_concurrency(pj_ioqueue_t *ioqueue,
+													   pj_bool_t allow)
+{
+	/* Not supported, just return PJ_SUCCESS silently */
+	PJ_UNUSED_ARG(ioqueue);
+	PJ_UNUSED_ARG(allow);
+	return PJ_SUCCESS;
+}
+
+/*
+ * Register a socket to the I/O queue framework. 
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_register_sock( pj_pool_t *pool,
+					      pj_ioqueue_t *ioq,
+					      pj_sock_t sock,
+					      void *user_data,
+					      const pj_ioqueue_callback *cb,
+                                              pj_ioqueue_key_t **p_key )
+{
+    pj_ioqueue_key_t *key;
+
+    key = PJ_POOL_ZALLOC_T(pool, pj_ioqueue_key_t);
+    key->cbObj = CIoqueueCallback::NewL(ioq, key, sock, cb, user_data);
+
+    *p_key = key;
+    return PJ_SUCCESS;
+}
+
+/*
+ * Unregister from the I/O Queue framework. 
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_unregister( pj_ioqueue_key_t *key )
+{
+    if (key == NULL || key->cbObj == NULL)
+	return PJ_SUCCESS;
+
+    // Cancel pending async object
+    if (key->cbObj) {
+	key->cbObj->Cancel();
+    }
+
+    // Close socket.
+    key->cbObj->get_pj_socket()->Socket().Close();
+    delete key->cbObj->get_pj_socket();
+
+    // Delete async object.
+    if (key->cbObj) {
+	delete key->cbObj;
+	key->cbObj = NULL;
+    }
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Get user data associated with an ioqueue key.
+ */
+PJ_DEF(void*) pj_ioqueue_get_user_data( pj_ioqueue_key_t *key )
+{
+    return key->cbObj->get_user_data();
+}
+
+
+/*
+ * Set or change the user data to be associated with the file descriptor or
+ * handle or socket descriptor.
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_set_user_data( pj_ioqueue_key_t *key,
+                                              void *user_data,
+                                              void **old_data)
+{
+    if (old_data)
+	*old_data = key->cbObj->get_user_data();
+    key->cbObj->set_user_data(user_data);
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Initialize operation key.
+ */
+PJ_DEF(void) pj_ioqueue_op_key_init( pj_ioqueue_op_key_t *op_key,
+				     pj_size_t size )
+{
+    pj_bzero(op_key, size);
+}
+
+
+/*
+ * Check if operation is pending on the specified operation key.
+ */
+PJ_DEF(pj_bool_t) pj_ioqueue_is_pending( pj_ioqueue_key_t *key,
+                                         pj_ioqueue_op_key_t *op_key )
+{
+    return key->cbObj->get_op_key()==op_key &&
+	   key->cbObj->IsActive();
+}
+
+
+/*
+ * Post completion status to the specified operation key and call the
+ * appropriate callback. 
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_post_completion( pj_ioqueue_key_t *key,
+                                                pj_ioqueue_op_key_t *op_key,
+                                                pj_ssize_t bytes_status )
+{
+    if (pj_ioqueue_is_pending(key, op_key)) {
+	key->cbObj->CancelOperation(op_key, bytes_status);
+    }
+    return PJ_SUCCESS;
+}
+
+
+#if defined(PJ_HAS_TCP) && PJ_HAS_TCP != 0
+/**
+ * Instruct I/O Queue to accept incoming connection on the specified 
+ * listening socket.
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key,
+                                       pj_ioqueue_op_key_t *op_key,
+				       pj_sock_t *new_sock,
+				       pj_sockaddr_t *local,
+				       pj_sockaddr_t *remote,
+				       int *addrlen )
+{
+    
+    return key->cbObj->StartAccept(op_key, new_sock, local, remote, addrlen);
+}
+
+
+/*
+ * Initiate non-blocking socket connect.
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_connect( pj_ioqueue_key_t *key,
+					const pj_sockaddr_t *addr,
+					int addrlen )
+{
+    pj_status_t status;
+    
+    RSocket &rSock = key->cbObj->get_pj_socket()->Socket();
+    TInetAddr inetAddr;
+    TRequestStatus reqStatus;
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+    
+    // Convert address
+    status = PjSymbianOS::pj2Addr(*(const pj_sockaddr*)addr, addrlen, 
+    				  inetAddr);
+    if (status != PJ_SUCCESS)
+    	return status;
+    
+    // We don't support async connect for now.
+    PJ_TODO(IOQUEUE_SUPPORT_ASYNC_CONNECT);
+
+    rSock.Connect(inetAddr, reqStatus);
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus == KErrNone)
+	return PJ_SUCCESS;
+
+    return PJ_RETURN_OS_ERROR(reqStatus.Int());
+}
+
+
+#endif	/* PJ_HAS_TCP */
+
+/*
+ * Poll the I/O Queue for completed events.
+ */
+PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioq,
+			     const pj_time_val *timeout)
+{
+    /* Polling is not necessary on Symbian, since all async activities
+     * are registered to active scheduler.
+     */
+    PJ_UNUSED_ARG(ioq);
+    PJ_UNUSED_ARG(timeout);
+    return 0;
+}
+
+
+/*
+ * Instruct the I/O Queue to read from the specified handle.
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_recv( pj_ioqueue_key_t *key,
+                                     pj_ioqueue_op_key_t *op_key,
+				     void *buffer,
+				     pj_ssize_t *length,
+				     pj_uint32_t flags )
+{
+    // If socket has reader, delete it.
+    if (key->cbObj->get_pj_socket()->Reader())
+    	key->cbObj->get_pj_socket()->DestroyReader();
+    
+    // Clear flag
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
+    return key->cbObj->StartRead(op_key, buffer, length, flags, NULL, NULL);
+}
+
+
+/*
+ * This function behaves similarly as #pj_ioqueue_recv(), except that it is
+ * normally called for socket, and the remote address will also be returned
+ * along with the data.
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_recvfrom( pj_ioqueue_key_t *key,
+                                         pj_ioqueue_op_key_t *op_key,
+					 void *buffer,
+					 pj_ssize_t *length,
+                                         pj_uint32_t flags,
+					 pj_sockaddr_t *addr,
+					 int *addrlen)
+{
+    CPjSocket *sock = key->cbObj->get_pj_socket();
+    
+    // If address is specified, check that the length match the
+    // address family
+    if (addr || addrlen) {
+    	PJ_ASSERT_RETURN(addr && addrlen && *addrlen, PJ_EINVAL);
+    	if (sock->GetAf() == PJ_AF_INET) {
+    	    PJ_ASSERT_RETURN(*addrlen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL);
+    	} else if (sock->GetAf() == PJ_AF_INET6) {
+    	    PJ_ASSERT_RETURN(*addrlen>=(int)sizeof(pj_sockaddr_in6), PJ_EINVAL);
+    	}
+    }
+    
+    // If socket has reader, delete it.
+    if (sock->Reader())
+    	sock->DestroyReader();
+    
+    if (key->cbObj->IsActive())
+	return PJ_EBUSY;
+
+    // Clear flag
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
+    return key->cbObj->StartRead(op_key, buffer, length, flags, addr, addrlen);
+}
+
+
+/*
+ * Instruct the I/O Queue to write to the handle.
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_send( pj_ioqueue_key_t *key,
+                                     pj_ioqueue_op_key_t *op_key,
+				     const void *data,
+				     pj_ssize_t *length,
+				     pj_uint32_t flags )
+{
+    TRequestStatus reqStatus;
+    TPtrC8 aBuffer((const TUint8*)data, (TInt)*length);
+    TSockXfrLength aLen;
+    
+    PJ_UNUSED_ARG(op_key);
+
+    // Forcing pending operation is not supported.
+    PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL);
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+
+    // Clear flag
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
+
+    key->cbObj->get_pj_socket()->Socket().Send(aBuffer, flags, reqStatus, aLen);
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus.Int() != KErrNone)
+	return PJ_RETURN_OS_ERROR(reqStatus.Int());
+
+    //At least in UIQ Emulator, aLen.Length() reports incorrect length
+    //for UDP (some newlc.com users seem to have reported this too).
+    //*length = aLen.Length();
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Instruct the I/O Queue to write to the handle.
+ */
+PJ_DEF(pj_status_t) pj_ioqueue_sendto( pj_ioqueue_key_t *key,
+                                       pj_ioqueue_op_key_t *op_key,
+				       const void *data,
+				       pj_ssize_t *length,
+                                       pj_uint32_t flags,
+				       const pj_sockaddr_t *addr,
+				       int addrlen)
+{
+    TRequestStatus reqStatus;
+    TPtrC8 aBuffer;
+    TInetAddr inetAddr;
+    TSockXfrLength aLen;
+    pj_status_t status;
+    
+    PJ_UNUSED_ARG(op_key);
+
+    // Forcing pending operation is not supported.
+    PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL);
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+
+    // Convert address
+    status = PjSymbianOS::pj2Addr(*(const pj_sockaddr*)addr, addrlen, 
+    				  inetAddr);
+    if (status != PJ_SUCCESS)
+    	return status;
+    
+    // Clear flag
+    flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC;
+
+    aBuffer.Set((const TUint8*)data, (TInt)*length);
+    CPjSocket *pjSock = key->cbObj->get_pj_socket();
+
+    pjSock->Socket().SendTo(aBuffer, inetAddr, flags, reqStatus, aLen);
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus.Int() != KErrNone)
+	return PJ_RETURN_OS_ERROR(reqStatus.Int());
+
+    //At least in UIQ Emulator, aLen.Length() reports incorrect length
+    //for UDP (some newlc.com users seem to have reported this too).
+    //*length = aLen.Length();
+    return PJ_SUCCESS;
+}
+
+PJ_DEF(pj_status_t) pj_ioqueue_set_concurrency(pj_ioqueue_key_t *key,
+											   pj_bool_t allow)
+{
+	/* Not supported, just return PJ_SUCCESS silently */
+	PJ_UNUSED_ARG(key);
+	PJ_UNUSED_ARG(allow);
+	return PJ_SUCCESS;
+}
+
+PJ_DEF(pj_status_t) pj_ioqueue_lock_key(pj_ioqueue_key_t *key)
+{
+	/* Not supported, just return PJ_SUCCESS silently */
+	PJ_UNUSED_ARG(key);
+	return PJ_SUCCESS;
+}
+
+PJ_DEF(pj_status_t) pj_ioqueue_unlock_key(pj_ioqueue_key_t *key)
+{
+	/* Not supported, just return PJ_SUCCESS silently */
+	PJ_UNUSED_ARG(key);
+	return PJ_SUCCESS;
+}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_winnt.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_winnt.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ioqueue_winnt.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ioqueue_winnt.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_generic.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ip_helper_generic.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_generic.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ip_helper_generic.c
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ip_helper_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ip_helper_symbian.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9f634a0b8b152df42b2736a63ca1a612d8028edb
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ip_helper_symbian.cpp
@@ -0,0 +1,150 @@
+/* $Id: ip_helper_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pj/ip_helper.h>
+#include <pj/addr_resolv.h>
+#include <pj/assert.h>
+#include <pj/errno.h>
+#include <pj/log.h>
+#include <pj/string.h>
+#include <pj/compat/socket.h>
+
+
+#include "os_symbian.h"
+
+#define THIS_FILE	"ip_helper_symbian.cpp"
+#define TRACE_ME	0
+
+static pj_status_t rsock_enum_interface(int af,
+					unsigned *p_cnt,
+					pj_sockaddr ifs[]) 
+{
+    TInt rc;
+    RSocket rSock;
+    TPckgBuf<TSoInetInterfaceInfo> info;
+    unsigned i;
+    
+    if (PjSymbianOS::Instance()->Connection()) {
+    	
+    	rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), 
+    			af, PJ_SOCK_DGRAM, KProtocolInetUdp,
+    			*PjSymbianOS::Instance()->Connection());
+    } else {
+    	
+    	rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), 
+    			af, PJ_SOCK_DGRAM, KProtocolInetUdp);
+    			
+    }
+        
+    if (rc != KErrNone)
+	return PJ_RETURN_OS_ERROR(rc);
+    
+    rSock.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl);
+    
+    for (i=0; i<*p_cnt &&
+    		rSock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, 
+    		             info) == KErrNone; ) 
+    {
+    	TInetAddr &iAddress = info().iAddress;
+    	int namelen;
+
+#if TRACE_ME
+		if (1) {
+			pj_sockaddr a;
+			char ipaddr[PJ_INET6_ADDRSTRLEN+2];
+			
+			namelen = sizeof(pj_sockaddr);
+			if (PjSymbianOS::Addr2pj(iAddress, a, &namelen, 
+									 PJ_FALSE) == PJ_SUCCESS) 
+			{
+				PJ_LOG(5,(THIS_FILE, "Enum: found address %s", 
+						pj_sockaddr_print(&a, ipaddr, sizeof(ipaddr), 2)));
+			}
+		}
+#endif
+    	
+    	namelen = sizeof(ifs[i]);
+    	if (PjSymbianOS::Addr2pj(iAddress, ifs[i], &namelen, 
+    							 PJ_TRUE) != PJ_SUCCESS)
+    	{
+    	    continue;
+    	}
+
+    	if (ifs[i].addr.sa_family != af)
+		    continue;
+    	
+    	++i;
+    }
+    
+    rSock.Close();
+    
+    // Done
+    *p_cnt = i;
+    
+    return PJ_SUCCESS;
+}
+					
+/*
+ * Enumerate the local IP interface currently active in the host.
+ */
+PJ_DEF(pj_status_t) pj_enum_ip_interface(int af,
+					 unsigned *p_cnt,
+					 pj_sockaddr ifs[])
+{
+    unsigned start;
+    pj_status_t status = PJ_SUCCESS;
+
+    start = 0;
+    	    
+    /* Get IPv6 interface first. */
+    if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) {
+    	unsigned max = *p_cnt;
+    	status = rsock_enum_interface(PJ_AF_INET6, &max, &ifs[start]);
+    	if (status == PJ_SUCCESS) {
+    	    (*p_cnt) -= max;
+    	    start += max;
+    	}
+    }
+    
+    /* Get IPv4 interface. */
+    if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) {
+    	unsigned max = *p_cnt;
+    	status = rsock_enum_interface(PJ_AF_INET, &max, &ifs[start]);
+    	if (status == PJ_SUCCESS) {
+    	    (*p_cnt) -= max;
+    	    start += max;
+    	}
+    }
+    
+    *p_cnt = start;
+    
+    return start ? PJ_SUCCESS : PJ_ENOTFOUND;
+}
+
+/*
+ * Enumerate the IP routing table for this host.
+ */
+PJ_DEF(pj_status_t) pj_enum_ip_route(unsigned *p_cnt,
+				     pj_ip_route_entry routes[])
+{
+    PJ_ASSERT_RETURN(p_cnt && *p_cnt > 0 && routes, PJ_EINVAL);
+    *p_cnt = 0;
+    return PJ_ENOTSUP;
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ip_helper_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/ip_helper_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/ip_helper_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/list.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/list.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/list.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/list.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/lock.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/lock.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/lock.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/lock.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/log.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/log.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_printk.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/log_writer_printk.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_printk.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/log_writer_printk.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_stdout.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/log_writer_stdout.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_stdout.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/log_writer_stdout.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_symbian_console.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/log_writer_symbian_console.cpp
similarity index 78%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_symbian_console.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/log_writer_symbian_console.cpp
index 34d4a40254363c3c1b25142accf7622a4040f1da..8f627cf149067127f7bf0402c0268f77f748361d 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/log_writer_symbian_console.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/log_writer_symbian_console.cpp
@@ -1,5 +1,5 @@
 /* $Id: log_writer_symbian_console.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #include <pj/log.h>
 #include <pj/os.h>
@@ -24,21 +24,21 @@
 #include "os_symbian.h"
 #include <e32cons.h>
 
-PJ_DEF (void) pj_log_write (int level, const char *buffer, int len)
+PJ_DEF(void) pj_log_write(int level, const char *buffer, int len)
 {
 #if 0
     wchar_t wbuffer[PJ_LOG_MAX_SIZE];
     CConsoleBase *cons = PjSymbianOS::Instance->Console();
 
-    pj_ansi_to_unicode (buffer, len, wbuffer, PJ_ARRAY_SIZE (wbuffer));
+    pj_ansi_to_unicode(buffer, len, wbuffer, PJ_ARRAY_SIZE(wbuffer));
 
-
-    TPtrC16 aPtr ( (TUint16*) wbuffer, len);
-    console->Write (aPtr);
+    
+    TPtrC16 aPtr((TUint16*)wbuffer, len);
+    console->Write(aPtr);
 #else
-    PJ_UNUSED_ARG (level);
-    PJ_UNUSED_ARG (buffer);
-    PJ_UNUSED_ARG (len);
+    PJ_UNUSED_ARG(level);
+    PJ_UNUSED_ARG(buffer);
+    PJ_UNUSED_ARG(len);
 #endif
 }
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_core_linux_kernel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_linux_kernel.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_core_linux_kernel.c
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_core_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_core_symbian.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9f2d1e6958cf923d8f0f32718acebf575f6a83a1
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_core_symbian.cpp
@@ -0,0 +1,1028 @@
+/* $Id: os_core_symbian.cpp 2482 2009-03-02 15:50:12Z nanang $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pj/os.h>
+#include <pj/assert.h>
+#include <pj/pool.h>
+#include <pj/log.h>
+#include <pj/rand.h>
+#include <pj/string.h>
+#include <pj/guid.h>
+#include <pj/except.h>
+#include <pj/errno.h>
+
+#include "os_symbian.h"
+
+
+#define PJ_MAX_TLS	    32
+#define DUMMY_MUTEX	    ((pj_mutex_t*)101)
+#define DUMMY_SEMAPHORE	    ((pj_sem_t*)102)
+#define THIS_FILE	    "os_core_symbian.c"
+ 
+/*
+ * Note:
+ *
+ * The Symbian implementation does not support threading!
+ */ 
+
+struct pj_thread_t
+{
+    char	    obj_name[PJ_MAX_OBJ_NAME];
+    void	   *tls_values[PJ_MAX_TLS];
+
+#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0
+    pj_uint32_t	    stk_size;
+    pj_uint32_t	    stk_max_usage;
+    char	   *stk_start;
+    const char	   *caller_file;
+    int		    caller_line;
+#endif
+
+} main_thread;
+
+struct pj_atomic_t
+{
+    pj_atomic_value_t	value;
+};
+
+struct pj_sem_t
+{
+    int value;
+    int max;
+};
+
+/* Flags to indicate which TLS variables have been used */
+static int tls_vars[PJ_MAX_TLS];
+
+/* atexit handlers */
+static unsigned atexit_count;
+static void (*atexit_func[32])(void);
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// CPjTimeoutTimer implementation
+//
+
+CPjTimeoutTimer::CPjTimeoutTimer()
+: CActive(PJ_SYMBIAN_TIMER_PRIORITY), hasTimedOut_(PJ_FALSE)
+{
+}
+
+CPjTimeoutTimer::~CPjTimeoutTimer()
+{
+    Cancel();
+    timer_.Close();
+}
+
+void CPjTimeoutTimer::ConstructL()
+{
+    hasTimedOut_ = PJ_FALSE;
+    timer_.CreateLocal();
+    CActiveScheduler::Add(this);
+}
+
+CPjTimeoutTimer *CPjTimeoutTimer::NewL()
+{
+    CPjTimeoutTimer *self = new CPjTimeoutTimer;
+    CleanupStack::PushL(self);
+
+    self->ConstructL();
+
+    CleanupStack::Pop(self);
+    return self;
+
+}
+
+void CPjTimeoutTimer::StartTimer(TUint miliSeconds)
+{
+    Cancel();
+
+    hasTimedOut_ = PJ_FALSE;
+    timer_.After(iStatus, miliSeconds * 1000);
+    SetActive();
+}
+
+bool CPjTimeoutTimer::HasTimedOut() const
+{
+    return hasTimedOut_ != 0;
+}
+
+void CPjTimeoutTimer::RunL()
+{
+    hasTimedOut_ = PJ_TRUE;
+}
+
+void CPjTimeoutTimer::DoCancel()
+{
+    timer_.Cancel();
+}
+
+TInt CPjTimeoutTimer::RunError(TInt aError)
+{
+    PJ_UNUSED_ARG(aError);
+    return KErrNone;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// PjSymbianOS implementation
+//
+
+PjSymbianOS::PjSymbianOS()
+: isConnectionUp_(false),
+  isSocketServInitialized_(false), isResolverInitialized_(false),
+  console_(NULL), selectTimeoutTimer_(NULL),
+  appSocketServ_(NULL), appConnection_(NULL), appHostResolver_(NULL),
+  appHostResolver6_(NULL)
+{
+}
+
+// Set parameters
+void PjSymbianOS::SetParameters(pj_symbianos_params *params) 
+{
+    appSocketServ_ = (RSocketServ*) params->rsocketserv;
+    appConnection_ = (RConnection*) params->rconnection;
+    appHostResolver_ = (RHostResolver*) params->rhostresolver;
+    appHostResolver6_ = (RHostResolver*) params->rhostresolver6;
+}
+
+// Get PjSymbianOS instance
+PjSymbianOS *PjSymbianOS::Instance()
+{
+    static PjSymbianOS instance_;
+    return &instance_;
+}
+
+
+// Initialize
+TInt PjSymbianOS::Initialize()
+{
+    TInt err;
+
+    selectTimeoutTimer_ = CPjTimeoutTimer::NewL();
+
+#if 0
+    pj_assert(console_ == NULL);
+    TRAPD(err, console_ = Console::NewL(_L("PJLIB"), 
+				        TSize(KConsFullScreen,KConsFullScreen)));
+    return err;
+#endif
+
+    /* Only create RSocketServ if application doesn't specify it
+     * in the parameters
+     */
+    if (!isSocketServInitialized_ && appSocketServ_ == NULL) {
+	err = socketServ_.Connect();
+	if (err != KErrNone)
+	    goto on_error;
+
+	isSocketServInitialized_ = true;
+    }
+
+    if (!isResolverInitialized_) {
+    	if (appHostResolver_ == NULL) {
+    	    if (Connection())
+    	    	err = hostResolver_.Open(SocketServ(), KAfInet, KSockStream,
+    	    			     	 *Connection());
+    	    else
+	    	err = hostResolver_.Open(SocketServ(), KAfInet, KSockStream);
+    	
+	    if (err != KErrNone)
+	    	goto on_error;
+    	}
+    	
+#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0
+    	if (appHostResolver6_ == NULL) {
+    	    if (Connection())
+    	    	err = hostResolver6_.Open(SocketServ(), KAfInet6, KSockStream,
+    	    			     	  *Connection());
+    	    else
+	    	err = hostResolver6_.Open(SocketServ(), KAfInet6, KSockStream);
+    	
+	    if (err != KErrNone)
+	    	goto on_error;
+    	}
+#endif
+    	
+    	
+	isResolverInitialized_ = true;
+    }
+
+    isConnectionUp_ = true;
+    
+    return KErrNone;
+
+on_error:
+    Shutdown();
+    return err;
+}
+
+// Shutdown
+void PjSymbianOS::Shutdown()
+{
+    isConnectionUp_ = false;
+    
+    if (isResolverInitialized_) {
+		hostResolver_.Close();
+#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0
+    	hostResolver6_.Close();
+#endif
+    	isResolverInitialized_ = false;
+    }
+
+    if (isSocketServInitialized_) {
+	socketServ_.Close();
+	isSocketServInitialized_ = false;
+    }
+
+    delete console_;
+    console_ = NULL;
+
+    delete selectTimeoutTimer_;
+    selectTimeoutTimer_ = NULL;
+    
+    appSocketServ_ = NULL;
+    appConnection_ = NULL;
+    appHostResolver_ = NULL;
+    appHostResolver6_ = NULL;
+}
+
+// Convert to Unicode
+TInt PjSymbianOS::ConvertToUnicode(TDes16 &aUnicode, const TDesC8 &aForeign)
+{
+#if 0
+    pj_assert(conv_ != NULL);
+    return conv_->ConvertToUnicode(aUnicode, aForeign, convToUnicodeState_);
+#else
+    return CnvUtfConverter::ConvertToUnicodeFromUtf8(aUnicode, aForeign);
+#endif
+}
+
+// Convert from Unicode
+TInt PjSymbianOS::ConvertFromUnicode(TDes8 &aForeign, const TDesC16 &aUnicode)
+{
+#if 0
+    pj_assert(conv_ != NULL);
+    return conv_->ConvertFromUnicode(aForeign, aUnicode, convToAnsiState_);
+#else
+    return CnvUtfConverter::ConvertFromUnicodeToUtf8(aForeign, aUnicode);
+#endif
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// PJLIB os.h implementation
+//
+
+PJ_DEF(pj_uint32_t) pj_getpid(void)
+{
+    return 0;
+}
+
+
+/* Set Symbian specific parameters */
+PJ_DEF(pj_status_t) pj_symbianos_set_params(pj_symbianos_params *prm) 
+{
+    PJ_ASSERT_RETURN(prm != NULL, PJ_EINVAL);
+    PjSymbianOS::Instance()->SetParameters(prm);
+    return PJ_SUCCESS;
+}
+
+
+/* Set connection status */
+PJ_DEF(void) pj_symbianos_set_connection_status(pj_bool_t up)
+{
+    PjSymbianOS::Instance()->SetConnectionStatus(up != 0);
+}
+
+
+/*
+ * pj_init(void).
+ * Init PJLIB!
+ */
+PJ_DEF(pj_status_t) pj_init(void)
+{
+	char stack_ptr;
+    pj_status_t status;
+    
+    pj_ansi_strcpy(main_thread.obj_name, "pjthread");
+
+    // Init main thread
+    pj_memset(&main_thread, 0, sizeof(main_thread));
+
+    // Initialize PjSymbianOS instance
+    PjSymbianOS *os = PjSymbianOS::Instance();
+
+    PJ_LOG(4,(THIS_FILE, "Initializing PJLIB for Symbian OS.."));
+
+    TInt err; 
+    err = os->Initialize();
+    if (err != KErrNone)
+    	return PJ_RETURN_OS_ERROR(err);
+    
+    /* 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)
+        goto on_error;
+
+#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0
+    main_thread.stk_start = &stack_ptr;
+    main_thread.stk_size = 0xFFFFFFFFUL;
+    main_thread.stk_max_usage = 0;
+#else
+    stack_ptr = '\0';
+#endif
+
+    PJ_LOG(5,(THIS_FILE, "PJLIB initialized."));
+    return PJ_SUCCESS;
+
+on_error:
+    pj_shutdown();
+    return PJ_RETURN_OS_ERROR(err);
+}
+
+
+PJ_DEF(pj_status_t) pj_atexit(pj_exit_callback func)
+{
+    if (atexit_count >= PJ_ARRAY_SIZE(atexit_func))
+	return PJ_ETOOMANY;
+
+    atexit_func[atexit_count++] = func;
+    return PJ_SUCCESS;
+}
+
+
+
+PJ_DEF(void) pj_shutdown(void)
+{
+    /* Call atexit() functions */
+    while (atexit_count > 0) {
+	(*atexit_func[atexit_count-1])();
+	--atexit_count;
+    }
+
+    /* Free exception ID */
+    if (PJ_NO_MEMORY_EXCEPTION != -1) {
+	pj_exception_id_free(PJ_NO_MEMORY_EXCEPTION);
+	PJ_NO_MEMORY_EXCEPTION = -1;
+    }
+
+    /* Clear static variables */
+    pj_errno_clear_handlers();
+
+    PjSymbianOS *os = PjSymbianOS::Instance();
+    os->Shutdown();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+class CPollTimeoutTimer : public CActive 
+{
+public:
+    static CPollTimeoutTimer* NewL(int msec, TInt prio);
+    ~CPollTimeoutTimer();
+    
+    virtual void RunL();
+    virtual void DoCancel();
+
+private:	
+    RTimer	     rtimer_;
+    
+    explicit CPollTimeoutTimer(TInt prio);
+    void ConstructL(int msec);
+};
+
+CPollTimeoutTimer::CPollTimeoutTimer(TInt prio)
+: CActive(prio)
+{
+}
+
+
+CPollTimeoutTimer::~CPollTimeoutTimer() 
+{
+    rtimer_.Close();
+}
+
+void CPollTimeoutTimer::ConstructL(int msec) 
+{
+    rtimer_.CreateLocal();
+    CActiveScheduler::Add(this);
+    rtimer_.After(iStatus, msec*1000);
+    SetActive();
+}
+
+CPollTimeoutTimer* CPollTimeoutTimer::NewL(int msec, TInt prio) 
+{
+    CPollTimeoutTimer *self = new CPollTimeoutTimer(prio);
+    CleanupStack::PushL(self);
+    self->ConstructL(msec);    
+    CleanupStack::Pop(self);
+
+    return self;
+}
+
+void CPollTimeoutTimer::RunL() 
+{
+}
+
+void CPollTimeoutTimer::DoCancel() 
+{
+     rtimer_.Cancel();
+}
+
+
+/*
+ * Wait the completion of any Symbian active objects. 
+ */
+PJ_DEF(pj_bool_t) pj_symbianos_poll(int priority, int ms_timeout)
+{
+    CPollTimeoutTimer *timer = NULL;
+    
+    if (priority==-1)
+    	priority = EPriorityNull;
+    
+    if (ms_timeout >= 0) {
+    	timer = CPollTimeoutTimer::NewL(ms_timeout, priority);
+    }
+    
+    PjSymbianOS::Instance()->WaitForActiveObjects(priority);
+    
+    if (timer) {
+        bool timer_is_active = timer->IsActive();
+    
+	timer->Cancel();
+        
+        delete timer;
+        
+    	return timer_is_active ? PJ_TRUE : PJ_FALSE;
+    	
+    } else {
+    	return PJ_TRUE;
+    }
+}
+
+
+/*
+ * pj_thread_is_registered()
+ */
+PJ_DEF(pj_bool_t) pj_thread_is_registered(void)
+{
+    return PJ_FALSE;
+}
+
+
+/*
+ * Get thread priority value for the thread.
+ */
+PJ_DEF(int) pj_thread_get_prio(pj_thread_t *thread)
+{
+    PJ_UNUSED_ARG(thread);
+    return 1;
+}
+
+
+/*
+ * Set the thread priority.
+ */
+PJ_DEF(pj_status_t) pj_thread_set_prio(pj_thread_t *thread,  int prio)
+{
+    PJ_UNUSED_ARG(thread);
+    PJ_UNUSED_ARG(prio);
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Get the lowest priority value available on this system.
+ */
+PJ_DEF(int) pj_thread_get_prio_min(pj_thread_t *thread)
+{
+    PJ_UNUSED_ARG(thread);
+    return 1;
+}
+
+
+/*
+ * Get the highest priority value available on this system.
+ */
+PJ_DEF(int) pj_thread_get_prio_max(pj_thread_t *thread)
+{
+    PJ_UNUSED_ARG(thread);
+    return 1;
+}
+
+
+/*
+ * pj_thread_get_os_handle()
+ */
+PJ_DEF(void*) pj_thread_get_os_handle(pj_thread_t *thread) 
+{
+    PJ_UNUSED_ARG(thread);
+    return NULL;
+}
+
+/*
+ * pj_thread_register(..)
+ */
+PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name,
+					 pj_thread_desc desc,
+                                         pj_thread_t **thread_ptr)
+{
+    PJ_UNUSED_ARG(cstr_thread_name);
+    PJ_UNUSED_ARG(desc);
+    PJ_UNUSED_ARG(thread_ptr);
+    return PJ_EINVALIDOP;
+}
+
+
+/*
+ * pj_thread_create(...)
+ */
+PJ_DEF(pj_status_t) pj_thread_create( pj_pool_t *pool, 
+				      const char *thread_name,
+				      pj_thread_proc *proc, 
+				      void *arg,
+				      pj_size_t stack_size, 
+				      unsigned flags,
+				      pj_thread_t **ptr_thread)
+{
+    PJ_UNUSED_ARG(pool);
+    PJ_UNUSED_ARG(thread_name);
+    PJ_UNUSED_ARG(proc);
+    PJ_UNUSED_ARG(arg);
+    PJ_UNUSED_ARG(stack_size);
+    PJ_UNUSED_ARG(flags);
+    PJ_UNUSED_ARG(ptr_thread);
+
+    /* Sorry mate, we don't support threading */
+    return PJ_ENOTSUP;
+}
+
+/*
+ * pj_thread-get_name()
+ */
+PJ_DEF(const char*) pj_thread_get_name(pj_thread_t *p)
+{
+    pj_assert(p == &main_thread);
+    return p->obj_name;
+}
+
+/*
+ * pj_thread_resume()
+ */
+PJ_DEF(pj_status_t) pj_thread_resume(pj_thread_t *p)
+{
+    PJ_UNUSED_ARG(p);
+    return PJ_EINVALIDOP;
+}
+
+/*
+ * pj_thread_this()
+ */
+PJ_DEF(pj_thread_t*) pj_thread_this(void)
+{
+    return &main_thread;
+}
+
+/*
+ * pj_thread_join()
+ */
+PJ_DEF(pj_status_t) pj_thread_join(pj_thread_t *rec)
+{
+    PJ_UNUSED_ARG(rec);
+    return PJ_EINVALIDOP;
+}
+
+/*
+ * pj_thread_destroy()
+ */
+PJ_DEF(pj_status_t) pj_thread_destroy(pj_thread_t *rec)
+{
+    PJ_UNUSED_ARG(rec);
+    return PJ_EINVALIDOP;
+}
+
+/*
+ * pj_thread_sleep()
+ */
+PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec)
+{
+    User::After(msec*1000);
+
+    return PJ_SUCCESS;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+/*
+ * pj_thread_local_alloc()
+ */
+
+PJ_DEF(pj_status_t) pj_thread_local_alloc(long *index)
+{
+    unsigned i;
+
+    /* Find unused TLS variable */
+    for (i=0; i<PJ_ARRAY_SIZE(tls_vars); ++i) {
+	if (tls_vars[i] == 0)
+	    break;
+    }
+
+    if (i == PJ_ARRAY_SIZE(tls_vars))
+	return PJ_ETOOMANY;
+
+    tls_vars[i] = 1;
+    *index = i;
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * pj_thread_local_free()
+ */
+PJ_DEF(void) pj_thread_local_free(long index)
+{
+    PJ_ASSERT_ON_FAIL(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) &&
+		     tls_vars[index] != 0, return);
+
+    tls_vars[index] = 0;
+}
+
+
+/*
+ * pj_thread_local_set()
+ */
+PJ_DEF(pj_status_t) pj_thread_local_set(long index, void *value)
+{
+    pj_thread_t *rec = pj_thread_this();
+
+    PJ_ASSERT_RETURN(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) &&
+		     tls_vars[index] != 0, PJ_EINVAL);
+
+    rec->tls_values[index] = value;
+    return PJ_SUCCESS;
+}
+
+/*
+ * pj_thread_local_get()
+ */
+PJ_DEF(void*) pj_thread_local_get(long index)
+{
+    pj_thread_t *rec = pj_thread_this();
+
+    PJ_ASSERT_RETURN(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) &&
+		     tls_vars[index] != 0, NULL);
+
+    return rec->tls_values[index];
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+/*
+ * Create atomic variable.
+ */
+PJ_DEF(pj_status_t) pj_atomic_create( pj_pool_t *pool, 
+				      pj_atomic_value_t initial,
+				      pj_atomic_t **atomic )
+{
+    *atomic = (pj_atomic_t*)pj_pool_alloc(pool, sizeof(struct pj_atomic_t));
+    (*atomic)->value = initial;
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Destroy atomic variable.
+ */
+PJ_DEF(pj_status_t) pj_atomic_destroy( pj_atomic_t *atomic_var )
+{
+    PJ_UNUSED_ARG(atomic_var);
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Set the value of an atomic type, and return the previous value.
+ */
+PJ_DEF(void) pj_atomic_set( pj_atomic_t *atomic_var, 
+			    pj_atomic_value_t value)
+{
+    atomic_var->value = value;
+}
+
+
+/*
+ * Get the value of an atomic type.
+ */
+PJ_DEF(pj_atomic_value_t) pj_atomic_get(pj_atomic_t *atomic_var)
+{
+    return atomic_var->value;
+}
+
+
+/*
+ * Increment the value of an atomic type.
+ */
+PJ_DEF(void) pj_atomic_inc(pj_atomic_t *atomic_var)
+{
+    ++atomic_var->value;
+}
+
+
+/*
+ * Increment the value of an atomic type and get the result.
+ */
+PJ_DEF(pj_atomic_value_t) pj_atomic_inc_and_get(pj_atomic_t *atomic_var)
+{
+    return ++atomic_var->value;
+}
+
+
+/*
+ * Decrement the value of an atomic type.
+ */
+PJ_DEF(void) pj_atomic_dec(pj_atomic_t *atomic_var)
+{
+    --atomic_var->value;
+}	
+
+
+/*
+ * Decrement the value of an atomic type and get the result.
+ */
+PJ_DEF(pj_atomic_value_t) pj_atomic_dec_and_get(pj_atomic_t *atomic_var)
+{
+    return --atomic_var->value;
+}
+
+
+/*
+ * Add a value to an atomic type.
+ */
+PJ_DEF(void) pj_atomic_add( pj_atomic_t *atomic_var,
+			    pj_atomic_value_t value)
+{
+    atomic_var->value += value;
+}
+
+
+/*
+ * Add a value to an atomic type and get the result.
+ */
+PJ_DEF(pj_atomic_value_t) pj_atomic_add_and_get( pj_atomic_t *atomic_var,
+			                         pj_atomic_value_t value)
+{
+    atomic_var->value += value;
+    return atomic_var->value;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+PJ_DEF(pj_status_t) pj_mutex_create( pj_pool_t *pool, 
+                                     const char *name,
+				     int type, 
+                                     pj_mutex_t **mutex)
+{
+    PJ_UNUSED_ARG(pool);
+    PJ_UNUSED_ARG(name);
+    PJ_UNUSED_ARG(type);
+
+    *mutex = DUMMY_MUTEX;
+    return PJ_SUCCESS;
+}
+
+/*
+ * pj_mutex_create_simple()
+ */
+PJ_DEF(pj_status_t) pj_mutex_create_simple( pj_pool_t *pool, 
+                                            const char *name,
+					    pj_mutex_t **mutex )
+{
+    return pj_mutex_create(pool, name, PJ_MUTEX_SIMPLE, mutex);
+}
+
+
+PJ_DEF(pj_status_t) pj_mutex_create_recursive( pj_pool_t *pool,
+					       const char *name,
+					       pj_mutex_t **mutex )
+{
+    return pj_mutex_create(pool, name, PJ_MUTEX_RECURSE, mutex);
+}
+
+
+/*
+ * pj_mutex_lock()
+ */
+PJ_DEF(pj_status_t) pj_mutex_lock(pj_mutex_t *mutex)
+{
+    pj_assert(mutex == DUMMY_MUTEX);
+    return PJ_SUCCESS;
+}
+
+/*
+ * pj_mutex_trylock()
+ */
+PJ_DEF(pj_status_t) pj_mutex_trylock(pj_mutex_t *mutex)
+{
+    pj_assert(mutex == DUMMY_MUTEX);
+    return PJ_SUCCESS;
+}
+
+/*
+ * pj_mutex_unlock()
+ */
+PJ_DEF(pj_status_t) pj_mutex_unlock(pj_mutex_t *mutex)
+{
+    pj_assert(mutex == DUMMY_MUTEX);
+    return PJ_SUCCESS;
+}
+
+/*
+ * pj_mutex_destroy()
+ */
+PJ_DEF(pj_status_t) pj_mutex_destroy(pj_mutex_t *mutex)
+{
+    pj_assert(mutex == DUMMY_MUTEX);
+    return PJ_SUCCESS;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+/*
+ * RW Mutex
+ */
+#include "os_rwmutex.c"
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+/*
+ * Enter critical section.
+ */
+PJ_DEF(void) pj_enter_critical_section(void)
+{
+    /* Nothing to do */
+}
+
+
+/*
+ * Leave critical section.
+ */
+PJ_DEF(void) pj_leave_critical_section(void)
+{
+    /* Nothing to do */
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+/*
+ * Create semaphore.
+ */
+PJ_DEF(pj_status_t) pj_sem_create( pj_pool_t *pool, 
+                                   const char *name,
+				   unsigned initial, 
+                                   unsigned max,
+				   pj_sem_t **p_sem)
+{
+    pj_sem_t *sem;
+ 
+    PJ_UNUSED_ARG(name);
+
+    sem = (pj_sem_t*) pj_pool_zalloc(pool, sizeof(pj_sem_t));
+    sem->value = initial;
+    sem->max = max;
+
+    *p_sem = sem;
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Wait for semaphore.
+ */
+PJ_DEF(pj_status_t) pj_sem_wait(pj_sem_t *sem)
+{
+    if (sem->value > 0) {
+	sem->value--;
+	return PJ_SUCCESS;
+    } else {
+	pj_assert(!"Unexpected!");
+	return PJ_EINVALIDOP;
+    }
+}
+
+
+/*
+ * Try wait for semaphore.
+ */
+PJ_DEF(pj_status_t) pj_sem_trywait(pj_sem_t *sem)
+{
+    if (sem->value > 0) {
+	sem->value--;
+	return PJ_SUCCESS;
+    } else {
+	pj_assert(!"Unexpected!");
+	return PJ_EINVALIDOP;
+    }
+}
+
+
+/*
+ * Release semaphore.
+ */
+PJ_DEF(pj_status_t) pj_sem_post(pj_sem_t *sem)
+{
+    sem->value++;
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Destroy semaphore.
+ */
+PJ_DEF(pj_status_t) pj_sem_destroy(pj_sem_t *sem)
+{
+    PJ_UNUSED_ARG(sem);
+    return PJ_SUCCESS;
+}
+
+
+#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK != 0
+/*
+ * The implementation of stack checking. 
+ */
+PJ_DEF(void) pj_thread_check_stack(const char *file, int line)
+{
+    char stk_ptr;
+    pj_uint32_t usage;
+    pj_thread_t *thread = pj_thread_this();
+
+    pj_assert(thread);
+
+    /* Calculate current usage. */
+    usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start :
+		thread->stk_start - &stk_ptr;
+
+    /* Assert if stack usage is dangerously high. */
+    pj_assert("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128));
+
+    /* Keep statistic. */
+    if (usage > thread->stk_max_usage) {
+	thread->stk_max_usage = usage;
+	thread->caller_file = file;
+	thread->caller_line = line;
+    }
+}
+
+/*
+ * Get maximum stack usage statistic. 
+ */
+PJ_DEF(pj_uint32_t) pj_thread_get_stack_max_usage(pj_thread_t *thread)
+{
+    return thread->stk_max_usage;
+}
+
+/*
+ * Dump thread stack status. 
+ */
+PJ_DEF(pj_status_t) pj_thread_get_stack_info(pj_thread_t *thread,
+					     const char **file,
+					     int *line)
+{
+    pj_assert(thread);
+
+    *file = thread->caller_file;
+    *line = thread->caller_line;
+    return 0;
+}
+
+#endif	/* PJ_OS_HAS_CHECK_STACK */
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_unix.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_core_unix.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_unix.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_core_unix.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_core_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_core_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_core_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_error_linux_kernel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_linux_kernel.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_error_linux_kernel.c
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_error_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_error_symbian.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..31707b97c377903df1c5561cdbcda4101e5b935c
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_error_symbian.cpp
@@ -0,0 +1,172 @@
+/* $Id: os_error_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pj/errno.h>
+#include <pj/assert.h>
+#include <pj/compat/stdarg.h>
+#include <pj/unicode.h>
+#include <pj/string.h>
+
+#include <e32err.h>
+#include <in_sock.h>
+
+
+#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0)
+static const struct {
+    pj_os_err_type code;
+    const char *msg;
+} gaErrorList[] = {
+    /*
+     * Generic error -1 to -46
+     */
+    PJ_BUILD_ERR( KErrNotFound,	    "Unable to find the specified object"),
+    PJ_BUILD_ERR( KErrGeneral,	    "General (unspecified) error"),
+    PJ_BUILD_ERR( KErrCancel,	    "The operation was cancelled"),
+    PJ_BUILD_ERR( KErrNoMemory,	    "Not enough memory"),
+    PJ_BUILD_ERR( KErrNotSupported, "The operation requested is not supported"),
+    PJ_BUILD_ERR( KErrArgument,	    "Bad request"),
+    PJ_BUILD_ERR( KErrTotalLossOfPrecision, "Total loss of precision"),
+    PJ_BUILD_ERR( KErrBadHandle,    "Bad object"),
+    PJ_BUILD_ERR( KErrOverflow,	    "Overflow"),
+    PJ_BUILD_ERR( KErrUnderflow,    "Underflow"),
+    PJ_BUILD_ERR( KErrAlreadyExists,"Already exists"),
+    PJ_BUILD_ERR( KErrPathNotFound, "Unable to find the specified folder"),
+    PJ_BUILD_ERR( KErrDied,	    "Closed"),
+    PJ_BUILD_ERR( KErrInUse,	    "The specified object is currently in use by another program"),
+    PJ_BUILD_ERR( KErrServerTerminated,	    "Server has closed"),
+    PJ_BUILD_ERR( KErrServerBusy,   "Server busy"),
+    PJ_BUILD_ERR( KErrCompletion,   "Completion error"),
+    PJ_BUILD_ERR( KErrNotReady,	    "Not ready"),
+    PJ_BUILD_ERR( KErrUnknown,	    "Unknown error"),
+    PJ_BUILD_ERR( KErrCorrupt,	    "Corrupt"),
+    PJ_BUILD_ERR( KErrAccessDenied, "Access denied"),
+    PJ_BUILD_ERR( KErrLocked,	    "Locked"),
+    PJ_BUILD_ERR( KErrWrite,	    "Failed to write"),
+    PJ_BUILD_ERR( KErrDisMounted,   "Wrong disk present"),
+    PJ_BUILD_ERR( KErrEof,	    "Unexpected end of file"),
+    PJ_BUILD_ERR( KErrDiskFull,	    "Disk full"),
+    PJ_BUILD_ERR( KErrBadDriver,    "Bad device driver"),
+    PJ_BUILD_ERR( KErrBadName,	    "Bad name"),
+    PJ_BUILD_ERR( KErrCommsLineFail,"Comms line failed"),
+    PJ_BUILD_ERR( KErrCommsFrame,   "Comms frame error"),
+    PJ_BUILD_ERR( KErrCommsOverrun, "Comms overrun error"),
+    PJ_BUILD_ERR( KErrCommsParity,  "Comms parity error"),
+    PJ_BUILD_ERR( KErrTimedOut,	    "Timed out"),
+    PJ_BUILD_ERR( KErrCouldNotConnect, "Failed to connect"),
+    PJ_BUILD_ERR( KErrCouldNotDisconnect, "Failed to disconnect"),
+    PJ_BUILD_ERR( KErrDisconnected, "Disconnected"),
+    PJ_BUILD_ERR( KErrBadLibraryEntryPoint, "Bad library entry point"),
+    PJ_BUILD_ERR( KErrBadDescriptor,"Bad descriptor"),
+    PJ_BUILD_ERR( KErrAbort,	    "Interrupted"),
+    PJ_BUILD_ERR( KErrTooBig,	    "Too big"),
+    PJ_BUILD_ERR( KErrDivideByZero, "Divide by zero"),
+    PJ_BUILD_ERR( KErrBadPower,	    "Batteries too low"),
+    PJ_BUILD_ERR( KErrDirFull,	    "Folder full"),
+    PJ_BUILD_ERR( KErrHardwareNotAvailable, ""),
+    PJ_BUILD_ERR( KErrSessionClosed,	    ""),
+    PJ_BUILD_ERR( KErrPermissionDenied,     ""),
+
+    /*
+     * Socket errors (-190 - -1000)
+     */
+    PJ_BUILD_ERR( KErrNetUnreach,   "Could not connect to the network. Currently unreachable"),
+    PJ_BUILD_ERR( KErrHostUnreach,  "Could not connect to the specified server"),
+    PJ_BUILD_ERR( KErrNoProtocolOpt,"The specified server refuses the selected protocol"),
+    PJ_BUILD_ERR( KErrUrgentData,   ""),
+    PJ_BUILD_ERR( KErrWouldBlock,   "Conflicts with KErrExtended, but cannot occur in practice"),
+
+    {0, NULL}
+};
+
+#endif	/* PJ_HAS_ERROR_STRING */
+
+
+PJ_DEF(pj_status_t) pj_get_os_error(void)
+{
+    return -1;
+}
+
+PJ_DEF(void) pj_set_os_error(pj_status_t code)
+{
+    PJ_UNUSED_ARG(code);
+}
+
+PJ_DEF(pj_status_t) pj_get_netos_error(void)
+{
+    return -1;
+}
+
+PJ_DEF(void) pj_set_netos_error(pj_status_t code)
+{
+    PJ_UNUSED_ARG(code);
+}
+
+PJ_BEGIN_DECL
+
+    PJ_DECL(int) platform_strerror( pj_os_err_type os_errcode, 
+                       		    char *buf, pj_size_t bufsize);
+PJ_END_DECL
+
+/* 
+ * platform_strerror()
+ *
+ * Platform specific error message. This file is called by pj_strerror() 
+ * in errno.c 
+ */
+PJ_DEF(int) platform_strerror( pj_os_err_type os_errcode, 
+			       char *buf, pj_size_t bufsize)
+{
+    int len = 0;
+
+    pj_assert(buf != NULL);
+    pj_assert(bufsize >= 0);
+
+    /*
+     * MUST NOT check stack here.
+     * This function might be called from PJ_CHECK_STACK() itself!
+       //PJ_CHECK_STACK();
+     */
+
+    if (!len) {
+#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0)
+	int i;
+        for (i = 0; gaErrorList[i].msg; ++i) {
+            if (gaErrorList[i].code == os_errcode) {
+                len = strlen(gaErrorList[i].msg);
+		if ((pj_size_t)len >= bufsize) {
+		    len = bufsize-1;
+		}
+		pj_memcpy(buf, gaErrorList[i].msg, len);
+		buf[len] = '\0';
+                break;
+            }
+        }
+#endif	/* PJ_HAS_ERROR_STRING */
+
+    }
+
+    if (!len) {
+	len = pj_ansi_snprintf( buf, bufsize, "Symbian native error %d", 
+				os_errcode);
+	buf[len] = '\0';
+    }
+
+    return len;
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_unix.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_error_unix.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_unix.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_error_unix.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_error_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_error_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_error_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_rwmutex.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_rwmutex.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_rwmutex.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_rwmutex.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_symbian.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_symbian.h
similarity index 95%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_symbian.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_symbian.h
index 9c01516fa7cf9ef09b80e34513e7ab6df90841d3..54d8a8011309e04b3bb741efc6ad5ef9eea80743 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_symbian.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_symbian.h
@@ -1,4 +1,4 @@
-/* $Id: os_symbian.h 2482 2009-03-02 15:50:12Z nanang $ */
+/* $Id: os_symbian.h 2804 2009-06-25 12:26:15Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -54,8 +54,9 @@ public:
     };
 
     // Construct CPjSocket
-    CPjSocket(int af, RSocket &sock)
-	: af_(af), sock_(sock), connected_(false), sockReader_(NULL)
+    CPjSocket(int af, int sock_type, RSocket &sock)
+	: af_(af), sock_(sock), sock_type_(sock_type), connected_(false), 
+	  sockReader_(NULL)
     { 
     }
 
@@ -86,6 +87,18 @@ public:
 	connected_ = connected;
     }
 
+    // Get socket type
+    int GetSockType() const
+    {
+	return sock_type_;
+    }
+    
+    // Returns true if socket is a datagram
+    bool IsDatagram() const
+    {
+	return sock_type_ == KSockDatagram;
+    }
+    
     // Get socket reader, if any.
     // May return NULL.
     CPjSocketReader *Reader()
@@ -103,6 +116,8 @@ private:
     int		     af_;
     RSocket	     sock_;	    // Must not be reference, or otherwise
 				    // it may point to local variable!
+    unsigned   	     sock_type_;
+    
     bool	     connected_;
     CPjSocketReader *sockReader_;
 };
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_bsd.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_bsd.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_bsd.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_bsd.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_common.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_common.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_common.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_common.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_linux_kernel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_linux_kernel.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_linux_kernel.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_unix.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_unix.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_time_unix.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_unix.c
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_win32.c
new file mode 100644
index 0000000000000000000000000000000000000000..2fe985c56981fca47fe0eac74638bcff0595980d
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_time_win32.c
@@ -0,0 +1,303 @@
+/* $Id: os_time_win32.c 2805 2009-06-25 12:29:04Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pj/os.h>
+#include <pj/string.h>
+#include <pj/log.h>
+#include <windows.h>
+
+///////////////////////////////////////////////////////////////////////////////
+
+#define SECS_TO_FT_MULT 10000000
+
+static LARGE_INTEGER base_time;
+
+#if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE
+#   define WINCE_TIME
+#endif
+
+#ifdef WINCE_TIME
+/* Note:
+ *  In Windows CE/Windows Mobile platforms, the availability of milliseconds
+ *  time resolution in SYSTEMTIME.wMilliseconds depends on the OEM, and most
+ *  likely it won't be available. When it's not available, the 
+ *  SYSTEMTIME.wMilliseconds will contain a constant arbitrary value.
+ *
+ *  Because of that, we need to emulate the milliseconds time resolution
+ *  using QueryPerformanceCounter() (via pj_get_timestamp() API). However 
+ *  there is limitation on using this, i.e. the time returned by 
+ *  pj_gettimeofday() may be off by up to plus/minus 999 msec (the second
+ *  part will be correct, however the msec part may be off), because we're 
+ *  not synchronizing the msec field with the change of value of the "second"
+ *  field of the system time.
+ *
+ *  Also there is other caveat which need to be handled (and they are 
+ *  handled by this implementation):
+ *   - user may change system time, so pj_gettimeofday() needs to periodically
+ *     checks if system time has changed. The period on which system time is
+ *     checked is controlled by PJ_WINCE_TIME_CHECK_INTERVAL macro.
+ */
+static LARGE_INTEGER g_start_time;  /* Time gettimeofday() is first called  */
+static pj_timestamp  g_start_tick;  /* TS gettimeofday() is first called  */
+static pj_timestamp  g_last_update; /* Last time check_system_time() is 
+				       called, to periodically synchronize
+				       with up-to-date system time (in case
+				       user changes system time).	    */
+static pj_uint64_t   g_update_period; /* Period (in TS) check_system_time()
+				         should be called.		    */
+
+/* Period on which check_system_time() is called, in seconds		    */
+#ifndef PJ_WINCE_TIME_CHECK_INTERVAL
+#   define PJ_WINCE_TIME_CHECK_INTERVAL (10)
+#endif
+
+#endif
+
+#ifdef WINCE_TIME
+static pj_status_t init_start_time(void)
+{
+    SYSTEMTIME st;
+    FILETIME ft;
+    pj_timestamp freq;
+    pj_status_t status;
+
+    GetLocalTime(&st);
+    SystemTimeToFileTime(&st, &ft);
+
+    g_start_time.LowPart = ft.dwLowDateTime;
+    g_start_time.HighPart = ft.dwHighDateTime;
+    g_start_time.QuadPart /= SECS_TO_FT_MULT;
+    g_start_time.QuadPart -= base_time.QuadPart;
+
+    status = pj_get_timestamp(&g_start_tick);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    g_last_update.u64 = g_start_tick.u64;
+
+    status = pj_get_timestamp_freq(&freq);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    g_update_period = PJ_WINCE_TIME_CHECK_INTERVAL * freq.u64;
+
+    PJ_LOG(4,("os_time_win32.c", "WinCE time (re)started"));
+
+    return PJ_SUCCESS;
+}
+
+static pj_status_t check_system_time(pj_uint64_t ts_elapsed)
+{
+    enum { MIS = 5 };
+    SYSTEMTIME st;
+    FILETIME ft;
+    LARGE_INTEGER cur, calc;
+    DWORD diff;
+    pj_timestamp freq;
+    pj_status_t status;
+
+    /* Get system's current time */
+    GetLocalTime(&st);
+    SystemTimeToFileTime(&st, &ft);
+    
+    cur.LowPart = ft.dwLowDateTime;
+    cur.HighPart = ft.dwHighDateTime;
+    cur.QuadPart /= SECS_TO_FT_MULT;
+    cur.QuadPart -= base_time.QuadPart;
+
+    /* Get our calculated system time */
+    status = pj_get_timestamp_freq(&freq);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    calc.QuadPart = g_start_time.QuadPart + ts_elapsed / freq.u64;
+
+    /* See the difference between calculated and actual system time */
+    if (calc.QuadPart >= cur.QuadPart) {
+	diff = (DWORD)(calc.QuadPart - cur.QuadPart);
+    } else {
+	diff = (DWORD)(cur.QuadPart - calc.QuadPart);
+    }
+
+    if (diff > MIS) {
+	/* System time has changed */
+	PJ_LOG(3,("os_time_win32.c", "WinCE system time changed detected "
+				      "(diff=%u)", diff));
+	status = init_start_time();
+    } else {
+	status = PJ_SUCCESS;
+    }
+
+    return status;
+}
+
+#endif
+
+// Find 1st Jan 1970 as a FILETIME 
+static pj_status_t get_base_time(void)
+{
+    SYSTEMTIME st;
+    FILETIME ft;
+    pj_status_t status = PJ_SUCCESS;
+
+    memset(&st,0,sizeof(st));
+    st.wYear=1970;
+    st.wMonth=1;
+    st.wDay=1;
+    SystemTimeToFileTime(&st, &ft);
+    
+    base_time.LowPart = ft.dwLowDateTime;
+    base_time.HighPart = ft.dwHighDateTime;
+    base_time.QuadPart /= SECS_TO_FT_MULT;
+
+#ifdef WINCE_TIME
+    pj_enter_critical_section();
+    status = init_start_time();
+    pj_leave_critical_section();
+#endif
+
+    return status;
+}
+
+PJ_DEF(pj_status_t) pj_gettimeofday(pj_time_val *tv)
+{
+#ifdef WINCE_TIME
+    pj_timestamp tick;
+    pj_uint64_t msec_elapsed;
+#else
+    SYSTEMTIME st;
+    FILETIME ft;
+    LARGE_INTEGER li;
+#endif
+    pj_status_t status;
+
+    if (base_time.QuadPart == 0) {
+	status = get_base_time();
+	if (status != PJ_SUCCESS)
+	    return status;
+    }
+
+#ifdef WINCE_TIME
+    do {
+	status = pj_get_timestamp(&tick);
+	if (status != PJ_SUCCESS)
+	    return status;
+
+	if (tick.u64 - g_last_update.u64 >= g_update_period) {
+	    pj_enter_critical_section();
+	    if (tick.u64 - g_last_update.u64 >= g_update_period) {
+		g_last_update.u64 = tick.u64;
+		check_system_time(tick.u64 - g_start_tick.u64);
+	    }
+	    pj_leave_critical_section();
+	} else {
+	    break;
+	}
+    } while (1);
+
+    msec_elapsed = pj_elapsed_msec64(&g_start_tick, &tick);
+
+    tv->sec = (long)(g_start_time.QuadPart + msec_elapsed/1000);
+    tv->msec = (long)(msec_elapsed % 1000);
+#else
+    /* Standard Win32 GetLocalTime */
+    GetLocalTime(&st);
+    SystemTimeToFileTime(&st, &ft);
+
+    li.LowPart = ft.dwLowDateTime;
+    li.HighPart = ft.dwHighDateTime;
+    li.QuadPart /= SECS_TO_FT_MULT;
+    li.QuadPart -= base_time.QuadPart;
+
+    tv->sec = li.LowPart;
+    tv->msec = st.wMilliseconds;
+#endif	/* WINCE_TIME */
+
+    return PJ_SUCCESS;
+}
+
+PJ_DEF(pj_status_t) pj_time_decode(const pj_time_val *tv, pj_parsed_time *pt)
+{
+    LARGE_INTEGER li;
+    FILETIME ft;
+    SYSTEMTIME st;
+
+    li.QuadPart = tv->sec;
+    li.QuadPart += base_time.QuadPart;
+    li.QuadPart *= SECS_TO_FT_MULT;
+
+    ft.dwLowDateTime = li.LowPart;
+    ft.dwHighDateTime = li.HighPart;
+    FileTimeToSystemTime(&ft, &st);
+
+    pt->year = st.wYear;
+    pt->mon = st.wMonth-1;
+    pt->day = st.wDay;
+    pt->wday = st.wDayOfWeek;
+
+    pt->hour = st.wHour;
+    pt->min = st.wMinute;
+    pt->sec = st.wSecond;
+    pt->msec = tv->msec;
+
+    return PJ_SUCCESS;
+}
+
+/**
+ * Encode parsed time to time value.
+ */
+PJ_DEF(pj_status_t) pj_time_encode(const pj_parsed_time *pt, pj_time_val *tv)
+{
+    SYSTEMTIME st;
+    FILETIME ft;
+    LARGE_INTEGER li;
+
+    pj_bzero(&st, sizeof(st));
+    st.wYear = (pj_uint16_t) pt->year;
+    st.wMonth = (pj_uint16_t) (pt->mon + 1);
+    st.wDay = (pj_uint16_t) pt->day;
+    st.wHour = (pj_uint16_t) pt->hour;
+    st.wMinute = (pj_uint16_t) pt->min;
+    st.wSecond = (pj_uint16_t) pt->sec;
+    st.wMilliseconds = (pj_uint16_t) pt->msec;
+    
+    SystemTimeToFileTime(&st, &ft);
+
+    li.LowPart = ft.dwLowDateTime;
+    li.HighPart = ft.dwHighDateTime;
+    li.QuadPart /= SECS_TO_FT_MULT;
+    li.QuadPart -= base_time.QuadPart;
+
+    tv->sec = li.LowPart;
+    tv->msec = st.wMilliseconds;
+
+    return PJ_SUCCESS;
+}
+
+/**
+ * Convert local time to GMT.
+ */
+PJ_DEF(pj_status_t) pj_time_local_to_gmt(pj_time_val *tv);
+
+/**
+ * Convert GMT to local time.
+ */
+PJ_DEF(pj_status_t) pj_time_gmt_to_local(pj_time_val *tv);
+
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_common.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_timestamp_common.c
similarity index 95%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_common.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_timestamp_common.c
index 6262a1993fa4d57caacde071209c1dc55b428035..10941d211d6b36cca6ccb9309eb41e386b44cb43 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_common.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_timestamp_common.c
@@ -1,4 +1,4 @@
-/* $Id: os_timestamp_common.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: os_timestamp_common.c 2805 2009-06-25 12:29:04Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -152,6 +152,12 @@ PJ_DEF(pj_uint32_t) pj_elapsed_msec( const pj_timestamp *start,
     return (pj_uint32_t)elapsed_msec(start, stop);
 }
 
+PJ_DEF(pj_uint64_t) pj_elapsed_msec64(const pj_timestamp *start,
+                                      const pj_timestamp *stop )
+{
+    return (pj_uint64_t)elapsed_msec(start, stop);
+}
+
 PJ_DEF(pj_time_val) pj_elapsed_time( const pj_timestamp *start,
                                      const pj_timestamp *stop )
 {
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_timestamp_linux_kernel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_linux_kernel.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_timestamp_linux_kernel.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_posix.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_timestamp_posix.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_posix.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_timestamp_posix.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_timestamp_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/os_timestamp_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/os_timestamp_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_buf.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_buf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_buf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_buf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_caching.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_caching.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_caching.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_caching.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_dbg.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_dbg.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_dbg.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_dbg.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_kmalloc.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_policy_kmalloc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_kmalloc.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_policy_kmalloc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_malloc.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_policy_malloc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_malloc.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_policy_malloc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_new.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_policy_new.cpp
similarity index 65%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_new.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_policy_new.cpp
index 6f99c068c3beede2da7c6348c89476cf1e20851b..e22040a2f42be5a2f401f2a8a9b3dffd6c305919 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_policy_new.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_policy_new.cpp
@@ -1,5 +1,5 @@
 /* $Id: pool_policy_new.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #include <pj/pool.h>
 #include <pj/except.h>
@@ -27,78 +27,76 @@
  * This file contains pool default policy definition and implementation.
  */
 #include "pool_signature.h"
+ 
 
-
-static void *operator_new (pj_pool_factory *factory, pj_size_t size)
+static void *operator_new(pj_pool_factory *factory, pj_size_t size)
 {
     void *mem;
 
     PJ_CHECK_STACK();
 
     if (factory->on_block_alloc) {
-        int rc;
-        rc = factory->on_block_alloc (factory, size);
-
-        if (!rc)
-            return NULL;
+		int rc;
+		rc = factory->on_block_alloc(factory, size);
+		if (!rc)
+		    return NULL;
     }
-
-    mem = (void*) new char[size+ (SIG_SIZE << 1) ];
-
+    
+    mem = (void*) new char[size+(SIG_SIZE << 1)];
+    
     /* Exception for new operator may be disabled, so.. */
-
     if (mem) {
-        /* Apply signature when PJ_SAFE_POOL is set. It will move
-         * "mem" pointer forward.
-         */
-        APPLY_SIG (mem, size);
+	/* Apply signature when PJ_SAFE_POOL is set. It will move
+	 * "mem" pointer forward.
+	 */
+	APPLY_SIG(mem, size);
     }
 
     return mem;
 }
 
-static void operator_delete (pj_pool_factory *factory, void *mem, pj_size_t size)
+static void operator_delete(pj_pool_factory *factory, void *mem, pj_size_t size)
 {
     PJ_CHECK_STACK();
 
-    if (factory->on_block_free)
-        factory->on_block_free (factory, size);
-
+    if (factory->on_block_free) 
+        factory->on_block_free(factory, size);
+    
     /* Check and remove signature when PJ_SAFE_POOL is set. It will
      * move "mem" pointer backward.
      */
-    REMOVE_SIG (mem, size);
+    REMOVE_SIG(mem, size);
 
     /* Note that when PJ_SAFE_POOL is set, the actual size of the block
      * is size + SIG_SIZE*2.
      */
 
-    char *p = (char*) mem;
-
+    char *p = (char*)mem;
     delete [] p;
 }
 
-static void default_pool_callback (pj_pool_t *pool, pj_size_t size)
+static void default_pool_callback(pj_pool_t *pool, pj_size_t size)
 {
     PJ_CHECK_STACK();
-    PJ_UNUSED_ARG (pool);
-    PJ_UNUSED_ARG (size);
+    PJ_UNUSED_ARG(pool);
+    PJ_UNUSED_ARG(size);
 
-    PJ_THROW (PJ_NO_MEMORY_EXCEPTION);
+    PJ_THROW(PJ_NO_MEMORY_EXCEPTION);
 }
 
-PJ_DEF_DATA (pj_pool_factory_policy) pj_pool_factory_default_policy = {
+PJ_DEF_DATA(pj_pool_factory_policy) pj_pool_factory_default_policy = 
+{
     &operator_new,
     &operator_delete,
     &default_pool_callback,
     0
 };
 
-PJ_DEF (const pj_pool_factory_policy*) pj_pool_factory_get_default_policy (void)
+PJ_DEF(const pj_pool_factory_policy*) pj_pool_factory_get_default_policy(void)
 {
     return &pj_pool_factory_default_policy;
 }
 
-
+ 
 #endif	/* PJ_HAS_POOL_ALT_API */
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_signature.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_signature.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/pool_signature.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/pool_signature.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/rand.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/rand.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/rand.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/rand.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/rbtree.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/rbtree.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/rbtree.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/rbtree.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_bsd.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_bsd.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_bsd.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_bsd.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_common.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_common.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_common.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_common.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_linux_kernel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_linux_kernel.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_linux_kernel.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_select.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/sock_select.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_select.c
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_select_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_select_symbian.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..727bcfdf8b3783a3e984f2804c642d3ab86a37cb
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_select_symbian.cpp
@@ -0,0 +1,163 @@
+/* $Id: sock_select_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pj/sock_select.h>
+#include <pj/array.h>
+#include <pj/assert.h>
+#include <pj/os.h>
+#include "os_symbian.h"
+
+ 
+struct symbian_fd_set
+{
+    unsigned	 count;
+    CPjSocket	*sock[PJ_IOQUEUE_MAX_HANDLES];
+};
+
+
+PJ_DEF(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp)
+{
+    symbian_fd_set *fds = (symbian_fd_set *)fdsetp;
+    fds->count = 0;
+}
+
+
+PJ_DEF(void) PJ_FD_SET(pj_sock_t fd, pj_fd_set_t *fdsetp)
+{
+    symbian_fd_set *fds = (symbian_fd_set *)fdsetp;
+
+    PJ_ASSERT_ON_FAIL(fds->count < PJ_IOQUEUE_MAX_HANDLES, return);
+    fds->sock[fds->count++] = (CPjSocket*)fd;
+}
+
+
+PJ_DEF(void) PJ_FD_CLR(pj_sock_t fd, pj_fd_set_t *fdsetp)
+{
+    symbian_fd_set *fds = (symbian_fd_set *)fdsetp;
+    unsigned i;
+    
+    for (i=0; i<fds->count; ++i) {
+	if (fds->sock[i] == (CPjSocket*)fd) {
+	    pj_array_erase(fds->sock, sizeof(fds->sock[0]), fds->count, i);
+	    --fds->count;
+	    return;
+	}
+    }
+}
+
+
+PJ_DEF(pj_bool_t) PJ_FD_ISSET(pj_sock_t fd, const pj_fd_set_t *fdsetp)
+{
+    symbian_fd_set *fds = (symbian_fd_set *)fdsetp;
+    unsigned i;
+    
+    for (i=0; i<fds->count; ++i) {
+	if (fds->sock[i] == (CPjSocket*)fd) {
+	    return PJ_TRUE;
+	}
+    }
+
+    return PJ_FALSE;
+}
+
+PJ_DEF(pj_size_t) PJ_FD_COUNT(const pj_fd_set_t *fdsetp)
+{
+    symbian_fd_set *fds = (symbian_fd_set *)fdsetp;
+    return fds->count;
+}
+
+
+PJ_DEF(int) pj_sock_select( int n, 
+			    pj_fd_set_t *readfds, 
+			    pj_fd_set_t *writefds,
+			    pj_fd_set_t *exceptfds, 
+			    const pj_time_val *timeout)
+{
+    CPjTimeoutTimer *pjTimer;
+    unsigned i;
+
+    PJ_UNUSED_ARG(n);
+    PJ_UNUSED_ARG(writefds);
+    PJ_UNUSED_ARG(exceptfds);
+
+    if (timeout) {
+	pjTimer = PjSymbianOS::Instance()->SelectTimeoutTimer();
+	pjTimer->StartTimer(timeout->sec*1000 + timeout->msec);
+
+    } else {
+	pjTimer = NULL;
+    }
+
+    /* Scan for readable sockets */
+
+    if (readfds) {
+	symbian_fd_set *fds = (symbian_fd_set *)readfds;
+
+	do {
+	    /* Scan sockets for readily available data */
+	    for (i=0; i<fds->count; ++i) {
+		CPjSocket *pjsock = fds->sock[i];
+
+		if (pjsock->Reader()) {
+		    if (pjsock->Reader()->HasData() && !pjsock->Reader()->IsActive()) {
+
+			/* Found socket with data ready */
+			PJ_FD_ZERO(readfds);
+			PJ_FD_SET((pj_sock_t)pjsock, readfds);
+
+			/* Cancel timer, if any */
+			if (pjTimer) {
+			    pjTimer->Cancel();
+			}
+
+			/* Clear writable and exception fd_set */
+			if (writefds)
+			    PJ_FD_ZERO(writefds);
+			if (exceptfds)
+			    PJ_FD_ZERO(exceptfds);
+
+			return 1;
+
+		    } else if (!pjsock->Reader()->IsActive())
+			pjsock->Reader()->StartRecvFrom();
+
+		} else {
+		    pjsock->CreateReader();
+		    pjsock->Reader()->StartRecvFrom();
+		}
+	    }
+
+	    PjSymbianOS::Instance()->WaitForActiveObjects();
+
+	} while (pjTimer==NULL || !pjTimer->HasTimedOut());
+    }
+
+
+    /* Timeout */
+
+    if (readfds)
+	PJ_FD_ZERO(readfds);
+    if (writefds)
+	PJ_FD_ZERO(writefds);
+    if (exceptfds)
+	PJ_FD_ZERO(exceptfds);
+
+    return 0;
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_symbian.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ec8ca4e2237ff2dad2a921f8594ae795905b4444
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/sock_symbian.cpp
@@ -0,0 +1,1015 @@
+/* $Id: sock_symbian.cpp 2804 2009-06-25 12:26:15Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pj/sock.h>
+#include <pj/addr_resolv.h>
+#include <pj/assert.h>
+#include <pj/errno.h>
+#include <pj/os.h>
+#include <pj/string.h>
+#include <pj/unicode.h>
+
+#include "os_symbian.h"
+
+
+/*
+ * Address families.
+ */
+const pj_uint16_t PJ_AF_UNSPEC	= KAFUnspec;
+const pj_uint16_t PJ_AF_UNIX	= 0xFFFF;
+const pj_uint16_t PJ_AF_INET	= KAfInet;
+const pj_uint16_t PJ_AF_INET6	= KAfInet6;
+const pj_uint16_t PJ_AF_PACKET	= 0xFFFF;
+const pj_uint16_t PJ_AF_IRDA	= 0xFFFF;
+
+/*
+ * Socket types conversion.
+ * The values here are indexed based on pj_sock_type
+ */
+const pj_uint16_t PJ_SOCK_STREAM= KSockStream;
+const pj_uint16_t PJ_SOCK_DGRAM	= KSockDatagram;
+const pj_uint16_t PJ_SOCK_RAW	= 0xFFFF;
+const pj_uint16_t PJ_SOCK_RDM	= 0xFFFF;
+
+/* setsockop() is not really supported. */
+const pj_uint16_t PJ_SOL_SOCKET	= 0xFFFF;
+const pj_uint16_t PJ_SOL_IP	= 0xFFFF;
+const pj_uint16_t PJ_SOL_TCP	= 0xFFFF;
+const pj_uint16_t PJ_SOL_UDP	= 0xFFFF;
+const pj_uint16_t PJ_SOL_IPV6	= 0xFFFF;
+
+/* TOS */
+const pj_uint16_t PJ_IP_TOS		= 0;
+const pj_uint16_t PJ_IPTOS_LOWDELAY	= 0;
+const pj_uint16_t PJ_IPTOS_THROUGHPUT	= 0;
+const pj_uint16_t PJ_IPTOS_RELIABILITY	= 0;
+const pj_uint16_t PJ_IPTOS_MINCOST	= 0;
+
+/* ioctl() is also not supported. */
+const pj_uint16_t PJ_SO_TYPE    = 0xFFFF;
+const pj_uint16_t PJ_SO_RCVBUF  = 0xFFFF;
+const pj_uint16_t PJ_SO_SNDBUF  = 0xFFFF;
+
+/* IP multicast is also not supported. */
+const pj_uint16_t PJ_IP_MULTICAST_IF    = 0xFFFF;
+const pj_uint16_t PJ_IP_MULTICAST_TTL   = 0xFFFF;
+const pj_uint16_t PJ_IP_MULTICAST_LOOP  = 0xFFFF;
+const pj_uint16_t PJ_IP_ADD_MEMBERSHIP  = 0xFFFF;
+const pj_uint16_t PJ_IP_DROP_MEMBERSHIP = 0xFFFF;
+
+/* Flags */
+const int PJ_MSG_OOB	     = 0;
+const int PJ_MSG_PEEK	     = KSockReadPeek;
+const int PJ_MSG_DONTROUTE   = 0;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// CPjSocket implementation.
+// (declaration is in os_symbian.h)
+//
+
+CPjSocket::~CPjSocket()
+{
+    DestroyReader();
+    sock_.Close();
+}
+
+
+// Create socket reader.
+CPjSocketReader *CPjSocket::CreateReader(unsigned max_len)
+{
+    pj_assert(sockReader_ == NULL);
+    return sockReader_ = CPjSocketReader::NewL(*this, max_len);
+}
+
+// Delete socket reader when it's not wanted.
+void CPjSocket::DestroyReader() 
+{
+    if (sockReader_) {
+	sockReader_->Cancel();
+	delete sockReader_;
+	sockReader_ = NULL;
+    }
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// CPjSocketReader implementation
+// (declaration in os_symbian.h)
+//
+
+
+CPjSocketReader::CPjSocketReader(CPjSocket &sock)
+: CActive(EPriorityStandard), 
+  sock_(sock), buffer_(NULL, 0), readCb_(NULL), key_(NULL)
+{
+}
+
+
+void CPjSocketReader::ConstructL(unsigned max_len)
+{
+    isDatagram_ = sock_.IsDatagram();
+
+    TUint8 *ptr = new TUint8[max_len];
+    buffer_.Set(ptr, 0, (TInt)max_len);
+    CActiveScheduler::Add(this);
+}
+
+CPjSocketReader *CPjSocketReader::NewL(CPjSocket &sock, unsigned max_len)
+{
+    CPjSocketReader *self = new (ELeave) CPjSocketReader(sock);
+    CleanupStack::PushL(self);
+    self->ConstructL(max_len);
+    CleanupStack::Pop(self);
+
+    return self;
+}
+
+
+CPjSocketReader::~CPjSocketReader()
+{
+    const TUint8 *data = buffer_.Ptr();
+    delete [] data;
+}
+
+void CPjSocketReader::StartRecv(void (*cb)(void *key), 
+			        void *key, 
+			        TDes8 *aDesc,
+			        TUint flags)
+{
+    StartRecvFrom(cb, key, aDesc, flags, NULL);
+}
+
+void CPjSocketReader::StartRecvFrom(void (*cb)(void *key), 
+				    void *key, 
+				    TDes8 *aDesc,
+				    TUint flags,
+				    TSockAddr *fromAddr)
+{
+    readCb_ = cb;
+    key_ = key;
+
+    if (aDesc == NULL) aDesc = &buffer_;
+    if (fromAddr == NULL) fromAddr = &recvAddr_;
+
+    sock_.Socket().RecvFrom(*aDesc, *fromAddr, flags, iStatus);
+    SetActive();
+}
+
+void CPjSocketReader::DoCancel()
+{
+    sock_.Socket().CancelRecv();
+}
+
+void CPjSocketReader::RunL()
+{
+    void (*old_cb)(void *key) = readCb_;
+    void *old_key = key_;
+
+    readCb_ = NULL;
+    key_ = NULL;
+
+    if (old_cb) {
+	(*old_cb)(old_key);
+    }
+}
+
+// Append data to aDesc, up to aDesc's maximum size.
+// If socket is datagram based, buffer_ will be clared.
+void CPjSocketReader::ReadData(TDes8 &aDesc, TInetAddr *addr)
+{
+    if (isDatagram_)
+	aDesc.Zero();
+
+    if (buffer_.Length() == 0)
+	return;
+
+    TInt size_to_copy = aDesc.MaxLength() - aDesc.Length();
+    if (size_to_copy > buffer_.Length())
+	size_to_copy = buffer_.Length();
+
+    aDesc.Append(buffer_.Ptr(), size_to_copy);
+
+    if (isDatagram_)
+	buffer_.Zero();
+    else
+	buffer_.Delete(0, size_to_copy);
+
+    if (addr)
+	*addr = recvAddr_;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// PJLIB's sock.h implementation
+//
+
+/*
+ * Convert 16-bit value from network byte order to host byte order.
+ */
+PJ_DEF(pj_uint16_t) pj_ntohs(pj_uint16_t netshort)
+{
+#if PJ_IS_LITTLE_ENDIAN
+    return pj_swap16(netshort);
+#else
+    return netshort;
+#endif
+}
+
+/*
+ * Convert 16-bit value from host byte order to network byte order.
+ */
+PJ_DEF(pj_uint16_t) pj_htons(pj_uint16_t hostshort)
+{
+#if PJ_IS_LITTLE_ENDIAN
+    return pj_swap16(hostshort);
+#else
+    return hostshort;
+#endif
+}
+
+/*
+ * Convert 32-bit value from network byte order to host byte order.
+ */
+PJ_DEF(pj_uint32_t) pj_ntohl(pj_uint32_t netlong)
+{
+#if PJ_IS_LITTLE_ENDIAN
+    return pj_swap32(netlong);
+#else
+    return netlong;
+#endif
+}
+
+/*
+ * Convert 32-bit value from host byte order to network byte order.
+ */
+PJ_DEF(pj_uint32_t) pj_htonl(pj_uint32_t hostlong)
+{
+#if PJ_IS_LITTLE_ENDIAN
+    return pj_swap32(hostlong);
+#else
+    return netlong;
+#endif
+}
+
+/*
+ * Convert an Internet host address given in network byte order
+ * to string in standard numbers and dots notation.
+ */
+PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr)
+{
+	static char str8[PJ_INET_ADDRSTRLEN];
+    TBuf<PJ_INET_ADDRSTRLEN> str16(0);
+
+    /* (Symbian IP address is in host byte order) */
+    TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0);
+    temp_addr.Output(str16);
+ 
+    return pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(),
+			      str8, sizeof(str8));
+}
+
+/*
+ * This function converts the Internet host address cp from the standard
+ * numbers-and-dots notation into binary data and stores it in the structure
+ * that inp points to. 
+ */
+PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp)
+{
+    enum { MAXIPLEN = PJ_INET_ADDRSTRLEN };
+
+    /* Initialize output with PJ_INADDR_NONE.
+     * Some apps relies on this instead of the return value
+     * (and anyway the return value is quite confusing!)
+     */
+    inp->s_addr = PJ_INADDR_NONE;
+
+    /* Caution:
+     *	this function might be called with cp->slen >= 16
+     *  (i.e. when called with hostname to check if it's an IP addr).
+     */
+    PJ_ASSERT_RETURN(cp && cp->slen && inp, 0);
+    if (cp->slen >= 16) {
+	return 0;
+    }
+
+    char tempaddr8[MAXIPLEN];
+    pj_memcpy(tempaddr8, cp->ptr, cp->slen);
+    tempaddr8[cp->slen] = '\0';
+
+    wchar_t tempaddr16[MAXIPLEN];
+    pj_ansi_to_unicode(tempaddr8, pj_ansi_strlen(tempaddr8),
+		       tempaddr16, sizeof(tempaddr16));
+
+    TBuf<MAXIPLEN> ip_addr((const TText*)tempaddr16);
+
+    TInetAddr addr;
+    addr.Init(KAfInet);
+    if (addr.Input(ip_addr) == KErrNone) {
+	/* Success (Symbian IP address is in host byte order) */
+	inp->s_addr = pj_htonl(addr.Address());
+	return 1;
+    } else {
+	/* Error */
+	return 0;
+    }
+}
+
+/*
+ * Convert text to IPv4/IPv6 address.
+ */
+PJ_DEF(pj_status_t) pj_inet_pton(int af, const pj_str_t *src, void *dst)
+{
+    char tempaddr[PJ_INET6_ADDRSTRLEN];
+
+    PJ_ASSERT_RETURN(af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EINVAL);
+    PJ_ASSERT_RETURN(src && src->slen && dst, PJ_EINVAL);
+
+    /* Initialize output with PJ_IN_ADDR_NONE for IPv4 (to be 
+     * compatible with pj_inet_aton()
+     */
+    if (af==PJ_AF_INET) {
+	((pj_in_addr*)dst)->s_addr = PJ_INADDR_NONE;
+    }
+
+    /* Caution:
+     *	this function might be called with cp->slen >= 46
+     *  (i.e. when called with hostname to check if it's an IP addr).
+     */
+    if (src->slen >= PJ_INET6_ADDRSTRLEN) {
+	return PJ_ENAMETOOLONG;
+    }
+
+    pj_memcpy(tempaddr, src->ptr, src->slen);
+    tempaddr[src->slen] = '\0';
+
+
+    wchar_t tempaddr16[PJ_INET6_ADDRSTRLEN];
+    pj_ansi_to_unicode(tempaddr, pj_ansi_strlen(tempaddr),
+		       tempaddr16, sizeof(tempaddr16));
+
+    TBuf<PJ_INET6_ADDRSTRLEN> ip_addr((const TText*)tempaddr16);
+
+    TInetAddr addr;
+    addr.Init(KAfInet6);
+    if (addr.Input(ip_addr) == KErrNone) {
+	if (af==PJ_AF_INET) {
+	    /* Success (Symbian IP address is in host byte order) */
+	    pj_uint32_t ip = pj_htonl(addr.Address());
+	    pj_memcpy(dst, &ip, 4);
+	} else if (af==PJ_AF_INET6) {
+	    const TIp6Addr & ip6 = addr.Ip6Address();
+	    pj_memcpy(dst, ip6.u.iAddr8, 16);
+	} else {
+	    pj_assert(!"Unexpected!");
+	    return PJ_EBUG;
+	}
+	return PJ_SUCCESS;
+    } else {
+	/* Error */
+	return PJ_EINVAL;
+    }
+}
+
+/*
+ * Convert IPv4/IPv6 address to text.
+ */
+PJ_DEF(pj_status_t) pj_inet_ntop(int af, const void *src,
+				 char *dst, int size)
+
+{
+    PJ_ASSERT_RETURN(src && dst && size, PJ_EINVAL);
+
+    *dst = '\0';
+
+    if (af==PJ_AF_INET) {
+
+	TBuf<PJ_INET_ADDRSTRLEN> str16;
+	pj_in_addr inaddr;
+
+	if (size < PJ_INET_ADDRSTRLEN)
+	    return PJ_ETOOSMALL;
+
+	pj_memcpy(&inaddr, src, 4);
+
+	/* Symbian IP address is in host byte order */
+	TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0);
+	temp_addr.Output(str16);
+ 
+	pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(),
+			   dst, size);
+	return PJ_SUCCESS;
+
+    } else if (af==PJ_AF_INET6) {
+	TBuf<PJ_INET6_ADDRSTRLEN> str16;
+
+	if (size < PJ_INET6_ADDRSTRLEN)
+	    return PJ_ETOOSMALL;
+
+	TIp6Addr ip6;
+	pj_memcpy(ip6.u.iAddr8, src, 16);
+
+	TInetAddr temp_addr(ip6, (TUint)0);
+	temp_addr.Output(str16);
+ 
+	pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(),
+			   dst, size);
+	return PJ_SUCCESS;
+
+    } else {
+	pj_assert(!"Unsupport address family");
+	return PJ_EINVAL;
+    }
+
+}
+
+/*
+ * Get hostname.
+ */
+PJ_DEF(const pj_str_t*) pj_gethostname(void)
+{
+    static char buf[PJ_MAX_HOSTNAME];
+    static pj_str_t hostname;
+
+    PJ_CHECK_STACK();
+
+    if (hostname.ptr == NULL) {
+	RHostResolver &resv = PjSymbianOS::Instance()->GetResolver(PJ_AF_INET);
+	TRequestStatus reqStatus;
+	THostName tmpName;
+
+	// Return empty hostname if access point is marked as down by app.
+	PJ_SYMBIAN_CHECK_CONNECTION2(&hostname);
+
+	resv.GetHostName(tmpName, reqStatus);
+	User::WaitForRequest(reqStatus);
+
+	hostname.ptr = pj_unicode_to_ansi((const wchar_t*)tmpName.Ptr(), tmpName.Length(),
+					  buf, sizeof(buf));
+	hostname.slen = tmpName.Length();
+    }
+    return &hostname;
+}
+
+/*
+ * Create new socket/endpoint for communication and returns a descriptor.
+ */
+PJ_DEF(pj_status_t) pj_sock_socket(int af, 
+				   int type, 
+				   int proto,
+				   pj_sock_t *p_sock)
+{
+    TInt rc;
+
+    PJ_CHECK_STACK();
+
+    /* Sanity checks. */
+    PJ_ASSERT_RETURN(p_sock!=NULL, PJ_EINVAL);
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+    
+    /* Set proto if none is specified. */
+    if (proto == 0) {
+	if (type == pj_SOCK_STREAM())
+	    proto = KProtocolInetTcp;
+	else if (type == pj_SOCK_DGRAM())
+	    proto = KProtocolInetUdp;
+    }
+
+    /* Create Symbian RSocket */
+    RSocket rSock;
+    if (PjSymbianOS::Instance()->Connection())
+    	rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), 
+    			af, type, proto,
+    			*PjSymbianOS::Instance()->Connection());
+    else
+    	rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), 
+    			af, type, proto);
+        
+    if (rc != KErrNone)
+	return PJ_RETURN_OS_ERROR(rc);
+
+
+    /* Wrap Symbian RSocket into PJLIB's CPjSocket, and return to caller */
+    CPjSocket *pjSock = new CPjSocket(af, type, rSock);
+    *p_sock = (pj_sock_t)pjSock;
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Bind socket.
+ */
+PJ_DEF(pj_status_t) pj_sock_bind( pj_sock_t sock, 
+				  const pj_sockaddr_t *addr,
+				  int len)
+{
+    pj_status_t status;
+    TInt rc;
+
+    PJ_CHECK_STACK();
+
+    PJ_ASSERT_RETURN(sock != 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(addr && len>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL);
+
+    // Convert PJLIB's pj_sockaddr into Symbian's TInetAddr
+    TInetAddr inetAddr;
+    status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)addr, len, inetAddr);
+    if (status != PJ_SUCCESS)
+    	return status;
+
+    // Get the RSocket instance
+    RSocket &rSock = ((CPjSocket*)sock)->Socket();
+
+    // Bind
+    rc = rSock.Bind(inetAddr);
+
+    return (rc==KErrNone) ? PJ_SUCCESS : PJ_RETURN_OS_ERROR(rc);
+}
+
+
+/*
+ * Bind socket.
+ */
+PJ_DEF(pj_status_t) pj_sock_bind_in( pj_sock_t sock, 
+				     pj_uint32_t addr32,
+				     pj_uint16_t port)
+{
+    pj_sockaddr_in addr;
+
+    PJ_CHECK_STACK();
+
+    pj_bzero(&addr, sizeof(addr));
+    addr.sin_family = PJ_AF_INET;
+    addr.sin_addr.s_addr = pj_htonl(addr32);
+    addr.sin_port = pj_htons(port);
+
+    return pj_sock_bind(sock, &addr, sizeof(pj_sockaddr_in));
+}
+
+
+/*
+ * Close socket.
+ */
+PJ_DEF(pj_status_t) pj_sock_close(pj_sock_t sock)
+{
+    PJ_CHECK_STACK();
+
+    PJ_ASSERT_RETURN(sock != 0, PJ_EINVAL);
+
+    CPjSocket *pjSock = (CPjSocket*)sock;
+
+    // This will close the socket.
+    delete pjSock;
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * Get remote's name.
+ */
+PJ_DEF(pj_status_t) pj_sock_getpeername( pj_sock_t sock,
+					 pj_sockaddr_t *addr,
+					 int *namelen)
+{
+    PJ_CHECK_STACK();
+    
+    PJ_ASSERT_RETURN(sock && addr && namelen && 
+		     *namelen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL);
+
+    CPjSocket *pjSock = (CPjSocket*)sock;
+    RSocket &rSock = pjSock->Socket();
+
+    // Socket must be connected.
+    PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP);
+
+    TInetAddr inetAddr;
+    rSock.RemoteName(inetAddr);
+
+    return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)addr, namelen);
+}
+
+/*
+ * Get socket name.
+ */
+PJ_DEF(pj_status_t) pj_sock_getsockname( pj_sock_t sock,
+					 pj_sockaddr_t *addr,
+					 int *namelen)
+{
+    PJ_CHECK_STACK();
+    
+    PJ_ASSERT_RETURN(sock && addr && namelen && 
+		     *namelen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL);
+
+    CPjSocket *pjSock = (CPjSocket*)sock;
+    RSocket &rSock = pjSock->Socket();
+
+    TInetAddr inetAddr;
+    rSock.LocalName(inetAddr);
+
+    return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)addr, namelen);
+}
+
+/*
+ * Send data
+ */
+PJ_DEF(pj_status_t) pj_sock_send(pj_sock_t sock,
+				 const void *buf,
+				 pj_ssize_t *len,
+				 unsigned flags)
+{
+    PJ_CHECK_STACK();
+    PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL);
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+    
+    CPjSocket *pjSock = (CPjSocket*)sock;
+    RSocket &rSock = pjSock->Socket();
+
+    // send() should only be called to connected socket
+    PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP);
+
+    TPtrC8 data((const TUint8*)buf, (TInt)*len);
+    TRequestStatus reqStatus;
+    TSockXfrLength sentLen;
+
+    rSock.Send(data, flags, reqStatus, sentLen);
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus.Int()==KErrNone) {
+	//*len = (TInt) sentLen.Length();
+	return PJ_SUCCESS;
+    } else
+	return PJ_RETURN_OS_ERROR(reqStatus.Int());
+}
+
+
+/*
+ * Send data.
+ */
+PJ_DEF(pj_status_t) pj_sock_sendto(pj_sock_t sock,
+				   const void *buf,
+				   pj_ssize_t *len,
+				   unsigned flags,
+				   const pj_sockaddr_t *to,
+				   int tolen)
+{
+    pj_status_t status;
+    
+    PJ_CHECK_STACK();
+    PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL);
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+    
+    CPjSocket *pjSock = (CPjSocket*)sock;
+    RSocket &rSock = pjSock->Socket();
+
+    // Only supports AF_INET for now
+    PJ_ASSERT_RETURN(tolen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL);
+
+    TInetAddr inetAddr;
+    status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)to, tolen, inetAddr);
+    if (status != PJ_SUCCESS)
+    	return status;
+
+    TPtrC8 data((const TUint8*)buf, (TInt)*len);
+    TRequestStatus reqStatus;
+    TSockXfrLength sentLen;
+
+    rSock.SendTo(data, inetAddr, flags, reqStatus, sentLen);
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus.Int()==KErrNone) {
+	//For some reason TSockXfrLength is not returning correctly!
+	//*len = (TInt) sentLen.Length();
+	return PJ_SUCCESS;
+    } else 
+	return PJ_RETURN_OS_ERROR(reqStatus.Int());
+}
+
+/*
+ * Receive data.
+ */
+PJ_DEF(pj_status_t) pj_sock_recv(pj_sock_t sock,
+				 void *buf,
+				 pj_ssize_t *len,
+				 unsigned flags)
+{
+    PJ_CHECK_STACK();
+
+    PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL);
+    PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL);
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+
+    CPjSocket *pjSock = (CPjSocket*)sock;
+
+    if (pjSock->Reader()) {
+	CPjSocketReader *reader = pjSock->Reader();
+
+	while (reader->IsActive() && !reader->HasData()) {
+	    User::WaitForAnyRequest();
+	}
+
+	if (reader->HasData()) {
+	    TPtr8 data((TUint8*)buf, (TInt)*len);
+	    TInetAddr inetAddr;
+
+	    reader->ReadData(data, &inetAddr);
+
+	    *len = data.Length();
+	    return PJ_SUCCESS;
+	}
+    }
+
+    TRequestStatus reqStatus;
+    TSockXfrLength recvLen;
+    TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len);
+
+    if (pjSock->IsDatagram()) {
+	pjSock->Socket().Recv(data, flags, reqStatus);
+    } else {
+	// Using static like this is not pretty, but we don't need to use
+	// the value anyway, hence doing it like this is probably most
+	// optimal.
+	static TSockXfrLength len;
+	pjSock->Socket().RecvOneOrMore(data, flags, reqStatus, len);
+    }
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus == KErrNone) {
+	//*len = (TInt)recvLen.Length();
+	*len = data.Length();
+	return PJ_SUCCESS;
+    } else {
+	*len = -1;
+	return PJ_RETURN_OS_ERROR(reqStatus.Int());
+    }
+}
+
+/*
+ * Receive data.
+ */
+PJ_DEF(pj_status_t) pj_sock_recvfrom(pj_sock_t sock,
+				     void *buf,
+				     pj_ssize_t *len,
+				     unsigned flags,
+				     pj_sockaddr_t *from,
+				     int *fromlen)
+{
+    PJ_CHECK_STACK();
+
+    PJ_ASSERT_RETURN(sock && buf && len && from && fromlen, PJ_EINVAL);
+    PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(*fromlen >= (int)sizeof(pj_sockaddr_in), PJ_EINVAL);
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+
+    CPjSocket *pjSock = (CPjSocket*)sock;
+    RSocket &rSock = pjSock->Socket();
+
+    if (pjSock->Reader()) {
+	CPjSocketReader *reader = pjSock->Reader();
+
+	while (reader->IsActive() && !reader->HasData()) {
+	    User::WaitForAnyRequest();
+	}
+
+	if (reader->HasData()) {
+	    TPtr8 data((TUint8*)buf, (TInt)*len);
+	    TInetAddr inetAddr;
+
+	    reader->ReadData(data, &inetAddr);
+
+	    *len = data.Length();
+
+	    if (from && fromlen) {
+		return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)from, 
+					    fromlen);
+	    } else {
+	    	return PJ_SUCCESS;
+	    }
+	}
+    }
+
+    TInetAddr inetAddr;
+    TRequestStatus reqStatus;
+    TSockXfrLength recvLen;
+    TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len);
+
+    rSock.RecvFrom(data, inetAddr, flags, reqStatus, recvLen);
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus == KErrNone) {
+	//*len = (TInt)recvLen.Length();
+	*len = data.Length();
+	return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)from, fromlen);
+    } else {
+	*len = -1;
+	*fromlen = -1;
+	return PJ_RETURN_OS_ERROR(reqStatus.Int());
+    }
+}
+
+/*
+ * Get socket option.
+ */
+PJ_DEF(pj_status_t) pj_sock_getsockopt( pj_sock_t sock,
+					pj_uint16_t level,
+					pj_uint16_t optname,
+					void *optval,
+					int *optlen)
+{
+    // Not supported for now.
+    PJ_UNUSED_ARG(sock);
+    PJ_UNUSED_ARG(level);
+    PJ_UNUSED_ARG(optname);
+    PJ_UNUSED_ARG(optval);
+    PJ_UNUSED_ARG(optlen);
+    return PJ_EINVALIDOP;
+}
+
+/*
+ * Set socket option.
+ */
+PJ_DEF(pj_status_t) pj_sock_setsockopt( pj_sock_t sock,
+					pj_uint16_t level,
+					pj_uint16_t optname,
+					const void *optval,
+					int optlen)
+{
+    // Not supported for now.
+    PJ_UNUSED_ARG(sock);
+    PJ_UNUSED_ARG(level);
+    PJ_UNUSED_ARG(optname);
+    PJ_UNUSED_ARG(optval);
+    PJ_UNUSED_ARG(optlen);
+    return PJ_EINVALIDOP;
+}
+
+/*
+ * Connect socket.
+ */
+PJ_DEF(pj_status_t) pj_sock_connect( pj_sock_t sock,
+				     const pj_sockaddr_t *addr,
+				     int namelen)
+{
+    pj_status_t status;
+    
+    PJ_CHECK_STACK();
+
+    PJ_ASSERT_RETURN(sock && addr && namelen, PJ_EINVAL);
+    PJ_ASSERT_RETURN(((pj_sockaddr*)addr)->addr.sa_family == PJ_AF_INET, 
+		     PJ_EINVAL);
+
+    // Return failure if access point is marked as down by app.
+    PJ_SYMBIAN_CHECK_CONNECTION();
+    
+    CPjSocket *pjSock = (CPjSocket*)sock;
+    RSocket &rSock = pjSock->Socket();
+
+    TInetAddr inetAddr;
+    TRequestStatus reqStatus;
+
+    status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)addr, namelen, inetAddr);
+    if (status != PJ_SUCCESS)
+    	return status;
+
+    rSock.Connect(inetAddr, reqStatus);
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus == KErrNone) {
+	pjSock->SetConnected(true);
+	return PJ_SUCCESS;
+    } else {
+	return PJ_RETURN_OS_ERROR(reqStatus.Int());
+    }
+}
+
+
+/*
+ * Shutdown socket.
+ */
+#if PJ_HAS_TCP
+PJ_DEF(pj_status_t) pj_sock_shutdown( pj_sock_t sock,
+				      int how)
+{
+    PJ_CHECK_STACK();
+
+    PJ_ASSERT_RETURN(sock, PJ_EINVAL);
+
+    CPjSocket *pjSock = (CPjSocket*)sock;
+    RSocket &rSock = pjSock->Socket();
+
+    RSocket::TShutdown aHow;
+    if (how == PJ_SD_RECEIVE)
+	aHow = RSocket::EStopInput;
+    else if (how == PJ_SHUT_WR)
+	aHow = RSocket::EStopOutput;
+    else
+	aHow = RSocket::ENormal;
+
+    TRequestStatus reqStatus;
+
+    rSock.Shutdown(aHow, reqStatus);
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus == KErrNone) {
+	return PJ_SUCCESS;
+    } else {
+	return PJ_RETURN_OS_ERROR(reqStatus.Int());
+    }
+}
+
+/*
+ * Start listening to incoming connections.
+ */
+PJ_DEF(pj_status_t) pj_sock_listen( pj_sock_t sock,
+				    int backlog)
+{
+    PJ_CHECK_STACK();
+
+    PJ_ASSERT_RETURN(sock && backlog, PJ_EINVAL);
+
+    CPjSocket *pjSock = (CPjSocket*)sock;
+    RSocket &rSock = pjSock->Socket();
+
+    TInt rc = rSock.Listen((TUint)backlog);
+
+    if (rc == KErrNone) {
+	return PJ_SUCCESS;
+    } else {
+	return PJ_RETURN_OS_ERROR(rc);
+    }
+}
+
+/*
+ * Accept incoming connections
+ */
+PJ_DEF(pj_status_t) pj_sock_accept( pj_sock_t serverfd,
+				    pj_sock_t *newsock,
+				    pj_sockaddr_t *addr,
+				    int *addrlen)
+{
+    PJ_CHECK_STACK();
+
+    PJ_ASSERT_RETURN(serverfd && newsock, PJ_EINVAL);
+
+    CPjSocket *pjSock = (CPjSocket*)serverfd;
+    RSocket &rSock = pjSock->Socket();
+
+    // Create a 'blank' socket
+    RSocket newSock;
+    newSock.Open(PjSymbianOS::Instance()->SocketServ());
+
+    // Call Accept()
+    TRequestStatus reqStatus;
+
+    rSock.Accept(newSock, reqStatus);
+    User::WaitForRequest(reqStatus);
+
+    if (reqStatus != KErrNone) {
+	return PJ_RETURN_OS_ERROR(reqStatus.Int());
+    }
+
+    // Create PJ socket
+    CPjSocket *newPjSock = new CPjSocket(pjSock->GetAf(), pjSock->GetSockType(),
+					 newSock);
+    newPjSock->SetConnected(true);
+
+    *newsock = (pj_sock_t) newPjSock;
+
+    if (addr && addrlen) {
+	return pj_sock_getpeername(*newsock, addr, addrlen);
+    }
+
+    return PJ_SUCCESS;
+}
+#endif	/* PJ_HAS_TCP */
+
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/string.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/string.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/string.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/string.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/symbols.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/symbols.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/symbols.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/symbols.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/timer.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/timer.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/timer.c
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/timer_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/timer_symbian.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0a9dd8a9377941880e097e731889eacf6b2f416f
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/timer_symbian.cpp
@@ -0,0 +1,276 @@
+/* $Id: timer_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pj/timer.h>
+#include <pj/pool.h>
+#include <pj/assert.h>
+#include <pj/errno.h>
+#include <pj/lock.h>
+
+#include "os_symbian.h"
+
+
+#define DEFAULT_MAX_TIMED_OUT_PER_POLL  (64)
+
+
+/**
+ * The implementation of timer heap.
+ */
+struct pj_timer_heap_t
+{
+    /** Maximum size of the heap. */
+    pj_size_t max_size;
+
+    /** Current size of the heap. */
+    pj_size_t cur_size;
+
+    /** Max timed out entries to process per poll. */
+    unsigned max_entries_per_poll;
+};
+
+
+//////////////////////////////////////////////////////////////////////////////
+/**
+ * Active object for each timer entry.
+ */
+class CPjTimerEntry : public CActive 
+{
+public:
+    static CPjTimerEntry* NewL(	pj_timer_heap_t *timer_heap,
+    				pj_timer_entry *entry,
+    				const pj_time_val *delay);
+    
+    ~CPjTimerEntry();
+    
+    virtual void RunL();
+    virtual void DoCancel();
+
+private:	
+    pj_timer_heap_t *timer_heap_;
+    pj_timer_entry  *entry_;
+    RTimer	     rtimer_;
+    
+    CPjTimerEntry(pj_timer_heap_t *timer_heap, pj_timer_entry *entry);
+    void ConstructL(const pj_time_val *delay);
+};
+
+
+CPjTimerEntry::CPjTimerEntry(pj_timer_heap_t *timer_heap,
+			     pj_timer_entry *entry)
+: CActive(PJ_SYMBIAN_TIMER_PRIORITY), timer_heap_(timer_heap), entry_(entry)
+{
+}
+
+CPjTimerEntry::~CPjTimerEntry() 
+{
+    Cancel();
+    rtimer_.Close();
+}
+
+void CPjTimerEntry::ConstructL(const pj_time_val *delay) 
+{
+    rtimer_.CreateLocal();
+    CActiveScheduler::Add(this);
+    
+    pj_int32_t interval = PJ_TIME_VAL_MSEC(*delay) * 1000;
+    if (interval < 0) {
+    	interval = 0;
+    }
+    rtimer_.After(iStatus, interval);
+    SetActive();
+}
+
+CPjTimerEntry* CPjTimerEntry::NewL(pj_timer_heap_t *timer_heap,
+				   pj_timer_entry *entry,
+				   const pj_time_val *delay) 
+{
+    CPjTimerEntry *self = new CPjTimerEntry(timer_heap, entry);
+    CleanupStack::PushL(self);
+    self->ConstructL(delay);
+    CleanupStack::Pop(self);
+
+    return self;
+}
+
+void CPjTimerEntry::RunL() 
+{
+    --timer_heap_->cur_size;
+    entry_->_timer_id = NULL;
+    entry_->cb(timer_heap_, entry_);
+    
+    // Finger's crossed!
+    delete this;
+}
+
+void CPjTimerEntry::DoCancel() 
+{
+     rtimer_.Cancel();
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+
+/*
+ * Calculate memory size required to create a timer heap.
+ */
+PJ_DEF(pj_size_t) pj_timer_heap_mem_size(pj_size_t count)
+{
+    return /* size of the timer heap itself: */
+           sizeof(pj_timer_heap_t) + 
+           /* size of each entry: */
+           (count+2) * (sizeof(pj_timer_entry*)+sizeof(pj_timer_id_t)) +
+           /* lock, pool etc: */
+           132;
+}
+
+/*
+ * Create a new timer heap.
+ */
+PJ_DEF(pj_status_t) pj_timer_heap_create( pj_pool_t *pool,
+					  pj_size_t size,
+                                          pj_timer_heap_t **p_heap)
+{
+    pj_timer_heap_t *ht;
+
+    PJ_ASSERT_RETURN(pool && p_heap, PJ_EINVAL);
+
+    *p_heap = NULL;
+
+    /* Allocate timer heap data structure from the pool */
+    ht = PJ_POOL_ALLOC_T(pool, pj_timer_heap_t);
+    if (!ht)
+        return PJ_ENOMEM;
+
+    /* Initialize timer heap sizes */
+    ht->max_size = size;
+    ht->cur_size = 0;
+    ht->max_entries_per_poll = DEFAULT_MAX_TIMED_OUT_PER_POLL;
+
+    *p_heap = ht;
+    return PJ_SUCCESS;
+}
+
+PJ_DEF(void) pj_timer_heap_destroy( pj_timer_heap_t *ht )
+{
+    PJ_UNUSED_ARG(ht);
+}
+
+PJ_DEF(void) pj_timer_heap_set_lock(  pj_timer_heap_t *ht,
+                                      pj_lock_t *lock,
+                                      pj_bool_t auto_del )
+{
+    PJ_UNUSED_ARG(ht);
+    if (auto_del)
+    	pj_lock_destroy(lock);
+}
+
+
+PJ_DEF(unsigned) pj_timer_heap_set_max_timed_out_per_poll(pj_timer_heap_t *ht,
+                                                          unsigned count )
+{
+    unsigned old_count = ht->max_entries_per_poll;
+    ht->max_entries_per_poll = count;
+    return old_count;
+}
+
+PJ_DEF(pj_timer_entry*) pj_timer_entry_init( pj_timer_entry *entry,
+                                             int id,
+                                             void *user_data,
+                                             pj_timer_heap_callback *cb )
+{
+    pj_assert(entry && cb);
+
+    entry->_timer_id = NULL;
+    entry->id = id;
+    entry->user_data = user_data;
+    entry->cb = cb;
+
+    return entry;
+}
+
+PJ_DEF(pj_status_t) pj_timer_heap_schedule( pj_timer_heap_t *ht,
+					    pj_timer_entry *entry, 
+					    const pj_time_val *delay)
+{
+    CPjTimerEntry *timerObj;
+    
+    PJ_ASSERT_RETURN(ht && entry && delay, PJ_EINVAL);
+    PJ_ASSERT_RETURN(entry->cb != NULL, PJ_EINVAL);
+
+    /* Prevent same entry from being scheduled more than once */
+    PJ_ASSERT_RETURN(entry->_timer_id == NULL, PJ_EINVALIDOP);
+
+    timerObj = CPjTimerEntry::NewL(ht, entry, delay);
+    entry->_timer_id = (void*) timerObj;
+    
+    ++ht->cur_size;
+    return PJ_SUCCESS;
+}
+
+PJ_DEF(int) pj_timer_heap_cancel( pj_timer_heap_t *ht,
+				  pj_timer_entry *entry)
+{
+    PJ_ASSERT_RETURN(ht && entry, PJ_EINVAL);
+    
+    if (entry->_timer_id != NULL) {
+    	CPjTimerEntry *timerObj = (CPjTimerEntry*) entry->_timer_id;
+    	timerObj->Cancel();
+    	delete timerObj;
+    	entry->_timer_id = NULL;
+    	--ht->cur_size;
+    	return 1;
+    } else {
+    	return 0;
+    }
+}
+
+PJ_DEF(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht, 
+                                     pj_time_val *next_delay )
+{
+    /* Polling is not necessary on Symbian, since all async activities
+     * are registered to active scheduler.
+     */
+    PJ_UNUSED_ARG(ht);
+    if (next_delay) {
+    	next_delay->sec = 1;
+    	next_delay->msec = 0;
+    }
+    return 0;
+}
+
+PJ_DEF(pj_size_t) pj_timer_heap_count( pj_timer_heap_t *ht )
+{
+    PJ_ASSERT_RETURN(ht, 0);
+
+    return ht->cur_size;
+}
+
+PJ_DEF(pj_status_t) pj_timer_heap_earliest_time( pj_timer_heap_t * ht,
+					         pj_time_val *timeval)
+{
+    /* We don't support this! */
+    PJ_UNUSED_ARG(ht);
+    
+    timeval->sec = 1;
+    timeval->msec = 0;
+    
+    return PJ_SUCCESS;
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/types.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/types.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/types.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/types.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/unicode_symbian.cpp
similarity index 57%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_symbian.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/unicode_symbian.cpp
index c1ce1e52e5a0f93886aa1ba60f22116695b8ce9b..e9eb957f957693b1c4dd8b6e54de19feb87495fd 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_symbian.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/unicode_symbian.cpp
@@ -1,5 +1,5 @@
 /* $Id: unicode_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #include <pj/unicode.h>
 
@@ -25,20 +25,20 @@
 /*
  * Convert ANSI strings to Unicode strings.
  */
-PJ_DEF (wchar_t*) pj_ansi_to_unicode (const char *str, pj_size_t len,
-                                      wchar_t *wbuf, pj_size_t wbuf_count)
+PJ_DEF(wchar_t*) pj_ansi_to_unicode( const char *str, pj_size_t len,
+				     wchar_t *wbuf, pj_size_t wbuf_count)
 {
-    TPtrC8 aForeign ( (const TUint8*) str, (TInt) len);
-    TPtr16 aUnicode ( (TUint16*) wbuf, (TInt) (wbuf_count-1));
+    TPtrC8 aForeign((const TUint8*)str, (TInt)len);
+    TPtr16 aUnicode((TUint16*)wbuf, (TInt)(wbuf_count-1));
     TInt left;
 
-    left = PjSymbianOS::Instance()->ConvertToUnicode (aUnicode, aForeign);
+    left = PjSymbianOS::Instance()->ConvertToUnicode(aUnicode, aForeign);
 
     if (left != 0) {
-        // Error, or there are unconvertable characters
-        *wbuf = 0;
+	// Error, or there are unconvertable characters
+	*wbuf = 0;
     } else {
-        wbuf[len] = 0;
+	wbuf[len] = 0;
     }
 
     return wbuf;
@@ -48,20 +48,20 @@ PJ_DEF (wchar_t*) pj_ansi_to_unicode (const char *str, pj_size_t len,
 /*
  * Convert Unicode string to ANSI string.
  */
-PJ_DEF (char*) pj_unicode_to_ansi (const wchar_t *wstr, pj_size_t len,
-                                   char *buf, pj_size_t buf_size)
+PJ_DEF(char*) pj_unicode_to_ansi( const wchar_t *wstr, pj_size_t len,
+				  char *buf, pj_size_t buf_size)
 {
-    TPtrC16 aUnicode ( (const TUint16*) wstr, (TInt) len);
-    TPtr8 aForeign ( (TUint8*) buf, (TInt) (buf_size-1));
+    TPtrC16 aUnicode((const TUint16*)wstr, (TInt)len);
+    TPtr8 aForeign((TUint8*)buf, (TInt)(buf_size-1));
     TInt left;
 
-    left = PjSymbianOS::Instance()->ConvertFromUnicode (aForeign, aUnicode);
+    left = PjSymbianOS::Instance()->ConvertFromUnicode(aForeign, aUnicode);
 
     if (left != 0) {
-        // Error, or there are unconvertable characters
-        buf[0] = '\0';
+	// Error, or there are unconvertable characters
+	buf[0] = '\0';
     } else {
-        buf[len] = '\0';
+	buf[len] = '\0';
     }
 
     return buf;
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/unicode_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pj/unicode_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pj/unicode_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib++-test/main.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib++-test/main.cpp
similarity index 78%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib++-test/main.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib++-test/main.cpp
index f69f4cc75a4bf3bcc3c7d2b753200a1e0d199257..6b749ad62dfba137f30cd89cc30c0d60113ab5e4 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib++-test/main.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib++-test/main.cpp
@@ -1,5 +1,5 @@
 /* $Id */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #include <pj++/file.hpp>
 #include <pj++/list.hpp>
@@ -42,20 +42,20 @@ int main()
     Pj_Caching_Pool mem;
     Pj_Pool the_pool;
     Pj_Pool *pool = &the_pool;
+    
+    the_pool.attach(mem.create_pool(4000,4000));
 
-    the_pool.attach (mem.create_pool (4000,4000));
-
-    Pj_Semaphore_Lock lsem (pool);
+    Pj_Semaphore_Lock lsem(pool);
     Pj_Semaphore_Lock *plsem;
 
-    plsem = new (pool) Pj_Semaphore_Lock (pool);
+    plsem = new(pool) Pj_Semaphore_Lock(pool);
     delete plsem;
 
-    Pj_Proactor proactor (pool, 100, 100);
+    Pj_Proactor proactor(pool, 100, 100);
 
-    My_Event_Handler *event_handler = new (the_pool) My_Event_Handler;
-    proactor.register_socket_handler (pool, event_handler);
-    proactor.unregister_handler (event_handler);
+    My_Event_Handler *event_handler = new(the_pool) My_Event_Handler;
+    proactor.register_socket_handler(pool, event_handler);
+    proactor.unregister_handler(event_handler);
 
     return 0;
 }
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/except.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-samples/except.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/except.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-samples/except.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/list.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-samples/list.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/list.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-samples/list.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/log.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-samples/log.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-samples/log.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-samples/log.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/activesock.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/activesock.c
similarity index 92%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/activesock.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/activesock.c
index 770493b1531efd9e2dfe1c5094876658d19b1231..ed6da1359514b70b20a90edc1980de1147e69063 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/activesock.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/activesock.c
@@ -1,4 +1,4 @@
-/* $Id: activesock.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: activesock.c 2804 2009-06-25 12:26:15Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -212,7 +212,11 @@ static int udp_ping_pong_test(void)
 
 	for (i=0; i<10 && last_rx1 == srv1->rx_cnt && last_rx2 == srv2->rx_cnt; ++i) {
 	    pj_time_val delay = {0, 10};
+#ifdef PJ_SYMBIAN
+	    pj_symbianos_poll(-1, 100);
+#else
 	    pj_ioqueue_poll(ioqueue, &delay);
+#endif
 	}
 
 	if (srv1->rx_err_cnt+srv1->tx_err_cnt != 0 ||
@@ -403,26 +407,47 @@ static int tcp_perf_test(void)
 	status = pj_activesock_send(asock2, &op_key->op_key, pkt, &len, 0);
 	if (status == PJ_EPENDING) {
 	    do {
+#if PJ_SYMBIAN
+		pj_symbianos_poll(-1, -1);
+#else
 		pj_ioqueue_poll(ioqueue, NULL);
+#endif
 	    } while (!state2->sent);
-	} else if (status != PJ_SUCCESS) {
-		PJ_LOG(1,("", "   err: send status=%d", status));
-	    status = -180;
-	    break;
-	} else if (status == PJ_SUCCESS) {
-	    if (len != sizeof(*pkt)) {
-		PJ_LOG(1,("", "   err: shouldn't report partial sent"));
-		status = -190;
-		break;
-	    }
+	} else {
+#if PJ_SYMBIAN
+		/* The Symbian socket always returns PJ_SUCCESS for TCP send,
+		 * eventhough the remote end hasn't received the data yet.
+		 * If we continue sending, eventually send() will block,
+		 * possibly because the send buffer is full. So we need to
+		 * poll the ioqueue periodically, to let receiver gets the 
+		 * data.
+		 */
+		pj_symbianos_poll(-1, 0);
+#endif
+		if (status != PJ_SUCCESS) {
+		    PJ_LOG(1,("", "   err: send status=%d", status));
+		    status = -180;
+		    break;
+		} else if (status == PJ_SUCCESS) {
+		    if (len != sizeof(*pkt)) {
+			PJ_LOG(1,("", "   err: shouldn't report partial sent"));
+			status = -190;
+			break;
+		    }
+		}
 	}
     }
 
     /* Wait until everything has been sent/received */
     if (state1->next_recv_seq < COUNT) {
+#ifdef PJ_SYMBIAN
+	while (pj_symbianos_poll(-1, 1000) == PJ_TRUE)
+	    ;
+#else
 	pj_time_val delay = {0, 100};
 	while (pj_ioqueue_poll(ioqueue, &delay) > 0)
 	    ;
+#endif
     }
 
     if (status == PJ_EPENDING)
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/atomic.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/atomic.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/atomic.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/atomic.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/echo_clt.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/echo_clt.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/echo_clt.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/echo_clt.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/errno.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/errno.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/errno.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/errno.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/exception.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/exception.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/exception.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/exception.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/fifobuf.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/fifobuf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/fifobuf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/fifobuf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/file.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/file.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/file.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/file.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/hash_test.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/hash_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/hash_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/hash_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_perf.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/ioq_perf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_perf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/ioq_perf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_tcp.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/ioq_tcp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_tcp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/ioq_tcp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_udp.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/ioq_udp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_udp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/ioq_udp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_unreg.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/ioq_unreg.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_unreg.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/ioq_unreg.c
index 95cfce7f66101c1910e1dbbb8cafc01e80ee6acf..bbd96dc0f94f67fbacba2bf28fbe94d492cdd598 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/ioq_unreg.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/ioq_unreg.c
@@ -1,4 +1,4 @@
-/* $Id: ioq_unreg.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: ioq_unreg.c 2816 2009-06-25 13:14:54Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -250,11 +250,12 @@ static int perform_unreg_test(pj_ioqueue_t *ioqueue,
 	    PJ_TIME_VAL_GTE(now, time_to_unregister) &&
 	    sock_data.pool) 
 	{
-	    pj_mutex_lock(sock_data.mutex);
+	    //Can't do this otherwise it'll deadlock
+	    //pj_mutex_lock(sock_data.mutex);
 
 	    sock_data.unregistered = 1;
 	    pj_ioqueue_unregister(sock_data.key);
-	    pj_mutex_unlock(sock_data.mutex);
+	    //pj_mutex_unlock(sock_data.mutex);
 	    pj_mutex_destroy(sock_data.mutex);
 	    pj_pool_release(sock_data.pool);
 	    sock_data.pool = NULL;
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/list.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/list.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/list.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/list.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_mod.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main_mod.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_mod.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main_mod.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_rtems.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main_rtems.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_rtems.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main_rtems.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main_symbian.cpp
similarity index 61%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_symbian.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main_symbian.cpp
index d1fd7828f332007e67d7ffcec79694bda0dd220a..e57b080d50a01cb2b5bab7bb61b72613ceabdc64 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_symbian.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main_symbian.cpp
@@ -25,10 +25,8 @@ int main()
     //err = test_main();
 
     if (err)
-        return err;
-
+	return err;
     return exp;
-
     //return 0;
 }
 
@@ -55,7 +53,7 @@ LOCAL_C void MainL()
     //
     test_main();
 
-    console->Printf (_L (" [press any key]\n"));
+    console->Printf(_L(" [press any key]\n"));
     console->Getch();
 
     CActiveScheduler::Stop();
@@ -63,61 +61,60 @@ LOCAL_C void MainL()
 
 class MyScheduler : public CActiveScheduler
 {
+public:
+    MyScheduler()
+    {}
 
-    public:
-        MyScheduler() {}
-
-        void Error (TInt aError) const;
+    void Error(TInt aError) const;
 };
 
-void MyScheduler::Error (TInt aError) const
+void MyScheduler::Error(TInt aError) const
 {
-    PJ_UNUSED_ARG (aError);
+    PJ_UNUSED_ARG(aError);
 }
 
 class ProgramStarter : public CActive
 {
-
-    public:
-        static ProgramStarter *NewL();
-        void Start();
-
-    protected:
-        ProgramStarter();
-        void ConstructL();
-        virtual void RunL();
-        virtual void DoCancel();
-        TInt RunError (TInt aError);
-
-    private:
-        RTimer timer_;
+public:
+    static ProgramStarter *NewL();
+    void Start();
+
+protected:
+    ProgramStarter();
+    void ConstructL();
+    virtual void RunL();
+    virtual void DoCancel();
+    TInt RunError(TInt aError);
+
+private:
+    RTimer timer_;
 };
 
 ProgramStarter::ProgramStarter()
-        : CActive (EPriorityNormal)
+: CActive(EPriorityNormal)
 {
 }
 
 void ProgramStarter::ConstructL()
 {
     timer_.CreateLocal();
-    CActiveScheduler::Add (this);
+    CActiveScheduler::Add(this);
 }
 
 ProgramStarter *ProgramStarter::NewL()
 {
     ProgramStarter *self = new (ELeave) ProgramStarter;
-    CleanupStack::PushL (self);
+    CleanupStack::PushL(self);
 
     self->ConstructL();
 
-    CleanupStack::Pop (self);
+    CleanupStack::Pop(self);
     return self;
 }
 
 void ProgramStarter::Start()
 {
-    timer_.After (iStatus, 0);
+    timer_.After(iStatus, 0);
     SetActive();
 }
 
@@ -130,74 +127,67 @@ void ProgramStarter::DoCancel()
 {
 }
 
-TInt ProgramStarter::RunError (TInt aError)
+TInt ProgramStarter::RunError(TInt aError)
 {
-    PJ_UNUSED_ARG (aError);
+    PJ_UNUSED_ARG(aError);
     return KErrNone;
 }
 
 
 LOCAL_C void DoStartL()
-{
+    {
     // Create active scheduler (to run active objects)
     CActiveScheduler* scheduler = new (ELeave) MyScheduler;
-    CleanupStack::PushL (scheduler);
-    CActiveScheduler::Install (scheduler);
+    CleanupStack::PushL(scheduler);
+    CActiveScheduler::Install(scheduler);
 
     ProgramStarter *starter = ProgramStarter::NewL();
     starter->Start();
 
     CActiveScheduler::Start();
-}
+    }
 
 
 //  Global Functions
 
-static void log_writer (int level, const char *buf, int len)
+static void log_writer(int level, const char *buf, int len)
 {
     wchar_t buf16[PJ_LOG_MAX_SIZE];
 
-    PJ_UNUSED_ARG (level);
+    PJ_UNUSED_ARG(level);
+    
+    pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16));
 
-    pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16));
-
-    TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len);
-    console->Write (aBuf);
+    TPtrC16 aBuf((const TUint16*)buf16, (TInt)len);
+    console->Write(aBuf);
 }
 
 
 GLDEF_C TInt E32Main()
-{
+    {
     // Create cleanup stack
     __UHEAP_MARK;
     CTrapCleanup* cleanup = CTrapCleanup::New();
 
     // Create output console
-    TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen)));
-
+    TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen)));
     if (createError)
         return createError;
 
-    pj_log_set_log_func (&log_writer);
+    pj_log_set_log_func(&log_writer);
 
     // Run application code inside TRAP harness, wait keypress when terminated
-    TRAPD (mainError, DoStartL());
-
+    TRAPD(mainError, DoStartL());
     if (mainError)
-        console->Printf (_L (" failed, leave code = %d"), mainError);
-
-    console->Printf (_L (" [press any key]\n"));
-
+        console->Printf(_L(" failed, leave code = %d"), mainError);
+    console->Printf(_L(" [press any key]\n"));
     console->Getch();
-
+    
     delete console;
-
     delete cleanup;
-
     __UHEAP_MARKEND;
-
     return KErrNone;
-}
+    }
 
 #endif	/* if 0 */
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/main_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/main_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/mutex.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/mutex.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/mutex.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/mutex.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/os.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/os.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/os.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/os.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/pool.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/pool.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/pool.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/pool.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/pool_perf.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/pool_perf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/pool_perf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/pool_perf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rand.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/rand.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rand.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/rand.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rbtree.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/rbtree.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rbtree.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/rbtree.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rtems_network_config.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/rtems_network_config.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/rtems_network_config.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/rtems_network_config.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/select.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/select.c
similarity index 97%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/select.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/select.c
index f9f37b96a083abb5415ff4785c3142a8eba8af2f..935168ec936a1436e4359264b8bd980e3b8687fc 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/select.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/select.c
@@ -1,4 +1,4 @@
-/* $Id: select.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: select.c 2820 2009-06-29 11:35:40Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -142,6 +142,9 @@ int select_test()
 	status=-40; goto on_return;
     }
 
+    // Sleep a bit. See http://trac.pjsip.org/repos/ticket/908
+    pj_thread_sleep(10);
+
     // Check that socket is marked as reable.
     // Note that select() may also report that sockets are writable.
     status = do_select(udp1, udp2, setcount);
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sleep.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/sleep.c
similarity index 83%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sleep.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/sleep.c
index 46a1e06780abd99980c28560985958aa90a626ee..11c3db98afcf907acea001fa199cbcb82216869c 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sleep.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/sleep.c
@@ -1,4 +1,4 @@
-/* $Id: sleep.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: sleep.c 2805 2009-06-25 12:29:04Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -55,19 +55,35 @@
 
 static int simple_sleep_test(void)
 {
-    enum { COUNT = 5 };
+    enum { COUNT = 10 };
     int i;
     pj_status_t rc;
     
     PJ_LOG(3,(THIS_FILE, "..will write messages every 1 second:"));
     
     for (i=0; i<COUNT; ++i) {
+	pj_time_val tv;
+	pj_parsed_time pt;
+
 	rc = pj_thread_sleep(1000);
 	if (rc != PJ_SUCCESS) {
 	    app_perror("...error: pj_thread_sleep()", rc);
 	    return -10;
 	}
-	PJ_LOG(3,(THIS_FILE, "...wake up.."));
+
+	rc = pj_gettimeofday(&tv);
+	if (rc != PJ_SUCCESS) {
+	    app_perror("...error: pj_gettimeofday()", rc);
+	    return -11;
+	}
+
+	pj_time_decode(&tv, &pt);
+
+	PJ_LOG(3,(THIS_FILE, 
+		  "...%04d-%02d-%02d %02d:%02d:%02d.%03d",
+		  pt.year, pt.mon, pt.day,
+		  pt.hour, pt.min, pt.sec, pt.msec));
+
     }
 
     return 0;
@@ -75,13 +91,15 @@ static int simple_sleep_test(void)
 
 static int sleep_duration_test(void)
 {
-    enum { MIS = 20, DURATION = 1000, DURATION2 = 500 };
+    enum { MIS = 20};
+    unsigned duration[] = { 2000, 1000, 500, 200, 100 };
+    unsigned i;
     pj_status_t rc;
 
     PJ_LOG(3,(THIS_FILE, "..running sleep duration test"));
 
     /* Test pj_thread_sleep() and pj_gettimeofday() */
-    {
+    for (i=0; i<PJ_ARRAY_SIZE(duration); ++i) {
         pj_time_val start, stop;
 	pj_uint32_t msec;
 
@@ -93,7 +111,7 @@ static int sleep_duration_test(void)
         }
 
         /* Sleep */
-        rc = pj_thread_sleep(DURATION);
+        rc = pj_thread_sleep(duration[i]);
         if (rc != PJ_SUCCESS) {
             app_perror("...error: pj_thread_sleep()", rc);
             return -20;
@@ -109,20 +127,20 @@ static int sleep_duration_test(void)
 	msec = PJ_TIME_VAL_MSEC(stop);
 
 	/* Check if it's within range. */
-	if (msec < DURATION * (100-MIS)/100 ||
-	    msec > DURATION * (100+MIS)/100)
+	if (msec < duration[i] * (100-MIS)/100 ||
+	    msec > duration[i] * (100+MIS)/100)
 	{
 	    PJ_LOG(3,(THIS_FILE, 
 		      "...error: slept for %d ms instead of %d ms "
 		      "(outside %d%% err window)",
-		      msec, DURATION, MIS));
+		      msec, duration[i], MIS));
 	    return -30;
 	}
     }
 
 
     /* Test pj_thread_sleep() and pj_get_timestamp() and friends */
-    {
+    for (i=0; i<PJ_ARRAY_SIZE(duration); ++i) {
 	pj_time_val t1, t2;
         pj_timestamp start, stop;
 	pj_uint32_t msec;
@@ -140,7 +158,7 @@ static int sleep_duration_test(void)
 	pj_gettimeofday(&t1);
 
         /* Sleep */
-        rc = pj_thread_sleep(DURATION2);
+        rc = pj_thread_sleep(duration[i]);
         if (rc != PJ_SUCCESS) {
             app_perror("...error: pj_thread_sleep()", rc);
             return -70;
@@ -162,13 +180,13 @@ static int sleep_duration_test(void)
         msec = pj_elapsed_msec(&start, &stop);
 
 	/* Check if it's within range. */
-	if (msec < DURATION2 * (100-MIS)/100 ||
-	    msec > DURATION2 * (100+MIS)/100)
+	if (msec < duration[i] * (100-MIS)/100 ||
+	    msec > duration[i] * (100+MIS)/100)
 	{
 	    PJ_LOG(3,(THIS_FILE, 
 		      "...error: slept for %d ms instead of %d ms "
 		      "(outside %d%% err window)",
-		      msec, DURATION2, MIS));
+		      msec, duration[i], MIS));
 	    PJ_TIME_VAL_SUB(t2, t1);
 	    PJ_LOG(3,(THIS_FILE, 
 		      "...info: gettimeofday() reported duration is "
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sock.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/sock.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sock.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/sock.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sock_perf.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/sock_perf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/sock_perf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/sock_perf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/string.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/string.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/string.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/string.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/test.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/test.h b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/test.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/test.h
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/test.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/thread.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/thread.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/thread.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/thread.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/timer.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/timer.c
similarity index 93%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/timer.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/timer.c
index f378091b746343aa0edb891dd22caed6571bcc80..5409172abe3864fc8fda3cd39198aeb93640c91f 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/timer.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/timer.c
@@ -1,4 +1,4 @@
-/* $Id: timer.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: timer.c 2817 2009-06-25 13:18:36Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -139,7 +139,16 @@ static int test_timer_heap(void)
 	    pj_gettimeofday(&now);
 
 	    pj_get_timestamp(&t1);
+#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+	    /* On Symbian, we must use OS poll (Active Scheduler poll) since 
+	     * timer is implemented using Active Object.
+	     */
+	    rc = 0;
+	    while (pj_symbianos_poll(-1, 0))
+		++rc;
+#else
 	    rc = pj_timer_heap_poll(timer, NULL);
+#endif
 	    pj_get_timestamp(&t2);
 	    if (rc > 0) {
 		done += rc;
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/timestamp.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/timestamp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/timestamp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/timestamp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_sync.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/udp_echo_srv_sync.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/udp_echo_srv_sync.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/udp_echo_srv_sync.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/util.c b/sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/util.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjlib/src/pjlib-test/util.c
rename to sflphone-common/libs/pjproject-1.0.3/pjlib/src/pjlib-test/util.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/README.txt b/sflphone-common/libs/pjproject-1.0.3/pjmedia/README.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/README.txt
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/README.txt
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/Jbtest.dat b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/Jbtest.dat
new file mode 100644
index 0000000000000000000000000000000000000000..3e2169c433078b38ced52575f88d92a21976c79c
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/Jbtest.dat
@@ -0,0 +1,324 @@
+= Ideal condition
+%adaptive 0 0 10
+!burst	    1
+!discard    0
+!lost	    0
+!empty	    0
+!delay	    1
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+.
+
+= DTX
+%adaptive 0 0 10
+!burst	    1
+!discard    0
+!lost	    0
+!empty	    20
+!delay	    1
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG
+# Start silence
+GGGGGGGGGGGGGGGGGGGG
+# End silence
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG
+.
+
+= Regular burst (three gets three puts)
+%adaptive 0 0 10
+!burst	    3
+!discard    0
+!lost	    0
+!empty	    0
+!delay	    3
+PPPGGGPPPGGGPPPGGG PPPGGGPPPGGGPPPGGG PPPGGGPPPGGGPPPGGG PPPGGGPPPGGGPPPGGG
+PPPGGGPPPGGGPPPGGG PPPGGGPPPGGGPPPGGG PPPGGGPPPGGGPPPGGG PPPGGGPPPGGGPPPGGG
+.
+
+= Random burst (no drift)
+%adaptive 0 0 10
+!burst	    4
+!discard    1 <- there may be delay adaptation caused by multiple empty GETs followed by multiple PUTs, later when burst level reaches 'stable' condition, JB may shrink some excess frames
+!lost	    0
+!empty	    4
+!delay	    4
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+.
+
+= Random burst (with drift, PUT > GET)
+%adaptive 0 0 10
+!burst	    4
+!discard    68 <- number of PUT - GET, JB does shrinking by discarding frames
+!lost	    0
+!empty	    4
+!delay	    8  <- should be less than or equal to twice of burst
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+P PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG P PGPGPPGGPPPPGGPGGGPG 
+P PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG P PGGGGPPPGPPGPPPGGPGG 
+.
+
+= Random burst (with drift, PUT < GET)
+%adaptive 0 0 10
+!burst	    4
+!discard    0
+!lost	    0
+!empty	    70 <- GET - PUT = 66, added 4 for tolerating empty caused by burst
+!delay	    4  <- should be less than or equal to burst
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+G PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG G PGGGGPPPGPPGPPPGGPGG 
+G PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG G PGPGPPGGPPPPGGPGGGPG 
+.
+
+= Packet lost
+%adaptive 0 0 10
+!burst	    1
+!discard    0
+!lost	    7
+!empty	    3
+!delay	    3
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG
+# Some losts
+LGPGPGLGPGPGPGLGPGPG
+# Normal
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG
+# More losts
+PLPGGGPPPGGGPLPGGGPG PLPGGGPPPGGGPLPGGGPG
+# Normal
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG
+.
+
+= Sequence restart
+%adaptive 0 0 10
+!burst	    1
+!discard    0
+!lost	    0
+!empty	    0
+!delay	    1
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+# seq restarted after 120 PUTs (default MAX_MISORDER == 100)
+R
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+.
+
+= Duplicated frames
+= e.g.: some Forward Error Correction (FEC) methods.
+%adaptive 0 0 10
+!burst	    1
+!discard    40
+!lost	    0
+!empty	    0
+!delay	    1
+PDGPDGPDGPDGPDG PDGPDGPDGPDGPDG PDGPDGPDGPDGPDG PDGPDGPDGPDGPDG
+PDGPDGPDGPDGPDG PDGPDGPDGPDGPDG PDGPDGPDGPDGPDG PDGPDGPDGPDGPDG
+.
+
+= Late frames
+%adaptive 0 0 10
+!burst	    1
+!discard    8  <- late frames are discarded + delay adaptation
+!lost	    4
+!empty	    4
+!delay	    4
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+# Suddenly there are some lost frames
+LGLGPGLGLGPG
+# Those lost frames are actually late (+misordered), here they come
+OOOO
+# Then back to normal
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG 
+.
+
+= PUT burst at the beginning
+%adaptive 0 0 10
+!burst	    1
+!discard    50 <- frames discarded for delay adaptation
+!lost	    0
+!empty	    0
+!delay	    25 <- average delay, JB is able to adapt the delay
+PPPPPPPPPPPPPPPPPPPP PPPPPPPPPPPPPPPPPPPP PPPPPPPPPP
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+.
+
+= Fixed mode prefetch 5, with two empty events
+%fixed 5
+!burst	    1
+!discard    0
+!lost	    0
+!empty	    10
+!delay	    5
+G
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+GGGGG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+.
+
+= Fixed mode prefetch 5, with random burst
+%fixed 5
+!burst	    3
+!discard    0
+!lost	    0
+!empty	    5
+!delay	    5
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+PGPGPPGGPPPPGGPGGGPG PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPPPGGPGGGPG 
+PGGGGPPPGPPGPPPGGPGG PGPGPPGGPPGGPPPGGGPG PGGGGPPPGPPGPPPGGPGG 
+.
+
+= Fixed mode prefetch 10, PUT burst at the beginning
+%fixed 10
+!burst	    1
+!discard    35 <- frames discarded for delay adaptation
+!lost	    0
+!empty	    0
+!delay	    30 <- average delay
+PPPPPPPPPPPPPPPPPPPP PPPPPPPPPPPPPPPPPPPP PPPPPPPPPP
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+PGPGPGPGPGPGPGPGPGPG PGPGPGPGPGPGPGPGPGPG PGPGPGPGPG
+.
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/Makefile b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/m-i386.mak b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/m-i386.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/m-i386.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/m-i386.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/m-x86_64.mak b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/m-x86_64.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/m-x86_64.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/m-x86_64.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-auto.mak.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-auto.mak.in
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-auto.mak.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-darwinos.mak b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-darwinos.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-darwinos.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-darwinos.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-linux.mak b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-linux.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-linux.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-linux.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-rtems.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-rtems.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-rtems.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-win32.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/os-win32.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/os-win32.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjaut.dsp b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjaut.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjaut.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjaut.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.dsp b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.dsw b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia.dsw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.dsw
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia.dsw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_codec.dsp b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia_codec.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_codec.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia_codec.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_codec.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia_codec.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_codec.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia_codec.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_test.dsp b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia_test.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_test.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia_test.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_test.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia_test.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/pjmedia_test.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/pjmedia_test.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_codec_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/wince-evc4/pjmedia_codec_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_codec_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/wince-evc4/pjmedia_codec_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_test.vcp b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/wince-evc4/pjmedia_test.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_test.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/wince-evc4/pjmedia_test.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/wince-evc4/pjmedia_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/wince-evc4/pjmedia_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_wince.vcw b/sflphone-common/libs/pjproject-1.0.3/pjmedia/build/wince-evc4/pjmedia_wince.vcw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/build/wince-evc4/pjmedia_wince.vcw
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/build/wince-evc4/pjmedia_wince.vcw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/doxygen.cfg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/doxygen.cfg
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/doxygen.cfg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/footer.html b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/footer.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/footer.html
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/footer.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/header.html b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/header.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/header.html
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/header.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/master-port.jpg b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/master-port.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/master-port.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/master-port.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-flow.jpg b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/media-flow.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-flow.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/media-flow.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-flow.vsd b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/media-flow.vsd
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-flow.vsd
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/media-flow.vsd
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-srtp-transport.PNG b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/media-srtp-transport.PNG
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-srtp-transport.PNG
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/media-srtp-transport.PNG
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-transport.PNG b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/media-transport.PNG
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/media-transport.PNG
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/media-transport.PNG
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/sample-manual-resampling.jpg b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/sample-manual-resampling.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/sample-manual-resampling.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/sample-manual-resampling.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/siprtp.jpg b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/siprtp.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/siprtp.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/siprtp.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/sndtest.jpg b/sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/sndtest.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/docs/sndtest.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/docs/sndtest.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/amr_helper.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/amr_helper.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/amr_helper.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/amr_helper.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/config.h
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/config.h
index 3b1af93cb6866bc36b5d51e068d727530fa62140..88847b9c4e01e6071aa94266e680ecf7570bc0f4 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/config.h
@@ -1,5 +1,5 @@
 /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #ifndef __PJMEDIA_CODEC_CONFIG_H__
 #define __PJMEDIA_CODEC_CONFIG_H__
@@ -118,7 +118,7 @@
 
 /**
  * Enable Intel IPP AMR codec. This also needs to be enabled when AMR WB
- * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP
+ * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP 
  * is enabled.
  *
  * Default: 1
@@ -130,7 +130,7 @@
 
 /**
  * Enable Intel IPP AMR wideband codec. The PJMEDIA_HAS_INTEL_IPP_CODEC_AMR
- * option must also be enabled to use this codec. This option is only used
+ * option must also be enabled to use this codec. This option is only used 
  * when PJMEDIA_HAS_INTEL_IPP is enabled.
  *
  * Default: 1
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config_auto.h.in b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/config_auto.h.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/config_auto.h.in
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/config_auto.h.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/g722.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/g722.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/g722.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/g722.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/gsm.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/gsm.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/gsm.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/gsm.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/ilbc.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/ilbc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/ilbc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/ilbc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/ipp_codecs.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/ipp_codecs.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/ipp_codecs.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/ipp_codecs.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/l16.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/l16.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/l16.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/l16.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/speex.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/speex.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/speex.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/speex.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/types.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia-codec/types.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia-codec/types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/alaw_ulaw.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/alaw_ulaw.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/alaw_ulaw.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/alaw_ulaw.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/bidirectional.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/bidirectional.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/bidirectional.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/bidirectional.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/circbuf.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/circbuf.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/circbuf.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/circbuf.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/clock.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/clock.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/clock.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/clock.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/codec.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/codec.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/codec.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/codec.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/conference.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/conference.h
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/conference.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/conference.h
index 3206ce614b886520d6e0fc95635f3971c1b4f7b6..7c296adc98b9762caf5c026ff3c65b4cb2ea5eba 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/conference.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/conference.h
@@ -1,4 +1,4 @@
-/* $Id: conference.h 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: conference.h 2790 2009-06-24 15:26:59Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -224,6 +224,9 @@ PJ_DECL(pj_status_t) pjmedia_conf_add_port( pjmedia_conf *conf,
 
 
 /**
+ * <i><b>Warning:</b> This API has been deprecated since 1.3 and will be
+ * removed in the future release, use #PJMEDIA_SPLITCOMB instead.</i>
+ *
  * Create and add a passive media port to the conference bridge. Unlike
  * "normal" media port that is added with #pjmedia_conf_add_port(), media
  * port created with this function will not have its get_frame() and
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/config.h
similarity index 96%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/config.h
index d52d0996ae7cc5cfe829e18ab94dfb14adcebf56..866359e4c1a64489a0e49b6366d90a88725e35ac 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/config.h
@@ -1,5 +1,5 @@
 /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #ifndef __PJMEDIA_CONFIG_H__
 #define __PJMEDIA_CONFIG_H__
@@ -60,7 +60,7 @@
 /** Constant for Win32 MME sound backend. */
 #define PJMEDIA_SOUND_WIN32_MME_SOUND	    3
 
-/** When this is set, pjmedia will not provide any sound device backend.
+/** When this is set, pjmedia will not provide any sound device backend. 
  *  Application will have to provide its own sound device backend
  *  and link the application with it.
  */
@@ -106,7 +106,7 @@
 
 /**
  * Specify whether delay buffer is used for sound device.
- * When delay buffer is enabled, the sound device callback
+ * When delay buffer is enabled, the sound device callback 
  * will be called one after another evenly.
  * The delay buffer also performs the best delay calculation
  * for the sound device, and will try to limit the delay caused
@@ -137,21 +137,21 @@
 /**
  * This denotes implementation of WSOLA using fixed or floating point WSOLA
  * algorithm. This implementation provides the best quality of the result,
- * at the expense of one frame delay and intensive processing power
+ * at the expense of one frame delay and intensive processing power 
  * requirement.
  */
 #define PJMEDIA_WSOLA_IMP_WSOLA		    1
 
 /**
- * This denotes implementation of WSOLA algorithm with faster waveform
- * similarity calculation. This implementation provides fair quality of
+ * This denotes implementation of WSOLA algorithm with faster waveform 
+ * similarity calculation. This implementation provides fair quality of 
  * the result with the main advantage of low processing power requirement.
  */
 #define PJMEDIA_WSOLA_IMP_WSOLA_LITE	    2
 
 /**
  * Specify type of Waveform based Similarity Overlap and Add (WSOLA) backend
- * implementation to be used. WSOLA is an algorithm to expand and/or compress
+ * implementation to be used. WSOLA is an algorithm to expand and/or compress 
  * audio frames without changing the pitch, and used by the delaybuf and as PLC
  * backend algorithm.
  *
@@ -165,7 +165,7 @@
 /**
  * Specify number of sound buffers. Larger number is better for sound
  * stability and to accommodate sound devices that are unable to send frames
- * in timely manner, however it would probably cause more audio delay (and
+ * in timely manner, however it would probably cause more audio delay (and 
  * definitely will take more memory). One individual buffer is normally 10ms
  * or 20 ms long, depending on ptime settings (samples_per_frame value).
  *
@@ -248,13 +248,13 @@
  */
 #define PJMEDIA_RESAMPLE_NONE		    1	/**< No resampling.	    */
 #define PJMEDIA_RESAMPLE_LIBRESAMPLE	    2	/**< Sample rate conversion 
-using libresample.  */
+						     using libresample.  */
 #define PJMEDIA_RESAMPLE_SPEEX		    3	/**< Sample rate conversion 
-using Speex. */
+						     using Speex. */
 #define PJMEDIA_RESAMPLE_LIBSAMPLERATE	    4	/**< Sample rate conversion 
-using libsamplerate
-(a.k.a Secret Rabbit Code)
-*/
+						     using libsamplerate 
+						     (a.k.a Secret Rabbit Code)
+						 */
 
 /**
  * Select which resample implementation to use. Currently pjmedia supports:
@@ -294,7 +294,7 @@ using libsamplerate
  * This (among other thing) will affect the size of buffers to be allocated
  * for outgoing packets.
  */
-#ifndef PJMEDIA_MAX_FRAME_DURATION_MS
+#ifndef PJMEDIA_MAX_FRAME_DURATION_MS   
 #   define PJMEDIA_MAX_FRAME_DURATION_MS   	200
 #endif
 
@@ -302,7 +302,7 @@ using libsamplerate
 /**
  * Max packet size to support.
  */
-#ifndef PJMEDIA_MAX_MTU
+#ifndef PJMEDIA_MAX_MTU			
 #  define PJMEDIA_MAX_MTU			1500
 #endif
 
@@ -310,7 +310,7 @@ using libsamplerate
 /**
  * DTMF/telephone-event duration, in timestamp.
  */
-#ifndef PJMEDIA_DTMF_DURATION
+#ifndef PJMEDIA_DTMF_DURATION		
 #  define PJMEDIA_DTMF_DURATION			1600	/* in timestamp */
 #endif
 
@@ -320,7 +320,7 @@ using libsamplerate
  * remote address required to make the stream switch transmission
  * to the source address.
  */
-#ifndef PJMEDIA_RTP_NAT_PROBATION_CNT
+#ifndef PJMEDIA_RTP_NAT_PROBATION_CNT	
 #  define PJMEDIA_RTP_NAT_PROBATION_CNT		10
 #endif
 
@@ -361,9 +361,9 @@ using libsamplerate
 
 /**
  * Specify whether RTCP XR support should be built into PJMEDIA. Disabling
- * this feature will reduce footprint slightly. Note that even when this
- * setting is enabled, RTCP XR processing will only be performed in stream
- * if it is enabled on run-time on per stream basis. See
+ * this feature will reduce footprint slightly. Note that even when this 
+ * setting is enabled, RTCP XR processing will only be performed in stream 
+ * if it is enabled on run-time on per stream basis. See  
  * PJMEDIA_STREAM_ENABLE_XR setting for more info.
  *
  * Default: 1 (yes).
@@ -375,7 +375,7 @@ using libsamplerate
 
 /**
  * The RTCP XR feature is activated and used by stream if \a enable_rtcp_xr
- * field of \a pjmedia_stream_info structure is non-zero. This setting
+ * field of \a pjmedia_stream_info structure is non-zero. This setting 
  * controls the default value of this field.
  *
  * Default: 0 (disabled)
@@ -394,7 +394,7 @@ using libsamplerate
  *
  * Specify zero to disable this feature.
  *
- * Default: 600 msec (which gives good probability that some RTP
+ * Default: 600 msec (which gives good probability that some RTP 
  *                    packets will reach the destination, but without
  *                    filling up the jitter buffer on the remote end).
  */
@@ -404,13 +404,13 @@ using libsamplerate
 
 
 /**
- * Specify the maximum duration of silence period in the codec, in msec.
+ * Specify the maximum duration of silence period in the codec, in msec. 
  * This is useful for example to keep NAT binding open in the firewall
- * and to prevent server from disconnecting the call because no
+ * and to prevent server from disconnecting the call because no 
  * RTP packet is received.
  *
  * This only applies to codecs that use PJMEDIA's VAD (pretty much
- * everything including iLBC, except Speex, which has its own DTX
+ * everything including iLBC, except Speex, which has its own DTX 
  * mechanism).
  *
  * Use (-1) to disable this feature.
@@ -462,7 +462,7 @@ using libsamplerate
  * remote, or should it rather use the codec preference as specified by
  * local endpoint.
  *
- * For example, suppose incoming call has codec order "8 0 3", while
+ * For example, suppose incoming call has codec order "8 0 3", while 
  * local codec order is "3 0 8". If remote codec order is preferable,
  * the selected codec will be 8, while if local codec order is preferable,
  * the selected codec will be 3.
@@ -490,7 +490,7 @@ using libsamplerate
 
 
 /**
- * This macro controls whether pjmedia should include SDP rtpmap
+ * This macro controls whether pjmedia should include SDP rtpmap 
  * attribute for static payload types. SDP rtpmap for static
  * payload types are optional, although they are normally included
  * for interoperability reason.
@@ -544,12 +544,12 @@ using libsamplerate
 #endif
 
 
-/*
+/* 
  * Below specifies the various tone generator backend algorithm.
  */
 
-/**
- * The math's sine(), floating point. This has very good precision
+/** 
+ * The math's sine(), floating point. This has very good precision 
  * but it's the slowest and requires floating point support and
  * linking with the math library.
  */
@@ -565,7 +565,7 @@ using libsamplerate
 /**
  * Fixed point using sine signal generated by Cordic algorithm. This
  * algorithm can be tuned to provide balance between precision and
- * performance by tuning the PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP
+ * performance by tuning the PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP 
  * setting, and may be suitable for platforms that lack floating-point
  * support.
  */
@@ -580,7 +580,7 @@ using libsamplerate
 
 
 /**
- * Specify the tone generator algorithm to be used. Please see
+ * Specify the tone generator algorithm to be used. Please see 
  * http://trac.pjsip.org/repos/wiki/Tone_Generator for the performance
  * analysis results of the various tone generator algorithms.
  *
@@ -600,7 +600,7 @@ using libsamplerate
 /**
  * Specify the number of calculation loops to generate the tone, when
  * PJMEDIA_TONEGEN_FIXED_POINT_CORDIC algorithm is used. With more calculation
- * loops, the tone signal gets more precise, but this will add more
+ * loops, the tone signal gets more precise, but this will add more 
  * processing.
  *
  * Valid values are 1 to 28.
@@ -688,8 +688,8 @@ using libsamplerate
 
 /**
  * Transport info (pjmedia_transport_info) contains a socket info and list
- * of transport specific info, since transports can be chained together
- * (for example, SRTP transport uses UDP transport as the underlying
+ * of transport specific info, since transports can be chained together 
+ * (for example, SRTP transport uses UDP transport as the underlying 
  * transport). This constant specifies maximum number of transport specific
  * infos that can be held in a transport info.
  */
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config_auto.h.in b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/config_auto.h.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/config_auto.h.in
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/config_auto.h.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/delaybuf.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/delaybuf.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/delaybuf.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/delaybuf.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/doxygen.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/doxygen.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/doxygen.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/doxygen.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/echo.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/echo.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/echo.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/echo.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/echo_port.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/echo_port.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/echo_port.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/echo_port.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/endpoint.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/endpoint.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/endpoint.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/endpoint.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/errno.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/errno.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/errno.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/errno.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/g711.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/g711.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/g711.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/g711.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/jbuf.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/jbuf.h
similarity index 95%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/jbuf.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/jbuf.h
index a941ae0d8112addf80a7bba602d2ef155fd561d6..99e4728e752b4567bfba49d333f5502f724ac7a5 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/jbuf.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/jbuf.h
@@ -1,4 +1,4 @@
-/* $Id: jbuf.h 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: jbuf.h 2788 2009-06-24 14:46:36Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -66,19 +66,28 @@ typedef enum pjmedia_jb_frame_type pjmedia_jb_frame_type;
 
 
 /**
- * This structure describes jitter buffer current status.
+ * This structure describes jitter buffer state.
  */
 struct pjmedia_jb_state
 {
+    /* Setting */
     unsigned	frame_size;	    /**< Individual frame size, in bytes.   */
-    unsigned	prefetch;	    /**< Current prefetch value, in frames  */
     unsigned	min_prefetch;	    /**< Minimum allowed prefetch, in frms. */
     unsigned	max_prefetch;	    /**< Maximum allowed prefetch, in frms. */
+
+    /* Status */
+    unsigned	prefetch;	    /**< Current prefetch value, in frames  */
     unsigned	size;		    /**< Current buffer size, in frames.    */
+
+    /* Statistic */
     unsigned	avg_delay;	    /**< Average delay, in ms.		    */
     unsigned	min_delay;	    /**< Minimum delay, in ms.		    */
     unsigned	max_delay;	    /**< Maximum delay, in ms.		    */
-    unsigned	dev_delay;	    /**< Standard deviation of delay, in ms. */
+    unsigned	dev_delay;	    /**< Standard deviation of delay, in ms.*/
+    unsigned	avg_burst;	    /**< Average burst, in frames.	    */
+    unsigned	lost;		    /**< Number of lost frames.		    */
+    unsigned	discard;	    /**< Number of discarded frames.	    */
+    unsigned	empty;		    /**< Number of empty on GET events.	    */
 };
 
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/master_port.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/master_port.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/master_port.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/master_port.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/mem_port.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/mem_port.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/mem_port.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/mem_port.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/null_port.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/null_port.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/null_port.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/null_port.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/plc.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/plc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/plc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/plc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/port.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/port.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/port.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/port.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/resample.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/resample.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/resample.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/resample.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtcp.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/rtcp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtcp.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/rtcp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtcp_xr.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/rtcp_xr.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtcp_xr.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/rtcp_xr.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtp.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/rtp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/rtp.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/rtp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sdp.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/sdp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sdp.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/sdp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sdp_neg.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/sdp_neg.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sdp_neg.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/sdp_neg.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/session.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/session.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/session.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/session.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/silencedet.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/silencedet.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/silencedet.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/silencedet.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sound.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/sound.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sound.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/sound.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sound_port.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/sound_port.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/sound_port.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/sound_port.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/splitcomb.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/splitcomb.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/splitcomb.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/splitcomb.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/stereo.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/stereo.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/stereo.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/stereo.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/stream.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/stream.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/stream.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/stream.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/symbian_sound_aps.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/symbian_sound_aps.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/symbian_sound_aps.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/symbian_sound_aps.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/tonegen.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/tonegen.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/tonegen.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/tonegen.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_adapter_sample.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_adapter_sample.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_adapter_sample.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_adapter_sample.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_ice.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_ice.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_ice.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_ice.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_loop.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_loop.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_loop.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_loop.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_srtp.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_srtp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_srtp.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_srtp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_udp.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_udp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/transport_udp.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/transport_udp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/types.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/types.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wav_playlist.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/wav_playlist.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wav_playlist.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/wav_playlist.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wav_port.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/wav_port.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wav_port.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/wav_port.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wave.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/wave.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wave.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/wave.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wsola.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/wsola.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/include/pjmedia/wsola.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/include/pjmedia/wsola.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722.c
index 033317d608e1a6e3eb1be4e1b9ae9112e237ab6f..ff8483bf092b3f62ef4e6e407cce72c591ee2c01 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722.c
@@ -1,4 +1,4 @@
-/* $Id: g722.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: g722.c 2792 2009-06-24 15:46:49Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -552,8 +552,8 @@ static pj_status_t g722_codec_encode(pjmedia_codec *codec,
 						(input->size >> 1),
 						NULL);
 	if (is_silence &&
-	    PJMEDIA_CODEC_MAX_SILENCE_PERIOD != -1 &&
-	    silence_duration < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*16000/1000) 
+	    (PJMEDIA_CODEC_MAX_SILENCE_PERIOD == -1 ||
+	     silence_duration < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*16000/1000))
 	{
 	    output->type = PJMEDIA_FRAME_TYPE_NONE;
 	    output->buf = NULL;
@@ -578,6 +578,7 @@ static pj_status_t g722_codec_encode(pjmedia_codec *codec,
     }
 
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
+    output->timestamp = input->timestamp;
     
     TRACE_((THIS_FILE, "G722 encode(): size=%d", output->size));
     return PJ_SUCCESS;
@@ -624,6 +625,7 @@ static pj_status_t g722_codec_decode(pjmedia_codec *codec,
     pj_assert(output->size == SAMPLES_PER_FRAME);
     output->size = SAMPLES_PER_FRAME * 2;
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
+    output->timestamp = input->timestamp;
 
 #if !PLC_DISABLED
     if (g722_data->plc_enabled)
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_dec.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722/g722_dec.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_dec.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722/g722_dec.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_dec.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722/g722_dec.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_dec.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722/g722_dec.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_enc.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722/g722_enc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_enc.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722/g722_enc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_enc.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722/g722_enc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/g722/g722_enc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/g722/g722_enc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/gsm.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/gsm.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/gsm.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/gsm.c
index 19e6b0394c950cc7bb7b7d50e27cd2d45690b89b..f56b1e949b53813476fb92c37f7b5034b88b10ad 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/gsm.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/gsm.c
@@ -1,4 +1,4 @@
-/* $Id: gsm.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: gsm.c 2792 2009-06-24 15:46:49Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -542,8 +542,8 @@ static pj_status_t gsm_codec_encode( pjmedia_codec *codec,
 						(input->size >> 1),
 						NULL);
 	if (is_silence &&
-	    PJMEDIA_CODEC_MAX_SILENCE_PERIOD != -1 &&
-	    silence_duration < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*8000/1000) 
+	    (PJMEDIA_CODEC_MAX_SILENCE_PERIOD == -1 ||
+	     silence_duration < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*8000/1000))
 	{
 	    output->type = PJMEDIA_FRAME_TYPE_NONE;
 	    output->buf = NULL;
@@ -566,6 +566,7 @@ static pj_status_t gsm_codec_encode( pjmedia_codec *codec,
     }
 
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
+    output->timestamp = input->timestamp;
 
     return PJ_SUCCESS;
 }
@@ -595,6 +596,7 @@ static pj_status_t gsm_codec_decode( pjmedia_codec *codec,
 
     output->size = 320;
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
+    output->timestamp = input->timestamp;
 
 #if !PLC_DISABLED
     if (gsm_data->plc_enabled)
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ilbc.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/ilbc.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ilbc.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/ilbc.c
index ff004aa734d99f973bb6a86538d85caf912b14c3..7feb1370c850d8679aac47abe514e8b5b5e8a9af 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ilbc.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/ilbc.c
@@ -1,4 +1,4 @@
-/* $Id: ilbc.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: ilbc.c 2792 2009-06-24 15:46:49Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -563,8 +563,8 @@ static pj_status_t ilbc_codec_encode(pjmedia_codec *codec,
 						(input->size >> 1),
 						NULL);
 	if (is_silence &&
-	    PJMEDIA_CODEC_MAX_SILENCE_PERIOD != -1 &&
-	    silence_period < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*8000/1000)
+	    (PJMEDIA_CODEC_MAX_SILENCE_PERIOD == -1 ||
+	     silence_period < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*8000/1000))
 	{
 	    output->type = PJMEDIA_FRAME_TYPE_NONE;
 	    output->buf = NULL;
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ipp_codecs.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/ipp_codecs.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ipp_codecs.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/ipp_codecs.c
index 2ae0654012e2ddde699b89fd0ff1553055fd062b..34948362ae20395c0cc84afeb25e9c4393829b45 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/ipp_codecs.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/ipp_codecs.c
@@ -1,4 +1,4 @@
-/* $Id: ipp_codecs.c 2543 2009-03-23 13:22:45Z nanang $ */
+/* $Id: ipp_codecs.c 2792 2009-06-24 15:46:49Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -1172,9 +1172,9 @@ static pj_status_t ipp_codec_encode( pjmedia_codec *codec,
 						(input->size >> 1),
 						NULL);
 	if (is_silence &&
-	    PJMEDIA_CODEC_MAX_SILENCE_PERIOD != -1 &&
-	    silence_duration < (PJMEDIA_CODEC_MAX_SILENCE_PERIOD *
-				(int)ippc->clock_rate / 1000)) 
+	    (PJMEDIA_CODEC_MAX_SILENCE_PERIOD == -1 ||
+	     silence_duration < (PJMEDIA_CODEC_MAX_SILENCE_PERIOD *
+	 			 (int)ippc->clock_rate / 1000)))
 	{
 	    output->type = PJMEDIA_FRAME_TYPE_NONE;
 	    output->buf = NULL;
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/l16.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/l16.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/l16.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/l16.c
index c4aee2ab9d436298f05751156da0579ab1199a6d..4e8d187d7d145bd7490099d9c9708368ff5d49c9 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/l16.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/l16.c
@@ -1,4 +1,4 @@
-/* $Id: l16.c 2547 2009-03-23 13:27:54Z nanang $ */
+/* $Id: l16.c 2792 2009-06-24 15:46:49Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -624,9 +624,9 @@ static pj_status_t l16_encode(pjmedia_codec *codec,
 						(input->size >> 1),
 						NULL);
 	if (is_silence &&
-	    PJMEDIA_CODEC_MAX_SILENCE_PERIOD != -1 &&
-	    silence_duration < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*
-			       (int)data->clock_rate/1000)
+	    (PJMEDIA_CODEC_MAX_SILENCE_PERIOD == -1 ||
+	     silence_duration < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*
+			        (int)data->clock_rate/1000))
 	{
 	    output->type = PJMEDIA_FRAME_TYPE_NONE;
 	    output->buf = NULL;
@@ -650,6 +650,7 @@ static pj_status_t l16_encode(pjmedia_codec *codec,
     /* Done */
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
     output->size = input->size;
+    output->timestamp = input->timestamp;
 
     return PJ_SUCCESS;
 }
@@ -684,6 +685,7 @@ static pj_status_t l16_decode(pjmedia_codec *codec,
 
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
     output->size = input->size;
+    output->timestamp = input->timestamp;
 
 #if !PLC_DISABLED
     if (l16_data->plc_enabled)
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/speex_codec.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/speex_codec.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia-codec/speex_codec.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia-codec/speex_codec.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/alaw_ulaw.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/alaw_ulaw.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/alaw_ulaw.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/alaw_ulaw.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/alaw_ulaw_table.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/alaw_ulaw_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/alaw_ulaw_table.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/alaw_ulaw_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/bidirectional.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/bidirectional.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/bidirectional.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/bidirectional.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/clock_thread.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/clock_thread.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/clock_thread.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/clock_thread.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/codec.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/codec.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/codec.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/codec.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/conference.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/conference.c
similarity index 95%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/conference.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/conference.c
index c46444f8badaf28a0b294ef0b1cfdda78e460b68..41ccea787a48ffe50aecc8fccc53694c2dfb0fb7 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/conference.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/conference.c
@@ -1,4 +1,4 @@
-/* $Id: conference.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: conference.c 2790 2009-06-24 15:26:59Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -570,13 +570,17 @@ PJ_DEF(pj_status_t) pjmedia_conf_create( pj_pool_t *pool,
 
     /* Create port zero for sound device. */
     status = create_sound_port(pool, conf);
-    if (status != PJ_SUCCESS)
+    if (status != PJ_SUCCESS) {
+	pjmedia_conf_destroy(conf);
 	return status;
+    }
 
     /* Create mutex. */
     status = pj_mutex_create_recursive(pool, "conf", &conf->mutex);
-    if (status != PJ_SUCCESS)
+    if (status != PJ_SUCCESS) {
+	pjmedia_conf_destroy(conf);
 	return status;
+    }
 
     /* If sound device was created, connect sound device to the
      * master port.
@@ -625,6 +629,8 @@ static pj_status_t resume_sound( pjmedia_conf *conf )
  */
 PJ_DEF(pj_status_t) pjmedia_conf_destroy( pjmedia_conf *conf )
 {
+    unsigned i, ci;
+
     PJ_ASSERT_RETURN(conf != NULL, PJ_EINVAL);
 
     /* Destroy sound device port. */
@@ -633,8 +639,24 @@ PJ_DEF(pj_status_t) pjmedia_conf_destroy( pjmedia_conf *conf )
 	conf->snd_dev_port = NULL;
     }
 
+    /* Destroy delay buf of all (passive) ports. */
+    for (i=0, ci=0; i<conf->max_ports && ci<conf->port_cnt; ++i) {
+	struct conf_port *cport;
+
+	cport = conf->ports[i];
+	if (!cport)
+	    continue;
+	
+	++ci;
+	if (cport->delay_buf) {
+	    pjmedia_delay_buf_destroy(cport->delay_buf);
+	    cport->delay_buf = NULL;
+	}
+    }
+
     /* Destroy mutex */
-    pj_mutex_destroy(conf->mutex);
+    if (conf->mutex)
+	pj_mutex_destroy(conf->mutex);
 
     return PJ_SUCCESS;
 }
@@ -792,6 +814,9 @@ PJ_DEF(pj_status_t) pjmedia_conf_add_passive_port( pjmedia_conf *conf,
     pj_str_t tmp;
     pj_status_t status;
 
+    PJ_LOG(1, (THIS_FILE, "This API has been deprecated since 1.3 and will "
+			  "be removed in the future release!"));
+
     PJ_ASSERT_RETURN(conf && pool, PJ_EINVAL);
 
     /* For this version of PJMEDIA, channel(s) number MUST be:
@@ -886,8 +911,14 @@ PJ_DEF(pj_status_t) pjmedia_conf_configure_port( pjmedia_conf *conf,
     /* Check arguments */
     PJ_ASSERT_RETURN(conf && slot<conf->max_ports, PJ_EINVAL);
 
+    pj_mutex_lock(conf->mutex);
+
     /* Port must be valid. */
-    PJ_ASSERT_RETURN(conf->ports[slot] != NULL, PJ_EINVAL);
+    conf_port = conf->ports[slot];
+    if (conf_port == NULL) {
+	pj_mutex_unlock(conf->mutex);
+	return PJ_EINVAL;
+    }
 
     conf_port = conf->ports[slot];
 
@@ -897,6 +928,8 @@ PJ_DEF(pj_status_t) pjmedia_conf_configure_port( pjmedia_conf *conf,
     if (rx != PJMEDIA_PORT_NO_CHANGE)
 	conf_port->rx_setting = rx;
 
+    pj_mutex_unlock(conf->mutex);
+
     return PJ_SUCCESS;
 }
 
@@ -917,17 +950,18 @@ PJ_DEF(pj_status_t) pjmedia_conf_connect_port( pjmedia_conf *conf,
     PJ_ASSERT_RETURN(conf && src_slot<conf->max_ports && 
 		     sink_slot<conf->max_ports, PJ_EINVAL);
 
-    /* Ports must be valid. */
-    PJ_ASSERT_RETURN(conf->ports[src_slot] != NULL, PJ_EINVAL);
-    PJ_ASSERT_RETURN(conf->ports[sink_slot] != NULL, PJ_EINVAL);
-
     /* For now, level MUST be zero. */
     PJ_ASSERT_RETURN(level == 0, PJ_EINVAL);
 
     pj_mutex_lock(conf->mutex);
 
+    /* Ports must be valid. */
     src_port = conf->ports[src_slot];
     dst_port = conf->ports[sink_slot];
+    if (!src_port || !dst_port) {
+	pj_mutex_unlock(conf->mutex);
+	return PJ_EINVAL;
+    }
 
     /* Check if connection has been made */
     for (i=0; i<src_port->listener_cnt; ++i) {
@@ -979,14 +1013,15 @@ PJ_DEF(pj_status_t) pjmedia_conf_disconnect_port( pjmedia_conf *conf,
     PJ_ASSERT_RETURN(conf && src_slot<conf->max_ports && 
 		     sink_slot<conf->max_ports, PJ_EINVAL);
 
-    /* Ports must be valid. */
-    PJ_ASSERT_RETURN(conf->ports[src_slot] != NULL, PJ_EINVAL);
-    PJ_ASSERT_RETURN(conf->ports[sink_slot] != NULL, PJ_EINVAL);
-
     pj_mutex_lock(conf->mutex);
 
+    /* Ports must be valid. */
     src_port = conf->ports[src_slot];
     dst_port = conf->ports[sink_slot];
+    if (!src_port || !dst_port) {
+	pj_mutex_unlock(conf->mutex);
+	return PJ_EINVAL;
+    }
 
     /* Check if connection has been made */
     for (i=0; i<src_port->listener_cnt; ++i) {
@@ -1057,9 +1092,6 @@ PJ_DEF(pj_status_t) pjmedia_conf_remove_port( pjmedia_conf *conf,
     /* Check arguments */
     PJ_ASSERT_RETURN(conf && port < conf->max_ports, PJ_EINVAL);
 
-    /* Port must be valid. */
-    PJ_ASSERT_RETURN(conf->ports[port] != NULL, PJ_EINVAL);
-
     /* Suspend the sound devices.
      * Don't want to remove port while port is being accessed by sound
      * device's threads!
@@ -1067,7 +1099,13 @@ PJ_DEF(pj_status_t) pjmedia_conf_remove_port( pjmedia_conf *conf,
 
     pj_mutex_lock(conf->mutex);
 
+    /* Port must be valid. */
     conf_port = conf->ports[port];
+    if (conf_port == NULL) {
+	pj_mutex_unlock(conf->mutex);
+	return PJ_EINVAL;
+    }
+
     conf_port->tx_setting = PJMEDIA_PORT_DISABLE;
     conf_port->rx_setting = PJMEDIA_PORT_DISABLE;
 
@@ -1109,6 +1147,14 @@ PJ_DEF(pj_status_t) pjmedia_conf_remove_port( pjmedia_conf *conf,
 	--conf->connect_cnt;
     }
 
+    /* Destroy pjmedia port if this conf port is passive port,
+     * i.e: has delay buf.
+     */
+    if (conf_port->delay_buf) {
+	pjmedia_port_destroy(conf_port->port);
+	conf_port->port = NULL;
+    }
+
     /* Remove the port. */
     conf->ports[port] = NULL;
     --conf->port_cnt;
@@ -1136,6 +1182,9 @@ PJ_DEF(pj_status_t) pjmedia_conf_enum_ports( pjmedia_conf *conf,
 
     PJ_ASSERT_RETURN(conf && p_count && ports, PJ_EINVAL);
 
+    /* Lock mutex */
+    pj_mutex_lock(conf->mutex);
+
     for (i=0; i<conf->max_ports && count<*p_count; ++i) {
 	if (!conf->ports[i])
 	    continue;
@@ -1143,6 +1192,9 @@ PJ_DEF(pj_status_t) pjmedia_conf_enum_ports( pjmedia_conf *conf,
 	ports[count++] = i;
     }
 
+    /* Unlock mutex */
+    pj_mutex_unlock(conf->mutex);
+
     *p_count = count;
     return PJ_SUCCESS;
 }
@@ -1159,10 +1211,15 @@ PJ_DEF(pj_status_t) pjmedia_conf_get_port_info( pjmedia_conf *conf,
     /* Check arguments */
     PJ_ASSERT_RETURN(conf && slot<conf->max_ports, PJ_EINVAL);
 
-    /* Port must be valid. */
-    PJ_ASSERT_RETURN(conf->ports[slot] != NULL, PJ_EINVAL);
+    /* Lock mutex */
+    pj_mutex_lock(conf->mutex);
 
+    /* Port must be valid. */
     conf_port = conf->ports[slot];
+    if (conf_port == NULL) {
+	pj_mutex_unlock(conf->mutex);
+	return PJ_EINVAL;
+    }
 
     info->slot = slot;
     info->name = conf_port->name;
@@ -1177,6 +1234,9 @@ PJ_DEF(pj_status_t) pjmedia_conf_get_port_info( pjmedia_conf *conf,
     info->tx_adj_level = conf_port->tx_adj_level - NORMAL_LEVEL;
     info->rx_adj_level = conf_port->rx_adj_level - NORMAL_LEVEL;
 
+    /* Unlock mutex */
+    pj_mutex_unlock(conf->mutex);
+
     return PJ_SUCCESS;
 }
 
@@ -1189,6 +1249,9 @@ PJ_DEF(pj_status_t) pjmedia_conf_get_ports_info(pjmedia_conf *conf,
 
     PJ_ASSERT_RETURN(conf && size && info, PJ_EINVAL);
 
+    /* Lock mutex */
+    pj_mutex_lock(conf->mutex);
+
     for (i=0; i<conf->max_ports && count<*size; ++i) {
 	if (!conf->ports[i])
 	    continue;
@@ -1197,6 +1260,9 @@ PJ_DEF(pj_status_t) pjmedia_conf_get_ports_info(pjmedia_conf *conf,
 	++count;
     }
 
+    /* Unlock mutex */
+    pj_mutex_unlock(conf->mutex);
+
     *size = count;
     return PJ_SUCCESS;
 }
@@ -1215,10 +1281,15 @@ PJ_DEF(pj_status_t) pjmedia_conf_get_signal_level( pjmedia_conf *conf,
     /* Check arguments */
     PJ_ASSERT_RETURN(conf && slot<conf->max_ports, PJ_EINVAL);
 
-    /* Port must be valid. */
-    PJ_ASSERT_RETURN(conf->ports[slot] != NULL, PJ_EINVAL);
+    /* Lock mutex */
+    pj_mutex_lock(conf->mutex);
 
+    /* Port must be valid. */
     conf_port = conf->ports[slot];
+    if (conf_port == NULL) {
+	pj_mutex_unlock(conf->mutex);
+	return PJ_EINVAL;
+    }
 
     if (tx_level != NULL) {
 	*tx_level = conf_port->tx_level;
@@ -1227,6 +1298,9 @@ PJ_DEF(pj_status_t) pjmedia_conf_get_signal_level( pjmedia_conf *conf,
     if (rx_level != NULL) 
 	*rx_level = conf_port->rx_level;
 
+    /* Unlock mutex */
+    pj_mutex_unlock(conf->mutex);
+
     return PJ_SUCCESS;
 }
 
@@ -1243,20 +1317,28 @@ PJ_DEF(pj_status_t) pjmedia_conf_adjust_rx_level( pjmedia_conf *conf,
     /* Check arguments */
     PJ_ASSERT_RETURN(conf && slot<conf->max_ports, PJ_EINVAL);
 
-    /* Port must be valid. */
-    PJ_ASSERT_RETURN(conf->ports[slot] != NULL, PJ_EINVAL);
-
     /* Value must be from -128 to +127 */
     /* Disabled, you can put more than +127, at your own risk: 
      PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL);
      */
     PJ_ASSERT_RETURN(adj_level >= -128, PJ_EINVAL);
 
+    /* Lock mutex */
+    pj_mutex_lock(conf->mutex);
+
+    /* Port must be valid. */
     conf_port = conf->ports[slot];
+    if (conf_port == NULL) {
+	pj_mutex_unlock(conf->mutex);
+	return PJ_EINVAL;
+    }
 
     /* Set normalized adjustment level. */
     conf_port->rx_adj_level = adj_level + NORMAL_LEVEL;
 
+    /* Unlock mutex */
+    pj_mutex_unlock(conf->mutex);
+
     return PJ_SUCCESS;
 }
 
@@ -1273,20 +1355,28 @@ PJ_DEF(pj_status_t) pjmedia_conf_adjust_tx_level( pjmedia_conf *conf,
     /* Check arguments */
     PJ_ASSERT_RETURN(conf && slot<conf->max_ports, PJ_EINVAL);
 
-    /* Port must be valid. */
-    PJ_ASSERT_RETURN(conf->ports[slot] != NULL, PJ_EINVAL);
-
     /* Value must be from -128 to +127 */
     /* Disabled, you can put more than +127,, at your own risk:
      PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL);
      */
     PJ_ASSERT_RETURN(adj_level >= -128, PJ_EINVAL);
 
+    /* Lock mutex */
+    pj_mutex_lock(conf->mutex);
+
+    /* Port must be valid. */
     conf_port = conf->ports[slot];
+    if (conf_port == NULL) {
+	pj_mutex_unlock(conf->mutex);
+	return PJ_EINVAL;
+    }
 
     /* Set normalized adjustment level. */
     conf_port->tx_adj_level = adj_level + NORMAL_LEVEL;
 
+    /* Unlock mutex */
+    pj_mutex_unlock(conf->mutex);
+
     return PJ_SUCCESS;
 }
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/delaybuf.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/delaybuf.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/delaybuf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/delaybuf.c
index 9fd748bc4193635e24f8c4a4c42d4d8c682de5b9..908fe5c5396339425e76810c2107b3a05c931451 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/delaybuf.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/delaybuf.c
@@ -1,4 +1,4 @@
-/* $Id: delaybuf.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: delaybuf.c 2790 2009-06-24 15:26:59Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -121,20 +121,23 @@ PJ_DEF(pj_status_t) pjmedia_delay_buf_create( pj_pool_t *pool,
     b->eff_cnt = b->max_cnt >> 1;
     b->recalc_timer = RECALC_TIME;
 
-    status = pj_lock_create_recursive_mutex(pool, b->obj_name, 
-					    &b->lock);
-    if (status != PJ_SUCCESS)
-	return status;
-
+    /* Create circular buffer */
     status = pjmedia_circ_buf_create(pool, b->max_cnt, &b->circ_buf);
     if (status != PJ_SUCCESS)
 	return status;
 
+    /* Create WSOLA */
     status = pjmedia_wsola_create(pool, clock_rate, samples_per_frame, 1,
 				  0, &b->wsola);
     if (status != PJ_SUCCESS)
 	return status;
 
+    /* Finally, create mutex */
+    status = pj_lock_create_recursive_mutex(pool, b->obj_name, 
+					    &b->lock);
+    if (status != PJ_SUCCESS)
+	return status;
+
     *p_b = b;
 
     TRACE__((b->obj_name,"Delay buffer created"));
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/dsound.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/dsound.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/dsound.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/dsound.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_common.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_common.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_common.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_common.c
index fb13055976677bc939388c47fce006fc5159f354..7275e7a4d049dad54eca57fa59f978283093b65b 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_common.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_common.c
@@ -1,4 +1,4 @@
-/* $Id: echo_common.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: echo_common.c 2790 2009-06-24 15:26:59Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -239,6 +239,12 @@ PJ_DEF(pj_status_t) pjmedia_echo_create2(pj_pool_t *pool,
 PJ_DEF(pj_status_t) pjmedia_echo_destroy(pjmedia_echo_state *echo )
 {
     (*echo->op->ec_destroy)(echo->state);
+
+    if (echo->delay_buf) {
+	pjmedia_delay_buf_destroy(echo->delay_buf);
+	echo->delay_buf = NULL;
+    }
+
     pj_pool_release(echo->pool);
     return PJ_SUCCESS;
 }
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_internal.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_internal.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_internal.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_internal.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_port.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_port.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_port.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_port.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_speex.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_speex.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_speex.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_speex.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_suppress.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_suppress.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/echo_suppress.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/echo_suppress.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/endpoint.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/endpoint.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/endpoint.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/endpoint.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/errno.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/errno.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/errno.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/errno.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/g711.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/g711.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/g711.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/g711.c
index f595fb9877d71c8b9b6f4772447a9218dde830c7..33b9b1524e2250b0d41ab9dc2aea6592762babd8 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/g711.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/g711.c
@@ -1,4 +1,4 @@
-/* $Id: g711.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: g711.c 2792 2009-06-24 15:46:49Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -502,8 +502,8 @@ static pj_status_t  g711_encode(pjmedia_codec *codec,
 						(const pj_int16_t*) input->buf, 
 						(input->size >> 1), NULL);
 	if (is_silence && 
-	    PJMEDIA_CODEC_MAX_SILENCE_PERIOD != -1 &&
-	    silence_period < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*8000/1000) 
+	    (PJMEDIA_CODEC_MAX_SILENCE_PERIOD == -1 ||
+	     silence_period < PJMEDIA_CODEC_MAX_SILENCE_PERIOD*8000/1000))
 	{
 	    output->type = PJMEDIA_FRAME_TYPE_NONE;
 	    output->buf = NULL;
@@ -539,6 +539,7 @@ static pj_status_t  g711_encode(pjmedia_codec *codec,
 
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
     output->size = (input->size >> 1);
+    output->timestamp = input->timestamp;
 
     return PJ_SUCCESS;
 }
@@ -582,6 +583,7 @@ static pj_status_t  g711_decode(pjmedia_codec *codec,
 
     output->type = PJMEDIA_FRAME_TYPE_AUDIO;
     output->size = (input->size << 1);
+    output->timestamp = input->timestamp;
 
 #if !PLC_DISABLED
     if (priv->plc_enabled)
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/jbuf.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/jbuf.c
new file mode 100644
index 0000000000000000000000000000000000000000..6e1e8b3fdd5b756a90403f790f16bce8dc637ef2
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/jbuf.c
@@ -0,0 +1,791 @@
+/* $Id: jbuf.c 2788 2009-06-24 14:46:36Z nanang $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 
+ */
+/*
+ * Based on implementation kindly contributed by Switchlab, Ltd.
+ */
+#include <pjmedia/jbuf.h>
+#include <pjmedia/errno.h>
+#include <pj/pool.h>
+#include <pj/assert.h>
+#include <pj/log.h>
+#include <pj/math.h>
+#include <pj/string.h>
+
+
+#define THIS_FILE   "jbuf.c"
+
+
+/* Minimal difference between JB size and 2*burst-level to perform 
+ * JB shrinking. 
+ */
+#define SAFE_SHRINKING_DIFF	1
+
+/* Minimal gap (in ms) between JB shrinking */
+#define MIN_SHRINK_GAP_MSEC	200
+
+/* Invalid sequence number, used as the initial value. */
+#define INVALID_OFFSET		-9999
+
+/* Maximum burst length, whenever an operation is bursting longer than 
+ * this value, JB will assume that the opposite operation was idle.
+ */
+#define MAX_BURST_MSEC		1000
+
+/* Number of OP switches to be performed in JB_STATUS_INITIALIZING, before
+ * JB can switch its states to JB_STATUS_PROCESSING.
+ */
+#define INIT_CYCLE		10
+
+
+/* Struct of JB internal buffer, represented in a circular buffer containing
+ * frame content, frame type, frame length, and frame bit info.
+ */
+typedef struct jb_framelist_t
+{
+    /* Settings */
+    unsigned	     frame_size;	/**< maximum size of frame	    */
+    unsigned	     max_count;		/**< maximum number of frames	    */
+
+    /* Buffers */
+    char	    *content;		/**< frame content array	    */
+    int		    *frame_type;	/**< frame type array		    */
+    pj_size_t	    *content_len;	/**< frame length array		    */
+    pj_uint32_t	    *bit_info;		/**< frame bit info array	    */
+    
+    /* States */
+    unsigned	     head;		/**< index of head, pointed frame
+					     will be returned by next GET   */
+    unsigned	     size;		/**< current size of framelist.	    */
+    int		     origin;		/**< original index of flist_head   */
+} jb_framelist_t;
+
+
+struct pjmedia_jbuf
+{
+    /* Settings (consts) */
+    pj_str_t	    jb_name;		/**< jitter buffer name		    */
+    pj_size_t	    jb_frame_size;	/**< frame size			    */
+    unsigned	    jb_frame_ptime;	/**< frame duration.		    */
+    pj_size_t	    jb_max_count;	/**< capacity of jitter buffer, 
+					     in frames			    */
+    int		    jb_def_prefetch;	/**< Default prefetch		    */
+    int		    jb_min_prefetch;	/**< Minimum allowable prefetch	    */
+    int		    jb_max_prefetch;	/**< Maximum allowable prefetch	    */
+    int		    jb_max_burst;	/**< maximum possible burst, whenever
+					     burst exceeds this value, it 
+					     won't be included in level 
+					     calculation		    */
+    int		    jb_min_shrink_gap;	/**< How often can we shrink	    */
+
+    /* Buffer */
+    jb_framelist_t  jb_framelist;	/**< the buffer			    */
+
+    /* States */
+    int		    jb_level;		/**< delay between source & 
+					     destination (calculated according 
+					     of the number of burst get/put 
+					     operations)		    */
+    int		    jb_max_hist_level;  /**< max level during the last level 
+					     calculations		    */
+    int		    jb_stable_hist;	/**< num of times the delay has	been 
+					     lower then the prefetch num    */
+    int		    jb_last_op;		/**< last operation executed 
+					     (put/get)			    */
+    int		    jb_prefetch;	/**< no. of frame to insert before 
+					     removing some (at the beginning 
+					     of the framelist->content 
+					     operation), the value may be
+					     continuously updated based on
+					     current frame burst level.	    */
+    int		    jb_status;		/**< status is 'init' until the	first 
+					     'put' operation		    */
+    int		    jb_init_cycle_cnt;	/**< status is 'init' until the	first 
+					     'put' operation		    */
+    int		    jb_last_del_seq;	/**< Seq # of last frame deleted    */
+
+    /* Statistics */
+    pj_math_stat    jb_delay;		/**< Delay statistics of jitter buffer 
+					     (in ms)			    */
+    pj_math_stat    jb_burst;		/**< Burst statistics (in frames)   */
+    unsigned	    jb_lost;		/**< Number of lost frames.	    */
+    unsigned	    jb_discard;		/**< Number of discarded frames.    */
+    unsigned	    jb_empty;		/**< Number of empty/prefetching frame
+					     returned by GET. */
+};
+
+
+#define JB_STATUS_INITIALIZING	0
+#define JB_STATUS_PROCESSING	1
+#define JB_STATUS_PREFETCHING	2
+
+/* Enabling this would log the jitter buffer state about once per 
+ * second.
+ */
+#if 1
+#  define TRACE__(args)	    PJ_LOG(5,args)
+#else
+#  define TRACE__(args)
+#endif
+
+static pj_status_t jb_framelist_reset(jb_framelist_t *framelist);
+
+static pj_status_t jb_framelist_init( pj_pool_t *pool,
+				      jb_framelist_t *framelist,
+				      unsigned frame_size,
+				      unsigned max_count) 
+{
+    PJ_ASSERT_RETURN(pool && framelist, PJ_EINVAL);
+
+    pj_bzero(framelist, sizeof(jb_framelist_t));
+
+    framelist->frame_size   = frame_size;
+    framelist->max_count    = max_count;
+    framelist->content	    = (char*) 
+			      pj_pool_alloc(pool,
+					    framelist->frame_size* 
+					    framelist->max_count);
+    framelist->frame_type   = (int*)
+			      pj_pool_alloc(pool, 
+					    sizeof(framelist->frame_type[0])*
+					    framelist->max_count);
+    framelist->content_len  = (pj_size_t*)
+			      pj_pool_alloc(pool, 
+					    sizeof(framelist->content_len[0])*
+					    framelist->max_count);
+    framelist->bit_info	    = (pj_uint32_t*)
+			      pj_pool_alloc(pool, 
+					    sizeof(framelist->bit_info[0])*
+					    framelist->max_count);
+
+    return jb_framelist_reset(framelist);
+
+}
+
+static pj_status_t jb_framelist_destroy(jb_framelist_t *framelist) 
+{
+    PJ_UNUSED_ARG(framelist);
+    return PJ_SUCCESS;
+}
+
+static pj_status_t jb_framelist_reset(jb_framelist_t *framelist) 
+{
+    framelist->head = 0;
+    framelist->origin = INVALID_OFFSET;
+    framelist->size = 0;
+
+    //pj_bzero(framelist->content, 
+    //	     framelist->frame_size * 
+    //	     framelist->max_count);
+
+    pj_memset(framelist->frame_type,
+	      PJMEDIA_JB_MISSING_FRAME,
+	      sizeof(framelist->frame_type[0]) * 
+	      framelist->max_count);
+
+    pj_bzero(framelist->content_len, 
+	     sizeof(framelist->content_len[0]) * 
+	     framelist->max_count);
+
+    //pj_bzero(framelist->bit_info,
+    //	     sizeof(framelist->bit_info[0]) * 
+    //	     framelist->max_count);
+
+    return PJ_SUCCESS;
+}
+
+
+static unsigned jb_framelist_size(jb_framelist_t *framelist) 
+{
+    return framelist->size;
+}
+
+
+static pj_bool_t jb_framelist_get(jb_framelist_t *framelist,
+				  void *frame, pj_size_t *size,
+				  pjmedia_jb_frame_type *p_type,
+				  pj_uint32_t *bit_info) 
+{
+    if (framelist->size) {
+	pj_memcpy(frame, 
+		  framelist->content + 
+		  framelist->head * framelist->frame_size,
+		  framelist->frame_size);
+	*p_type = (pjmedia_jb_frame_type) 
+		  framelist->frame_type[framelist->head];
+	if (size)
+	    *size   = framelist->content_len[framelist->head];
+	if (bit_info)
+	    *bit_info = framelist->bit_info[framelist->head];
+
+	//pj_bzero(framelist->content + 
+	//	 framelist->head * framelist->frame_size,
+	//	 framelist->frame_size);
+	framelist->frame_type[framelist->head] = PJMEDIA_JB_MISSING_FRAME;
+	framelist->content_len[framelist->head] = 0;
+	framelist->bit_info[framelist->head] = 0;
+
+	framelist->origin++;
+	framelist->head = (framelist->head + 1) % framelist->max_count;
+	framelist->size--;
+	
+	return PJ_TRUE;
+    } else {
+	pj_bzero(frame, framelist->frame_size);
+
+	return PJ_FALSE;
+    }
+}
+
+
+static unsigned jb_framelist_remove_head(jb_framelist_t *framelist,
+					 unsigned count) 
+{
+    if (count > framelist->size) 
+	count = framelist->size;
+
+    if (count) {
+	/* may be done in two steps if overlapping */
+	unsigned step1,step2;
+	unsigned tmp = framelist->head+count;
+
+	if (tmp > framelist->max_count) {
+	    step1 = framelist->max_count - framelist->head;
+	    step2 = count-step1;
+	} else {
+	    step1 = count;
+	    step2 = 0;
+	}
+
+	//pj_bzero(framelist->content + 
+	//	    framelist->head * framelist->frame_size,
+	//          step1*framelist->frame_size);
+	pj_memset(framelist->frame_type+framelist->head,
+		  PJMEDIA_JB_MISSING_FRAME,
+		  step1*sizeof(framelist->frame_type[0]));
+	pj_bzero(framelist->content_len+framelist->head,
+		  step1*sizeof(framelist->content_len[0]));
+
+	if (step2) {
+	    //pj_bzero( framelist->content,
+	    //	      step2*framelist->frame_size);
+	    pj_memset(framelist->frame_type,
+		      PJMEDIA_JB_MISSING_FRAME,
+		      step2*sizeof(framelist->frame_type[0]));
+	    pj_bzero (framelist->content_len,
+		      step2*sizeof(framelist->content_len[0]));
+	}
+
+	/* update states */
+	framelist->origin += count;
+	framelist->head = (framelist->head + count) % framelist->max_count;
+	framelist->size -= count;
+    }
+    
+    return count;
+}
+
+
+static pj_status_t jb_framelist_put_at(jb_framelist_t *framelist,
+				       int index,
+				       const void *frame,
+				       unsigned frame_size,
+				       pj_uint32_t bit_info)
+{
+    int distance;
+    unsigned where;
+    enum { MAX_MISORDER = 100 };
+    enum { MAX_DROPOUT = 3000 };
+
+    assert(frame_size <= framelist->frame_size);
+
+    /* too late or duplicated or sequence restart */
+    if (index < framelist->origin) {
+	if (framelist->origin - index < MAX_MISORDER) {
+	    /* too late or duplicated */
+	    return PJ_ETOOSMALL;
+	} else {
+	    /* sequence restart */
+	    framelist->origin = index - framelist->size;
+	}
+    }
+
+    /* if jbuf is empty, just reset the origin */
+    if (framelist->size == 0) {
+	framelist->origin = index;
+    }
+
+    /* get distance of this frame to the first frame in the buffer */
+    distance = index - framelist->origin;
+
+    /* far jump, the distance is greater than buffer capacity */
+    if (distance >= (int)framelist->max_count) {
+	if (distance > MAX_DROPOUT) {
+	    /* jump too far, reset the buffer */
+	    jb_framelist_reset(framelist);
+	    framelist->origin = index;
+	    distance = 0;
+	} else {
+	    /* otherwise, reject the frame */
+	    return PJ_ETOOMANY;
+	}
+    }
+
+    /* get the slot position */
+    where = (framelist->head + distance) % framelist->max_count;
+
+    /* if the slot is occupied, it must be duplicated frame, ignore it. */
+    if (framelist->frame_type[where] != PJMEDIA_JB_MISSING_FRAME)
+	return PJ_EEXISTS;
+
+    /* put the frame into the slot */
+    pj_memcpy(framelist->content + where * framelist->frame_size,
+	      frame, frame_size);
+    framelist->frame_type[where] = PJMEDIA_JB_NORMAL_FRAME;
+    framelist->content_len[where] = frame_size;
+    framelist->bit_info[where] = bit_info;
+    if (framelist->origin + (int)framelist->size <= index)
+	framelist->size = distance + 1;
+
+    return PJ_SUCCESS;
+}
+
+
+
+enum pjmedia_jb_op
+{
+    JB_OP_INIT  = -1,
+    JB_OP_PUT   = 1,
+    JB_OP_GET   = 2
+};
+
+
+PJ_DEF(pj_status_t) pjmedia_jbuf_create(pj_pool_t *pool, 
+					const pj_str_t *name,
+					unsigned frame_size, 
+					unsigned ptime,
+					unsigned max_count,
+					pjmedia_jbuf **p_jb)
+{
+    pjmedia_jbuf *jb;
+    pj_status_t status;
+
+    jb = PJ_POOL_ZALLOC_T(pool, pjmedia_jbuf);
+
+    status = jb_framelist_init(pool, &jb->jb_framelist, frame_size, max_count);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    pj_strdup_with_null(pool, &jb->jb_name, name);
+    jb->jb_frame_size	 = frame_size;
+    jb->jb_frame_ptime   = ptime;
+    jb->jb_prefetch	 = PJ_MIN(PJMEDIA_JB_DEFAULT_INIT_DELAY,max_count*4/5);
+    jb->jb_min_prefetch  = 0;
+    jb->jb_max_prefetch  = max_count*4/5;
+    jb->jb_max_count	 = max_count;
+    jb->jb_min_shrink_gap= MIN_SHRINK_GAP_MSEC / ptime;
+    jb->jb_max_burst	 = MAX_BURST_MSEC / ptime;
+    pj_math_stat_init(&jb->jb_delay);
+    pj_math_stat_init(&jb->jb_burst);
+
+    pjmedia_jbuf_reset(jb);
+
+    *p_jb = jb;
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Set the jitter buffer to fixed delay mode. The default behavior
+ * is to adapt the delay with actual packet delay.
+ *
+ */
+PJ_DEF(pj_status_t) pjmedia_jbuf_set_fixed( pjmedia_jbuf *jb,
+					    unsigned prefetch)
+{
+    PJ_ASSERT_RETURN(jb, PJ_EINVAL);
+    PJ_ASSERT_RETURN(prefetch <= jb->jb_max_count, PJ_EINVAL);
+
+    jb->jb_min_prefetch = jb->jb_max_prefetch = 
+	jb->jb_prefetch = jb->jb_def_prefetch = prefetch;
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Set the jitter buffer to adaptive mode.
+ */
+PJ_DEF(pj_status_t) pjmedia_jbuf_set_adaptive( pjmedia_jbuf *jb,
+					       unsigned prefetch,
+					       unsigned min_prefetch,
+					       unsigned max_prefetch)
+{
+    PJ_ASSERT_RETURN(jb, PJ_EINVAL);
+    PJ_ASSERT_RETURN(min_prefetch < max_prefetch &&
+		     prefetch <= max_prefetch &&
+		     max_prefetch <= jb->jb_max_count,
+		     PJ_EINVAL);
+
+    jb->jb_prefetch = jb->jb_def_prefetch = prefetch;
+    jb->jb_min_prefetch = min_prefetch;
+    jb->jb_max_prefetch = max_prefetch;
+
+    return PJ_SUCCESS;
+}
+
+
+PJ_DEF(pj_status_t) pjmedia_jbuf_reset(pjmedia_jbuf *jb)
+{
+    jb->jb_level	 = 0;
+    jb->jb_last_op	 = JB_OP_INIT;
+    jb->jb_stable_hist	 = 0;
+    jb->jb_status	 = JB_STATUS_INITIALIZING;
+    jb->jb_init_cycle_cnt= 0;
+    jb->jb_max_hist_level= 0;
+
+    jb_framelist_reset(&jb->jb_framelist);
+
+    return PJ_SUCCESS;
+}
+
+
+PJ_DEF(pj_status_t) pjmedia_jbuf_destroy(pjmedia_jbuf *jb)
+{
+    TRACE__((jb->jb_name.ptr, "\n"
+	    "  JB summary:\n"
+	    "    size=%d prefetch=%d\n"
+	    "    delay (min/max/avg/dev)=%d/%d/%d/%d ms\n"
+	    "    burst (min/max/avg/dev)=%d/%d/%d/%d frames\n"
+	    "    lost=%d discard=%d empty=%d\n",
+	    jb->jb_framelist.size, jb->jb_prefetch,
+	    jb->jb_delay.min, jb->jb_delay.max, jb->jb_delay.mean, 
+	    pj_math_stat_get_stddev(&jb->jb_delay),
+	    jb->jb_burst.min, jb->jb_burst.max, jb->jb_burst.mean, 
+	    pj_math_stat_get_stddev(&jb->jb_burst),
+	    jb->jb_lost, jb->jb_discard, jb->jb_empty));
+
+    return jb_framelist_destroy(&jb->jb_framelist);
+}
+
+
+static void jbuf_calculate_jitter(pjmedia_jbuf *jb)
+{
+    int diff, cur_size;
+
+    cur_size = jb_framelist_size(&jb->jb_framelist);
+    pj_math_stat_update(&jb->jb_burst, jb->jb_level);
+    jb->jb_max_hist_level = PJ_MAX(jb->jb_max_hist_level, jb->jb_level);
+
+    /* Burst level is decreasing */
+    if (jb->jb_level < jb->jb_prefetch) {
+
+	enum { STABLE_HISTORY_LIMIT = 100 };
+        
+	jb->jb_stable_hist++;
+        
+	/* Only update the prefetch if 'stable' condition is reached 
+	 * (not just short time impulse)
+	 */
+	if (jb->jb_stable_hist > STABLE_HISTORY_LIMIT) {
+    	
+	    diff = (jb->jb_prefetch - jb->jb_max_hist_level) / 3;
+
+	    if (diff < 1)
+		diff = 1;
+
+	    jb->jb_prefetch -= diff;
+	    if (jb->jb_prefetch < jb->jb_min_prefetch) 
+		jb->jb_prefetch = jb->jb_min_prefetch;
+
+	    /* Reset history */
+	    jb->jb_max_hist_level = 0;
+	    jb->jb_stable_hist = 0;
+
+	    TRACE__((jb->jb_name.ptr,"jb updated(1), prefetch=%d, size=%d",
+		     jb->jb_prefetch, cur_size));
+	}
+    }
+
+    /* Burst level is increasing */
+    else if (jb->jb_level > jb->jb_prefetch) {
+
+	/* Instaneous set prefetch to recent maximum level (max_hist_level) */
+	jb->jb_prefetch = PJ_MIN(jb->jb_max_hist_level,
+				 (int)(jb->jb_max_count*4/5));
+	if (jb->jb_prefetch > jb->jb_max_prefetch)
+	    jb->jb_prefetch = jb->jb_max_prefetch;
+
+	jb->jb_stable_hist = 0;
+	/* Do not reset max_hist_level. */
+	//jb->jb_max_hist_level = 0;
+
+	TRACE__((jb->jb_name.ptr,"jb updated(2), prefetch=%d, size=%d", 
+		 jb->jb_prefetch, cur_size));
+    }
+
+    /* Level is unchanged */
+    else {
+	jb->jb_stable_hist = 0;
+    }
+}
+
+PJ_INLINE(void) jbuf_update(pjmedia_jbuf *jb, int oper)
+{
+    int diff, burst_level;
+
+    if(jb->jb_last_op != oper) {
+	jb->jb_last_op = oper;
+
+	if (jb->jb_status == JB_STATUS_INITIALIZING) {
+	    /* Switch status 'initializing' -> 'processing' after some OP 
+	     * switch cycles and current OP is GET (burst level is calculated 
+	     * based on PUT burst), so burst calculation is guaranted to be
+	     * performed right after the status switching.
+	     */
+	    if (++jb->jb_init_cycle_cnt >= INIT_CYCLE && oper == JB_OP_GET) {
+		jb->jb_status = JB_STATUS_PROCESSING;
+	    } else {
+		jb->jb_level = 0;
+		return;
+	    }
+	}
+
+	/* Perform jitter calculation based on PUT burst-level only, since 
+	 * GET burst-level may not be accurate, e.g: when VAD is active.
+	 * Note that when burst-level is too big, i.e: exceeds jb_max_burst,
+	 * the GET op may be idle, in this case, we better skip the jitter 
+	 * calculation.
+	 */
+	if (oper == JB_OP_GET && jb->jb_level < jb->jb_max_burst)
+	    jbuf_calculate_jitter(jb);
+
+	jb->jb_level = 0;
+    }
+
+    /* These code is used for shortening the delay in the jitter buffer.
+     * It needs shrink only when there is possibility of drift. Drift
+     * detection is performed by inspecting the jitter buffer size, if
+     * its size is twice of current burst level, there can be drift.
+     *
+     * Moreover, normally drift level is quite low, so JB shouldn't need
+     * to shrink aggresively, it will shrink maximum one frame per 
+     * MIN_SHRINK_GAP_MSEC ms. Theoritically, JB may handle drift level 
+     * as much as = FRAME_PTIME/MIN_SHRINK_GAP_MSEC * 100%
+     *
+     * Whenever there is drift, where PUT > GET, this method will keep 
+     * the latency (JB size) as much as twice of burst level.
+     */
+
+    if (jb->jb_status != JB_STATUS_PROCESSING)
+	return;
+
+    burst_level = PJ_MAX(jb->jb_prefetch, jb->jb_level);
+    diff = jb_framelist_size(&jb->jb_framelist) - burst_level*2;
+
+    if (diff >= SAFE_SHRINKING_DIFF) {
+	/* Check and adjust jb_last_del_seq, in case there was seq restart */
+	if (jb->jb_framelist.origin < jb->jb_last_del_seq)
+	    jb->jb_last_del_seq = jb->jb_framelist.origin;
+
+	if (jb->jb_framelist.origin - jb->jb_last_del_seq >=
+	    jb->jb_min_shrink_gap)
+	{
+	    /* Shrink slowly, one frame per cycle */
+	    diff = 1;
+
+	    /* Drop frame(s)! */
+	    diff = jb_framelist_remove_head(&jb->jb_framelist, diff);
+	    jb->jb_last_del_seq = jb->jb_framelist.origin;
+	    jb->jb_discard += diff;
+
+	    TRACE__((jb->jb_name.ptr, 
+		     "JB shrinking %d frame(s), cur size=%d", diff,
+		     jb_framelist_size(&jb->jb_framelist)));
+	}
+    }
+}
+
+PJ_DEF(void) pjmedia_jbuf_put_frame( pjmedia_jbuf *jb, 
+				     const void *frame, 
+				     pj_size_t frame_size, 
+				     int frame_seq)
+{
+    pjmedia_jbuf_put_frame2(jb, frame, frame_size, 0, frame_seq, NULL);
+}
+
+PJ_DEF(void) pjmedia_jbuf_put_frame2(pjmedia_jbuf *jb, 
+				     const void *frame, 
+				     pj_size_t frame_size, 
+				     pj_uint32_t bit_info,
+				     int frame_seq,
+				     pj_bool_t *discarded)
+{
+    pj_size_t min_frame_size;
+    int prev_size, cur_size;
+    pj_status_t status;
+
+    /* Get JB size before PUT */
+    prev_size = jb_framelist_size(&jb->jb_framelist);
+    
+    /* Attempt to store the frame */
+    min_frame_size = PJ_MIN(frame_size, jb->jb_frame_size);
+    status = jb_framelist_put_at(&jb->jb_framelist, frame_seq, frame,
+				 min_frame_size, bit_info);
+    
+    /* Jitter buffer is full, cannot store the frame */
+    while (status == PJ_ETOOMANY) {
+	unsigned removed;
+
+	removed = jb_framelist_remove_head(&jb->jb_framelist,
+					   PJ_MAX(jb->jb_max_count/4, 1));
+	status = jb_framelist_put_at(&jb->jb_framelist, frame_seq, frame,
+				     min_frame_size, bit_info);
+
+	jb->jb_discard += removed;
+    }
+
+    /* Get JB size after PUT */
+    cur_size = jb_framelist_size(&jb->jb_framelist);
+
+    /* Return the flag if this frame is discarded */
+    if (discarded)
+	*discarded = (status != PJ_SUCCESS);
+
+    if (status == PJ_SUCCESS) {
+	if (jb->jb_status == JB_STATUS_PREFETCHING) {
+	    TRACE__((jb->jb_name.ptr, "PUT prefetch_cnt=%d/%d", 
+		     cur_size, jb->jb_prefetch));
+	    if (cur_size >= jb->jb_prefetch)
+		jb->jb_status = JB_STATUS_PROCESSING;
+	}
+	jb->jb_level += (cur_size > prev_size ? cur_size-prev_size : 1);
+	jbuf_update(jb, JB_OP_PUT);
+    } else
+	jb->jb_discard++;
+}
+
+/*
+ * Get frame from jitter buffer.
+ */
+PJ_DEF(void) pjmedia_jbuf_get_frame( pjmedia_jbuf *jb, 
+				     void *frame, 
+				     char *p_frame_type)
+{
+    pjmedia_jbuf_get_frame2(jb, frame, NULL, p_frame_type, NULL);
+}
+
+/*
+ * Get frame from jitter buffer.
+ */
+PJ_DEF(void) pjmedia_jbuf_get_frame2(pjmedia_jbuf *jb, 
+				     void *frame, 
+				     pj_size_t *size,
+				     char *p_frame_type,
+				     pj_uint32_t *bit_info)
+{
+    int cur_size;
+
+    cur_size = jb_framelist_size(&jb->jb_framelist);
+
+    if (cur_size == 0) {
+	/* jitter buffer empty */
+
+	if (jb->jb_def_prefetch)
+	    jb->jb_status = JB_STATUS_PREFETCHING;
+
+	//pj_bzero(frame, jb->jb_frame_size);
+	*p_frame_type = PJMEDIA_JB_ZERO_EMPTY_FRAME;
+	if (size)
+	    *size = 0;
+
+	jb->jb_empty++;
+
+    } else if (jb->jb_status == JB_STATUS_PREFETCHING) {
+
+	/* Can't return frame because jitter buffer is filling up
+	 * minimum prefetch.
+	 */
+
+	//pj_bzero(frame, jb->jb_frame_size);
+	*p_frame_type = PJMEDIA_JB_ZERO_PREFETCH_FRAME;
+	if (size)
+	    *size = 0;
+
+	TRACE__((jb->jb_name.ptr, "GET prefetch_cnt=%d/%d",
+		 cur_size, jb->jb_prefetch));
+
+	jb->jb_empty++;
+
+    } else {
+
+	pjmedia_jb_frame_type ftype;
+	pj_bool_t res;
+
+	/* Retrieve a frame from frame list */
+	res = jb_framelist_get(&jb->jb_framelist, frame, size, &ftype, 
+			       bit_info);
+	pj_assert(res);
+
+	/* We've successfully retrieved a frame from the frame list, but
+	 * the frame could be a blank frame!
+	 */
+	if (ftype == PJMEDIA_JB_NORMAL_FRAME) {
+	    *p_frame_type = PJMEDIA_JB_NORMAL_FRAME;
+	} else {
+	    *p_frame_type = PJMEDIA_JB_MISSING_FRAME;
+	    jb->jb_lost++;
+	}
+
+	/* Calculate delay on the first GET */
+	if (jb->jb_last_op == JB_OP_PUT)
+	    pj_math_stat_update(&jb->jb_delay, cur_size * jb->jb_frame_ptime);
+    }
+
+    jb->jb_level++;
+    jbuf_update(jb, JB_OP_GET);
+}
+
+/*
+ * Get jitter buffer state.
+ */
+PJ_DEF(pj_status_t) pjmedia_jbuf_get_state( pjmedia_jbuf *jb,
+					    pjmedia_jb_state *state )
+{
+    PJ_ASSERT_RETURN(jb && state, PJ_EINVAL);
+
+    state->frame_size = jb->jb_frame_size;
+    state->min_prefetch = jb->jb_min_prefetch;
+    state->max_prefetch = jb->jb_max_prefetch;
+    
+    state->prefetch = jb->jb_prefetch;
+    state->size = jb_framelist_size(&jb->jb_framelist);
+    
+    state->avg_delay = jb->jb_delay.mean;
+    state->min_delay = jb->jb_delay.min;
+    state->max_delay = jb->jb_delay.max;
+    state->dev_delay = pj_math_stat_get_stddev(&jb->jb_delay);
+    
+    state->avg_burst = jb->jb_burst.mean;
+    state->empty = jb->jb_empty;
+    state->discard = jb->jb_discard;
+    state->lost = jb->jb_lost;
+
+    return PJ_SUCCESS;
+}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/master_port.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/master_port.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/master_port.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/master_port.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/mem_capture.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/mem_capture.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/mem_capture.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/mem_capture.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/mem_player.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/mem_player.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/mem_player.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/mem_player.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/null_port.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/null_port.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/null_port.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/null_port.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/nullsound.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/nullsound.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/nullsound.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/nullsound.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/pasound.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/pasound.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/pasound.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/pasound.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/plc_common.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/plc_common.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/plc_common.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/plc_common.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/port.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/port.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/port.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/port.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_libsamplerate.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/resample_libsamplerate.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_libsamplerate.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/resample_libsamplerate.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_port.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/resample_port.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_port.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/resample_port.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_resample.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/resample_resample.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_resample.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/resample_resample.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_speex.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/resample_speex.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/resample_speex.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/resample_speex.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/rtcp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/rtcp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp_xr.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/rtcp_xr.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtcp_xr.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/rtcp_xr.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtp.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/rtp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/rtp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/rtp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/sdp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/sdp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp_cmp.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/sdp_cmp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp_cmp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/sdp_cmp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp_neg.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/sdp_neg.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp_neg.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/sdp_neg.c
index 7d14c9e265c93a19cbf2f5276f4f9cae9f17ee44..c128118a157d3bbb25f0c0565770e63bb6c5b071 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sdp_neg.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/sdp_neg.c
@@ -1,4 +1,4 @@
-/* $Id: sdp_neg.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: sdp_neg.c 2795 2009-06-24 18:52:57Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -422,10 +422,18 @@ PJ_DEF(pj_status_t) pjmedia_sdp_neg_set_local_answer( pj_pool_t *pool,
     /* State now is STATE_WAIT_NEGO. */
     neg->state = PJMEDIA_SDP_NEG_STATE_WAIT_NEGO;
     if (local) {
-	if (!neg->initial_sdp) {
+	neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local);
+	if (neg->initial_sdp) {
+	    /* I don't think there is anything in RFC 3264 that mandates
+	     * answerer to place the same origin (and increment version)
+	     * in the answer, but probably it won't hurt either.
+	     * Note that the version will be incremented in 
+	     * pjmedia_sdp_neg_negotiate()
+	     */
+	    neg->neg_local_sdp->origin.id = neg->initial_sdp->origin.id;
+	} else {
 	    neg->initial_sdp = pjmedia_sdp_session_clone(pool, local);
 	}
-	neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local);
     } else {
 	PJ_ASSERT_RETURN(neg->initial_sdp, PJMEDIA_SDPNEG_ENOINITIAL);
 	neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, neg->initial_sdp);
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/session.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/session.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/session.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/session.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/silencedet.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/silencedet.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/silencedet.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/silencedet.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sound_port.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/sound_port.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/sound_port.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/sound_port.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/splitcomb.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/splitcomb.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/splitcomb.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/splitcomb.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stereo_port.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/stereo_port.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stereo_port.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/stereo_port.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stream.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/stream.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stream.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/stream.c
index ca518d73ccbdc48ffa679ec9038005e0227ffa10..479a8a1ff109bd1e16f9c219cebba7c535f784c8 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/stream.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/stream.c
@@ -1,4 +1,4 @@
-/* $Id: stream.c 2543 2009-03-23 13:22:45Z nanang $ */
+/* $Id: stream.c 2818 2009-06-25 13:27:02Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -1884,6 +1884,10 @@ PJ_DEF(pj_status_t) pjmedia_stream_destroy( pjmedia_stream *stream )
 	stream->jb_mutex = NULL;
     }
 
+    /* Destroy jitter buffer */
+    if (stream->jb)
+	pjmedia_jbuf_destroy(stream->jb);
+
     return PJ_SUCCESS;
 }
 
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/symbian_sound.cpp b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/symbian_sound.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9aa762fa408205ffe6e5d175a484e058e82bade9
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/symbian_sound.cpp
@@ -0,0 +1,944 @@
+/* $Id: symbian_sound.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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.
+    pjmedia_dir		 	 dir;
+    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;
+    }
+}
+
+
+/*
+ * Utility: print sound device error
+ */
+static void snd_perror(const char *title, TInt rc) 
+{
+    PJ_LOG(1,(THIS_FILE, "%s: error code %d", title, rc));
+}
+ 
+//////////////////////////////////////////////////////////////////////////////
+//
+
+/*
+ * Implementation: Symbian Input Stream.
+ */
+class CPjAudioInputEngine : public CBase, 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();
+
+private:
+    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_;
+
+    // cache variable
+    // to avoid calculating frame length repeatedly
+    TInt			  frameLen_;
+    
+    // in some SymbianOS (e.g: OSv9.1), sometimes recorded size != requested framesize
+    // so let's provide a buffer to make sure the rec callback returns framesize as requested.
+    TUint8		     *frameRecBuf_;
+    TInt			  frameRecBufLen_;
+
+    CPjAudioInputEngine(pjmedia_snd_stream *parent_strm,
+			pjmedia_snd_rec_cb rec_cb,
+			void *user_data);
+    void ConstructL();
+    TPtr8 & GetFrame();
+    
+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), userData_(user_data), 
+      iInputStream_(NULL), iStreamBuffer_(NULL), iFramePtr_(0, 0),
+      lastError_(KErrNone), timeStamp_(0),
+      frameLen_(parent_strm->samples_per_frame * parent_strm->channel_count * BYTES_PER_SAMPLE),
+      frameRecBuf_(NULL), frameRecBufLen_(0)
+{
+}
+
+CPjAudioInputEngine::~CPjAudioInputEngine()
+{
+    Stop();
+
+    delete iStreamBuffer_;
+    iStreamBuffer_ = NULL;
+    
+    delete [] frameRecBuf_;
+    frameRecBuf_ = NULL;
+    frameRecBufLen_ = 0;
+}
+
+void CPjAudioInputEngine::ConstructL()
+{
+    iStreamBuffer_ = HBufC8::NewL(frameLen_);
+    CleanupStack::PushL(iStreamBuffer_);
+
+    frameRecBuf_ = new TUint8[frameLen_*2];
+    CleanupStack::PushL(frameRecBuf_);
+}
+
+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->frameRecBuf_);
+    CleanupStack::Pop(self->iStreamBuffer_);
+    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);
+
+    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);
+    
+    // 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_symbianos_poll(-1, 100);
+    }
+
+    if (iInputStream_) {
+	delete iInputStream_;
+	iInputStream_ = NULL;
+    }
+    
+    state_ = STATE_INACTIVE;
+}
+
+
+TPtr8 & CPjAudioInputEngine::GetFrame() 
+{
+    //iStreamBuffer_->Des().FillZ(frameLen_);
+    iFramePtr_.Set((TUint8*)(iStreamBuffer_->Ptr()), frameLen_, frameLen_);
+    return iFramePtr_;
+}
+
+void CPjAudioInputEngine::MaiscOpenComplete(TInt aError)
+{
+    lastError_ = aError;
+    if (aError != KErrNone) {
+        snd_perror("Error in MaiscOpenComplete()", aError);
+    	return;
+    }
+
+    // set stream priority to normal and time sensitive
+    iInputStream_->SetPriority(EPriorityNormal, 
+    			       EMdaPriorityPreferenceTime);				
+
+    // Read the first frame.
+    TPtr8 & frm = GetFrame();
+    TRAPD(err2, iInputStream_->ReadL(frm));
+    if (err2) {
+    	PJ_LOG(4,(THIS_FILE, "Exception in iInputStream_->ReadL()"));
+    }
+}
+
+void CPjAudioInputEngine::MaiscBufferCopied(TInt aError, 
+					    const TDesC8 &aBuffer)
+{
+    lastError_ = aError;
+    if (aError != KErrNone) {
+    	snd_perror("Error in MaiscBufferCopied()", aError);
+	return;
+    }
+
+    if (frameRecBufLen_ || aBuffer.Size() < frameLen_) {
+		pj_memcpy(frameRecBuf_ + frameRecBufLen_, (void*) aBuffer.Ptr(), aBuffer.Size());
+		frameRecBufLen_ += aBuffer.Size();
+    }
+
+    if (frameRecBufLen_) {
+    	while (frameRecBufLen_ >= frameLen_) {
+	    	// Call the callback.
+		    recCb_(userData_, timeStamp_, frameRecBuf_, frameLen_);
+		    // Increment timestamp.
+		    timeStamp_ += parentStrm_->samples_per_frame;
+
+		    frameRecBufLen_ -= frameLen_;
+		    pj_memmove(frameRecBuf_, frameRecBuf_+frameLen_, frameRecBufLen_);
+    	}
+    } else {
+    	// Call the callback.
+	    recCb_(userData_, timeStamp_, (void*) aBuffer.Ptr(), aBuffer.Size());
+	    // Increment timestamp.
+	    timeStamp_ += parentStrm_->samples_per_frame;
+    }
+
+    // Record next frame
+    TPtr8 & frm = GetFrame();
+    TRAPD(err2, iInputStream_->ReadL(frm));
+    if (err2) {
+    	PJ_LOG(4,(THIS_FILE, "Exception in iInputStream_->ReadL()"));
+    }
+}
+
+
+void CPjAudioInputEngine::MaiscRecordComplete(TInt aError)
+{
+    lastError_ = aError;
+    state_ = STATE_INACTIVE;
+    if (aError != KErrNone) {
+    	snd_perror("Error in MaiscRecordComplete()", aError);
+    }
+}
+
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+/*
+ * Implementation: Symbian Output Stream.
+ */
+
+class CPjAudioOutputEngine : public CBase, 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();
+
+private:
+    State		     state_;
+    pjmedia_snd_stream	    *parentStrm_;
+    pjmedia_snd_play_cb	     playCb_;
+    void		    *userData_;
+    CMdaAudioOutputStream   *iOutputStream_;
+    TUint8		    *frameBuf_;
+    unsigned		     frameBufSize_;
+    TPtrC8		     frame_;
+    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);
+
+    // 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_symbianos_poll(-1, 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/2th of stream max volume
+	iOutputStream_->SetVolume(iOutputStream_->MaxVolume()/2);
+	
+	// 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.
+	frame_.Set(frameBuf_, frameBufSize_);
+	iOutputStream_->WriteL(frame_);
+    } else {
+    	snd_perror("Error in MaoscOpenComplete()", aError);
+    }
+}
+
+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.
+	frame_.Set(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;
+	snd_perror("Error in MaoscBufferCopied()", aError);
+    }
+}
+
+void CPjAudioOutputEngine::MaoscPlayComplete(TInt aError)
+{
+    lastError_ = aError;
+    state_ = STATE_INACTIVE;
+    if (aError != KErrNone) {
+    	snd_perror("Error in MaoscPlayComplete()", aError);
+    }
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+
+/*
+ * 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 */
+    if (index == (unsigned)-1)
+	index = 0;
+
+    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;
+
+    if (index==-1) index = 0;
+    
+    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->dir = PJMEDIA_DIR_CAPTURE;
+    strm->pool = pool;
+    strm->clock_rate = clock_rate;
+    strm->channel_count = channel_count;
+    strm->samples_per_frame = samples_per_frame;
+
+    PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL);
+    PJ_ASSERT_RETURN(get_clock_rate_cap(clock_rate) != 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(get_channel_cap(channel_count) != 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;
+
+    if (index == -1) index = 0;
+    
+    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->dir = PJMEDIA_DIR_PLAYBACK;    
+    strm->pool = pool;
+    strm->clock_rate = clock_rate;
+    strm->channel_count = channel_count;
+    strm->samples_per_frame = samples_per_frame;
+
+    PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL);
+    PJ_ASSERT_RETURN(get_clock_rate_cap(clock_rate) != 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(get_channel_cap(channel_count) != 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;
+
+    if (rec_id == -1) rec_id = 0;
+    if (play_id == -1) play_id = 0;
+    
+    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->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK;
+    strm->pool = pool;
+    strm->clock_rate = clock_rate;
+    strm->channel_count = channel_count;
+    strm->samples_per_frame = samples_per_frame;
+
+    PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL);
+    PJ_ASSERT_RETURN(get_clock_rate_cap(clock_rate) != 0, PJ_EINVAL);
+    PJ_ASSERT_RETURN(get_channel_cap(channel_count) != 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);
+    }
+
+    // Create the input stream.
+    TRAPD(err1, strm->inEngine = CPjAudioInputEngine::NewL(strm, rec_cb, 
+    							   user_data));
+    if (err1 != KErrNone) {
+        strm->inEngine = NULL;
+        delete strm->outEngine;
+    	strm->outEngine = NULL;
+    	pj_pool_release(pool);	
+	return PJ_RETURN_OS_ERROR(err1);
+    }
+
+    // Done.
+    *p_snd_strm = strm;
+    return PJ_SUCCESS;
+}
+
+/*
+ * Get stream info.
+ */
+PJ_DEF(pj_status_t) pjmedia_snd_stream_get_info(pjmedia_snd_stream *strm,
+						pjmedia_snd_stream_info *pi)
+{
+    PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL);
+
+    pj_bzero(pi, sizeof(*pi));
+    pi->dir = strm->dir;
+    pi->play_id = 0;
+    pi->rec_id = 0;
+    pi->clock_rate = strm->clock_rate;
+    pi->channel_count = strm->channel_count;
+    pi->samples_per_frame = strm->samples_per_frame;
+    pi->bits_per_sample = BYTES_PER_SAMPLE * 8;
+    // Symbian uses 4096 bytes buffer (~2048 samples/256 ms) for PCM rec & play.
+    // The latencies below are rounded up to be a multiplication of 80.
+    pi->rec_latency  = 2080;
+    pi->play_latency = 2080;
+
+    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->outEngine) {
+    	status = stream->outEngine->StartPlay();
+    	if (status != PJ_SUCCESS)
+    	    return status;
+    }
+    
+    if (stream->inEngine) {
+    	status = stream->inEngine->StartRecord();
+    	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;
+}
+
+
+/*
+ * Set sound latency.
+ */
+PJ_DEF(pj_status_t) pjmedia_snd_set_latency(unsigned input_latency, 
+					    unsigned output_latency)
+{
+    /* Nothing to do */
+    PJ_UNUSED_ARG(input_latency);
+    PJ_UNUSED_ARG(output_latency);
+    return PJ_SUCCESS;
+}
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/symbian_sound_aps.cpp b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/symbian_sound_aps.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..85cf6106ae5beaad65e9b0d23838a4088469d0e3
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/symbian_sound_aps.cpp
@@ -0,0 +1,920 @@
+/* $Id: symbian_sound_aps.cpp 2540 2009-03-23 13:18:19Z nanang $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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/alaw_ulaw.h>
+#include <pjmedia/errno.h>
+#include <pjmedia/symbian_sound_aps.h>
+#include <pj/assert.h>
+#include <pj/log.h>
+#include <pj/math.h>
+#include <pj/os.h>
+
+#include <e32msgqueue.h>
+#include <sounddevice.h>
+#include <APSClientSession.h>
+
+//////////////////////////////////////////////////////////////////////////////
+//
+
+#define THIS_FILE	    "symbian_sound_aps.cpp"
+
+#define BYTES_PER_SAMPLE    2
+#define POOL_NAME	    "SymbianSoundAps"
+#define POOL_SIZE	    512
+#define POOL_INC	    512
+
+#if 1
+#   define TRACE_(st) PJ_LOG(3, st)
+#else
+#   define TRACE_(st)
+#endif
+
+static pjmedia_snd_dev_info symbian_snd_dev_info = 
+{
+    "Symbian Sound Device (APS)",
+    1,
+    1,
+    8000
+};
+
+/* App UID to open global APS queues to communicate with the APS server. */
+extern TPtrC		    APP_UID;
+
+/* Default setting for loudspeaker */
+static pj_bool_t act_loudspeaker = PJ_FALSE;
+
+/* Forward declaration of CPjAudioEngine */
+class CPjAudioEngine;
+
+/* 
+ * PJMEDIA Sound Stream instance 
+ */
+struct pjmedia_snd_stream
+{
+    // Pool
+    pj_pool_t			*pool;
+
+    // Common settings.
+    pjmedia_dir		 	 dir;
+    unsigned			 clock_rate;
+    unsigned			 channel_count;
+    unsigned			 samples_per_frame;
+
+    // Audio engine
+    CPjAudioEngine		*engine;
+};
+
+static pj_pool_factory *snd_pool_factory;
+
+
+/*
+ * Utility: print sound device error
+ */
+static void snd_perror(const char *title, TInt rc) 
+{
+    PJ_LOG(1,(THIS_FILE, "%s (error code=%d)", title, rc));
+}
+ 
+//////////////////////////////////////////////////////////////////////////////
+//
+
+/**
+ * Abstract class for handler of callbacks from APS client.
+ */
+class MQueueHandlerObserver
+{
+public:
+    virtual void InputStreamInitialized(const TInt aStatus) = 0;
+    virtual void OutputStreamInitialized(const TInt aStatus) = 0;
+    virtual void NotifyError(const TInt aError) = 0;
+
+    virtual void RecCb(TAPSCommBuffer &buffer) = 0;
+    virtual void PlayCb(TAPSCommBuffer &buffer) = 0;
+};
+
+/**
+ * Handler for communication and data queue.
+ */
+class CQueueHandler : public CActive
+{
+public:
+    // Types of queue handler
+    enum TQueueHandlerType {
+        ERecordCommQueue,
+        EPlayCommQueue,
+        ERecordQueue,
+        EPlayQueue
+    };
+
+    // The order corresponds to the APS Server state, do not change!
+    enum TState {
+    	EAPSPlayerInitialize        = 1,
+    	EAPSRecorderInitialize      = 2,
+    	EAPSPlayData                = 3,
+    	EAPSRecordData              = 4,
+    	EAPSPlayerInitComplete      = 5,
+    	EAPSRecorderInitComplete    = 6
+    };
+
+    static CQueueHandler* NewL(MQueueHandlerObserver* aObserver, 
+			       RMsgQueue<TAPSCommBuffer>* aQ, 
+			       TQueueHandlerType aType)
+    {
+	CQueueHandler* self = new (ELeave) CQueueHandler(aObserver, aQ, aType);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+    }
+
+    // Destructor
+    ~CQueueHandler() { Cancel(); }
+
+    // Start listening queue event
+    void Start() {
+	iQ->NotifyDataAvailable(iStatus);
+	SetActive();
+    }
+
+private:
+    // Constructor
+    CQueueHandler(MQueueHandlerObserver* aObserver, 
+		  RMsgQueue<TAPSCommBuffer>* aQ, 
+		  TQueueHandlerType aType) 
+	: CActive(CActive::EPriorityHigh),
+	  iQ(aQ), iObserver(aObserver), iType(aType)
+    {
+	CActiveScheduler::Add(this);
+
+	// use lower priority for comm queues
+	if ((iType == ERecordCommQueue) || (iType == EPlayCommQueue))
+	    SetPriority(CActive::EPriorityStandard);
+    }
+
+    // Second phase constructor
+    void ConstructL() {}
+
+    // Inherited from CActive
+    void DoCancel() { iQ->CancelDataAvailable(); }
+
+    void RunL() {
+	if (iStatus != KErrNone) {
+	    iObserver->NotifyError(iStatus.Int());
+	    return;
+        }    
+
+	TAPSCommBuffer buffer;
+	TInt ret = iQ->Receive(buffer);
+
+	if (ret != KErrNone) {
+	    iObserver->NotifyError(ret);
+	    return;
+	}
+
+	switch (iType) {
+	case ERecordQueue:
+	    if (buffer.iCommand == EAPSRecordData) {
+		iObserver->RecCb(buffer);
+	    }
+	    break;
+
+	// Callbacks from the APS main thread
+	case EPlayCommQueue:
+	    switch (buffer.iCommand) {
+		case EAPSPlayData:
+		    if (buffer.iStatus == KErrUnderflow) {
+			iObserver->PlayCb(buffer);
+		    }
+		    break;
+		case EAPSPlayerInitialize:
+		    iObserver->NotifyError(buffer.iStatus);
+		    break;
+		case EAPSPlayerInitComplete:
+		    iObserver->OutputStreamInitialized(buffer.iStatus);
+		    break;
+		case EAPSRecorderInitComplete:
+		    iObserver->InputStreamInitialized(buffer.iStatus);
+		    break;
+		default:
+		    iObserver->NotifyError(buffer.iStatus);
+		    break;
+	    }
+	    break;
+
+	// Callbacks from the APS recorder thread
+	case ERecordCommQueue:
+	    switch (buffer.iCommand) {
+		// The APS recorder thread will only report errors
+		// through this handler. All other callbacks will be
+		// sent from the APS main thread through EPlayCommQueue
+		case EAPSRecorderInitialize:
+		    if (buffer.iStatus == KErrNone) {
+			iObserver->InputStreamInitialized(buffer.iStatus);
+			break;
+		    }
+		case EAPSRecordData:
+		    iObserver->NotifyError(buffer.iStatus);
+		    break;
+		default:
+		    break;
+	    }
+	    break;
+
+	default:
+	    break;
+        }
+
+        // issue next request
+        iQ->NotifyDataAvailable(iStatus);
+        SetActive();
+    }
+
+    // Data
+    RMsgQueue<TAPSCommBuffer>	*iQ;   // (not owned)
+    MQueueHandlerObserver	*iObserver; // (not owned)
+    TQueueHandlerType            iType;
+};
+
+
+/*
+ * Implementation: Symbian Input & Output Stream.
+ */
+class CPjAudioEngine : public CBase, MQueueHandlerObserver
+{
+public:
+    enum State
+    {
+	STATE_NULL,
+	STATE_READY,
+	STATE_STREAMING
+    };
+
+    ~CPjAudioEngine();
+
+    static CPjAudioEngine *NewL(pjmedia_snd_stream *parent_strm,
+				pjmedia_snd_rec_cb rec_cb,
+				pjmedia_snd_play_cb play_cb,
+				void *user_data);
+
+    TInt StartL();
+    void Stop();
+
+    TInt ActivateSpeaker(TBool active);
+
+private:
+    CPjAudioEngine(pjmedia_snd_stream *parent_strm,
+		   pjmedia_snd_rec_cb rec_cb,
+		   pjmedia_snd_play_cb play_cb,
+		   void *user_data);
+    void ConstructL();
+    
+    TInt InitPlayL();
+    TInt InitRecL();
+    TInt StartStreamL();
+    
+    // Inherited from MQueueHandlerObserver
+    virtual void InputStreamInitialized(const TInt aStatus);
+    virtual void OutputStreamInitialized(const TInt aStatus);
+    virtual void NotifyError(const TInt aError);
+
+    virtual void RecCb(TAPSCommBuffer &buffer);
+    virtual void PlayCb(TAPSCommBuffer &buffer);
+
+    State			 state_;
+    pjmedia_snd_stream		*parentStrm_;
+    pjmedia_snd_rec_cb		 recCb_;
+    pjmedia_snd_play_cb		 playCb_;
+    void			*userData_;
+    pj_uint32_t			 TsPlay_;
+    pj_uint32_t			 TsRec_;
+
+    RAPSSession                  iSession;
+    TAPSInitSettings             iSettings;
+    RMsgQueue<TAPSCommBuffer>    iReadQ;
+    RMsgQueue<TAPSCommBuffer>    iReadCommQ;
+    RMsgQueue<TAPSCommBuffer>    iWriteQ;
+    RMsgQueue<TAPSCommBuffer>    iWriteCommQ;
+
+    CQueueHandler		*iPlayCommHandler;
+    CQueueHandler		*iRecCommHandler;
+    CQueueHandler		*iRecHandler;
+    
+    static pj_uint8_t		 aps_samples_per_frame;
+    
+    pj_int16_t			*play_buf;
+    pj_uint16_t			 play_buf_len;
+    pj_uint16_t			 play_buf_start;
+    pj_int16_t			*rec_buf;
+    pj_uint16_t			 rec_buf_len;
+};
+
+
+pj_uint8_t CPjAudioEngine::aps_samples_per_frame = 0;
+
+
+CPjAudioEngine* CPjAudioEngine::NewL(pjmedia_snd_stream *parent_strm,
+				     pjmedia_snd_rec_cb rec_cb,
+				     pjmedia_snd_play_cb play_cb,
+				     void *user_data)
+{
+    CPjAudioEngine* self = new (ELeave) CPjAudioEngine(parent_strm,
+						       rec_cb, play_cb,
+						       user_data);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+}
+
+CPjAudioEngine::CPjAudioEngine(pjmedia_snd_stream *parent_strm,
+			       pjmedia_snd_rec_cb rec_cb,
+			       pjmedia_snd_play_cb play_cb,
+			       void *user_data) 
+      : state_(STATE_NULL),
+	parentStrm_(parent_strm),
+	recCb_(rec_cb),
+	playCb_(play_cb),
+	userData_(user_data),
+	iPlayCommHandler(0),
+	iRecCommHandler(0),
+	iRecHandler(0)
+{
+}
+
+CPjAudioEngine::~CPjAudioEngine()
+{
+    Stop();
+
+    delete iPlayCommHandler;
+    iPlayCommHandler = NULL;
+    delete iRecCommHandler;
+    iRecCommHandler = NULL;
+
+    // On some devices, immediate closing after stopping may cause APS server
+    // panic KERN-EXEC 0, so let's wait for sometime before really closing
+    // the client session.
+    TTime start, now;
+    enum { APS_CLOSE_WAIT_TIME = 200 }; /* in msecs */
+    
+    start.UniversalTime();
+    do {
+	pj_symbianos_poll(-1, APS_CLOSE_WAIT_TIME);
+	now.UniversalTime();
+    } while (now.MicroSecondsFrom(start) < APS_CLOSE_WAIT_TIME * 1000);
+    
+    iSession.Close();
+
+    if (state_ == STATE_READY) {
+	if (parentStrm_->dir != PJMEDIA_DIR_PLAYBACK) {
+	    iReadQ.Close();
+	    iReadCommQ.Close();
+	}
+	iWriteQ.Close();
+	iWriteCommQ.Close();
+    }
+}
+
+TInt CPjAudioEngine::InitPlayL()
+{
+    if (state_ == STATE_STREAMING || state_ == STATE_READY)
+	return 0;
+
+    TInt err = iSession.InitializePlayer(iSettings);
+    if (err != KErrNone) {
+	snd_perror("Failed to initialize player", err);
+	return err;
+    }
+
+    // Open message queues for the output stream
+    TBuf<128> buf2 = iSettings.iGlobal;
+    buf2.Append(_L("PlayQueue"));
+    TBuf<128> buf3 = iSettings.iGlobal;
+    buf3.Append(_L("PlayCommQueue"));
+
+    while (iWriteQ.OpenGlobal(buf2))
+	User::After(10);
+    while (iWriteCommQ.OpenGlobal(buf3))
+	User::After(10);
+
+    // Construct message queue handler
+    iPlayCommHandler = CQueueHandler::NewL(this,
+					   &iWriteCommQ,
+					   CQueueHandler::EPlayCommQueue);
+
+    // Start observing APS callbacks on output stream message queue
+    iPlayCommHandler->Start();
+
+    return 0;
+}
+
+TInt CPjAudioEngine::InitRecL()
+{
+    if (state_ == STATE_STREAMING || state_ == STATE_READY)
+	return 0;
+
+    // Initialize input stream device
+    TInt err = iSession.InitializeRecorder(iSettings);
+    if (err != KErrNone) {
+	snd_perror("Failed to initialize recorder", err);
+	return err;
+    }
+
+    TBuf<128> buf1 = iSettings.iGlobal;
+    buf1.Append(_L("RecordQueue"));
+    TBuf<128> buf4 = iSettings.iGlobal;
+    buf4.Append(_L("RecordCommQueue"));
+
+    // Must wait for APS thread to finish creating message queues
+    // before we can open and use them.
+    while (iReadQ.OpenGlobal(buf1))
+	User::After(10);
+    while (iReadCommQ.OpenGlobal(buf4))
+	User::After(10);
+
+    // Construct message queue handlers
+    iRecCommHandler = CQueueHandler::NewL(this,
+					  &iReadCommQ,
+					  CQueueHandler::ERecordCommQueue);
+
+    // Start observing APS callbacks from on input stream message queue
+    iRecCommHandler->Start();
+    
+    return 0;
+}
+
+TInt CPjAudioEngine::StartL()
+{
+    TInt err = iSession.Connect();
+    if (err != KErrNone && err != KErrAlreadyExists)
+	return err;
+
+    if (state_ == STATE_READY)
+	return StartStreamL();
+
+    // Even if only capturer are opened, playback thread of APS Server need 
+    // to be run(?). Since some messages will be delivered via play comm queue.
+    return InitPlayL();
+}
+
+void CPjAudioEngine::Stop()
+{
+    iSession.Stop();
+
+    delete iRecHandler;
+    iRecHandler = NULL;
+
+    state_ = STATE_READY;
+}
+
+void CPjAudioEngine::ConstructL()
+{
+    iSettings.iFourCC		    = TFourCC(KMCPFourCCIdG711);
+    iSettings.iGlobal		    = APP_UID;
+    iSettings.iPriority		    = TMdaPriority(100);
+    iSettings.iPreference	    = TMdaPriorityPreference(0x05210001);
+    iSettings.iSettings.iChannels   = EMMFMono;
+    iSettings.iSettings.iSampleRate = EMMFSampleRate8000Hz;
+    iSettings.iSettings.iVolume	    = 0;
+    
+    /* play_buf size is samples per frame of parent stream. */
+    play_buf = (pj_int16_t*)pj_pool_alloc(parentStrm_->pool, 
+				          parentStrm_->samples_per_frame << 1);
+    play_buf_len = 0;
+    play_buf_start = 0;
+    
+    /* rec_buf size is samples per frame of parent stream. */
+    rec_buf  = (pj_int16_t*)pj_pool_alloc(parentStrm_->pool, 
+					  parentStrm_->samples_per_frame << 1);
+    rec_buf_len = 0;
+}
+
+TInt CPjAudioEngine::StartStreamL()
+{
+    if (state_ == STATE_STREAMING)
+	return 0;
+
+    iSession.SetCng(EFalse);
+    iSession.SetVadMode(EFalse);
+    iSession.SetPlc(EFalse);
+    iSession.SetEncoderMode(EULawOr30ms);
+    iSession.SetDecoderMode(EULawOr30ms);
+    iSession.ActivateLoudspeaker(act_loudspeaker);
+
+    // Not only playback
+    if (parentStrm_->dir != PJMEDIA_DIR_PLAYBACK) {
+	iRecHandler = CQueueHandler::NewL(this, &iReadQ, 
+					  CQueueHandler::ERecordQueue);
+	iRecHandler->Start();
+	iSession.Read();
+	TRACE_((THIS_FILE, "APS recorder started"));
+    }
+
+    // Not only capture
+    if (parentStrm_->dir != PJMEDIA_DIR_CAPTURE) {
+	iSession.Write();
+	TRACE_((THIS_FILE, "APS player started"));
+    }
+
+    state_ = STATE_STREAMING;
+    return 0;
+}
+
+///////////////////////////////////////////////////////////
+// Inherited from MQueueHandlerObserver
+//
+
+void CPjAudioEngine::InputStreamInitialized(const TInt aStatus)
+{
+    TRACE_((THIS_FILE, "InputStreamInitialized %d", aStatus));
+
+    state_ = STATE_READY;
+    if (aStatus == KErrNone) {
+	StartStreamL();
+    }
+}
+
+void CPjAudioEngine::OutputStreamInitialized(const TInt aStatus)
+{
+    TRACE_((THIS_FILE, "OutputStreamInitialized %d", aStatus));
+
+    if (aStatus == KErrNone) {
+	if (parentStrm_->dir == PJMEDIA_DIR_PLAYBACK) {
+	    state_ = STATE_READY;
+	    // Only playback, start directly
+	    StartStreamL();
+	} else
+	    InitRecL();
+    }
+}
+
+void CPjAudioEngine::NotifyError(const TInt aError)
+{
+    snd_perror("Error from CQueueHandler", aError);
+}
+
+void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
+{
+    pj_assert(buffer.iBuffer[0] == 1 && buffer.iBuffer[1] == 0);
+
+    /* Detect the recorder G.711 frame size, player frame size will follow 
+     * this recorder frame size. 
+     */
+    if (CPjAudioEngine::aps_samples_per_frame == 0) {
+	CPjAudioEngine::aps_samples_per_frame = buffer.iBuffer.Length() < 160?
+						 80 : 160;
+	TRACE_((THIS_FILE, "Detected APS G.711 frame size = %u samples", 
+		CPjAudioEngine::aps_samples_per_frame));
+    }
+
+    /* Decode APS buffer (coded in G.711) and put the PCM result into rec_buf.
+     * Whenever rec_buf is full, call parent stream callback.  
+     */ 
+    unsigned dec_len = 0;
+
+    while (dec_len < CPjAudioEngine::aps_samples_per_frame) {
+	unsigned tmp;
+
+	tmp = PJ_MIN(parentStrm_->samples_per_frame - rec_buf_len, 
+		     CPjAudioEngine::aps_samples_per_frame - dec_len);
+	pjmedia_ulaw_decode(&rec_buf[rec_buf_len], 
+			    buffer.iBuffer.Ptr() + 2 + dec_len, 
+			    tmp);
+	rec_buf_len += tmp;
+	dec_len += tmp;
+	
+	pj_assert(rec_buf_len <= parentStrm_->samples_per_frame);
+	
+	if (rec_buf_len == parentStrm_->samples_per_frame) {
+	    recCb_(userData_, 0, rec_buf, rec_buf_len << 1);
+	    rec_buf_len = 0;
+	}
+    }
+}
+
+void CPjAudioEngine::PlayCb(TAPSCommBuffer &buffer)
+{
+    buffer.iCommand = CQueueHandler::EAPSPlayData;
+    buffer.iStatus = 0;
+    buffer.iBuffer.Zero();
+    buffer.iBuffer.Append(1);
+    buffer.iBuffer.Append(0);
+
+    /* Send 10ms silence frame if frame size hasn't been known. */
+    if (CPjAudioEngine::aps_samples_per_frame == 0) {
+	pjmedia_zero_samples(play_buf, 80);
+	pjmedia_ulaw_encode((pj_uint8_t*)play_buf, play_buf, 80);
+	buffer.iBuffer.Append((TUint8*)play_buf, 80);
+	iWriteQ.Send(buffer);
+	return;
+    }
+    
+    unsigned enc_len = 0;
+    
+    /* Call parent stream callback to get PCM samples to play,
+     * encode the PCM samples into G.711 and put it into APS buffer. 
+     */
+    while (enc_len < CPjAudioEngine::aps_samples_per_frame) {
+	if (play_buf_len == 0) {
+	    playCb_(userData_, 0, play_buf, parentStrm_->samples_per_frame<<1);
+	    play_buf_len = parentStrm_->samples_per_frame;
+	    play_buf_start = 0;
+	}
+	
+	unsigned tmp;
+	
+	tmp = PJ_MIN(play_buf_len, 
+		     CPjAudioEngine::aps_samples_per_frame - enc_len);
+	pjmedia_ulaw_encode((pj_uint8_t*)&play_buf[play_buf_start], 
+			    &play_buf[play_buf_start], 
+			    tmp);
+	buffer.iBuffer.Append((TUint8*)&play_buf[play_buf_start], tmp);
+	enc_len += tmp;
+	play_buf_len -= tmp;
+	play_buf_start += tmp;
+    }
+
+    iWriteQ.Send(buffer);
+}
+
+//
+// End of inherited from MQueueHandlerObserver
+/////////////////////////////////////////////////////////////
+
+
+TInt CPjAudioEngine::ActivateSpeaker(TBool active)
+{
+    if (state_ == STATE_READY || state_ == STATE_STREAMING) {
+        iSession.ActivateLoudspeaker(active);
+	return KErrNone;
+    }
+    return KErrNotReady;
+}
+//////////////////////////////////////////////////////////////////////////////
+//
+
+
+/*
+ * 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 */
+    if (index == (unsigned)-1)
+	index = 0;
+
+    PJ_ASSERT_RETURN(index==0, NULL);
+    return &symbian_snd_dev_info;
+}
+
+static pj_status_t sound_open(pjmedia_dir dir,
+			      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(p_snd_strm, PJ_EINVAL);
+    PJ_ASSERT_RETURN(clock_rate == 8000 && channel_count == 1 && 
+		     bits_per_sample == 16, PJ_ENOTSUP);
+    PJ_ASSERT_RETURN((dir == PJMEDIA_DIR_CAPTURE_PLAYBACK && rec_cb && play_cb)
+		     || (dir == PJMEDIA_DIR_CAPTURE && rec_cb && !play_cb)
+		     || (dir == PJMEDIA_DIR_PLAYBACK && !rec_cb && play_cb),
+		     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->dir = dir;
+    strm->pool = pool;
+    strm->clock_rate = clock_rate;
+    strm->channel_count = channel_count;
+    strm->samples_per_frame = samples_per_frame;
+
+    // Create the audio engine.
+    TRAPD(err, strm->engine = CPjAudioEngine::NewL(strm, rec_cb, 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;
+}
+
+
+
+/*
+ * 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)
+{
+    if (index < 0) index = 0;
+    PJ_ASSERT_RETURN(index == 0, PJ_EINVAL);
+
+    return sound_open(PJMEDIA_DIR_CAPTURE, clock_rate, channel_count, 
+		      samples_per_frame, bits_per_sample, rec_cb, NULL,
+		      user_data, p_snd_strm);
+}
+
+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 )
+{
+    if (index < 0) index = 0;
+    PJ_ASSERT_RETURN(index == 0, PJ_EINVAL);
+
+    return sound_open(PJMEDIA_DIR_PLAYBACK, clock_rate, channel_count, 
+		      samples_per_frame, bits_per_sample, NULL, play_cb,
+		      user_data, p_snd_strm);
+}
+
+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)
+{
+    if (rec_id < 0) rec_id = 0;
+    if (play_id < 0) play_id = 0;
+    PJ_ASSERT_RETURN(play_id == 0 && rec_id == 0, PJ_EINVAL);
+
+    return sound_open(PJMEDIA_DIR_CAPTURE_PLAYBACK, clock_rate, channel_count, 
+		      samples_per_frame, bits_per_sample, rec_cb, play_cb,
+		      user_data, p_snd_strm);
+}
+
+/*
+ * Get stream info.
+ */
+PJ_DEF(pj_status_t) pjmedia_snd_stream_get_info(pjmedia_snd_stream *strm,
+						pjmedia_snd_stream_info *pi)
+{
+    PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL);
+
+    pj_bzero(pi, sizeof(*pi));
+    pi->dir = strm->dir;
+    pi->play_id = 0;
+    pi->rec_id = 0;
+    pi->clock_rate = strm->clock_rate;
+    pi->channel_count = strm->channel_count;
+    pi->samples_per_frame = strm->samples_per_frame;
+    pi->bits_per_sample = BYTES_PER_SAMPLE * 8;
+    // latencies approximation (in samples)
+    pi->rec_latency  = strm->samples_per_frame * 2;
+    pi->play_latency = strm->samples_per_frame * 2;
+
+    return PJ_SUCCESS;
+}
+
+
+PJ_DEF(pj_status_t) pjmedia_snd_stream_start(pjmedia_snd_stream *stream)
+{
+    PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL);
+    
+    if (stream->engine) {
+	TInt err = stream->engine->StartL();
+    	if (err != KErrNone)
+    	    return PJ_RETURN_OS_ERROR(err);
+    }
+    	
+    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->engine) {
+    	stream->engine->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->engine) {
+    	delete stream->engine;
+    	stream->engine = 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;
+}
+
+
+/*
+ * Set sound latency.
+ */
+PJ_DEF(pj_status_t) pjmedia_snd_set_latency(unsigned input_latency, 
+					    unsigned output_latency)
+{
+    /* Nothing to do */
+    PJ_UNUSED_ARG(input_latency);
+    PJ_UNUSED_ARG(output_latency);
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Activate/deactivate loudspeaker.
+ */
+PJ_DEF(pj_status_t) pjmedia_snd_aps_activate_loudspeaker(
+					pjmedia_snd_stream *stream, 
+					pj_bool_t active)
+{
+    if (stream == NULL) {
+	act_loudspeaker = active;
+    } else {
+	if (stream->engine == NULL)
+	    return PJ_EINVAL;
+
+	TInt err = stream->engine->ActivateSpeaker(active);
+	if (err != KErrNone)
+	    return PJ_RETURN_OS_ERROR(err);
+    }
+
+    return PJ_SUCCESS;
+}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/tonegen.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/tonegen.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/tonegen.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/tonegen.c
index 9338fe8b0a54ba7875f5f74089cb31a1b7c7789d..4065cf0bcc1485fca85daf9b422942c230a68131 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/tonegen.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/tonegen.c
@@ -1,4 +1,4 @@
-/* $Id: tonegen.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: tonegen.c 2793 2009-06-24 15:52:17Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -384,13 +384,13 @@ static pjmedia_tone_digit_map digit_map =
 	{ '0', 941,  1336 },
 	{ '1', 697,  1209 },
 	{ '2', 697,  1336 },
-	{ '3', 697,  1447 },
+	{ '3', 697,  1477 },
 	{ '4', 770,  1209 },
 	{ '5', 770,  1336 },
-	{ '6', 770,  1447 },
+	{ '6', 770,  1477 },
 	{ '7', 852,  1209 },
 	{ '8', 852,  1336 },
-	{ '9', 852,  1447 },
+	{ '9', 852,  1477 },
 	{ 'a', 697,  1633 },
 	{ 'b', 770,  1633 },
 	{ 'c', 852,  1633 },
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_adapter_sample.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_adapter_sample.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_adapter_sample.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_adapter_sample.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_ice.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_ice.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_ice.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_ice.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_loop.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_loop.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_loop.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_loop.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_srtp.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_srtp.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_srtp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_srtp.c
index b9650d1b02c14c04a10993bf905dc6a748377aff..92f22fd8bebcb235b855424c00c815f8e7ea1c7e 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_srtp.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_srtp.c
@@ -1,4 +1,4 @@
-/* $Id: transport_srtp.c 2533 2009-03-23 13:07:05Z nanang $ */
+/* $Id: transport_srtp.c 2794 2009-06-24 16:00:36Z nanang $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -22,6 +22,7 @@
 #include <pjmedia/endpoint.h>
 #include <pjlib-util/base64.h>
 #include <pj/assert.h>
+#include <pj/ctype.h>
 #include <pj/lock.h>
 #include <pj/log.h>
 #include <pj/os.h>
@@ -979,6 +980,7 @@ static pj_status_t parse_attr_crypto(pj_pool_t *pool,
 {
     pj_str_t input;
     char *token;
+    int token_len;
     pj_str_t tmp;
     pj_status_t status;
     int itmp;
@@ -992,10 +994,20 @@ static pj_status_t parse_attr_crypto(pj_pool_t *pool,
 	PJ_LOG(4,(THIS_FILE, "Attribute crypto expecting tag"));
 	return PJMEDIA_SDP_EINATTR;
     }
-    *tag = atoi(token);
-    if (*tag == 0)
+    token_len = pj_ansi_strlen(token);
+
+    /* Tag must not use leading zeroes. */
+    if (token_len > 1 && *token == '0')
 	return PJMEDIA_SDP_EINATTR;
 
+    /* Tag must be decimal, i.e: contains only digit '0'-'9'. */
+    for (itmp = 0; itmp < token_len; ++itmp)
+	if (!pj_isdigit(token[itmp]))
+	    return PJMEDIA_SDP_EINATTR;
+
+    /* Get tag value. */
+    *tag = atoi(token);
+
     /* Crypto-suite */
     token = strtok(NULL, " ");
     if (!token) {
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_udp.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_udp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/transport_udp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/transport_udp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_player.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wav_player.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_player.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wav_player.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_playlist.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wav_playlist.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_playlist.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wav_playlist.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_writer.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wav_writer.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wav_writer.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wav_writer.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wave.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wave.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wave.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wave.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wmme_sound.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wmme_sound.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wmme_sound.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wmme_sound.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wsola.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wsola.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/pjmedia/wsola.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/pjmedia/wsola.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/audio_tool.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/audio_tool.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/audio_tool.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/audio_tool.c
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/jbuf_test.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/jbuf_test.c
new file mode 100644
index 0000000000000000000000000000000000000000..3e8964832e9bdde62fd3dc62f063f5543e7f1c8b
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/jbuf_test.c
@@ -0,0 +1,308 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <stdio.h>
+#include <ctype.h>
+#include <pj/pool.h>
+#include "test.h"
+
+#define JB_INIT_PREFETCH    0
+#define JB_MIN_PREFETCH	    0
+#define JB_MAX_PREFETCH	    10
+#define JB_PTIME	    20
+#define JB_BUF_SIZE	    50
+
+#define REPORT
+//#define PRINT_COMMENT
+
+typedef struct test_param_t {
+    pj_bool_t adaptive;
+    unsigned init_prefetch;
+    unsigned min_prefetch;
+    unsigned max_prefetch;
+} test_param_t;
+
+typedef struct test_cond_t {
+    int burst;
+    int discard;
+    int lost;
+    int empty;
+    int delay;	    /**< Maximum delay, in frames.	    */
+} test_cond_t;
+
+static pj_bool_t parse_test_headers(char *line, test_param_t *param, 
+			       test_cond_t *cond)
+{
+    char *p = line;
+
+    if (*p == '%') {
+	/* Test params. */
+	char mode_st[16];
+
+	sscanf(p+1, "%s %u %u %u", mode_st, &param->init_prefetch, 
+	       &param->min_prefetch, &param->max_prefetch);
+	param->adaptive = (pj_ansi_stricmp(mode_st, "adaptive") == 0);
+
+    } else if (*p == '!') {
+	/* Success condition. */
+	char cond_st[16];
+	unsigned cond_val;
+
+	sscanf(p+1, "%s %u", cond_st, &cond_val);
+	if (pj_ansi_stricmp(cond_st, "burst") == 0)
+	    cond->burst = cond_val;
+	else if (pj_ansi_stricmp(cond_st, "delay") == 0)
+	    cond->delay = cond_val;
+	else if (pj_ansi_stricmp(cond_st, "discard") == 0)
+	    cond->discard = cond_val;
+	else if (pj_ansi_stricmp(cond_st, "empty") == 0)
+	    cond->empty = cond_val;
+	else if (pj_ansi_stricmp(cond_st, "lost") == 0)
+	    cond->lost = cond_val;
+
+    } else if (*p == '=') {
+	/* Test title. */
+	++p;
+	while (*p && isspace(*p)) ++p;
+	printf("%s", p);
+    } else {
+	/* Unknown header, perhaps this is the test data */
+
+	/* Skip spaces */
+	while (*p && isspace(*p)) ++p;
+
+	/* Test data started.*/
+	if (*p != 0)
+	    return PJ_FALSE;
+    }
+
+    return PJ_TRUE;
+}
+
+static pj_bool_t process_test_data(char data, pjmedia_jbuf *jb, 
+				   pj_uint16_t *seq, pj_uint16_t *last_seq)
+{
+    char frame[1];
+    char f_type;
+    pj_bool_t print_state = PJ_TRUE;
+    pj_bool_t data_eos = PJ_FALSE;
+
+    switch (toupper(data)) {
+    case 'G': /* Get */
+	pjmedia_jbuf_get_frame(jb, frame, &f_type);
+	break;
+    case 'P': /* Put */
+	pjmedia_jbuf_put_frame(jb, (void*)frame, 1, *seq);
+	*last_seq = *seq;
+	++*seq;
+	break;
+    case 'L': /* Lost */
+	*last_seq = *seq;
+	++*seq;
+	printf("Lost\n");
+	break;
+    case 'R': /* Sequence restarts */
+	*seq = 1;
+	printf("Sequence restarting, from %u to %u\n", *last_seq, *seq);
+	break;
+    case 'J': /* Sequence jumps */
+	(*seq) += 5000;
+	printf("Sequence jumping, from %u to %u\n", *last_seq, *seq);
+	break;
+    case 'D': /* Frame duplicated */
+	pjmedia_jbuf_put_frame(jb, (void*)frame, 1, *seq - 1);
+	break;
+    case 'O': /* Old/late frame */
+	pjmedia_jbuf_put_frame(jb, (void*)frame, 1, *seq - 10 - pj_rand()%40);
+	break;
+    case '.': /* End of test session. */
+	data_eos = PJ_TRUE;
+	break;
+    default:
+	print_state = PJ_FALSE;
+	printf("Unknown test data '%c'\n", data);
+	break;
+    }
+
+    if (data_eos)
+	return PJ_FALSE;
+
+#ifdef REPORT
+    if (print_state) {
+	pjmedia_jb_state state;
+
+	pjmedia_jbuf_get_state(jb, &state);
+	printf("seq=%d\t%c\tsize=%d\tprefetch=%d\n", 
+	       *last_seq, toupper(data), state.size, state.prefetch);
+    }
+#endif
+
+    return PJ_TRUE;
+}
+
+int jbuf_main(void)
+{
+    FILE *input = fopen("JBTEST.DAT", "rt");
+    pj_bool_t data_eof = PJ_FALSE;
+    int old_log_level;
+    int rc = 0;
+
+    old_log_level = pj_log_get_level();
+    pj_log_set_level(5);
+
+    while (rc == 0 && !data_eof) {
+	pj_str_t jb_name = {"JBTEST", 6};
+	pjmedia_jbuf *jb;
+	pj_pool_t *pool;
+	pjmedia_jb_state state;
+	pj_uint16_t last_seq = 0;
+	pj_uint16_t seq = 1;
+	char line[1024], *p = NULL;
+
+	test_param_t param;
+	test_cond_t cond;
+
+	param.adaptive = PJ_TRUE;
+	param.init_prefetch = JB_INIT_PREFETCH;
+	param.min_prefetch = JB_MIN_PREFETCH;
+	param.max_prefetch = JB_MAX_PREFETCH;
+
+	cond.burst = -1;
+	cond.delay = -1;
+	cond.discard = -1;
+	cond.empty = -1;
+	cond.lost = -1;
+
+	printf("\n\n");
+
+	/* Parse test session title, param, and conditions */
+	do {
+	    p = fgets(line, sizeof(line), input);
+	} while (p && parse_test_headers(line, &param, &cond));
+
+	/* EOF test data */
+	if (p == NULL)
+	    break;
+
+	//printf("======================================================\n");
+
+	/* Initialize test session */
+	pool = pj_pool_create(mem, "JBPOOL", 256*16, 256*16, NULL);
+	pjmedia_jbuf_create(pool, &jb_name, 1, JB_PTIME, JB_BUF_SIZE, &jb);
+	pjmedia_jbuf_reset(jb);
+
+	if (param.adaptive) {
+	    pjmedia_jbuf_set_adaptive(jb, 
+				      param.init_prefetch, 
+				      param.min_prefetch,
+				      param.max_prefetch);
+	} else {
+	    pjmedia_jbuf_set_fixed(jb, param.init_prefetch);
+	}
+
+#ifdef REPORT
+	pjmedia_jbuf_get_state(jb, &state);
+	printf("Initial\tsize=%d\tprefetch=%d\tmin.pftch=%d\tmax.pftch=%d\n", 
+	       state.size, state.prefetch, state.min_prefetch, 
+	       state.max_prefetch);
+#endif
+
+
+	/* Test session start */
+	while (1) {
+	    int c;
+	    
+	    /* Get next line of test data */
+	    if (!p || *p == 0) {
+		p = fgets(line, sizeof(line), input);
+		if (p == NULL) {
+		    data_eof = PJ_TRUE;
+		    break;
+		}
+	    }
+
+	    /* Get next char of test data */
+	    c = *p++;
+
+	    /* Skip spaces */
+	    if (isspace(c))
+		continue;
+
+	    /* Print comment line */
+	    if (c == '#') {
+#ifdef PRINT_COMMENT
+		while (*p && isspace(*p)) ++p;
+		if (*p) printf("..%s", p);
+#endif
+		*p = 0;
+		continue;
+	    }
+
+	    /* Process test data */
+	    if (!process_test_data(c, jb, &seq, &last_seq))
+		break;
+	}
+
+	/* Print JB states */
+	pjmedia_jbuf_get_state(jb, &state);
+	printf("------------------------------------------------------\n");
+	printf("Summary:\n");
+	printf("  size=%d prefetch=%d\n", state.size, state.prefetch);
+	printf("  delay (min/max/avg/dev)=%d/%d/%d/%d ms\n",
+	       state.min_delay, state.max_delay, state.avg_delay, 
+	       state.dev_delay);
+	printf("  lost=%d discard=%d empty=%d burst(avg)=%d\n", 
+	       state.lost, state.discard, state.empty, state.avg_burst);
+
+	/* Evaluate test session */
+	if (cond.burst >= 0 && (int)state.avg_burst > cond.burst) {
+	    printf("! 'Burst' should be %d, it is %d\n", 
+		   cond.burst, state.avg_burst);
+	    rc |= 1;
+	}
+	if (cond.delay >= 0 && (int)state.avg_delay/JB_PTIME > cond.delay) {
+	    printf("! 'Delay' should be %d, it is %d\n", 
+		   cond.delay, state.avg_delay/JB_PTIME);
+	    rc |= 2;
+	}
+	if (cond.discard >= 0 && (int)state.discard > cond.discard) {
+	    printf("! 'Discard' should be %d, it is %d\n",
+		   cond.discard, state.discard);
+	    rc |= 4;
+	}
+	if (cond.empty >= 0 && (int)state.empty > cond.empty) {
+	    printf("! 'Empty' should be %d, it is %d\n", 
+		   cond.empty, state.empty);
+	    rc |= 8;
+	}
+	if (cond.lost >= 0 && (int)state.lost > cond.lost) {
+	    printf("! 'Lost' should be %d, it is %d\n", 
+		   cond.lost, state.lost);
+	    rc |= 16;
+	}
+
+	pjmedia_jbuf_destroy(jb);
+	pj_pool_release(pool);
+    }
+
+    fclose(input);
+    pj_log_set_level(old_log_level);
+
+    return rc;
+}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/main.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/main.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/main.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/main.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/mips_test.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/mips_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/mips_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/mips_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/rtp_test.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/rtp_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/rtp_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/rtp_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdp_neg_test.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/sdp_neg_test.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdp_neg_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/sdp_neg_test.c
index 35c414cea67f364614b7ecb8163452b11c7c78bd..c0be9d34d14bab1f569b46b06c6ae311dcf2af3d 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdp_neg_test.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/sdp_neg_test.c
@@ -1,4 +1,4 @@
-/* $Id: sdp_neg_test.c 2548 2009-03-23 13:28:30Z bennylp $ */
+/* $Id: sdp_neg_test.c 2818 2009-06-25 13:27:02Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -39,7 +39,7 @@ struct offer_answer
     char *sdp3;			/* local active media	local answer	*/
 };
 
-struct test
+static struct test
 {
     const char		*title;
     unsigned		 offer_answer_count;
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdptest.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/sdptest.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/sdptest.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/sdptest.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/session_test.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/session_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/session_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/session_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/test.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/test.c
similarity index 96%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/test.c
index 2bae030b1a4352c84bba6bfcf3e61847e904a7e9..0c39963eb91d14b68fdc1f132b8caa887bfe8350 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/test.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/test.c
@@ -60,11 +60,12 @@ int test_main(void)
     //sdp_test (&caching_pool.factory);
     //rtp_test(&caching_pool.factory);
     //session_test (&caching_pool.factory);
-    //jbuf_main();
-    mips_test();
+    DO_TEST(jbuf_main());
+    //DO_TEST(mips_test());
 
     PJ_LOG(3,(THIS_FILE," "));
 
+on_return:
     if (rc != 0) {
 	PJ_LOG(3,(THIS_FILE,"Test completed with error(s)!"));
     } else {
@@ -72,5 +73,6 @@ int test_main(void)
     }
 
     pj_caching_pool_destroy(&caching_pool);
+
     return rc;
 }
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/test.h b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/test.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/test.h
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/test.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/wince_main.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/wince_main.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/wince_main.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/wince_main.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/wsola_test.c b/sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/wsola_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjmedia/src/test/wsola_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjmedia/src/test/wsola_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/Makefile b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.dsp b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.dsw b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath.dsw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.dsw
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath.dsw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath_test.dsp b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath_test.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath_test.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath_test.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath_test.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath_test.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjnath_test.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjnath_test.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjstun_srv_test.dsp b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjstun_srv_test.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjstun_srv_test.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjstun_srv_test.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjstun_srv_test.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjstun_srv_test.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjstun_srv_test.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjstun_srv_test.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_client.dsp b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjturn_client.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_client.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjturn_client.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_client.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjturn_client.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_client.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjturn_client.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_srv.dsp b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjturn_srv.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/pjturn_srv.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/pjturn_srv.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_test_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/wince-evc4/pjnath_test_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_test_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/wince-evc4/pjnath_test_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/wince-evc4/pjnath_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/wince-evc4/pjnath_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_wince.vcw b/sflphone-common/libs/pjproject-1.0.3/pjnath/build/wince-evc4/pjnath_wince.vcw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/build/wince-evc4/pjnath_wince.vcw
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/build/wince-evc4/pjnath_wince.vcw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/UML-class-diagram.dia b/sflphone-common/libs/pjproject-1.0.3/pjnath/docs/UML-class-diagram.dia
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/docs/UML-class-diagram.dia
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/docs/UML-class-diagram.dia
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/UML-class-diagram.png b/sflphone-common/libs/pjproject-1.0.3/pjnath/docs/UML-class-diagram.png
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/docs/UML-class-diagram.png
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/docs/UML-class-diagram.png
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.3/pjnath/docs/doxygen.cfg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/docs/doxygen.cfg
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/docs/doxygen.cfg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/doxygen.css b/sflphone-common/libs/pjproject-1.0.3/pjnath/docs/doxygen.css
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/docs/doxygen.css
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/docs/doxygen.css
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/footer.html b/sflphone-common/libs/pjproject-1.0.3/pjnath/docs/footer.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/docs/footer.html
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/docs/footer.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/header.html b/sflphone-common/libs/pjproject-1.0.3/pjnath/docs/header.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/docs/header.html
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/docs/header.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/ice-arch.jpg b/sflphone-common/libs/pjproject-1.0.3/pjnath/docs/ice-arch.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/docs/ice-arch.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/docs/ice-arch.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/docs/stun-arch.jpg b/sflphone-common/libs/pjproject-1.0.3/pjnath/docs/stun-arch.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/docs/stun-arch.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/docs/stun-arch.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/config.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/config.h
similarity index 97%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/config.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/config.h
index d2f79be003b35df45bbd88b606c7ab094de110d1..b7bf10901054bbc47fb65e4848afd2efb9bd9fe0 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/config.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/config.h
@@ -1,5 +1,5 @@
 /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #ifndef __PJNATH_CONFIG_H__
 #define __PJNATH_CONFIG_H__
@@ -65,9 +65,9 @@
 
 /**
  * The default initial STUN round-trip time estimation (the RTO value
- * in RFC 3489-bis), in miliseconds.
- * This value is used to control the STUN request
- * retransmit time. The initial value of retransmission interval
+ * in RFC 3489-bis), in miliseconds. 
+ * This value is used to control the STUN request 
+ * retransmit time. The initial value of retransmission interval 
  * would be set to this value, and will be doubled after each
  * retransmission.
  */
@@ -78,7 +78,7 @@
 
 /**
  * The STUN transaction timeout value, in miliseconds.
- * After the last retransmission is sent and if no response is received
+ * After the last retransmission is sent and if no response is received 
  * after this time, the STUN transaction will be considered to have failed.
  *
  * The default value is 16x RTO (as per RFC 3489-bis).
@@ -201,8 +201,8 @@
 
 
 /**
- * Number of seconds to refresh the permission/channel binding before the
- * permission/channel binding expires. This value should be greater than
+ * Number of seconds to refresh the permission/channel binding before the 
+ * permission/channel binding expires. This value should be greater than 
  * PJ_TURN_PERM_TIMEOUT setting.
  */
 #ifndef PJ_TURN_REFRESH_SEC_BEFORE
@@ -211,7 +211,7 @@
 
 
 /**
- * The TURN session timer heart beat interval. When this timer occurs, the
+ * The TURN session timer heart beat interval. When this timer occurs, the 
  * TURN session will scan all the permissions/channel bindings to see which
  * need to be refreshed.
  */
@@ -270,10 +270,10 @@
 /**
  * The number of bits to represent ICE candidate's local preference. The
  * local preference is used to specify preference among candidates with
- * the same type, and ICE draft suggests 65535 as the default local
- * preference, which means we need 16 bits to represent the value. But
+ * the same type, and ICE draft suggests 65535 as the default local 
+ * preference, which means we need 16 bits to represent the value. But 
  * since we don't have the facility to specify local preference, we'll
- * just disable this feature and let the preference sorted by the
+ * just disable this feature and let the preference sorted by the 
  * type only.
  *
  * Default: 0
@@ -304,15 +304,15 @@
 
 
 /**
- * According to ICE Section 8.2. Updating States, if an In-Progress pair in
- * the check list is for the same component as a nominated pair, the agent
+ * According to ICE Section 8.2. Updating States, if an In-Progress pair in 
+ * the check list is for the same component as a nominated pair, the agent 
  * SHOULD cease retransmissions for its check if its pair priority is lower
  * than the lowest priority nominated pair for that component.
  *
  * If a higher priority check is In Progress, this rule would cause that
  * check to be performed even when it most likely will fail.
  *
- * The macro here controls if ICE session should cancel all In Progress
+ * The macro here controls if ICE session should cancel all In Progress 
  * checks for the same component regardless of its priority.
  *
  * Default: 1 (yes, cancel all)
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/errno.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/errno.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/errno.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/errno.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/ice_session.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/ice_session.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/ice_session.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/ice_session.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/ice_strans.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/ice_strans.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/ice_strans.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/ice_strans.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/nat_detect.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/nat_detect.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/nat_detect.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/nat_detect.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_auth.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_auth.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_auth.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_auth.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_config.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_config.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_config.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_config.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_msg.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_msg.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_msg.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_msg.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_session.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_session.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_session.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_session.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_sock.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_sock.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_sock.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_sock.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_transaction.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_transaction.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/stun_transaction.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/stun_transaction.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/turn_session.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/turn_session.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/turn_session.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/turn_session.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/turn_sock.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/turn_sock.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/turn_sock.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/turn_sock.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/types.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/include/pjnath/types.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/include/pjnath/types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/ice_test.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/ice_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/ice_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/ice_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/main.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/main.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/main.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/main.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/main_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/main_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/main_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/main_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/server.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/server.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/server.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/server.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/server.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/server.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/server.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/server.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/sess_auth.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/sess_auth.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/sess_auth.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/sess_auth.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/stun.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/stun.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/stun.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/stun.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/stun_sock_test.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/stun_sock_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/stun_sock_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/stun_sock_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/test.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/test.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/test.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/test.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/test.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/turn_sock_test.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/turn_sock_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath-test/turn_sock_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath-test/turn_sock_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/errno.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/errno.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/errno.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/errno.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_session.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/ice_session.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_session.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/ice_session.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_strans.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/ice_strans.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/ice_strans.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/ice_strans.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/nat_detect.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/nat_detect.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/nat_detect.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/nat_detect.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_auth.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_auth.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_auth.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_auth.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_msg.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_msg.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_msg.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_msg.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_msg_dump.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_msg_dump.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_msg_dump.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_msg_dump.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_session.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_session.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_session.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_session.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_sock.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_sock.c
similarity index 97%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_sock.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_sock.c
index 40ab8ad5891db05fb1f8a91045fb6558b84ee279..90b32e50c126debb55c85571044e786df21cefff 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_sock.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_sock.c
@@ -1,4 +1,4 @@
-/* $Id: stun_sock.c 2531 2009-03-23 13:02:53Z bennylp $ */
+/* $Id: stun_sock.c 2808 2009-06-25 12:42:03Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -534,8 +534,17 @@ PJ_DEF(pj_status_t) pj_stun_sock_get_info( pj_stun_sock *stun_sock,
 	info->alias_cnt = 1;
 	pj_sockaddr_cp(&info->aliases[0], &info->bound_addr);
     } else {
+	pj_sockaddr def_addr;
+	pj_uint16_t port = pj_sockaddr_get_port(&info->bound_addr); 
 	unsigned i;
 
+	/* Get the default address */
+	status = pj_gethostip(stun_sock->af, &def_addr);
+	if (status != PJ_SUCCESS)
+	    return status;
+	
+	pj_sockaddr_set_port(&def_addr, port);
+	
 	/* Enum all IP interfaces in the host */
 	info->alias_cnt = PJ_ARRAY_SIZE(info->aliases);
 	status = pj_enum_ip_interface(stun_sock->af, &info->alias_cnt, 
@@ -545,10 +554,18 @@ PJ_DEF(pj_status_t) pj_stun_sock_get_info( pj_stun_sock *stun_sock,
 
 	/* Set the port number for each address.
 	 */
-	if (stun_sock->af == pj_AF_INET()) {
-	    for (i=0; i<info->alias_cnt; ++i) {
-		pj_sockaddr_set_port(&info->aliases[i],
-				     pj_sockaddr_get_port(&info->bound_addr));
+	for (i=0; i<info->alias_cnt; ++i) {
+	    pj_sockaddr_set_port(&info->aliases[i], port);
+	}
+
+	/* Put the default IP in the first slot */
+	for (i=0; i<info->alias_cnt; ++i) {
+	    if (pj_sockaddr_cmp(&info->aliases[i], &def_addr)==0) {
+		if (i!=0) {
+		    pj_sockaddr_cp(&info->aliases[i], &info->aliases[0]);
+		    pj_sockaddr_cp(&info->aliases[0], &def_addr);
+		}
+		break;
 	    }
 	}
     }
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_transaction.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_transaction.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/stun_transaction.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/stun_transaction.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_session.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/turn_session.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_session.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/turn_session.c
index 1edb2f944e7c911123a99b499754fffd77cf2bfd..43801fe7f48fc3c38ba1271b3a4fbc0dd0162fdb 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_session.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/turn_session.c
@@ -1,4 +1,4 @@
-/* $Id: turn_session.c 2407 2009-01-01 20:56:36Z bennylp $ */
+/* $Id: turn_session.c 2810 2009-06-25 12:53:14Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -638,9 +638,10 @@ PJ_DEF(pj_status_t) pj_turn_session_alloc(pj_turn_session *sess,
 
     pj_lock_acquire(sess->lock);
 
+    if (param && param != &sess->alloc_param) 
+	pj_turn_alloc_param_copy(sess->pool, &sess->alloc_param, param);
+
     if (sess->state < PJ_TURN_STATE_RESOLVED) {
-	if (param && param != &sess->alloc_param) 
-	    pj_turn_alloc_param_copy(sess->pool, &sess->alloc_param, param);
 	sess->pending_alloc = PJ_TRUE;
 
 	PJ_LOG(4,(sess->obj_name, "Pending ALLOCATE in state %s",
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_sock.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/turn_sock.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjnath/turn_sock.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjnath/turn_sock.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-client/client_main.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-client/client_main.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-client/client_main.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-client/client_main.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/allocation.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/allocation.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/allocation.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/allocation.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/auth.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/auth.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/auth.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/auth.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/auth.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/auth.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/auth.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/auth.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/listener_tcp.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/listener_tcp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/listener_tcp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/listener_tcp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/listener_udp.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/listener_udp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/listener_udp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/listener_udp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/main.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/main.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/main.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/main.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/server.c b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/server.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/server.c
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/server.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/turn.h b/sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/turn.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjnath/src/pjturn-srv/turn.h
rename to sflphone-common/libs/pjproject-1.0.3/pjnath/src/pjturn-srv/turn.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjproject-vs8.sln b/sflphone-common/libs/pjproject-1.0.3/pjproject-vs8.sln
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjproject-vs8.sln
rename to sflphone-common/libs/pjproject-1.0.3/pjproject-vs8.sln
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjproject.dsw b/sflphone-common/libs/pjproject-1.0.3/pjproject.dsw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjproject.dsw
rename to sflphone-common/libs/pjproject-1.0.3/pjproject.dsw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Footprint.mak b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/Footprint.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Footprint.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/Footprint.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Makefile b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Samples-vc.mak b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/Samples-vc.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Samples-vc.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/Samples-vc.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Samples.mak b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/Samples.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/Samples.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/Samples.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/get-footprint.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/get-footprint.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/get-footprint.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/get-footprint.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/os-win32.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/os-win32.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/os-win32.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsip_apps.dsw b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/pjsip_apps.dsw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsip_apps.dsw
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/pjsip_apps.dsw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsua.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/pjsua.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsua.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/pjsua.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsua.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/pjsua.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/pjsua.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/pjsua.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/py_pjsua.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/py_pjsua.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/py_pjsua.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/py_pjsua.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/py_pjsua.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/py_pjsua.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/py_pjsua.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/py_pjsua.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/python_pjsua.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/python_pjsua.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/python_pjsua.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/python_pjsua.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/sample_debug.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/sample_debug.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/sample_debug.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/sample_debug.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/sample_debug.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/sample_debug.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/sample_debug.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/sample_debug.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/samples.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/samples.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/samples.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/samples.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/samples.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/samples.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/samples.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/samples.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/wince-evc4/wince_demos.vcw b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/wince-evc4/wince_demos.vcw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/build/wince-evc4/wince_demos.vcw
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/build/wince-evc4/wince_demos.vcw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/main.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua/main.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/main.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua/main.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/main_rtems.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua/main_rtems.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/main_rtems.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua/main_rtems.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/pjsua_app.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua/pjsua_app.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/pjsua_app.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua/pjsua_app.c
index ad3df904b6be652071afa52bbee19643f0af50b0..654d06100a36e95456096f52eb688a13fef3c20a 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua/pjsua_app.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua/pjsua_app.c
@@ -1,4 +1,4 @@
-/* $Id: pjsua_app.c 2544 2009-03-23 13:23:20Z bennylp $ */
+/* $Id: pjsua_app.c 2818 2009-06-25 13:27:02Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -3131,14 +3131,16 @@ void console_app_main(const pj_str_t *uri_to_call)
 		} else {
 		    pjsua_buddy_info binfo;
 		    pjsua_buddy_get_info(result.nb_result-1, &binfo);
-		    uri = binfo.uri.ptr;
+		    tmp.ptr = buf;
+		    pj_strncpy(&tmp, &binfo.uri, sizeof(buf));
 		}
 
 	    } else if (result.uri_result) {
-		uri = result.uri_result;
+		tmp = pj_str(result.uri_result);
+	    } else {
+		tmp.slen = 0;
 	    }
 	    
-	    tmp = pj_str(uri);
 	    pjsua_call_make_call( current_acc, &tmp, 0, NULL, NULL, NULL);
 	    break;
 
@@ -3162,15 +3164,15 @@ void console_app_main(const pj_str_t *uri_to_call)
 		    continue;
 		}
 		pjsua_buddy_get_info(result.nb_result-1, &binfo);
-		uri = binfo.uri.ptr;
+		tmp.ptr = buf;
+		pj_strncpy(&tmp, &binfo.uri, sizeof(buf));
 	    } else {
-		uri =  result.uri_result;
+		tmp = pj_str(result.uri_result);
 	    }
 
 	    for (i=0; i<my_atoi(menuin); ++i) {
 		pj_status_t status;
 	    
-		tmp = pj_str(uri);
 		status = pjsua_call_make_call(current_acc, &tmp, 0, NULL,
 					      NULL, NULL);
 		if (status != PJ_SUCCESS)
@@ -3208,7 +3210,9 @@ void console_app_main(const pj_str_t *uri_to_call)
 		} else {
 		    pjsua_buddy_info binfo;
 		    pjsua_buddy_get_info(result.nb_result-1, &binfo);
-		    uri = binfo.uri.ptr;
+		    tmp.ptr = buf;
+		    pj_strncpy_with_null(&tmp, &binfo.uri, sizeof(buf));
+		    uri = buf;
 		}
 
 	    } else if (result.uri_result) {
@@ -3759,22 +3763,39 @@ void console_app_main(const pj_str_t *uri_to_call)
 	    ui_input_url("Destination URI", buf, sizeof(buf), &result);
 	    if (result.nb_result != NO_NB) {
 
-		if (result.nb_result == -1 || result.nb_result == 0) {
+		if (result.nb_result == -1) {
 		    puts("Sorry you can't do that!");
 		    continue;
+		} else if (result.nb_result == 0) {
+		    uri = NULL;
+		    if (current_call == PJSUA_INVALID_ID) {
+			puts("No current call");
+			continue;
+		    }
 		} else {
 		    pjsua_buddy_info binfo;
 		    pjsua_buddy_get_info(result.nb_result-1, &binfo);
-		    uri = binfo.uri.ptr;
+		    tmp.ptr = buf;
+		    pj_strncpy_with_null(&tmp, &binfo.uri, sizeof(buf));
+		    uri = buf;
 		}
 
 	    } else if (result.uri_result) {
 		uri = result.uri_result;
 	    }
 	    
-	    tmp = pj_str(uri);
-
-	    send_request(text, &tmp);
+	    if (uri) {
+		tmp = pj_str(uri);
+		send_request(text, &tmp);
+	    } else {
+		/* If you send call control request using this method
+		 * (such requests includes BYE, CANCEL, etc.), it will
+		 * not go well with the call state, so don't do it
+		 * unless it's for testing.
+		 */
+		pj_str_t method = pj_str(text);
+		pjsua_call_send_request(current_call, &method, NULL);
+	    }
 	    break;
 
 	case 'e':
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/README.TXT b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/README.TXT
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/README.TXT
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/README.TXT
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/StdAfx.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/StdAfx.cpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/StdAfx.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/StdAfx.cpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/StdAfx.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/StdAfx.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/StdAfx.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/StdAfx.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/newres.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/newres.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/newres.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/newres.h
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1e9bbb169268ecc9e278ce73d9fad8d708a9e649
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp
@@ -0,0 +1,761 @@
+// pjsua_wince.cpp : Defines the entry point for the application.
+//
+
+#include "stdafx.h"
+#include "pjsua_wince.h"
+#include <commctrl.h>
+#include <pjsua-lib/pjsua.h>
+
+#define MAX_LOADSTRING 100
+
+// Global Variables:
+static HINSTANCE    hInst;
+static HWND	    hMainWnd;
+static HWND	    hwndCB;
+static HWND	    hwndGlobalStatus, hwndURI, hwndCallStatus;
+static HWND	    hwndActionButton, hwndExitButton;
+
+
+
+//
+// Basic config.
+//
+#define SIP_PORT	5060
+
+
+//
+// Destination URI (to make call, or to subscribe presence)
+//
+#define SIP_DST_URI	"sip:192.168.0.7:5061"
+
+//
+// Account
+//
+#define HAS_SIP_ACCOUNT	0	// 0 to disable registration
+#define SIP_DOMAIN	"server"
+#define SIP_REALM	"server"
+#define SIP_USER	"user"
+#define SIP_PASSWD	"secret"
+
+//
+// Outbound proxy for all accounts
+//
+#define SIP_PROXY	NULL
+//#define SIP_PROXY	"sip:192.168.0.2;lr"
+
+
+//
+// Configure nameserver if DNS SRV is to be used with both SIP
+// or STUN (for STUN see other settings below)
+//
+#define NAMESERVER	NULL
+//#define NAMESERVER	"62.241.163.201"
+
+//
+// STUN server
+#if 1
+	// Use this to have the STUN server resolved normally
+#   define STUN_DOMAIN	NULL
+#   define STUN_SERVER	"stun.fwdnet.net"
+#elif 0
+	// Use this to have the STUN server resolved with DNS SRV
+#   define STUN_DOMAIN	"iptel.org"
+#   define STUN_SERVER	NULL
+#else
+	// Use this to disable STUN
+#   define STUN_DOMAIN	NULL
+#   define STUN_SERVER	NULL
+#endif
+
+//
+// Use ICE?
+//
+#define USE_ICE		1
+
+
+//
+// Globals
+//
+static pj_pool_t   *g_pool;
+static pj_str_t	    g_local_uri;
+static int	    g_current_acc;
+static int	    g_current_call = PJSUA_INVALID_ID;
+static int	    g_current_action;
+
+enum
+{
+    ID_GLOBAL_STATUS	= 21,
+    ID_URI,
+    ID_CALL_STATUS,
+    ID_POLL_TIMER,
+};
+
+enum
+{
+    ID_MENU_NONE	= 64,
+    ID_MENU_CALL,
+    ID_MENU_ANSWER,
+    ID_MENU_DISCONNECT,
+    ID_BTN_ACTION,
+};
+
+
+// Forward declarations of functions included in this code module:
+static ATOM		MyRegisterClass	(HINSTANCE, LPTSTR);
+BOOL			InitInstance	(HINSTANCE, int);
+static void		OnCreate	(HWND hWnd);
+static LRESULT CALLBACK	WndProc		(HWND, UINT, WPARAM, LPARAM);
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+static void OnError(const wchar_t *title, pj_status_t status)
+{
+    char errmsg[PJ_ERR_MSG_SIZE];
+    PJ_DECL_UNICODE_TEMP_BUF(werrmsg, PJ_ERR_MSG_SIZE);
+
+    pj_strerror(status, errmsg, sizeof(errmsg));
+    
+    MessageBox(NULL, PJ_STRING_TO_NATIVE(errmsg, werrmsg, PJ_ERR_MSG_SIZE),
+	       title, MB_OK);
+}
+
+
+static void SetLocalURI(const char *uri, int len, bool enabled=true)
+{
+    wchar_t tmp[128];
+    if (len==-1) len=pj_ansi_strlen(uri);
+    pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp));
+    SetDlgItemText(hMainWnd, ID_GLOBAL_STATUS, tmp);
+    EnableWindow(hwndGlobalStatus, enabled?TRUE:FALSE);
+}
+
+
+
+static void SetURI(const char *uri, int len, bool enabled=true)
+{
+    wchar_t tmp[128];
+    if (len==-1) len=pj_ansi_strlen(uri);
+    pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp));
+    SetDlgItemText(hMainWnd, ID_URI, tmp);
+    EnableWindow(hwndURI, enabled?TRUE:FALSE);
+}
+
+
+static void SetCallStatus(const char *state, int len)
+{
+    wchar_t tmp[128];
+    if (len==-1) len=pj_ansi_strlen(state);
+    pj_ansi_to_unicode(state, len, tmp, PJ_ARRAY_SIZE(tmp));
+    SetDlgItemText(hMainWnd, ID_CALL_STATUS, tmp);
+}
+
+static void SetAction(int action, bool enable=true)
+{
+    HMENU hMenu;
+
+    hMenu = CommandBar_GetMenu(hwndCB, 0);
+
+    RemoveMenu(hMenu, ID_MENU_NONE, MF_BYCOMMAND);
+    RemoveMenu(hMenu, ID_MENU_CALL, MF_BYCOMMAND);
+    RemoveMenu(hMenu, ID_MENU_ANSWER, MF_BYCOMMAND);
+    RemoveMenu(hMenu, ID_MENU_DISCONNECT, MF_BYCOMMAND);
+
+    switch (action) {
+    case ID_MENU_NONE:
+	InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("None"));
+	SetWindowText(hwndActionButton, TEXT("-"));
+	break;
+    case ID_MENU_CALL:
+	InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Call"));
+	SetWindowText(hwndActionButton, TEXT("&Call"));
+	break;
+    case ID_MENU_ANSWER:
+	InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Answer"));
+	SetWindowText(hwndActionButton, TEXT("&Answer"));
+	break;
+    case ID_MENU_DISCONNECT:
+	InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Hangup"));
+	SetWindowText(hwndActionButton, TEXT("&Hangup"));
+	break;
+    }
+
+    EnableMenuItem(hMenu, action, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED));
+    DrawMenuBar(hMainWnd);
+
+    g_current_action = action;
+}
+
+
+/*
+ * Handler when invite state has changed.
+ */
+static void on_call_state(pjsua_call_id call_id, pjsip_event *e)
+{
+    pjsua_call_info call_info;
+
+    PJ_UNUSED_ARG(e);
+
+    pjsua_call_get_info(call_id, &call_info);
+
+    if (call_info.state == PJSIP_INV_STATE_DISCONNECTED) {
+
+	g_current_call = PJSUA_INVALID_ID;
+	SetURI(SIP_DST_URI, -1);
+	SetAction(ID_MENU_CALL);
+	//SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen);
+	SetCallStatus(call_info.last_status_text.ptr, call_info.last_status_text.slen);
+
+    } else {
+	//if (g_current_call == PJSUA_INVALID_ID)
+	//    g_current_call = call_id;
+
+	if (call_info.remote_contact.slen)
+	    SetURI(call_info.remote_contact.ptr, call_info.remote_contact.slen, false);
+	else
+	    SetURI(call_info.remote_info.ptr, call_info.remote_info.slen, false);
+
+	if (call_info.state == PJSIP_INV_STATE_CONFIRMED)
+	    SetAction(ID_MENU_DISCONNECT);
+
+	SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen);
+    }
+}
+
+
+/*
+ * Callback on media state changed event.
+ * The action may connect the call to sound device, to file, or
+ * to loop the call.
+ */
+static void on_call_media_state(pjsua_call_id call_id)
+{
+    pjsua_call_info call_info;
+
+    pjsua_call_get_info(call_id, &call_info);
+
+    if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) {
+	pjsua_conf_connect(call_info.conf_slot, 0);
+	pjsua_conf_connect(0, call_info.conf_slot);
+    }
+}
+
+
+/**
+ * Handler when there is incoming call.
+ */
+static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id,
+			     pjsip_rx_data *rdata)
+{
+    pjsua_call_info call_info;
+
+    PJ_UNUSED_ARG(acc_id);
+    PJ_UNUSED_ARG(rdata);
+
+    if (g_current_call != PJSUA_INVALID_ID) {
+	pj_str_t reason;
+	reason = pj_str("Another call is in progress");
+	pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, &reason, NULL);
+	return;
+    }
+
+    g_current_call = call_id;
+
+    pjsua_call_get_info(call_id, &call_info);
+
+    SetAction(ID_MENU_ANSWER);
+    SetURI(call_info.remote_info.ptr, call_info.remote_info.slen, false);
+    pjsua_call_answer(call_id, 200, NULL, NULL);
+}
+
+
+/*
+ * Handler registration status has changed.
+ */
+static void on_reg_state(pjsua_acc_id acc_id)
+{
+    PJ_UNUSED_ARG(acc_id);
+
+    // Log already written.
+}
+
+
+/*
+ * Handler on buddy state changed.
+ */
+static void on_buddy_state(pjsua_buddy_id buddy_id)
+{
+}
+
+
+/**
+ * Incoming IM message (i.e. MESSAGE request)!
+ */
+static void on_pager(pjsua_call_id call_id, const pj_str_t *from, 
+		     const pj_str_t *to, const pj_str_t *contact,
+		     const pj_str_t *mime_type, const pj_str_t *text)
+{
+}
+
+
+/**
+ * Received typing indication
+ */
+static void on_typing(pjsua_call_id call_id, const pj_str_t *from,
+		      const pj_str_t *to, const pj_str_t *contact,
+		      pj_bool_t is_typing)
+{
+}
+
+
+static BOOL OnInitStack(void)
+{
+    pjsua_config	    cfg;
+    pjsua_logging_config    log_cfg;
+    pjsua_media_config	    media_cfg;
+    pjsua_transport_config  udp_cfg;
+    pjsua_transport_config  rtp_cfg;
+    pjsua_transport_id	    transport_id;
+    pjsua_transport_info    transport_info;
+    pj_str_t		    tmp;
+    pj_status_t status;
+
+    /* Create pjsua */
+    status = pjsua_create();
+    if (status != PJ_SUCCESS) {
+	OnError(TEXT("Error creating pjsua"), status);
+	return FALSE;
+    }
+
+    /* Create global pool for application */
+    g_pool = pjsua_pool_create("pjsua", 4000, 4000);
+
+    /* Init configs */
+    pjsua_config_default(&cfg);
+    pjsua_media_config_default(&media_cfg);
+    pjsua_transport_config_default(&udp_cfg);
+    udp_cfg.port = SIP_PORT;
+
+    pjsua_transport_config_default(&rtp_cfg);
+    rtp_cfg.port = 40000;
+
+    pjsua_logging_config_default(&log_cfg);
+    log_cfg.level = 5;
+    log_cfg.log_filename = pj_str("\\pjsua.txt");
+    log_cfg.msg_logging = 1;
+    log_cfg.decor = pj_log_get_decor() | PJ_LOG_HAS_CR;
+
+    /* Setup media */
+    media_cfg.clock_rate = 8000;
+    media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE;
+    media_cfg.ec_tail_len = 256;
+    media_cfg.quality = 1;
+    media_cfg.ptime = 20;
+    media_cfg.enable_ice = USE_ICE;
+
+    /* Initialize application callbacks */
+    cfg.cb.on_call_state = &on_call_state;
+    cfg.cb.on_call_media_state = &on_call_media_state;
+    cfg.cb.on_incoming_call = &on_incoming_call;
+    cfg.cb.on_reg_state = &on_reg_state;
+    cfg.cb.on_buddy_state = &on_buddy_state;
+    cfg.cb.on_pager = &on_pager;
+    cfg.cb.on_typing = &on_typing;
+
+    if (SIP_PROXY) {
+	    cfg.outbound_proxy_cnt = 1;
+	    cfg.outbound_proxy[0] = pj_str(SIP_PROXY);
+    }
+    
+    if (NAMESERVER) {
+	    cfg.nameserver_count = 1;
+	    cfg.nameserver[0] = pj_str(NAMESERVER);
+    }
+    
+    if (NAMESERVER && STUN_DOMAIN) {
+	    cfg.stun_domain = pj_str(STUN_DOMAIN);
+    } else if (STUN_SERVER) {
+	    cfg.stun_host = pj_str(STUN_SERVER);
+    }
+    
+    
+    /* Initialize pjsua */
+    status = pjsua_init(&cfg, &log_cfg, &media_cfg);
+    if (status != PJ_SUCCESS) {
+	OnError(TEXT("Initialization error"), status);
+	return FALSE;
+    }
+
+    /* Set codec priority */
+    pjsua_codec_set_priority(pj_cstr(&tmp, "pcmu"), 240);
+    pjsua_codec_set_priority(pj_cstr(&tmp, "pcma"), 230);
+    pjsua_codec_set_priority(pj_cstr(&tmp, "speex/8000"), 190);
+    pjsua_codec_set_priority(pj_cstr(&tmp, "ilbc"), 189);
+    pjsua_codec_set_priority(pj_cstr(&tmp, "speex/16000"), 180);
+    pjsua_codec_set_priority(pj_cstr(&tmp, "speex/32000"), 0);
+    pjsua_codec_set_priority(pj_cstr(&tmp, "gsm"), 100);
+
+
+    /* Add UDP transport and the corresponding PJSUA account */
+    status = pjsua_transport_create(PJSIP_TRANSPORT_UDP,
+				    &udp_cfg, &transport_id);
+    if (status != PJ_SUCCESS) {
+	OnError(TEXT("Error starting SIP transport"), status);
+	return FALSE;
+    }
+
+    pjsua_transport_get_info(transport_id, &transport_info);
+
+    g_local_uri.ptr = (char*)pj_pool_alloc(g_pool, 128);
+    g_local_uri.slen = pj_ansi_sprintf(g_local_uri.ptr,
+				       "<sip:%.*s:%d>",
+				       (int)transport_info.local_name.host.slen,
+				       transport_info.local_name.host.ptr,
+				       transport_info.local_name.port);
+
+
+    /* Add local account */
+    pjsua_acc_add_local(transport_id, PJ_TRUE, &g_current_acc);
+    pjsua_acc_set_online_status(g_current_acc, PJ_TRUE);
+
+    /* Add account */
+    if (HAS_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_REALM);
+	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, &g_current_acc);
+	if (status != PJ_SUCCESS) {
+	    pjsua_destroy();
+	    return PJ_FALSE;
+	}
+    }
+
+    /* Add buddy */
+    if (SIP_DST_URI) {
+    	pjsua_buddy_config bcfg;
+    
+    	pjsua_buddy_config_default(&bcfg);
+    	bcfg.uri = pj_str(SIP_DST_URI);
+    	bcfg.subscribe = PJ_FALSE;
+    	
+    	pjsua_buddy_add(&bcfg, NULL);
+    }
+
+    /* Start pjsua */
+    status = pjsua_start();
+    if (status != PJ_SUCCESS) {
+	OnError(TEXT("Error starting pjsua"), status);
+	return FALSE;
+    }
+
+    return TRUE;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+int WINAPI WinMain(HINSTANCE hInstance,
+		   HINSTANCE hPrevInstance,
+		   LPTSTR    lpCmdLine,
+		   int       nCmdShow)
+{
+    MSG msg;
+    HACCEL hAccelTable;
+    
+
+
+    // Perform application initialization:
+    if (!InitInstance (hInstance, nCmdShow)) 
+    {
+	return FALSE;
+    }
+    
+    hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_PJSUA_WINCE);
+    
+    
+    // Main message loop:
+    while (GetMessage(&msg, NULL, 0, 0)) 
+    {
+	if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 
+	{
+	    TranslateMessage(&msg);
+	    DispatchMessage(&msg);
+	}
+    }
+    
+    return msg.wParam;
+}
+
+static ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass)
+{
+    WNDCLASS wc;
+
+    wc.style		= CS_HREDRAW | CS_VREDRAW;
+    wc.lpfnWndProc	= (WNDPROC) WndProc;
+    wc.cbClsExtra	= 0;
+    wc.cbWndExtra	= 0;
+    wc.hInstance	= hInstance;
+    wc.hIcon		= LoadIcon(hInstance, MAKEINTRESOURCE(IDI_PJSUA_WINCE));
+    wc.hCursor		= 0;
+    wc.hbrBackground	= (HBRUSH) GetStockObject(WHITE_BRUSH);
+    wc.lpszMenuName	= 0;
+    wc.lpszClassName	= szWindowClass;
+
+    return RegisterClass(&wc);
+}
+
+
+/* Callback upon NAT detection completion */
+static void nat_detect_cb(const pj_stun_nat_detect_result *res)
+{
+    if (res->status != PJ_SUCCESS) {
+	char msg[250];
+	pj_ansi_snprintf(msg, sizeof(msg), "NAT detection failed: %s",
+			 res->status_text);
+	SetCallStatus(msg, pj_ansi_strlen(msg));
+    } else {
+	char msg[250];
+	pj_ansi_snprintf(msg, sizeof(msg), "NAT type is %s",
+			 res->nat_type_name);
+	SetCallStatus(msg, pj_ansi_strlen(msg));
+    }
+}
+
+
+BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
+{
+    HWND	hWnd;
+    TCHAR	szTitle[MAX_LOADSTRING];
+    TCHAR	szWindowClass[MAX_LOADSTRING];
+
+    hInst = hInstance;
+
+    /* Init stack */
+    if (OnInitStack() == FALSE)
+	return FALSE;
+
+    LoadString(hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING);
+    MyRegisterClass(hInstance, szWindowClass);
+
+    LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
+    hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
+	    CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, 
+	    NULL, NULL, hInstance, NULL);
+
+    if (!hWnd)
+    {	
+	    return FALSE;
+    }
+
+    hMainWnd = hWnd;
+    ShowWindow(hWnd, nCmdShow);
+    UpdateWindow(hWnd);
+    if (hwndCB)
+	CommandBar_Show(hwndCB, TRUE);
+
+    SetTimer(hMainWnd, ID_POLL_TIMER, 50, NULL);
+
+    pjsua_detect_nat_type();
+    return TRUE;
+}
+
+
+static void OnCreate(HWND hWnd)
+{
+    enum 
+    {
+	X = 10,
+	Y = 40,
+	W = 220,
+	H = 30,
+    };
+
+    DWORD dwStyle;
+
+    hMainWnd = hWnd;
+
+    hwndCB = CommandBar_Create(hInst, hWnd, 1);			
+    CommandBar_InsertMenubar(hwndCB, hInst, IDM_MENU, 0);   
+    CommandBar_AddAdornments(hwndCB, 0, 0);
+
+    // Create global status text
+    dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED | ES_LEFT;  
+    hwndGlobalStatus = CreateWindow(
+                TEXT("EDIT"),   // Class name
+                NULL,           // Window text
+                dwStyle,        // Window style
+                X,		// x-coordinate of the upper-left corner
+                Y+0,            // y-coordinate of the upper-left corner
+                W,		// Width of the window for the edit
+                                // control
+                H-5,		// Height of the window for the edit
+                                // control
+                hWnd,           // Window handle to the parent window
+                (HMENU) ID_GLOBAL_STATUS, // Control identifier
+                hInst,           // Instance handle
+                NULL);          // Specify NULL for this parameter when 
+                                // you create a control
+    SetLocalURI(g_local_uri.ptr, g_local_uri.slen, false);
+
+
+    // Create URI edit
+    dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER;  
+    hwndURI = CreateWindow (
+                TEXT("EDIT"),   // Class name
+                NULL,		// Window text
+                dwStyle,        // Window style
+                X,  // x-coordinate of the upper-left corner
+                Y+H,  // y-coordinate of the upper-left corner
+                W,  // Width of the window for the edit
+                                // control
+                H-5,  // Height of the window for the edit
+                                // control
+                hWnd,           // Window handle to the parent window
+                (HMENU) ID_URI, // Control identifier
+                hInst,           // Instance handle
+                NULL);          // Specify NULL for this parameter when 
+                                // you create a control
+
+    // Create action Button
+    hwndActionButton = CreateWindow( L"button", L"Action", 
+                         WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 
+                         X, Y+2*H, 
+			 60, H-5, hWnd, 
+                         (HMENU) ID_BTN_ACTION,
+                         hInst, NULL );
+
+    // Create exit button
+    hwndExitButton = CreateWindow( L"button", L"E&xit", 
+                         WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 
+                         X+70, Y+2*H, 
+			 60, H-5, hWnd, 
+                         (HMENU) ID_EXIT,
+                         hInst, NULL );
+
+
+    // Create call status edit
+    dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED;  
+    hwndCallStatus = CreateWindow (
+                TEXT("EDIT"),   // Class name
+                NULL,		// Window text
+                dwStyle,        // Window style
+                X,  // x-coordinate of the upper-left corner
+                Y+3*H,  // y-coordinate of the upper-left corner
+                W,  // Width of the window for the edit
+                                // control
+                H-5,  // Height of the window for the edit
+                                // control
+                hWnd,           // Window handle to the parent window
+                (HMENU) ID_CALL_STATUS, // Control identifier
+                hInst,           // Instance handle
+                NULL);          // Specify NULL for this parameter when 
+                                // you create a control
+    SetCallStatus("Ready", 5);
+    SetAction(ID_MENU_CALL);
+    SetURI(SIP_DST_URI, -1);
+    SetFocus(hWnd);
+
+}
+
+
+static void OnDestroy(void)
+{
+    pjsua_destroy();
+}
+
+static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+    int wmId, wmEvent;
+    
+    switch (message) {
+    case WM_KEYUP:
+	if (wParam==114) {
+	    wParam = ID_MENU_CALL;
+	} else if (wParam==115) {
+	    if (g_current_call == PJSUA_INVALID_ID)
+		wParam = ID_EXIT;
+	    else
+		wParam = ID_MENU_DISCONNECT;
+	} else
+	    break;
+
+    case WM_COMMAND:
+	wmId    = LOWORD(wParam); 
+	wmEvent = HIWORD(wParam); 
+	if (wmId == ID_BTN_ACTION)
+	    wmId = g_current_action;
+	switch (wmId)
+	{
+	case ID_MENU_CALL:
+	    if (g_current_call != PJSUA_INVALID_ID) {
+		MessageBox(NULL, TEXT("Can not make call"), 
+			   TEXT("You already have one call active"), MB_OK);
+	    }
+	    pj_str_t dst_uri;
+	    wchar_t text[256];
+	    char tmp[256];
+	    pj_status_t status;
+
+	    GetWindowText(hwndURI, text, PJ_ARRAY_SIZE(text));
+	    pj_unicode_to_ansi(text, pj_unicode_strlen(text),
+			       tmp, sizeof(tmp));
+	    dst_uri.ptr = tmp;
+	    dst_uri.slen = pj_ansi_strlen(tmp);
+	    status = pjsua_call_make_call(g_current_acc,
+						      &dst_uri, 0, NULL,
+						      NULL, &g_current_call);
+	    if (status != PJ_SUCCESS)
+		OnError(TEXT("Unable to make call"), status);
+	    break;
+	case ID_MENU_ANSWER:
+	    if (g_current_call == PJSUA_INVALID_ID)
+		MessageBox(NULL, TEXT("Can not answer"), 
+			   TEXT("There is no call!"), MB_OK);
+	    else
+		pjsua_call_answer(g_current_call, 200, NULL, NULL);
+	    break;
+	case ID_MENU_DISCONNECT:
+	    if (g_current_call == PJSUA_INVALID_ID)
+		MessageBox(NULL, TEXT("Can not disconnect"), 
+			   TEXT("There is no call!"), MB_OK);
+	    else
+		pjsua_call_hangup(g_current_call, PJSIP_SC_DECLINE, NULL, NULL);
+	    break;
+	case ID_EXIT:
+	    DestroyWindow(hWnd);
+	    break;
+	default:
+	    return DefWindowProc(hWnd, message, wParam, lParam);
+	}
+	break;
+
+    case WM_CREATE:
+	OnCreate(hWnd);
+	break;
+
+    case WM_DESTROY:
+	OnDestroy();
+	CommandBar_Destroy(hwndCB);
+	PostQuitMessage(0);
+	break;
+
+    case WM_TIMER:
+	pjsua_handle_events(1);
+	break;
+
+    default:
+	return DefWindowProc(hWnd, message, wParam, lParam);
+    }
+   return 0;
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.ico b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.ico
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.ico
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.ico
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.rc b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.rc
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.rc
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.rc
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/pjsua_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/pjsua_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/resource.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/resource.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pjsua_wince/resource.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pjsua_wince/resource.h
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2d42d96e2ea3f8e259bbfb5dc4ab2966ea01d874
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.cpp
@@ -0,0 +1,66 @@
+// PocketPJ.cpp : Defines the class behaviors for the application.
+//
+
+#include "stdafx.h"
+#include "PocketPJ.h"
+#include "PocketPJDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CPocketPJApp
+
+BEGIN_MESSAGE_MAP(CPocketPJApp, CWinApp)
+	//{{AFX_MSG_MAP(CPocketPJApp)
+		// NOTE - the ClassWizard will add and remove mapping macros here.
+		//    DO NOT EDIT what you see in these blocks of generated code!
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CPocketPJApp construction
+
+CPocketPJApp::CPocketPJApp()
+	: CWinApp()
+{
+	// TODO: add construction code here,
+	// Place all significant initialization in InitInstance
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CPocketPJApp object
+
+CPocketPJApp theApp;
+
+/////////////////////////////////////////////////////////////////////////////
+// CPocketPJApp initialization
+
+BOOL CPocketPJApp::InitInstance()
+{
+	// Standard initialization
+	// If you are not using these features and wish to reduce the size
+	//  of your final executable, you should remove from the following
+	//  the specific initialization routines you do not need.
+
+	CPocketPJDlg dlg;
+	m_pMainWnd = &dlg;
+	int nResponse = dlg.DoModal();
+	if (nResponse == IDOK)
+	{
+		// TODO: Place code here to handle when the dialog is
+		//  dismissed with OK
+	}
+	else if (nResponse == IDCANCEL)
+	{
+		// TODO: Place code here to handle when the dialog is
+		//  dismissed with Cancel
+	}
+
+	// Since the dialog has been closed, return FALSE so that we exit the
+	//  application, rather than start the application's message pump.
+	return FALSE;
+}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.rc b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.rc
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.rc
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.rc
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcc b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.vcc
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcc
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.vcc
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcw b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.vcw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJ.vcw
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJ.vcw
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJDlg.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJDlg.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6178f6c67177c9fba037d23533b92ea9d4b64b60
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJDlg.cpp
@@ -0,0 +1,749 @@
+// PocketPJDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "PocketPJ.h"
+#include "PocketPJDlg.h"
+#include <iphlpapi.h>
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+#define TIMER_ID    101
+static CPocketPJDlg *theDlg;
+
+/////////////////////////////////////////////////////////////////////////////
+// CPocketPJDlg dialog
+
+CPocketPJDlg::CPocketPJDlg(CWnd* pParent /*=NULL*/)
+	: CDialog(CPocketPJDlg::IDD, pParent), m_PopUp(NULL)
+{
+	//{{AFX_DATA_INIT(CPocketPJDlg)
+		// NOTE: the ClassWizard will add member initialization here
+	//}}AFX_DATA_INIT
+	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
+	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+
+	theDlg = this;
+
+	m_PopUp = new CPopUpWnd(this);
+	m_PopUp->Hide();
+
+	unsigned i;
+	m_PopUpCount = 0;
+	for (i=0; i<POPUP_MAX_TYPE; ++i) {
+	    m_PopUpState[i] = FALSE;
+	}
+}
+
+void CPocketPJDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CPocketPJDlg)
+	DDX_Control(pDX, IDC_URL, m_Url);
+	DDX_Control(pDX, IDC_BUDDY_LIST, m_BuddyList);
+	DDX_Control(pDX, IDC_BTN_ACTION, m_BtnUrlAction);
+	DDX_Control(pDX, IDC_BTN_ACC, m_BtnAcc);
+	DDX_Control(pDX, IDC_ACC_ID, m_AccId);
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CPocketPJDlg, CDialog)
+	//{{AFX_MSG_MAP(CPocketPJDlg)
+	ON_BN_CLICKED(IDC_BTN_ACC, OnBtnAcc)
+	ON_BN_CLICKED(IDC_BTN_ACTION, OnBtnAction)
+	ON_COMMAND(IDC_ACC_SETTINGS, OnSettings)
+	ON_COMMAND(IDC_URI_CALL, OnUriCall)
+	ON_WM_TIMER()
+	ON_COMMAND(IDC_URI_ADD_BUDDY, OnUriAddBuddy)
+	ON_COMMAND(IDC_URI_DEL_BUDDY, OnUriDelBuddy)
+	ON_COMMAND(IDC_ACC_ONLINE, OnAccOnline)
+	ON_COMMAND(IDC_ACC_INVISIBLE, OnAccInvisible)
+	ON_NOTIFY(NM_CLICK, IDC_BUDDY_LIST, OnClickBuddyList)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+void CPocketPJDlg::Error(const CString &title, pj_status_t rc)
+{
+    char errmsg[PJ_ERR_MSG_SIZE];
+    wchar_t werrmsg[PJ_ERR_MSG_SIZE];
+
+    pj_strerror(rc, errmsg, sizeof(errmsg));
+    pj_ansi_to_unicode(errmsg, strlen(errmsg), werrmsg, PJ_ARRAY_SIZE(werrmsg));
+
+    AfxMessageBox(title + _T(": ") + werrmsg);
+}
+
+BOOL CPocketPJDlg::Restart()
+{
+    unsigned i;
+    pj_status_t status;
+
+    char ver[80];
+    sprintf(ver, "PocketPJ/%s", pj_get_version());
+
+    ShowWindow(SW_SHOW);
+    PopUp_Show(POPUP_REGISTRATION, ver,
+	       "Starting up....", "", "", "", 0);
+
+    KillTimer(TIMER_ID);
+
+    // Destroy first.
+    PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Cleaning up..");
+    pjsua_destroy();
+
+    m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_OFFLINE)) );
+    UpdateWindow();
+
+
+    // Create
+    PopUp_Show(POPUP_REGISTRATION, ver,
+	       "Starting up....", "Creating stack..", "", "", 0);
+
+    status = pjsua_create();
+    if (status != PJ_SUCCESS) {
+	Error(_T("Error in creating library"), status);
+	PopUp_Hide(POPUP_REGISTRATION);
+	return FALSE;
+    }
+
+    pjsua_config cfg;
+    pjsua_logging_config log_cfg;
+    pjsua_media_config media_cfg;
+
+    pjsua_config_default(&cfg);
+    cfg.max_calls = 1;
+    cfg.thread_cnt = 0;
+    cfg.user_agent = pj_str(ver);
+
+    cfg.cb.on_call_state = &on_call_state;
+    cfg.cb.on_call_media_state = &on_call_media_state;
+    cfg.cb.on_incoming_call = &on_incoming_call;
+    cfg.cb.on_reg_state = &on_reg_state;
+    cfg.cb.on_buddy_state = &on_buddy_state;
+    cfg.cb.on_pager = &on_pager;
+
+    /* Configure nameserver */
+    char nameserver[60];
+    {
+	FIXED_INFO fi;
+	ULONG len = sizeof(fi);
+	CString err;
+
+	PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Retrieving network parameters..");
+	if (GetNetworkParams(&fi, &len) != ERROR_SUCCESS) {
+	    err = _T("Info: Error querying network parameters. You must configure DNS server.");
+	} else if (fi.CurrentDnsServer == NULL) {
+	    err = _T("Info: DNS server not configured. You must configure DNS server.");
+	} 
+	
+	if (err.GetLength()) {
+	    if (m_Cfg.m_DNS.GetLength()) {
+		pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_DNS, m_Cfg.m_DNS.GetLength(),
+				   nameserver, sizeof(nameserver));
+		cfg.nameserver_count = 1;
+		cfg.nameserver[0] = pj_str(nameserver);
+	    } else {
+		AfxMessageBox(err);
+		pjsua_destroy();
+		PopUp_Hide(POPUP_REGISTRATION);
+		return FALSE;
+	    }
+	} else {
+	    strcpy(nameserver, fi.CurrentDnsServer->IpAddress.String);
+	    cfg.nameserver_count = 1;
+	    cfg.nameserver[0] = pj_str(nameserver);
+	}
+    }
+
+    char tmp_stun[80];
+    if (m_Cfg.m_UseStun) {
+	pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_StunSrv, m_Cfg.m_StunSrv.GetLength(),
+			   tmp_stun, sizeof(tmp_stun));
+	cfg.stun_host = pj_str(tmp_stun);
+    }
+
+    pjsua_logging_config_default(&log_cfg);
+    log_cfg.log_filename = pj_str("\\PocketPJ.TXT");
+
+    pjsua_media_config_default(&media_cfg);
+    media_cfg.clock_rate = 8000;
+    media_cfg.audio_frame_ptime = 40;
+    media_cfg.ec_tail_len = 0;
+    media_cfg.ilbc_mode = 30;
+    media_cfg.max_media_ports = 8;
+    media_cfg.quality = 5;
+    media_cfg.thread_cnt = 1;
+    media_cfg.enable_ice = m_Cfg.m_UseIce;
+    media_cfg.no_vad = !m_Cfg.m_VAD;
+
+    if (m_Cfg.m_EchoSuppress) {
+	media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE;
+	media_cfg.ec_tail_len = m_Cfg.m_EcTail;
+    }
+
+    // Init
+    PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Initializing..");
+    status = pjsua_init(&cfg, &log_cfg, &media_cfg);
+    if (status != PJ_SUCCESS) {
+	Error(_T("Error initializing library"), status);
+	pjsua_destroy();
+	PopUp_Hide(POPUP_REGISTRATION);
+	return FALSE;
+    }
+
+    // Create one UDP transport
+    PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding UDP transport..");
+    pjsua_transport_id transport_id;
+    pjsua_transport_config udp_cfg;
+
+    pjsua_transport_config_default(&udp_cfg);
+    udp_cfg.port = 0;
+    status = pjsua_transport_create(PJSIP_TRANSPORT_UDP,
+					&udp_cfg, &transport_id);
+    if (status != PJ_SUCCESS) {
+	Error(_T("Error creating UDP transport"), status);
+	pjsua_destroy();
+	PopUp_Hide(POPUP_REGISTRATION);
+	return FALSE;
+    }
+
+    if (m_Cfg.m_TCP) {
+	// Create one TCP transport
+	PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding TCP transport..");
+	pjsua_transport_id transport_id;
+	pjsua_transport_config tcp_cfg;
+
+	pjsua_transport_config_default(&tcp_cfg);
+	tcp_cfg.port = 0;
+	status = pjsua_transport_create(PJSIP_TRANSPORT_TCP,
+					&tcp_cfg, &transport_id);
+	if (status != PJ_SUCCESS) {
+	    Error(_T("Error creating TCP transport"), status);
+	    pjsua_destroy();
+	    PopUp_Hide(POPUP_REGISTRATION);
+	    return FALSE;
+	}
+    }
+
+    // Adjust codecs priority
+    pj_str_t tmp;
+    pjsua_codec_set_priority(pj_cstr(&tmp, "*"), 0);
+    for (i=0; i<(unsigned)m_Cfg.m_Codecs.GetSize(); ++i) {
+	CString codec = m_Cfg.m_Codecs.GetAt(i);
+	char tmp_nam[80];
+
+	pj_unicode_to_ansi((LPCTSTR)codec, codec.GetLength(),
+			   tmp_nam, sizeof(tmp_nam));
+	pjsua_codec_set_priority(pj_cstr(&tmp, tmp_nam), 200-i);
+    }
+
+    // Start!
+    PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Starting..");
+    status = pjsua_start();
+    if (status != PJ_SUCCESS) {
+	Error(_T("Error starting library"), status);
+	pjsua_destroy();
+	PopUp_Hide(POPUP_REGISTRATION);
+	return FALSE;
+    }
+
+    // Add account
+    PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding account..");
+    char domain[80], username[80], passwd[80];
+    char id[80], reg_uri[80];
+    pjsua_acc_config acc_cfg;
+
+    pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_Domain, m_Cfg.m_Domain.GetLength(),
+		       domain, sizeof(domain));
+    pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_User, m_Cfg.m_User.GetLength(),
+		       username, sizeof(username));
+    pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_Password, m_Cfg.m_Password.GetLength(),
+		       passwd, sizeof(passwd));
+
+    snprintf(id, sizeof(id), "<sip:%s@%s>", username, domain);
+    snprintf(reg_uri, sizeof(reg_uri), "sip:%s", domain);
+
+    pjsua_acc_config_default(&acc_cfg);
+    acc_cfg.id = pj_str(id);
+    acc_cfg.reg_uri = pj_str(reg_uri);
+    acc_cfg.cred_count = 1;
+    acc_cfg.cred_info[0].scheme = pj_str("Digest");
+    acc_cfg.cred_info[0].realm = pj_str("*");
+    acc_cfg.cred_info[0].username = pj_str(username);
+    acc_cfg.cred_info[0].data_type = 0;
+    acc_cfg.cred_info[0].data = pj_str(passwd);
+
+#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0)
+    acc_cfg.use_srtp = (m_Cfg.m_UseSrtp ? PJMEDIA_SRTP_OPTIONAL : PJMEDIA_SRTP_DISABLED);
+    acc_cfg.srtp_secure_signaling = 0;
+#endif
+
+    acc_cfg.publish_enabled = m_Cfg.m_UsePublish;
+    
+    char route[80];
+    if (m_Cfg.m_TCP) {
+	snprintf(route, sizeof(route), "<sip:%s;lr;transport=tcp>", domain);
+	acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route);
+    } else {
+	snprintf(route, sizeof(route), "<sip:%s;lr>", domain);
+	acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route);
+    }
+
+    status = pjsua_acc_add(&acc_cfg, PJ_TRUE, &m_PjsuaAccId);
+    if (status != PJ_SUCCESS) {
+	Error(_T("Invalid account settings"), status);
+	pjsua_destroy();
+	PopUp_Hide(POPUP_REGISTRATION);
+	return FALSE;
+    }
+
+    CString acc_text = m_Cfg.m_User + _T("@") + m_Cfg.m_Domain;
+    m_AccId.SetWindowText(acc_text);
+
+    PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE1, acc_text);
+    PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE2, "Registering..");
+    PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "");
+
+    SetTimer(TIMER_ID, 100, NULL);
+    return TRUE;
+}
+
+
+void CPocketPJDlg::PopUp_Show( PopUpType type, 
+			        const CString& title1,
+				const CString& title2,
+				const CString& title3,
+				const CString& btn1,
+				const CString& btn2,
+				unsigned userData)
+{
+    if (!m_PopUpState[type])
+	++m_PopUpCount;
+
+    m_PopUpState[type] = TRUE;
+
+    m_PopUpContent[type].m_Title1 = title1;
+    m_PopUpContent[type].m_Title2 = title2;
+    m_PopUpContent[type].m_Title3 = title3;
+    m_PopUpContent[type].m_Btn1 = btn1;
+    m_PopUpContent[type].m_Btn2 = btn2;
+
+    m_PopUp->SetContent(m_PopUpContent[type]);
+    m_PopUp->Show();
+}
+
+void CPocketPJDlg::PopUp_Modify(PopUpType type,
+				PopUpElement el,
+				const CString& text)
+{
+    switch (el) {
+    case POPUP_EL_TITLE1:
+	m_PopUpContent[type].m_Title1 = text;
+	break;
+    case POPUP_EL_TITLE2:
+	m_PopUpContent[type].m_Title2 = text;
+	break;
+    case POPUP_EL_TITLE3:
+	m_PopUpContent[type].m_Title3 = text;
+	break;
+    case POPUP_EL_BUTTON1:
+	m_PopUpContent[type].m_Btn1 = text;
+	break;
+    case POPUP_EL_BUTTON2:
+	m_PopUpContent[type].m_Btn1 = text;
+	break;
+    }
+
+    m_PopUp->SetContent(m_PopUpContent[type]);
+}
+
+void CPocketPJDlg::PopUp_Hide(PopUpType type)
+{
+    if (m_PopUpState[type])
+	--m_PopUpCount;
+
+    m_PopUpState[type] = FALSE;
+
+    if (m_PopUpCount == 0) {
+	m_PopUp->Hide();
+	UpdateWindow();
+    } else {
+	for (int i=POPUP_MAX_TYPE-1; i>=0; --i) {
+	    if (m_PopUpState[i]) {
+		m_PopUp->SetContent(m_PopUpContent[i]);
+		break;
+	    }
+	}
+    }
+}
+
+void CPocketPJDlg::OnCallState()
+{
+    pjsua_call_info ci;
+
+    pjsua_call_get_info(0, &ci);
+    
+    switch (ci.state) {
+    case PJSIP_INV_STATE_NULL:	    /**< Before INVITE is sent or received  */
+	break;
+    case PJSIP_INV_STATE_CALLING:   /**< After INVITE is sent		    */
+	PopUp_Show(POPUP_CALL, "Calling..", ci.remote_info.ptr, "",
+		   "", "Hangup", 0);
+	break;
+    case PJSIP_INV_STATE_INCOMING:  /**< After INVITE is received.	    */
+	PopUp_Show(POPUP_CALL, "Incoming call..", ci.remote_info.ptr, "",
+		   "Answer", "Hangup", 0);
+	pjsua_call_answer(0, 180, NULL, NULL);
+	if (m_Cfg.m_AutoAnswer)
+	    OnPopUpButton(1);
+	break;
+    case PJSIP_INV_STATE_EARLY:	    /**< After response with To tag.	    */
+    case PJSIP_INV_STATE_CONNECTING:/**< After 2xx is sent/received.	    */
+    case PJSIP_INV_STATE_CONFIRMED:  /**< After ACK is sent/received.	    */
+	{
+	    CString stateText = ci.state_text.ptr;
+	    PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, stateText);
+	}
+	break;
+    case PJSIP_INV_STATE_DISCONNECTED:/**< Session is terminated.	    */
+	PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, "Disconnected");
+	PopUp_Hide(POPUP_CALL);
+	break;
+    }    
+}
+
+void CPocketPJDlg::on_call_state(pjsua_call_id call_id, pjsip_event *e)
+{
+    theDlg->OnCallState();
+}
+
+void CPocketPJDlg::on_call_media_state(pjsua_call_id call_id)
+{
+    pjsua_call_info call_info;
+
+    pjsua_call_get_info(call_id, &call_info);
+    if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) {
+	pjsua_conf_connect(call_info.conf_slot, 0);
+	pjsua_conf_connect(0, call_info.conf_slot);
+    }
+}
+
+void CPocketPJDlg::on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id,
+				    pjsip_rx_data *rdata)
+{
+}
+
+void CPocketPJDlg::OnRegState()
+{
+    pjsua_acc_info ai;
+    pjsua_acc_get_info(m_PjsuaAccId, &ai);
+
+    CString acc_text = m_Cfg.m_User + _T("@") + m_Cfg.m_Domain;
+
+    if (ai.expires>0 && ai.status/100==2) {
+	/* Registration success */
+	HBITMAP old = m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ONLINE)) );
+	acc_text += " (OK)";
+	m_AccId.SetWindowText(acc_text);
+    } else if (ai.status/100 != 2) {
+	acc_text += " (err)";
+	Error(_T("SIP registration error"), PJSIP_ERRNO_FROM_SIP_STATUS(ai.status));
+	m_AccId.SetWindowText(acc_text);
+    }
+    PopUp_Hide(POPUP_REGISTRATION);
+}
+
+void CPocketPJDlg::on_reg_state(pjsua_acc_id acc_id)
+{
+    theDlg->OnRegState();
+}
+
+void CPocketPJDlg::on_buddy_state(pjsua_buddy_id buddy_id)
+{
+    theDlg->RedrawBuddyList();
+}
+
+void CPocketPJDlg::on_pager(pjsua_call_id call_id, const pj_str_t *from, 
+			    const pj_str_t *to, const pj_str_t *contact,
+			    const pj_str_t *mime_type, const pj_str_t *text)
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CPocketPJDlg message handlers
+
+BOOL CPocketPJDlg::OnInitDialog()
+{
+	CDialog::OnInitDialog();
+
+	// Set the icon for this dialog.  The framework does this automatically
+	//  when the application's main window is not a dialog
+	SetIcon(m_hIcon, TRUE);			// Set big icon
+	SetIcon(m_hIcon, FALSE);		// Set small icon
+	
+	CenterWindow(GetDesktopWindow());	// center to the hpc screen
+ 
+	// TODO: Add extra initialization here
+	
+	m_Cfg.LoadRegistry();
+	//ShowWindow(SW_SHOW);
+	m_AccId.SetWindowText(m_Cfg.m_User);
+
+	CImageList *il = new CImageList;
+	VERIFY(il->Create(16, 16, ILC_COLOR|ILC_MASK, 2, 4));
+
+	CBitmap *bmp = new CBitmap;
+	bmp->LoadBitmap(MAKEINTRESOURCE(IDB_BLANK));
+	il->Add(bmp, RGB(255,255,255));
+	bmp = new CBitmap;
+	bmp->LoadBitmap(MAKEINTRESOURCE(IDB_ONLINE));
+	il->Add(bmp, RGB(255,255,255));
+	
+	m_BuddyList.SetImageList(il, LVSIL_SMALL);
+
+	if (m_Cfg.m_Domain.GetLength()==0 || Restart() == FALSE) {
+	    for (;;) {
+		CSettingsDlg dlg(m_Cfg);
+		if (dlg.DoModal() != IDOK) {
+		    EndDialog(IDOK);
+		    return TRUE;
+		}
+
+		m_Cfg.SaveRegistry();
+
+		if (Restart())
+		    break;
+	    }
+	}
+
+	RedrawBuddyList();
+	return TRUE;  // return TRUE  unless you set the focus to a control
+}
+
+
+
+void CPocketPJDlg::OnBtnAcc() 
+{
+    CMenu menu;
+    VERIFY(menu.LoadMenu(IDR_ACC_MENU));
+    CMenu* pPopup = menu.GetSubMenu(0);
+    ASSERT(pPopup != NULL);
+
+    RECT r;
+    m_BtnAcc.GetWindowRect(&r);
+    pPopup->TrackPopupMenu(TPM_LEFTALIGN, r.left+4, r.top+4, this);
+}
+
+void CPocketPJDlg::OnBtnAction() 
+{
+    CMenu menu;
+    VERIFY(menu.LoadMenu(IDR_URI_MENU));
+    CMenu* pPopup = menu.GetSubMenu(0);
+    ASSERT(pPopup != NULL);
+
+    RECT r;
+    this->m_BtnUrlAction.GetWindowRect(&r);
+    pPopup->TrackPopupMenu(TPM_LEFTALIGN, r.left+4, r.top+4, this);
+}
+
+void CPocketPJDlg::OnSettings() 
+{
+    for (;;) {
+	CSettingsDlg dlg(m_Cfg);
+	if (dlg.DoModal() != IDOK) {
+	    return;
+	}
+
+	m_Cfg.SaveRegistry();
+
+	if (Restart())
+	    break;
+    }
+}
+
+void CPocketPJDlg::OnOK()
+{
+    if (AfxMessageBox(_T("Quit PocketPJ?"), MB_YESNO)==IDYES) {
+	KillTimer(TIMER_ID);
+	PopUp_Show(POPUP_REGISTRATION, "", "Shutting down..", "", "", "", 0);
+	pjsua_destroy();
+	CDialog::OnOK();
+	PopUp_Hide(POPUP_REGISTRATION);
+	m_Cfg.SaveRegistry();
+	return;
+    }
+}
+
+void CPocketPJDlg::OnTimer(UINT nIDEvent) 
+{
+    pjsua_handle_events(10);
+    CDialog::OnTimer(nIDEvent);
+}
+
+int  CPocketPJDlg::FindBuddyInPjsua(const CString &Uri)
+{
+    char uri[80];
+    pjsua_buddy_id  id[128];
+    unsigned i, count = PJ_ARRAY_SIZE(id);
+
+    if (pjsua_enum_buddies(id, &count) != PJ_SUCCESS)
+	return PJSUA_INVALID_ID;
+    if (count==0)
+	return PJSUA_INVALID_ID;
+
+    pj_unicode_to_ansi((LPCTSTR)Uri, Uri.GetLength(), uri, sizeof(uri));
+
+    for (i=0; i<count; ++i) {
+	pjsua_buddy_info bi;
+	pjsua_buddy_get_info(id[i], &bi);
+	if (pj_strcmp2(&bi.uri, uri)==0)
+	    return i;
+    }
+
+    return PJSUA_INVALID_ID;
+}
+
+int  CPocketPJDlg::FindBuddyInCfg(const CString &uri)
+{
+    int i;
+    for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) {
+	if (m_Cfg.m_BuddyList.GetAt(0) == uri) {
+	    return i;
+	}
+    }
+    return -1;
+}
+
+void CPocketPJDlg::RedrawBuddyList()
+{
+    int i;
+
+    m_BuddyList.DeleteAllItems();
+
+    for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) {
+	int isOnline;
+	int id;
+
+	id = FindBuddyInPjsua(m_Cfg.m_BuddyList.GetAt(i));
+	if (id != PJSUA_INVALID_ID) {
+	    pjsua_buddy_info bi;
+	    pjsua_buddy_get_info(id, &bi);
+	    isOnline = (bi.status == PJSUA_BUDDY_STATUS_ONLINE);
+	} else {
+	    isOnline = 0;
+	}
+
+	LVITEM lvi;
+	memset(&lvi, 0, sizeof(lvi));
+	lvi.mask = LVIF_TEXT  | LVIF_IMAGE;
+	lvi.iItem = i;
+	lvi.iImage = isOnline;
+	lvi.pszText = (LPTSTR)(LPCTSTR)m_Cfg.m_BuddyList.GetAt(i);
+
+	m_BuddyList.InsertItem(&lvi);
+    }
+}
+
+void CPocketPJDlg::OnUriCall() 
+{
+    char tmp[120];
+    CString uri;
+    pj_status_t status;
+
+    m_Url.GetWindowText(uri);
+    pj_unicode_to_ansi((LPCTSTR)uri, uri.GetLength(), tmp, sizeof(tmp));
+    if ((status=pjsua_verify_sip_url(tmp)) != PJ_SUCCESS) {
+	Error("The URL is not valid SIP URL", status);
+	return;
+    }
+
+    pj_str_t dest_uri = pj_str(tmp);
+    pjsua_call_id call_id;
+
+    status = pjsua_call_make_call(m_PjsuaAccId, &dest_uri, 0, NULL, NULL, &call_id);
+
+    if (status != PJ_SUCCESS)
+	Error("Unable to make call", status);
+}
+
+void CPocketPJDlg::OnUriAddBuddy() 
+{
+    int i;
+    char tmp[120];
+    CString uri;
+    pj_status_t status;
+
+    m_Url.GetWindowText(uri);
+    pj_unicode_to_ansi((LPCTSTR)uri, uri.GetLength(), tmp, sizeof(tmp));
+    if ((status=pjsua_verify_sip_url(tmp)) != PJ_SUCCESS) {
+	Error("The URL is not valid SIP URL", status);
+	return;
+    }
+
+    for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) {
+	if (m_Cfg.m_BuddyList.GetAt(0) == uri) {
+	    AfxMessageBox(_T("The URI is already in the buddy list"));
+	    return;
+	}
+    }
+
+    m_Cfg.m_BuddyList.Add(uri);
+    RedrawBuddyList();
+}
+
+void CPocketPJDlg::OnUriDelBuddy() 
+{
+    CString uri;
+
+    m_Url.GetWindowText(uri);
+    int i = FindBuddyInCfg(uri);
+    if (i<0) {
+	/* Buddy not found */
+	return;
+    }
+
+    m_Cfg.m_BuddyList.RemoveAt(i);
+    RedrawBuddyList();
+    AfxMessageBox(_T("Buddy " + uri + " deleted"));
+}
+
+void CPocketPJDlg::OnAccOnline() 
+{
+    pjsua_acc_set_online_status(m_PjsuaAccId, PJ_TRUE);
+    m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ONLINE)) );
+}
+
+void CPocketPJDlg::OnAccInvisible() 
+{
+    pjsua_acc_set_online_status(m_PjsuaAccId, PJ_FALSE);
+    m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_INVISIBLE)) );
+}
+
+void CPocketPJDlg::OnPopUpButton(int btnNo)
+{
+    if (btnNo == 1) {
+	pjsua_call_answer(0, 200, NULL, 0);
+	PopUp_Modify(POPUP_CALL, POPUP_EL_BUTTON1, "");
+    } else if (btnNo == 2) {
+	// Hangup button
+	PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE2, "Hang up..");
+	PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, "");
+	pjsua_call_hangup(0, PJSIP_SC_DECLINE, 0, 0);
+    }
+}
+
+void CPocketPJDlg::OnClickBuddyList(NMHDR* pNMHDR, LRESULT* pResult) 
+{
+    POSITION pos = m_BuddyList.GetFirstSelectedItemPosition();
+    if (pos != NULL) {
+	int iItem = m_BuddyList.GetNextSelectedItem(pos);
+	CString uri = m_BuddyList.GetItemText(iItem, 0);
+	m_Url.SetWindowText(uri);
+    }
+    *pResult = 0;
+}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJDlg.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PocketPJDlg.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PocketPJDlg.h
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PopUpWnd.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PopUpWnd.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1f1654f0621eca2dd67e4686be3002f1a647eff5
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PopUpWnd.cpp
@@ -0,0 +1,235 @@
+#include "stdafx.h"
+#include "PopUpWnd.h"
+#include "resource.h"
+#include "PocketPJDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+#define IDC_BTN1     10
+#define IDC_BTN2     11
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CPopUpWnd
+
+CPopUpWnd::CPopUpWnd(CPocketPJDlg* pParent)
+{
+    Create(pParent);
+}
+
+CPopUpWnd::~CPopUpWnd()
+{
+    DestroyWindow();
+}
+
+BOOL CPopUpWnd::Create(CPocketPJDlg* pParent)
+{
+    BOOL bSuccess;
+
+    m_ParentWnd = pParent;
+
+    // Register window class
+    CString csClassName = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW,
+                                              0,
+                                              CBrush(::GetSysColor(COLOR_BTNFACE)));
+
+    // Create popup window
+    bSuccess = CreateEx(WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style
+                        csClassName,                       // Classname
+                        _T("PocketPJ"),                    // Title
+                        WS_POPUP|WS_BORDER|WS_CAPTION,     // style
+                        0,0,                               // position - updated soon.
+                        1,1,				   // Size - updated soon
+                        pParent->GetSafeHwnd(),            // handle to parent
+                        0,                                 // No menu
+                        NULL);    
+    if (!bSuccess) 
+	return FALSE;
+
+    ShowWindow(SW_HIDE);
+
+    // Now create the controls
+    CRect TempRect(0,0,10,10);
+
+    /* |SS_LEFTNOWORDWRAP */
+    bSuccess = m_Title1.Create(_T("Title1"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX,
+			       TempRect, this, IDC_TITLE1);
+    if (!bSuccess)
+	return FALSE;
+
+    bSuccess = m_Title2.Create(_T("Title2"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX,
+			       TempRect, this, IDC_TITLE2);
+    if (!bSuccess)
+	return FALSE;
+
+    bSuccess = m_Title3.Create(_T("Title3"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX,
+			       TempRect, this, IDC_TITLE3);
+    if (!bSuccess)
+	return FALSE;
+
+    bSuccess = m_Btn1.Create(_T("Button1"), 
+                             WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, 
+                             TempRect, this, IDC_BTN1);
+    if (!bSuccess)
+	return FALSE;
+
+    bSuccess = m_Btn2.Create(_T("Button2"), 
+                             WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, 
+                             TempRect, this, IDC_BTN2);
+    if (!bSuccess)
+	return FALSE;
+
+    CFont *ft1 = new CFont, 
+	  *ft2 = new CFont, 
+	  *ft3 = new CFont;
+
+
+    LOGFONT lf;
+    memset(&lf, 0, sizeof(LOGFONT));
+    lf.lfHeight = 12;
+    lstrcpy(lf.lfFaceName, _T("Arial"));
+    VERIFY(ft1->CreateFontIndirect(&lf));
+    VERIFY(ft3->CreateFontIndirect(&lf));
+
+    lf.lfHeight = 20;
+    VERIFY(ft2->CreateFontIndirect(&lf));
+
+    m_Title1.SetFont(ft1, TRUE);
+    m_Title2.SetFont(ft2, TRUE);
+    m_Title3.SetFont(ft3, TRUE);
+
+
+    SetWindowSize();
+
+    // Center and show window
+    CenterWindow();
+
+    Show();
+
+    return TRUE;
+}
+
+void CPopUpWnd::SetContent(const CPopUpContent &content)
+{
+    m_Title1.SetWindowText(content.m_Title1);
+    m_Title2.SetWindowText(content.m_Title2);
+    m_Title3.SetWindowText(content.m_Title3);
+
+    if (content.m_Btn1 != "") {
+	m_Btn1.SetWindowText(content.m_Btn1);
+	m_Btn1.ShowWindow(SW_SHOW);
+    } else {
+	m_Btn1.ShowWindow(SW_HIDE);
+    }
+
+    if (content.m_Btn2 != "") {
+	m_Btn2.SetWindowText(content.m_Btn2);
+	m_Btn2.ShowWindow(SW_SHOW);
+    } else {
+	m_Btn2.ShowWindow(SW_HIDE);
+    }
+
+    UpdateWindow();
+    ShowWindow(SW_SHOW);
+}
+
+void CPopUpWnd::SetWindowSize(int width, int height)
+{
+    enum { H1 = 16, H2 = 40, H3 = 16, S = 5, G = 10, BW=60, BH=20, BG=40};
+
+    CRect rootRect(0, 0, 320, 240);
+    int Y;
+
+    MoveWindow((rootRect.Width() - width)/2, (rootRect.Height() - height)/2,
+	       width, height);
+
+    m_Title1.MoveWindow(10, Y=S, width-20, H1);
+    m_Title2.MoveWindow(10, Y+=H1+G, width-20, H2);
+    m_Title3.MoveWindow(10, Y+=H2+G, width-20, H3);
+
+    m_Btn1.MoveWindow((width-2*BW-BG)/2, Y+=H3+G, BW, BH);
+    m_Btn2.MoveWindow((width-2*BW-BG)/2+BW+BG, Y, BW, BH);
+}
+
+void CPopUpWnd::Hide()  
+{ 
+    if (!::IsWindow(GetSafeHwnd())) 
+        return;
+
+    if (IsWindowVisible())
+    {
+        ShowWindow(SW_HIDE);
+        ModifyStyle(WS_VISIBLE, 0);
+    }
+}
+
+void CPopUpWnd::Show()  
+{ 
+    if (!::IsWindow(GetSafeHwnd()))
+        return;
+
+    ModifyStyle(0, WS_VISIBLE);
+    ShowWindow(SW_SHOWNA);
+    RedrawWindow(NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW);
+}
+
+BEGIN_MESSAGE_MAP(CPopUpWnd, CWnd)
+    //{{AFX_MSG_MAP(CPopUpWnd)
+    ON_WM_ERASEBKGND()
+	//}}AFX_MSG_MAP
+    ON_BN_CLICKED(IDC_BTN1, OnCancel1)
+    ON_BN_CLICKED(IDC_BTN2, OnCancel2)
+END_MESSAGE_MAP()
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CPopUpWnd message handlers
+
+BOOL CPopUpWnd::OnEraseBkgnd(CDC* pDC) 
+{
+    CBrush backBrush;
+    backBrush.CreateSolidBrush(RGB(255,255,255));
+    CBrush* pOldBrush = pDC->SelectObject(&backBrush);
+
+    CRect rect;
+    pDC->GetClipBox(&rect);     // Erase the area needed
+    pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
+    pDC->SelectObject(pOldBrush);
+
+    return TRUE;
+}
+
+void CPopUpWnd::OnCancel1() 
+{
+    m_ParentWnd->OnPopUpButton(1);
+}
+
+
+void CPopUpWnd::OnCancel2() 
+{
+    m_ParentWnd->OnPopUpButton(2);
+}
+
+
+BOOL CPopUpWnd::DestroyWindow() 
+{
+    return CWnd::DestroyWindow();
+}
+
+void CPopUpWnd::PeekAndPump()
+{
+    MSG msg;
+    while (::PeekMessage(&msg, NULL,0,0,PM_NOREMOVE)) 
+    {
+        if (!AfxGetApp()->PumpMessage()) 
+        {
+            ::PostQuitMessage(0);
+            return;
+        } 
+    }
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PopUpWnd.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/PopUpWnd.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/PopUpWnd.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/ReadMe.txt b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/ReadMe.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/ReadMe.txt
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/ReadMe.txt
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/SettingsDlg.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/SettingsDlg.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1357044ae2c4675b973a6de003ba6a4a8476b784
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/SettingsDlg.cpp
@@ -0,0 +1,376 @@
+// SettingsDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "PocketPJ.h"
+#include "SettingsDlg.h"
+#include <pjsua-lib/pjsua.h>
+#include <atlbase.h>
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+#define REG_PATH	_T("pjsip.org\\PocketPC")
+#define REG_DOMAIN	_T("Domain")
+#define REG_USER	_T("User")
+#define REG_PASSWD	_T("Data")
+#define REG_USE_STUN	_T("UseSTUN")
+#define REG_STUN_SRV	_T("STUNSrv")
+#define REG_DNS		_T("DNS")
+#define REG_USE_ICE	_T("UseICE")
+#define REG_USE_SRTP	_T("UseSRTP")
+#define REG_USE_PUBLISH	_T("UsePUBLISH")
+#define REG_BUDDY_CNT	_T("BuddyCnt")
+#define REG_BUDDY_X	_T("Buddy%u")
+#define REG_ENABLE_EC	_T("EnableEC")
+#define REG_EC_TAIL	_T("ECTail")
+#define REG_ENABLE_VAD	_T("EnableVAD")
+#define REG_ENABLE_TCP	_T("EnableTCP")
+#define REG_CODEC_CNT	_T("CodecCnt")
+#define REG_CODEC_X	_T("Codec%u")
+#define REG_AUTO_ANSWER	_T("AutoAnswer")
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Settings
+CPocketPJSettings::CPocketPJSettings()
+: m_UseStun(FALSE), m_UseIce(FALSE), m_UseSrtp(FALSE), m_UsePublish(FALSE),
+  m_EchoSuppress(TRUE), m_EcTail(200), m_TCP(FALSE), m_VAD(FALSE),
+  m_AutoAnswer(FALSE)
+{
+    /* Init codec list */
+#if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC
+    m_Codecs.Add(_T("GSM"));
+#endif
+#if defined(PJMEDIA_HAS_G711_CODEC) && PJMEDIA_HAS_G711_CODEC
+    m_Codecs.Add(_T("PCMU"));
+    m_Codecs.Add(_T("PCMA"));
+#endif
+#if defined(PJMEDIA_HAS_SPEEX_CODEC) && PJMEDIA_HAS_SPEEX_CODEC
+    m_Codecs.Add(_T("Speex"));
+#endif
+}
+
+// Load from registry
+void CPocketPJSettings::LoadRegistry()
+{
+    CRegKey key;
+    wchar_t textVal[256];
+    DWORD dwordVal;
+    DWORD cbData;
+
+
+    if (key.Open(HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS)
+	return;
+
+    cbData = sizeof(textVal);
+    if (key.QueryValue(textVal, REG_DOMAIN, &cbData) == ERROR_SUCCESS) {
+	m_Domain = textVal;
+    }
+
+    cbData = sizeof(textVal);
+    if (key.QueryValue(textVal, REG_USER, &cbData) == ERROR_SUCCESS) {
+	m_User = textVal;
+    }
+
+    cbData = sizeof(textVal);
+    if (key.QueryValue(textVal, REG_PASSWD, &cbData) == ERROR_SUCCESS) {
+	m_Password = textVal;
+    }
+
+    cbData = sizeof(textVal);
+    if (key.QueryValue(textVal, REG_STUN_SRV, &cbData) == ERROR_SUCCESS) {
+	m_StunSrv = textVal;
+    }
+
+    cbData = sizeof(textVal);
+    if (key.QueryValue(textVal, REG_DNS, &cbData) == ERROR_SUCCESS) {
+	m_DNS = textVal;
+    }
+
+    dwordVal = 0;
+    if (key.QueryValue(dwordVal, REG_USE_STUN) == ERROR_SUCCESS) {
+	m_UseStun = dwordVal != 0;
+    }
+
+    if (key.QueryValue(dwordVal, REG_USE_ICE) == ERROR_SUCCESS) {
+	m_UseIce = dwordVal != 0;
+    }
+
+
+    if (key.QueryValue(dwordVal, REG_USE_SRTP) == ERROR_SUCCESS) {
+	m_UseSrtp = dwordVal != 0;
+    }
+
+
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(dwordVal, REG_USE_PUBLISH) == ERROR_SUCCESS) {
+	m_UsePublish = dwordVal != 0;
+    }
+
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(dwordVal, REG_ENABLE_EC) == ERROR_SUCCESS) {
+	m_EchoSuppress = dwordVal != 0;
+    }
+
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(dwordVal, REG_EC_TAIL) == ERROR_SUCCESS) {
+	m_EcTail = dwordVal;
+    }
+
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(dwordVal, REG_ENABLE_TCP) == ERROR_SUCCESS) {
+	m_TCP = dwordVal != 0;
+    }
+
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(dwordVal, REG_ENABLE_VAD) == ERROR_SUCCESS) {
+	m_VAD = dwordVal != 0;
+    }
+
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(dwordVal, REG_AUTO_ANSWER) == ERROR_SUCCESS) {
+	m_AutoAnswer = dwordVal != 0;
+    }
+
+    m_BuddyList.RemoveAll();
+
+    DWORD buddyCount = 0;
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(dwordVal, REG_BUDDY_CNT) == ERROR_SUCCESS) {
+	buddyCount = dwordVal;
+    }
+
+    unsigned i;
+    for (i=0; i<buddyCount; ++i) {
+	CString entry;
+	entry.Format(REG_BUDDY_X, i);
+
+	cbData = sizeof(textVal);
+	if (key.QueryValue(textVal, entry, &cbData) == ERROR_SUCCESS) {
+	    m_BuddyList.Add(textVal);
+	}
+    }
+
+    DWORD codecCount = 0;
+    cbData = sizeof(dwordVal);
+    if (key.QueryValue(codecCount, REG_CODEC_CNT) == ERROR_SUCCESS) {
+
+	m_Codecs.RemoveAll();
+
+	for (i=0; i<codecCount; ++i) {
+	    CString entry;
+	    entry.Format(REG_CODEC_X, i);
+
+	    cbData = sizeof(textVal);
+	    if (key.QueryValue(textVal, entry, &cbData) == ERROR_SUCCESS) {
+		m_Codecs.Add(textVal);
+	    }
+	}
+    }
+
+    key.Close();
+}
+
+// Save to registry
+void CPocketPJSettings::SaveRegistry()
+{
+    CRegKey key;
+
+    if (key.Create(HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS)
+	return;
+
+    key.SetValue(m_Domain, REG_DOMAIN);
+    key.SetValue(m_User, REG_USER);
+    key.SetValue(m_Password, REG_PASSWD);
+    key.SetValue(m_StunSrv, REG_STUN_SRV);
+    key.SetValue(m_DNS, REG_DNS);
+    
+    key.SetValue(m_UseStun, REG_USE_STUN);
+    key.SetValue(m_UseIce, REG_USE_ICE);
+    key.SetValue(m_UseSrtp, REG_USE_SRTP);
+    key.SetValue(m_UsePublish, REG_USE_PUBLISH);
+
+    key.SetValue(m_EchoSuppress, REG_ENABLE_EC);
+    key.SetValue(m_EcTail, REG_EC_TAIL);
+
+    key.SetValue(m_TCP, REG_ENABLE_TCP);
+    key.SetValue(m_VAD, REG_ENABLE_VAD);
+    key.SetValue(m_AutoAnswer, REG_AUTO_ANSWER);
+
+    key.SetValue(m_BuddyList.GetSize(), REG_BUDDY_CNT);
+
+    int i;
+    for (i=0; i<m_BuddyList.GetSize(); ++i) {
+	CString entry;
+	entry.Format(REG_BUDDY_X, i);
+	key.SetValue(m_BuddyList.GetAt(i), entry);
+    }
+
+    DWORD N = m_Codecs.GetSize();
+    key.SetValue(N, REG_CODEC_CNT);
+    for (i=0; i<m_Codecs.GetSize(); ++i) {
+	CString entry;
+	entry.Format(REG_CODEC_X, i);
+	key.SetValue(m_Codecs.GetAt(i), entry);
+    }
+
+    key.Close();
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CSettingsDlg dialog
+
+
+CSettingsDlg::CSettingsDlg(CPocketPJSettings &cfg, CWnd* pParent)
+	: CDialog(CSettingsDlg::IDD, pParent), m_Cfg(cfg)
+{
+	//{{AFX_DATA_INIT(CSettingsDlg)
+	m_Domain = _T("");
+	m_ICE = FALSE;
+	m_Passwd = _T("");
+	m_PUBLISH = FALSE;
+	m_SRTP = FALSE;
+	m_STUN = FALSE;
+	m_StunSrv = _T("");
+	m_User = _T("");
+	m_Dns = _T("");
+	m_EchoSuppress = FALSE;
+	m_EcTail = _T("");
+	m_TCP = FALSE;
+	m_VAD = FALSE;
+	m_AutoAnswer = FALSE;
+	//}}AFX_DATA_INIT
+
+	m_Domain    = m_Cfg.m_Domain;
+	m_ICE	    = m_Cfg.m_UseIce;
+	m_Passwd    = m_Cfg.m_Password;
+	m_PUBLISH   = m_Cfg.m_UsePublish;
+	m_SRTP	    = m_Cfg.m_UseSrtp;
+	m_STUN	    = m_Cfg.m_UseStun;
+	m_StunSrv   = m_Cfg.m_StunSrv;
+	m_User	    = m_Cfg.m_User;
+	m_Dns	    = m_Cfg.m_DNS;
+	m_EchoSuppress = m_Cfg.m_EchoSuppress;
+	m_TCP	    = m_Cfg.m_TCP;
+	m_VAD	    = m_Cfg.m_VAD;
+	m_AutoAnswer= m_Cfg.m_AutoAnswer;
+
+	CString s;
+	s.Format(_T("%d"), m_Cfg.m_EcTail);
+	m_EcTail    = s;
+
+}
+
+
+void CSettingsDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CSettingsDlg)
+	DDX_Control(pDX, IDC_CODECS, m_Codecs);
+	DDX_Text(pDX, IDC_DOMAIN, m_Domain);
+	DDX_Check(pDX, IDC_ICE, m_ICE);
+	DDX_Text(pDX, IDC_PASSWD, m_Passwd);
+	DDX_Check(pDX, IDC_PUBLISH, m_PUBLISH);
+	DDX_Check(pDX, IDC_SRTP, m_SRTP);
+	DDX_Check(pDX, IDC_STUN, m_STUN);
+	DDX_Text(pDX, IDC_STUN_SRV, m_StunSrv);
+	DDX_Text(pDX, IDC_USER, m_User);
+	DDX_Text(pDX, IDC_DNS, m_Dns);
+	DDX_Check(pDX, IDC_ECHO_SUPPRESS, m_EchoSuppress);
+	DDX_Text(pDX, IDC_EC_TAIL, m_EcTail);
+	DDX_Check(pDX, IDC_TCP, m_TCP);
+	DDX_Check(pDX, IDC_VAD, m_VAD);
+	DDX_Check(pDX, IDC_AA, m_AutoAnswer);
+	//}}AFX_DATA_MAP
+
+	
+	if (m_Codecs.GetCount() == 0) {
+	    int i;
+	    for (i=0; i<m_Cfg.m_Codecs.GetSize(); ++i) {
+		m_Codecs.AddString(m_Cfg.m_Codecs.GetAt(i));
+	    }
+	    m_Codecs.SetCurSel(0);
+	}
+}
+
+
+BEGIN_MESSAGE_MAP(CSettingsDlg, CDialog)
+	//{{AFX_MSG_MAP(CSettingsDlg)
+	ON_BN_CLICKED(IDC_STUN, OnStun)
+	ON_BN_CLICKED(IDC_ECHO_SUPPRESS, OnEchoSuppress)
+	ON_CBN_SELCHANGE(IDC_CODECS, OnSelchangeCodecs)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CSettingsDlg message handlers
+
+int CSettingsDlg::DoModal() 
+{
+    int rc = CDialog::DoModal();	
+
+    return rc;
+}
+
+void CSettingsDlg::OnStun() 
+{
+}
+
+void CSettingsDlg::OnEchoSuppress() 
+{
+}
+
+void CSettingsDlg::OnSelchangeCodecs() 
+{
+    int cur = m_Codecs.GetCurSel();
+    if (cur < 1)
+	return;
+
+    CString codec;
+    DWORD N;
+
+    m_Codecs.GetLBText(cur, codec);
+    N = m_Codecs.GetCount();
+    m_Codecs.DeleteString(cur);
+    N = m_Codecs.GetCount();
+    m_Codecs.InsertString(0, codec);
+    N = m_Codecs.GetCount();
+    m_Codecs.SetCurSel(0);
+}
+
+
+void CSettingsDlg::OnOK() 
+{
+    UpdateData(TRUE);
+
+    m_Cfg.m_Domain	= m_Domain;
+    m_Cfg.m_UseIce	= m_ICE != 0;
+    m_Cfg.m_Password	= m_Passwd;
+    m_Cfg.m_UsePublish	= m_PUBLISH != 0;
+    m_Cfg.m_UseSrtp	= m_SRTP != 0;
+    m_Cfg.m_UseStun	= m_STUN != 0;
+    m_Cfg.m_StunSrv	= m_StunSrv;
+    m_Cfg.m_User	= m_User;
+    m_Cfg.m_DNS		= m_Dns;
+    m_Cfg.m_EchoSuppress= m_EchoSuppress != 0;
+    m_Cfg.m_EcTail	= _ttoi(m_EcTail);
+    m_Cfg.m_TCP		= m_TCP != 0;
+    m_Cfg.m_VAD		= m_VAD != 0;
+    m_Cfg.m_AutoAnswer	= m_AutoAnswer != 0;
+
+    unsigned i;
+    m_Cfg.m_Codecs.RemoveAll();
+    DWORD N = m_Codecs.GetCount();
+    for (i=0; i<N; ++i) {
+	CString codec;
+	m_Codecs.GetLBText(i, codec);
+	m_Cfg.m_Codecs.Add(codec);
+    }
+
+    CDialog::OnOK();
+}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/SettingsDlg.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/SettingsDlg.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/SettingsDlg.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/StdAfx.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/StdAfx.cpp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/StdAfx.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/StdAfx.cpp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/StdAfx.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/StdAfx.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/StdAfx.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/StdAfx.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/newres.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/newres.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/newres.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/newres.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/PocketPJ.ico b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/PocketPJ.ico
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/PocketPJ.ico
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/PocketPJ.ico
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/PocketPJ.rc2 b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/PocketPJ.rc2
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/PocketPJ.rc2
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/PocketPJ.rc2
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/action.bmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/action.bmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/action.bmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/action.bmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/blank.bmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/blank.bmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/blank.bmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/blank.bmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/invisibl.bmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/invisibl.bmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/invisibl.bmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/invisibl.bmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/invisibl.ico b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/invisibl.ico
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/invisibl.ico
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/invisibl.ico
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/offline.bmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/offline.bmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/offline.bmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/offline.bmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/offline.ico b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/offline.ico
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/offline.ico
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/offline.ico
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/online.bmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/online.bmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/online.bmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/online.bmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/online.ico b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/online.ico
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/res/online.ico
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/res/online.ico
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/resource.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/resource.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/pocketpj/resource.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/pocketpj/resource.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/DEPRECATED.txt b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/DEPRECATED.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/DEPRECATED.txt
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/DEPRECATED.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/Makefile b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/helper.mak b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/helper.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/helper.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/helper.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/pjsua.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/pjsua.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/pjsua.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/pjsua.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/pjsua_app.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/pjsua_app.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/pjsua_app.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/pjsua_app.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/py_pjsua.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/py_pjsua.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.def b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/py_pjsua.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.def
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/py_pjsua.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/py_pjsua.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/py_pjsua.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/py_pjsua.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/setup.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/setup.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/py_pjsua/setup.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/py_pjsua/setup.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/Makefile b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/_pjsua.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/_pjsua.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.def b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/_pjsua.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.def
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/_pjsua.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/_pjsua.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/_pjsua.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/_pjsua.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/helper.mak b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/helper.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/helper.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/helper.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/pjsua.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/pjsua.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/pjsua.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/pjsua.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/call.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/samples/call.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/call.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/samples/call.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/presence.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/samples/presence.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/presence.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/samples/presence.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/registration.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/samples/registration.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/registration.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/samples/registration.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/simplecall.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/samples/simplecall.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/samples/simplecall.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/samples/simplecall.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/setup-vc.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/setup-vc.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/setup-vc.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/setup-vc.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/setup.py b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/setup.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/python/setup.py
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/python/setup.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/aectest.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/aectest.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/aectest.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/aectest.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/confbench.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/confbench.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/confbench.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/confbench.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/confsample.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/confsample.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/confsample.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/confsample.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/debug.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/debug.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/debug.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/debug.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/encdec.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/encdec.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/encdec.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/encdec.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/footprint.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/footprint.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/footprint.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/footprint.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/invtester.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/invtester.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/invtester.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/invtester.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/latency.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/latency.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/latency.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/latency.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/level.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/level.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/level.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/level.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/main_rtems.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/main_rtems.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/main_rtems.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/main_rtems.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/mix.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/mix.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/mix.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/mix.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/pcaputil.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/pcaputil.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/pcaputil.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/pcaputil.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/pjsip-perf.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/pjsip-perf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/pjsip-perf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/pjsip-perf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playfile.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/playfile.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playfile.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/playfile.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playsine.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/playsine.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/playsine.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/playsine.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/proxy.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/proxy.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/proxy.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/proxy.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/recfile.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/recfile.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/recfile.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/recfile.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/resampleplay.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/resampleplay.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/resampleplay.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/resampleplay.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/simple_pjsua.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/simple_pjsua.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/simple_pjsua.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/simple_pjsua.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/simpleua.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/simpleua.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/simpleua.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/simpleua.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/siprtp.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/siprtp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/siprtp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/siprtp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/siprtp_report.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/siprtp_report.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/siprtp_report.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/siprtp_report.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sipstateless.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/sipstateless.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sipstateless.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/sipstateless.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sndinfo.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/sndinfo.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sndinfo.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/sndinfo.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sndtest.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/sndtest.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/sndtest.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/sndtest.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateful_proxy.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/stateful_proxy.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateful_proxy.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/stateful_proxy.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateless_proxy.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/stateless_proxy.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stateless_proxy.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/stateless_proxy.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stereotest.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/stereotest.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/stereotest.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/stereotest.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/streamutil.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/streamutil.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/streamutil.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/streamutil.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/strerror.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/strerror.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/strerror.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/strerror.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/tonegen.c b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/tonegen.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/tonegen.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/tonegen.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/util.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/util.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/samples/util.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/samples/util.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/main_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/main_symbian.cpp
similarity index 80%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/main_symbian.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/main_symbian.cpp
index d7f3f0ec634d5b4165e155238d0d14921fe51101..8a7f6029c840d25741ee501fb1c455e7514988ab 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/main_symbian.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/main_symbian.cpp
@@ -1,5 +1,5 @@
 /* $Id: main_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 #include "ua.h"
 
@@ -29,7 +29,7 @@
 CConsoleBase* console;
 
 // Needed by APS
-TPtrC APP_UID = _L ("A000000D");
+TPtrC APP_UID = _L("A000000D");
 
 
 ////////////////////////////////////////////////////////////////////////////
@@ -37,13 +37,13 @@ TPtrC APP_UID = _L ("A000000D");
 LOCAL_C void DoStartL()
 {
     CActiveScheduler *scheduler = new (ELeave) CActiveScheduler;
-    CleanupStack::PushL (scheduler);
-    CActiveScheduler::Install (scheduler);
+    CleanupStack::PushL(scheduler);
+    CActiveScheduler::Install(scheduler);
 
     ua_main();
-
-    CActiveScheduler::Install (NULL);
-    CleanupStack::Pop (scheduler);
+    
+    CActiveScheduler::Install(NULL);
+    CleanupStack::Pop(scheduler);
     delete scheduler;
 }
 
@@ -60,26 +60,22 @@ GLDEF_C TInt E32Main()
     CTrapCleanup* cleanup = CTrapCleanup::New();
 
     // Create output console
-    TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen)));
-
+    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"));
+    TRAPD(startError, DoStartL());
 
+    console->Printf(_L("[press any key to close]\n"));
     console->Getch();
-
+    
     delete console;
-
     delete cleanup;
 
-    CloseSTDLIB();
+    CloseSTDLIB(); 
 
     // Mark end of heap usage, detect memory leaks
     __UHEAP_MARKEND;
-
     return KErrNone;
 }
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/symbian_ua_reg.rss b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/symbian_ua_reg.rss
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/symbian_ua_reg.rss
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/symbian_ua_reg.rss
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/ua.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/ua.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5014d6dc3c4586f6cb3fd7d86a64457c48fb889c
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/ua.cpp
@@ -0,0 +1,932 @@
+/* $Id: ua.cpp 2804 2009-06-25 12:26:15Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pjsua-lib/pjsua.h>
+#include <pjsua-lib/pjsua_internal.h>
+#include "ua.h"
+
+#define THIS_FILE	"symbian_ua.cpp"
+#define LOG_LEVEL	3
+
+//
+// Basic config.
+//
+#define SIP_PORT	5060
+
+
+//
+// Destination URI (to make call, or to subscribe presence)
+//
+#define SIP_DST_URI	"sip:100@pjsip.lab"
+
+//
+// Account
+//
+#define HAS_SIP_ACCOUNT	0	// 1 to enable registration
+#define SIP_DOMAIN	"pjsip.lab"
+#define SIP_USER	"400"
+#define SIP_PASSWD	"400"
+
+//
+// Outbound proxy for all accounts
+//
+#define SIP_PROXY	NULL
+//#define SIP_PROXY	"<sip:192.168.0.8;lr>"
+
+//
+// Set to 1 if TCP is desired (experimental)
+//
+#define ENABLE_SIP_TCP	0
+
+//
+// Configure nameserver if DNS SRV is to be used with both SIP
+// or STUN (for STUN see other settings below)
+//
+#define NAMESERVER	NULL
+//#define NAMESERVER	"192.168.0.2"
+
+//
+// STUN server
+#if 0
+	// Use this to have the STUN server resolved normally
+#   define STUN_DOMAIN	NULL
+#   define STUN_SERVER	"stun.pjsip.org"
+#elif 0
+	// Use this to have the STUN server resolved with DNS SRV
+#   define STUN_DOMAIN	"pjsip.org"
+#   define STUN_SERVER	NULL
+#else
+	// Use this to disable STUN
+#   define STUN_DOMAIN	NULL
+#   define STUN_SERVER	NULL
+#endif
+
+//
+// Use ICE?
+//
+#define USE_ICE		1
+
+//
+// Use SRTP?
+//
+#define USE_SRTP 	PJSUA_DEFAULT_USE_SRTP
+
+//
+// Globals
+//
+static pjsua_acc_id g_acc_id = PJSUA_INVALID_ID;
+static pjsua_call_id g_call_id = PJSUA_INVALID_ID;
+static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID;
+
+
+/* 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);
+
+    if (g_call_id != PJSUA_INVALID_ID) {
+    	pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, NULL, NULL);
+    	return;
+    }
+    
+    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));
+
+    g_call_id = call_id;
+    
+    /* Automatically answer incoming calls with 180/Ringing */
+    pjsua_call_answer(call_id, 180, 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);
+    
+    if (ci.state == PJSIP_INV_STATE_DISCONNECTED) {
+    	if (call_id == g_call_id)
+    	    g_call_id = PJSUA_INVALID_ID;
+    } else if (ci.state != PJSIP_INV_STATE_INCOMING) {
+    	if (g_call_id == PJSUA_INVALID_ID)
+    	    g_call_id = call_id;
+    }
+    
+    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);
+    }
+}
+
+
+/* Handler on buddy state changed. */
+static void on_buddy_state(pjsua_buddy_id buddy_id)
+{
+    pjsua_buddy_info info;
+    pjsua_buddy_get_info(buddy_id, &info);
+
+    PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s",
+	      (int)info.uri.slen,
+	      info.uri.ptr,
+	      (int)info.status_text.slen,
+	      info.status_text.ptr));
+}
+
+
+/* Incoming IM message (i.e. MESSAGE request)!  */
+static void on_pager(pjsua_call_id call_id, const pj_str_t *from, 
+		     const pj_str_t *to, const pj_str_t *contact,
+		     const pj_str_t *mime_type, const pj_str_t *text)
+{
+    /* Note: call index may be -1 */
+    PJ_UNUSED_ARG(call_id);
+    PJ_UNUSED_ARG(to);
+    PJ_UNUSED_ARG(contact);
+    PJ_UNUSED_ARG(mime_type);
+
+    PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s",
+	      (int)from->slen, from->ptr,
+	      (int)text->slen, text->ptr));
+}
+
+
+/* Received typing indication  */
+static void on_typing(pjsua_call_id call_id, const pj_str_t *from,
+		      const pj_str_t *to, const pj_str_t *contact,
+		      pj_bool_t is_typing)
+{
+    PJ_UNUSED_ARG(call_id);
+    PJ_UNUSED_ARG(to);
+    PJ_UNUSED_ARG(contact);
+
+    PJ_LOG(3,(THIS_FILE, "IM indication: %.*s %s",
+	      (int)from->slen, from->ptr,
+	      (is_typing?"is typing..":"has stopped typing")));
+}
+
+
+/* Call transfer request status. */
+static void on_call_transfer_status(pjsua_call_id call_id,
+				    int status_code,
+				    const pj_str_t *status_text,
+				    pj_bool_t final,
+				    pj_bool_t *p_cont)
+{
+    PJ_LOG(3,(THIS_FILE, "Call %d: transfer status=%d (%.*s) %s",
+	      call_id, status_code,
+	      (int)status_text->slen, status_text->ptr,
+	      (final ? "[final]" : "")));
+
+    if (status_code/100 == 2) {
+	PJ_LOG(3,(THIS_FILE, 
+	          "Call %d: call transfered successfully, disconnecting call",
+		  call_id));
+	pjsua_call_hangup(call_id, PJSIP_SC_GONE, NULL, NULL);
+	*p_cont = PJ_FALSE;
+    }
+}
+
+
+/* NAT detection result */
+static void on_nat_detect(const pj_stun_nat_detect_result *res) 
+{
+    if (res->status != PJ_SUCCESS) {
+	pjsua_perror(THIS_FILE, "NAT detection failed", res->status);
+    } else {
+	PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name));
+    }    
+}
+
+/* Notification that call is being replaced. */
+static void on_call_replaced(pjsua_call_id old_call_id,
+			     pjsua_call_id new_call_id)
+{
+    pjsua_call_info old_ci, new_ci;
+
+    pjsua_call_get_info(old_call_id, &old_ci);
+    pjsua_call_get_info(new_call_id, &new_ci);
+
+    PJ_LOG(3,(THIS_FILE, "Call %d with %.*s is being replaced by "
+			 "call %d with %.*s",
+			 old_call_id, 
+			 (int)old_ci.remote_info.slen, old_ci.remote_info.ptr,
+			 new_call_id,
+			 (int)new_ci.remote_info.slen, new_ci.remote_info.ptr));
+}
+
+
+//#include<e32debug.h>
+
+/* Logging callback */
+static void log_writer(int level, const char *buf, int len)
+{
+    static 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);
+    //RDebug::Print(aBuf);
+    console->Write(aBuf);
+    
+}
+
+/*
+ * app_startup()
+ *
+ * url may contain URL to call.
+ */
+static pj_status_t app_startup()
+{
+    pj_status_t status;
+
+    /* Redirect log before pjsua_init() */
+    pj_log_set_log_func(&log_writer);
+    
+    /* Set log level */
+    pj_log_set_level(LOG_LEVEL);
+
+    /* Create pjsua first! */
+    status = pjsua_create();
+    if (status != PJ_SUCCESS) {
+    	pjsua_perror(THIS_FILE, "pjsua_create() error", status);
+    	return status;
+    }
+
+    /* Init pjsua */
+    pjsua_config cfg;
+    pjsua_logging_config log_cfg;
+    pjsua_media_config med_cfg;
+
+    pjsua_config_default(&cfg);
+    cfg.max_calls = 2;
+    cfg.thread_cnt = 0; // Disable threading on Symbian
+    cfg.use_srtp = USE_SRTP;
+    cfg.srtp_secure_signaling = 0;
+    
+    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;
+    cfg.cb.on_buddy_state = &on_buddy_state;
+    cfg.cb.on_pager = &on_pager;
+    cfg.cb.on_typing = &on_typing;
+    cfg.cb.on_call_transfer_status = &on_call_transfer_status;
+    cfg.cb.on_call_replaced = &on_call_replaced;
+    cfg.cb.on_nat_detect = &on_nat_detect;
+    
+    if (SIP_PROXY) {
+	    cfg.outbound_proxy_cnt = 1;
+	    cfg.outbound_proxy[0] = pj_str(SIP_PROXY);
+    }
+    
+    if (NAMESERVER) {
+	    cfg.nameserver_count = 1;
+	    cfg.nameserver[0] = pj_str(NAMESERVER);
+    }
+    
+    if (NAMESERVER && STUN_DOMAIN) {
+	    cfg.stun_domain = pj_str(STUN_DOMAIN);
+    } else if (STUN_SERVER) {
+	    cfg.stun_host = pj_str(STUN_SERVER);
+    }
+    
+    
+    pjsua_logging_config_default(&log_cfg);
+    log_cfg.level = LOG_LEVEL;
+    log_cfg.console_level = LOG_LEVEL;
+    log_cfg.cb = &log_writer;
+    //log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log");
+
+    pjsua_media_config_default(&med_cfg);
+    med_cfg.thread_cnt = 0; // Disable threading on Symbian
+    med_cfg.has_ioqueue = PJ_FALSE;
+    med_cfg.clock_rate = 8000;
+#if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1)
+    med_cfg.audio_frame_ptime = 20;
+#else
+    med_cfg.audio_frame_ptime = 40;
+#endif
+    med_cfg.ec_tail_len = 0;
+    med_cfg.enable_ice = USE_ICE;
+    med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed
+    
+    status = pjsua_init(&cfg, &log_cfg, &med_cfg);
+    if (status != PJ_SUCCESS) {
+	    pjsua_perror(THIS_FILE, "pjsua_init() error", status);
+	    pjsua_destroy();
+	    return status;
+    }
+    
+    /* Adjust Speex priority and enable only the narrowband */
+    {
+        pj_str_t codec_id = pj_str("speex/8000");
+        pjmedia_codec_mgr_set_codec_priority( 
+        	pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt),
+        	&codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1);
+
+        codec_id = pj_str("speex/16000");
+        pjmedia_codec_mgr_set_codec_priority( 
+        	pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt),
+        	&codec_id, PJMEDIA_CODEC_PRIO_DISABLED);
+
+        codec_id = pj_str("speex/32000");
+        pjmedia_codec_mgr_set_codec_priority( 
+        	pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt),
+        	&codec_id, PJMEDIA_CODEC_PRIO_DISABLED);
+    }
+    
+    /* Add UDP transport. */
+    pjsua_transport_config tcfg;
+    pjsua_transport_id tid;
+
+    pjsua_transport_config_default(&tcfg);
+    tcfg.port = SIP_PORT;
+    status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid);
+    if (status != PJ_SUCCESS) {
+	    pjsua_perror(THIS_FILE, "Error creating UDP transport", status);
+	    pjsua_destroy();
+	    return status;
+    }
+
+    /* Add TCP transport */
+#if ENABLE_SIP_TCP
+    pjsua_transport_config_default(&tcfg);
+    tcfg.port = SIP_PORT;
+    status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, &tcfg, &tid);
+    if (status != PJ_SUCCESS) {
+	    pjsua_perror(THIS_FILE, "Error creating TCP transport", status);
+	    pjsua_destroy();
+	    return status;
+    }
+#endif
+    
+    /* Add account for the transport */
+    pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id);
+
+
+    /* 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. */
+    if (HAS_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("*");
+	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, &g_acc_id);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "Error adding account", status);
+		pjsua_destroy();
+		return status;
+	}
+    }
+
+    if (SIP_DST_URI) {
+    	pjsua_buddy_config bcfg;
+    
+    	pjsua_buddy_config_default(&bcfg);
+    	bcfg.uri = pj_str(SIP_DST_URI);
+    	bcfg.subscribe = PJ_FALSE;
+    	
+    	pjsua_buddy_add(&bcfg, &g_buddy_id);
+    }
+    return PJ_SUCCESS;
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+/*
+ * The interractive console UI
+ */
+#include <e32base.h>
+
+class ConsoleUI : public CActive 
+{
+public:
+    ConsoleUI(CConsoleBase *con);
+    ~ConsoleUI();
+
+    // Run console UI
+    void Run();
+
+    // Stop
+    void Stop();
+    
+protected:
+    // Cancel asynchronous read.
+    void DoCancel();
+
+    // Implementation: called when read has completed.
+    void RunL();
+    
+private:
+    CConsoleBase *con_;
+};
+
+
+ConsoleUI::ConsoleUI(CConsoleBase *con) 
+: CActive(EPriorityStandard), con_(con)
+{
+    CActiveScheduler::Add(this);
+}
+
+ConsoleUI::~ConsoleUI() 
+{
+    Stop();
+}
+
+// Run console UI
+void ConsoleUI::Run() 
+{
+    con_->Read(iStatus);
+    SetActive();
+}
+
+// Stop console UI
+void ConsoleUI::Stop() 
+{
+    Cancel();
+}
+
+// Cancel asynchronous read.
+void ConsoleUI::DoCancel() 
+{
+    con_->ReadCancel();
+}
+
+static void PrintMenu() 
+{
+    PJ_LOG(3, (THIS_FILE, "\n\n"
+	    "Menu:\n"
+	    "  d    Dump states\n"
+	    "  D    Dump states detail\n"
+	    "  P    Dump pool factory\n"
+   	    "  l    Start loopback audio device\n"
+   	    "  L    Stop loopback audio device\n"
+	    "  m    Call " SIP_DST_URI "\n"
+	    "  a    Answer call\n"
+	    "  g    Hangup all calls\n"
+	    "  s    Subscribe " SIP_DST_URI "\n"
+	    "  S    Unsubscribe presence\n"
+	    "  o    Set account online\n"
+	    "  O    Set account offline\n"
+	    "  w    Quit\n"));
+}
+
+// Implementation: called when read has completed.
+void ConsoleUI::RunL() 
+{
+    TKeyCode kc = con_->KeyCode();
+    pj_bool_t reschedule = PJ_TRUE;
+    
+    switch (kc) {
+    case 'w':
+	    CActiveScheduler::Stop();
+	    reschedule = PJ_FALSE;
+	    break;
+    case 'D':
+    case 'd':
+	    pjsua_dump(kc == 'D');
+	    break;
+    case 'p':
+    case 'P':
+	    pj_pool_factory_dump(pjsua_get_pool_factory(), PJ_TRUE);
+	    break;
+    case 'l':
+		pjsua_conf_connect(0, 0);
+	    break;
+    case 'L':
+		pjsua_conf_disconnect(0, 0);
+	    break;
+    case 'm':
+	    if (g_call_id != PJSUA_INVALID_ID) {
+		    PJ_LOG(3,(THIS_FILE, "Another call is active"));	
+		    break;
+	    }
+    
+	    if (pjsua_verify_sip_url(SIP_DST_URI) == PJ_SUCCESS) {
+		    pj_str_t dst = pj_str(SIP_DST_URI);
+		    pjsua_call_make_call(g_acc_id, &dst, 0, NULL,
+					 NULL, &g_call_id);
+	    } else {
+		    PJ_LOG(3,(THIS_FILE, "Invalid SIP URI"));
+	    }
+	    break;
+    case 'a':
+	    if (g_call_id != PJSUA_INVALID_ID)
+		    pjsua_call_answer(g_call_id, 200, NULL, NULL);
+	    break;
+    case 'g':
+	    pjsua_call_hangup_all();
+	    break;
+    case 's':
+    case 'S':
+	    if (g_buddy_id != PJSUA_INVALID_ID)
+		    pjsua_buddy_subscribe_pres(g_buddy_id, kc=='s');
+	    break;
+    case 'o':
+    case 'O':
+	    pjsua_acc_set_online_status(g_acc_id, kc=='o');
+	    break;
+    default:
+	    PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed",
+		      kc, kc));
+	    break;
+    }
+
+    PrintMenu();
+    
+    if (reschedule)
+	Run();
+}
+
+#if 0
+// IP networking related testing
+static pj_status_t test_addr(void)
+{
+	int af;
+	unsigned i, count;
+	pj_addrinfo ai[8];
+	pj_sockaddr ifs[8];
+	const pj_str_t *hostname;
+	pj_hostent he;
+	pj_status_t status;
+	
+	pj_log_set_log_func(&log_writer);
+	
+	status = pj_init();
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "pj_init() error", status);
+		return status;
+	}
+	
+	af = pj_AF_INET();
+	
+#if 0
+	pj_in_addr in_addr;
+	pj_str_t aa = pj_str("1.1.1.1");
+	in_addr = pj_inet_addr(&aa);
+	char *the_addr = pj_inet_ntoa(in_addr);
+	PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr));
+
+	aa = pj_str("192.168.0.15");
+	in_addr = pj_inet_addr(&aa);
+	the_addr = pj_inet_ntoa(in_addr);
+	PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr));
+
+	aa = pj_str("2.2.2.2");
+	in_addr = pj_inet_addr(&aa);
+	the_addr = pj_inet_ntoa(in_addr);
+	PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr));
+	
+	return -1;
+#endif
+	
+	// Hostname
+	hostname = pj_gethostname();
+	if (hostname == NULL) {
+		status = PJ_ERESOLVE;
+		pjsua_perror(THIS_FILE, "pj_gethostname() error", status);
+		goto on_return;
+	}
+	
+	PJ_LOG(3,(THIS_FILE, "Hostname: %.*s", hostname->slen, hostname->ptr));
+	
+	// Gethostbyname
+	status = pj_gethostbyname(hostname, &he);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "pj_gethostbyname() error", status);
+	} else {
+		PJ_LOG(3,(THIS_FILE, "gethostbyname: %s", 
+				  pj_inet_ntoa(*(pj_in_addr*)he.h_addr)));
+	}
+	
+	// Getaddrinfo
+	count = PJ_ARRAY_SIZE(ai);
+	status = pj_getaddrinfo(af, hostname, &count, ai);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "pj_getaddrinfo() error", status);
+	} else {
+		for (i=0; i<count; ++i) {
+			char ipaddr[PJ_INET6_ADDRSTRLEN+2];
+			PJ_LOG(3,(THIS_FILE, "Addrinfo: %s", 
+					  pj_sockaddr_print(&ai[i].ai_addr, ipaddr, sizeof(ipaddr), 2)));
+		}
+	}
+	
+	// Enum interface
+	count = PJ_ARRAY_SIZE(ifs);
+	status = pj_enum_ip_interface(af, &count, ifs);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "pj_enum_ip_interface() error", status);
+	} else {
+		for (i=0; i<count; ++i) {
+			char ipaddr[PJ_INET6_ADDRSTRLEN+2];
+			PJ_LOG(3,(THIS_FILE, "Interface: %s", 
+					  pj_sockaddr_print(&ifs[i], ipaddr, sizeof(ipaddr), 2)));
+		}
+	}
+
+	// Get default iinterface
+	status = pj_getdefaultipinterface(af, &ifs[0]);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "pj_getdefaultipinterface() error", status);
+	} else {
+		char ipaddr[PJ_INET6_ADDRSTRLEN+2];
+		PJ_LOG(3,(THIS_FILE, "Default IP: %s", 
+				  pj_sockaddr_print(&ifs[0], ipaddr, sizeof(ipaddr), 2)));
+	}
+	
+	// Get default IP address
+	status = pj_gethostip(af, &ifs[0]);
+	if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "pj_gethostip() error", status);
+	} else {
+		char ipaddr[PJ_INET6_ADDRSTRLEN+2];
+		PJ_LOG(3,(THIS_FILE, "Host IP: %s", 
+				  pj_sockaddr_print(&ifs[0], ipaddr, sizeof(ipaddr), 2)));
+	}
+	
+	status = -1;
+	
+on_return:
+	pj_shutdown();
+	return status;
+}
+#endif
+
+
+#include <es_sock.h>
+
+#if 0
+// Force network connection to use the first IAP, 
+// this is useful for debugging on emulator without GUI. 
+// Include commdb.lib & apengine.lib in symbian_ua.mmp file
+// if this is enabled.
+
+#include <apdatahandler.h>
+
+inline void ForceUseFirstIAP() 
+{
+    TUint32 rank = 1;
+    TUint32 bearers;
+    TUint32 prompt;
+    TUint32 iap;
+
+    CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(commDb);
+
+    CApDataHandler* apDataHandler = CApDataHandler::NewLC(*commDb);
+    
+    TCommDbConnectionDirection direction = ECommDbConnectionDirectionOutgoing;
+    apDataHandler->GetPreferredIfDbIapTypeL(rank, direction, bearers, prompt, iap);
+    prompt = ECommDbDialogPrefDoNotPrompt;
+    apDataHandler->SetPreferredIfDbIapTypeL(rank, direction, bearers, (TCommDbDialogPref)prompt, iap, ETrue);
+    CleanupStack::PopAndDestroy(2); // apDataHandler, commDb
+}
+
+static void SelectIAP() 
+{
+    ForceUseFirstIAP();
+}
+
+#else
+
+static void SelectIAP() 
+{
+}
+
+#endif
+
+
+// Class CConnMon to monitor network connection (RConnection). Whenever
+// the connection is down, it will notify PJLIB and restart PJSUA-LIB.
+class CConnMon : public CActive {
+public:
+    static CConnMon* NewL(RConnection &conn, RSocketServ &sserver) {
+	CConnMon *self = new (ELeave) CConnMon(conn, sserver);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+    }
+    
+    void Start() {
+	conn_.ProgressNotification(nif_progress_, iStatus);
+	SetActive();
+    }
+    
+    void Stop() {
+	Cancel();
+    }
+    
+    ~CConnMon() { Stop(); }
+    
+private:
+    CConnMon(RConnection &conn, RSocketServ &sserver) : 
+	CActive(EPriorityHigh), 
+	conn_(conn), 
+	sserver_(sserver)
+    {
+	CActiveScheduler::Add(this);
+    }
+    
+    void ConstructL() {}
+
+    void DoCancel() {
+	conn_.CancelProgressNotification();
+    }
+
+    void RunL() {
+	int stage = nif_progress_().iStage;
+	
+	if (stage == KLinkLayerClosed) {
+	    pj_status_t status;
+	    TInt err;
+
+	    // Tell pjlib that connection is down.
+	    pj_symbianos_set_connection_status(PJ_FALSE);
+	    
+	    PJ_LOG(3, (THIS_FILE, "RConnection closed, restarting PJSUA.."));
+	    
+	    // Destroy pjsua
+	    pjsua_destroy();
+	    PJ_LOG(3, (THIS_FILE, "PJSUA destroyed."));
+
+	    // Reopen the connection
+	    err = conn_.Open(sserver_);
+	    if (err == KErrNone)
+		err = conn_.Start();
+	    if (err != KErrNone) {
+		CActiveScheduler::Stop();
+		return;
+	    }
+
+	    // Reinit Symbian OS param before pj_init()
+	    pj_symbianos_params sym_params;
+	    pj_bzero(&sym_params, sizeof(sym_params));
+	    sym_params.rsocketserv = &sserver_;
+	    sym_params.rconnection = &conn_;
+	    pj_symbianos_set_params(&sym_params);
+
+	    // Reinit pjsua
+	    status = app_startup();
+	    if (status != PJ_SUCCESS) {
+		pjsua_perror(THIS_FILE, "app_startup() error", status);
+		CActiveScheduler::Stop();
+		return;
+	    }
+	    
+	    PJ_LOG(3, (THIS_FILE, "PJSUA restarted."));
+	    PrintMenu();
+	}
+	
+	Start();
+    }
+    
+    RConnection& conn_;
+    RSocketServ& sserver_;
+    TNifProgressBuf nif_progress_;
+};
+
+////////////////////////////////////////////////////////////////////////////
+int ua_main() 
+{
+    RSocketServ aSocketServer;
+    RConnection aConn;
+    TInt err;
+    pj_symbianos_params sym_params;
+    pj_status_t status;
+
+    SelectIAP();
+    
+    // Initialize RSocketServ
+    if ((err=aSocketServer.Connect()) != KErrNone)
+    	return PJ_STATUS_FROM_OS(err);
+    
+    // Open up a connection
+    if ((err=aConn.Open(aSocketServer)) != KErrNone) {
+	aSocketServer.Close();
+	return PJ_STATUS_FROM_OS(err);
+    }
+    
+    if ((err=aConn.Start()) != KErrNone) {
+    	aSocketServer.Close();
+    	return PJ_STATUS_FROM_OS(err);
+    }
+    
+    // Set Symbian OS parameters in pjlib.
+    // This must be done before pj_init() is called.
+    pj_bzero(&sym_params, sizeof(sym_params));
+    sym_params.rsocketserv = &aSocketServer;
+    sym_params.rconnection = &aConn;
+    pj_symbianos_set_params(&sym_params);
+    
+    // Initialize pjsua
+    status  = app_startup();
+    //status = test_addr();
+    if (status != PJ_SUCCESS) {
+    	aConn.Close();
+    	aSocketServer.Close();
+	return status;
+    }
+
+    
+    // Run the UI
+    ConsoleUI *con = new ConsoleUI(console);
+    
+    con->Run();
+    PrintMenu();
+
+    // Init & start connection monitor
+    CConnMon *connmon = CConnMon::NewL(aConn, aSocketServer);
+    connmon->Start();
+
+    CActiveScheduler::Start();
+    
+    delete connmon;
+    delete con;
+
+    // Dump memory statistics
+    PJ_LOG(3,(THIS_FILE, "Max heap usage: %u.%03uMB",
+	      pjsua_var.cp.peak_used_size / 1000000,
+	      (pjsua_var.cp.peak_used_size % 1000000)/1000));
+    
+    // check max stack usage
+#if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0
+	pj_thread_t* this_thread = pj_thread_this();
+	if (!this_thread)
+	    return status;
+	
+	const char* max_stack_file;
+	int max_stack_line;
+	status = pj_thread_get_stack_info(this_thread, &max_stack_file, &max_stack_line);
+	
+	PJ_LOG(3,(THIS_FILE, "Max stack usage: %u at %s:%d", 
+		  pj_thread_get_stack_max_usage(this_thread), 
+		  max_stack_file, max_stack_line));
+#endif
+	
+    // Shutdown pjsua
+    pjsua_destroy();
+    
+    // Close connection and socket server
+    aConn.Close();
+    aSocketServer.Close();
+	
+    return status;
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/ua.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua/ua.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua/ua.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/application.uidesign b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/application.uidesign
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/application.uidesign
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/application.uidesign
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.l01 b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.l01
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.l01
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.l01
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.loc b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.loc
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.loc
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.loc
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.rss b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.rss
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.rss
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui.rss
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.l01 b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.l01
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.l01
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.l01
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.loc b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.loc
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.loc
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.loc
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.rssi b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.rssi
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.rssi
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiContainer.rssi
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.l01 b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.l01
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.l01
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.l01
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.loc b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.loc
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.loc
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.loc
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.rssi b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.rssi
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.rssi
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_guiSettingItemList.rssi
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.loc b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.loc
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.loc
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.loc
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.rss b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.rss
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.rss
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/data/symbian_ua_gui_reg.rss
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/list_icon.bmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/list_icon.bmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/list_icon.bmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/list_icon.bmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/list_icon_mask.bmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/list_icon_mask.bmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/list_icon_mask.bmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/list_icon_mask.bmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon.bmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon.bmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon.bmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon.bmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon_mask.bmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon_mask.bmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon_mask.bmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/mark_icon_mask.bmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/qgn_menu_symbian_ua_gui.svg b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/qgn_menu_symbian_ua_gui.svg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/gfx/qgn_menu_symbian_ua_gui.svg
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/gfx/qgn_menu_symbian_ua_gui.svg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/ABLD.BAT b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/group/ABLD.BAT
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/ABLD.BAT
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/group/ABLD.BAT
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/Icons_aif_scalable_dc.mk b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/group/Icons_aif_scalable_dc.mk
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/Icons_aif_scalable_dc.mk
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/group/Icons_aif_scalable_dc.mk
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/bld.inf b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/group/bld.inf
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/bld.inf
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/group/bld.inf
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/symbian_ua_gui.mmp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/group/symbian_ua_gui.mmp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/group/symbian_ua_gui.mmp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/group/symbian_ua_gui.mmp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.hrh b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.hrh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.hrh
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.hrh
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.pan b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.pan
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.pan
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_gui.pan
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.hrh b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.hrh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.hrh
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.hrh
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.hrh b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.hrh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.hrh
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.hrh
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.pkg b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.pkg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.pkg
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.pkg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.txt b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.txt
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/sis/symbian_ua_gui.txt
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6d7522938b924bc781abb0d7ae49544c8af38811
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp
@@ -0,0 +1,144 @@
+/*
+========================================================================
+ Name        : Symbian_ua_guiSettingItemListSettings.cpp
+ Author      : nanang
+ Copyright   : (c) 2008-2009 Teluu Inc.
+ Description : 
+========================================================================
+*/
+/**
+ *	Generated helper class which manages the settings contained 
+ *	in 'symbian_ua_guiSettingItemList'.  Each CAknSettingItem maintains
+ *	a reference to data in this class so that changes in the setting
+ *	item list can be synchronized with this storage.
+ */
+ 
+// [[[ begin generated region: do not modify [Generated Includes]
+#include <e32base.h>
+#include <stringloader.h>
+#include <barsread.h>
+#include <symbian_ua_gui.rsg>
+#include "Symbian_ua_guiSettingItemListSettings.h"
+// ]]] end generated region [Generated Includes]
+
+/**
+ * C/C++ constructor for settings data, cannot throw
+ */
+TSymbian_ua_guiSettingItemListSettings::TSymbian_ua_guiSettingItemListSettings()
+	{
+	}
+
+/**
+ * Two-phase constructor for settings data
+ */
+TSymbian_ua_guiSettingItemListSettings* TSymbian_ua_guiSettingItemListSettings::NewL()
+	{
+	TSymbian_ua_guiSettingItemListSettings* data = new( ELeave ) TSymbian_ua_guiSettingItemListSettings;
+	CleanupStack::PushL( data );
+	data->ConstructL();
+	CleanupStack::Pop( data );
+	return data;
+	}
+	
+/**
+ *	Second phase for initializing settings data
+ */
+void TSymbian_ua_guiSettingItemListSettings::ConstructL()
+	{
+	// [[[ begin generated region: do not modify [Generated Initializers]
+		{
+		HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR );
+		SetEd_registrar( text->Des() );
+		CleanupStack::PopAndDestroy( text );
+		}
+		{
+		HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER );
+		SetEd_user( text->Des() );
+		CleanupStack::PopAndDestroy( text );
+		}
+	SetB_srtp( 0 );
+	SetB_ice( 0 );
+		{
+		HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER );
+		SetEd_stun_server( text->Des() );
+		CleanupStack::PopAndDestroy( text );
+		}
+	// ]]] end generated region [Generated Initializers]
+	
+	}
+	
+// [[[ begin generated region: do not modify [Generated Contents]
+TDes& TSymbian_ua_guiSettingItemListSettings::Ed_registrar()
+	{
+	return iEd_registrar;
+	}
+
+void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar(const TDesC& aValue)
+	{
+	if ( aValue.Length() < KEd_registrarMaxLength)
+		iEd_registrar.Copy( aValue );
+	else
+		iEd_registrar.Copy( aValue.Ptr(), KEd_registrarMaxLength);
+	}
+
+TDes& TSymbian_ua_guiSettingItemListSettings::Ed_user()
+	{
+	return iEd_user;
+	}
+
+void TSymbian_ua_guiSettingItemListSettings::SetEd_user(const TDesC& aValue)
+	{
+	if ( aValue.Length() < KEd_userMaxLength)
+		iEd_user.Copy( aValue );
+	else
+		iEd_user.Copy( aValue.Ptr(), KEd_userMaxLength);
+	}
+
+TDes& TSymbian_ua_guiSettingItemListSettings::Ed_password()
+	{
+	return iEd_password;
+	}
+
+void TSymbian_ua_guiSettingItemListSettings::SetEd_password(const TDesC& aValue)
+	{
+	if ( aValue.Length() < KEd_passwordMaxLength)
+		iEd_password.Copy( aValue );
+	else
+		iEd_password.Copy( aValue.Ptr(), KEd_passwordMaxLength);
+	}
+
+TBool& TSymbian_ua_guiSettingItemListSettings::B_srtp()
+	{
+	return iB_srtp;
+	}
+
+void TSymbian_ua_guiSettingItemListSettings::SetB_srtp(const TBool& aValue)
+	{
+	iB_srtp = aValue;
+	}
+
+TBool& TSymbian_ua_guiSettingItemListSettings::B_ice()
+	{
+	return iB_ice;
+	}
+
+void TSymbian_ua_guiSettingItemListSettings::SetB_ice(const TBool& aValue)
+	{
+	iB_ice = aValue;
+	}
+
+TDes& TSymbian_ua_guiSettingItemListSettings::Ed_stun_server()
+	{
+	return iEd_stun_server;
+	}
+
+void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server(const TDesC& aValue)
+	{
+	if ( aValue.Length() < KEd_stun_serverMaxLength)
+		iEd_stun_server.Copy( aValue );
+	else
+		iEd_stun_server.Copy( aValue.Ptr(), KEd_stun_serverMaxLength);
+	}
+
+// ]]] end generated region [Generated Contents]
+
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f722336a1b900a640f9aecab638b82c5b60f10cc
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp
@@ -0,0 +1,514 @@
+/* $Id: ua.cpp 1793 2008-02-14 13:39:24Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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 <pjsua-lib/pjsua.h>
+#include <pjsua-lib/pjsua_internal.h>
+#include <es_sock.h>
+#include "symbian_ua.h"
+
+#define THIS_FILE	"symbian_ua.cpp"
+#define LOG_LEVEL	3
+
+#define SIP_PORT	5060
+#define USE_ICE		0
+#define USE_SRTP	PJSUA_DEFAULT_USE_SRTP
+
+static RSocketServ aSocketServer;
+static RConnection aConn;
+
+static pjsua_acc_id g_acc_id = PJSUA_INVALID_ID;
+static pjsua_call_id g_call_id = PJSUA_INVALID_ID;
+static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID;
+
+static symbian_ua_info_cb_t g_cb =  {NULL, NULL, NULL, NULL, NULL};
+
+static void log_writer(int level, const char *buf, int len)
+{
+    static wchar_t buf16[PJ_LOG_MAX_SIZE];
+
+    PJ_UNUSED_ARG(level);
+    
+    if (!g_cb.on_info)
+	return;
+
+    pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16));
+    g_cb.on_info(buf16);
+}
+
+static void on_reg_state(pjsua_acc_id acc_id)
+{
+    pjsua_acc_info acc_info;
+    pj_status_t status;
+
+    status = pjsua_acc_get_info(acc_id, &acc_info);
+    if (status != PJ_SUCCESS)
+	return;
+
+    if (acc_info.status == 200) {
+	if (acc_info.expires) {
+	    PJ_LOG(3,(THIS_FILE, "Registration success!"));
+	    if (g_cb.on_reg_state) g_cb.on_reg_state(true);
+	} else {
+	    PJ_LOG(3,(THIS_FILE, "Unregistration success!"));
+	    if (g_cb.on_unreg_state) g_cb.on_unreg_state(true);
+	}
+    } else {
+	if (acc_info.expires) {
+	    PJ_LOG(3,(THIS_FILE, "Registration failed!"));
+	    if (g_cb.on_reg_state) g_cb.on_reg_state(false);
+	} else {
+	    PJ_LOG(3,(THIS_FILE, "Unregistration failed!"));
+	    if (g_cb.on_unreg_state) g_cb.on_unreg_state(false);
+	}
+    }
+}
+
+/* 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);
+
+    if (g_call_id != PJSUA_INVALID_ID) {
+    	pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, NULL, NULL);
+    	return;
+    }
+    
+    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));
+
+    g_call_id = call_id;
+    
+    /* Automatically answer incoming calls with 180/Ringing */
+    pjsua_call_answer(call_id, 180, NULL, NULL);
+
+    if (g_cb.on_incoming_call) {
+	static wchar_t disp[256];
+	static wchar_t uri[PJSIP_MAX_URL_SIZE];
+
+	pj_ansi_to_unicode(ci.remote_info.ptr, ci.remote_info.slen, 
+	    disp, PJ_ARRAY_SIZE(disp));
+	pj_ansi_to_unicode(ci.remote_contact.ptr, ci.remote_contact.slen, 
+	    uri, PJ_ARRAY_SIZE(uri));
+
+	g_cb.on_incoming_call(disp, uri);
+    }
+}
+
+/* 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);
+    
+    if (ci.state == PJSIP_INV_STATE_DISCONNECTED) {
+    	if (call_id == g_call_id)
+    	    g_call_id = PJSUA_INVALID_ID;
+	if (g_cb.on_call_end) {
+	    static wchar_t reason[256];
+	    pj_ansi_to_unicode(ci.last_status_text.ptr, ci.last_status_text.slen, 
+		    reason, PJ_ARRAY_SIZE(reason));
+	    g_cb.on_call_end(reason);
+	}
+
+    } else if (ci.state != PJSIP_INV_STATE_INCOMING) {
+    	if (g_call_id == PJSUA_INVALID_ID)
+    	    g_call_id = call_id;
+    }
+    
+    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);
+    }
+}
+
+
+/* Handler on buddy state changed. */
+static void on_buddy_state(pjsua_buddy_id buddy_id)
+{
+    pjsua_buddy_info info;
+    pjsua_buddy_get_info(buddy_id, &info);
+
+    PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s",
+	      (int)info.uri.slen,
+	      info.uri.ptr,
+	      (int)info.status_text.slen,
+	      info.status_text.ptr));
+}
+
+
+/* Incoming IM message (i.e. MESSAGE request)!  */
+static void on_pager(pjsua_call_id call_id, const pj_str_t *from, 
+		     const pj_str_t *to, const pj_str_t *contact,
+		     const pj_str_t *mime_type, const pj_str_t *text)
+{
+    /* Note: call index may be -1 */
+    PJ_UNUSED_ARG(call_id);
+    PJ_UNUSED_ARG(to);
+    PJ_UNUSED_ARG(contact);
+    PJ_UNUSED_ARG(mime_type);
+
+    PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s",
+	      (int)from->slen, from->ptr,
+	      (int)text->slen, text->ptr));
+}
+
+
+/* Received typing indication  */
+static void on_typing(pjsua_call_id call_id, const pj_str_t *from,
+		      const pj_str_t *to, const pj_str_t *contact,
+		      pj_bool_t is_typing)
+{
+    PJ_UNUSED_ARG(call_id);
+    PJ_UNUSED_ARG(to);
+    PJ_UNUSED_ARG(contact);
+
+    PJ_LOG(3,(THIS_FILE, "IM indication: %.*s %s",
+	      (int)from->slen, from->ptr,
+	      (is_typing?"is typing..":"has stopped typing")));
+}
+
+
+/* Call transfer request status. */
+static void on_call_transfer_status(pjsua_call_id call_id,
+				    int status_code,
+				    const pj_str_t *status_text,
+				    pj_bool_t final,
+				    pj_bool_t *p_cont)
+{
+    PJ_LOG(3,(THIS_FILE, "Call %d: transfer status=%d (%.*s) %s",
+	      call_id, status_code,
+	      (int)status_text->slen, status_text->ptr,
+	      (final ? "[final]" : "")));
+
+    if (status_code/100 == 2) {
+	PJ_LOG(3,(THIS_FILE, 
+	          "Call %d: call transfered successfully, disconnecting call",
+		  call_id));
+	pjsua_call_hangup(call_id, PJSIP_SC_GONE, NULL, NULL);
+	*p_cont = PJ_FALSE;
+    }
+}
+
+
+/* NAT detection result */
+static void on_nat_detect(const pj_stun_nat_detect_result *res) 
+{
+    if (res->status != PJ_SUCCESS) {
+	pjsua_perror(THIS_FILE, "NAT detection failed", res->status);
+    } else {
+	PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name));
+    }    
+}
+
+/* Notification that call is being replaced. */
+static void on_call_replaced(pjsua_call_id old_call_id,
+			     pjsua_call_id new_call_id)
+{
+    pjsua_call_info old_ci, new_ci;
+
+    pjsua_call_get_info(old_call_id, &old_ci);
+    pjsua_call_get_info(new_call_id, &new_ci);
+
+    PJ_LOG(3,(THIS_FILE, "Call %d with %.*s is being replaced by "
+			 "call %d with %.*s",
+			 old_call_id, 
+			 (int)old_ci.remote_info.slen, old_ci.remote_info.ptr,
+			 new_call_id,
+			 (int)new_ci.remote_info.slen, new_ci.remote_info.ptr));
+}
+
+int symbian_ua_init()
+{
+    TInt err;
+    pj_symbianos_params sym_params;
+    pj_status_t status;
+    
+    // Initialize RSocketServ
+    if ((err=aSocketServer.Connect()) != KErrNone)
+    	return PJ_STATUS_FROM_OS(err);
+    
+    // Open up a connection
+    if ((err=aConn.Open(aSocketServer)) != KErrNone) {
+	    aSocketServer.Close();
+		return PJ_STATUS_FROM_OS(err);
+    }
+    
+    if ((err=aConn.Start()) != KErrNone) {
+	aConn.Close();
+    	aSocketServer.Close();
+    	return PJ_STATUS_FROM_OS(err);
+    }
+    
+    // Set Symbian OS parameters in pjlib.
+    // This must be done before pj_init() is called.
+    pj_bzero(&sym_params, sizeof(sym_params));
+    sym_params.rsocketserv = &aSocketServer;
+    sym_params.rconnection = &aConn;
+    pj_symbianos_set_params(&sym_params);
+
+    /* Redirect log before pjsua_init() */
+    pj_log_set_log_func(&log_writer);
+    
+    /* Set log level */
+    pj_log_set_level(LOG_LEVEL);
+
+    /* Create pjsua first! */
+    status = pjsua_create();
+    if (status != PJ_SUCCESS) {
+    	pjsua_perror(THIS_FILE, "pjsua_create() error", status);
+    	return status;
+    }
+
+    /* Init pjsua */
+    pjsua_config cfg;
+
+    pjsua_config_default(&cfg);
+    cfg.max_calls = 2;
+    cfg.thread_cnt = 0; // Disable threading on Symbian
+    cfg.use_srtp = USE_SRTP;
+    cfg.srtp_secure_signaling = 0;
+
+    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;
+    cfg.cb.on_buddy_state = &on_buddy_state;
+    cfg.cb.on_pager = &on_pager;
+    cfg.cb.on_typing = &on_typing;
+    cfg.cb.on_call_transfer_status = &on_call_transfer_status;
+    cfg.cb.on_call_replaced = &on_call_replaced;
+    cfg.cb.on_nat_detect = &on_nat_detect;
+    cfg.cb.on_reg_state = &on_reg_state;
+
+    pjsua_media_config med_cfg;
+
+    pjsua_media_config_default(&med_cfg);
+    med_cfg.thread_cnt = 0; // Disable threading on Symbian
+    med_cfg.has_ioqueue = PJ_FALSE;
+    med_cfg.clock_rate = 8000;
+#if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1)
+    med_cfg.audio_frame_ptime = 20;
+#else
+    med_cfg.audio_frame_ptime = 40;
+#endif
+    med_cfg.ec_tail_len = 0;
+    med_cfg.enable_ice = USE_ICE;
+    med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed
+
+    pjsua_logging_config log_cfg;
+
+    pjsua_logging_config_default(&log_cfg);
+    log_cfg.console_level = LOG_LEVEL;
+    log_cfg.cb = &log_writer;
+    log_cfg.decor = 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 tcfg;
+    pjsua_transport_id tid;
+
+    pjsua_transport_config_default(&tcfg);
+    tcfg.port = SIP_PORT;
+    status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid);
+    if (status != PJ_SUCCESS) {
+	    pjsua_perror(THIS_FILE, "Error creating transport", status);
+	    pjsua_destroy();
+	    return status;
+    }
+
+    /* Add account for the transport */
+    pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id);
+
+    /* 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;
+    }
+
+    /* Adjust Speex priority and enable only the narrowband */
+    {
+        pj_str_t codec_id = pj_str("speex/8000");
+        pjmedia_codec_mgr_set_codec_priority( 
+        	pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt),
+        	&codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1);
+
+        codec_id = pj_str("speex/16000");
+        pjmedia_codec_mgr_set_codec_priority( 
+        	pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt),
+        	&codec_id, PJMEDIA_CODEC_PRIO_DISABLED);
+
+        codec_id = pj_str("speex/32000");
+        pjmedia_codec_mgr_set_codec_priority( 
+        	pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt),
+        	&codec_id, PJMEDIA_CODEC_PRIO_DISABLED);
+    }
+
+    return PJ_SUCCESS;
+}
+
+
+int symbian_ua_destroy()
+{
+    // Shutdown pjsua
+    pjsua_destroy();
+    
+    // Close connection and socket server
+    aConn.Close();
+    aSocketServer.Close();
+    
+    CloseSTDLIB();
+
+    return PJ_SUCCESS;
+}
+
+void symbian_ua_set_info_callback(const symbian_ua_info_cb_t *cb)
+{
+    if (cb)
+	g_cb = *cb;
+    else
+	pj_bzero(&g_cb, sizeof(g_cb));
+}
+
+int symbian_ua_set_account(const char *domain, const char *username, 
+			   const char *password,
+			   bool use_srtp, bool use_ice)
+{
+    pj_status_t status;
+
+    PJ_ASSERT_RETURN(username && password && domain, PJ_EINVAL);
+    PJ_UNUSED_ARG(use_srtp);
+    PJ_UNUSED_ARG(use_ice);
+
+    if (domain[0] == 0) {
+	    pjsua_acc_info acc_info;
+	    pj_status_t status;
+
+	    status = pjsua_acc_get_info(g_acc_id, &acc_info);
+	    if (status != PJ_SUCCESS)
+		return status;
+
+	    if (acc_info.status == 200) {
+			PJ_LOG(3,(THIS_FILE, "Unregistering.."));
+			pjsua_acc_set_registration(g_acc_id, PJ_FALSE);
+			g_acc_id = 0;
+	    }
+	    return PJ_SUCCESS;
+    }
+
+    if (pjsua_acc_get_count() > 1) {
+	status = pjsua_acc_del(g_acc_id);
+	if (status != PJ_SUCCESS) {
+	    pjsua_perror(THIS_FILE, "Error removing account", status);
+	    return status;
+	}
+	g_acc_id = 0;
+    }
+
+    pjsua_acc_config cfg;
+    char tmp_id[PJSIP_MAX_URL_SIZE];
+    char tmp_reg_uri[PJSIP_MAX_URL_SIZE];
+
+    if (!pj_ansi_strnicmp(domain, "sip:", 4)) {
+	domain += 4;
+    }
+
+    pjsua_acc_config_default(&cfg);
+    pj_ansi_sprintf(tmp_id, "sip:%s@%s", username, domain);
+    cfg.id = pj_str(tmp_id);
+    pj_ansi_sprintf(tmp_reg_uri, "sip:%s", domain);
+    cfg.reg_uri = pj_str(tmp_reg_uri);
+    cfg.cred_count = 1;
+    cfg.cred_info[0].realm = pj_str("*");
+    cfg.cred_info[0].scheme = pj_str("digest");
+    cfg.cred_info[0].username = pj_str((char*)username);
+    cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
+    cfg.cred_info[0].data = pj_str((char*)password);
+
+    status = pjsua_acc_add(&cfg, PJ_TRUE, &g_acc_id);
+    if (status != PJ_SUCCESS) {
+	    pjsua_perror(THIS_FILE, "Error setting account", status);
+	    pjsua_destroy();
+	    return status;
+    }
+
+    return PJ_SUCCESS;
+}
+
+int symbian_ua_makecall(const char* dest_url)
+{
+    if (pjsua_verify_sip_url(dest_url) == PJ_SUCCESS) {
+	    pj_str_t dst = pj_str((char*)dest_url);
+	    pjsua_call_make_call(g_acc_id, &dst, 0, NULL,
+				 NULL, &g_call_id);
+
+	    return PJ_SUCCESS;
+    }
+
+    return PJ_EINVAL;
+}
+
+int symbian_ua_endcall()
+{
+    pjsua_call_hangup_all();
+
+    return PJ_SUCCESS;
+}
+
+bool symbian_ua_anycall()
+{
+    return (pjsua_call_get_count()>0);
+}
+
+int symbian_ua_answercall()
+{
+    PJ_ASSERT_RETURN (g_call_id != PJSUA_INVALID_ID, PJ_EINVAL);
+
+    return pjsua_call_answer(g_call_id, 200, NULL, NULL);
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ac399510b2bb98b03fe0b34dbf21a021b4be41ec
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp
@@ -0,0 +1,247 @@
+/*
+========================================================================
+ Name        : symbian_ua_guiAppUi.cpp
+ Author      : nanang
+ Copyright   : (c) 2008-2009 Teluu Inc.
+ Description : 
+========================================================================
+*/
+// [[[ begin generated region: do not modify [Generated System Includes]
+#include <eikmenub.h>
+#include <akncontext.h>
+#include <akntitle.h>
+#include <symbian_ua_gui.rsg>
+// ]]] end generated region [Generated System Includes]
+
+// [[[ begin generated region: do not modify [Generated User Includes]
+#include "symbian_ua_guiAppUi.h"
+#include "symbian_ua_gui.hrh"
+#include "symbian_ua_guiContainer.hrh"
+#include "symbian_ua_guiSettingItemList.hrh"
+#include "symbian_ua_guiContainerView.h"
+#include "symbian_ua_guiSettingItemListView.h"
+// ]]] end generated region [Generated User Includes]
+
+// [[[ begin generated region: do not modify [Generated Constants]
+// ]]] end generated region [Generated Constants]
+
+#include "symbian_ua.h"
+
+/**
+ * Construct the Csymbian_ua_guiAppUi instance
+ */ 
+Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer(0)
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+
+	}
+
+/** 
+ * The appui's destructor removes the container from the control
+ * stack and destroys it.
+ */
+Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	TRAPD( err_Dlg_wait_init, RemoveDlg_wait_initL() );
+	// ]]] end generated region [Generated Contents]
+	}
+
+// [[[ begin generated function: do not modify
+void Csymbian_ua_guiAppUi::InitializeContainersL()
+	{
+	iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL();
+	AddViewL( iSymbian_ua_guiContainerView );
+	iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL();
+	AddViewL( iSymbian_ua_guiSettingItemListView );
+	SetDefaultViewL( *iSymbian_ua_guiSettingItemListView );
+	}
+// ]]] end generated function
+
+/**
+ * Handle a command for this appui (override)
+ * @param aCommand command id to be handled
+ */
+void Csymbian_ua_guiAppUi::HandleCommandL( TInt aCommand )
+	{
+	// [[[ begin generated region: do not modify [Generated Code]
+	TBool commandHandled = EFalse;
+	switch ( aCommand )
+		{ // code to dispatch to the AppUi's menu and CBA commands is generated here
+		default:
+			break;
+		}
+	
+		
+	if ( !commandHandled ) 
+		{
+		if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit )
+			{
+		    	symbian_ua_destroy();
+			Exit();
+			}
+		}
+	// ]]] end generated region [Generated Code]
+	
+	}
+
+/** 
+ * Override of the HandleResourceChangeL virtual function
+ */
+void Csymbian_ua_guiAppUi::HandleResourceChangeL( TInt aType )
+	{
+	CAknViewAppUi::HandleResourceChangeL( aType );
+	// [[[ begin generated region: do not modify [Generated Code]
+	// ]]] end generated region [Generated Code]
+	
+	}
+				
+/** 
+ * Override of the HandleKeyEventL virtual function
+ * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not
+ * @param aKeyEvent 
+ * @param aType 
+ */
+TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL(
+		const TKeyEvent& aKeyEvent,
+		TEventCode aType )
+	{
+	// The inherited HandleKeyEventL is private and cannot be called
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+	
+	return EKeyWasNotConsumed;
+	}
+
+/** 
+ * Override of the HandleViewDeactivation virtual function
+ *
+ * @param aViewIdToBeDeactivated 
+ * @param aNewlyActivatedViewId 
+ */
+void Csymbian_ua_guiAppUi::HandleViewDeactivation( 
+		const TVwsViewId& aViewIdToBeDeactivated, 
+		const TVwsViewId& aNewlyActivatedViewId )
+	{
+	CAknViewAppUi::HandleViewDeactivation( 
+			aViewIdToBeDeactivated, 
+			aNewlyActivatedViewId );
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+	
+	}
+
+/**
+ * @brief Completes the second phase of Symbian object construction. 
+ * Put initialization code that could leave here. 
+ */ 
+void Csymbian_ua_guiAppUi::ConstructL()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	BaseConstructL( EAknEnableSkin );
+	InitializeContainersL();
+	// ]]] end generated region [Generated Contents]
+
+	// Create private folder
+	RProcess process;
+	TFileName path;
+	
+	path.Copy( process.FileName().Left(2) );
+	
+	if(path.Compare(_L("c")) || path.Compare(_L("C")))
+		CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC);
+	else if(path.Compare(_L("e")) || path.Compare(_L("E")))
+		CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE);	
+	
+	// Init PJSUA
+	if (symbian_ua_init() != 0) {
+	    symbian_ua_destroy();
+	    Exit();
+	}
+	
+	ExecuteDlg_wait_initLD();
+
+	CTimer::ConstructL();
+	CActiveScheduler::Add( this );
+	After(4000000);
+	}
+
+/** 
+ * Override of the HandleApplicationSpecificEventL virtual function
+ */
+void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL( 
+		TInt aType, 
+		const TWsEvent& anEvent )
+	{
+	CAknViewAppUi::HandleApplicationSpecificEventL( aType, anEvent );
+	// [[[ begin generated region: do not modify [Generated Code]
+	// ]]] end generated region [Generated Code]
+	
+	}
+				
+/** 
+ * Handle the applicationSpecificEvent event.
+ */
+void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL( 
+		TInt /* aType */, 
+		const TWsEvent& /* anEvent */ )
+	{
+	// TODO: implement applicationSpecificEvent event handler
+	}
+				
+// [[[ begin generated function: do not modify
+/**
+ * Execute the wait dialog for dlg_wait_init. This routine returns
+ * while the dialog is showing. It will be closed and destroyed when
+ * RemoveDlg_wait_initL() or the user selects the Cancel soft key.
+ * @param aOverrideText optional override text. When null the text configured
+ * in the UI Designer is used.
+ */
+void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD( const TDesC* aOverrideText )
+	{
+	iDlg_wait_init = new ( ELeave ) CAknWaitDialog( 
+			reinterpret_cast< CEikDialog** >( &iDlg_wait_init ), EFalse );
+	if ( aOverrideText != NULL )
+		{
+		iDlg_wait_init->SetTextL( *aOverrideText );
+		}
+	iDlg_wait_init->ExecuteLD( R_APPLICATION_DLG_WAIT_INIT );
+	iDlg_wait_initCallback = new ( ELeave ) CProgressDialogCallback( 
+		this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL );
+	iDlg_wait_init->SetCallback( iDlg_wait_initCallback );
+	}
+// ]]] end generated function
+
+// [[[ begin generated function: do not modify
+/**
+ * Close and dispose of the wait dialog for dlg_wait_init
+ */
+void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL()
+	{
+	if ( iDlg_wait_init != NULL )
+		{
+		iDlg_wait_init->SetCallback( NULL );
+		iDlg_wait_init->ProcessFinishedL();    // deletes the dialog
+		iDlg_wait_init = NULL;
+		}
+	delete iDlg_wait_initCallback;
+	iDlg_wait_initCallback = NULL;
+	
+	}
+// ]]] end generated function
+
+/** 
+ * Handle the canceled event.
+ */
+void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL( CAknProgressDialog* /* aDialog */ )
+	{
+	// TODO: implement canceled event handler
+	
+	}
+				
+void Csymbian_ua_guiAppUi::RunL()
+	{
+	RemoveDlg_wait_initL();
+	iSymbian_ua_guiSettingItemListView->HandleCommandL(EAknSoftkeySave);
+	}
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp
similarity index 78%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp
index d32c672d6c7e08becc4bab7c0a2fe005a0d5948a..dc60fecd64d1cab99afdbb61aa15b9f49921935b 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp
@@ -3,7 +3,7 @@
  Name        : symbian_ua_guiApplication.cpp
  Author      : nanang
  Copyright   : (c) 2008-2009 Teluu Inc.
- Description :
+ Description : 
 ========================================================================
 */
 // [[[ begin generated region: do not modify [Generated System Includes]
@@ -19,50 +19,50 @@
 
 
 // Needed by APS
-TPtrC APP_UID = _L ("EBD12EE4");
+TPtrC APP_UID = _L("EBD12EE4");
 
 /**
  * @brief Returns the application's UID (override from CApaApplication::AppDllUid())
  * @return UID for this application (KUidsymbian_ua_guiApplication)
  */
 TUid Csymbian_ua_guiApplication::AppDllUid() const
-{
-    return KUidsymbian_ua_guiApplication;
-}
+	{
+	return KUidsymbian_ua_guiApplication;
+	}
 
 /**
  * @brief Creates the application's document (override from CApaApplication::CreateDocumentL())
  * @return Pointer to the created document object (Csymbian_ua_guiDocument)
  */
 CApaDocument* Csymbian_ua_guiApplication::CreateDocumentL()
-{
-    return Csymbian_ua_guiDocument::NewL (*this);
-}
+	{
+	return Csymbian_ua_guiDocument::NewL( *this );
+	}
 
 #ifdef EKA2
 
 /**
  *	@brief Called by the application framework to construct the application object
  *  @return The application (Csymbian_ua_guiApplication)
- */
+ */	
 LOCAL_C CApaApplication* NewApplication()
-{
-    return new Csymbian_ua_guiApplication;
-}
+	{
+	return new Csymbian_ua_guiApplication;
+	}
 
 /**
 * @brief This standard export is the entry point for all Series 60 applications
 * @return error code
- */
+ */	
 GLDEF_C TInt E32Main()
-{
-    TInt err;
-
-    err = EikStart::RunApplication (NewApplication);
-
-    return err;
-}
+	{
+	TInt err;
+	
+	err = EikStart::RunApplication( NewApplication );
 
+	return err;
+	}
+	
 #else 	// Series 60 2.x main DLL program code
 
 /**
@@ -70,17 +70,17 @@ GLDEF_C TInt E32Main()
 * @return The application (Csymbian_ua_guiApplication)
 */
 EXPORT_C CApaApplication* NewApplication()
-{
-    return new Csymbian_ua_guiApplication;
-}
+	{
+	return new Csymbian_ua_guiApplication;
+	}
 
 /**
 * @brief This standard export is the entry point for all Series 60 applications
 * @return error code
 */
-GLDEF_C TInt E32Dll (TDllReason /*reason*/)
-{
-    return KErrNone;
-}
+GLDEF_C TInt E32Dll(TDllReason /*reason*/)
+	{
+	return KErrNone;
+	}
 
 #endif // EKA2
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..777217c7de802bbeee708c77d062236f1961d719
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp
@@ -0,0 +1,285 @@
+/*
+========================================================================
+ Name        : symbian_ua_guiContainer.cpp
+ Author      : nanang
+ Copyright   : (c) 2008-2009 Teluu Inc.
+ Description : 
+========================================================================
+*/
+// [[[ begin generated region: do not modify [Generated System Includes]
+#include <barsread.h>
+#include <stringloader.h>
+#include <eiklabel.h>
+#include <eikenv.h>
+#include <gdi.h>
+#include <eikedwin.h>
+#include <aknviewappui.h>
+#include <eikappui.h>
+#include <symbian_ua_gui.rsg>
+// ]]] end generated region [Generated System Includes]
+
+// [[[ begin generated region: do not modify [Generated User Includes]
+#include "symbian_ua_guiContainer.h"
+#include "symbian_ua_guiContainerView.h"
+#include "symbian_ua_gui.hrh"
+#include "symbian_ua_guiContainer.hrh"
+#include "symbian_ua_guiSettingItemList.hrh"
+// ]]] end generated region [Generated User Includes]
+
+// [[[ begin generated region: do not modify [Generated Constants]
+// ]]] end generated region [Generated Constants]
+
+/**
+ * First phase of Symbian two-phase construction. Should not 
+ * contain any code that could leave.
+ */
+CSymbian_ua_guiContainer::CSymbian_ua_guiContainer()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	iLabel1 = NULL;
+	iEd_url = NULL;
+	iEd_info = NULL;
+	// ]]] end generated region [Generated Contents]
+	
+	}
+/** 
+ * Destroy child controls.
+ */
+CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	delete iLabel1;
+	iLabel1 = NULL;
+	delete iEd_url;
+	iEd_url = NULL;
+	delete iEd_info;
+	iEd_info = NULL;
+	// ]]] end generated region [Generated Contents]
+	
+	}
+				
+/**
+ * Construct the control (first phase).
+ *  Creates an instance and initializes it.
+ *  Instance is not left on cleanup stack.
+ * @param aRect bounding rectangle
+ * @param aParent owning parent, or NULL
+ * @param aCommandObserver command observer
+ * @return initialized instance of CSymbian_ua_guiContainer
+ */
+CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL( 
+		const TRect& aRect, 
+		const CCoeControl* aParent, 
+		MEikCommandObserver* aCommandObserver )
+	{
+	CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC( 
+			aRect, 
+			aParent, 
+			aCommandObserver );
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/**
+ * Construct the control (first phase).
+ *  Creates an instance and initializes it.
+ *  Instance is left on cleanup stack.
+ * @param aRect The rectangle for this window
+ * @param aParent owning parent, or NULL
+ * @param aCommandObserver command observer
+ * @return new instance of CSymbian_ua_guiContainer
+ */
+CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC( 
+		const TRect& aRect, 
+		const CCoeControl* aParent, 
+		MEikCommandObserver* aCommandObserver )
+	{
+	CSymbian_ua_guiContainer* self = new ( ELeave ) CSymbian_ua_guiContainer();
+	CleanupStack::PushL( self );
+	self->ConstructL( aRect, aParent, aCommandObserver );
+	return self;
+	}
+			
+/**
+ * Construct the control (second phase).
+ *  Creates a window to contain the controls and activates it.
+ * @param aRect bounding rectangle
+ * @param aCommandObserver command observer
+ * @param aParent owning parent, or NULL
+ */ 
+void CSymbian_ua_guiContainer::ConstructL( 
+		const TRect& aRect, 
+		const CCoeControl* aParent, 
+		MEikCommandObserver* aCommandObserver )
+	{
+	if ( aParent == NULL )
+	    {
+		CreateWindowL();
+	    }
+	else
+	    {
+	    SetContainerWindowL( *aParent );
+	    }
+	iFocusControl = NULL;
+	iCommandObserver = aCommandObserver;
+	InitializeControlsL();
+	SetRect( aRect );
+	ActivateL();
+	// [[[ begin generated region: do not modify [Post-ActivateL initializations]
+	// ]]] end generated region [Post-ActivateL initializations]
+	
+	}
+			
+/**
+* Return the number of controls in the container (override)
+* @return count
+*/
+TInt CSymbian_ua_guiContainer::CountComponentControls() const
+	{
+	return ( int ) ELastControl;
+	}
+				
+/**
+* Get the control with the given index (override)
+* @param aIndex Control index [0...n) (limited by #CountComponentControls)
+* @return Pointer to control
+*/
+CCoeControl* CSymbian_ua_guiContainer::ComponentControl( TInt aIndex ) const
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	switch ( aIndex )
+		{
+		case ELabel1:
+			return iLabel1;
+		case EEd_url:
+			return iEd_url;
+		case EEd_info:
+			return iEd_info;
+		}
+	// ]]] end generated region [Generated Contents]
+	
+	// handle any user controls here...
+	
+	return NULL;
+	}
+				
+/**
+ *	Handle resizing of the container. This implementation will lay out
+ *  full-sized controls like list boxes for any screen size, and will layout
+ *  labels, editors, etc. to the size they were given in the UI designer.
+ *  This code will need to be modified to adjust arbitrary controls to
+ *  any screen size.
+ */				
+void CSymbian_ua_guiContainer::SizeChanged()
+	{
+	CCoeControl::SizeChanged();
+	LayoutControls();
+	// [[[ begin generated region: do not modify [Generated Contents]
+			
+	// ]]] end generated region [Generated Contents]
+	
+	}
+				
+// [[[ begin generated function: do not modify
+/**
+ * Layout components as specified in the UI Designer
+ */
+void CSymbian_ua_guiContainer::LayoutControls()
+	{
+	iLabel1->SetExtent( TPoint( 2, 23 ), TSize( 32, 28 ) );
+	iEd_url->SetExtent( TPoint( 49, 25 ), TSize( 197, 28 ) );
+	iEd_info->SetExtent( TPoint( 3, 78 ), TSize( 235, 143 ) );
+	}
+// ]]] end generated function
+
+/**
+ *	Handle key events.
+ */				
+TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL( 
+		const TKeyEvent& aKeyEvent, 
+		TEventCode aType )
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	
+	// ]]] end generated region [Generated Contents]
+	
+	if ( iFocusControl != NULL
+		&& iFocusControl->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed )
+		{
+		return EKeyWasConsumed;
+		}
+	return CCoeControl::OfferKeyEventL( aKeyEvent, aType );
+	}
+				
+// [[[ begin generated function: do not modify
+/**
+ *	Initialize each control upon creation.
+ */				
+void CSymbian_ua_guiContainer::InitializeControlsL()
+	{
+	iLabel1 = new ( ELeave ) CEikLabel;
+	iLabel1->SetContainerWindowL( *this );
+		{
+		TResourceReader reader;
+		iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1 );
+		iLabel1->ConstructFromResourceL( reader );
+		CleanupStack::PopAndDestroy(); // reader internal state
+		}
+	iEd_url = new ( ELeave ) CEikEdwin;
+	iEd_url->SetContainerWindowL( *this );
+		{
+		TResourceReader reader;
+		iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL );
+		iEd_url->ConstructFromResourceL( reader );
+		CleanupStack::PopAndDestroy(); // reader internal state
+		}
+		{
+		HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2 );
+		iEd_url->SetTextL( text );
+		CleanupStack::PopAndDestroy( text );
+		}
+	iEd_info = new ( ELeave ) CEikEdwin;
+	iEd_info->SetContainerWindowL( *this );
+		{
+		TResourceReader reader;
+		iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO );
+		iEd_info->ConstructFromResourceL( reader );
+		CleanupStack::PopAndDestroy(); // reader internal state
+		}
+		{
+		HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2 );
+		iEd_info->SetTextL( text );
+		CleanupStack::PopAndDestroy( text );
+		}
+	
+	iEd_url->SetFocus( ETrue );
+	iFocusControl = iEd_url;
+	
+	}
+// ]]] end generated function
+
+/** 
+ * Handle global resource changes, such as scalable UI or skin events (override)
+ */
+void CSymbian_ua_guiContainer::HandleResourceChange( TInt aType )
+	{
+	CCoeControl::HandleResourceChange( aType );
+	SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiContainerViewId ) )->ClientRect() );
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+	
+	}
+				
+/**
+ *	Draw container contents.
+ */				
+void CSymbian_ua_guiContainer::Draw( const TRect& aRect ) const
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	CWindowGc& gc = SystemGc();
+	gc.Clear( aRect );
+	
+	// ]]] end generated region [Generated Contents]
+	
+	}
+				
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..661c210eac8ada40713cc3b7bbe0defd198b57e5
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp
@@ -0,0 +1,478 @@
+/*
+========================================================================
+ Name        : symbian_ua_guiContainerView.cpp
+ Author      : nanang
+ Copyright   : (c) 2008-2009 Teluu Inc.
+ Description : 
+========================================================================
+*/
+// [[[ begin generated region: do not modify [Generated System Includes]
+#include <aknviewappui.h>
+#include <eikmenub.h>
+#include <avkon.hrh>
+#include <barsread.h>
+#include <stringloader.h>
+#include <eiklabel.h>
+#include <eikenv.h>
+#include <gdi.h>
+#include <eikedwin.h>
+#include <akncontext.h>
+#include <akntitle.h>
+#include <eikbtgpc.h>
+#include <aknnotewrappers.h>
+#include <aknquerydialog.h>
+#include <symbian_ua_gui.rsg>
+// ]]] end generated region [Generated System Includes]
+
+// [[[ begin generated region: do not modify [Generated User Includes]
+#include "symbian_ua_gui.hrh"
+#include "symbian_ua_guiContainerView.h"
+#include "symbian_ua_guiContainer.hrh"
+#include "symbian_ua_guiSettingItemList.hrh"
+#include "symbian_ua_guiContainer.h"
+// ]]] end generated region [Generated User Includes]
+
+#include <utf.h>
+#include "symbian_ua.h"
+
+// [[[ begin generated region: do not modify [Generated Constants]
+// ]]] end generated region [Generated Constants]
+
+Csymbian_ua_guiContainerView *myinstance = NULL;
+_LIT(KStCall, "Call");
+_LIT(KStHangUp, "Hang Up");
+
+void on_info(const wchar_t* buf)
+{
+	TPtrC aBuf((const TUint16*)buf);
+	
+	if (myinstance)
+		myinstance->PutMessage(aBuf);
+}
+
+void on_incoming_call(const wchar_t* caller_disp, const wchar_t* caller_uri)
+{
+	TBuf<512> buf;
+	TPtrC aDisp((const TUint16*)caller_disp);
+	TPtrC aUri((const TUint16*)caller_uri);
+	_LIT(KFormat, "Incoming call from %S, accept?");
+	
+	buf.Format(KFormat, &aDisp);
+	if (Csymbian_ua_guiContainerView::RunQry_accept_callL(&buf) == EAknSoftkeyYes)
+	{
+		CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
+		if (cba != NULL) {
+			TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp));
+			cba->DrawDeferred();
+		}
+		symbian_ua_answercall();
+	} else {
+		symbian_ua_endcall();	
+	}
+}
+
+void on_call_end(const wchar_t* reason)
+{
+	TPtrC aReason((const TUint16*)reason);
+	
+	CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
+	if (cba != NULL) {
+		TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall));
+		cba->DrawDeferred();
+	}
+	
+	Csymbian_ua_guiContainerView::RunNote_infoL(&aReason);
+}
+
+void on_reg_state(bool success)
+{
+	if (success)
+		Csymbian_ua_guiContainerView::RunNote_infoL();
+	else
+		Csymbian_ua_guiContainerView::RunNote_warningL();
+}
+
+void on_unreg_state(bool success)
+{
+	TPtrC st_success(_L("Unregistration Success!"));
+	TPtrC st_failed(_L("Unregistration Failed!"));
+	
+	if (success)
+		Csymbian_ua_guiContainerView::RunNote_infoL(&st_success);
+	else
+		Csymbian_ua_guiContainerView::RunNote_warningL(&st_failed);
+}
+
+void Csymbian_ua_guiContainerView::PutMessage(const TDesC &msg)
+	{
+	if (!iSymbian_ua_guiContainer)
+		return;
+	
+	CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_info);
+
+	obj_info->SetTextL(&msg);
+	obj_info->DrawDeferred();
+	}
+
+/**
+ * First phase of Symbian two-phase construction. Should not contain any
+ * code that could leave.
+ */
+Csymbian_ua_guiContainerView::Csymbian_ua_guiContainerView()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	iSymbian_ua_guiContainer = NULL;
+	// ]]] end generated region [Generated Contents]
+	
+	}
+/** 
+ * The view's destructor removes the container from the control
+ * stack and destroys it.
+ */
+Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	delete iSymbian_ua_guiContainer;
+	iSymbian_ua_guiContainer = NULL;
+	// ]]] end generated region [Generated Contents]
+	
+	symbian_ua_set_info_callback(NULL);
+	myinstance = NULL;
+	}
+
+/**
+ * Symbian two-phase constructor.
+ * This creates an instance then calls the second-phase constructor
+ * without leaving the instance on the cleanup stack.
+ * @return new instance of Csymbian_ua_guiContainerView
+ */
+Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL()
+	{
+	Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/**
+ * Symbian two-phase constructor.
+ * This creates an instance, pushes it on the cleanup stack,
+ * then calls the second-phase constructor.
+ * @return new instance of Csymbian_ua_guiContainerView
+ */
+Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewLC()
+	{
+	Csymbian_ua_guiContainerView* self = new ( ELeave ) Csymbian_ua_guiContainerView();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	return self;
+	}
+
+
+/**
+ * Second-phase constructor for view.  
+ * Initialize contents from resource.
+ */ 
+void Csymbian_ua_guiContainerView::ConstructL()
+	{
+	// [[[ begin generated region: do not modify [Generated Code]
+	BaseConstructL( R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW );
+	// ]]] end generated region [Generated Code]
+	
+	// add your own initialization code here
+	symbian_ua_info_cb_t cb;
+	Mem::FillZ(&cb, sizeof(cb));
+
+	cb.on_info = &on_info;
+	cb.on_incoming_call = &on_incoming_call;
+	cb.on_reg_state = &on_reg_state;
+	cb.on_unreg_state = &on_unreg_state;
+	cb.on_call_end = &on_call_end;
+	
+	symbian_ua_set_info_callback(&cb);
+	myinstance = this;
+	}
+	
+/**
+ * @return The UID for this view
+ */
+TUid Csymbian_ua_guiContainerView::Id() const
+	{
+	return TUid::Uid( ESymbian_ua_guiContainerViewId );
+	}
+
+/**
+ * Handle a command for this view (override)
+ * @param aCommand command id to be handled
+ */
+void Csymbian_ua_guiContainerView::HandleCommandL( TInt aCommand )
+	{   
+	// [[[ begin generated region: do not modify [Generated Code]
+	TBool commandHandled = EFalse;
+	switch ( aCommand )
+		{	// code to dispatch to the AknView's menu and CBA commands is generated here
+	
+		case ESymbian_ua_guiContainerViewControlPaneRightId:
+			commandHandled = CallSoftKeyPressedL( aCommand );
+			break;
+		case ESymbian_ua_guiContainerViewSettingMenuItemCommand:
+			commandHandled = HandleSettingMenuItemSelectedL( aCommand );
+			break;
+		default:
+			break;
+		}
+	
+		
+	if ( !commandHandled ) 
+		{
+	
+		if ( aCommand == ESymbian_ua_guiContainerViewControlPaneRightId )
+			{
+			AppUi()->HandleCommandL( EEikCmdExit );
+			}
+	
+		}
+	// ]]] end generated region [Generated Code]
+	
+	}
+
+/**
+ *	Handles user actions during activation of the view, 
+ *	such as initializing the content.
+ */
+void Csymbian_ua_guiContainerView::DoActivateL(
+		const TVwsViewId& /*aPrevViewId*/,
+		TUid /*aCustomMessageId*/,
+		const TDesC8& /*aCustomMessage*/ )
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	SetupStatusPaneL();
+	
+	CEikButtonGroupContainer* cba = AppUi()->Cba();
+	if ( cba != NULL ) 
+		{
+		cba->MakeVisible( EFalse );
+		}
+	
+	if ( iSymbian_ua_guiContainer == NULL )
+		{
+		iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL( ClientRect(), NULL, this );
+		iSymbian_ua_guiContainer->SetMopParent( this );
+		AppUi()->AddToStackL( *this, iSymbian_ua_guiContainer );
+		} 
+	// ]]] end generated region [Generated Contents]
+	
+	cba = CEikButtonGroupContainer::Current();
+	if (cba != NULL) {
+		if (symbian_ua_anycall())
+			cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp);
+		else
+			cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall);
+	}
+	
+	}
+
+/**
+ */
+void Csymbian_ua_guiContainerView::DoDeactivate()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	CleanupStatusPane();
+	
+	CEikButtonGroupContainer* cba = AppUi()->Cba();
+	if ( cba != NULL ) 
+		{
+		cba->MakeVisible( ETrue );
+		cba->DrawDeferred();
+		}
+	
+	if ( iSymbian_ua_guiContainer != NULL )
+		{
+		AppUi()->RemoveFromViewStack( *this, iSymbian_ua_guiContainer );
+		delete iSymbian_ua_guiContainer;
+		iSymbian_ua_guiContainer = NULL;
+		}
+	// ]]] end generated region [Generated Contents]
+	
+	}
+
+// [[[ begin generated function: do not modify
+void Csymbian_ua_guiContainerView::SetupStatusPaneL()
+	{
+	// reset the context pane
+	TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
+	CEikStatusPaneBase::TPaneCapabilities subPaneContext = 
+		StatusPane()->PaneCapabilities( contextPaneUid );
+	if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
+		{
+		CAknContextPane* context = static_cast< CAknContextPane* > ( 
+			StatusPane()->ControlL( contextPaneUid ) );
+		context->SetPictureToDefaultL();
+		}
+	
+	// setup the title pane
+	TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
+	CEikStatusPaneBase::TPaneCapabilities subPaneTitle = 
+		StatusPane()->PaneCapabilities( titlePaneUid );
+	if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
+		{
+		CAknTitlePane* title = static_cast< CAknTitlePane* >( 
+			StatusPane()->ControlL( titlePaneUid ) );
+		TResourceReader reader;
+		iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE );
+		title->SetFromResourceL( reader );
+		CleanupStack::PopAndDestroy(); // reader internal state
+		}
+				
+	}
+// ]]] end generated function
+
+// [[[ begin generated function: do not modify
+void Csymbian_ua_guiContainerView::CleanupStatusPane()
+	{
+	}
+// ]]] end generated function
+
+/** 
+ * Handle status pane size change for this view (override)
+ */
+void Csymbian_ua_guiContainerView::HandleStatusPaneSizeChange()
+	{
+	CAknView::HandleStatusPaneSizeChange();
+	
+	// this may fail, but we're not able to propagate exceptions here
+	TInt result;
+	TRAP( result, SetupStatusPaneL() ); 
+	}
+	
+/** 
+ * Handle the rightSoftKeyPressed event.
+ * @return ETrue if the command was handled, EFalse if not
+ */
+TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL( TInt aCommand )
+	{
+	CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_url);
+	CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
+	
+	if (symbian_ua_anycall()) {
+		symbian_ua_endcall();
+		return ETrue;
+	}
+
+	PutMessage(_L("Making call..."));
+	if ( cba != NULL ) {
+		cba->SetCommandL(aCommand, KStHangUp);
+		cba->DrawDeferred();
+	}
+	
+
+	TUint8 url[256];
+	TPtr8 aUrl(url, 256);
+
+	HBufC *buf = obj_url->GetTextInHBufL();
+	CnvUtfConverter::ConvertFromUnicodeToUtf8(aUrl, *buf);
+	delete buf;
+
+	if (symbian_ua_makecall((char *)aUrl.PtrZ()) != 0) {
+		PutMessage(_L("Making call failed!"));
+		if ( cba != NULL ) {
+			cba->SetCommandL(aCommand, KStCall);
+			cba->DrawDeferred();
+		}
+	}
+	
+	return ETrue;
+	}
+				
+/** 
+ * Handle the selected event.
+ * @param aCommand the command id invoked
+ * @return ETrue if the command was handled, EFalse if not
+ */
+TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL( TInt aCommand )
+	{
+	AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiSettingItemListViewId));
+	return ETrue;
+	}
+				
+// [[[ begin generated function: do not modify
+/**
+ * Show the popup note for note_error
+ * @param aOverrideText optional override text
+ */
+void Csymbian_ua_guiContainerView::RunNote_errorL( const TDesC* aOverrideText )
+	{
+	CAknErrorNote* note = new ( ELeave ) CAknErrorNote();
+	if ( aOverrideText == NULL )
+		{
+		HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR );
+		note->ExecuteLD( *noteText );
+		CleanupStack::PopAndDestroy( noteText );
+		}
+	else
+		{
+		note->ExecuteLD( *aOverrideText );
+		}
+	}
+// ]]] end generated function
+
+// [[[ begin generated function: do not modify
+/**
+ * Show the popup note for note_info
+ * @param aOverrideText optional override text
+ */
+void Csymbian_ua_guiContainerView::RunNote_infoL( const TDesC* aOverrideText )
+	{
+	CAknInformationNote* note = new ( ELeave ) CAknInformationNote();
+	if ( aOverrideText == NULL )
+		{
+		HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO );
+		note->ExecuteLD( *noteText );
+		CleanupStack::PopAndDestroy( noteText );
+		}
+	else
+		{
+		note->ExecuteLD( *aOverrideText );
+		}
+	}
+// ]]] end generated function
+
+// [[[ begin generated function: do not modify
+/**
+ * Show the popup note for note_warning
+ * @param aOverrideText optional override text
+ */
+void Csymbian_ua_guiContainerView::RunNote_warningL( const TDesC* aOverrideText )
+	{
+	CAknWarningNote* note = new ( ELeave ) CAknWarningNote();
+	if ( aOverrideText == NULL )
+		{
+		HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING );
+		note->ExecuteLD( *noteText );
+		CleanupStack::PopAndDestroy( noteText );
+		}
+	else
+		{
+		note->ExecuteLD( *aOverrideText );
+		}
+	}
+// ]]] end generated function
+
+// [[[ begin generated function: do not modify
+/**
+ * Show the popup dialog for qry_accept_call
+ * @param aOverrideText optional override text
+ * @return EAknSoftkeyYes (left soft key id) or 0
+ */
+TInt Csymbian_ua_guiContainerView::RunQry_accept_callL( const TDesC* aOverrideText )
+	{
+				
+	CAknQueryDialog* queryDialog = CAknQueryDialog::NewL();	
+	
+	if ( aOverrideText != NULL )
+		{
+		queryDialog->SetPromptL( *aOverrideText );
+		}
+	return queryDialog->ExecuteLD( R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL );
+	}
+// ]]] end generated function
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp
similarity index 64%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp
index 209c9ebcec9f9a653241e1340be8fb8b382c2949..8eb54f8d74fed49b685ad511827c23256e1d61f4 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp
@@ -3,7 +3,7 @@
  Name        : symbian_ua_guiDocument.cpp
  Author      : nanang
  Copyright   : (c) 2008-2009 Teluu Inc.
- Description :
+ Description : 
 ========================================================================
 */
 // [[[ begin generated region: do not modify [Generated User Includes]
@@ -15,19 +15,19 @@
  * @brief Constructs the document class for the application.
  * @param anApplication the application instance
  */
-Csymbian_ua_guiDocument::Csymbian_ua_guiDocument (CEikApplication& anApplication)
-        : CAknDocument (anApplication)
-{
-}
+Csymbian_ua_guiDocument::Csymbian_ua_guiDocument( CEikApplication& anApplication )
+	: CAknDocument( anApplication )
+	{
+	}
 
 /**
- * @brief Completes the second phase of Symbian object construction.
- * Put initialization code that could leave here.
- */
+ * @brief Completes the second phase of Symbian object construction. 
+ * Put initialization code that could leave here.  
+ */ 
 void Csymbian_ua_guiDocument::ConstructL()
-{
-}
-
+	{
+	}
+	
 /**
  * Symbian OS two-phase constructor.
  *
@@ -37,21 +37,21 @@ void Csymbian_ua_guiDocument::ConstructL()
  * @param aApp the application instance
  * @return the new Csymbian_ua_guiDocument
  */
-Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL (CEikApplication& aApp)
-{
-    Csymbian_ua_guiDocument* self = new (ELeave) Csymbian_ua_guiDocument (aApp);
-    CleanupStack::PushL (self);
-    self->ConstructL();
-    CleanupStack::Pop (self);
-    return self;
-}
+Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL( CEikApplication& aApp )
+	{
+	Csymbian_ua_guiDocument* self = new ( ELeave ) Csymbian_ua_guiDocument( aApp );
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
 
 /**
  * @brief Creates the application UI object for this document.
  * @return the new instance
- */
+ */	
 CEikAppUi* Csymbian_ua_guiDocument::CreateAppUiL()
-{
-    return new (ELeave) Csymbian_ua_guiAppUi;
-}
-
+	{
+	return new ( ELeave ) Csymbian_ua_guiAppUi;
+	}
+				
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..27f3d6e5ce3c2793c376ae827d531342cea8e787
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp
@@ -0,0 +1,423 @@
+/*
+========================================================================
+ Name        : symbian_ua_guiSettingItemList.cpp
+ Author      : nanang
+ Copyright   : (c) 2008-2009 Teluu Inc.
+ Description : 
+========================================================================
+*/
+
+// [[[ begin generated region: do not modify [Generated System Includes]
+#include <avkon.hrh>
+#include <avkon.rsg>
+#include <eikmenup.h>
+#include <aknappui.h>
+#include <eikcmobs.h>
+#include <barsread.h>
+#include <stringloader.h>
+#include <gdi.h>
+#include <eikedwin.h>
+#include <eikenv.h>
+#include <eikseced.h>
+#include <aknpopupfieldtext.h>
+#include <eikappui.h>
+#include <aknviewappui.h>
+#include <akntextsettingpage.h> 
+#include <symbian_ua_gui.rsg>
+// ]]] end generated region [Generated System Includes]
+
+// [[[ begin generated region: do not modify [Generated User Includes]
+#include "symbian_ua_guiSettingItemList.h"
+#include "Symbian_ua_guiSettingItemListSettings.h"
+#include "symbian_ua_guiSettingItemList.hrh"
+#include "symbian_ua_gui.hrh"
+#include "symbian_ua_guiSettingItemListView.h"
+// ]]] end generated region [Generated User Includes]
+
+
+#include <s32stor.h>
+#include <s32file.h>
+
+
+// [[[ begin generated region: do not modify [Generated Constants]
+// ]]] end generated region [Generated Constants]
+
+
+_LIT(KtxDicFileName			,"settings.ini" );
+ 
+const TInt KRegistrar		= 2;
+const TInt KUsername		= 3;
+const TInt KPassword		= 4;
+const TInt KStunServer		= 5;
+const TInt KSrtp			= 6;
+const TInt KIce				= 7;
+
+/**
+ * Construct the CSymbian_ua_guiSettingItemList instance
+ * @param aCommandObserver command observer
+ */ 
+CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList( 
+		TSymbian_ua_guiSettingItemListSettings& aSettings, 
+		MEikCommandObserver* aCommandObserver )
+	: iSettings( aSettings ), iCommandObserver( aCommandObserver )
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+	
+	}
+/** 
+ * Destroy any instance variables
+ */
+CSymbian_ua_guiSettingItemList::~CSymbian_ua_guiSettingItemList()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+	
+	}
+
+/**
+ * Handle system notification that the container's size has changed.
+ */
+void CSymbian_ua_guiSettingItemList::SizeChanged()
+	{
+	if ( ListBox() ) 
+		{
+		ListBox()->SetRect( Rect() );
+		}
+	}
+
+/**
+ * Create one setting item at a time, identified by id.
+ * CAknSettingItemList calls this method and takes ownership
+ * of the returned value.  The CAknSettingItem object owns
+ * a reference to the underlying data, which EditItemL() uses
+ * to edit and store the value.
+ */
+CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL( TInt aId )
+	{
+	switch ( aId )
+		{
+	// [[[ begin generated region: do not modify [Initializers]
+		case ESymbian_ua_guiSettingItemListViewEd_registrar:
+			{			
+			CAknTextSettingItem* item = new ( ELeave ) 
+				CAknTextSettingItem( 
+					aId,
+					iSettings.Ed_registrar() );
+			item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
+			return item;
+			}
+		case ESymbian_ua_guiSettingItemListViewEd_user:
+			{			
+			CAknTextSettingItem* item = new ( ELeave ) 
+				CAknTextSettingItem( 
+					aId,
+					iSettings.Ed_user() );
+			item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
+			return item;
+			}
+		case ESymbian_ua_guiSettingItemListViewEd_password:
+			{			
+			CAknPasswordSettingItem* item = new ( ELeave ) 
+				CAknPasswordSettingItem( 
+					aId,
+					CAknPasswordSettingItem::EAlpha,
+					iSettings.Ed_password() );
+			item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
+			return item;
+			}
+		case ESymbian_ua_guiSettingItemListViewB_srtp:
+			{			
+			CAknBinaryPopupSettingItem* item = new ( ELeave ) 
+				CAknBinaryPopupSettingItem( 
+					aId,
+					iSettings.B_srtp() );
+			item->SetHidden( ETrue ); 
+			return item;
+			}
+		case ESymbian_ua_guiSettingItemListViewB_ice:
+			{			
+			CAknBinaryPopupSettingItem* item = new ( ELeave ) 
+				CAknBinaryPopupSettingItem( 
+					aId,
+					iSettings.B_ice() );
+			item->SetHidden( ETrue ); 
+			return item;
+			}
+		case ESymbian_ua_guiSettingItemListViewEd_stun_server:
+			{			
+			CAknTextSettingItem* item = new ( ELeave ) 
+				CAknTextSettingItem( 
+					aId,
+					iSettings.Ed_stun_server() );
+			item->SetHidden( ETrue ); 
+			return item;
+			}
+	// ]]] end generated region [Initializers]
+	
+		}
+		
+	return NULL;
+	}
+	
+/**
+ * Edit the setting item identified by the given id and store
+ * the changes into the store.
+ * @param aIndex the index of the setting item in SettingItemArray()
+ * @param aCalledFromMenu true: a menu item invoked editing, thus
+ *	always show the edit page and interactively edit the item;
+ *	false: change the item in place if possible, else show the edit page
+ */
+void CSymbian_ua_guiSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu )
+	{
+	CAknSettingItem* item = ( *SettingItemArray() )[aIndex];
+	switch ( item->Identifier() )
+		{
+	// [[[ begin generated region: do not modify [Editing Started Invoker]
+	// ]]] end generated region [Editing Started Invoker]
+	
+		}
+	
+	CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );
+	
+	TBool storeValue = ETrue;
+	switch ( item->Identifier() )
+		{
+	// [[[ begin generated region: do not modify [Editing Stopped Invoker]
+	// ]]] end generated region [Editing Stopped Invoker]
+	
+		}
+		
+	if ( storeValue )
+		{
+		item->StoreL();
+		SaveSettingValuesL();
+		}	
+	}
+/**
+ *	Handle the "Change" option on the Options menu.  This is an
+ *	alternative to the Selection key that forces the settings page
+ *	to come up rather than changing the value in place (if possible).
+ */
+void CSymbian_ua_guiSettingItemList::ChangeSelectedItemL()
+	{
+	if ( ListBox()->CurrentItemIndex() >= 0 )
+		{
+		EditItemL( ListBox()->CurrentItemIndex(), ETrue );
+		}
+	}
+
+/**
+ *	Load the initial contents of the setting items.  By default,
+ *	the setting items are populated with the default values from
+ * 	the design.  You can override those values here.
+ *	<p>
+ *	Note: this call alone does not update the UI.  
+ *	LoadSettingsL() must be called afterwards.
+ */
+void CSymbian_ua_guiSettingItemList::LoadSettingValuesL()
+	{
+	// load values into iSettings
+
+	TFileName path;
+	TFileName pathWithoutDrive;
+	CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive );
+
+	// Extract drive letter into appDrive:
+#ifdef __WINS__
+	path.Copy( _L("c:") );
+#else
+	RProcess process;
+	path.Copy( process.FileName().Left(2) );
+#endif
+
+	path.Append( pathWithoutDrive );
+	path.Append( KtxDicFileName );
+	
+	TFindFile AufFolder(CCoeEnv::Static()->FsSession());
+	if(KErrNone == AufFolder.FindByDir(path, KNullDesC))
+	{
+		CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid(1));
+		TUid FileUid;
+		
+		FileUid.iUid = KRegistrar;
+		if(MyDStore->IsPresentL(FileUid))
+		{
+			RDictionaryReadStream in;
+			in.OpenLC(*MyDStore,FileUid);
+			in >> iSettings.Ed_registrar();
+			CleanupStack::PopAndDestroy(1);// in
+		}
+			
+		FileUid.iUid = KUsername;
+		if(MyDStore->IsPresentL(FileUid))
+		{
+			RDictionaryReadStream in;
+			in.OpenLC(*MyDStore,FileUid);
+			in >> iSettings.Ed_user();
+			CleanupStack::PopAndDestroy(1);// in
+		}
+
+		FileUid.iUid = KPassword;
+		if(MyDStore->IsPresentL(FileUid))
+		{
+			RDictionaryReadStream in;
+			in.OpenLC(*MyDStore,FileUid);
+			in >> iSettings.Ed_password();
+			CleanupStack::PopAndDestroy(1);// in
+		}
+
+		FileUid.iUid = KStunServer;
+		if(MyDStore->IsPresentL(FileUid))
+		{
+			RDictionaryReadStream in;
+			in.OpenLC(*MyDStore,FileUid);
+			in >> iSettings.Ed_stun_server();
+			CleanupStack::PopAndDestroy(1);// in
+		}
+
+		FileUid.iUid = KSrtp;
+		if(MyDStore->IsPresentL(FileUid))
+		{
+			RDictionaryReadStream in;
+			in.OpenLC(*MyDStore,FileUid);
+			iSettings.SetB_srtp((TBool)in.ReadInt32L());
+			CleanupStack::PopAndDestroy(1);// in
+		}
+		
+		FileUid.iUid = KIce;
+		if(MyDStore->IsPresentL(FileUid))
+		{
+			RDictionaryReadStream in;
+			in.OpenLC(*MyDStore,FileUid);
+			iSettings.SetB_ice((TBool)in.ReadInt32L());
+			CleanupStack::PopAndDestroy(1);// in
+		}
+
+		CleanupStack::PopAndDestroy(1);// Store		
+	}
+
+	}
+	
+/**
+ *	Save the contents of the setting items.  Note, this is called
+ *	whenever an item is changed and stored to the model, so it
+ *	may be called multiple times or not at all.
+ */
+void CSymbian_ua_guiSettingItemList::SaveSettingValuesL()
+	{
+	// store values from iSettings
+
+	TFileName path;
+	TFileName pathWithoutDrive;
+	CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive );
+
+	// Extract drive letter into appDrive:
+#ifdef __WINS__
+	path.Copy( _L("c:") );
+#else
+	RProcess process;
+	path.Copy( process.FileName().Left(2) );
+	
+	if(path.Compare(_L("c")) || path.Compare(_L("C")))
+		CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC);
+	else if(path.Compare(_L("e")) || path.Compare(_L("E")))
+		CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE);	
+#endif
+
+	path.Append( pathWithoutDrive );
+	path.Append( KtxDicFileName );
+	
+	TFindFile AufFolder(CCoeEnv::Static()->FsSession());
+	if(KErrNone == AufFolder.FindByDir(path, KNullDesC))
+	{
+		User::LeaveIfError(CCoeEnv::Static()->FsSession().Delete(AufFolder.File()));
+	}
+ 
+	CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),path, TUid::Uid(1));
+ 
+	TUid FileUid = {0x0};
+		
+	FileUid.iUid = KRegistrar;
+	RDictionaryWriteStream out1;
+	out1.AssignLC(*MyDStore,FileUid);
+	out1 << iSettings.Ed_registrar();
+	out1.CommitL(); 	
+	CleanupStack::PopAndDestroy(1);// out2	
+	
+	FileUid.iUid = KUsername;
+	RDictionaryWriteStream out2;
+	out2.AssignLC(*MyDStore,FileUid);
+	out2 << iSettings.Ed_user();
+	out2.CommitL(); 	
+	CleanupStack::PopAndDestroy(1);// out2	
+	
+	FileUid.iUid = KPassword;
+	RDictionaryWriteStream out3;
+	out3.AssignLC(*MyDStore,FileUid);
+	out3 << iSettings.Ed_password();
+	out3.CommitL(); 	
+	CleanupStack::PopAndDestroy(1);// out2	
+	
+	FileUid.iUid = KStunServer;
+	RDictionaryWriteStream out4;
+	out4.AssignLC(*MyDStore,FileUid);
+	out4 << iSettings.Ed_stun_server();
+	out4.CommitL(); 	
+	CleanupStack::PopAndDestroy(1);// out2	
+	
+	FileUid.iUid = KSrtp;
+	RDictionaryWriteStream out5;
+	out5.AssignLC(*MyDStore,FileUid);
+	out5.WriteInt32L(iSettings.B_srtp());
+	out5.CommitL(); 	
+	CleanupStack::PopAndDestroy(1);// out1
+	
+	FileUid.iUid = KIce;
+	RDictionaryWriteStream out6;
+	out6.AssignLC(*MyDStore,FileUid);
+	out6.WriteInt32L(iSettings.B_ice());
+	out6.CommitL(); 	
+	CleanupStack::PopAndDestroy(1);// out1
+	 
+	MyDStore->CommitL();
+	CleanupStack::PopAndDestroy(1);// Store
+
+	}
+
+
+/** 
+ * Handle global resource changes, such as scalable UI or skin events (override)
+ */
+void CSymbian_ua_guiSettingItemList::HandleResourceChange( TInt aType )
+	{
+	CAknSettingItemList::HandleResourceChange( aType );
+	SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiSettingItemListViewId ) )->ClientRect() );
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+	
+	}
+				
+/** 
+ * Handle key event (override)
+ * @param aKeyEvent key event
+ * @param aType event code
+ * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed
+ */
+TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL( 
+		const TKeyEvent& aKeyEvent, 
+		TEventCode aType )
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+	
+	if ( aKeyEvent.iCode == EKeyLeftArrow 
+		|| aKeyEvent.iCode == EKeyRightArrow )
+		{
+		// allow the tab control to get the arrow keys
+		return EKeyWasNotConsumed;
+		}
+	
+	return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType );
+	}
+				
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..243ff994c57092b657a7f86bcee643b8393be22e
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp
@@ -0,0 +1,285 @@
+/*
+========================================================================
+ Name        : symbian_ua_guiSettingItemListView.cpp
+ Author      : nanang
+ Copyright   : (c) 2008-2009 Teluu Inc.
+ Description : 
+========================================================================
+*/
+// [[[ begin generated region: do not modify [Generated System Includes]
+#include <aknviewappui.h>
+#include <eikmenub.h>
+#include <avkon.hrh>
+#include <akncontext.h>
+#include <akntitle.h>
+#include <stringloader.h>
+#include <barsread.h>
+#include <eikbtgpc.h>
+#include <symbian_ua_gui.rsg>
+// ]]] end generated region [Generated System Includes]
+
+// [[[ begin generated region: do not modify [Generated User Includes]
+#include "symbian_ua_gui.hrh"
+#include "symbian_ua_guiSettingItemListView.h"
+#include "symbian_ua_guiContainer.hrh"
+#include "symbian_ua_guiSettingItemList.hrh"
+#include "symbian_ua_guiSettingItemList.h"
+// ]]] end generated region [Generated User Includes]
+
+#include "symbian_ua.h"
+
+// [[[ begin generated region: do not modify [Generated Constants]
+// ]]] end generated region [Generated Constants]
+
+/**
+ * First phase of Symbian two-phase construction. Should not contain any
+ * code that could leave.
+ */
+Csymbian_ua_guiSettingItemListView::Csymbian_ua_guiSettingItemListView()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+	
+	}
+/** 
+ * The view's destructor removes the container from the control
+ * stack and destroys it.
+ */
+Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	// ]]] end generated region [Generated Contents]
+	
+	}
+
+/**
+ * Symbian two-phase constructor.
+ * This creates an instance then calls the second-phase constructor
+ * without leaving the instance on the cleanup stack.
+ * @return new instance of Csymbian_ua_guiSettingItemListView
+ */
+Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL()
+	{
+	Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/**
+ * Symbian two-phase constructor.
+ * This creates an instance, pushes it on the cleanup stack,
+ * then calls the second-phase constructor.
+ * @return new instance of Csymbian_ua_guiSettingItemListView
+ */
+Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewLC()
+	{
+	Csymbian_ua_guiSettingItemListView* self = new ( ELeave ) Csymbian_ua_guiSettingItemListView();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	return self;
+	}
+
+
+/**
+ * Second-phase constructor for view.  
+ * Initialize contents from resource.
+ */ 
+void Csymbian_ua_guiSettingItemListView::ConstructL()
+	{
+	// [[[ begin generated region: do not modify [Generated Code]
+	BaseConstructL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW );
+	// ]]] end generated region [Generated Code]
+	
+	// add your own initialization code here
+	}
+	
+/**
+ * @return The UID for this view
+ */
+TUid Csymbian_ua_guiSettingItemListView::Id() const
+	{
+	return TUid::Uid( ESymbian_ua_guiSettingItemListViewId );
+	}
+
+/**
+ * Handle a command for this view (override)
+ * @param aCommand command id to be handled
+ */
+void Csymbian_ua_guiSettingItemListView::HandleCommandL( TInt aCommand )
+	{   
+	// [[[ begin generated region: do not modify [Generated Code]
+	TBool commandHandled = EFalse;
+	switch ( aCommand )
+		{	// code to dispatch to the AknView's menu and CBA commands is generated here
+	
+		case EAknSoftkeySave:
+			commandHandled = HandleControlPaneRightSoftKeyPressedL( aCommand );
+			break;
+		case ESymbian_ua_guiSettingItemListViewMenuItem1Command:
+			commandHandled = HandleChangeSelectedSettingItemL( aCommand );
+			break;
+		default:
+			break;
+		}
+	
+		
+	if ( !commandHandled ) 
+		{
+	
+		}
+	// ]]] end generated region [Generated Code]
+	
+	}
+
+/**
+ *	Handles user actions during activation of the view, 
+ *	such as initializing the content.
+ */
+void Csymbian_ua_guiSettingItemListView::DoActivateL(
+		const TVwsViewId& /*aPrevViewId*/,
+		TUid /*aCustomMessageId*/,
+		const TDesC8& /*aCustomMessage*/ )
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	SetupStatusPaneL();
+	
+	CEikButtonGroupContainer* cba = AppUi()->Cba();
+	if ( cba != NULL ) 
+		{
+		cba->MakeVisible( EFalse );
+		}
+	
+	if ( iSymbian_ua_guiSettingItemList == NULL )
+		{
+		iSettings = TSymbian_ua_guiSettingItemListSettings::NewL();
+		iSymbian_ua_guiSettingItemList = new ( ELeave ) CSymbian_ua_guiSettingItemList( *iSettings, this );
+		iSymbian_ua_guiSettingItemList->SetMopParent( this );
+		iSymbian_ua_guiSettingItemList->ConstructFromResourceL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST );
+		iSymbian_ua_guiSettingItemList->ActivateL();
+		iSymbian_ua_guiSettingItemList->LoadSettingValuesL();
+		iSymbian_ua_guiSettingItemList->LoadSettingsL();
+		AppUi()->AddToStackL( *this, iSymbian_ua_guiSettingItemList );
+		} 
+	// ]]] end generated region [Generated Contents]
+	
+	}
+
+/**
+ */
+void Csymbian_ua_guiSettingItemListView::DoDeactivate()
+	{
+	// [[[ begin generated region: do not modify [Generated Contents]
+	CleanupStatusPane();
+	
+	CEikButtonGroupContainer* cba = AppUi()->Cba();
+	if ( cba != NULL ) 
+		{
+		cba->MakeVisible( ETrue );
+		cba->DrawDeferred();
+		}
+	
+	if ( iSymbian_ua_guiSettingItemList != NULL )
+		{
+		AppUi()->RemoveFromStack( iSymbian_ua_guiSettingItemList );
+		delete iSymbian_ua_guiSettingItemList;
+		iSymbian_ua_guiSettingItemList = NULL;
+		delete iSettings;
+		iSettings = NULL;
+		}
+	// ]]] end generated region [Generated Contents]
+	
+	}
+
+// [[[ begin generated function: do not modify
+void Csymbian_ua_guiSettingItemListView::SetupStatusPaneL()
+	{
+	// reset the context pane
+	TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
+	CEikStatusPaneBase::TPaneCapabilities subPaneContext = 
+		StatusPane()->PaneCapabilities( contextPaneUid );
+	if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
+		{
+		CAknContextPane* context = static_cast< CAknContextPane* > ( 
+			StatusPane()->ControlL( contextPaneUid ) );
+		context->SetPictureToDefaultL();
+		}
+	
+	// setup the title pane
+	TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
+	CEikStatusPaneBase::TPaneCapabilities subPaneTitle = 
+		StatusPane()->PaneCapabilities( titlePaneUid );
+	if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
+		{
+		CAknTitlePane* title = static_cast< CAknTitlePane* >( 
+			StatusPane()->ControlL( titlePaneUid ) );
+		TResourceReader reader;
+		iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE );
+		title->SetFromResourceL( reader );
+		CleanupStack::PopAndDestroy(); // reader internal state
+		}
+				
+	}
+// ]]] end generated function
+
+// [[[ begin generated function: do not modify
+void Csymbian_ua_guiSettingItemListView::CleanupStatusPane()
+	{
+	}
+// ]]] end generated function
+
+/** 
+ * Handle status pane size change for this view (override)
+ */
+void Csymbian_ua_guiSettingItemListView::HandleStatusPaneSizeChange()
+	{
+	CAknView::HandleStatusPaneSizeChange();
+	
+	// this may fail, but we're not able to propagate exceptions here
+	TInt result;
+	TRAP( result, SetupStatusPaneL() ); 
+	}
+	
+/** 
+ * Handle the selected event.
+ * @param aCommand the command id invoked
+ * @return ETrue if the command was handled, EFalse if not
+ */
+TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL( TInt aCommand )
+	{
+	iSymbian_ua_guiSettingItemList->ChangeSelectedItemL();
+	return ETrue;
+	}
+								
+/** 
+ * Handle the rightSoftKeyPressed event.
+ * @return ETrue if the command was handled, EFalse if not
+ */
+TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL( TInt aCommand )
+	{
+	TUint8 domain[256] = {0};
+	TPtr8 cDomain(domain, sizeof(domain));
+	TUint8 user[64] = {0};
+	TPtr8 cUser(user, sizeof(user));
+	TUint8 pass[64] = {0};
+	TPtr8 cPass(pass, sizeof(pass));
+	
+	cDomain.Copy(iSettings->Ed_registrar());
+	cUser.Copy(iSettings->Ed_user());
+	cPass.Copy(iSettings->Ed_password());
+	symbian_ua_set_account((char*)domain, (char*)user, (char*)pass, false, false);
+	
+	AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId));
+	return ETrue;
+	}
+
+/** 
+ * Handle the selected event.
+ * @param aCommand the command id invoked
+ * @return ETrue if the command was handled, EFalse if not
+ */
+TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL( TInt aCommand )
+	{
+	AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId));
+	return ETrue;
+	}
+				
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiContainer.uidesign b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiContainer.uidesign
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiContainer.uidesign
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiContainer.uidesign
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiSettingItemList.uidesign b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiSettingItemList.uidesign
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiSettingItemList.uidesign
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symbian_ua_gui/symbian_ua_guiSettingItemList.uidesign
diff --git a/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symsndtest/app_main.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symsndtest/app_main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..22b74bb757749db853ae51fe69a07ecff2bea270
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symsndtest/app_main.cpp
@@ -0,0 +1,373 @@
+/* $Id: app_main.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 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/delaybuf.h>
+#include <pjmedia/sound.h>
+#include <pj/errno.h>
+#include <pj/os.h>
+#include <pj/log.h>
+#include <pj/string.h>
+#include <pj/unicode.h>
+#include <e32cons.h>
+
+#define THIS_FILE		"app_main.cpp"
+#define CLOCK_RATE		8000
+#define CHANNEL_COUNT		1
+#define PTIME			20
+#define SAMPLES_PER_FRAME	(CLOCK_RATE*PTIME/1000)
+#define BITS_PER_SAMPLE		16
+
+extern CConsoleBase* console;
+
+static pj_caching_pool cp;
+static pjmedia_snd_stream *strm;
+static unsigned rec_cnt, play_cnt;
+static pj_time_val t_start;
+
+pj_pool_t *pool;
+pjmedia_delay_buf *delaybuf;
+
+/* Logging callback */
+static void log_writer(int level, const char *buf, unsigned len)
+{
+    static 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);
+}
+
+/* perror util */
+static void app_perror(const char *title, pj_status_t status) 
+{
+    char errmsg[PJ_ERR_MSG_SIZE];	
+    pj_strerror(status, errmsg, sizeof(errmsg));
+    PJ_LOG(1,(THIS_FILE, "Error: %s: %s", title, errmsg));
+}
+
+/* Application init */
+static pj_status_t app_init() 
+{
+    unsigned i, count;
+    pj_status_t status;
+   
+    /* Redirect log */
+    pj_log_set_log_func((void (*)(int,const char*,int)) &log_writer);
+    pj_log_set_decor(PJ_LOG_HAS_NEWLINE);
+    pj_log_set_level(3);
+    
+    /* Init pjlib */
+    status = pj_init();
+    if (status != PJ_SUCCESS) {
+    	app_perror("pj_init()", status);
+    	return status;
+    }
+
+    pj_caching_pool_init(&cp, NULL, 0);
+    
+    /* Init sound subsystem */
+    status = pjmedia_snd_init(&cp.factory);
+    if (status != PJ_SUCCESS) {
+    	app_perror("pjmedia_snd_init()", status);
+        pj_caching_pool_destroy(&cp);
+    	pj_shutdown();
+    	return status;
+    }
+    
+    count = pjmedia_snd_get_dev_count();
+    PJ_LOG(3,(THIS_FILE, "Device count: %d", count));
+    for (i=0; i<count; ++i) {
+    	const pjmedia_snd_dev_info *info;
+    	
+    	info = pjmedia_snd_get_dev_info(i);
+    	PJ_LOG(3, (THIS_FILE, "%d: %s %d/%d %dHz",
+    		   i, info->name, info->input_count, info->output_count,
+    		   info->default_samples_per_sec));	
+    }
+
+    /* Create pool */
+    pool = pj_pool_create(&cp.factory, THIS_FILE, 512, 512, NULL);
+    if (pool == NULL) {
+    	app_perror("pj_pool_create()", status);
+        pj_caching_pool_destroy(&cp);
+    	pj_shutdown();
+    	return status;
+    }
+
+    /* Init delay buffer */
+    status = pjmedia_delay_buf_create(pool, THIS_FILE, CLOCK_RATE, 
+				      SAMPLES_PER_FRAME, CHANNEL_COUNT, 
+				      0, 0, &delaybuf);
+    if (status != PJ_SUCCESS) {
+    	app_perror("pjmedia_delay_buf_create()", status);
+        //pj_caching_pool_destroy(&cp);
+    	//pj_shutdown();
+    	//return status;
+    }
+    
+    return PJ_SUCCESS;
+}
+
+
+/* Sound capture callback */
+static pj_status_t rec_cb(void *user_data, 
+			  pj_uint32_t timestamp,
+			  void *input,
+			  unsigned size) 
+{
+    PJ_UNUSED_ARG(user_data);
+    PJ_UNUSED_ARG(timestamp);
+    PJ_UNUSED_ARG(size);
+
+    pjmedia_delay_buf_put(delaybuf, (pj_int16_t*)input);
+
+    if (size != SAMPLES_PER_FRAME*2) {
+		PJ_LOG(3, (THIS_FILE, "Size captured = %u",
+	 		   size));
+    }
+
+    ++rec_cnt;
+    return PJ_SUCCESS;
+}
+
+/* Play cb */
+static pj_status_t play_cb(void *user_data,
+			   pj_uint32_t timestamp,
+			   void *output,
+			   unsigned size) 
+{
+    PJ_UNUSED_ARG(user_data);
+    PJ_UNUSED_ARG(timestamp);
+    PJ_UNUSED_ARG(size);
+    
+    pjmedia_delay_buf_get(delaybuf, (pj_int16_t*)output);
+    
+    ++play_cnt;
+    return PJ_SUCCESS;	
+}
+
+/* Start sound */
+static pj_status_t snd_start(unsigned flag) 
+{
+    pj_status_t status;
+    
+    if (strm != NULL) {
+    	app_perror("snd already open", PJ_EINVALIDOP);
+    	return PJ_EINVALIDOP;
+    }
+    
+    if (flag==PJMEDIA_DIR_CAPTURE_PLAYBACK)
+    	status = pjmedia_snd_open(-1, -1, CLOCK_RATE, CHANNEL_COUNT,
+    				  SAMPLES_PER_FRAME, BITS_PER_SAMPLE,
+    				  &rec_cb, &play_cb, NULL, &strm);
+    else if (flag==PJMEDIA_DIR_CAPTURE)
+    	status = pjmedia_snd_open_rec(-1, CLOCK_RATE, CHANNEL_COUNT,
+    				      SAMPLES_PER_FRAME, BITS_PER_SAMPLE,
+    				      &rec_cb, NULL, &strm);
+    else
+    	status = pjmedia_snd_open_player(-1, CLOCK_RATE, CHANNEL_COUNT,
+    					 SAMPLES_PER_FRAME, BITS_PER_SAMPLE,
+    					 &play_cb, NULL, &strm);
+			 
+    if (status != PJ_SUCCESS) {
+    	app_perror("snd open", status);
+    	return status;
+    }
+
+    rec_cnt = play_cnt = 0;
+    pj_gettimeofday(&t_start);
+
+    pjmedia_delay_buf_reset(delaybuf);
+
+    status = pjmedia_snd_stream_start(strm);
+    if (status != PJ_SUCCESS) {
+    	app_perror("snd start", status);
+    	pjmedia_snd_stream_close(strm);
+    	strm = NULL;
+    	return status;
+    }
+
+    return PJ_SUCCESS;
+}
+
+/* Stop sound */
+static pj_status_t snd_stop() 
+{
+    pj_time_val now;
+    pj_status_t status;
+    
+    if (strm == NULL) {
+    	app_perror("snd not open", PJ_EINVALIDOP);
+    	return PJ_EINVALIDOP;
+    }
+    
+    status = pjmedia_snd_stream_close(strm);
+    strm = NULL;
+    
+    pj_gettimeofday(&now);
+    PJ_TIME_VAL_SUB(now, t_start);
+
+    PJ_LOG(3,(THIS_FILE, "Duration: %d.%03d", now.sec, now.msec));
+    PJ_LOG(3,(THIS_FILE, "Captured: %d", rec_cnt));
+    PJ_LOG(3,(THIS_FILE, "Played: %d", play_cnt));
+
+    return status;
+}
+
+/* Shutdown application */
+static void app_fini() 
+{
+    if (strm)
+    	snd_stop();
+    
+    pjmedia_snd_deinit();
+    pjmedia_delay_buf_destroy(delaybuf);
+    pj_pool_release(pool);
+    pj_caching_pool_destroy(&cp);
+    pj_shutdown();
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+/*
+ * The interractive console UI
+ */
+#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(EPriorityHigh), 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();
+}
+
+static void PrintMenu() 
+{
+    PJ_LOG(3, (THIS_FILE, "\n\n"
+	    "Menu:\n"
+	    "  a    Start bidir sound\n"
+	    "  t    Start recorder\n"
+	    "  p    Start player\n"
+	    "  d    Stop & close sound\n"
+	    "  w    Quit\n"));
+}
+
+// Implementation: called when read has completed.
+void ConsoleUI::RunL() 
+{
+    TKeyCode kc = con_->KeyCode();
+    pj_bool_t reschedule = PJ_TRUE;
+    
+    switch (kc) {
+    case 'w':
+	    asw_->AsyncStop();
+	    reschedule = PJ_FALSE;
+	    break;
+    case 'a':
+    	snd_start(PJMEDIA_DIR_CAPTURE_PLAYBACK);
+	break;
+    case 't':
+    	snd_start(PJMEDIA_DIR_CAPTURE);
+	break;
+    case 'p':
+    	snd_start(PJMEDIA_DIR_PLAYBACK);
+    break;
+    case 'd':
+    	snd_stop();
+	break;
+    default:
+	    PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed",
+		      kc, kc));
+	    break;
+    }
+
+    PrintMenu();
+    
+    if (reschedule)
+	Run();
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+int app_main() 
+{
+    if (app_init() != PJ_SUCCESS)
+        return -1;
+    
+    // Run the UI
+    CActiveSchedulerWait *asw = new CActiveSchedulerWait;
+    ConsoleUI *con = new ConsoleUI(asw, console);
+    
+    con->Run();
+    
+    PrintMenu();
+    asw->Start();
+    
+    delete con;
+    delete asw;
+    
+    app_fini();
+    return 0;
+}
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/main_symbian.cpp b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symsndtest/main_symbian.cpp
similarity index 65%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/main_symbian.cpp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symsndtest/main_symbian.cpp
index 512a0e1767d842ca28613dda7e960d2fceb1d621..e33ff6969f9fedd7f9d8e9807efa281a6536a7fe 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/main_symbian.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symsndtest/main_symbian.cpp
@@ -1,5 +1,5 @@
 /* $Id: main_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
-/*
+/* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  *
@@ -15,7 +15,7 @@
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 
 #include <e32std.h>
@@ -29,38 +29,36 @@
 CConsoleBase* console;
 
 // Needed by APS
-TPtrC APP_UID = _L ("A000000D");
+TPtrC APP_UID = _L("A000000D");
 
 int app_main();
 
 
 ////////////////////////////////////////////////////////////////////////////
-
 class MyTask : public CActive
 {
-
-    public:
-        static MyTask *NewL (CActiveSchedulerWait *asw);
-        ~MyTask();
-        void Start();
-
-    protected:
-        MyTask (CActiveSchedulerWait *asw);
-        void ConstructL();
-        virtual void RunL();
-        virtual void DoCancel();
-
-    private:
-        RTimer timer_;
-        CActiveSchedulerWait *asw_;
+public:
+    static MyTask *NewL(CActiveSchedulerWait *asw);
+    ~MyTask();
+    void Start();
+
+protected:
+    MyTask(CActiveSchedulerWait *asw);
+    void ConstructL();
+    virtual void RunL();
+    virtual void DoCancel();
+
+private:
+    RTimer timer_;
+    CActiveSchedulerWait *asw_;
 };
 
-MyTask::MyTask (CActiveSchedulerWait *asw)
-        : CActive (EPriorityNormal), asw_ (asw)
+MyTask::MyTask(CActiveSchedulerWait *asw)
+: CActive(EPriorityNormal), asw_(asw)
 {
 }
 
-MyTask::~MyTask()
+MyTask::~MyTask() 
 {
     timer_.Close();
 }
@@ -68,23 +66,23 @@ MyTask::~MyTask()
 void MyTask::ConstructL()
 {
     timer_.CreateLocal();
-    CActiveScheduler::Add (this);
+    CActiveScheduler::Add(this);
 }
 
-MyTask *MyTask::NewL (CActiveSchedulerWait *asw)
+MyTask *MyTask::NewL(CActiveSchedulerWait *asw)
 {
-    MyTask *self = new (ELeave) MyTask (asw);
-    CleanupStack::PushL (self);
+    MyTask *self = new (ELeave) MyTask(asw);
+    CleanupStack::PushL(self);
 
     self->ConstructL();
 
-    CleanupStack::Pop (self);
+    CleanupStack::Pop(self);
     return self;
 }
 
 void MyTask::Start()
 {
-    timer_.After (iStatus, 0);
+    timer_.After(iStatus, 0);
     SetActive();
 }
 
@@ -104,24 +102,24 @@ void MyTask::DoCancel()
 LOCAL_C void DoStartL()
 {
     CActiveScheduler *scheduler = new (ELeave) CActiveScheduler;
-    CleanupStack::PushL (scheduler);
-    CActiveScheduler::Install (scheduler);
+    CleanupStack::PushL(scheduler);
+    CActiveScheduler::Install(scheduler);
 
     CActiveSchedulerWait *asw = new CActiveSchedulerWait;
-    CleanupStack::PushL (asw);
-
-    MyTask *task = MyTask::NewL (asw);
+    CleanupStack::PushL(asw);
+    
+    MyTask *task = MyTask::NewL(asw);
     task->Start();
 
     asw->Start();
-
+    
     delete task;
-
-    CleanupStack::Pop (asw);
+    
+    CleanupStack::Pop(asw);
     delete asw;
-
-    CActiveScheduler::Install (NULL);
-    CleanupStack::Pop (scheduler);
+    
+    CActiveScheduler::Install(NULL);
+    CleanupStack::Pop(scheduler);
     delete scheduler;
 }
 
@@ -138,26 +136,22 @@ GLDEF_C TInt E32Main()
     CTrapCleanup* cleanup = CTrapCleanup::New();
 
     // Create output console
-    TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen)));
-
+    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"));
+    TRAPD(startError, DoStartL());
 
+    console->Printf(_L("[press any key to close]\n"));
     console->Getch();
-
+    
     delete console;
-
     delete cleanup;
 
-    CloseSTDLIB();
+    CloseSTDLIB(); 
 
     // Mark end of heap usage, detect memory leaks
     __UHEAP_MARKEND;
-
     return KErrNone;
 }
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/symsndtest_reg.rss b/sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symsndtest/symsndtest_reg.rss
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip-apps/src/symsndtest/symsndtest_reg.rss
rename to sflphone-common/libs/pjproject-1.0.3/pjsip-apps/src/symsndtest/symsndtest_reg.rss
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/Makefile b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/os-auto.mak.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-auto.mak.in
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/os-auto.mak.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-rtems.mak b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/os-rtems.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/os-rtems.mak
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/os-rtems.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip.dsw b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip.dsw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip.dsw
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip.dsw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_core.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_core.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_core.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_core.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_core.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_core.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_core.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_core.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_simple.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_simple.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_simple.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_simple.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_simple.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_simple.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_simple.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_simple.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_ua.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_ua.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_ua.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_ua.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_ua.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_ua.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsip_ua.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsip_ua.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsua_lib.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsua_lib.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsua_lib.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsua_lib.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsua_lib.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsua_lib.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/pjsua_lib.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/pjsua_lib.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/test_pjsip.dsp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/test_pjsip.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/test_pjsip.dsp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/test_pjsip.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/test_pjsip.vcproj b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/test_pjsip.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/test_pjsip.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/test_pjsip.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_core_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsip_core_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_core_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsip_core_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_simple_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsip_simple_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_simple_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsip_simple_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_ua_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsip_ua_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_ua_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsip_ua_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_wince.vcw b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsip_wince.vcw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsip_wince.vcw
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsip_wince.vcw
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsua_lib_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsua_lib_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/pjsua_lib_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/pjsua_lib_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/test_pjsip_wince.vcp b/sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/test_pjsip_wince.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/build/wince-evc4/test_pjsip_wince.vcp
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/build/wince-evc4/test_pjsip_wince.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/PJSUA-TESTING.txt b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/PJSUA-TESTING.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/PJSUA-TESTING.txt
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/PJSUA-TESTING.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/TRANSPORT-PROBLEMS.TXT b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/TRANSPORT-PROBLEMS.TXT
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/TRANSPORT-PROBLEMS.TXT
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/TRANSPORT-PROBLEMS.TXT
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/doxygen.cfg b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/doxygen.cfg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/doxygen.cfg
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/doxygen.cfg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/doxygen.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/doxygen.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/doxygen.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/doxygen.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/footer.html b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/footer.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/footer.html
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/footer.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/header.html b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/header.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/header.html
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/header.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsip-arch.jpg b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/pjsip-arch.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsip-arch.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/pjsip-arch.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsip-perf.jpg b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/pjsip-perf.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsip-perf.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/pjsip-perf.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsua.jpg b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/pjsua.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/pjsua.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/pjsua.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/docs/siprtp.jpg b/sflphone-common/libs/pjproject-1.0.3/pjsip/docs/siprtp.jpg
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/docs/siprtp.jpg
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/docs/siprtp.jpg
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/errno.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/errno.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/errno.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/errno.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/evsub.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/evsub.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/evsub.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/evsub.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/evsub_msg.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/evsub_msg.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/evsub_msg.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/evsub_msg.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/iscomposing.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/iscomposing.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/iscomposing.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/iscomposing.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/pidf.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/pidf.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/pidf.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/pidf.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/presence.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/presence.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/presence.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/presence.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/publish.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/publish.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/publish.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/publish.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/rpid.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/rpid.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/rpid.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/rpid.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/types.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/types.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/xpidf.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/xpidf.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-simple/xpidf.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-simple/xpidf.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_100rel.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_100rel.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_100rel.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_100rel.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_inv.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_inv.h
similarity index 95%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_inv.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_inv.h
index f4066b4fa7a96cf5f598e127c97b27aa8afb1832..532eeb57d24218034c34e5f05d66a2ceb6ec1532 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_inv.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_inv.h
@@ -1,4 +1,4 @@
-/* $Id: sip_inv.h 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: sip_inv.h 2799 2009-06-25 10:58:13Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -653,16 +653,32 @@ PJ_DECL(pj_status_t) pjsip_inv_set_sdp_answer(pjsip_inv_session *inv,
 /**
  * Create a SIP message to initiate invite session termination. Depending on 
  * the state of the session, this function may return CANCEL request, 
- * a non-2xx final response, or a BYE request. If the session has not answered
- * the incoming INVITE, this function creates the non-2xx final response with 
- * the specified status code in st_code and optional status text in st_text.
+ * a non-2xx final response, a BYE request, or even no request. 
+ *
+ * For UAS, if the session has not answered the incoming INVITE, this function
+ * creates the non-2xx final response with the specified status code in 
+ * \a st_code and optional status text in \a st_text. 
+ *
+ * For UAC, if the original INVITE has not been answered with a final 
+ * response, the behavior depends on whether provisional response has been
+ * received. If provisional response has been received, this function will
+ * create CANCEL request. If no provisional response has been received, the
+ * function will not create CANCEL request (the function will return 
+ * PJ_SUCCESS but the \a p_tdata will contain NULL) because we cannot send
+ * CANCEL before receiving provisional response. If then a provisional
+ * response is received, the invite session will send CANCEL automatically.
+ * 
+ * For both UAC and UAS, if the INVITE session has been answered with final
+ * response, a BYE request will be created.
  *
  * @param inv		The invite session.
  * @param st_code	Status code to be used for terminating the session.
  * @param st_text	Optional status text.
- * @param p_tdata	Pointer to receive the message to be created.
+ * @param p_tdata	Pointer to receive the message to be created. Note
+ *			that it's possible to receive NULL here while the
+ *			function returns PJ_SUCCESS, see the description.
  *
- * @return		PJ_SUCCESS if termination message can be created.
+ * @return		PJ_SUCCESS if termination is initiated.
  */
 PJ_DECL(pj_status_t) pjsip_inv_end_session( pjsip_inv_session *inv,
 					    int st_code,
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_regc.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_regc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_regc.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_regc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_replaces.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_replaces.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_replaces.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_replaces.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_xfer.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_xfer.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip-ua/sip_xfer.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip-ua/sip_xfer.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/print_util.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/print_util.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/print_util.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/print_util.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_auth.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_auth.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_aka.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_auth_aka.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_aka.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_auth_aka.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_msg.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_auth_msg.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_msg.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_auth_msg.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_parser.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_auth_parser.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_auth_parser.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_auth_parser.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h.in b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_autoconf.h.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_autoconf.h.in
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_autoconf.h.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_config.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_config.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_config.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_config.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_dialog.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_dialog.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_dialog.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_dialog.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_endpoint.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_endpoint.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_endpoint.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_endpoint.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_errno.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_errno.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_errno.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_errno.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_event.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_event.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_event.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_event.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_module.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_module.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_module.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_module.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_msg.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_msg.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_msg.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_msg.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_parser.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_parser.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_parser.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_parser.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_private.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_private.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_private.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_private.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_resolve.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_resolve.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_resolve.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_resolve.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_tel_uri.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_tel_uri.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_tel_uri.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_tel_uri.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transaction.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transaction.h
similarity index 92%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transaction.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transaction.h
index 98d40f49fa6f63f46bb09fbef7c69b860b9e6591..3c7f1bca4ec5db27d0676b1a8f5a49f21d50a360 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transaction.h
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transaction.h
@@ -1,4 +1,4 @@
-/* $Id: sip_transaction.h 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: sip_transaction.h 2798 2009-06-25 10:48:08Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -311,7 +311,6 @@ PJ_DECL(pj_status_t) pjsip_tsx_create_key( pj_pool_t *pool,
 				           const pjsip_method *method,
 				           const pjsip_rx_data *rdata );
 
-
 /**
  * Force terminate transaction.
  *
@@ -330,10 +329,38 @@ PJ_DECL(pj_status_t) pjsip_tsx_terminate( pjsip_transaction *tsx,
  * This operation normally is used for INVITE transaction only, when
  * the transaction is cancelled before any provisional response has been
  * received.
+ *
+ * @param tsx       The transaction.
+ *
+ * @return          PJ_SUCCESS or the appropriate error code.
  */
 PJ_DECL(pj_status_t) pjsip_tsx_stop_retransmit(pjsip_transaction *tsx);
 
 
+/**
+ * Start a timer to terminate transaction after the specified time
+ * has elapsed. This function is only valid for INVITE transaction,
+ * and only before final response is received for the INVITE transaction.
+ * It is normally called after the UAC has sent CANCEL for this
+ * INVITE transaction. 
+ *
+ * The purpose of this function is to terminate the transaction if UAS 
+ * does not send final response to this INVITE transaction even after 
+ * it sends 200/OK to CANCEL (for example when the UAS complies to RFC
+ * 2543).
+ *
+ * Once this timer is set, the transaction will be terminated either when
+ * a final response is received or the timer expires.
+ *
+ * @param tsx       The transaction.
+ * @param millisec  Timeout value in milliseconds.
+ *
+ * @return          PJ_SUCCESS or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pjsip_tsx_set_timeout(pjsip_transaction *tsx,
+					   unsigned millisec);
+
+
 /**
  * Get the transaction instance in the incoming message. If the message
  * has a corresponding transaction, this function will return non NULL
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_loop.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport_loop.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_loop.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport_loop.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_tcp.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport_tcp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_tcp.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport_tcp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_tls.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport_tls.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_tls.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport_tls.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_udp.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport_udp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_transport_udp.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_transport_udp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_types.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_types.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_ua_layer.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_ua_layer.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_ua_layer.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_ua_layer.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_uri.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_uri.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_uri.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_uri.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_util.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_util.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip/sip_util.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip/sip_util.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_auth.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip_auth.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_auth.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip_auth.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_simple.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip_simple.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_simple.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip_simple.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_ua.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip_ua.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsip_ua.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsip_ua.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsua-lib/pjsua.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsua-lib/pjsua.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsua-lib/pjsua.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsua-lib/pjsua.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsua-lib/pjsua_internal.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsua-lib/pjsua_internal.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/include/pjsua-lib/pjsua_internal.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/include/pjsua-lib/pjsua_internal.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/errno.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/errno.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/errno.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/errno.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/evsub.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/evsub.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/evsub.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/evsub.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/evsub_msg.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/evsub_msg.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/evsub_msg.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/evsub_msg.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/iscomposing.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/iscomposing.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/iscomposing.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/iscomposing.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/pidf.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/pidf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/pidf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/pidf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/presence.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/presence.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/presence.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/presence.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/presence_body.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/presence_body.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/presence_body.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/presence_body.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/publishc.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/publishc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/publishc.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/publishc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/rpid.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/rpid.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/rpid.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/rpid.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/xpidf.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/xpidf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-simple/xpidf.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-simple/xpidf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_100rel.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_100rel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_100rel.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_100rel.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_inv.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_inv.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_inv.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_inv.c
index a676e5addaf67ef52d5a2a8dddb2b547a932fb9d..e7391da47bf3931b198b1f8b6353aab6c818136d 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_inv.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_inv.c
@@ -1,4 +1,4 @@
-/* $Id: sip_inv.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: sip_inv.c 2811 2009-06-25 13:01:06Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -1367,8 +1367,10 @@ PJ_DEF(pj_status_t) pjsip_inv_invite( pjsip_inv_session *inv,
 	const pjmedia_sdp_session *offer;
 
 	status = pjmedia_sdp_neg_get_neg_local(inv->neg, &offer);
-	if (status != PJ_SUCCESS)
+	if (status != PJ_SUCCESS) {
+	    pjsip_tx_data_dec_ref(tdata);
 	    goto on_return;
+	}
 
 	tdata->msg->body = create_sdp_body(tdata->pool, offer);
     }
@@ -1867,12 +1869,13 @@ PJ_DEF(pj_status_t) pjsip_inv_end_session(  pjsip_inv_session *inv,
 	     */
 	    if (inv->invite_tsx->status_code < 100) {
 
-		pjsip_tsx_stop_retransmit(inv->invite_tsx);
+		/* Do not stop INVITE retransmission, see ticket #506 */
+		//pjsip_tsx_stop_retransmit(inv->invite_tsx);
 		inv->cancelling = PJ_TRUE;
 		inv->pending_cancel = PJ_TRUE;
 		*p_tdata = NULL;
-		PJ_LOG(4, (inv->obj_name, "Stopping retransmission, "
-			   "delaying CANCEL"));
+		PJ_LOG(4, (inv->obj_name, "Delaying CANCEL since no "
+			   "provisional response is received yet"));
 		return PJ_SUCCESS;
 	    }
 
@@ -1884,6 +1887,14 @@ PJ_DEF(pj_status_t) pjsip_inv_end_session(  pjsip_inv_session *inv,
 	    status = pjsip_endpt_create_cancel(inv->dlg->endpt, 
 					       inv->invite_tsx->last_tx,
 					       &tdata);
+	    if (status != PJ_SUCCESS)
+		return status;
+
+	    /* Set timeout for the INVITE transaction, in case UAS is not
+	     * able to respond the INVITE with 487 final response. The 
+	     * timeout value is 64*T1.
+	     */
+	    pjsip_tsx_set_timeout(inv->invite_tsx, 64 * pjsip_cfg()->tsx.t1);
 
 	} else {
 
@@ -2246,11 +2257,16 @@ PJ_DEF(pj_status_t) pjsip_inv_update (	pjsip_inv_session *inv,
 	goto on_error;
     }
 
+    /* Notify negotiator about the new offer. This will fix the offer
+     * with correct SDP origin.
+     */
     status = pjmedia_sdp_neg_modify_local_offer(inv->pool,inv->neg,
 						offer);
     if (status != PJ_SUCCESS)
 	goto on_error;
 
+    /* Retrieve the "fixed" offer from negotiator */
+    pjmedia_sdp_neg_get_neg_local(inv->neg, &offer);
 
     /* Update Contact if required */
     if (new_contact) {
@@ -2464,7 +2480,12 @@ static void inv_respond_incoming_cancel(pjsip_inv_session *inv,
 	if (status == PJ_SUCCESS) {
 	    /* Remove the message body */
 	    tdata->msg->body = NULL;
-	    pjsip_dlg_send_response(inv->dlg, invite_tsx, tdata);
+	    if (inv->options & PJSIP_INV_REQUIRE_100REL) {
+		status = pjsip_100rel_tx_response(inv, tdata);
+	    } else {
+		status = pjsip_dlg_send_response(inv->dlg, invite_tsx, 
+						 tdata);
+	    }
 	}
     }
 
@@ -3345,6 +3366,22 @@ static void inv_on_state_early( pjsip_inv_session *inv, pjsip_event *e)
 	
 	/* Generic handling for UAC tsx completion */
 	handle_uac_tsx_response(inv, e);
+
+    } else if (tsx->role == PJSIP_ROLE_UAS &&
+	       tsx->method.id == PJSIP_BYE_METHOD &&
+	       tsx->status_code < 200 &&
+	       e->body.tsx_state.type == PJSIP_EVENT_RX_MSG)
+    {
+	/* Received BYE before the 2xx/OK response to INVITE.
+	 * Assume that the 2xx/OK response is lost and the BYE
+	 * arrives earlier.
+	 */
+	inv_respond_incoming_bye(inv, tsx, e->body.tsx_state.src.rdata, e);
+
+	/* Set timer just in case we will never get the final response
+	 * for INVITE.
+	 */
+	pjsip_tsx_set_timeout(inv->invite_tsx, 64*pjsip_cfg()->tsx.t1);
     }
 }
 
@@ -3617,9 +3654,19 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e)
 		if (mod_inv.cb.on_create_offer)  {
 		    (*mod_inv.cb.on_create_offer)(inv, &sdp);
 		    if (sdp) {
+			/* Notify negotiator about the new offer. This will
+			 * fix the offer with correct SDP origin.
+			 */
 			status = pjmedia_sdp_neg_modify_local_offer(dlg->pool,
 								    inv->neg,
 								    sdp);
+
+			/* Retrieve the "fixed" offer from negotiator */
+			if (status==PJ_SUCCESS) {
+			    const pjmedia_sdp_session *lsdp = NULL;
+			    pjmedia_sdp_neg_get_neg_local(inv->neg, &lsdp);
+			    sdp = (pjmedia_sdp_session*)lsdp;
+			}
 		    }
 		} 
 		
@@ -3726,6 +3773,9 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e)
 	    if (neg_state == PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) {
 		pjmedia_sdp_neg_cancel_offer(inv->neg);
 	    }
+
+	    if (tsx == inv->invite_tsx)
+		inv->invite_tsx = NULL;
 	}
 
     } else if (tsx->role == PJSIP_ROLE_UAS &&
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_reg.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_reg.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_reg.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_reg.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_replaces.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_replaces.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_replaces.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_replaces.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_xfer.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_xfer.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip-ua/sip_xfer.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip-ua/sip_xfer.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_aka.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_aka.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_aka.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_aka.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_client.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_client.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_client.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_client.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_msg.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_msg.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_msg.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_msg.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_parser.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_parser.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_parser.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_parser.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_server.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_server.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_auth_server.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_auth_server.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_config.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_config.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_config.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_config.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_dialog.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_dialog.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_dialog.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_dialog.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_endpoint.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_endpoint.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_endpoint.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_endpoint.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_errno.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_errno.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_errno.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_errno.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_msg.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_msg.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_msg.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_msg.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_parser.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_parser.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_parser.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_parser.c
index 91f54687874c23ffc62c4a0f3fccc6b34d5d12d1..5c17443208fae224f1bdedf8e1e6e6774df49ab4 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_parser.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_parser.c
@@ -1,4 +1,4 @@
-/* $Id: sip_parser.c 2538 2009-03-23 13:14:26Z bennylp $ */
+/* $Id: sip_parser.c 2802 2009-06-25 11:29:49Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -1588,7 +1588,8 @@ PJ_DEF(pj_status_t) pjsip_parse_status_line( char *buf, pj_size_t size,
     PJ_USE_EXCEPTION;
 
     pj_bzero(status_line, sizeof(*status_line));
-    pj_scan_init(&scanner, buf, size, 0, &on_syntax_error);
+    pj_scan_init(&scanner, buf, size, PJ_SCAN_AUTOSKIP_WS_HEADER, 
+		 &on_syntax_error);
 
     PJ_TRY {
 	int_parse_status_line(&scanner, status_line);
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_resolve.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_resolve.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_resolve.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_resolve.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_tel_uri.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_tel_uri.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_tel_uri.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_tel_uri.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transaction.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transaction.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transaction.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transaction.c
index 50b7cdb70fd960a286afaf233c45d2508b59dc8e..864cd7c67f036e1e15274a61b1e84cd32be7c9c9 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transaction.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transaction.c
@@ -1,4 +1,4 @@
-/* $Id: sip_transaction.c 2534 2009-03-23 13:09:09Z bennylp $ */
+/* $Id: sip_transaction.c 2798 2009-06-25 10:48:08Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -1502,6 +1502,47 @@ PJ_DEF(pj_status_t) pjsip_tsx_stop_retransmit(pjsip_transaction *tsx)
 }
 
 
+/*
+ * Start a timer to terminate transaction after the specified time
+ * has elapsed. 
+ */
+PJ_DEF(pj_status_t) pjsip_tsx_set_timeout( pjsip_transaction *tsx,
+					   unsigned millisec)
+{
+    struct tsx_lock_data lck;
+    pj_time_val timeout;
+
+    PJ_ASSERT_RETURN(tsx != NULL, PJ_EINVAL);
+    PJ_ASSERT_RETURN(tsx->role == PJSIP_ROLE_UAC &&
+		     tsx->method.id == PJSIP_INVITE_METHOD,
+		     PJ_EINVALIDOP);
+
+    lock_tsx(tsx, &lck);
+
+    /* Transaction must not have got final response */
+    PJ_ASSERT_ON_FAIL(tsx->status_code < 200,
+		    { unlock_tsx(tsx, &lck); return PJ_EINVALIDOP; });
+
+    if (tsx->timeout_timer.id != 0) {
+	pjsip_endpt_cancel_timer(tsx->endpt, &tsx->timeout_timer);
+	tsx->timeout_timer.id = 0;
+    }
+
+    timeout.sec = 0;
+    timeout.msec = millisec;
+    pj_time_val_normalize(&timeout);
+
+    tsx->timeout_timer.id = TIMER_ACTIVE;
+    pjsip_endpt_schedule_timer(tsx->endpt, &tsx->timeout_timer,
+			       &timeout);
+
+
+    unlock_tsx(tsx, &lck);
+
+    return PJ_SUCCESS;
+}
+
+
 /*
  * This function is called by TU to send a message.
  */
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_loop.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport_loop.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_loop.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport_loop.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_tcp.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport_tcp.c
similarity index 97%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_tcp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport_tcp.c
index 042f192528cf30f934b634531459801ed42ddb88..c0829cc5d46f1c855ec3dfb4d31e5e8e96801cd7 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_tcp.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport_tcp.c
@@ -1,4 +1,4 @@
-/* $Id: sip_transport_tcp.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: sip_transport_tcp.c 2804 2009-06-25 12:26:15Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -805,33 +805,33 @@ static pj_status_t lis_create_transport(pjsip_tpfactory *factory,
     status = pj_activesock_start_connect(tcp->asock, tcp->base.pool, rem_addr,
 					 sizeof(pj_sockaddr_in));
     if (status == PJ_SUCCESS) {
-	tcp->has_pending_connect = PJ_FALSE;
+	on_connect_complete(tcp->asock, PJ_SUCCESS);
     } else if (status != PJ_EPENDING) {
 	tcp_destroy(&tcp->base, status);
 	return status;
     }
 
-    /* Update (again) local address, just in case local address currently
-     * set is different now that asynchronous connect() is started.
-     */
-    addr_len = sizeof(pj_sockaddr_in);
-    if (pj_sock_getsockname(sock, &local_addr, &addr_len)==PJ_SUCCESS) {
-	pj_sockaddr_in *tp_addr = (pj_sockaddr_in*)&tcp->base.local_addr;
-
-	/* Some systems (like old Win32 perhaps) may not set local address
-	 * properly before socket is fully connected.
+    if (tcp->has_pending_connect) {
+	/* Update (again) local address, just in case local address currently
+	 * set is different now that asynchronous connect() is started.
 	 */
-	if (tp_addr->sin_addr.s_addr != local_addr.sin_addr.s_addr &&
-	    local_addr.sin_addr.s_addr != 0) 
-	{
-	    tp_addr->sin_addr.s_addr = local_addr.sin_addr.s_addr;
-	    tp_addr->sin_port = local_addr.sin_port;
-	    sockaddr_to_host_port(tcp->base.pool, &tcp->base.local_name,
-				  &local_addr);
-	}
-    }
+	addr_len = sizeof(pj_sockaddr_in);
+	if (pj_sock_getsockname(sock, &local_addr, &addr_len)==PJ_SUCCESS) {
+	    pj_sockaddr_in *tp_addr = (pj_sockaddr_in*)&tcp->base.local_addr;
 
-    if (tcp->has_pending_connect) {
+	    /* Some systems (like old Win32 perhaps) may not set local address
+	     * properly before socket is fully connected.
+	     */
+	    if (tp_addr->sin_addr.s_addr != local_addr.sin_addr.s_addr &&
+		local_addr.sin_addr.s_addr != 0) 
+	    {
+		tp_addr->sin_addr.s_addr = local_addr.sin_addr.s_addr;
+		tp_addr->sin_port = local_addr.sin_port;
+		sockaddr_to_host_port(tcp->base.pool, &tcp->base.local_name,
+				      &local_addr);
+	    }
+	}
+	
 	PJ_LOG(4,(tcp->base.obj_name, 
 		  "TCP transport %.*s:%d is connecting to %.*s:%d...",
 		  (int)tcp->base.local_name.host.slen,
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_tls_ossl.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport_tls_ossl.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_tls_ossl.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport_tls_ossl.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_udp.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport_udp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_transport_udp.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_transport_udp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_ua_layer.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_ua_layer.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_ua_layer.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_ua_layer.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_uri.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_uri.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_uri.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_uri.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_util.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_util.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util_proxy.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_util_proxy.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util_proxy.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_util_proxy.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util_statefull.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_util_statefull.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsip/sip_util_statefull.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsip/sip_util_statefull.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_acc.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_acc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_acc.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_acc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_call.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_call.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_call.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_call.c
index 55f5d95d7faf853068d88e5d569e89121ad218da..555a6ddd45d0355e19c7fb474dd2251f37418dc2 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_call.c
@@ -1,4 +1,4 @@
-/* $Id: pjsua_call.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: pjsua_call.c 2815 2009-06-25 13:13:26Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -78,21 +78,6 @@ static pjsip_redirect_op pjsua_call_on_redirected(pjsip_inv_session *inv,
 static pj_status_t create_sdp_of_call_hold(pjsua_call *call,
 					   pjmedia_sdp_session **p_answer);
 
-/* Update SDP version in the offer */
-static void update_sdp_version(pjsua_call *call,
-			       pjmedia_sdp_session *sdp)
-{
-    const pjmedia_sdp_session *old_sdp = NULL;
-    pj_status_t status;
-
-    status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &old_sdp);
-    if (status != PJ_SUCCESS || old_sdp == NULL)
-	return;
-
-    sdp->origin.version = old_sdp->origin.version + 1;
-}
-
-
 /*
  * Callback called by event framework when the xfer subscription state
  * has changed.
@@ -463,6 +448,11 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id,
 	return status;
     }
 
+    /* Increment the dialog's lock otherwise when invite session creation
+     * fails the dialog will be destroyed prematurely.
+     */
+    pjsip_dlg_inc_lock(dlg);
+
     /* Calculate call's secure level */
     call->secure_level = get_secure_level(acc_id, dest_uri);
 
@@ -553,11 +543,10 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id,
 	pjsua_perror(THIS_FILE, "Unable to send initial INVITE request", 
 		     status);
 
-	/* Upon failure to send first request, both dialog and invite 
+	/* Upon failure to send first request, the invite 
 	 * session would have been cleared.
 	 */
 	inv = NULL;
-	dlg = NULL;
 	goto on_error;
     }
 
@@ -566,6 +555,7 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id,
     if (p_call_id)
 	*p_call_id = call_id;
 
+    pjsip_dlg_dec_lock(dlg);
     pj_pool_release(tmp_pool);
     PJSUA_UNLOCK();
 
@@ -573,10 +563,13 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id,
 
 
 on_error:
+    if (dlg) {
+	/* This may destroy the dialog */
+	pjsip_dlg_dec_lock(dlg);
+    }
+
     if (inv != NULL) {
 	pjsip_inv_terminate(inv, PJSIP_SC_OK, PJ_FALSE);
-    } else if (dlg) {
-	pjsip_dlg_terminate(dlg);
     }
 
     if (call_id != -1) {
@@ -1507,8 +1500,6 @@ PJ_DEF(pj_status_t) pjsua_call_set_hold(pjsua_call_id call_id,
 	return status;
     }
 
-    update_sdp_version(call, sdp);
-
     /* Create re-INVITE with new offer */
     status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata);
     if (status != PJ_SUCCESS) {
@@ -1579,8 +1570,6 @@ PJ_DEF(pj_status_t) pjsua_call_reinvite( pjsua_call_id call_id,
 	return status;
     }
 
-    update_sdp_version(call, sdp);
-
     /* Create re-INVITE with new offer */
     status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata);
     if (status != PJ_SUCCESS) {
@@ -1638,8 +1627,6 @@ PJ_DEF(pj_status_t) pjsua_call_update( pjsua_call_id call_id,
 	return status;
     }
 
-    update_sdp_version(call, sdp);
-
     /* Create UPDATE with new offer */
     status = pjsip_inv_update(call->inv, NULL, sdp, &tdata);
     if (status != PJ_SUCCESS) {
@@ -3184,7 +3171,10 @@ static pj_status_t create_sdp_of_call_hold(pjsua_call *call,
      * 'inactive' (PJMEDIA_DIR_NONE).
      * (See RFC 3264 Section 8.4 and RFC 4317 Section 3.1)
      */
-    if (call->media_dir != PJMEDIA_DIR_ENCODING) {
+    /* http://trac.pjsip.org/repos/ticket/880 
+       if (call->media_dir != PJMEDIA_DIR_ENCODING) {
+     */
+    if (1) {
 	pjmedia_sdp_attr *attr;
 
 	/* Remove existing directions attributes */
@@ -3193,7 +3183,7 @@ static pj_status_t create_sdp_of_call_hold(pjsua_call *call,
 	pjmedia_sdp_media_remove_all_attr(sdp->media[0], "recvonly");
 	pjmedia_sdp_media_remove_all_attr(sdp->media[0], "inactive");
 
-	if (call->media_dir == PJMEDIA_DIR_ENCODING_DECODING) {
+	if (call->media_dir & PJMEDIA_DIR_ENCODING) {
 	    /* Add sendonly attribute */
 	    attr = pjmedia_sdp_attr_create(pool, "sendonly", NULL);
 	    pjmedia_sdp_media_add_attr(sdp->media[0], attr);
@@ -3309,8 +3299,6 @@ static void pjsua_call_on_create_offer(pjsip_inv_session *inv,
 	return;
     }
 
-    update_sdp_version(call, *offer);
-
     PJSUA_UNLOCK();
 }
 
@@ -3426,7 +3414,7 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
 	    msg = rdata->msg_info.msg;
 	    body = msg->body;
 	    if (!body) {
-		PJ_LOG(4,(THIS_FILE, 
+		PJ_LOG(2,(THIS_FILE, 
 			  "Warning: received NOTIFY without message body"));
 		return;
 	    }
@@ -3435,7 +3423,7 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
 	    if (pj_stricmp2(&body->content_type.type, "message") != 0 ||
 		pj_stricmp2(&body->content_type.subtype, "sipfrag") != 0)
 	    {
-		PJ_LOG(4,(THIS_FILE, 
+		PJ_LOG(2,(THIS_FILE, 
 			  "Warning: received NOTIFY with non message/sipfrag "
 			  "content"));
 		return;
@@ -3445,7 +3433,7 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
 	    status = pjsip_parse_status_line((char*)body->data, body->len, 
 					     &status_line);
 	    if (status != PJ_SUCCESS) {
-		PJ_LOG(4,(THIS_FILE, 
+		PJ_LOG(2,(THIS_FILE, 
 			  "Warning: received NOTIFY with invalid "
 			  "message/sipfrag content"));
 		return;
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_core.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_core.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_core.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_core.c
index b5dc17d787fb8b1f02bda76632b5ad0a73860487..2609c9343c712b7ad4f877478eebf8c96feaae4c 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_core.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_core.c
@@ -1,4 +1,4 @@
-/* $Id: pjsua_core.c 2542 2009-03-23 13:21:01Z bennylp $ */
+/* $Id: pjsua_core.c 2814 2009-06-25 13:11:53Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -643,7 +643,8 @@ PJ_DEF(pj_status_t) pjsua_init( const pjsua_config *ua_cfg,
     /* Initialize logging first so that info/errors can be captured */
     if (log_cfg) {
 	status = pjsua_reconfigure_logging(log_cfg);
-	PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
+	if (status != PJ_SUCCESS)
+	    return status;
     }
 
     /* If nameserver is configured, create DNS resolver instance and
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_im.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_im.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_im.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_im.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_media.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_media.c
similarity index 99%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_media.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_media.c
index 538f73e5701943695b969009d60f91f8a6fe4964..f312e404bd5a0eea1ca1cb56560ec20c1cba4c40 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_media.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_media.c
@@ -1,4 +1,4 @@
-/* $Id: pjsua_media.c 2541 2009-03-23 13:19:31Z bennylp $ */
+/* $Id: pjsua_media.c 2813 2009-06-25 13:09:24Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -468,12 +468,16 @@ static void close_snd_timer_cb( pj_timer_heap_t *th,
 {
     PJ_UNUSED_ARG(th);
 
-    PJ_LOG(4,(THIS_FILE,"Closing sound device after idle for %d seconds", 
-	      pjsua_var.media_cfg.snd_auto_close_time));
+    PJSUA_LOCK();
+    if (entry->id) {
+	PJ_LOG(4,(THIS_FILE,"Closing sound device after idle for %d seconds", 
+		  pjsua_var.media_cfg.snd_auto_close_time));
 
-    entry->id = PJ_FALSE;
+	entry->id = PJ_FALSE;
 
-    close_snd_dev();
+	close_snd_dev();
+    }
+    PJSUA_UNLOCK();
 }
 
 
@@ -1605,10 +1609,12 @@ PJ_DEF(pj_status_t) pjsua_conf_connect( pjsua_conf_port_id source,
 					pjsua_conf_port_id sink)
 {
     /* If sound device idle timer is active, cancel it first. */
+    PJSUA_LOCK();
     if (pjsua_var.snd_idle_timer.id) {
 	pjsip_endpt_cancel_timer(pjsua_var.endpt, &pjsua_var.snd_idle_timer);
 	pjsua_var.snd_idle_timer.id = PJ_FALSE;
     }
+    PJSUA_UNLOCK();
 
     /* Create sound port if none is instantiated */
     if (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL && 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_pres.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_pres.c
similarity index 98%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_pres.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_pres.c
index 616f2e62793923b598bd85f60d16e34640b48613..8ce1d4d3afe60ef56c358388c8713ff82c5c4487 100644
--- a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/pjsua-lib/pjsua_pres.c
+++ b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/pjsua-lib/pjsua_pres.c
@@ -1,4 +1,4 @@
-/* $Id: pjsua_pres.c 2394 2008-12-23 17:27:53Z bennylp $ */
+/* $Id: pjsua_pres.c 2812 2009-06-25 13:05:59Z bennylp $ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -389,6 +389,12 @@ PJ_DEF(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id)
 
     PJSUA_LOCK();
 
+    /* Not interested with further events for this buddy */
+    if (pjsua_var.buddy[buddy_id].sub) {
+	pjsip_evsub_set_mod_data(pjsua_var.buddy[buddy_id].sub, 
+				 pjsua_var.mod.id, NULL);
+    }
+
     /* Remove buddy */
     pjsua_var.buddy[buddy_id].uri.slen = 0;
     pjsua_var.buddy_cnt--;
@@ -1442,13 +1448,21 @@ static void subscribe_buddy_presence(unsigned index)
 	return;
     }
 
+    /* Increment the dialog's lock otherwise when presence session creation
+     * fails the dialog will be destroyed prematurely.
+     */
+    pjsip_dlg_inc_lock(buddy->dlg);
+
     status = pjsip_pres_create_uac( buddy->dlg, &pres_callback, 
 				    PJSIP_EVSUB_NO_EVENT_ID, &buddy->sub);
     if (status != PJ_SUCCESS) {
 	pjsua_var.buddy[index].sub = NULL;
 	pjsua_perror(THIS_FILE, "Unable to create presence client", 
 		     status);
-	pjsip_dlg_terminate(buddy->dlg);
+	/* This should destroy the dialog since there's no session
+	 * referencing it
+	 */
+	pjsip_dlg_dec_lock(buddy->dlg);
 	if (tmp_pool) pj_pool_release(tmp_pool);
 	return;
     }
@@ -1481,6 +1495,7 @@ static void subscribe_buddy_presence(unsigned index)
 
     status = pjsip_pres_initiate(buddy->sub, -1, &tdata);
     if (status != PJ_SUCCESS) {
+	pjsip_dlg_dec_lock(buddy->dlg);
 	if (buddy->sub) {
 	    pjsip_pres_terminate(buddy->sub, PJ_FALSE);
 	}
@@ -1495,6 +1510,7 @@ static void subscribe_buddy_presence(unsigned index)
 
     status = pjsip_pres_send_request(buddy->sub, tdata);
     if (status != PJ_SUCCESS) {
+	pjsip_dlg_dec_lock(buddy->dlg);
 	if (buddy->sub) {
 	    pjsip_pres_terminate(buddy->sub, PJ_FALSE);
 	}
@@ -1505,6 +1521,7 @@ static void subscribe_buddy_presence(unsigned index)
 	return;
     }
 
+    pjsip_dlg_dec_lock(buddy->dlg);
     if (tmp_pool) pj_pool_release(tmp_pool);
 }
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/dlg_core_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/dlg_core_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/dlg_core_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/dlg_core_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/dns_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/dns_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/dns_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/dns_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/inv_offer_answer_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/inv_offer_answer_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/inv_offer_answer_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/inv_offer_answer_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/main.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/main.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main_rtems.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/main_rtems.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main_rtems.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/main_rtems.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main_win32.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/main_win32.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/main_win32.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/main_win32.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_err_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/msg_err_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_err_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/msg_err_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_logger.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/msg_logger.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_logger.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/msg_logger.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/msg_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/msg_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/msg_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/regc_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/regc_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/regc_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/regc_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/test.h b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/test.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/test.h
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/test.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_loop_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/transport_loop_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_loop_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/transport_loop_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_tcp_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/transport_tcp_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_tcp_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/transport_tcp_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/transport_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/transport_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_udp_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/transport_udp_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/transport_udp_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/transport_udp_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_basic_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/tsx_basic_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_basic_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/tsx_basic_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_bench.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/tsx_bench.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_bench.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/tsx_bench.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_uac_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/tsx_uac_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_uac_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/tsx_uac_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_uas_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/tsx_uas_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/tsx_uas_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/tsx_uas_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/txdata_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/txdata_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/txdata_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/txdata_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/uri_test.c b/sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/uri_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/pjsip/src/test-pjsip/uri_test.c
rename to sflphone-common/libs/pjproject-1.0.3/pjsip/src/test-pjsip/uri_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/self-test.mak b/sflphone-common/libs/pjproject-1.0.3/self-test.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/self-test.mak
rename to sflphone-common/libs/pjproject-1.0.3/self-test.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/svn_add b/sflphone-common/libs/pjproject-1.0.3/svn_add
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/svn_add
rename to sflphone-common/libs/pjproject-1.0.3/svn_add
diff --git a/sflphone-common/libs/pjproject-1.0.2/svn_pset b/sflphone-common/libs/pjproject-1.0.3/svn_pset
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/svn_pset
rename to sflphone-common/libs/pjproject-1.0.3/svn_pset
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/README.TXT b/sflphone-common/libs/pjproject-1.0.3/tests/cdash/README.TXT
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/cdash/README.TXT
rename to sflphone-common/libs/pjproject-1.0.3/tests/cdash/README.TXT
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/builder.py b/sflphone-common/libs/pjproject-1.0.3/tests/cdash/builder.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/cdash/builder.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/cdash/builder.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_gnu.py b/sflphone-common/libs/pjproject-1.0.3/tests/cdash/cfg_gnu.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_gnu.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/cdash/cfg_gnu.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_msvc.py b/sflphone-common/libs/pjproject-1.0.3/tests/cdash/cfg_msvc.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_msvc.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/cdash/cfg_msvc.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_site_sample.py b/sflphone-common/libs/pjproject-1.0.3/tests/cdash/cfg_site_sample.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_site_sample.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/cdash/cfg_site_sample.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_symbian.py b/sflphone-common/libs/pjproject-1.0.3/tests/cdash/cfg_symbian.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/cdash/cfg_symbian.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/cdash/cfg_symbian.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/inc_test.py b/sflphone-common/libs/pjproject-1.0.3/tests/cdash/inc_test.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/cdash/inc_test.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/cdash/inc_test.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/main.py b/sflphone-common/libs/pjproject-1.0.3/tests/cdash/main.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/cdash/main.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/cdash/main.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/cdash/starttest_sample.bat b/sflphone-common/libs/pjproject-1.0.3/tests/cdash/starttest_sample.bat
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/cdash/starttest_sample.bat
rename to sflphone-common/libs/pjproject-1.0.3/tests/cdash/starttest_sample.bat
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/README.TXT b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/README.TXT
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/README.TXT
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/README.TXT
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/config_site.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/config_site.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/config_site.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/config_site.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_cfg.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/inc_cfg.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_cfg.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/inc_cfg.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_const.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/inc_const.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_const.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/inc_const.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_sdp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/inc_sdp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_sdp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/inc_sdp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_sip.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/inc_sip.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/inc_sip.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/inc_sip.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_call.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_call.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_call.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_call.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_media_playrec.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_media_playrec.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_media_playrec.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_media_playrec.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_pesq.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_pesq.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_pesq.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_pesq.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_pres.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_pres.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_pres.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_pres.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_recvfrom.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_recvfrom.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_recvfrom.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_recvfrom.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_run.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_run.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_run.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_run.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_sendto.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_sendto.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/mod_sendto.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/mod_sendto.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/run.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/run.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/run.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/run.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/runall.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/runall.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/runall.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/runall.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/100_simplecall.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/100_simplecall.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/100_simplecall.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/100_simplecall.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_0_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_0_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_0_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_0_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_0.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_1_0.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_0.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_1_0.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_1_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_1_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_1_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_1_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_1_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_2_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_2_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_2_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_2_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_2_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_2_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/150_srtp_2_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/150_srtp_2_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/200_tcp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/200_tcp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/200_tcp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/200_tcp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_0_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/300_ice_0_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_0_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/300_ice_0_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_1_0.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/300_ice_1_0.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_1_0.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/300_ice_1_0.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_1_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/300_ice_1_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/300_ice_1_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/300_ice_1_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/301_ice_public_a.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/301_ice_public_a.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/301_ice_public_a.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/301_ice_public_a.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/301_ice_public_b.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/301_ice_public_b.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/301_ice_public_b.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/301_ice_public_b.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/305_ice_comp_1_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/305_ice_comp_1_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/305_ice_comp_1_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/305_ice_comp_1_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/305_ice_comp_2_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/305_ice_comp_2_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/305_ice_comp_2_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/305_ice_comp_2_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/350_prack_a.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/350_prack_a.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/350_prack_a.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/350_prack_a.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/350_prack_b.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/350_prack_b.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-call/350_prack_b.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-call/350_prack_b.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_16.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_16.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_16.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_16.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_22.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_22.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_22.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_22.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_32.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_32.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_32.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_32.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_44.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_44.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_44.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_44.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_48.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_48.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_48.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_48.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_11.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_11.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_11.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_11.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_16.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_16.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_16.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_16.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_22.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_22.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_22.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_22.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_32.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_32.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_32.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_32.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_44.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_44.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_44.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_44.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_48.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_48.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-media-playrec/100_resample_lf_8_48.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-media-playrec/100_resample_lf_8_48.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/100_defaults.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/100_defaults.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/100_defaults.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/100_defaults.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/101_defaults.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/101_defaults.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/101_defaults.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/101_defaults.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g711a.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_g711a.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g711a.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_g711a.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g711u.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_g711u.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g711u.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_g711u.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g722.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_g722.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_g722.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_g722.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_gsm.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_gsm.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_gsm.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_gsm.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_ilbc.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_ilbc.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_ilbc.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_ilbc.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_16000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_l16_16000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_16000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_l16_16000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_8000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_l16_8000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_8000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_l16_8000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_8000_stereo.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_l16_8000_stereo.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_l16_8000_stereo.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_l16_8000_stereo.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_speex_16000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_speex_16000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_speex_16000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_speex_16000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_speex_8000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_speex_8000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/200_codec_speex_8000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/200_codec_speex_8000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g711a.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_g711a.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g711a.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_g711a.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g711u.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_g711u.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g711u.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_g711u.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g722.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_g722.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_g722.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_g722.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_gsm.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_gsm.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_gsm.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_gsm.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_ilbc.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_ilbc.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_ilbc.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_ilbc.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_16000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_l16_16000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_16000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_l16_16000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_16000_stereo.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_l16_16000_stereo.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_16000_stereo.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_l16_16000_stereo.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_8000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_l16_8000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_8000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_l16_8000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_8000_stereo.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_l16_8000_stereo.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_l16_8000_stereo.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_l16_8000_stereo.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_speex_16000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_speex_16000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_speex_16000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_speex_16000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_speex_8000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_speex_8000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pesq/201_codec_speex_8000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pesq/201_codec_speex_8000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pres/100_peertopeer.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pres/100_peertopeer.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pres/100_peertopeer.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pres/100_peertopeer.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pres/200_publish.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pres/200_publish.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-pres/200_publish.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-pres/200_publish.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/200_reg_good_enocredentiall.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/200_reg_good_enocredentiall.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/200_reg_good_enocredentiall.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/200_reg_good_enocredentiall.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/201_reg_good_ok.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/201_reg_good_ok.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/201_reg_good_ok.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/201_reg_good_ok.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/202_reg_good_ok_wildcard.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/202_reg_good_ok_wildcard.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/202_reg_good_ok_wildcard.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/202_reg_good_ok_wildcard.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/205_reg_good_no_realm.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/205_reg_good_no_realm.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/205_reg_good_no_realm.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/205_reg_good_no_realm.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/206_reg_good_efailedcredential.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/206_reg_good_efailedcredential.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/206_reg_good_efailedcredential.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/206_reg_good_efailedcredential.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/208_reg_good_retry_nonce_ok.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/208_reg_good_retry_nonce_ok.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/208_reg_good_retry_nonce_ok.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/208_reg_good_retry_nonce_ok.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/220_reg_good_ims_ok.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/220_reg_good_ims_ok.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/220_reg_good_ims_ok.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/220_reg_good_ims_ok.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/234_reg_bad_stale_ok.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/234_reg_bad_stale_ok.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-recvfrom/234_reg_bad_stale_ok.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-recvfrom/234_reg_bad_stale_ok.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-run/100_simple.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-run/100_simple.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-run/100_simple.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-run/100_simple.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-run/200_register.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-run/200_register.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-run/200_register.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-run/200_register.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_3.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_4.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_4.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_4.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_4.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_5.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_5.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_5.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_5.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/100_simplecall.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/100_simplecall.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/100_simplecall.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/100_simplecall.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/110_tel_uri.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/110_tel_uri.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/110_tel_uri.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/110_tel_uri.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/121_sdp_with_video_static_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/121_sdp_with_video_static_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/121_sdp_with_video_static_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/121_sdp_with_video_static_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/121_sdp_with_video_static_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/121_sdp_with_video_static_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/121_sdp_with_video_static_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/121_sdp_with_video_static_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/122_sdp_with_unknown_dynamic_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/123_sdp_with_unknown_static_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/124_sdp_with_unknown_static_unknown_transport.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/124_sdp_with_unknown_static_unknown_transport.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/124_sdp_with_unknown_static_unknown_transport.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/124_sdp_with_unknown_static_unknown_transport.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_0.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_0.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_0.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_0.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_3.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_3.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_3.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_3.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_4.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_4.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_4.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_4.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/150_err_extension.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/150_err_extension.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/150_err_extension.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/150_err_extension.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/151_err_sdp_video.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/151_err_sdp_video.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/151_err_sdp_video.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/151_err_sdp_video.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/152_err_sdp_no_media.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/152_err_sdp_no_media.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/152_err_sdp_no_media.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/152_err_sdp_no_media.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/153_err_sdp_unsupported_codec.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/155_err_sdp_bad_syntax.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/155_err_sdp_bad_syntax.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/155_err_sdp_bad_syntax.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/155_err_sdp_bad_syntax.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/156_err_sdp_bad_net_type.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/156_err_sdp_bad_net_type.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/156_err_sdp_bad_net_type.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/156_err_sdp_bad_net_type.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/157_err_sdp_bad_addr_type.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/158_err_sdp_bad_transport_type.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/159_no_rport.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/159_no_rport.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport_nit.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/159_no_rport_nit.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/159_no_rport_nit.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/159_no_rport_nit.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/160_err_duplicate_replaces.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/160_err_duplicate_replaces.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/160_err_duplicate_replaces.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/160_err_duplicate_replaces.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/161_err_replaces_dlg_not_found.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_no_ice.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_no_ice.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_no_ice.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_no_ice.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_success_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_success_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_success_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_success_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_3.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_success_3.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_3.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_success_3.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_4.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_success_4.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/200_ice_success_4.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/200_ice_success_4.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/201_ice_mismatch_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/201_ice_mismatch_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/201_ice_mismatch_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/201_ice_mismatch_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_3.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/201_ice_mismatch_3.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/201_ice_mismatch_3.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/201_ice_mismatch_3.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_crypto_case_insensitive.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_crypto_case_insensitive.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_crypto_case_insensitive.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_crypto_case_insensitive.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_duplicated_crypto_tag.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_duplicated_crypto_tag.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_duplicated_crypto_tag.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_duplicated_crypto_tag.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_non_numeric.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_non_numeric.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_non_numeric.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_non_numeric.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_zero.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_receive_crypto_tag_zero.py
similarity index 66%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_zero.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_receive_crypto_tag_zero.py
index 1fc2b53d6002cf045ed9effc4edd7ebdd551f76d..1276573b14b33724ddda1a37033d796204688619 100644
--- a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_invalid_crypto_tag_zero.py
+++ b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_receive_crypto_tag_zero.py
@@ -1,4 +1,4 @@
-# $Id: 300_srtp_invalid_crypto_tag_zero.py 2036 2008-06-20 17:43:55Z nanang $
+# $Id: 300_srtp_receive_crypto_tag_zero.py 2794 2009-06-24 16:00:36Z nanang $
 import inc_sip as sip
 import inc_sdp as sdp
 
@@ -21,6 +21,6 @@ args = "--null-audio --auto-answer 200 --max-calls 1 --use-srtp 1 --srtp-secure
 include = []
 exclude = []
 
-sendto_cfg = sip.SendtoCfg( "caller has used invalid crypto tag (zero), callee must not accept the call", 
-			    pjsua_args=args, sdp=sdp, resp_code=406, 
+sendto_cfg = sip.SendtoCfg( "caller has used crypto tag zero, callee must accept the call", 
+			    pjsua_args=args, sdp=sdp, resp_code=200, 
 			    resp_inc=include, resp_exc=exclude)
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_3.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_3.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_3.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/300_srtp_receive_no_key_3.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/301_srtp0_recv_avp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/301_srtp0_recv_avp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/301_srtp0_recv_avp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/301_srtp0_recv_avp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/301_srtp0_recv_savp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/301_srtp0_recv_savp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/301_srtp0_recv_savp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/301_srtp0_recv_savp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/310_srtp1_no_crypto.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/310_srtp1_no_crypto.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/310_srtp1_no_crypto.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/310_srtp1_no_crypto.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/311_srtp1_recv_avp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/311_srtp1_recv_avp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/311_srtp1_recv_avp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/311_srtp1_recv_avp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/312_srtp1_recv_savp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/312_srtp1_recv_savp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/312_srtp1_recv_savp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/312_srtp1_recv_savp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/313_srtp1_unsupported_crypto.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/313_srtp1_unsupported_crypto.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/313_srtp1_unsupported_crypto.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/313_srtp1_unsupported_crypto.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp2_no_crypto.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp2_no_crypto.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp2_no_crypto.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp2_no_crypto.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp_with_unknown_media_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_1.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_1.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_1.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_1.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/320_srtp_with_unknown_transport_2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/321_srtp2_recv_avp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/321_srtp2_recv_avp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/321_srtp2_recv_avp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/321_srtp2_recv_avp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/322_srtp2_recv_savp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/322_srtp2_recv_savp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/322_srtp2_recv_savp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/322_srtp2_recv_savp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/323_srtp2_unsupported_crypto.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/323_srtp2_unsupported_crypto.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/323_srtp2_unsupported_crypto.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/323_srtp2_unsupported_crypto.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/330_srtp_prefer_rtp_savp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/330_srtp_prefer_rtp_savp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/330_srtp_prefer_rtp_savp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/330_srtp_prefer_rtp_savp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/331_srtp_prefer_rtp_avp.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/331_srtp_prefer_rtp_avp.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/331_srtp_prefer_rtp_avp.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/331_srtp_prefer_rtp_avp.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/360_non_sip_uri.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/360_non_sip_uri.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/360_non_sip_uri.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/360_non_sip_uri.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/361_non_sip_uri.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/361_non_sip_uri.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/361_non_sip_uri.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/361_non_sip_uri.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/362_non_sip_uri.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/362_non_sip_uri.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/362_non_sip_uri.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/362_non_sip_uri.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/363_non_sip_uri_subscribe.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/363_non_sip_uri_subscribe.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/363_non_sip_uri_subscribe.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/363_non_sip_uri_subscribe.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/364_non_sip_uri_subscribe.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/364_non_sip_uri_subscribe.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/364_non_sip_uri_subscribe.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/364_non_sip_uri_subscribe.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/400_fmtp_g7221_with_bitrate.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/400_fmtp_g7221_with_bitrate.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/400_fmtp_g7221_with_bitrate.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/400_fmtp_g7221_with_bitrate.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_24000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_24000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_24000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_24000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_32000.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_32000.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_32000.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_32000.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/410_fmtp_amrnb_offer_octet_align.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/410_fmtp_amrnb_offer_octet_align.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/410_fmtp_amrnb_offer_octet_align.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/410_fmtp_amrnb_offer_octet_align.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/411_fmtp_amrnb_offer_band_eff.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/411_fmtp_amrnb_offer_band_eff.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/411_fmtp_amrnb_offer_band_eff.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/411_fmtp_amrnb_offer_band_eff.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/412_fmtp_amrnb_offer_band_eff2.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/412_fmtp_amrnb_offer_band_eff2.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/412_fmtp_amrnb_offer_band_eff2.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/412_fmtp_amrnb_offer_band_eff2.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/500_pres_subscribe_with_bad_event.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/500_pres_subscribe_with_bad_event.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/500_pres_subscribe_with_bad_event.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/500_pres_subscribe_with_bad_event.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/999_asterisk_err.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/999_asterisk_err.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/999_asterisk_err.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/999_asterisk_err.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/999_message_no_body.py b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/999_message_no_body.py
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sendto/999_message_no_body.py
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sendto/999_message_no_body.py
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/inv_401_retry_after_100.xml
diff --git a/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-cancel-no-final.xml b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-cancel-no-final.xml
new file mode 100644
index 0000000000000000000000000000000000000000..e96f2a37402b7187a1e8c95e3ec9cc1427252150
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-cancel-no-final.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Basic UAS responder">
+  <recv request="INVITE" crlf="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 100 Trying
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:192.168.0.15>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <!-- Wait for CANCEL -->
+  <recv request="CANCEL" crlf="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+
+  <!-- definition of the response time repartition table (unit is ms)   -->
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <!-- definition of the call length repartition table (unit is ms)     -->
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
diff --git a/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-early-bye.xml b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-early-bye.xml
new file mode 100644
index 0000000000000000000000000000000000000000..216b8b45bf706d8e5fe437a467c238c4d0a83f22
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-early-bye.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Early BYE">
+  <recv request="INVITE" crlf="true">
+    <action>
+	<ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/>
+	<ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/>
+        <assign assign_to="4" variable="5" />
+    </action>
+  </recv>
+
+  <send>
+    <![CDATA[
+      SIP/2.0 100 Trying
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:[$5] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port]
+      From: sipp  <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+      To[$3]
+      Call-ID: [call_id]
+      Cseq: 1 BYE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+   <recv response="200">
+   </recv>
+
+
+  <!-- definition of the response time repartition table (unit is ms)   -->
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <!-- definition of the call length repartition table (unit is ms)     -->
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
diff --git a/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-forked-200.xml b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-forked-200.xml
new file mode 100644
index 0000000000000000000000000000000000000000..229f7d89d8cb682b14deb05633eb98508090cfc6
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-forked-200.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<!-- 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             -->
+<!--                                                                    -->
+<!--                 Sipp default 'uas' scenario.                       -->
+<!--                                                                    -->
+
+<scenario name="Forked INVITE, one of them require PRACK">
+  <recv request="INVITE" crlf="true">
+   <action>
+    <ereg regexp="branch=([0-9a-zA-Z]*)"
+          search_in="hdr"
+	  header="Via"
+          assign_to="1,2"/>
+    <assign assign_to="1" variable="2"/>
+    </action>
+  </recv>
+
+  <send>
+    <![CDATA[
+      SIP/2.0 100 Trying
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+    ]]>
+  </send>
+
+  <!-- Call leg 1: 200/OK -->
+  <send>
+    <![CDATA[
+      SIP/2.0 200 OK
+      Via: SIP/2.0/UDP 127.0.0.1;received=127.0.0.1;rport=5080;branch=[$2]
+      [last_From:]
+      [last_To:];tag=UA_1
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:UA_1@[local_ip]:[local_port]>
+      Content-Type: application/sdp
+
+      v=0
+      o=- 3442013205 3442013205 IN IP4 192.168.0.13
+      s=pjsip
+      c=IN IP4 192.168.0.13
+      t=0 0
+      m=audio 4002 RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+    ]]>
+  </send>
+
+  <!-- Call leg 2: 200/OK -->
+  <send>
+    <![CDATA[
+      SIP/2.0 200 OK
+      Via: SIP/2.0/UDP 127.0.0.1;received=127.0.0.1;rport=5080;branch=[$2]
+      [last_From:]
+      [last_To:];tag=UA_2
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:UA_2@[local_ip]:[local_port]>
+      Content-Type: application/sdp
+
+      v=0
+      o=- 3442013205 3442013205 IN IP4 192.168.0.13
+      s=pjsip
+      c=IN IP4 192.168.0.13
+      t=0 0
+      m=audio 4002 RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+    ]]>
+  </send>
+
+  <!-- Receive ACK -->
+  <recv request="ACK"
+        optional="false"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <!-- Receive BYE -->
+  <recv request="BYE" crlf="true">
+  </recv>
+
+  <!-- Send 200/OK to BYE -->
+  <send>
+    <![CDATA[
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+    ]]>
+  </send>
+
+
+
+  <!-- Receive ACK -->
+  <recv request="ACK"
+        optional="false"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <!-- Receive BYE -->
+  <recv request="BYE" crlf="true">
+  </recv>
+
+  <!-- Send 200/OK to BYE -->
+  <send>
+    <![CDATA[
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+    ]]>
+  </send>
+
+  <!-- definition of the response time repartition table (unit is ms)   -->
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <!-- definition of the call length repartition table (unit is ms)     -->
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sipp/uas-template.xml b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-template.xml
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/scripts-sipp/uas-template.xml
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/scripts-sipp/uas-template.xml
diff --git a/sflphone-common/libs/pjproject-1.0.2/tests/pjsua/tools/cmp_wav.c b/sflphone-common/libs/pjproject-1.0.3/tests/pjsua/tools/cmp_wav.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/tests/pjsua/tools/cmp_wav.c
rename to sflphone-common/libs/pjproject-1.0.3/tests/pjsua/tools/cmp_wav.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/README.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/README.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/README.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/README.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/Makefile b/sflphone-common/libs/pjproject-1.0.3/third_party/build/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/Makefile b/sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/config.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/config.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/config.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/config.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.dsp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/libgsmcodec.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.dsp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/libgsmcodec.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.vcp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/libgsmcodec.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.vcp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/libgsmcodec.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/libgsmcodec.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/gsm/libgsmcodec.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/gsm/libgsmcodec.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/Makefile b/sflphone-common/libs/pjproject-1.0.3/third_party/build/ilbc/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/ilbc/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.dsp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/ilbc/libilbccodec.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.dsp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/ilbc/libilbccodec.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.vcp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/ilbc/libilbccodec.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.vcp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/ilbc/libilbccodec.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/build/ilbc/libilbccodec.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/ilbc/libilbccodec.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/ilbc/libilbccodec.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.3/third_party/build/os-auto.mak.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/os-auto.mak.in
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/os-auto.mak.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-darwinos.mak b/sflphone-common/libs/pjproject-1.0.3/third_party/build/os-darwinos.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/os-darwinos.mak
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/os-darwinos.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-linux.mak b/sflphone-common/libs/pjproject-1.0.3/third_party/build/os-linux.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/os-linux.mak
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/os-linux.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/os-win32.mak b/sflphone-common/libs/pjproject-1.0.3/third_party/build/os-win32.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/os-win32.mak
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/os-win32.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/Makefile b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.dsp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/libportaudio.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.dsp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/libportaudio.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.vcp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/libportaudio.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.vcp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/libportaudio.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/libportaudio.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/libportaudio.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/libportaudio.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-auto.mak.in b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/os-auto.mak.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-auto.mak.in
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/os-auto.mak.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-linux.mak b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/os-linux.mak
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/os-linux.mak
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/os-linux.mak
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_allocation.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_allocation.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_allocation.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_allocation.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_allocation.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_allocation.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_allocation.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_allocation.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_converters.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_converters.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_converters.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_converters.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_converters.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_converters.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_converters.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_converters.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_cpuload.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_cpuload.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_cpuload.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_cpuload.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_cpuload.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_cpuload.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_cpuload.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_cpuload.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_debugprint.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_debugprint.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_debugprint.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_debugprint.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_debugprint.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_debugprint.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_debugprint.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_debugprint.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_dither.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_dither.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_dither.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_dither.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_dither.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_dither.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_dither.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_dither.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_endianness.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_endianness.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_endianness.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_endianness.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_front.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_front.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_front.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_front.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_hostapi.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_hostapi.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_hostapi.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_hostapi.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_linux_alsa.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_linux_alsa.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_linux_alsa.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_linux_alsa.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_linux_alsa.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_linux_alsa.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_linux_alsa.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_linux_alsa.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_blocking.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_blocking.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_blocking.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_blocking.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_blocking.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_blocking.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_blocking.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_blocking.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_internal.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_internal.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_internal.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_internal.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_old.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_old.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_old.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_old.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_utilities.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_utilities.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_utilities.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_utilities.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_utilities.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_utilities.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_core_utilities.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_core_utilities.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_hostapis.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_hostapis.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_mac_hostapis.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_mac_hostapis.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_process.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_process.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_process.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_process.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_process.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_process.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_process.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_process.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_ringbuffer.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_ringbuffer.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_ringbuffer.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_ringbuffer.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_ringbuffer.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_ringbuffer.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_ringbuffer.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_ringbuffer.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_skeleton.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_skeleton.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_skeleton.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_skeleton.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_stream.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_stream.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_stream.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_stream.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_stream.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_stream.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_stream.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_stream.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_trace.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_trace.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_trace.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_trace.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_trace.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_trace.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_trace.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_trace.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_types.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_types.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_hostapis.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_unix_hostapis.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_hostapis.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_unix_hostapis.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_oss.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_unix_oss.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_oss.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_unix_oss.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_util.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_unix_util.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_util.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_unix_util.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_util.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_unix_util.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_unix_util.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_unix_util.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_util.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_util.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_util.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_util.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_hostapis.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_hostapis.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_hostapis.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_hostapis.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_util.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_util.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_util.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_util.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_waveformat.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_waveformat.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_waveformat.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_waveformat.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_waveformat.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_waveformat.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_waveformat.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_waveformat.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_wmme.c b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_wmme.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_wmme.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_wmme.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_wmme.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_wmme.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/pa_win_wmme.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/pa_win_wmme.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/portaudio.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/portaudio.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/portaudio/src/portaudio.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/portaudio/src/portaudio.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/Makefile b/sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/config.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/config.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/config.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/config.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.dsp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.dsp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.vcp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.vcp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample_dll.dsp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample_dll.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample_dll.dsp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample_dll.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample_dll.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample_dll.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/resample/libresample_dll.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/resample/libresample_dll.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/README.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/build/samplerate/README.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/README.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/samplerate/README.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/Static.msvc b/sflphone-common/libs/pjproject-1.0.3/third_party/build/samplerate/Static.msvc
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/Static.msvc
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/samplerate/Static.msvc
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/libsamplerate_static.dsp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/samplerate/libsamplerate_static.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/samplerate/libsamplerate_static.dsp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/samplerate/libsamplerate_static.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/Makefile b/sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/config.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/config.h
similarity index 95%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/config.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/config.h
index e04c40be4f7383fdda6c17ec53d4369e70989492..ba7be7a6e21d233da490e2274094580c6d416459 100644
--- a/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/config.h
+++ b/sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/config.h
@@ -4,7 +4,7 @@
 #if !defined(PJ_HAS_FLOATING_POINT) || PJ_HAS_FLOATING_POINT==0
 #   define FIXED_POINT
 #   define USE_KISS_FFT
-#else
+#else 
 #   define FLOATING_POINT
 #   define USE_SMALLFT
 #endif
@@ -12,7 +12,7 @@
 #define EXPORT
 
 #if (defined(PJ_WIN32) && PJ_WIN32!=0) || \
-    (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0)
+    (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0) 
 #   include "../../speex/win32/config.h"
 #else
 #define inline __inline
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.dsp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/libspeex.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.dsp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/libspeex.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.vcp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/libspeex.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.vcp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/libspeex.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/libspeex.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/libspeex.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/libspeex.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/speex/speex_config_types.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/speex/speex_config_types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/speex/speex/speex_config_types.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/speex/speex/speex_config_types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/Makefile b/sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.dsp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/libsrtp.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.dsp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/libsrtp.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.vcp b/sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/libsrtp.vcp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.vcp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/libsrtp.vcp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/libsrtp.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/libsrtp.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/libsrtp.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/srtp_config.h b/sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/srtp_config.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/build/srtp/srtp_config.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/build/srtp/srtp_config.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/COPYRIGHT b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/COPYRIGHT
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/COPYRIGHT
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/COPYRIGHT
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/ChangeLog b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/ChangeLog
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/ChangeLog
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/ChangeLog
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/INSTALL b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/INSTALL
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/INSTALL
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/INSTALL
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/MACHINES b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/MACHINES
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/MACHINES
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/MACHINES
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/MANIFEST b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/MANIFEST
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/MANIFEST
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/MANIFEST
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/Makefile b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/README b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/README
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/README
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/README
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/add-test/add_test.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/add-test/add_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/add-test/add_test.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/add-test/add_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/add-test/add_test.dta b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/add-test/add_test.dta
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/add-test/add_test.dta
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/add-test/add_test.dta
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/config.h b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/config.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/config.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/config.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/gsm.h b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/gsm.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/gsm.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/gsm.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/private.h b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/private.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/private.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/private.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/proto.h b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/proto.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/proto.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/proto.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/toast.h b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/toast.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/toast.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/toast.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/unproto.h b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/unproto.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/inc/unproto.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/inc/unproto.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm.3 b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/man/gsm.3
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm.3
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/man/gsm.3
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_explode.3 b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/man/gsm_explode.3
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_explode.3
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/man/gsm_explode.3
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_option.3 b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/man/gsm_option.3
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_option.3
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/man/gsm_option.3
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_print.3 b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/man/gsm_print.3
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/man/gsm_print.3
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/man/gsm_print.3
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/add.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/add.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/add.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/add.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/code.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/code.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/code.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/code.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/debug.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/debug.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/debug.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/debug.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/decode.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/decode.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/decode.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/decode.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_create.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_create.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_create.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_create.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_decode.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_decode.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_decode.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_decode.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_destroy.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_destroy.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_destroy.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_destroy.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_encode.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_encode.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_encode.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_encode.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_explode.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_explode.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_explode.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_explode.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_implode.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_implode.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_implode.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_implode.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_option.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_option.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_option.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_option.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_print.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_print.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/gsm_print.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/gsm_print.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/long_term.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/long_term.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/long_term.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/long_term.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/lpc.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/lpc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/lpc.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/lpc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/preprocess.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/preprocess.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/preprocess.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/preprocess.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/rpe.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/rpe.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/rpe.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/rpe.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/short_term.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/short_term.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/short_term.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/short_term.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_alaw.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast_alaw.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_alaw.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast_alaw.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_audio.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast_audio.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_audio.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast_audio.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_lin.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast_lin.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_lin.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast_lin.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_ulaw.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast_ulaw.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/src/toast_ulaw.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/src/toast_ulaw.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/bitter.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/bitter.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/bitter.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/bitter.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/bitter.dta b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/bitter.dta
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/bitter.dta
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/bitter.dta
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/ginger.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/ginger.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/ginger.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/ginger.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/sour.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/sour.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour1.dta b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/sour1.dta
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour1.dta
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/sour1.dta
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour2.dta b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/sour2.dta
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sour2.dta
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/sour2.dta
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sweet.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/sweet.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/sweet.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/sweet.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/taste.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/taste.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/taste.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/taste.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/taste.h b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/taste.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tls/taste.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tls/taste.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/cod2lin.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/cod2lin.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/cod2lin.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/cod2lin.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/cod2txt.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/cod2txt.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/cod2txt.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/cod2txt.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/gsm2cod.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/gsm2cod.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/gsm2cod.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/gsm2cod.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/lin2cod.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/lin2cod.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/lin2cod.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/lin2cod.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/lin2txt.c b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/lin2txt.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/lin2txt.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/lin2txt.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/run b/sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/run
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/gsm/tst/run
rename to sflphone-common/libs/pjproject-1.0.3/third_party/gsm/tst/run
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/FrameClassify.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/FrameClassify.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/FrameClassify.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/FrameClassify.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/FrameClassify.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/FrameClassify.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/FrameClassify.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/FrameClassify.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCdecode.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/LPCdecode.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCdecode.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/LPCdecode.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCdecode.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/LPCdecode.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCdecode.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/LPCdecode.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCencode.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/LPCencode.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCencode.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/LPCencode.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCencode.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/LPCencode.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/LPCencode.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/LPCencode.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateConstructW.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/StateConstructW.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateConstructW.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/StateConstructW.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateConstructW.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/StateConstructW.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateConstructW.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/StateConstructW.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateSearchW.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/StateSearchW.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateSearchW.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/StateSearchW.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateSearchW.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/StateSearchW.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/StateSearchW.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/StateSearchW.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/anaFilter.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/anaFilter.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/anaFilter.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/anaFilter.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/anaFilter.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/anaFilter.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/anaFilter.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/anaFilter.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/constants.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/constants.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/constants.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/constants.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/constants.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/constants.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/constants.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/constants.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/createCB.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/createCB.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/createCB.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/createCB.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/createCB.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/createCB.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/createCB.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/createCB.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/doCPLC.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/doCPLC.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/doCPLC.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/doCPLC.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/doCPLC.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/doCPLC.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/doCPLC.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/doCPLC.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/enhancer.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/enhancer.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/enhancer.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/enhancer.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/enhancer.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/enhancer.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/enhancer.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/enhancer.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/filter.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/filter.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/filter.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/filter.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/filter.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/filter.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/filter.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/filter.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/gainquant.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/gainquant.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/gainquant.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/gainquant.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/gainquant.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/gainquant.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/gainquant.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/gainquant.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/getCBvec.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/getCBvec.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/getCBvec.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/getCBvec.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/getCBvec.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/getCBvec.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/getCBvec.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/getCBvec.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/helpfun.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/helpfun.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/helpfun.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/helpfun.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/helpfun.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/helpfun.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/helpfun.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/helpfun.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpInput.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/hpInput.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpInput.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/hpInput.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpInput.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/hpInput.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpInput.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/hpInput.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpOutput.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/hpOutput.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpOutput.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/hpOutput.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpOutput.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/hpOutput.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/hpOutput.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/hpOutput.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBConstruct.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iCBConstruct.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBConstruct.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iCBConstruct.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBConstruct.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iCBConstruct.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBConstruct.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iCBConstruct.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBSearch.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iCBSearch.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBSearch.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iCBSearch.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBSearch.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iCBSearch.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iCBSearch.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iCBSearch.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_decode.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_decode.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_decode.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_decode.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_decode.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_decode.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_decode.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_decode.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_define.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_define.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_define.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_define.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_encode.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_encode.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_encode.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_encode.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_encode.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_encode.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_encode.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_encode.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_test.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_test.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/iLBC_test.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/iLBC_test.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/lsf.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/lsf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/lsf.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/lsf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/lsf.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/lsf.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/lsf.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/lsf.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/packing.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/packing.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/packing.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/packing.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/packing.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/packing.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/packing.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/packing.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/syntFilter.c b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/syntFilter.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/syntFilter.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/syntFilter.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/syntFilter.h b/sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/syntFilter.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/ilbc/syntFilter.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/ilbc/syntFilter.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/mp3/BladeMP3EncDLL.h b/sflphone-common/libs/pjproject-1.0.3/third_party/mp3/BladeMP3EncDLL.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/mp3/BladeMP3EncDLL.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/mp3/BladeMP3EncDLL.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/mp3/mp3_port.h b/sflphone-common/libs/pjproject-1.0.3/third_party/mp3/mp3_port.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/mp3/mp3_port.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/mp3/mp3_port.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/mp3/mp3_writer.c b/sflphone-common/libs/pjproject-1.0.3/third_party/mp3/mp3_writer.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/mp3/mp3_writer.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/mp3/mp3_writer.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/Doxyfile b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/Doxyfile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/Doxyfile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/Doxyfile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/LICENSE.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/LICENSE.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/LICENSE.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/LICENSE.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/README.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/README.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/README.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/README.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/SConstruct b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/SConstruct
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/SConstruct
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/SConstruct
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/Makefile-dll b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/Makefile-dll
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/Makefile-dll
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/Makefile-dll
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/Makefile-static b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/Makefile-static
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/Makefile-static
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/Makefile-static
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/portaudio-dll.dev b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/portaudio-dll.dev
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/portaudio-dll.dev
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/portaudio-dll.dev
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/portaudio-static.dev b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/portaudio-static.dev
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/portaudio-static.dev
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/portaudio-static.dev
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/readme.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/readme.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/dev-cpp/readme.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/dev-cpp/readme.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.def b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.def
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.dsp b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.dsp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.dsp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.dsp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.dsw b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.dsw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.dsw
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.dsw
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.sln b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.sln
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.sln
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.sln
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/portaudio.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/portaudio.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/readme.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/readme.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/msvc/readme.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/msvc/readme.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/scons/SConscript_common b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/scons/SConscript_common
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/scons/SConscript_common
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/scons/SConscript_common
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/scons/SConscript_opts b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/scons/SConscript_opts
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/build/scons/SConscript_opts
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/build/scons/SConscript_opts
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/config.guess b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/config.guess
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/config.guess
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/config.guess
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/config.sub b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/config.sub
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/config.sub
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/config.sub
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/configure b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/configure
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/configure
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/configure
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/configure.in b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/configure.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/configure.in
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/configure.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/depcomp b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/depcomp
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/depcomp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/depcomp
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/fixdir.bat b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/fixdir.bat
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/fixdir.bat
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/fixdir.bat
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/fixfile.bat b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/fixfile.bat
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/fixfile.bat
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/fixfile.bat
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_asio.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_asio.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_asio.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_asio.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_jack.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_jack.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_jack.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_jack.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_linux_alsa.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_linux_alsa.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_linux_alsa.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_linux_alsa.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_mac_core.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_mac_core.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_mac_core.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_mac_core.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_ds.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_win_ds.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_ds.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_win_ds.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_waveformat.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_win_waveformat.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_waveformat.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_win_waveformat.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_wmme.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_win_wmme.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/pa_win_wmme.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/pa_win_wmme.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/portaudio.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/portaudio.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/include/portaudio.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/include/portaudio.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/index.html b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/index.html
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/index.html
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/index.html
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/install-sh b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/install-sh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/install-sh
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/install-sh
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/ltmain.sh b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/ltmain.sh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/ltmain.sh
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/ltmain.sh
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/missing b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/missing
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/missing
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/missing
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/README.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/README.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/README.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/README.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/pablio.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/pablio.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.def b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/pablio.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.def
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/pablio.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/pablio.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/pablio.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/pablio.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_rw.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/test_rw.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_rw.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/test_rw.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_rw_echo.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/test_rw_echo.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_rw_echo.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/test_rw_echo.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_w_saw.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/test_w_saw.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_w_saw.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/test_w_saw.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_w_saw8.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/test_w_saw8.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/pablio/test_w_saw8.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/pablio/test_w_saw8.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/portaudio-2.0.pc.in b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/portaudio-2.0.pc.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/portaudio-2.0.pc.in
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/portaudio-2.0.pc.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/SConscript b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/SConscript
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/SConscript
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/SConscript
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_allocation.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_allocation.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_allocation.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_allocation.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_allocation.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_allocation.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_allocation.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_allocation.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_converters.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_converters.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_converters.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_converters.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_converters.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_converters.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_converters.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_converters.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_cpuload.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_cpuload.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_cpuload.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_cpuload.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_cpuload.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_cpuload.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_cpuload.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_cpuload.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_debugprint.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_debugprint.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_debugprint.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_debugprint.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_debugprint.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_debugprint.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_debugprint.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_debugprint.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_dither.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_dither.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_dither.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_dither.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_dither.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_dither.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_dither.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_dither.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_endianness.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_endianness.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_endianness.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_endianness.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_front.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_front.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_front.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_front.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_hostapi.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_hostapi.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_hostapi.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_hostapi.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_memorybarrier.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_memorybarrier.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_memorybarrier.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_memorybarrier.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_process.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_process.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_process.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_process.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_process.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_process.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_process.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_process.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_ringbuffer.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_ringbuffer.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_ringbuffer.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_ringbuffer.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_ringbuffer.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_ringbuffer.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_ringbuffer.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_ringbuffer.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_skeleton.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_skeleton.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_skeleton.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_skeleton.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_stream.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_stream.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_stream.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_stream.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_stream.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_stream.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_stream.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_stream.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_trace.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_trace.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_trace.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_trace.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_trace.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_trace.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_trace.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_trace.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_types.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_types.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_util.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_util.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/common/pa_util.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/common/pa_util.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/ASIO-README.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/ASIO-README.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/ASIO-README.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/ASIO-README.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/Callback_adaptation_.pdf b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/Callback_adaptation_.pdf
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/Callback_adaptation_.pdf
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/Callback_adaptation_.pdf
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp
similarity index 87%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp
index 1b4b33781f155d3eb78dbbfe53dba83bee14ac08..8dfefbd67b95ffc0d64194ab75ab7a05e1b1f72f 100644
--- a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp
@@ -71,7 +71,7 @@
     (IUnknown functions)
     0   virtual HRESULT STDMETHODCALLTYPE (*QueryInterface)(REFIID riid, void **ppv) = 0;
     4   virtual ULONG STDMETHODCALLTYPE (*AddRef)() = 0;
-    8   virtual ULONG STDMETHODCALLTYPE (*Release)() = 0;
+    8   virtual ULONG STDMETHODCALLTYPE (*Release)() = 0;      
 
     (IASIO functions)
     12	virtual ASIOBool (*init)(void *sysHandle) = 0;
@@ -128,7 +128,7 @@
     with MSVC, and requires that you ship the OpenASIO DLL with your
     application.
 
-
+    
     ACKNOWLEDGEMENTS
 
     Ross Bencina: worked out the thiscall details above, wrote the original
@@ -186,7 +186,7 @@ extern IASIO* theAsioDriver;
 
 // The following macros define the inline assembler for BORLAND first then gcc
 
-#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__)
+#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__)          
 
 
 #define CALL_THISCALL_0( resultName, thisPtr, funcOffset )\
@@ -277,7 +277,7 @@ extern IASIO* theAsioDriver;
                           :"=a"(resultName) /* Output Operands */           \
                           :"c"(thisPtr)     /* Input Operands */            \
                          );                                                 \
- 
+
 
 #define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 )                 \
     __asm__ __volatile__ ("pushl %0\n\t"                                    \
@@ -287,7 +287,7 @@ extern IASIO* theAsioDriver;
                           :"r"(param1),     /* Input Operands */            \
                            "c"(thisPtr)                                     \
                          );                                                 \
- 
+
 
 #define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 )          \
     __asm__ __volatile__ ("pushl %1\n\t"                                    \
@@ -297,7 +297,7 @@ extern IASIO* theAsioDriver;
                           :"r"(param1),     /* Input Operands */            \
                            "c"(thisPtr)                                     \
                           );                                                \
- 
+
 
 #define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 )   \
     __asm__ __volatile__ ("pushl 4(%1)\n\t"                                 \
@@ -310,7 +310,7 @@ extern IASIO* theAsioDriver;
                            /* when using GCC 3.3.3, and maybe later versions*/\
                            "c"(thisPtr)                                     \
                           );                                                \
- 
+
 
 #define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 )  \
     __asm__ __volatile__ ("pushl %1\n\t"                                    \
@@ -322,7 +322,7 @@ extern IASIO* theAsioDriver;
                            "r"(param1),                                     \
                            "c"(thisPtr)                                     \
                           );                                                \
- 
+
 
 #define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\
     __asm__ __volatile__ ("pushl %1\n\t"                                    \
@@ -338,7 +338,7 @@ extern IASIO* theAsioDriver;
                            "r"(param1),                                     \
                            "c"(thisPtr)                                     \
                           );                                                \
- 
+
 #endif
 
 
@@ -354,8 +354,8 @@ IASIOThiscallResolver::IASIOThiscallResolver()
 }
 
 // Constructor called from ASIOInit() below
-IASIOThiscallResolver::IASIOThiscallResolver (IASIO* that)
-        : that_ (that)
+IASIOThiscallResolver::IASIOThiscallResolver(IASIO* that)
+: that_( that )
 {
 }
 
@@ -363,11 +363,11 @@ IASIOThiscallResolver::IASIOThiscallResolver (IASIO* that)
 // really a COM object, just a wrapper which will work with the ASIO SDK.
 // If you wanted to use ASIO without the SDK you might want to implement COM
 // aggregation in these methods.
-HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface (REFIID riid, void **ppv)
+HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface(REFIID riid, void **ppv)
 {
-    (void) riid;    // suppress unused variable warning
+    (void)riid;     // suppress unused variable warning
 
-    assert (false);  // this function should never be called by the ASIO SDK.
+    assert( false ); // this function should never be called by the ASIO SDK.
 
     *ppv = NULL;
     return E_NOINTERFACE;
@@ -375,176 +375,176 @@ HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface (REFIID riid, vo
 
 ULONG STDMETHODCALLTYPE IASIOThiscallResolver::AddRef()
 {
-    assert (false);  // this function should never be called by the ASIO SDK.
+    assert( false ); // this function should never be called by the ASIO SDK.
 
     return 1;
 }
 
 ULONG STDMETHODCALLTYPE IASIOThiscallResolver::Release()
 {
-    assert (false);  // this function should never be called by the ASIO SDK.
-
+    assert( false ); // this function should never be called by the ASIO SDK.
+    
     return 1;
 }
 
 
 // Implement the IASIO interface methods by performing the vptr manipulation
 // described above then delegating to the real implementation.
-ASIOBool IASIOThiscallResolver::init (void *sysHandle)
+ASIOBool IASIOThiscallResolver::init(void *sysHandle)
 {
     ASIOBool result;
-    CALL_THISCALL_1 (result, that_, 12, sysHandle);
+    CALL_THISCALL_1( result, that_, 12, sysHandle );
     return result;
 }
 
-void IASIOThiscallResolver::getDriverName (char *name)
+void IASIOThiscallResolver::getDriverName(char *name)
 {
-    CALL_VOID_THISCALL_1 (that_, 16, name);
+    CALL_VOID_THISCALL_1( that_, 16, name );
 }
 
 long IASIOThiscallResolver::getDriverVersion()
 {
     ASIOBool result;
-    CALL_THISCALL_0 (result, that_, 20);
+    CALL_THISCALL_0( result, that_, 20 );
     return result;
 }
 
-void IASIOThiscallResolver::getErrorMessage (char *string)
+void IASIOThiscallResolver::getErrorMessage(char *string)
 {
-    CALL_VOID_THISCALL_1 (that_, 24, string);
+     CALL_VOID_THISCALL_1( that_, 24, string );
 }
 
 ASIOError IASIOThiscallResolver::start()
 {
     ASIOBool result;
-    CALL_THISCALL_0 (result, that_, 28);
+    CALL_THISCALL_0( result, that_, 28 );
     return result;
 }
 
 ASIOError IASIOThiscallResolver::stop()
 {
     ASIOBool result;
-    CALL_THISCALL_0 (result, that_, 32);
+    CALL_THISCALL_0( result, that_, 32 );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::getChannels (long *numInputChannels, long *numOutputChannels)
+ASIOError IASIOThiscallResolver::getChannels(long *numInputChannels, long *numOutputChannels)
 {
     ASIOBool result;
-    CALL_THISCALL_2 (result, that_, 36, numInputChannels, numOutputChannels);
+    CALL_THISCALL_2( result, that_, 36, numInputChannels, numOutputChannels );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::getLatencies (long *inputLatency, long *outputLatency)
+ASIOError IASIOThiscallResolver::getLatencies(long *inputLatency, long *outputLatency)
 {
     ASIOBool result;
-    CALL_THISCALL_2 (result, that_, 40, inputLatency, outputLatency);
+    CALL_THISCALL_2( result, that_, 40, inputLatency, outputLatency );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::getBufferSize (long *minSize, long *maxSize,
+ASIOError IASIOThiscallResolver::getBufferSize(long *minSize, long *maxSize,
         long *preferredSize, long *granularity)
 {
     ASIOBool result;
-    CALL_THISCALL_4 (result, that_, 44, minSize, maxSize, preferredSize, granularity);
+    CALL_THISCALL_4( result, that_, 44, minSize, maxSize, preferredSize, granularity );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::canSampleRate (ASIOSampleRate sampleRate)
+ASIOError IASIOThiscallResolver::canSampleRate(ASIOSampleRate sampleRate)
 {
     ASIOBool result;
-    CALL_THISCALL_1_DOUBLE (result, that_, 48, sampleRate);
+    CALL_THISCALL_1_DOUBLE( result, that_, 48, sampleRate );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::getSampleRate (ASIOSampleRate *sampleRate)
+ASIOError IASIOThiscallResolver::getSampleRate(ASIOSampleRate *sampleRate)
 {
     ASIOBool result;
-    CALL_THISCALL_1 (result, that_, 52, sampleRate);
+    CALL_THISCALL_1( result, that_, 52, sampleRate );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::setSampleRate (ASIOSampleRate sampleRate)
-{
+ASIOError IASIOThiscallResolver::setSampleRate(ASIOSampleRate sampleRate)
+{    
     ASIOBool result;
-    CALL_THISCALL_1_DOUBLE (result, that_, 56, sampleRate);
+    CALL_THISCALL_1_DOUBLE( result, that_, 56, sampleRate );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::getClockSources (ASIOClockSource *clocks, long *numSources)
+ASIOError IASIOThiscallResolver::getClockSources(ASIOClockSource *clocks, long *numSources)
 {
     ASIOBool result;
-    CALL_THISCALL_2 (result, that_, 60, clocks, numSources);
+    CALL_THISCALL_2( result, that_, 60, clocks, numSources );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::setClockSource (long reference)
+ASIOError IASIOThiscallResolver::setClockSource(long reference)
 {
     ASIOBool result;
-    CALL_THISCALL_1 (result, that_, 64, reference);
+    CALL_THISCALL_1( result, that_, 64, reference );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::getSamplePosition (ASIOSamples *sPos, ASIOTimeStamp *tStamp)
+ASIOError IASIOThiscallResolver::getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp)
 {
     ASIOBool result;
-    CALL_THISCALL_2 (result, that_, 68, sPos, tStamp);
+    CALL_THISCALL_2( result, that_, 68, sPos, tStamp );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::getChannelInfo (ASIOChannelInfo *info)
+ASIOError IASIOThiscallResolver::getChannelInfo(ASIOChannelInfo *info)
 {
     ASIOBool result;
-    CALL_THISCALL_1 (result, that_, 72, info);
+    CALL_THISCALL_1( result, that_, 72, info );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::createBuffers (ASIOBufferInfo *bufferInfos,
+ASIOError IASIOThiscallResolver::createBuffers(ASIOBufferInfo *bufferInfos,
         long numChannels, long bufferSize, ASIOCallbacks *callbacks)
 {
     ASIOBool result;
-    CALL_THISCALL_4 (result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks);
+    CALL_THISCALL_4( result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks );
     return result;
 }
 
 ASIOError IASIOThiscallResolver::disposeBuffers()
 {
     ASIOBool result;
-    CALL_THISCALL_0 (result, that_, 80);
+    CALL_THISCALL_0( result, that_, 80 );
     return result;
 }
 
 ASIOError IASIOThiscallResolver::controlPanel()
 {
     ASIOBool result;
-    CALL_THISCALL_0 (result, that_, 84);
+    CALL_THISCALL_0( result, that_, 84 );
     return result;
 }
 
-ASIOError IASIOThiscallResolver::future (long selector,void *opt)
+ASIOError IASIOThiscallResolver::future(long selector,void *opt)
 {
     ASIOBool result;
-    CALL_THISCALL_2 (result, that_, 88, selector, opt);
+    CALL_THISCALL_2( result, that_, 88, selector, opt );
     return result;
 }
 
 ASIOError IASIOThiscallResolver::outputReady()
 {
     ASIOBool result;
-    CALL_THISCALL_0 (result, that_, 92);
+    CALL_THISCALL_0( result, that_, 92 );
     return result;
 }
 
 
 // Implement our substitute ASIOInit() method
-ASIOError IASIOThiscallResolver::ASIOInit (ASIODriverInfo *info)
+ASIOError IASIOThiscallResolver::ASIOInit(ASIODriverInfo *info)
 {
     // To ensure that our instance's vptr is correctly constructed, even if
     // ASIOInit is called prior to main(), we explicitly call its constructor
     // (potentially over the top of an existing instance). Note that this is
     // pretty ugly, and is only safe because IASIOThiscallResolver has no
     // destructor and contains no objects with destructors.
-    new ( (void*) &instance) IASIOThiscallResolver (theAsioDriver);
+    new((void*)&instance) IASIOThiscallResolver( theAsioDriver );
 
     // Interpose between ASIO client code and the real driver.
     theAsioDriver = &instance;
@@ -553,7 +553,7 @@ ASIOError IASIOThiscallResolver::ASIOInit (ASIODriverInfo *info)
     // real driver because theAsioDriver is reset to zero in ASIOExit().
 
     // Delegate to the real ASIOInit
-    return ::ASIOInit (info);
+	return ::ASIOInit(info);
 }
 
 
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/pa_asio.cpp b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/pa_asio.cpp
similarity index 55%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/pa_asio.cpp
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/pa_asio.cpp
index cf54465cfa65c74901ed79159748ab6f2232d66f..1ba67e92ae9080876f6b83b5550b241819acfe0f 100644
--- a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/asio/pa_asio.cpp
+++ b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/asio/pa_asio.cpp
@@ -29,13 +29,13 @@
  */
 
 /*
- * The text above constitutes the entire PortAudio license; however,
+ * The text above constitutes the entire PortAudio license; however, 
  * the PortAudio community also makes the following non-binding requests:
  *
  * Any person wishing to distribute modifications to the Software is
  * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also
- * requested that these non-binding requests be included along with the
+ * they can be incorporated into the canonical version. It is also 
+ * requested that these non-binding requests be included along with the 
  * license above.
  */
 
@@ -83,7 +83,7 @@
 
     @todo review ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable
 
-    @todo review Blocking i/o latency computations in OpenStream(), changing ring
+    @todo review Blocking i/o latency computations in OpenStream(), changing ring 
           buffer to a non-power-of-two structure could reduce blocking i/o latency.
 
     @todo implement IsFormatSupported
@@ -171,8 +171,8 @@
 
 /* external reference to ASIO SDK's asioDrivers.
 
- This is a bit messy because we want to explicitly manage
- allocation/deallocation of this structure, but some layers of the SDK
+ This is a bit messy because we want to explicitly manage 
+ allocation/deallocation of this structure, but some layers of the SDK 
  which we currently use (eg the implementation in asio.cpp) still
  use this global version.
 
@@ -190,9 +190,9 @@ extern AsioDrivers* asioDrivers;
 
 /* prototypes for functions declared in this file */
 
-extern "C" PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex);
-static void Terminate (struct PaUtilHostApiRepresentation *hostApi);
-static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
+extern "C" PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex );
+static void Terminate( struct PaUtilHostApiRepresentation *hostApi );
+static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
                            PaStream** s,
                            const PaStreamParameters *inputParameters,
                            const PaStreamParameters *outputParameters,
@@ -200,109 +200,82 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
                            unsigned long framesPerBuffer,
                            PaStreamFlags streamFlags,
                            PaStreamCallback *streamCallback,
-                           void *userData);
-static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi,
+                           void *userData );
+static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
                                   const PaStreamParameters *inputParameters,
                                   const PaStreamParameters *outputParameters,
-                                  double sampleRate);
-static PaError CloseStream (PaStream* stream);
-static PaError StartStream (PaStream *stream);
-static PaError StopStream (PaStream *stream);
-static PaError AbortStream (PaStream *stream);
-static PaError IsStreamStopped (PaStream *s);
-static PaError IsStreamActive (PaStream *stream);
-static PaTime GetStreamTime (PaStream *stream);
-static double GetStreamCpuLoad (PaStream* stream);
-static PaError ReadStream (PaStream* stream, void *buffer, unsigned long frames);
-static PaError WriteStream (PaStream* stream, const void *buffer, unsigned long frames);
-static signed long GetStreamReadAvailable (PaStream* stream);
-static signed long GetStreamWriteAvailable (PaStream* stream);
+                                  double sampleRate );
+static PaError CloseStream( PaStream* stream );
+static PaError StartStream( PaStream *stream );
+static PaError StopStream( PaStream *stream );
+static PaError AbortStream( PaStream *stream );
+static PaError IsStreamStopped( PaStream *s );
+static PaError IsStreamActive( PaStream *stream );
+static PaTime GetStreamTime( PaStream *stream );
+static double GetStreamCpuLoad( PaStream* stream );
+static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames );
+static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames );
+static signed long GetStreamReadAvailable( PaStream* stream );
+static signed long GetStreamWriteAvailable( PaStream* stream );
 
 /* Blocking i/o callback function. */
-static int BlockingIoPaCallback (const void                     *inputBuffer    ,
-                                 void                     *outputBuffer   ,
-                                 unsigned long             framesPerBuffer,
-                                 const PaStreamCallbackTimeInfo *timeInfo       ,
-                                 PaStreamCallbackFlags     statusFlags    ,
-                                 void                     *userData);
+static int BlockingIoPaCallback(const void                     *inputBuffer    ,
+                                      void                     *outputBuffer   ,
+                                      unsigned long             framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *timeInfo       ,
+                                      PaStreamCallbackFlags     statusFlags    ,
+                                      void                     *userData       );
 
 /* our ASIO callback functions */
 
-static void bufferSwitch (long index, ASIOBool processNow);
-static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool processNow);
-static void sampleRateChanged (ASIOSampleRate sRate);
-static long asioMessages (long selector, long value, void* message, double* opt);
+static void bufferSwitch(long index, ASIOBool processNow);
+static ASIOTime *bufferSwitchTimeInfo(ASIOTime *timeInfo, long index, ASIOBool processNow);
+static void sampleRateChanged(ASIOSampleRate sRate);
+static long asioMessages(long selector, long value, void* message, double* opt);
 
-static ASIOCallbacks asioCallbacks_ = { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo };
+static ASIOCallbacks asioCallbacks_ =
+    { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo };
 
 
 #define PA_ASIO_SET_LAST_HOST_ERROR( errorCode, errorText ) \
     PaUtil_SetLastHostErrorInfo( paASIO, errorCode, errorText )
 
 
-static void PaAsio_SetLastSystemError (DWORD errorCode)
+static void PaAsio_SetLastSystemError( DWORD errorCode )
 {
     LPVOID lpMsgBuf;
-    FormatMessage (
+    FormatMessage(
         FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
         NULL,
         errorCode,
-        MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
+        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
         (LPTSTR) &lpMsgBuf,
         0,
         NULL
     );
-    PaUtil_SetLastHostErrorInfo (paASIO, errorCode, (const char*) lpMsgBuf);
-    LocalFree (lpMsgBuf);
+    PaUtil_SetLastHostErrorInfo( paASIO, errorCode, (const char*)lpMsgBuf );
+    LocalFree( lpMsgBuf );
 }
 
 #define PA_ASIO_SET_LAST_SYSTEM_ERROR( errorCode ) \
     PaAsio_SetLastSystemError( errorCode )
 
 
-static const char* PaAsio_GetAsioErrorText (ASIOError asioError)
+static const char* PaAsio_GetAsioErrorText( ASIOError asioError )
 {
     const char *result;
 
-    switch (asioError) {
-
+    switch( asioError ){
         case ASE_OK:
-
-        case ASE_SUCCESS:
-            result = "Success";
-            break;
-
-        case ASE_NotPresent:
-            result = "Hardware input or output is not present or available";
-            break;
-
-        case ASE_HWMalfunction:
-            result = "Hardware is malfunctioning";
-            break;
-
-        case ASE_InvalidParameter:
-            result = "Input parameter invalid";
-            break;
-
-        case ASE_InvalidMode:
-            result = "Hardware is in a bad mode or used in a bad mode";
-            break;
-
-        case ASE_SPNotAdvancing:
-            result = "Hardware is not running when sample position is inquired";
-            break;
-
-        case ASE_NoClock:
-            result = "Sample clock or rate cannot be determined or is not present";
-            break;
-
-        case ASE_NoMemory:
-            result = "Not enough memory for completing the request";
-            break;
-
-        default:
-            result = "Unknown ASIO error";
-            break;
+        case ASE_SUCCESS:           result = "Success"; break;
+        case ASE_NotPresent:        result = "Hardware input or output is not present or available"; break;
+        case ASE_HWMalfunction:     result = "Hardware is malfunctioning"; break;
+        case ASE_InvalidParameter:  result = "Input parameter invalid"; break;
+        case ASE_InvalidMode:       result = "Hardware is in a bad mode or used in a bad mode"; break;
+        case ASE_SPNotAdvancing:    result = "Hardware is not running when sample position is inquired"; break;
+        case ASE_NoClock:           result = "Sample clock or rate cannot be determined or is not present"; break;
+        case ASE_NoMemory:          result = "Not enough memory for completing the request"; break;
+        default:                    result = "Unknown ASIO error"; break;
     }
 
     return result;
@@ -317,45 +290,30 @@ static const char* PaAsio_GetAsioErrorText (ASIOError asioError)
 
 // Atomic increment and decrement operations
 #if MAC
-/* need to be implemented on Mac */
-inline long PaAsio_AtomicIncrement (volatile long* v)
-{
-    return ++ (*const_cast<long*> (v));
-}
-
-inline long PaAsio_AtomicDecrement (volatile long* v)
-{
-    return -- (*const_cast<long*> (v));
-}
-
+    /* need to be implemented on Mac */
+    inline long PaAsio_AtomicIncrement(volatile long* v) {return ++(*const_cast<long*>(v));}
+    inline long PaAsio_AtomicDecrement(volatile long* v) {return --(*const_cast<long*>(v));}
 #elif WINDOWS
-inline long PaAsio_AtomicIncrement (volatile long* v)
-{
-    return InterlockedIncrement (const_cast<long*> (v));
-}
-
-inline long PaAsio_AtomicDecrement (volatile long* v)
-{
-    return InterlockedDecrement (const_cast<long*> (v));
-}
-
+    inline long PaAsio_AtomicIncrement(volatile long* v) {return InterlockedIncrement(const_cast<long*>(v));}
+    inline long PaAsio_AtomicDecrement(volatile long* v) {return InterlockedDecrement(const_cast<long*>(v));}
 #endif
 
 
 
-typedef struct PaAsioDriverInfo {
+typedef struct PaAsioDriverInfo
+{
     ASIODriverInfo asioDriverInfo;
     long inputChannelCount, outputChannelCount;
     long bufferMinSize, bufferMaxSize, bufferPreferredSize, bufferGranularity;
     bool postOutput;
 }
-
 PaAsioDriverInfo;
 
 
 /* PaAsioHostApiRepresentation - host api datastructure specific to this implementation */
 
-typedef struct {
+typedef struct
+{
     PaUtilHostApiRepresentation inheritedHostApiRep;
     PaUtilStreamInterface callbackStreamInterface;
     PaUtilStreamInterface blockingStreamInterface;
@@ -364,7 +322,7 @@ typedef struct {
 
     AsioDrivers *asioDrivers;
     void *systemSpecific;
-
+    
     /* the ASIO C API only allows one ASIO driver to be open at a time,
         so we keep track of whether we have the driver open here, and
         use this information to return errors from OpenStream if the
@@ -379,7 +337,6 @@ typedef struct {
     PaDeviceIndex openAsioDeviceIndex;
     PaAsioDriverInfo openAsioDriverInfo;
 }
-
 PaAsioHostApiRepresentation;
 
 
@@ -387,206 +344,117 @@ PaAsioHostApiRepresentation;
     Retrieve <driverCount> driver names from ASIO, returned in a char**
     allocated in <group>.
 */
-static char **GetAsioDriverNames (PaAsioHostApiRepresentation *asioHostApi, PaUtilAllocationGroup *group, long driverCount)
+static char **GetAsioDriverNames( PaAsioHostApiRepresentation *asioHostApi, PaUtilAllocationGroup *group, long driverCount )
 {
     char **result = 0;
     int i;
 
-    result = (char**) PaUtil_GroupAllocateMemory (
-                 group, sizeof (char*) * driverCount);
-
-    if (!result)
+    result =(char**)PaUtil_GroupAllocateMemory(
+            group, sizeof(char*) * driverCount );
+    if( !result )
         goto error;
 
-    result[0] = (char*) PaUtil_GroupAllocateMemory (
-                    group, 32 * driverCount);
-
-    if (!result[0])
+    result[0] = (char*)PaUtil_GroupAllocateMemory(
+            group, 32 * driverCount );
+    if( !result[0] )
         goto error;
 
-    for (i=0; i<driverCount; ++i)
+    for( i=0; i<driverCount; ++i )
         result[i] = result[0] + (32 * i);
 
-    asioHostApi->asioDrivers->getDriverNames (result, driverCount);
+    asioHostApi->asioDrivers->getDriverNames( result, driverCount );
 
 error:
     return result;
 }
 
 
-static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat (ASIOSampleType type)
+static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat(ASIOSampleType type)
 {
     switch (type) {
-
         case ASIOSTInt16MSB:
-
         case ASIOSTInt16LSB:
-            return paInt16;
+                return paInt16;
 
         case ASIOSTFloat32MSB:
-
         case ASIOSTFloat32LSB:
-
         case ASIOSTFloat64MSB:
-
         case ASIOSTFloat64LSB:
-            return paFloat32;
+                return paFloat32;
 
         case ASIOSTInt32MSB:
-
         case ASIOSTInt32LSB:
-
         case ASIOSTInt32MSB16:
-
         case ASIOSTInt32LSB16:
-
         case ASIOSTInt32MSB18:
-
         case ASIOSTInt32MSB20:
-
         case ASIOSTInt32MSB24:
-
         case ASIOSTInt32LSB18:
-
         case ASIOSTInt32LSB20:
-
         case ASIOSTInt32LSB24:
-            return paInt32;
+                return paInt32;
 
         case ASIOSTInt24MSB:
-
         case ASIOSTInt24LSB:
-            return paInt24;
+                return paInt24;
 
         default:
-            return paCustomFormat;
+                return paCustomFormat;
     }
 }
 
-void AsioSampleTypeLOG (ASIOSampleType type)
+void AsioSampleTypeLOG(ASIOSampleType type)
 {
     switch (type) {
-
-        case ASIOSTInt16MSB:
-            PA_DEBUG ( ("ASIOSTInt16MSB\n"));
-            break;
-
-        case ASIOSTInt16LSB:
-            PA_DEBUG ( ("ASIOSTInt16LSB\n"));
-            break;
-
-        case ASIOSTFloat32MSB:
-            PA_DEBUG ( ("ASIOSTFloat32MSB\n"));
-            break;
-
-        case ASIOSTFloat32LSB:
-            PA_DEBUG ( ("ASIOSTFloat32LSB\n"));
-            break;
-
-        case ASIOSTFloat64MSB:
-            PA_DEBUG ( ("ASIOSTFloat64MSB\n"));
-            break;
-
-        case ASIOSTFloat64LSB:
-            PA_DEBUG ( ("ASIOSTFloat64LSB\n"));
-            break;
-
-        case ASIOSTInt32MSB:
-            PA_DEBUG ( ("ASIOSTInt32MSB\n"));
-            break;
-
-        case ASIOSTInt32LSB:
-            PA_DEBUG ( ("ASIOSTInt32LSB\n"));
-            break;
-
-        case ASIOSTInt32MSB16:
-            PA_DEBUG ( ("ASIOSTInt32MSB16\n"));
-            break;
-
-        case ASIOSTInt32LSB16:
-            PA_DEBUG ( ("ASIOSTInt32LSB16\n"));
-            break;
-
-        case ASIOSTInt32MSB18:
-            PA_DEBUG ( ("ASIOSTInt32MSB18\n"));
-            break;
-
-        case ASIOSTInt32MSB20:
-            PA_DEBUG ( ("ASIOSTInt32MSB20\n"));
-            break;
-
-        case ASIOSTInt32MSB24:
-            PA_DEBUG ( ("ASIOSTInt32MSB24\n"));
-            break;
-
-        case ASIOSTInt32LSB18:
-            PA_DEBUG ( ("ASIOSTInt32LSB18\n"));
-            break;
-
-        case ASIOSTInt32LSB20:
-            PA_DEBUG ( ("ASIOSTInt32LSB20\n"));
-            break;
-
-        case ASIOSTInt32LSB24:
-            PA_DEBUG ( ("ASIOSTInt32LSB24\n"));
-            break;
-
-        case ASIOSTInt24MSB:
-            PA_DEBUG ( ("ASIOSTInt24MSB\n"));
-            break;
-
-        case ASIOSTInt24LSB:
-            PA_DEBUG ( ("ASIOSTInt24LSB\n"));
-            break;
-
-        default:
-            PA_DEBUG ( ("Custom Format%d\n",type));
-            break;
+        case ASIOSTInt16MSB:  PA_DEBUG(("ASIOSTInt16MSB\n"));  break;
+        case ASIOSTInt16LSB:  PA_DEBUG(("ASIOSTInt16LSB\n"));  break;
+        case ASIOSTFloat32MSB:PA_DEBUG(("ASIOSTFloat32MSB\n"));break;
+        case ASIOSTFloat32LSB:PA_DEBUG(("ASIOSTFloat32LSB\n"));break;
+        case ASIOSTFloat64MSB:PA_DEBUG(("ASIOSTFloat64MSB\n"));break;
+        case ASIOSTFloat64LSB:PA_DEBUG(("ASIOSTFloat64LSB\n"));break;
+        case ASIOSTInt32MSB:  PA_DEBUG(("ASIOSTInt32MSB\n"));  break;
+        case ASIOSTInt32LSB:  PA_DEBUG(("ASIOSTInt32LSB\n"));  break;
+        case ASIOSTInt32MSB16:PA_DEBUG(("ASIOSTInt32MSB16\n"));break;
+        case ASIOSTInt32LSB16:PA_DEBUG(("ASIOSTInt32LSB16\n"));break;
+        case ASIOSTInt32MSB18:PA_DEBUG(("ASIOSTInt32MSB18\n"));break;
+        case ASIOSTInt32MSB20:PA_DEBUG(("ASIOSTInt32MSB20\n"));break;
+        case ASIOSTInt32MSB24:PA_DEBUG(("ASIOSTInt32MSB24\n"));break;
+        case ASIOSTInt32LSB18:PA_DEBUG(("ASIOSTInt32LSB18\n"));break;
+        case ASIOSTInt32LSB20:PA_DEBUG(("ASIOSTInt32LSB20\n"));break;
+        case ASIOSTInt32LSB24:PA_DEBUG(("ASIOSTInt32LSB24\n"));break;
+        case ASIOSTInt24MSB:  PA_DEBUG(("ASIOSTInt24MSB\n"));  break;
+        case ASIOSTInt24LSB:  PA_DEBUG(("ASIOSTInt24LSB\n"));  break;
+        default:              PA_DEBUG(("Custom Format%d\n",type));break;
 
     }
 }
 
-static int BytesPerAsioSample (ASIOSampleType sampleType)
+static int BytesPerAsioSample( ASIOSampleType sampleType )
 {
     switch (sampleType) {
-
         case ASIOSTInt16MSB:
-
         case ASIOSTInt16LSB:
             return 2;
 
         case ASIOSTFloat64MSB:
-
         case ASIOSTFloat64LSB:
             return 8;
 
         case ASIOSTFloat32MSB:
-
         case ASIOSTFloat32LSB:
-
         case ASIOSTInt32MSB:
-
         case ASIOSTInt32LSB:
-
         case ASIOSTInt32MSB16:
-
         case ASIOSTInt32LSB16:
-
         case ASIOSTInt32MSB18:
-
         case ASIOSTInt32MSB20:
-
         case ASIOSTInt32MSB24:
-
         case ASIOSTInt32LSB18:
-
         case ASIOSTInt32LSB20:
-
         case ASIOSTInt32LSB24:
             return 4;
 
         case ASIOSTInt24MSB:
-
         case ASIOSTInt24LSB:
             return 3;
 
@@ -596,86 +464,93 @@ static int BytesPerAsioSample (ASIOSampleType sampleType)
 }
 
 
-static void Swap16 (void *buffer, long shift, long count)
+static void Swap16( void *buffer, long shift, long count )
 {
-    unsigned short *p = (unsigned short*) buffer;
+    unsigned short *p = (unsigned short*)buffer;
     unsigned short temp;
     (void) shift; /* unused parameter */
 
-    while (count--) {
+    while( count-- )
+    {
         temp = *p;
-        *p++ = (unsigned short) ( (temp<<8) | (temp>>8));
+        *p++ = (unsigned short)((temp<<8) | (temp>>8));
     }
 }
 
-static void Swap24 (void *buffer, long shift, long count)
+static void Swap24( void *buffer, long shift, long count )
 {
-    unsigned char *p = (unsigned char*) buffer;
+    unsigned char *p = (unsigned char*)buffer;
     unsigned char temp;
     (void) shift; /* unused parameter */
 
-    while (count--) {
+    while( count-- )
+    {
         temp = *p;
-        *p = * (p+2);
-        * (p+2) = temp;
+        *p = *(p+2);
+        *(p+2) = temp;
         p += 3;
     }
 }
 
 #define PA_SWAP32_( x ) ((x>>24) | ((x>>8)&0xFF00) | ((x<<8)&0xFF0000) | (x<<24));
 
-static void Swap32 (void *buffer, long shift, long count)
+static void Swap32( void *buffer, long shift, long count )
 {
-    unsigned long *p = (unsigned long*) buffer;
+    unsigned long *p = (unsigned long*)buffer;
     unsigned long temp;
     (void) shift; /* unused parameter */
 
-    while (count--) {
+    while( count-- )
+    {
         temp = *p;
-        *p++ = PA_SWAP32_ (temp);
+        *p++ = PA_SWAP32_( temp);
     }
 }
 
-static void SwapShiftLeft32 (void *buffer, long shift, long count)
+static void SwapShiftLeft32( void *buffer, long shift, long count )
 {
-    unsigned long *p = (unsigned long*) buffer;
+    unsigned long *p = (unsigned long*)buffer;
     unsigned long temp;
 
-    while (count--) {
+    while( count-- )
+    {
         temp = *p;
-        temp = PA_SWAP32_ (temp);
+        temp = PA_SWAP32_( temp);
         *p++ = temp << shift;
     }
 }
 
-static void ShiftRightSwap32 (void *buffer, long shift, long count)
+static void ShiftRightSwap32( void *buffer, long shift, long count )
 {
-    unsigned long *p = (unsigned long*) buffer;
+    unsigned long *p = (unsigned long*)buffer;
     unsigned long temp;
 
-    while (count--) {
+    while( count-- )
+    {
         temp = *p >> shift;
-        *p++ = PA_SWAP32_ (temp);
+        *p++ = PA_SWAP32_( temp);
     }
 }
 
-static void ShiftLeft32 (void *buffer, long shift, long count)
+static void ShiftLeft32( void *buffer, long shift, long count )
 {
-    unsigned long *p = (unsigned long*) buffer;
+    unsigned long *p = (unsigned long*)buffer;
     unsigned long temp;
 
-    while (count--) {
+    while( count-- )
+    {
         temp = *p;
         *p++ = temp << shift;
     }
 }
 
-static void ShiftRight32 (void *buffer, long shift, long count)
+static void ShiftRight32( void *buffer, long shift, long count )
 {
-    unsigned long *p = (unsigned long*) buffer;
+    unsigned long *p = (unsigned long*)buffer;
     unsigned long temp;
 
-    while (count--) {
+    while( count-- )
+    {
         temp = *p;
         *p++ = temp >> shift;
     }
@@ -683,63 +558,65 @@ static void ShiftRight32 (void *buffer, long shift, long count)
 
 #define PA_SWAP_( x, y ) temp=x; x = y; y = temp;
 
-static void Swap64ConvertFloat64ToFloat32 (void *buffer, long shift, long count)
+static void Swap64ConvertFloat64ToFloat32( void *buffer, long shift, long count )
 {
-    double *in = (double*) buffer;
-    float *out = (float*) buffer;
+    double *in = (double*)buffer;
+    float *out = (float*)buffer;
     unsigned char *p;
     unsigned char temp;
     (void) shift; /* unused parameter */
 
-    while (count--) {
-        p = (unsigned char*) in;
-        PA_SWAP_ (p[0], p[7]);
-        PA_SWAP_ (p[1], p[6]);
-        PA_SWAP_ (p[2], p[5]);
-        PA_SWAP_ (p[3], p[4]);
+    while( count-- )
+    {
+        p = (unsigned char*)in;
+        PA_SWAP_( p[0], p[7] );
+        PA_SWAP_( p[1], p[6] );
+        PA_SWAP_( p[2], p[5] );
+        PA_SWAP_( p[3], p[4] );
 
         *out++ = (float) (*in++);
     }
 }
 
-static void ConvertFloat64ToFloat32 (void *buffer, long shift, long count)
+static void ConvertFloat64ToFloat32( void *buffer, long shift, long count )
 {
-    double *in = (double*) buffer;
-    float *out = (float*) buffer;
+    double *in = (double*)buffer;
+    float *out = (float*)buffer;
     (void) shift; /* unused parameter */
 
-    while (count--)
+    while( count-- )
         *out++ = (float) (*in++);
 }
 
-static void ConvertFloat32ToFloat64Swap64 (void *buffer, long shift, long count)
+static void ConvertFloat32ToFloat64Swap64( void *buffer, long shift, long count )
 {
-    float *in = ( (float*) buffer) + (count-1);
-    double *out = ( (double*) buffer) + (count-1);
+    float *in = ((float*)buffer) + (count-1);
+    double *out = ((double*)buffer) + (count-1);
     unsigned char *p;
     unsigned char temp;
     (void) shift; /* unused parameter */
 
-    while (count--) {
+    while( count-- )
+    {
         *out = *in--;
 
-        p = (unsigned char*) out;
-        PA_SWAP_ (p[0], p[7]);
-        PA_SWAP_ (p[1], p[6]);
-        PA_SWAP_ (p[2], p[5]);
-        PA_SWAP_ (p[3], p[4]);
+        p = (unsigned char*)out;
+        PA_SWAP_( p[0], p[7] );
+        PA_SWAP_( p[1], p[6] );
+        PA_SWAP_( p[2], p[5] );
+        PA_SWAP_( p[3], p[4] );
 
         out--;
     }
 }
 
-static void ConvertFloat32ToFloat64 (void *buffer, long shift, long count)
+static void ConvertFloat32ToFloat64( void *buffer, long shift, long count )
 {
-    float *in = ( (float*) buffer) + (count-1);
-    double *out = ( (double*) buffer) + (count-1);
+    float *in = ((float*)buffer) + (count-1);
+    double *out = ((double*)buffer) + (count-1);
     (void) shift; /* unused parameter */
 
-    while (count--)
+    while( count-- )
         *out-- = *in--;
 }
 
@@ -753,337 +630,302 @@ static void ConvertFloat32ToFloat64 (void *buffer, long shift, long count)
 #define PA_LSB_IS_NATIVE_
 #endif
 
-typedef void PaAsioBufferConverter (void *, long, long);
+typedef void PaAsioBufferConverter( void *, long, long );
 
-static void SelectAsioToPaConverter (ASIOSampleType type, PaAsioBufferConverter **converter, long *shift)
+static void SelectAsioToPaConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift )
 {
     *shift = 0;
     *converter = 0;
 
     switch (type) {
-
         case ASIOSTInt16MSB:
             /* dest: paInt16, no conversion necessary, possible byte swap*/
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = Swap16;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = Swap16;
+            #endif
             break;
-
         case ASIOSTInt16LSB:
             /* dest: paInt16, no conversion necessary, possible byte swap*/
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = Swap16;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = Swap16;
+            #endif
             break;
-
         case ASIOSTFloat32MSB:
             /* dest: paFloat32, no conversion necessary, possible byte swap*/
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = Swap32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = Swap32;
+            #endif
             break;
-
         case ASIOSTFloat32LSB:
             /* dest: paFloat32, no conversion necessary, possible byte swap*/
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = Swap32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = Swap32;
+            #endif
             break;
-
         case ASIOSTFloat64MSB:
             /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = Swap64ConvertFloat64ToFloat32;
-#else
-            *converter = ConvertFloat64ToFloat32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = Swap64ConvertFloat64ToFloat32;
+            #else
+                *converter = ConvertFloat64ToFloat32;
+            #endif
             break;
-
         case ASIOSTFloat64LSB:
             /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = Swap64ConvertFloat64ToFloat32;
-#else
-            *converter = ConvertFloat64ToFloat32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = Swap64ConvertFloat64ToFloat32;
+            #else
+                *converter = ConvertFloat64ToFloat32;
+            #endif
             break;
-
         case ASIOSTInt32MSB:
             /* dest: paInt32, no conversion necessary, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = Swap32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = Swap32;
+            #endif
             break;
-
         case ASIOSTInt32LSB:
             /* dest: paInt32, no conversion necessary, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = Swap32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = Swap32;
+            #endif
             break;
-
         case ASIOSTInt32MSB16:
             /* dest: paInt32, 16 bit shift, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = SwapShiftLeft32;
-#else
-            *converter = ShiftLeft32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = SwapShiftLeft32;
+            #else
+                *converter = ShiftLeft32;
+            #endif
             *shift = 16;
             break;
-
         case ASIOSTInt32MSB18:
             /* dest: paInt32, 14 bit shift, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = SwapShiftLeft32;
-#else
-            *converter = ShiftLeft32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = SwapShiftLeft32;
+            #else
+                *converter = ShiftLeft32;
+            #endif
             *shift = 14;
             break;
-
         case ASIOSTInt32MSB20:
             /* dest: paInt32, 12 bit shift, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = SwapShiftLeft32;
-#else
-            *converter = ShiftLeft32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = SwapShiftLeft32;
+            #else
+                *converter = ShiftLeft32;
+            #endif
             *shift = 12;
             break;
-
         case ASIOSTInt32MSB24:
             /* dest: paInt32, 8 bit shift, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = SwapShiftLeft32;
-#else
-            *converter = ShiftLeft32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = SwapShiftLeft32;
+            #else
+                *converter = ShiftLeft32;
+            #endif
             *shift = 8;
             break;
-
         case ASIOSTInt32LSB16:
             /* dest: paInt32, 16 bit shift, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = SwapShiftLeft32;
-#else
-            *converter = ShiftLeft32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = SwapShiftLeft32;
+            #else
+                *converter = ShiftLeft32;
+            #endif
             *shift = 16;
             break;
-
         case ASIOSTInt32LSB18:
             /* dest: paInt32, 14 bit shift, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = SwapShiftLeft32;
-#else
-            *converter = ShiftLeft32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = SwapShiftLeft32;
+            #else
+                *converter = ShiftLeft32;
+            #endif
             *shift = 14;
             break;
-
         case ASIOSTInt32LSB20:
             /* dest: paInt32, 12 bit shift, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = SwapShiftLeft32;
-#else
-            *converter = ShiftLeft32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = SwapShiftLeft32;
+            #else
+                *converter = ShiftLeft32;
+            #endif
             *shift = 12;
             break;
-
         case ASIOSTInt32LSB24:
             /* dest: paInt32, 8 bit shift, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = SwapShiftLeft32;
-#else
-            *converter = ShiftLeft32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = SwapShiftLeft32;
+            #else
+                *converter = ShiftLeft32;
+            #endif
             *shift = 8;
             break;
-
         case ASIOSTInt24MSB:
             /* dest: paInt24, no conversion necessary, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = Swap24;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = Swap24;
+            #endif
             break;
-
         case ASIOSTInt24LSB:
             /* dest: paInt24, no conversion necessary, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = Swap24;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = Swap24;
+            #endif
             break;
     }
 }
 
 
-static void SelectPaToAsioConverter (ASIOSampleType type, PaAsioBufferConverter **converter, long *shift)
+static void SelectPaToAsioConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift )
 {
     *shift = 0;
     *converter = 0;
 
     switch (type) {
-
         case ASIOSTInt16MSB:
             /* src: paInt16, no conversion necessary, possible byte swap*/
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = Swap16;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = Swap16;
+            #endif
             break;
-
         case ASIOSTInt16LSB:
             /* src: paInt16, no conversion necessary, possible byte swap*/
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = Swap16;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = Swap16;
+            #endif
             break;
-
         case ASIOSTFloat32MSB:
             /* src: paFloat32, no conversion necessary, possible byte swap*/
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = Swap32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = Swap32;
+            #endif
             break;
-
         case ASIOSTFloat32LSB:
             /* src: paFloat32, no conversion necessary, possible byte swap*/
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = Swap32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = Swap32;
+            #endif
             break;
-
         case ASIOSTFloat64MSB:
             /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = ConvertFloat32ToFloat64Swap64;
-#else
-            *converter = ConvertFloat32ToFloat64;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = ConvertFloat32ToFloat64Swap64;
+            #else
+                *converter = ConvertFloat32ToFloat64;
+            #endif
             break;
-
         case ASIOSTFloat64LSB:
             /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = ConvertFloat32ToFloat64Swap64;
-#else
-            *converter = ConvertFloat32ToFloat64;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = ConvertFloat32ToFloat64Swap64;
+            #else
+                *converter = ConvertFloat32ToFloat64;
+            #endif
             break;
-
         case ASIOSTInt32MSB:
             /* src: paInt32, no conversion necessary, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = Swap32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = Swap32;
+            #endif
             break;
-
         case ASIOSTInt32LSB:
             /* src: paInt32, no conversion necessary, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = Swap32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = Swap32;
+            #endif
             break;
-
         case ASIOSTInt32MSB16:
             /* src: paInt32, 16 bit shift, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = ShiftRightSwap32;
-#else
-            *converter = ShiftRight32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = ShiftRightSwap32;
+            #else
+                *converter = ShiftRight32;
+            #endif
             *shift = 16;
             break;
-
         case ASIOSTInt32MSB18:
             /* src: paInt32, 14 bit shift, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = ShiftRightSwap32;
-#else
-            *converter = ShiftRight32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = ShiftRightSwap32;
+            #else
+                *converter = ShiftRight32;
+            #endif
             *shift = 14;
             break;
-
         case ASIOSTInt32MSB20:
             /* src: paInt32, 12 bit shift, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = ShiftRightSwap32;
-#else
-            *converter = ShiftRight32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = ShiftRightSwap32;
+            #else
+                *converter = ShiftRight32;
+            #endif
             *shift = 12;
             break;
-
         case ASIOSTInt32MSB24:
             /* src: paInt32, 8 bit shift, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = ShiftRightSwap32;
-#else
-            *converter = ShiftRight32;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = ShiftRightSwap32;
+            #else
+                *converter = ShiftRight32;
+            #endif
             *shift = 8;
             break;
-
         case ASIOSTInt32LSB16:
             /* src: paInt32, 16 bit shift, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = ShiftRightSwap32;
-#else
-            *converter = ShiftRight32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = ShiftRightSwap32;
+            #else
+                *converter = ShiftRight32;
+            #endif
             *shift = 16;
             break;
-
         case ASIOSTInt32LSB18:
             /* src: paInt32, 14 bit shift, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = ShiftRightSwap32;
-#else
-            *converter = ShiftRight32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = ShiftRightSwap32;
+            #else
+                *converter = ShiftRight32;
+            #endif
             *shift = 14;
             break;
-
         case ASIOSTInt32LSB20:
             /* src: paInt32, 12 bit shift, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = ShiftRightSwap32;
-#else
-            *converter = ShiftRight32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = ShiftRightSwap32;
+            #else
+                *converter = ShiftRight32;
+            #endif
             *shift = 12;
             break;
-
         case ASIOSTInt32LSB24:
             /* src: paInt32, 8 bit shift, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = ShiftRightSwap32;
-#else
-            *converter = ShiftRight32;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = ShiftRightSwap32;
+            #else
+                *converter = ShiftRight32;
+            #endif
             *shift = 8;
             break;
-
         case ASIOSTInt24MSB:
             /* src: paInt24, no conversion necessary, possible byte swap */
-#ifdef PA_LSB_IS_NATIVE_
-            *converter = Swap24;
-#endif
+            #ifdef PA_LSB_IS_NATIVE_
+                *converter = Swap24;
+            #endif
             break;
-
         case ASIOSTInt24LSB:
             /* src: paInt24, no conversion necessary, possible byte swap */
-#ifdef PA_MSB_IS_NATIVE_
-            *converter = Swap24;
-#endif
+            #ifdef PA_MSB_IS_NATIVE_
+                *converter = Swap24;
+            #endif
             break;
     }
 }
 
 
-typedef struct PaAsioDeviceInfo {
+typedef struct PaAsioDeviceInfo
+{
     PaDeviceInfo commonDeviceInfo;
     long minBufferSize;
     long maxBufferSize;
@@ -1092,25 +934,26 @@ typedef struct PaAsioDeviceInfo {
 
     ASIOChannelInfo *asioChannelInfos;
 }
-
 PaAsioDeviceInfo;
 
 
-PaError PaAsio_GetAvailableLatencyValues (PaDeviceIndex device,
-        long *minLatency, long *maxLatency, long *preferredLatency, long *granularity)
+PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device,
+        long *minLatency, long *maxLatency, long *preferredLatency, long *granularity )
 {
     PaError result;
     PaUtilHostApiRepresentation *hostApi;
     PaDeviceIndex hostApiDevice;
 
-    result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO);
+    result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO );
 
-    if (result == paNoError) {
-        result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi);
+    if( result == paNoError )
+    {
+        result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi );
 
-        if (result == paNoError) {
+        if( result == paNoError )
+        {
             PaAsioDeviceInfo *asioDeviceInfo =
-                (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice];
+                    (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice];
 
             *minLatency = asioDeviceInfo->minBufferSize;
             *maxLatency = asioDeviceInfo->maxBufferSize;
@@ -1125,10 +968,10 @@ PaError PaAsio_GetAvailableLatencyValues (PaDeviceIndex device,
 /* Unload whatever we loaded in LoadAsioDriver().
    Also balance the call to CoInitialize(0).
 */
-static void UnloadAsioDriver (void)
+static void UnloadAsioDriver( void )
 {
-    ASIOExit();
-    CoUninitialize();
+	ASIOExit();
+	CoUninitialize();
 }
 
 /*
@@ -1137,63 +980,67 @@ static void UnloadAsioDriver (void)
     and must be closed by the called by calling UnloadAsioDriver() - if an error
     is returned the driver will already be unloaded.
 */
-static PaError LoadAsioDriver (PaAsioHostApiRepresentation *asioHostApi, const char *driverName,
-                               PaAsioDriverInfo *driverInfo, void *systemSpecific)
+static PaError LoadAsioDriver( PaAsioHostApiRepresentation *asioHostApi, const char *driverName,
+        PaAsioDriverInfo *driverInfo, void *systemSpecific )
 {
     PaError result = paNoError;
     ASIOError asioError;
     int asioIsInitialized = 0;
 
-    /*
-    ASIO uses CoCreateInstance() to load a driver. That requires that
-    CoInitialize(0) be called for every thread that loads a driver.
-    It is OK to call CoInitialize(0) multiple times form one thread as long
-    as it is balanced by a call to CoUninitialize(). See UnloadAsioDriver().
-
-    The V18 version called CoInitialize() starting on 2/19/02.
-    That was removed from PA V19 for unknown reasons.
-    Phil Burk added it back on 6/27/08 so that JSyn would work.
+    /* 
+	ASIO uses CoCreateInstance() to load a driver. That requires that
+	CoInitialize(0) be called for every thread that loads a driver.
+	It is OK to call CoInitialize(0) multiple times form one thread as long
+	as it is balanced by a call to CoUninitialize(). See UnloadAsioDriver().
+
+	The V18 version called CoInitialize() starting on 2/19/02.
+	That was removed from PA V19 for unknown reasons.
+	Phil Burk added it back on 6/27/08 so that JSyn would work.
     */
-    CoInitialize (0);
+	CoInitialize( 0 );
 
-    if (!asioHostApi->asioDrivers->loadDriver (const_cast<char*> (driverName))) {
-        /* If this returns an error then it might be because CoInitialize(0) was removed.
-          It should be called right before this.
-        */
+    if( !asioHostApi->asioDrivers->loadDriver( const_cast<char*>(driverName) ) )
+    {
+		/* If this returns an error then it might be because CoInitialize(0) was removed.
+		  It should be called right before this.
+	    */
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_HOST_ERROR (0, "Failed to load ASIO driver");
+        PA_ASIO_SET_LAST_HOST_ERROR( 0, "Failed to load ASIO driver" );
         goto error;
     }
 
-    memset (&driverInfo->asioDriverInfo, 0, sizeof (ASIODriverInfo));
-
+    memset( &driverInfo->asioDriverInfo, 0, sizeof(ASIODriverInfo) );
     driverInfo->asioDriverInfo.asioVersion = 2;
     driverInfo->asioDriverInfo.sysRef = systemSpecific;
-
-    if ( (asioError = ASIOInit (&driverInfo->asioDriverInfo)) != ASE_OK) {
+    if( (asioError = ASIOInit( &driverInfo->asioDriverInfo )) != ASE_OK )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
         goto error;
-    } else {
+    }
+    else
+    {
         asioIsInitialized = 1;
     }
 
-    if ( (asioError = ASIOGetChannels (&driverInfo->inputChannelCount,
-                                       &driverInfo->outputChannelCount)) != ASE_OK) {
+    if( (asioError = ASIOGetChannels(&driverInfo->inputChannelCount,
+            &driverInfo->outputChannelCount)) != ASE_OK )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
         goto error;
     }
 
-    if ( (asioError = ASIOGetBufferSize (&driverInfo->bufferMinSize,
-                                         &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize,
-                                         &driverInfo->bufferGranularity)) != ASE_OK) {
+    if( (asioError = ASIOGetBufferSize(&driverInfo->bufferMinSize,
+            &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize,
+            &driverInfo->bufferGranularity)) != ASE_OK )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
         goto error;
     }
 
-    if (ASIOOutputReady() == ASE_OK)
+    if( ASIOOutputReady() == ASE_OK )
         driverInfo->postOutput = true;
     else
         driverInfo->postOutput = false;
@@ -1201,29 +1048,27 @@ static PaError LoadAsioDriver (PaAsioHostApiRepresentation *asioHostApi, const c
     return result;
 
 error:
-    if (asioIsInitialized) {
-        ASIOExit();
-    }
-
-    CoUninitialize();
-
+    if( asioIsInitialized )
+	{
+		ASIOExit();
+	}
+	CoUninitialize();
     return result;
 }
 
 
 #define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_     13   /* must be the same number of elements as in the array below */
 static ASIOSampleRate defaultSampleRateSearchOrder_[]
-= {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0,
-   192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0
-  };
+     = {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0,
+        192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 };
 
 
 /* we look up IsDebuggerPresent at runtime incase it isn't present (on Win95 for example) */
-typedef BOOL (WINAPI *IsDebuggerPresentPtr) (VOID);
+typedef BOOL (WINAPI *IsDebuggerPresentPtr)(VOID);
 IsDebuggerPresentPtr IsDebuggerPresent_ = 0;
 //FARPROC IsDebuggerPresent_ = 0; // this is the current way to do it apparently according to davidv
 
-PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex)
+PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex )
 {
     PaError result = paNoError;
     int i, driverCount;
@@ -1232,9 +1077,9 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
     char **names;
     PaAsioDriverInfo paAsioDriverInfo;
 
-    asioHostApi = (PaAsioHostApiRepresentation*) PaUtil_AllocateMemory (sizeof (PaAsioHostApiRepresentation));
-
-    if (!asioHostApi) {
+    asioHostApi = (PaAsioHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaAsioHostApiRepresentation) );
+    if( !asioHostApi )
+    {
         result = paInsufficientMemory;
         goto error;
     }
@@ -1242,22 +1087,25 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
     asioHostApi->asioDrivers = 0; /* avoid surprises in our error handler below */
 
     asioHostApi->allocations = PaUtil_CreateAllocationGroup();
-
-    if (!asioHostApi->allocations) {
+    if( !asioHostApi->allocations )
+    {
         result = paInsufficientMemory;
         goto error;
     }
 
     /* Allocate the AsioDrivers() driver list (class from ASIO SDK) */
-    try {
+    try
+    {
         asioHostApi->asioDrivers = new AsioDrivers(); /* calls CoInitialize(0) */
-    } catch (std::bad_alloc) {
+    } 
+    catch (std::bad_alloc)
+    {
         asioHostApi->asioDrivers = 0;
     }
-
     /* some implementations of new (ie MSVC, see http://support.microsoft.com/?kbid=167733)
        don't throw std::bad_alloc, so we also explicitly test for a null return. */
-    if (asioHostApi->asioDrivers == 0) {
+    if( asioHostApi->asioDrivers == 0 )
+    {
         result = paInsufficientMemory;
         goto error;
     }
@@ -1274,23 +1122,24 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
     (*hostApi)->info.name = "ASIO";
     (*hostApi)->info.deviceCount = 0;
 
-#ifdef WINDOWS
-    /* use desktop window as system specific ptr */
-    asioHostApi->systemSpecific = GetDesktopWindow();
-#endif
+    #ifdef WINDOWS
+        /* use desktop window as system specific ptr */
+        asioHostApi->systemSpecific = GetDesktopWindow();
+    #endif
 
     /* driverCount is the number of installed drivers - not necessarily
         the number of installed physical devices. */
-#if MAC
-    driverCount = asioHostApi->asioDrivers->getNumFragments();
-#elif WINDOWS
-    driverCount = asioHostApi->asioDrivers->asioGetNumDev();
-#endif
+    #if MAC
+        driverCount = asioHostApi->asioDrivers->getNumFragments();
+    #elif WINDOWS
+        driverCount = asioHostApi->asioDrivers->asioGetNumDev();
+    #endif
 
-    if (driverCount > 0) {
-        names = GetAsioDriverNames (asioHostApi, asioHostApi->allocations, driverCount);
-
-        if (!names) {
+    if( driverCount > 0 )
+    {
+        names = GetAsioDriverNames( asioHostApi, asioHostApi->allocations, driverCount );
+        if( !names )
+        {
             result = paInsufficientMemory;
             goto error;
         }
@@ -1298,59 +1147,64 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
 
         /* allocate enough space for all drivers, even if some aren't installed */
 
-        (*hostApi)->deviceInfos = (PaDeviceInfo**) PaUtil_GroupAllocateMemory (
-                                      asioHostApi->allocations, sizeof (PaDeviceInfo*) * driverCount);
-
-        if (! (*hostApi)->deviceInfos) {
+        (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory(
+                asioHostApi->allocations, sizeof(PaDeviceInfo*) * driverCount );
+        if( !(*hostApi)->deviceInfos )
+        {
             result = paInsufficientMemory;
             goto error;
         }
 
         /* allocate all device info structs in a contiguous block */
-        deviceInfoArray = (PaAsioDeviceInfo*) PaUtil_GroupAllocateMemory (
-                              asioHostApi->allocations, sizeof (PaAsioDeviceInfo) * driverCount);
-
-        if (!deviceInfoArray) {
+        deviceInfoArray = (PaAsioDeviceInfo*)PaUtil_GroupAllocateMemory(
+                asioHostApi->allocations, sizeof(PaAsioDeviceInfo) * driverCount );
+        if( !deviceInfoArray )
+        {
             result = paInsufficientMemory;
             goto error;
         }
 
-        IsDebuggerPresent_ = GetProcAddress (LoadLibrary ("Kernel32.dll"), "IsDebuggerPresent");
+        IsDebuggerPresent_ = GetProcAddress( LoadLibrary( "Kernel32.dll" ), "IsDebuggerPresent" );
 
-        for (i=0; i < driverCount; ++i) {
+        for( i=0; i < driverCount; ++i )
+        {
 
-            PA_DEBUG ( ("ASIO names[%d]:%s\n",i,names[i]));
+            PA_DEBUG(("ASIO names[%d]:%s\n",i,names[i]));
 
             // Since portaudio opens ALL ASIO drivers, and no one else does that,
             // we face fact that some drivers were not meant for it, drivers which act
             // like shells on top of REAL drivers, for instance.
             // so we get duplicate handles, locks and other problems.
-            // so lets NOT try to load any such wrappers.
+            // so lets NOT try to load any such wrappers. 
             // The ones i [davidv] know of so far are:
 
-            if (strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0
-                    || strcmp (names[i],"ASIO Multimedia Driver")          == 0
-                    || strncmp (names[i],"Premiere",8)                      == 0  //"Premiere Elements Windows Sound 1.0"
-                    || strncmp (names[i],"Adobe",5)                         == 0  //"Adobe Default Windows Sound 1.5"
-                    || strncmp (names[i],"ReaRoute ASIO",13)                == 0  //Reaper www.reaper.fm <- fix your stuff man.
-               ) {
-                PA_DEBUG ( ("BLACKLISTED!!!\n"));
+            if (   strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0
+                || strcmp (names[i],"ASIO Multimedia Driver")          == 0
+                || strncmp(names[i],"Premiere",8)                      == 0   //"Premiere Elements Windows Sound 1.0"
+                || strncmp(names[i],"Adobe",5)                         == 0   //"Adobe Default Windows Sound 1.5"
+                || strncmp(names[i],"ReaRoute ASIO",13)                == 0   //Reaper www.reaper.fm <- fix your stuff man.
+               )
+            {
+                PA_DEBUG(("BLACKLISTED!!!\n"));
                 continue;
             }
 
 
-            if (IsDebuggerPresent_ && IsDebuggerPresent_()) {
+            if( IsDebuggerPresent_ && IsDebuggerPresent_() )  
+            {
                 /* ASIO Digidesign Driver uses PACE copy protection which quits out
                    if a debugger is running. So we don't load it if a debugger is running. */
-                if (strcmp (names[i], "ASIO Digidesign Driver") == 0) {
-                    PA_DEBUG ( ("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n"));
-                    continue;
-                }
-            }
+                if( strcmp(names[i], "ASIO Digidesign Driver") == 0 )  
+                {
+                    PA_DEBUG(("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n"));  
+                    continue;  
+                }  
+            }  
 
 
             /* Attempt to load the asio driver... */
-            if (LoadAsioDriver (asioHostApi, names[i], &paAsioDriverInfo, asioHostApi->systemSpecific) == paNoError) {
+            if( LoadAsioDriver( asioHostApi, names[i], &paAsioDriverInfo, asioHostApi->systemSpecific ) == paNoError )
+            {
                 PaAsioDeviceInfo *asioDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ];
                 PaDeviceInfo *deviceInfo = &asioDeviceInfo->commonDeviceInfo;
 
@@ -1358,33 +1212,33 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
                 deviceInfo->hostApi = hostApiIndex;
 
                 deviceInfo->name = names[i];
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d name = %s\n",  i,deviceInfo->name));
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d inputChannels       = %d\n", i, paAsioDriverInfo.inputChannelCount));
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d outputChannels      = %d\n", i, paAsioDriverInfo.outputChannelCount));
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferMinSize       = %d\n", i, paAsioDriverInfo.bufferMinSize));
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferMaxSize       = %d\n", i, paAsioDriverInfo.bufferMaxSize));
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize));
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferGranularity   = %d\n", i, paAsioDriverInfo.bufferGranularity));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d name = %s\n",  i,deviceInfo->name));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d inputChannels       = %d\n", i, paAsioDriverInfo.inputChannelCount));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d outputChannels      = %d\n", i, paAsioDriverInfo.outputChannelCount));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMinSize       = %d\n", i, paAsioDriverInfo.bufferMinSize));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMaxSize       = %d\n", i, paAsioDriverInfo.bufferMaxSize));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d bufferGranularity   = %d\n", i, paAsioDriverInfo.bufferGranularity));
 
                 deviceInfo->maxInputChannels  = paAsioDriverInfo.inputChannelCount;
                 deviceInfo->maxOutputChannels = paAsioDriverInfo.outputChannelCount;
 
                 deviceInfo->defaultSampleRate = 0.;
                 bool foundDefaultSampleRate = false;
-
-                for (int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j) {
-                    ASIOError asioError = ASIOCanSampleRate (defaultSampleRateSearchOrder_[j]);
-
-                    if (asioError != ASE_NoClock && asioError != ASE_NotPresent) {
+                for( int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j )
+                {
+                    ASIOError asioError = ASIOCanSampleRate( defaultSampleRateSearchOrder_[j] );
+                    if( asioError != ASE_NoClock && asioError != ASE_NotPresent )
+                    {
                         deviceInfo->defaultSampleRate = defaultSampleRateSearchOrder_[j];
                         foundDefaultSampleRate = true;
                         break;
                     }
                 }
 
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate));
 
-                if (foundDefaultSampleRate) {
+                if( foundDefaultSampleRate ){
 
                     /* calculate default latency values from bufferPreferredSize
                         for default low latency, and bufferPreferredSize * 3
@@ -1395,28 +1249,27 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
                     */
 
                     double defaultLowLatency =
-                        paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate;
+                            paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate;
 
                     deviceInfo->defaultLowInputLatency = defaultLowLatency;
                     deviceInfo->defaultLowOutputLatency = defaultLowLatency;
 
                     long defaultHighLatencyBufferSize =
-                        paAsioDriverInfo.bufferPreferredSize * 3;
+                            paAsioDriverInfo.bufferPreferredSize * 3;
 
-                    if (defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize)
+                    if( defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize )
                         defaultHighLatencyBufferSize = paAsioDriverInfo.bufferMaxSize;
 
                     double defaultHighLatency =
-                        defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate;
-
-                    if (defaultHighLatency < defaultLowLatency)
-                        defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */
+                            defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate;
 
+                    if( defaultHighLatency < defaultLowLatency )
+                        defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ 
+                            
                     deviceInfo->defaultHighInputLatency = defaultHighLatency;
-
                     deviceInfo->defaultHighOutputLatency = defaultHighLatency;
-
-                } else {
+                    
+                }else{
 
                     deviceInfo->defaultLowInputLatency = 0.;
                     deviceInfo->defaultLowOutputLatency = 0.;
@@ -1424,11 +1277,10 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
                     deviceInfo->defaultHighOutputLatency = 0.;
                 }
 
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency));
-
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency));
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency));
-                PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency));
+                PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency));
 
                 asioDeviceInfo->minBufferSize = paAsioDriverInfo.bufferMinSize;
                 asioDeviceInfo->maxBufferSize = paAsioDriverInfo.bufferMaxSize;
@@ -1436,39 +1288,39 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
                 asioDeviceInfo->bufferGranularity = paAsioDriverInfo.bufferGranularity;
 
 
-                asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*) PaUtil_GroupAllocateMemory (
-                                                       asioHostApi->allocations,
-                                                       sizeof (ASIOChannelInfo) * (deviceInfo->maxInputChannels
-                                                                                   + deviceInfo->maxOutputChannels));
-
-                if (!asioDeviceInfo->asioChannelInfos) {
+                asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*)PaUtil_GroupAllocateMemory(
+                        asioHostApi->allocations,
+                        sizeof(ASIOChannelInfo) * (deviceInfo->maxInputChannels
+                                + deviceInfo->maxOutputChannels) );
+                if( !asioDeviceInfo->asioChannelInfos )
+                {
                     result = paInsufficientMemory;
                     goto error_unload;
                 }
 
                 int a;
 
-                for (a=0; a < deviceInfo->maxInputChannels; ++a) {
+                for( a=0; a < deviceInfo->maxInputChannels; ++a ){
                     asioDeviceInfo->asioChannelInfos[a].channel = a;
                     asioDeviceInfo->asioChannelInfos[a].isInput = ASIOTrue;
-                    ASIOError asioError = ASIOGetChannelInfo (&asioDeviceInfo->asioChannelInfos[a]);
-
-                    if (asioError != ASE_OK) {
+                    ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[a] );
+                    if( asioError != ASE_OK )
+                    {
                         result = paUnanticipatedHostError;
-                        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+                        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
                         goto error_unload;
                     }
                 }
 
-                for (a=0; a < deviceInfo->maxOutputChannels; ++a) {
+                for( a=0; a < deviceInfo->maxOutputChannels; ++a ){
                     int b = deviceInfo->maxInputChannels + a;
                     asioDeviceInfo->asioChannelInfos[b].channel = a;
                     asioDeviceInfo->asioChannelInfos[b].isInput = ASIOFalse;
-                    ASIOError asioError = ASIOGetChannelInfo (&asioDeviceInfo->asioChannelInfos[b]);
-
-                    if (asioError != ASE_OK) {
+                    ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[b] );
+                    if( asioError != ASE_OK )
+                    {
                         result = paUnanticipatedHostError;
-                        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+                        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
                         goto error_unload;
                     }
                 }
@@ -1478,16 +1330,18 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
                 UnloadAsioDriver();
 
                 (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo;
-
-                ++ (*hostApi)->info.deviceCount;
+                ++(*hostApi)->info.deviceCount;
             }
         }
     }
 
-    if ( (*hostApi)->info.deviceCount > 0) {
+    if( (*hostApi)->info.deviceCount > 0 )
+    {
         (*hostApi)->info.defaultInputDevice = 0;
         (*hostApi)->info.defaultOutputDevice = 0;
-    } else {
+    }
+    else
+    {
         (*hostApi)->info.defaultInputDevice = paNoDevice;
         (*hostApi)->info.defaultOutputDevice = paNoDevice;
     }
@@ -1497,97 +1351,97 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
     (*hostApi)->OpenStream = OpenStream;
     (*hostApi)->IsFormatSupported = IsFormatSupported;
 
-    PaUtil_InitializeStreamInterface (&asioHostApi->callbackStreamInterface, CloseStream, StartStream,
+    PaUtil_InitializeStreamInterface( &asioHostApi->callbackStreamInterface, CloseStream, StartStream,
                                       StopStream, AbortStream, IsStreamStopped, IsStreamActive,
                                       GetStreamTime, GetStreamCpuLoad,
                                       PaUtil_DummyRead, PaUtil_DummyWrite,
-                                      PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable);
+                                      PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable );
 
-    PaUtil_InitializeStreamInterface (&asioHostApi->blockingStreamInterface, CloseStream, StartStream,
+    PaUtil_InitializeStreamInterface( &asioHostApi->blockingStreamInterface, CloseStream, StartStream,
                                       StopStream, AbortStream, IsStreamStopped, IsStreamActive,
                                       GetStreamTime, PaUtil_DummyGetCpuLoad,
-                                      ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable);
+                                      ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable );
 
     return result;
 
 error_unload:
-    UnloadAsioDriver();
+	UnloadAsioDriver();
 
 error:
-
-    if (asioHostApi) {
-        if (asioHostApi->allocations) {
-            PaUtil_FreeAllAllocations (asioHostApi->allocations);
-            PaUtil_DestroyAllocationGroup (asioHostApi->allocations);
+    if( asioHostApi )
+    {
+        if( asioHostApi->allocations )
+        {
+            PaUtil_FreeAllAllocations( asioHostApi->allocations );
+            PaUtil_DestroyAllocationGroup( asioHostApi->allocations );
         }
 
         delete asioHostApi->asioDrivers;
-
         asioDrivers = 0; /* keep SDK global in sync until we stop depending on it */
 
-        PaUtil_FreeMemory (asioHostApi);
+        PaUtil_FreeMemory( asioHostApi );
     }
-
     return result;
 }
 
 
-static void Terminate (struct PaUtilHostApiRepresentation *hostApi)
+static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
 {
-    PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi;
+    PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi;
 
     /*
         IMPLEMENT ME:
             - clean up any resources not handled by the allocation group (need to review if there are any)
     */
 
-    if (asioHostApi->allocations) {
-        PaUtil_FreeAllAllocations (asioHostApi->allocations);
-        PaUtil_DestroyAllocationGroup (asioHostApi->allocations);
+    if( asioHostApi->allocations )
+    {
+        PaUtil_FreeAllAllocations( asioHostApi->allocations );
+        PaUtil_DestroyAllocationGroup( asioHostApi->allocations );
     }
 
     delete asioHostApi->asioDrivers; /* calls CoUninitialize() */
-
     asioDrivers = 0; /* keep SDK global in sync until we stop depending on it */
 
-    PaUtil_FreeMemory (asioHostApi);
+    PaUtil_FreeMemory( asioHostApi );
 }
 
 
-static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi,
+static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
                                   const PaStreamParameters *inputParameters,
                                   const PaStreamParameters *outputParameters,
-                                  double sampleRate)
+                                  double sampleRate )
 {
     PaError result = paNoError;
-    PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi;
+    PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi;
     PaAsioDriverInfo *driverInfo = &asioHostApi->openAsioDriverInfo;
     int inputChannelCount, outputChannelCount;
     PaSampleFormat inputSampleFormat, outputSampleFormat;
-    PaDeviceIndex asioDeviceIndex;
+    PaDeviceIndex asioDeviceIndex;                                  
     ASIOError asioError;
-
-    if (inputParameters && outputParameters) {
+    
+    if( inputParameters && outputParameters )
+    {
         /* full duplex ASIO stream must use the same device for input and output */
 
-        if (inputParameters->device != outputParameters->device)
+        if( inputParameters->device != outputParameters->device )
             return paBadIODeviceCombination;
     }
-
-    if (inputParameters) {
+    
+    if( inputParameters )
+    {
         inputChannelCount = inputParameters->channelCount;
         inputSampleFormat = inputParameters->sampleFormat;
 
         /* all standard sample formats are supported by the buffer adapter,
             this implementation doesn't support any custom sample formats */
-
-        if (inputSampleFormat & paCustomFormat)
+        if( inputSampleFormat & paCustomFormat )
             return paSampleFormatNotSupported;
-
+            
         /* unless alternate device specification is supported, reject the use of
             paUseHostApiSpecificDeviceSpecification */
 
-        if (inputParameters->device == paUseHostApiSpecificDeviceSpecification)
+        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )
             return paInvalidDevice;
 
         asioDeviceIndex = inputParameters->device;
@@ -1596,24 +1450,26 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi,
         /** @todo do more validation here */
         // if( inputParameters->hostApiSpecificStreamInfo )
         //    return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-    } else {
+    }
+    else
+    {
         inputChannelCount = 0;
     }
 
-    if (outputParameters) {
+    if( outputParameters )
+    {
         outputChannelCount = outputParameters->channelCount;
         outputSampleFormat = outputParameters->sampleFormat;
 
         /* all standard sample formats are supported by the buffer adapter,
             this implementation doesn't support any custom sample formats */
-
-        if (outputSampleFormat & paCustomFormat)
+        if( outputSampleFormat & paCustomFormat )
             return paSampleFormatNotSupported;
-
+            
         /* unless alternate device specification is supported, reject the use of
             paUseHostApiSpecificDeviceSpecification */
 
-        if (outputParameters->device == paUseHostApiSpecificDeviceSpecification)
+        if( outputParameters->device == paUseHostApiSpecificDeviceSpecification )
             return paInvalidDevice;
 
         asioDeviceIndex = outputParameters->device;
@@ -1622,7 +1478,9 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi,
         /** @todo do more validation here */
         // if( outputParameters->hostApiSpecificStreamInfo )
         //    return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
-    } else {
+    }
+    else
+    {
         outputChannelCount = 0;
     }
 
@@ -1630,8 +1488,9 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi,
 
     /* if an ASIO device is open we can only get format information for the currently open device */
 
-    if (asioHostApi->openAsioDeviceIndex != paNoDevice
-            && asioHostApi->openAsioDeviceIndex != asioDeviceIndex) {
+    if( asioHostApi->openAsioDeviceIndex != paNoDevice 
+            && asioHostApi->openAsioDeviceIndex != asioDeviceIndex )
+    {
         return paDeviceUnavailable;
     }
 
@@ -1640,47 +1499,50 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi,
         rather than the ones in our device info structure which may be stale */
 
     /* open the device if it's not already open */
-    if (asioHostApi->openAsioDeviceIndex == paNoDevice) {
-        result = LoadAsioDriver (asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name,
-                                 driverInfo, asioHostApi->systemSpecific);
-
-        if (result != paNoError)
+    if( asioHostApi->openAsioDeviceIndex == paNoDevice )
+    {
+        result = LoadAsioDriver( asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name,
+                driverInfo, asioHostApi->systemSpecific );
+        if( result != paNoError )
             return result;
     }
 
     /* check that input device can support inputChannelCount */
-    if (inputChannelCount > 0) {
-        if (inputChannelCount > driverInfo->inputChannelCount) {
+    if( inputChannelCount > 0 )
+    {
+        if( inputChannelCount > driverInfo->inputChannelCount )
+        {
             result = paInvalidChannelCount;
             goto done;
         }
     }
 
     /* check that output device can support outputChannelCount */
-    if (outputChannelCount) {
-        if (outputChannelCount > driverInfo->outputChannelCount) {
+    if( outputChannelCount )
+    {
+        if( outputChannelCount > driverInfo->outputChannelCount )
+        {
             result = paInvalidChannelCount;
             goto done;
         }
     }
-
+    
     /* query for sample rate support */
-    asioError = ASIOCanSampleRate (sampleRate);
-
-    if (asioError == ASE_NoClock || asioError == ASE_NotPresent) {
+    asioError = ASIOCanSampleRate( sampleRate );
+    if( asioError == ASE_NoClock || asioError == ASE_NotPresent )
+    {
         result = paInvalidSampleRate;
         goto done;
     }
 
 done:
-
     /* close the device if it wasn't already open */
-
-    if (asioHostApi->openAsioDeviceIndex == paNoDevice) {
+    if( asioHostApi->openAsioDeviceIndex == paNoDevice )
+    {
         UnloadAsioDriver(); /* not sure if we should check for errors here */
     }
 
-    if (result == paNoError)
+    if( result == paNoError )
         return paFormatIsSupported;
     else
         return result;
@@ -1689,8 +1551,8 @@ done:
 
 
 /** A data structure specifically for storing blocking i/o related data. */
-
-typedef struct PaAsioStreamBlockingState {
+typedef struct PaAsioStreamBlockingState
+{
     int stopFlag; /**< Flag indicating that block processing is to be stopped. */
 
     unsigned long writeBuffersRequested; /**< The number of available output buffers, requested by the #WriteStream() function. */
@@ -1718,14 +1580,14 @@ typedef struct PaAsioStreamBlockingState {
     int outputUnderflowFlag; /**< Flag to signal an output underflow from within the callback function. */
     int inputOverflowFlag; /**< Flag to signal an input overflow from within the callback function. */
 }
-
 PaAsioStreamBlockingState;
 
 
 
 /* PaAsioStream - a stream data structure specifically for this implementation */
 
-typedef struct PaAsioStream {
+typedef struct PaAsioStream
+{
     PaUtilStreamRepresentation streamRepresentation;
     PaUtilCpuLoadMeasurer cpuLoadMeasurer;
     PaUtilBufferProcessor bufferProcessor;
@@ -1768,71 +1630,86 @@ typedef struct PaAsioStream {
 
     PaAsioStreamBlockingState *blockingState; /**< Blocking i/o data struct, or NULL when using callback interface. */
 }
-
 PaAsioStream;
 
 static PaAsioStream *theAsioStream = 0; /* due to ASIO sdk limitations there can be only one stream */
 
 
-static void ZeroOutputBuffers (PaAsioStream *stream, long index)
+static void ZeroOutputBuffers( PaAsioStream *stream, long index )
 {
     int i;
 
-    for (i=0; i < stream->outputChannelCount; ++i) {
+    for( i=0; i < stream->outputChannelCount; ++i )
+    {
         void *buffer = stream->asioBufferInfos[ i + stream->inputChannelCount ].buffers[index];
 
-        int bytesPerSample = BytesPerAsioSample (stream->asioChannelInfos[ i + stream->inputChannelCount ].type);
+        int bytesPerSample = BytesPerAsioSample( stream->asioChannelInfos[ i + stream->inputChannelCount ].type );
 
-        memset (buffer, 0, stream->framesPerHostCallback * bytesPerSample);
+        memset( buffer, 0, stream->framesPerHostCallback * bytesPerSample );
     }
 }
 
 
-static unsigned long SelectHostBufferSize (unsigned long suggestedLatencyFrames,
-        PaAsioDriverInfo *driverInfo)
+static unsigned long SelectHostBufferSize( unsigned long suggestedLatencyFrames,
+        PaAsioDriverInfo *driverInfo )
 {
     unsigned long result;
 
-    if (suggestedLatencyFrames == 0) {
+    if( suggestedLatencyFrames == 0 )
+    {
         result = driverInfo->bufferPreferredSize;
-    } else {
-        if (suggestedLatencyFrames <= (unsigned long) driverInfo->bufferMinSize) {
+    }
+    else{
+        if( suggestedLatencyFrames <= (unsigned long)driverInfo->bufferMinSize )
+        {
             result = driverInfo->bufferMinSize;
-        } else if (suggestedLatencyFrames >= (unsigned long) driverInfo->bufferMaxSize) {
+        }
+        else if( suggestedLatencyFrames >= (unsigned long)driverInfo->bufferMaxSize )
+        {
             result = driverInfo->bufferMaxSize;
-        } else {
-            if (driverInfo->bufferGranularity == -1) {
+        }
+        else
+        {
+            if( driverInfo->bufferGranularity == -1 )
+            {
                 /* power-of-two */
                 result = 2;
 
-                while (result < suggestedLatencyFrames)
+                while( result < suggestedLatencyFrames )
                     result *= 2;
 
-                if (result < (unsigned long) driverInfo->bufferMinSize)
+                if( result < (unsigned long)driverInfo->bufferMinSize )
                     result = driverInfo->bufferMinSize;
 
-                if (result > (unsigned long) driverInfo->bufferMaxSize)
+                if( result > (unsigned long)driverInfo->bufferMaxSize )
                     result = driverInfo->bufferMaxSize;
-            } else if (driverInfo->bufferGranularity == 0) {
+            }
+            else if( driverInfo->bufferGranularity == 0 )
+            {
                 /* the documentation states that bufferGranularity should be
                     zero when bufferMinSize, bufferMaxSize and
                     bufferPreferredSize are the same. We assume that is the case.
                 */
 
                 result = driverInfo->bufferPreferredSize;
-            } else {
+            }
+            else
+            {
                 /* modulo granularity */
 
                 unsigned long remainder =
-                    suggestedLatencyFrames % driverInfo->bufferGranularity;
+                        suggestedLatencyFrames % driverInfo->bufferGranularity;
 
-                if (remainder == 0) {
+                if( remainder == 0 )
+                {
                     result = suggestedLatencyFrames;
-                } else {
+                }
+                else
+                {
                     result = suggestedLatencyFrames
-                             + (driverInfo->bufferGranularity - remainder);
+                            + (driverInfo->bufferGranularity - remainder);
 
-                    if (result > (unsigned long) driverInfo->bufferMaxSize)
+                    if( result > (unsigned long)driverInfo->bufferMaxSize )
                         result = driverInfo->bufferMaxSize;
                 }
             }
@@ -1845,29 +1722,31 @@ static unsigned long SelectHostBufferSize (unsigned long suggestedLatencyFrames,
 
 /* returns channelSelectors if present */
 
-static PaError ValidateAsioSpecificStreamInfo (
-    const PaStreamParameters *streamParameters,
-    const PaAsioStreamInfo *streamInfo,
-    int deviceChannelCount,
-    int **channelSelectors)
+static PaError ValidateAsioSpecificStreamInfo(
+        const PaStreamParameters *streamParameters,
+        const PaAsioStreamInfo *streamInfo,
+        int deviceChannelCount,
+        int **channelSelectors )
 {
-    if (streamInfo) {
-        if (streamInfo->size != sizeof (PaAsioStreamInfo)
-                || streamInfo->version != 1) {
+    if( streamInfo )
+    {
+        if( streamInfo->size != sizeof( PaAsioStreamInfo )
+                || streamInfo->version != 1 )
+        {
             return paIncompatibleHostApiSpecificStreamInfo;
         }
 
-        if (streamInfo->flags & paAsioUseChannelSelectors)
+        if( streamInfo->flags & paAsioUseChannelSelectors )
             *channelSelectors = streamInfo->channelSelectors;
 
-        if (! (*channelSelectors))
+        if( !(*channelSelectors) )
             return paIncompatibleHostApiSpecificStreamInfo;
 
-        for (int i=0; i < streamParameters->channelCount; ++i) {
-            if ( (*channelSelectors) [i] < 0
-                    || (*channelSelectors) [i] >= deviceChannelCount) {
+        for( int i=0; i < streamParameters->channelCount; ++i ){
+             if( (*channelSelectors)[i] < 0
+                    || (*channelSelectors)[i] >= deviceChannelCount ){
                 return paInvalidChannelCount;
-            }
+             }           
         }
     }
 
@@ -1877,7 +1756,7 @@ static PaError ValidateAsioSpecificStreamInfo (
 
 /* see pa_hostapi.h for a list of validity guarantees made about OpenStream  parameters */
 
-static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
+static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
                            PaStream** s,
                            const PaStreamParameters *inputParameters,
                            const PaStreamParameters *outputParameters,
@@ -1885,10 +1764,10 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
                            unsigned long framesPerBuffer,
                            PaStreamFlags streamFlags,
                            PaStreamCallback *streamCallback,
-                           void *userData)
+                           void *userData )
 {
     PaError result = paNoError;
-    PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi;
+    PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi;
     PaAsioStream *stream = 0;
     PaAsioStreamInfo *inputStreamInfo, *outputStreamInfo;
     unsigned long framesPerHostBuffer;
@@ -1909,7 +1788,7 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
     bool isExternal = false;
 
     /* Are we using blocking i/o interface? */
-    int usingBlockingIo = (!streamCallback) ? TRUE : FALSE;
+    int usingBlockingIo = ( !streamCallback ) ? TRUE : FALSE;
     /* Blocking i/o stuff */
     long lBlockingBufferSize     = 0; /* Desired ring buffer size in samples. */
     long lBlockingBufferSizePow2 = 0; /* Power-of-2 rounded ring buffer size. */
@@ -1922,76 +1801,78 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
 
     /* unless we move to using lower level ASIO calls, we can only have
         one device open at a time */
-
-    if (asioHostApi->openAsioDeviceIndex != paNoDevice) {
-        PA_DEBUG ( ("OpenStream paDeviceUnavailable\n"));
+    if( asioHostApi->openAsioDeviceIndex != paNoDevice )
+    {
+        PA_DEBUG(("OpenStream paDeviceUnavailable\n"));
         return paDeviceUnavailable;
     }
 
-    if (inputParameters && outputParameters) {
+    if( inputParameters && outputParameters )
+    {
         /* full duplex ASIO stream must use the same device for input and output */
 
-        if (inputParameters->device != outputParameters->device) {
-            PA_DEBUG ( ("OpenStream paBadIODeviceCombination\n"));
+        if( inputParameters->device != outputParameters->device )
+        {
+            PA_DEBUG(("OpenStream paBadIODeviceCombination\n"));
             return paBadIODeviceCombination;
         }
     }
 
-    if (inputParameters) {
+    if( inputParameters )
+    {
         inputChannelCount = inputParameters->channelCount;
         inputSampleFormat = inputParameters->sampleFormat;
-        suggestedInputLatencyFrames = (unsigned long) ( (inputParameters->suggestedLatency * sampleRate) +0.5f);
+        suggestedInputLatencyFrames = (unsigned long)((inputParameters->suggestedLatency * sampleRate)+0.5f);
 
         /* unless alternate device specification is supported, reject the use of
             paUseHostApiSpecificDeviceSpecification */
-
-        if (inputParameters->device == paUseHostApiSpecificDeviceSpecification)
+        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )
             return paInvalidDevice;
 
         asioDeviceIndex = inputParameters->device;
 
-        PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[asioDeviceIndex];
+        PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex];
 
         /* validate hostApiSpecificStreamInfo */
-        inputStreamInfo = (PaAsioStreamInfo*) inputParameters->hostApiSpecificStreamInfo;
-
-        result = ValidateAsioSpecificStreamInfo (inputParameters, inputStreamInfo,
-                 asioDeviceInfo->commonDeviceInfo.maxInputChannels,
-                 &inputChannelSelectors
-                                                );
-
-        if (result != paNoError) return result;
-    } else {
+        inputStreamInfo = (PaAsioStreamInfo*)inputParameters->hostApiSpecificStreamInfo;
+        result = ValidateAsioSpecificStreamInfo( inputParameters, inputStreamInfo,
+            asioDeviceInfo->commonDeviceInfo.maxInputChannels,
+            &inputChannelSelectors
+        );
+        if( result != paNoError ) return result;
+    }
+    else
+    {
         inputChannelCount = 0;
         inputSampleFormat = 0;
         suggestedInputLatencyFrames = 0;
     }
 
-    if (outputParameters) {
+    if( outputParameters )
+    {
         outputChannelCount = outputParameters->channelCount;
         outputSampleFormat = outputParameters->sampleFormat;
-        suggestedOutputLatencyFrames = (unsigned long) ( (outputParameters->suggestedLatency * sampleRate) +0.5f);
+        suggestedOutputLatencyFrames = (unsigned long)((outputParameters->suggestedLatency * sampleRate)+0.5f);
 
         /* unless alternate device specification is supported, reject the use of
             paUseHostApiSpecificDeviceSpecification */
-
-        if (outputParameters->device == paUseHostApiSpecificDeviceSpecification)
+        if( outputParameters->device == paUseHostApiSpecificDeviceSpecification )
             return paInvalidDevice;
 
         asioDeviceIndex = outputParameters->device;
 
-        PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[asioDeviceIndex];
+        PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex];
 
         /* validate hostApiSpecificStreamInfo */
-        outputStreamInfo = (PaAsioStreamInfo*) outputParameters->hostApiSpecificStreamInfo;
-
-        result = ValidateAsioSpecificStreamInfo (outputParameters, outputStreamInfo,
-                 asioDeviceInfo->commonDeviceInfo.maxOutputChannels,
-                 &outputChannelSelectors
-                                                );
-
-        if (result != paNoError) return result;
-    } else {
+        outputStreamInfo = (PaAsioStreamInfo*)outputParameters->hostApiSpecificStreamInfo;
+        result = ValidateAsioSpecificStreamInfo( outputParameters, outputStreamInfo,
+            asioDeviceInfo->commonDeviceInfo.maxOutputChannels,
+            &outputChannelSelectors
+        );
+        if( result != paNoError ) return result;
+    }
+    else
+    {
         outputChannelCount = 0;
         outputSampleFormat = 0;
         suggestedOutputLatencyFrames = 0;
@@ -2002,30 +1883,33 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
     /* NOTE: we load the driver and use its current settings
         rather than the ones in our device info structure which may be stale */
 
-    result = LoadAsioDriver (asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name,
-                             driverInfo, asioHostApi->systemSpecific);
-
-    if (result == paNoError)
+    result = LoadAsioDriver( asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name,
+            driverInfo, asioHostApi->systemSpecific );
+    if( result == paNoError )
         asioIsInitialized = 1;
-    else {
-        PA_DEBUG ( ("OpenStream ERROR1 - LoadAsioDriver returned %d\n", result));
+    else{
+        PA_DEBUG(("OpenStream ERROR1 - LoadAsioDriver returned %d\n", result));
         goto error;
     }
 
     /* check that input device can support inputChannelCount */
-    if (inputChannelCount > 0) {
-        if (inputChannelCount > driverInfo->inputChannelCount) {
+    if( inputChannelCount > 0 )
+    {
+        if( inputChannelCount > driverInfo->inputChannelCount )
+        {
             result = paInvalidChannelCount;
-            PA_DEBUG ( ("OpenStream ERROR2\n"));
+            PA_DEBUG(("OpenStream ERROR2\n"));
             goto error;
         }
     }
 
     /* check that output device can support outputChannelCount */
-    if (outputChannelCount) {
-        if (outputChannelCount > driverInfo->outputChannelCount) {
+    if( outputChannelCount )
+    {
+        if( outputChannelCount > driverInfo->outputChannelCount )
+        {
             result = paInvalidChannelCount;
-            PA_DEBUG ( ("OpenStream ERROR3\n"));
+            PA_DEBUG(("OpenStream ERROR3\n"));
             goto error;
         }
     }
@@ -2037,18 +1921,16 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
     {
         ASIOClockSource clocks[32];
         long numSources=32;
-        asioError = ASIOGetClockSources (clocks, &numSources);
-
-        if (asioError != ASE_OK) {
-            PA_DEBUG ( ("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText (asioError)));
-        } else {
-            PA_DEBUG ( ("INFO ASIOGetClockSources listing %d clocks\n", numSources));
-
-            for (int i=0;i<numSources;++i) {
-                PA_DEBUG ( ("ASIOClockSource%d %s current:%d\n", i,clocks[i].name, clocks[i].isCurrentSource));
-
+        asioError = ASIOGetClockSources(clocks, &numSources);
+        if( asioError != ASE_OK ){
+            PA_DEBUG(("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText(asioError) ));
+        }else{
+            PA_DEBUG(("INFO ASIOGetClockSources listing %d clocks\n", numSources ));
+            for (int i=0;i<numSources;++i){
+                PA_DEBUG(("ASIOClockSource%d %s current:%d\n", i,clocks[i].name, clocks[i].isCurrentSource ));
+               
                 /*
-                  If you have problems with some drivers when externally clocked,
+                  If you have problems with some drivers when externally clocked, 
                   uncomment the next two lines
                  */
                 //if (clocks[i].isCurrentSource)
@@ -2057,15 +1939,15 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
         }
     }
 
-    // check that the device supports the requested sample rate
-
-    asioError = ASIOCanSampleRate (sampleRate);
+    // check that the device supports the requested sample rate 
 
-    PA_DEBUG ( ("ASIOCanSampleRate(%f):%d\n",sampleRate, asioError));
+    asioError = ASIOCanSampleRate( sampleRate );
+    PA_DEBUG(("ASIOCanSampleRate(%f):%d\n",sampleRate, asioError ));
 
-    if (asioError != ASE_OK) {
+    if( asioError != ASE_OK )
+    {
         result = paInvalidSampleRate;
-        PA_DEBUG ( ("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError)));
+        PA_DEBUG(("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) ));
         goto error;
     }
 
@@ -2074,33 +1956,32 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
     // sample rate if the device is not already in that rate.
 
     ASIOSampleRate oldRate;
-
-    asioError = ASIOGetSampleRate (&oldRate);
-
-    if (asioError != ASE_OK) {
+    asioError = ASIOGetSampleRate(&oldRate);
+    if( asioError != ASE_OK )
+    {
         result = paInvalidSampleRate;
-        PA_DEBUG ( ("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError)));
+        PA_DEBUG(("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) ));
         goto error;
     }
+    PA_DEBUG(("ASIOGetSampleRate:%f\n",oldRate));
 
-    PA_DEBUG ( ("ASIOGetSampleRate:%f\n",oldRate));
+    if (oldRate != sampleRate){
 
-    if (oldRate != sampleRate) {
+        PA_DEBUG(("before ASIOSetSampleRate(%f)\n",sampleRate));
 
-        PA_DEBUG ( ("before ASIOSetSampleRate(%f)\n",sampleRate));
-
-        asioError = ASIOSetSampleRate (isExternal?0:sampleRate);
+        asioError = ASIOSetSampleRate( isExternal?0:sampleRate );
         /* Set sample rate */
-
-        if (asioError != ASE_OK) {
+        if( asioError != ASE_OK )
+        {
             result = paInvalidSampleRate;
-            PA_DEBUG ( ("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError)));
+            PA_DEBUG(("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) ));
             goto error;
         }
-
-        PA_DEBUG ( ("after ASIOSetSampleRate(%f)\n",sampleRate));
-    } else {
-        PA_DEBUG ( ("No Need to change SR\n"));
+        PA_DEBUG(("after ASIOSetSampleRate(%f)\n",sampleRate));
+    }
+    else
+    {
+        PA_DEBUG(("No Need to change SR\n"));
     }
 
 
@@ -2111,32 +1992,30 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
     */
 
     /* validate platform specific flags */
-    if ( (streamFlags & paPlatformSpecificFlags) != 0) {
-        PA_DEBUG ( ("OpenStream invalid flags!!\n"));
+    if( (streamFlags & paPlatformSpecificFlags) != 0 ){
+        PA_DEBUG(("OpenStream invalid flags!!\n"));
         return paInvalidFlag; /* unexpected platform specific flag */
     }
 
 
-    stream = (PaAsioStream*) PaUtil_AllocateMemory (sizeof (PaAsioStream));
-
-    if (!stream) {
+    stream = (PaAsioStream*)PaUtil_AllocateMemory( sizeof(PaAsioStream) );
+    if( !stream )
+    {
         result = paInsufficientMemory;
-        PA_DEBUG ( ("OpenStream ERROR5\n"));
+        PA_DEBUG(("OpenStream ERROR5\n"));
         goto error;
     }
-
     stream->blockingState = NULL; /* Blocking i/o not initialized, yet. */
 
 
-    stream->completedBuffersPlayedEvent = CreateEvent (NULL, TRUE, FALSE, NULL);
-
-    if (stream->completedBuffersPlayedEvent == NULL) {
+    stream->completedBuffersPlayedEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
+    if( stream->completedBuffersPlayedEvent == NULL )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError());
-        PA_DEBUG ( ("OpenStream ERROR6\n"));
+        PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() );
+        PA_DEBUG(("OpenStream ERROR6\n"));
         goto error;
     }
-
     completedBuffersPlayedEventInited = 1;
 
 
@@ -2145,88 +2024,95 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
     stream->bufferPtrs = 0; /* for deallocation in error */
 
     /* Using blocking i/o interface... */
-
-    if (usingBlockingIo) {
+    if( usingBlockingIo )
+    {
         /* Blocking i/o is implemented by running callback mode, using a special blocking i/o callback. */
         streamCallback = BlockingIoPaCallback; /* Setup PA to use the ASIO blocking i/o callback. */
         userData       = &theAsioStream;       /* The callback user data will be the PA ASIO stream. */
-        PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation,
-                                               &asioHostApi->blockingStreamInterface, streamCallback, userData);
-    } else { /* Using callback interface... */
-        PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation,
-                                               &asioHostApi->callbackStreamInterface, streamCallback, userData);
+        PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation,
+                                               &asioHostApi->blockingStreamInterface, streamCallback, userData );
+    }
+    else /* Using callback interface... */
+    {
+        PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation,
+                                               &asioHostApi->callbackStreamInterface, streamCallback, userData );
     }
 
 
-    PaUtil_InitializeCpuLoadMeasurer (&stream->cpuLoadMeasurer, sampleRate);
-
+    PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate );
 
-    stream->asioBufferInfos = (ASIOBufferInfo*) PaUtil_AllocateMemory (
-                                  sizeof (ASIOBufferInfo) * (inputChannelCount + outputChannelCount));
 
-    if (!stream->asioBufferInfos) {
+    stream->asioBufferInfos = (ASIOBufferInfo*)PaUtil_AllocateMemory(
+            sizeof(ASIOBufferInfo) * (inputChannelCount + outputChannelCount) );
+    if( !stream->asioBufferInfos )
+    {
         result = paInsufficientMemory;
-        PA_DEBUG ( ("OpenStream ERROR7\n"));
+        PA_DEBUG(("OpenStream ERROR7\n"));
         goto error;
     }
 
 
-    for (i=0; i < inputChannelCount; ++i) {
+    for( i=0; i < inputChannelCount; ++i )
+    {
         ASIOBufferInfo *info = &stream->asioBufferInfos[i];
 
         info->isInput = ASIOTrue;
 
-        if (inputChannelSelectors) {
+        if( inputChannelSelectors ){
             // inputChannelSelectors values have already been validated in
             // ValidateAsioSpecificStreamInfo() above
             info->channelNum = inputChannelSelectors[i];
-        } else {
+        }else{
             info->channelNum = i;
         }
 
         info->buffers[0] = info->buffers[1] = 0;
     }
 
-    for (i=0; i < outputChannelCount; ++i) {
+    for( i=0; i < outputChannelCount; ++i ){
         ASIOBufferInfo *info = &stream->asioBufferInfos[inputChannelCount+i];
 
         info->isInput = ASIOFalse;
 
-        if (outputChannelSelectors) {
+        if( outputChannelSelectors ){
             // outputChannelSelectors values have already been validated in
             // ValidateAsioSpecificStreamInfo() above
             info->channelNum = outputChannelSelectors[i];
-        } else {
+        }else{
             info->channelNum = i;
         }
-
+        
         info->buffers[0] = info->buffers[1] = 0;
     }
 
 
     /* Using blocking i/o interface... */
-    if (usingBlockingIo) {
-        /** @todo REVIEW selection of host buffer size for blocking i/o */
+    if( usingBlockingIo )
+    {
+/** @todo REVIEW selection of host buffer size for blocking i/o */
         /* Use default host latency for blocking i/o. */
-        framesPerHostBuffer = SelectHostBufferSize (0, driverInfo);
+        framesPerHostBuffer = SelectHostBufferSize( 0, driverInfo );
 
-    } else { /* Using callback interface... */
-        framesPerHostBuffer = SelectHostBufferSize (
-                                  ( (suggestedInputLatencyFrames > suggestedOutputLatencyFrames)
-                                    ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames),
-                                  driverInfo);
+    }
+    else /* Using callback interface... */
+    {
+        framesPerHostBuffer = SelectHostBufferSize(
+                (( suggestedInputLatencyFrames > suggestedOutputLatencyFrames )
+                        ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames),
+                driverInfo );
     }
 
 
-    PA_DEBUG ( ("PaAsioOpenStream: framesPerHostBuffer :%d\n",  framesPerHostBuffer));
+    PA_DEBUG(("PaAsioOpenStream: framesPerHostBuffer :%d\n",  framesPerHostBuffer));
 
-    asioError = ASIOCreateBuffers (stream->asioBufferInfos,
-                                   inputChannelCount+outputChannelCount,
-                                   framesPerHostBuffer, &asioCallbacks_);
+    asioError = ASIOCreateBuffers( stream->asioBufferInfos,
+            inputChannelCount+outputChannelCount,
+            framesPerHostBuffer, &asioCallbacks_ );
 
-    if (asioError != ASE_OK
-            && framesPerHostBuffer != (unsigned long) driverInfo->bufferPreferredSize) {
-        PA_DEBUG ( ("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText (asioError)));
+    if( asioError != ASE_OK
+            && framesPerHostBuffer != (unsigned long)driverInfo->bufferPreferredSize )
+    {
+        PA_DEBUG(("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText(asioError) ));
         /*
             Some buggy drivers (like the Hoontech DSP24) give incorrect
             [min, preferred, max] values They should work with the preferred size
@@ -2236,217 +2122,221 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
 
         framesPerHostBuffer = driverInfo->bufferPreferredSize;
 
-        PA_DEBUG ( ("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n",  framesPerHostBuffer));
+        PA_DEBUG(("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n",  framesPerHostBuffer));
 
-        ASIOError asioError2 = ASIOCreateBuffers (stream->asioBufferInfos,
-                               inputChannelCount+outputChannelCount,
-                               framesPerHostBuffer, &asioCallbacks_);
-
-        if (asioError2 == ASE_OK)
+        ASIOError asioError2 = ASIOCreateBuffers( stream->asioBufferInfos,
+                inputChannelCount+outputChannelCount,
+                 framesPerHostBuffer, &asioCallbacks_ );
+        if( asioError2 == ASE_OK )
             asioError = ASE_OK;
     }
 
-    if (asioError != ASE_OK) {
+    if( asioError != ASE_OK )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
-        PA_DEBUG ( ("OpenStream ERROR9\n"));
+        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
+        PA_DEBUG(("OpenStream ERROR9\n"));
         goto error;
     }
 
     asioBuffersCreated = 1;
 
-    stream->asioChannelInfos = (ASIOChannelInfo*) PaUtil_AllocateMemory (
-                                   sizeof (ASIOChannelInfo) * (inputChannelCount + outputChannelCount));
-
-    if (!stream->asioChannelInfos) {
+    stream->asioChannelInfos = (ASIOChannelInfo*)PaUtil_AllocateMemory(
+            sizeof(ASIOChannelInfo) * (inputChannelCount + outputChannelCount) );
+    if( !stream->asioChannelInfos )
+    {
         result = paInsufficientMemory;
-        PA_DEBUG ( ("OpenStream ERROR10\n"));
+        PA_DEBUG(("OpenStream ERROR10\n"));
         goto error;
     }
 
-    for (i=0; i < inputChannelCount + outputChannelCount; ++i) {
+    for( i=0; i < inputChannelCount + outputChannelCount; ++i )
+    {
         stream->asioChannelInfos[i].channel = stream->asioBufferInfos[i].channelNum;
         stream->asioChannelInfos[i].isInput = stream->asioBufferInfos[i].isInput;
-        asioError = ASIOGetChannelInfo (&stream->asioChannelInfos[i]);
-
-        if (asioError != ASE_OK) {
+        asioError = ASIOGetChannelInfo( &stream->asioChannelInfos[i] );
+        if( asioError != ASE_OK )
+        {
             result = paUnanticipatedHostError;
-            PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
-            PA_DEBUG ( ("OpenStream ERROR11\n"));
+            PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
+            PA_DEBUG(("OpenStream ERROR11\n"));
             goto error;
         }
     }
 
-    stream->bufferPtrs = (void**) PaUtil_AllocateMemory (
-
-                             2 * sizeof (void*) * (inputChannelCount + outputChannelCount));
-
-    if (!stream->bufferPtrs) {
+    stream->bufferPtrs = (void**)PaUtil_AllocateMemory(
+            2 * sizeof(void*) * (inputChannelCount + outputChannelCount) );
+    if( !stream->bufferPtrs )
+    {
         result = paInsufficientMemory;
-        PA_DEBUG ( ("OpenStream ERROR12\n"));
+        PA_DEBUG(("OpenStream ERROR12\n"));
         goto error;
     }
 
-    if (inputChannelCount > 0) {
+    if( inputChannelCount > 0 )
+    {
         stream->inputBufferPtrs[0] = stream-> bufferPtrs;
         stream->inputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount];
 
-        for (i=0; i<inputChannelCount; ++i) {
+        for( i=0; i<inputChannelCount; ++i )
+        {
             stream->inputBufferPtrs[0][i] = stream->asioBufferInfos[i].buffers[0];
             stream->inputBufferPtrs[1][i] = stream->asioBufferInfos[i].buffers[1];
         }
-    } else {
+    }
+    else
+    {
         stream->inputBufferPtrs[0] = 0;
         stream->inputBufferPtrs[1] = 0;
     }
 
-    if (outputChannelCount > 0) {
+    if( outputChannelCount > 0 )
+    {
         stream->outputBufferPtrs[0] = &stream->bufferPtrs[inputChannelCount*2];
         stream->outputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount*2 + outputChannelCount];
 
-        for (i=0; i<outputChannelCount; ++i) {
+        for( i=0; i<outputChannelCount; ++i )
+        {
             stream->outputBufferPtrs[0][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[0];
             stream->outputBufferPtrs[1][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[1];
         }
-    } else {
+    }
+    else
+    {
         stream->outputBufferPtrs[0] = 0;
         stream->outputBufferPtrs[1] = 0;
     }
 
-    if (inputChannelCount > 0) {
+    if( inputChannelCount > 0 )
+    {
         /* FIXME: assume all channels use the same type for now */
         ASIOSampleType inputType = stream->asioChannelInfos[0].type;
 
-        PA_DEBUG ( ("ASIO Input  type:%d",inputType));
-        AsioSampleTypeLOG (inputType);
-        hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat (inputType);
+        PA_DEBUG(("ASIO Input  type:%d",inputType));
+        AsioSampleTypeLOG(inputType);
+        hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( inputType );
 
-        SelectAsioToPaConverter (inputType, &stream->inputBufferConverter, &stream->inputShift);
-    } else {
+        SelectAsioToPaConverter( inputType, &stream->inputBufferConverter, &stream->inputShift );
+    }
+    else
+    {
         hostInputSampleFormat = 0;
         stream->inputBufferConverter = 0;
     }
 
-    if (outputChannelCount > 0) {
+    if( outputChannelCount > 0 )
+    {
         /* FIXME: assume all channels use the same type for now */
         ASIOSampleType outputType = stream->asioChannelInfos[inputChannelCount].type;
 
-        PA_DEBUG ( ("ASIO Output type:%d",outputType));
-        AsioSampleTypeLOG (outputType);
-        hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat (outputType);
+        PA_DEBUG(("ASIO Output type:%d",outputType));
+        AsioSampleTypeLOG(outputType);
+        hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( outputType );
 
-        SelectPaToAsioConverter (outputType, &stream->outputBufferConverter, &stream->outputShift);
-    } else {
+        SelectPaToAsioConverter( outputType, &stream->outputBufferConverter, &stream->outputShift );
+    }
+    else
+    {
         hostOutputSampleFormat = 0;
         stream->outputBufferConverter = 0;
     }
 
 
-    ASIOGetLatencies (&stream->inputLatency, &stream->outputLatency);
+    ASIOGetLatencies( &stream->inputLatency, &stream->outputLatency );
 
 
     /* Using blocking i/o interface... */
-
-    if (usingBlockingIo) {
+    if( usingBlockingIo )
+    {
         /* Allocate the blocking i/o input ring buffer memory. */
-        stream->blockingState = (PaAsioStreamBlockingState*) PaUtil_AllocateMemory (sizeof (PaAsioStreamBlockingState));
-
-        if (!stream->blockingState) {
+        stream->blockingState = (PaAsioStreamBlockingState*)PaUtil_AllocateMemory( sizeof(PaAsioStreamBlockingState) );
+        if( !stream->blockingState )
+        {
             result = paInsufficientMemory;
-            PA_DEBUG ( ("ERROR! Blocking i/o interface struct allocation failed in OpenStream()\n"));
+            PA_DEBUG(("ERROR! Blocking i/o interface struct allocation failed in OpenStream()\n"));
             goto error;
         }
 
         /* Initialize blocking i/o interface struct. */
         stream->blockingState->readFramesReadyEvent   = NULL; /* Uninitialized, yet. */
-
         stream->blockingState->writeBuffersReadyEvent = NULL; /* Uninitialized, yet. */
-
         stream->blockingState->readRingBufferData     = NULL; /* Uninitialized, yet. */
-
         stream->blockingState->writeRingBufferData    = NULL; /* Uninitialized, yet. */
-
         stream->blockingState->readStreamBuffer       = NULL; /* Uninitialized, yet. */
-
         stream->blockingState->writeStreamBuffer      = NULL; /* Uninitialized, yet. */
-
         stream->blockingState->stopFlag               = TRUE; /* Not started, yet. */
 
 
         /* If the user buffer is unspecified */
-        if (framesPerBuffer == paFramesPerBufferUnspecified) {
+        if( framesPerBuffer == paFramesPerBufferUnspecified )
+        {
             /* Make the user buffer the same size as the host buffer. */
             framesPerBuffer = framesPerHostBuffer;
         }
 
 
         /* Initialize callback buffer processor. */
-        result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor               ,
-                 inputChannelCount                     ,
-                 inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */
-                 hostInputSampleFormat                 , /* Host format. */
-                 outputChannelCount                    ,
-                 outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */
-                 hostOutputSampleFormat                , /* Host format. */
-                 sampleRate                            ,
-                 streamFlags                           ,
-                 framesPerBuffer                       , /* Frames per ring buffer block. */
-                 framesPerHostBuffer                   , /* Frames per asio buffer. */
-                 paUtilFixedHostBufferSize             ,
-                 streamCallback                        ,
-                 userData);
-
-        if (result != paNoError) {
-            PA_DEBUG ( ("OpenStream ERROR13\n"));
+        result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor               ,
+                                                    inputChannelCount                     ,
+                                                    inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */
+                                                    hostInputSampleFormat                 , /* Host format. */
+                                                    outputChannelCount                    ,
+                                                    outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */
+                                                    hostOutputSampleFormat                , /* Host format. */
+                                                    sampleRate                            ,
+                                                    streamFlags                           ,
+                                                    framesPerBuffer                       , /* Frames per ring buffer block. */
+                                                    framesPerHostBuffer                   , /* Frames per asio buffer. */
+                                                    paUtilFixedHostBufferSize             ,
+                                                    streamCallback                        ,
+                                                    userData                               );
+        if( result != paNoError ){
+            PA_DEBUG(("OpenStream ERROR13\n"));
             goto error;
         }
-
         callbackBufferProcessorInited = TRUE;
 
         /* Initialize the blocking i/o buffer processor. */
-        result = PaUtil_InitializeBufferProcessor (&stream->blockingState->bufferProcessor,
-                 inputChannelCount                     ,
-                 inputSampleFormat                     , /* User format. */
-                 inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */
-                 outputChannelCount                    ,
-                 outputSampleFormat                    , /* User format. */
-                 outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */
-                 sampleRate                            ,
-                 paClipOff | paDitherOff               , /* Don't use dither nor clipping. */
-                 framesPerBuffer                       , /* Frames per user buffer. */
-                 framesPerBuffer                       , /* Frames per ring buffer block. */
-                 paUtilBoundedHostBufferSize           ,
-                 NULL, NULL);                            /* No callback! */
-
-        if (result != paNoError) {
-            PA_DEBUG ( ("ERROR! Blocking i/o buffer processor initialization failed in OpenStream()\n"));
+        result = PaUtil_InitializeBufferProcessor(&stream->blockingState->bufferProcessor,
+                                                   inputChannelCount                     ,
+                                                   inputSampleFormat                     , /* User format. */
+                                                   inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */
+                                                   outputChannelCount                    ,
+                                                   outputSampleFormat                    , /* User format. */
+                                                   outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */
+                                                   sampleRate                            ,
+                                                   paClipOff | paDitherOff               , /* Don't use dither nor clipping. */
+                                                   framesPerBuffer                       , /* Frames per user buffer. */
+                                                   framesPerBuffer                       , /* Frames per ring buffer block. */
+                                                   paUtilBoundedHostBufferSize           ,
+                                                   NULL, NULL                            );/* No callback! */
+        if( result != paNoError ){
+            PA_DEBUG(("ERROR! Blocking i/o buffer processor initialization failed in OpenStream()\n"));
             goto error;
         }
-
         blockingBufferProcessorInited = TRUE;
 
         /* If input is requested. */
-
-        if (inputChannelCount) {
+        if( inputChannelCount )
+        {
             /* Create the callback sync-event. */
-            stream->blockingState->readFramesReadyEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
-
-            if (stream->blockingState->readFramesReadyEvent == NULL) {
+            stream->blockingState->readFramesReadyEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
+            if( stream->blockingState->readFramesReadyEvent == NULL )
+            {
                 result = paUnanticipatedHostError;
-                PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError());
-                PA_DEBUG ( ("ERROR! Blocking i/o \"read frames ready\" event creation failed in OpenStream()\n"));
+                PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() );
+                PA_DEBUG(("ERROR! Blocking i/o \"read frames ready\" event creation failed in OpenStream()\n"));
                 goto error;
             }
-
             blockingReadFramesReadyEventInitialized = 1;
 
 
             /* Create pointer buffer to access non-interleaved data in ReadStream() */
-            stream->blockingState->readStreamBuffer = (void**) PaUtil_AllocateMemory (sizeof (void*) * inputChannelCount);
-
-            if (!stream->blockingState->readStreamBuffer) {
+            stream->blockingState->readStreamBuffer = (void**)PaUtil_AllocateMemory( sizeof(void*) * inputChannelCount );
+            if( !stream->blockingState->readStreamBuffer )
+            {
                 result = paInsufficientMemory;
-                PA_DEBUG ( ("ERROR! Blocking i/o read stream buffer allocation failed in OpenStream()\n"));
+                PA_DEBUG(("ERROR! Blocking i/o read stream buffer allocation failed in OpenStream()\n"));
                 goto error;
             }
 
@@ -2465,79 +2355,74 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
                5) Get the next larger (or equal) power-of-two buffer size.
              */
             lBlockingBufferSize = suggestedInputLatencyFrames - stream->inputLatency;
-
             lBlockingBufferSize = (lBlockingBufferSize > 0) ? lBlockingBufferSize : 1;
-
             lBlockingBufferSize = (lBlockingBufferSize + framesPerBuffer - 1) / framesPerBuffer;
-
             lBlockingBufferSize = (lBlockingBufferSize + 1) * framesPerBuffer;
 
             /* Get the next larger or equal power-of-two buffersize. */
             lBlockingBufferSizePow2 = 1;
-
-            while (lBlockingBufferSize > (lBlockingBufferSizePow2<<=1));
-
+            while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) );
             lBlockingBufferSize = lBlockingBufferSizePow2;
 
             /* Compute total intput latency in seconds */
             stream->streamRepresentation.streamInfo.inputLatency =
-                (double) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor)
-                          + PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor)
-                          + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer
-                          + stream->inputLatency)
+                (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor               )
+                        + PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor)
+                        + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer
+                        + stream->inputLatency )
                 / sampleRate;
 
             /* The code below prints the ASIO latency which doesn't include
                the buffer processor latency nor the blocking i/o latency. It
                reports the added latency separately.
             */
-            PA_DEBUG ( ("PaAsio : ASIO InputLatency = %ld (%ld ms),\n         added buffProc:%ld (%ld ms),\n         added blocking:%ld (%ld ms)\n",
-                        stream->inputLatency,
-                        (long) (stream->inputLatency * (1000.0 / sampleRate)),
-                        PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor),
-                        (long) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) * (1000.0 / sampleRate)),
-                        PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer,
-                        (long) ( (PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate))
-                       ));
+            PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms),\n         added buffProc:%ld (%ld ms),\n         added blocking:%ld (%ld ms)\n",
+                stream->inputLatency,
+                (long)( stream->inputLatency * (1000.0 / sampleRate) ),
+                PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor),
+                (long)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) * (1000.0 / sampleRate) ),
+                PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer,
+                (long)( (PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate) )
+                ));
 
             /* Determine the size of ring buffer in bytes. */
-            lBytesPerFrame = inputChannelCount * Pa_GetSampleSize (inputSampleFormat);
+            lBytesPerFrame = inputChannelCount * Pa_GetSampleSize(inputSampleFormat );
 
             /* Allocate the blocking i/o input ring buffer memory. */
-            stream->blockingState->readRingBufferData = (void*) PaUtil_AllocateMemory (lBlockingBufferSize * lBytesPerFrame);
-
-            if (!stream->blockingState->readRingBufferData) {
+            stream->blockingState->readRingBufferData = (void*)PaUtil_AllocateMemory( lBlockingBufferSize * lBytesPerFrame );
+            if( !stream->blockingState->readRingBufferData )
+            {
                 result = paInsufficientMemory;
-                PA_DEBUG ( ("ERROR! Blocking i/o input ring buffer allocation failed in OpenStream()\n"));
+                PA_DEBUG(("ERROR! Blocking i/o input ring buffer allocation failed in OpenStream()\n"));
                 goto error;
             }
 
             /* Initialize the input ring buffer struct. */
-            PaUtil_InitializeRingBuffer (&stream->blockingState->readRingBuffer    ,
-                                         lBytesPerFrame                           ,
-                                         lBlockingBufferSize                      ,
-                                         stream->blockingState->readRingBufferData);
+            PaUtil_InitializeRingBuffer( &stream->blockingState->readRingBuffer    ,
+                                          lBytesPerFrame                           ,
+                                          lBlockingBufferSize                      ,
+                                          stream->blockingState->readRingBufferData );
         }
 
         /* If output is requested. */
-        if (outputChannelCount) {
-            stream->blockingState->writeBuffersReadyEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
-
-            if (stream->blockingState->writeBuffersReadyEvent == NULL) {
+        if( outputChannelCount )
+        {
+            stream->blockingState->writeBuffersReadyEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
+            if( stream->blockingState->writeBuffersReadyEvent == NULL )
+            {
                 result = paUnanticipatedHostError;
-                PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError());
-                PA_DEBUG ( ("ERROR! Blocking i/o \"write buffers ready\" event creation failed in OpenStream()\n"));
+                PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() );
+                PA_DEBUG(("ERROR! Blocking i/o \"write buffers ready\" event creation failed in OpenStream()\n"));
                 goto error;
             }
-
             blockingWriteBuffersReadyEventInitialized = 1;
 
             /* Create pointer buffer to access non-interleaved data in WriteStream() */
-            stream->blockingState->writeStreamBuffer = (const void**) PaUtil_AllocateMemory (sizeof (const void*) * outputChannelCount);
-
-            if (!stream->blockingState->writeStreamBuffer) {
+            stream->blockingState->writeStreamBuffer = (const void**)PaUtil_AllocateMemory( sizeof(const void*) * outputChannelCount );
+            if( !stream->blockingState->writeStreamBuffer )
+            {
                 result = paInsufficientMemory;
-                PA_DEBUG ( ("ERROR! Blocking i/o write stream buffer allocation failed in OpenStream()\n"));
+                PA_DEBUG(("ERROR! Blocking i/o write stream buffer allocation failed in OpenStream()\n"));
                 goto error;
             }
 
@@ -2556,11 +2441,8 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
                5) Get the next larger (or equal) power-of-two buffer size.
              */
             lBlockingBufferSize = suggestedOutputLatencyFrames - stream->outputLatency;
-
             lBlockingBufferSize = (lBlockingBufferSize > 0) ? lBlockingBufferSize : 1;
-
             lBlockingBufferSize = (lBlockingBufferSize + framesPerBuffer - 1) / framesPerBuffer;
-
             lBlockingBufferSize = (lBlockingBufferSize + 1) * framesPerBuffer;
 
             /* The buffer size (without the additional block) corresponds
@@ -2570,96 +2452,93 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
 
             /* Get the next larger or equal power-of-two buffersize. */
             lBlockingBufferSizePow2 = 1;
-
-            while (lBlockingBufferSize > (lBlockingBufferSizePow2<<=1));
-
+            while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) );
             lBlockingBufferSize = lBlockingBufferSizePow2;
 
             /* Compute total output latency in seconds */
             stream->streamRepresentation.streamInfo.outputLatency =
-                (double) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor)
-                          + PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor)
-                          + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer
-                          + stream->outputLatency)
+                (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor               )
+                        + PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor)
+                        + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer
+                        + stream->outputLatency )
                 / sampleRate;
 
             /* The code below prints the ASIO latency which doesn't include
                the buffer processor latency nor the blocking i/o latency. It
                reports the added latency separately.
             */
-            PA_DEBUG ( ("PaAsio : ASIO OutputLatency = %ld (%ld ms),\n         added buffProc:%ld (%ld ms),\n         added blocking:%ld (%ld ms)\n",
-                        stream->outputLatency,
-                        (long) (stream->inputLatency * (1000.0 / sampleRate)),
-                        PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor),
-                        (long) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) * (1000.0 / sampleRate)),
-                        PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer,
-                        (long) ( (PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate))
-                       ));
+            PA_DEBUG(("PaAsio : ASIO OutputLatency = %ld (%ld ms),\n         added buffProc:%ld (%ld ms),\n         added blocking:%ld (%ld ms)\n",
+                stream->outputLatency,
+                (long)( stream->inputLatency * (1000.0 / sampleRate) ),
+                PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor),
+                (long)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) * (1000.0 / sampleRate) ),
+                PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer,
+                (long)( (PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate) )
+                ));
 
             /* Determine the size of ring buffer in bytes. */
-            lBytesPerFrame = outputChannelCount * Pa_GetSampleSize (outputSampleFormat);
+            lBytesPerFrame = outputChannelCount * Pa_GetSampleSize(outputSampleFormat);
 
             /* Allocate the blocking i/o output ring buffer memory. */
-            stream->blockingState->writeRingBufferData = (void*) PaUtil_AllocateMemory (lBlockingBufferSize * lBytesPerFrame);
-
-            if (!stream->blockingState->writeRingBufferData) {
+            stream->blockingState->writeRingBufferData = (void*)PaUtil_AllocateMemory( lBlockingBufferSize * lBytesPerFrame );
+            if( !stream->blockingState->writeRingBufferData )
+            {
                 result = paInsufficientMemory;
-                PA_DEBUG ( ("ERROR! Blocking i/o output ring buffer allocation failed in OpenStream()\n"));
+                PA_DEBUG(("ERROR! Blocking i/o output ring buffer allocation failed in OpenStream()\n"));
                 goto error;
             }
 
             /* Initialize the output ring buffer struct. */
-            PaUtil_InitializeRingBuffer (&stream->blockingState->writeRingBuffer    ,
-                                         lBytesPerFrame                            ,
-                                         lBlockingBufferSize                       ,
-                                         stream->blockingState->writeRingBufferData);
+            PaUtil_InitializeRingBuffer( &stream->blockingState->writeRingBuffer    ,
+                                          lBytesPerFrame                            ,
+                                          lBlockingBufferSize                       ,
+                                          stream->blockingState->writeRingBufferData );
         }
 
         stream->streamRepresentation.streamInfo.sampleRate = sampleRate;
 
 
-    } else { /* Using callback interface... */
-        result =  PaUtil_InitializeBufferProcessor (&stream->bufferProcessor,
-                  inputChannelCount, inputSampleFormat, hostInputSampleFormat,
-                  outputChannelCount, outputSampleFormat, hostOutputSampleFormat,
-                  sampleRate, streamFlags, framesPerBuffer,
-                  framesPerHostBuffer, paUtilFixedHostBufferSize,
-                  streamCallback, userData);
-
-        if (result != paNoError) {
-            PA_DEBUG ( ("OpenStream ERROR13\n"));
+    }
+    else /* Using callback interface... */
+    {
+        result =  PaUtil_InitializeBufferProcessor( &stream->bufferProcessor,
+                        inputChannelCount, inputSampleFormat, hostInputSampleFormat,
+                        outputChannelCount, outputSampleFormat, hostOutputSampleFormat,
+                        sampleRate, streamFlags, framesPerBuffer,
+                        framesPerHostBuffer, paUtilFixedHostBufferSize,
+                        streamCallback, userData );
+        if( result != paNoError ){
+            PA_DEBUG(("OpenStream ERROR13\n"));
             goto error;
         }
-
         callbackBufferProcessorInited = TRUE;
 
         stream->streamRepresentation.streamInfo.inputLatency =
-            (double) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor)
-                      + stream->inputLatency) / sampleRate;   // seconds
+                (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)
+                    + stream->inputLatency) / sampleRate;   // seconds
         stream->streamRepresentation.streamInfo.outputLatency =
-            (double) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor)
-                      + stream->outputLatency) / sampleRate; // seconds
+                (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)
+                    + stream->outputLatency) / sampleRate; // seconds
         stream->streamRepresentation.streamInfo.sampleRate = sampleRate;
 
         // the code below prints the ASIO latency which doesn't include the
         // buffer processor latency. it reports the added latency separately
-        PA_DEBUG ( ("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n",
-                    stream->inputLatency,
-                    (long) ( (stream->inputLatency*1000) / sampleRate),
-                    PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor),
-                    (long) ( (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) *1000) / sampleRate)
-                   ));
-
-        PA_DEBUG ( ("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n",
-                    stream->outputLatency,
-                    (long) ( (stream->outputLatency*1000) / sampleRate),
-                    PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor),
-                    (long) ( (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) *1000) / sampleRate)
-                   ));
+        PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n",
+                stream->inputLatency,
+                (long)((stream->inputLatency*1000)/ sampleRate),  
+                PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor),
+                (long)((PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)*1000)/ sampleRate)
+                ));
+
+        PA_DEBUG(("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n",
+                stream->outputLatency,
+                (long)((stream->outputLatency*1000)/ sampleRate), 
+                PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor),
+                (long)((PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)*1000)/ sampleRate)
+                ));
     }
 
     stream->asioHostApi = asioHostApi;
-
     stream->framesPerHostCallback = framesPerHostBuffer;
 
     stream->inputChannelCount = inputChannelCount;
@@ -2669,64 +2548,61 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi,
 
     asioHostApi->openAsioDeviceIndex = asioDeviceIndex;
 
-    *s = (PaStream*) stream;
+    *s = (PaStream*)stream;
 
     return result;
 
 error:
-    PA_DEBUG ( ("goto errored\n"));
-
-    if (stream) {
-        if (stream->blockingState) {
-            if (blockingBufferProcessorInited)
-                PaUtil_TerminateBufferProcessor (&stream->blockingState->bufferProcessor);
-
-            if (stream->blockingState->writeRingBufferData)
-                PaUtil_FreeMemory (stream->blockingState->writeRingBufferData);
-
-            if (stream->blockingState->writeStreamBuffer)
-                PaUtil_FreeMemory (stream->blockingState->writeStreamBuffer);
-
-            if (blockingWriteBuffersReadyEventInitialized)
-                CloseHandle (stream->blockingState->writeBuffersReadyEvent);
-
-            if (stream->blockingState->readRingBufferData)
-                PaUtil_FreeMemory (stream->blockingState->readRingBufferData);
-
-            if (stream->blockingState->readStreamBuffer)
-                PaUtil_FreeMemory (stream->blockingState->readStreamBuffer);
-
-            if (blockingReadFramesReadyEventInitialized)
-                CloseHandle (stream->blockingState->readFramesReadyEvent);
-
-            PaUtil_FreeMemory (stream->blockingState);
+    PA_DEBUG(("goto errored\n"));
+    if( stream )
+    {
+        if( stream->blockingState )
+        {
+            if( blockingBufferProcessorInited )
+                PaUtil_TerminateBufferProcessor( &stream->blockingState->bufferProcessor );
+
+            if( stream->blockingState->writeRingBufferData )
+                PaUtil_FreeMemory( stream->blockingState->writeRingBufferData );
+            if( stream->blockingState->writeStreamBuffer )
+                PaUtil_FreeMemory( stream->blockingState->writeStreamBuffer );
+            if( blockingWriteBuffersReadyEventInitialized )
+                CloseHandle( stream->blockingState->writeBuffersReadyEvent );
+
+            if( stream->blockingState->readRingBufferData )
+                PaUtil_FreeMemory( stream->blockingState->readRingBufferData );
+            if( stream->blockingState->readStreamBuffer )
+                PaUtil_FreeMemory( stream->blockingState->readStreamBuffer );
+            if( blockingReadFramesReadyEventInitialized )
+                CloseHandle( stream->blockingState->readFramesReadyEvent );
+
+            PaUtil_FreeMemory( stream->blockingState );
         }
 
-        if (callbackBufferProcessorInited)
-            PaUtil_TerminateBufferProcessor (&stream->bufferProcessor);
+        if( callbackBufferProcessorInited )
+            PaUtil_TerminateBufferProcessor( &stream->bufferProcessor );
 
-        if (completedBuffersPlayedEventInited)
-            CloseHandle (stream->completedBuffersPlayedEvent);
+        if( completedBuffersPlayedEventInited )
+            CloseHandle( stream->completedBuffersPlayedEvent );
 
-        if (stream->asioBufferInfos)
-            PaUtil_FreeMemory (stream->asioBufferInfos);
+        if( stream->asioBufferInfos )
+            PaUtil_FreeMemory( stream->asioBufferInfos );
 
-        if (stream->asioChannelInfos)
-            PaUtil_FreeMemory (stream->asioChannelInfos);
+        if( stream->asioChannelInfos )
+            PaUtil_FreeMemory( stream->asioChannelInfos );
 
-        if (stream->bufferPtrs)
-            PaUtil_FreeMemory (stream->bufferPtrs);
+        if( stream->bufferPtrs )
+            PaUtil_FreeMemory( stream->bufferPtrs );
 
-        PaUtil_FreeMemory (stream);
+        PaUtil_FreeMemory( stream );
     }
 
-    if (asioBuffersCreated)
+    if( asioBuffersCreated )
         ASIODisposeBuffers();
 
-    if (asioIsInitialized) {
-        UnloadAsioDriver();
-    }
-
+    if( asioIsInitialized )
+	{
+		UnloadAsioDriver();
+	}
     return result;
 }
 
@@ -2735,48 +2611,46 @@ error:
     When CloseStream() is called, the multi-api layer ensures that
     the stream has already been stopped or aborted.
 */
-static PaError CloseStream (PaStream* s)
+static PaError CloseStream( PaStream* s )
 {
     PaError result = paNoError;
-    PaAsioStream *stream = (PaAsioStream*) s;
+    PaAsioStream *stream = (PaAsioStream*)s;
 
     /*
         IMPLEMENT ME:
             - additional stream closing + cleanup
     */
 
-    PaUtil_TerminateBufferProcessor (&stream->bufferProcessor);
-    PaUtil_TerminateStreamRepresentation (&stream->streamRepresentation);
+    PaUtil_TerminateBufferProcessor( &stream->bufferProcessor );
+    PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation );
 
     stream->asioHostApi->openAsioDeviceIndex = paNoDevice;
 
-    CloseHandle (stream->completedBuffersPlayedEvent);
+    CloseHandle( stream->completedBuffersPlayedEvent );
 
     /* Using blocking i/o interface... */
+    if( stream->blockingState )
+    {
+        PaUtil_TerminateBufferProcessor( &stream->blockingState->bufferProcessor );
 
-    if (stream->blockingState) {
-        PaUtil_TerminateBufferProcessor (&stream->blockingState->bufferProcessor);
-
-        if (stream->inputChannelCount) {
-            PaUtil_FreeMemory (stream->blockingState->readRingBufferData);
-            PaUtil_FreeMemory (stream->blockingState->readStreamBuffer);
-            CloseHandle (stream->blockingState->readFramesReadyEvent);
+        if( stream->inputChannelCount ) {
+            PaUtil_FreeMemory( stream->blockingState->readRingBufferData );
+            PaUtil_FreeMemory( stream->blockingState->readStreamBuffer  );
+            CloseHandle( stream->blockingState->readFramesReadyEvent );
         }
-
-        if (stream->outputChannelCount) {
-            PaUtil_FreeMemory (stream->blockingState->writeRingBufferData);
-            PaUtil_FreeMemory (stream->blockingState->writeStreamBuffer);
-            CloseHandle (stream->blockingState->writeBuffersReadyEvent);
+        if( stream->outputChannelCount ) {
+            PaUtil_FreeMemory( stream->blockingState->writeRingBufferData );
+            PaUtil_FreeMemory( stream->blockingState->writeStreamBuffer );
+            CloseHandle( stream->blockingState->writeBuffersReadyEvent );
         }
 
-        PaUtil_FreeMemory (stream->blockingState);
+        PaUtil_FreeMemory( stream->blockingState );
     }
 
-    PaUtil_FreeMemory (stream->asioBufferInfos);
-
-    PaUtil_FreeMemory (stream->asioChannelInfos);
-    PaUtil_FreeMemory (stream->bufferPtrs);
-    PaUtil_FreeMemory (stream);
+    PaUtil_FreeMemory( stream->asioBufferInfos );
+    PaUtil_FreeMemory( stream->asioChannelInfos );
+    PaUtil_FreeMemory( stream->bufferPtrs );
+    PaUtil_FreeMemory( stream );
 
     ASIODisposeBuffers();
     UnloadAsioDriver();
@@ -2785,7 +2659,7 @@ static PaError CloseStream (PaStream* s)
 }
 
 
-static void bufferSwitch (long index, ASIOBool directProcess)
+static void bufferSwitch(long index, ASIOBool directProcess)
 {
 //TAKEN FROM THE ASIO SDK
 
@@ -2799,28 +2673,27 @@ static void bufferSwitch (long index, ASIOBool directProcess)
     // timeInfo.systemTime fields and the according flags
 
     ASIOTime  timeInfo;
-    memset (&timeInfo, 0, sizeof (timeInfo));
+    memset( &timeInfo, 0, sizeof (timeInfo) );
 
     // get the time stamp of the buffer, not necessary if no
     // synchronization to other media is required
-
-    if (ASIOGetSamplePosition (&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK)
-        timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid;
+    if( ASIOGetSamplePosition(&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK)
+            timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid;
 
     // Call the real callback
-    bufferSwitchTimeInfo (&timeInfo, index, directProcess);
+    bufferSwitchTimeInfo( &timeInfo, index, directProcess );
 }
 
 
 // conversion from 64 bit ASIOSample/ASIOTimeStamp to double float
 #if NATIVE_INT64
-#define ASIO64toDouble(a)  (a)
+    #define ASIO64toDouble(a)  (a)
 #else
-const double twoRaisedTo32 = 4294967296.;
-#define ASIO64toDouble(a)  ((a).lo + (a).hi * twoRaisedTo32)
+    const double twoRaisedTo32 = 4294967296.;
+    #define ASIO64toDouble(a)  ((a).lo + (a).hi * twoRaisedTo32)
 #endif
 
-static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool directProcess)
+static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool directProcess )
 {
     // the actual processing callback.
     // Beware that this is normally in a seperate thread, hence be sure that
@@ -2849,23 +2722,22 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool
     // synchronization to other media is required
 
     if (timeInfo->timeInfo.flags & kSystemTimeValid)
-        asioDriverInfo.nanoSeconds = ASIO64toDouble (timeInfo->timeInfo.systemTime);
+            asioDriverInfo.nanoSeconds = ASIO64toDouble(timeInfo->timeInfo.systemTime);
     else
-        asioDriverInfo.nanoSeconds = 0;
+            asioDriverInfo.nanoSeconds = 0;
 
     if (timeInfo->timeInfo.flags & kSamplePositionValid)
-        asioDriverInfo.samples = ASIO64toDouble (timeInfo->timeInfo.samplePosition);
+            asioDriverInfo.samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition);
     else
-        asioDriverInfo.samples = 0;
+            asioDriverInfo.samples = 0;
 
     if (timeInfo->timeCode.flags & kTcValid)
-        asioDriverInfo.tcSamples = ASIO64toDouble (timeInfo->timeCode.timeCodeSamples);
+            asioDriverInfo.tcSamples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples);
     else
-        asioDriverInfo.tcSamples = 0;
+            asioDriverInfo.tcSamples = 0;
 
     // get the system reference time
     asioDriverInfo.sysRefTime = get_sys_reference_time();
-
 #endif
 
 #if 0
@@ -2873,19 +2745,14 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool
     // tells you the time when driver got its interrupt and the delay until the app receives
     // the event notification.
     static double last_samples = 0;
-
     char tmp[128];
-
-    sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples                 \n", asioDriverInfo.sysRefTime - (long) (asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long) (asioDriverInfo.nanoSeconds / 1000000.0), (long) (asioDriverInfo.samples - last_samples));
-
+    sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples                 \n", asioDriverInfo.sysRefTime - (long)(asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long)(asioDriverInfo.nanoSeconds / 1000000.0), (long)(asioDriverInfo.samples - last_samples));
     OutputDebugString (tmp);
-
     last_samples = asioDriverInfo.samples;
-
 #endif
 
 
-    if (!theAsioStream)
+    if( !theAsioStream )
         return 0L;
 
     // Keep sample position
@@ -2893,51 +2760,57 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool
 
 
     // protect against reentrancy
-    if (PaAsio_AtomicIncrement (&theAsioStream->reenterCount)) {
+    if( PaAsio_AtomicIncrement(&theAsioStream->reenterCount) )
+    {
         theAsioStream->reenterError++;
         //DBUG(("bufferSwitchTimeInfo : reentrancy detection = %d\n", asioDriverInfo.reenterError));
         return 0L;
     }
 
     int buffersDone = 0;
-
-    do {
-        if (buffersDone > 0) {
+    
+    do
+    {
+        if( buffersDone > 0 )
+        {
             // this is a reentered buffer, we missed processing it on time
             // set the input overflow and output underflow flags as appropriate
-
-            if (theAsioStream->inputChannelCount > 0)
+            
+            if( theAsioStream->inputChannelCount > 0 )
                 theAsioStream->callbackFlags |= paInputOverflow;
-
-            if (theAsioStream->outputChannelCount > 0)
+                
+            if( theAsioStream->outputChannelCount > 0 )
                 theAsioStream->callbackFlags |= paOutputUnderflow;
-        } else {
-            if (theAsioStream->zeroOutput) {
-                ZeroOutputBuffers (theAsioStream, index);
+        }
+        else
+        {
+            if( theAsioStream->zeroOutput )
+            {
+                ZeroOutputBuffers( theAsioStream, index );
 
                 // Finally if the driver supports the ASIOOutputReady() optimization,
                 // do it here, all data are in place
-
-                if (theAsioStream->postOutput)
+                if( theAsioStream->postOutput )
                     ASIOOutputReady();
 
-                if (theAsioStream->stopProcessing) {
-                    if (theAsioStream->stopPlayoutCount < 2) {
+                if( theAsioStream->stopProcessing )
+                {
+                    if( theAsioStream->stopPlayoutCount < 2 )
+                    {
                         ++theAsioStream->stopPlayoutCount;
-
-                        if (theAsioStream->stopPlayoutCount == 2) {
+                        if( theAsioStream->stopPlayoutCount == 2 )
+                        {
                             theAsioStream->isActive = 0;
-
-                            if (theAsioStream->streamRepresentation.streamFinishedCallback != 0)
-                                theAsioStream->streamRepresentation.streamFinishedCallback (theAsioStream->streamRepresentation.userData);
-
+                            if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 )
+                                theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData );
                             theAsioStream->streamFinishedCallbackCalled = true;
-
-                            SetEvent (theAsioStream->completedBuffersPlayedEvent);
+                            SetEvent( theAsioStream->completedBuffersPlayedEvent );
                         }
                     }
                 }
-            } else {
+            }
+            else
+            {
 
 #if 0
 // test code to try to detect slip conditions... these may work on some systems
@@ -2945,168 +2818,165 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool
 
 // check that sample delta matches buffer size (otherwise we must have skipped
 // a buffer.
-                static double last_samples = -512;
-                double samples;
+static double last_samples = -512;
+double samples;
 //if( timeInfo->timeCode.flags & kTcValid )
 //    samples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples);
 //else
-                samples = ASIO64toDouble (timeInfo->timeInfo.samplePosition);
-                int delta = samples - last_samples;
+    samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition);
+int delta = samples - last_samples;
 //printf( "%d\n", delta);
-                last_samples = samples;
+last_samples = samples;
 
-                if (delta > theAsioStream->framesPerHostCallback) {
-                    if (theAsioStream->inputChannelCount > 0)
-                        theAsioStream->callbackFlags |= paInputOverflow;
+if( delta > theAsioStream->framesPerHostCallback )
+{
+    if( theAsioStream->inputChannelCount > 0 )
+        theAsioStream->callbackFlags |= paInputOverflow;
 
-                    if (theAsioStream->outputChannelCount > 0)
-                        theAsioStream->callbackFlags |= paOutputUnderflow;
-                }
+    if( theAsioStream->outputChannelCount > 0 )
+        theAsioStream->callbackFlags |= paOutputUnderflow;
+}
 
 // check that the buffer index is not the previous index (which would indicate
 // that a buffer was skipped.
-                static int previousIndex = 1;
-
-                if (index == previousIndex) {
-                    if (theAsioStream->inputChannelCount > 0)
-                        theAsioStream->callbackFlags |= paInputOverflow;
-
-                    if (theAsioStream->outputChannelCount > 0)
-                        theAsioStream->callbackFlags |= paOutputUnderflow;
-                }
-
-                previousIndex = index;
+static int previousIndex = 1;
+if( index == previousIndex )
+{
+    if( theAsioStream->inputChannelCount > 0 )
+        theAsioStream->callbackFlags |= paInputOverflow;
 
+    if( theAsioStream->outputChannelCount > 0 )
+        theAsioStream->callbackFlags |= paOutputUnderflow;
+}
+previousIndex = index;
 #endif
 
                 int i;
 
-                PaUtil_BeginCpuLoadMeasurement (&theAsioStream->cpuLoadMeasurer);
+                PaUtil_BeginCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer );
 
                 PaStreamCallbackTimeInfo paTimeInfo;
 
                 // asio systemTime is supposed to be measured according to the same
                 // clock as timeGetTime
-                paTimeInfo.currentTime = (ASIO64toDouble (timeInfo->timeInfo.systemTime) * .000000001);
+                paTimeInfo.currentTime = (ASIO64toDouble( timeInfo->timeInfo.systemTime ) * .000000001);
 
                 /* patch from Paul Boege */
                 paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime -
-                                                ( (double) theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate);
+                    ((double)theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate);
 
                 paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime +
-                                                 ( (double) theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate);
+                    ((double)theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate);
 
                 /* old version is buggy because the buffer processor also adds in its latency to the time parameters
                 paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - theAsioStream->streamRepresentation.streamInfo.inputLatency;
                 paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + theAsioStream->streamRepresentation.streamInfo.outputLatency;
                 */
 
-                /* Disabled! Stopping and re-starting the stream causes an input overflow / output undeflow. S.Fischer */
+/* Disabled! Stopping and re-starting the stream causes an input overflow / output undeflow. S.Fischer */
 #if 0
 // detect underflows by checking inter-callback time > 2 buffer period
-                static double previousTime = -1;
+static double previousTime = -1;
+if( previousTime > 0 ){
 
-                if (previousTime > 0) {
-
-                    double delta = paTimeInfo.currentTime - previousTime;
-
-                    if (delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate)) {
-                        if (theAsioStream->inputChannelCount > 0)
-                            theAsioStream->callbackFlags |= paInputOverflow;
-
-                        if (theAsioStream->outputChannelCount > 0)
-                            theAsioStream->callbackFlags |= paOutputUnderflow;
-                    }
-                }
+    double delta = paTimeInfo.currentTime - previousTime;
 
-                previousTime = paTimeInfo.currentTime;
+    if( delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate) ){
+        if( theAsioStream->inputChannelCount > 0 )
+            theAsioStream->callbackFlags |= paInputOverflow;
 
+        if( theAsioStream->outputChannelCount > 0 )
+            theAsioStream->callbackFlags |= paOutputUnderflow;
+    }
+}
+previousTime = paTimeInfo.currentTime;
 #endif
 
                 // note that the above input and output times do not need to be
                 // adjusted for the latency of the buffer processor -- the buffer
                 // processor handles that.
 
-                if (theAsioStream->inputBufferConverter) {
-                    for (i=0; i<theAsioStream->inputChannelCount; i++) {
-                        theAsioStream->inputBufferConverter (theAsioStream->inputBufferPtrs[index][i],
-                                                             theAsioStream->inputShift, theAsioStream->framesPerHostCallback);
+                if( theAsioStream->inputBufferConverter )
+                {
+                    for( i=0; i<theAsioStream->inputChannelCount; i++ )
+                    {
+                        theAsioStream->inputBufferConverter( theAsioStream->inputBufferPtrs[index][i],
+                                theAsioStream->inputShift, theAsioStream->framesPerHostCallback );
                     }
                 }
 
-                PaUtil_BeginBufferProcessing (&theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags);
+                PaUtil_BeginBufferProcessing( &theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags );
 
                 /* reset status flags once they've been passed to the callback */
                 theAsioStream->callbackFlags = 0;
 
-                PaUtil_SetInputFrameCount (&theAsioStream->bufferProcessor, 0 /* default to host buffer size */);
-
-                for (i=0; i<theAsioStream->inputChannelCount; ++i)
-                    PaUtil_SetNonInterleavedInputChannel (&theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i]);
+                PaUtil_SetInputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ );
+                for( i=0; i<theAsioStream->inputChannelCount; ++i )
+                    PaUtil_SetNonInterleavedInputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i] );
 
-                PaUtil_SetOutputFrameCount (&theAsioStream->bufferProcessor, 0 /* default to host buffer size */);
-
-                for (i=0; i<theAsioStream->outputChannelCount; ++i)
-                    PaUtil_SetNonInterleavedOutputChannel (&theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i]);
+                PaUtil_SetOutputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ );
+                for( i=0; i<theAsioStream->outputChannelCount; ++i )
+                    PaUtil_SetNonInterleavedOutputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i] );
 
                 int callbackResult;
-
-                if (theAsioStream->stopProcessing)
+                if( theAsioStream->stopProcessing )
                     callbackResult = paComplete;
                 else
                     callbackResult = paContinue;
-
-                unsigned long framesProcessed = PaUtil_EndBufferProcessing (&theAsioStream->bufferProcessor, &callbackResult);
-
-                if (theAsioStream->outputBufferConverter) {
-                    for (i=0; i<theAsioStream->outputChannelCount; i++) {
-                        theAsioStream->outputBufferConverter (theAsioStream->outputBufferPtrs[index][i],
-                                                              theAsioStream->outputShift, theAsioStream->framesPerHostCallback);
+                unsigned long framesProcessed = PaUtil_EndBufferProcessing( &theAsioStream->bufferProcessor, &callbackResult );
+
+                if( theAsioStream->outputBufferConverter )
+                {
+                    for( i=0; i<theAsioStream->outputChannelCount; i++ )
+                    {
+                        theAsioStream->outputBufferConverter( theAsioStream->outputBufferPtrs[index][i],
+                                theAsioStream->outputShift, theAsioStream->framesPerHostCallback );
                     }
                 }
 
-                PaUtil_EndCpuLoadMeasurement (&theAsioStream->cpuLoadMeasurer, framesProcessed);
+                PaUtil_EndCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer, framesProcessed );
 
                 // Finally if the driver supports the ASIOOutputReady() optimization,
                 // do it here, all data are in place
-
-                if (theAsioStream->postOutput)
+                if( theAsioStream->postOutput )
                     ASIOOutputReady();
 
-                if (callbackResult == paContinue) {
+                if( callbackResult == paContinue )
+                {
                     /* nothing special to do */
-                } else if (callbackResult == paAbort) {
+                }
+                else if( callbackResult == paAbort )
+                {
                     /* finish playback immediately  */
                     theAsioStream->isActive = 0;
-
-                    if (theAsioStream->streamRepresentation.streamFinishedCallback != 0)
-                        theAsioStream->streamRepresentation.streamFinishedCallback (theAsioStream->streamRepresentation.userData);
-
+                    if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 )
+                        theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData );
                     theAsioStream->streamFinishedCallbackCalled = true;
-
-                    SetEvent (theAsioStream->completedBuffersPlayedEvent);
-
+                    SetEvent( theAsioStream->completedBuffersPlayedEvent );
                     theAsioStream->zeroOutput = true;
-                } else { /* paComplete or other non-zero value indicating complete */
+                }
+                else /* paComplete or other non-zero value indicating complete */
+                {
                     /* Finish playback once currently queued audio has completed. */
                     theAsioStream->stopProcessing = true;
 
-                    if (PaUtil_IsBufferProcessorOutputEmpty (&theAsioStream->bufferProcessor)) {
+                    if( PaUtil_IsBufferProcessorOutputEmpty( &theAsioStream->bufferProcessor ) )
+                    {
                         theAsioStream->zeroOutput = true;
                         theAsioStream->stopPlayoutCount = 0;
                     }
                 }
             }
         }
-
+        
         ++buffersDone;
-    } while (PaAsio_AtomicDecrement (&theAsioStream->reenterCount) >= 0);
+    }while( PaAsio_AtomicDecrement(&theAsioStream->reenterCount) >= 0 );
 
     return 0L;
 }
 
 
-static void sampleRateChanged (ASIOSampleRate sRate)
+static void sampleRateChanged(ASIOSampleRate sRate)
 {
     // TAKEN FROM THE ASIO SDK
     // do whatever you need to do if the sample rate changed
@@ -3117,10 +2987,10 @@ static void sampleRateChanged (ASIOSampleRate sRate)
     // You might have to update time/sample related conversion routines, etc.
 
     (void) sRate; /* unused parameter */
-    PA_DEBUG ( ("sampleRateChanged : %d \n", sRate));
+    PA_DEBUG( ("sampleRateChanged : %d \n", sRate));
 }
 
-static long asioMessages (long selector, long value, void* message, double* opt)
+static long asioMessages(long selector, long value, void* message, double* opt)
 {
 // TAKEN FROM THE ASIO SDK
     // currently the parameters "value", "message" and "opt" are not used.
@@ -3129,22 +2999,20 @@ static long asioMessages (long selector, long value, void* message, double* opt)
     (void) message; /* unused parameters */
     (void) opt;
 
-    PA_DEBUG ( ("asioMessages : %d , %d \n", selector, value));
-
-    switch (selector) {
+    PA_DEBUG( ("asioMessages : %d , %d \n", selector, value));
 
+    switch(selector)
+    {
         case kAsioSelectorSupported:
-
-            if (value == kAsioResetRequest
-                    || value == kAsioEngineVersion
-                    || value == kAsioResyncRequest
-                    || value == kAsioLatenciesChanged
-                    // the following three were added for ASIO 2.0, you don't necessarily have to support them
-                    || value == kAsioSupportsTimeInfo
-                    || value == kAsioSupportsTimeCode
-                    || value == kAsioSupportsInputMonitor)
-                ret = 1L;
-
+            if(value == kAsioResetRequest
+            || value == kAsioEngineVersion
+            || value == kAsioResyncRequest
+            || value == kAsioLatenciesChanged
+            // the following three were added for ASIO 2.0, you don't necessarily have to support them
+            || value == kAsioSupportsTimeInfo
+            || value == kAsioSupportsTimeCode
+            || value == kAsioSupportsInputMonitor)
+                    ret = 1L;
             break;
 
         case kAsioBufferSizeChange:
@@ -3160,7 +3028,6 @@ static long asioMessages (long selector, long value, void* message, double* opt)
             /*FIXME: commented the next line out */
             //asioDriverInfo.stopped;  // In this sample the processing will just stop
             ret = 1L;
-
             break;
 
         case kAsioResyncRequest:
@@ -3171,7 +3038,6 @@ static long asioMessages (long selector, long value, void* message, double* opt)
             // by another thread.
             // However a driver can issue it in other situations, too.
             ret = 1L;
-
             break;
 
         case kAsioLatenciesChanged:
@@ -3179,7 +3045,6 @@ static long asioMessages (long selector, long value, void* message, double* opt)
             // Beware, it this does not mean that the buffer sizes have changed!
             // You might need to update internal delay data.
             ret = 1L;
-
             //printf("kAsioLatenciesChanged \n");
             break;
 
@@ -3188,7 +3053,6 @@ static long asioMessages (long selector, long value, void* message, double* opt)
             // If a host applications does not implement this selector, ASIO 1.0 is assumed
             // by the driver
             ret = 2L;
-
             break;
 
         case kAsioSupportsTimeInfo:
@@ -3197,7 +3061,6 @@ static long asioMessages (long selector, long value, void* message, double* opt)
             // For compatibility with ASIO 1.0 drivers the host application should always support
             // the "old" bufferSwitch method, too.
             ret = 1;
-
             break;
 
         case kAsioSupportsTimeCode:
@@ -3205,28 +3068,26 @@ static long asioMessages (long selector, long value, void* message, double* opt)
             // If an application does not need to know about time code, the driver has less work
             // to do.
             ret = 0;
-
             break;
     }
-
     return ret;
 }
 
 
-static PaError StartStream (PaStream *s)
+static PaError StartStream( PaStream *s )
 {
     PaError result = paNoError;
-    PaAsioStream *stream = (PaAsioStream*) s;
+    PaAsioStream *stream = (PaAsioStream*)s;
     PaAsioStreamBlockingState *blockingState = stream->blockingState;
     ASIOError asioError;
 
-    if (stream->outputChannelCount > 0) {
-        ZeroOutputBuffers (stream, 0);
-        ZeroOutputBuffers (stream, 1);
+    if( stream->outputChannelCount > 0 )
+    {
+        ZeroOutputBuffers( stream, 0 );
+        ZeroOutputBuffers( stream, 1 );
     }
 
-    PaUtil_ResetBufferProcessor (&stream->bufferProcessor);
-
+    PaUtil_ResetBufferProcessor( &stream->bufferProcessor );
     stream->stopProcessing = false;
     stream->zeroOutput = false;
 
@@ -3236,77 +3097,77 @@ static PaError StartStream (PaStream *s)
 
     stream->callbackFlags = 0;
 
-    if (ResetEvent (stream->completedBuffersPlayedEvent) == 0) {
+    if( ResetEvent( stream->completedBuffersPlayedEvent ) == 0 )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError());
+        PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() );
     }
 
 
     /* Using blocking i/o interface... */
-    if (blockingState) {
+    if( blockingState )
+    {
         /* Reset blocking i/o buffer processor. */
-        PaUtil_ResetBufferProcessor (&blockingState->bufferProcessor);
+        PaUtil_ResetBufferProcessor( &blockingState->bufferProcessor );
 
         /* If we're about to process some input data. */
-
-        if (stream->inputChannelCount) {
+        if( stream->inputChannelCount )
+        {
             /* Reset callback-ReadStream sync event. */
-            if (ResetEvent (blockingState->readFramesReadyEvent) == 0) {
+            if( ResetEvent( blockingState->readFramesReadyEvent ) == 0 )
+            {
                 result = paUnanticipatedHostError;
-                PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError());
+                PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() );
             }
 
             /* Flush blocking i/o ring buffer. */
-            PaUtil_FlushRingBuffer (&blockingState->readRingBuffer);
-
-            (*blockingState->bufferProcessor.inputZeroer) (blockingState->readRingBuffer.buffer, 1, blockingState->bufferProcessor.inputChannelCount * blockingState->readRingBuffer.bufferSize);
+            PaUtil_FlushRingBuffer( &blockingState->readRingBuffer );
+            (*blockingState->bufferProcessor.inputZeroer)( blockingState->readRingBuffer.buffer, 1, blockingState->bufferProcessor.inputChannelCount * blockingState->readRingBuffer.bufferSize );
         }
 
         /* If we're about to process some output data. */
-        if (stream->outputChannelCount) {
+        if( stream->outputChannelCount )
+        {
             /* Reset callback-WriteStream sync event. */
-            if (ResetEvent (blockingState->writeBuffersReadyEvent) == 0) {
+            if( ResetEvent( blockingState->writeBuffersReadyEvent ) == 0 )
+            {
                 result = paUnanticipatedHostError;
-                PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError());
+                PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() );
             }
 
             /* Flush blocking i/o ring buffer. */
-            PaUtil_FlushRingBuffer (&blockingState->writeRingBuffer);
-
-            (*blockingState->bufferProcessor.outputZeroer) (blockingState->writeRingBuffer.buffer, 1, blockingState->bufferProcessor.outputChannelCount * blockingState->writeRingBuffer.bufferSize);
+            PaUtil_FlushRingBuffer( &blockingState->writeRingBuffer );
+            (*blockingState->bufferProcessor.outputZeroer)( blockingState->writeRingBuffer.buffer, 1, blockingState->bufferProcessor.outputChannelCount * blockingState->writeRingBuffer.bufferSize );
 
             /* Initialize the output ring buffer to "silence". */
-            PaUtil_AdvanceRingBufferWriteIndex (&blockingState->writeRingBuffer, blockingState->writeRingBufferInitialFrames);
+            PaUtil_AdvanceRingBufferWriteIndex( &blockingState->writeRingBuffer, blockingState->writeRingBufferInitialFrames );
         }
 
         /* Clear requested frames / buffers count. */
         blockingState->writeBuffersRequested     = 0;
-
         blockingState->readFramesRequested       = 0;
-
         blockingState->writeBuffersRequestedFlag = FALSE;
-
         blockingState->readFramesRequestedFlag   = FALSE;
-
         blockingState->outputUnderflowFlag       = FALSE;
-
         blockingState->inputOverflowFlag         = FALSE;
-
         blockingState->stopFlag                  = FALSE;
     }
 
 
-    if (result == paNoError) {
+    if( result == paNoError )
+    {
         theAsioStream = stream;
         asioError = ASIOStart();
-
-        if (asioError == ASE_OK) {
+        if( asioError == ASE_OK )
+        {
             stream->isActive = 1;
             stream->streamFinishedCallbackCalled = false;
-        } else {
+        }
+        else
+        {
             theAsioStream = 0;
             result = paUnanticipatedHostError;
-            PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+            PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
         }
     }
 
@@ -3314,16 +3175,18 @@ static PaError StartStream (PaStream *s)
 }
 
 
-static PaError StopStream (PaStream *s)
+static PaError StopStream( PaStream *s )
 {
     PaError result = paNoError;
-    PaAsioStream *stream = (PaAsioStream*) s;
+    PaAsioStream *stream = (PaAsioStream*)s;
     PaAsioStreamBlockingState *blockingState = stream->blockingState;
     ASIOError asioError;
 
-    if (stream->isActive) {
+    if( stream->isActive )
+    {
         /* If blocking i/o output is in use */
-        if (blockingState && stream->outputChannelCount) {
+        if( blockingState && stream->outputChannelCount )
+        {
             /* Request the whole output buffer to be available. */
             blockingState->writeBuffersRequested = blockingState->writeRingBuffer.bufferSize;
             /* Signalize that additional buffers are need. */
@@ -3334,18 +3197,20 @@ static PaError StopStream (PaStream *s)
             /* Wait until requested number of buffers has been freed. Time
                out after twice the blocking i/o ouput buffer could have
                been consumed. */
-            DWORD timeout = (DWORD) (2 * blockingState->writeRingBuffer.bufferSize * 1000
-                                     / stream->streamRepresentation.streamInfo.sampleRate);
-            DWORD waitResult = WaitForSingleObject (blockingState->writeBuffersReadyEvent, timeout);
+            DWORD timeout = (DWORD)( 2 * blockingState->writeRingBuffer.bufferSize * 1000
+                                       / stream->streamRepresentation.streamInfo.sampleRate );
+            DWORD waitResult = WaitForSingleObject( blockingState->writeBuffersReadyEvent, timeout );
 
             /* If something seriously went wrong... */
-
-            if (waitResult == WAIT_FAILED) {
-                PA_DEBUG ( ("WaitForSingleObject() failed in StopStream()\n"));
+            if( waitResult == WAIT_FAILED )
+            {
+                PA_DEBUG(("WaitForSingleObject() failed in StopStream()\n"));
                 result = paUnanticipatedHostError;
-                PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError());
-            } else if (waitResult == WAIT_TIMEOUT) {
-                PA_DEBUG ( ("WaitForSingleObject() timed out in StopStream()\n"));
+                PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() );
+            }
+            else if( waitResult == WAIT_TIMEOUT )
+            {
+                PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n"));
                 result = paTimedOut;
             }
         }
@@ -3359,55 +3224,57 @@ static PaError StopStream (PaStream *s)
             length is longer than the asio buffer size then that should
             be taken into account.
         */
-
-        if (WaitForSingleObject (theAsioStream->completedBuffersPlayedEvent,
-                                 (DWORD) (stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.))
-                == WAIT_TIMEOUT) {
-            PA_DEBUG ( ("WaitForSingleObject() timed out in StopStream()\n"));
+        if( WaitForSingleObject( theAsioStream->completedBuffersPlayedEvent,
+                (DWORD)(stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.) )
+                    == WAIT_TIMEOUT )
+        {
+            PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n" ));
         }
     }
 
     asioError = ASIOStop();
-
-    if (asioError != ASE_OK) {
+    if( asioError != ASE_OK )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
     }
 
     theAsioStream = 0;
-
     stream->isActive = 0;
 
-    if (!stream->streamFinishedCallbackCalled) {
-        if (stream->streamRepresentation.streamFinishedCallback != 0)
-            stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData);
+    if( !stream->streamFinishedCallbackCalled )
+    {
+        if( stream->streamRepresentation.streamFinishedCallback != 0 )
+            stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData );
     }
 
     return result;
 }
 
 
-static PaError AbortStream (PaStream *s)
+static PaError AbortStream( PaStream *s )
 {
     PaError result = paNoError;
-    PaAsioStream *stream = (PaAsioStream*) s;
+    PaAsioStream *stream = (PaAsioStream*)s;
     ASIOError asioError;
 
     stream->zeroOutput = true;
 
     asioError = ASIOStop();
-
-    if (asioError != ASE_OK) {
+    if( asioError != ASE_OK )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
-    } else {
+        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
+    }
+    else
+    {
         // make sure that the callback is not still in-flight when ASIOStop()
         // returns. This has been observed to happen on the Hoontech DSP24 for
         // example.
         int count = 2000;  // only wait for 2 seconds, rather than hanging.
-
-        while (theAsioStream->reenterCount != -1 && count > 0) {
-            Sleep (1);
+        while( theAsioStream->reenterCount != -1 && count > 0 )
+        {
+            Sleep(1);
             --count;
         }
     }
@@ -3417,21 +3284,21 @@ static PaError AbortStream (PaStream *s)
         not - this is based on the fact that ASIOStop is unlikely to fail
         if the callback is running - it's more likely to fail because the
         callback is not running. */
-
+        
     theAsioStream = 0;
-
     stream->isActive = 0;
 
-    if (!stream->streamFinishedCallbackCalled) {
-        if (stream->streamRepresentation.streamFinishedCallback != 0)
-            stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData);
+    if( !stream->streamFinishedCallbackCalled )
+    {
+        if( stream->streamRepresentation.streamFinishedCallback != 0 )
+            stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData );
     }
 
     return result;
 }
 
 
-static PaError IsStreamStopped (PaStream *s)
+static PaError IsStreamStopped( PaStream *s )
 {
     //PaAsioStream *stream = (PaAsioStream*)s;
     (void) s; /* unused parameter */
@@ -3439,26 +3306,26 @@ static PaError IsStreamStopped (PaStream *s)
 }
 
 
-static PaError IsStreamActive (PaStream *s)
+static PaError IsStreamActive( PaStream *s )
 {
-    PaAsioStream *stream = (PaAsioStream*) s;
+    PaAsioStream *stream = (PaAsioStream*)s;
 
     return stream->isActive;
 }
 
 
-static PaTime GetStreamTime (PaStream *s)
+static PaTime GetStreamTime( PaStream *s )
 {
     (void) s; /* unused parameter */
-    return (double) timeGetTime() * .001;
+    return (double)timeGetTime() * .001;
 }
 
 
-static double GetStreamCpuLoad (PaStream* s)
+static double GetStreamCpuLoad( PaStream* s )
 {
-    PaAsioStream *stream = (PaAsioStream*) s;
+    PaAsioStream *stream = (PaAsioStream*)s;
 
-    return PaUtil_GetCpuLoad (&stream->cpuLoadMeasurer);
+    return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer );
 }
 
 
@@ -3468,12 +3335,12 @@ static double GetStreamCpuLoad (PaStream* s)
     for blocking streams.
 */
 
-static PaError ReadStream (PaStream      *s     ,
+static PaError ReadStream( PaStream      *s     ,
                            void          *buffer,
-                           unsigned long  frames)
+                           unsigned long  frames )
 {
     PaError result = paNoError; /* Initial return value. */
-    PaAsioStream *stream = (PaAsioStream*) s; /* The PA ASIO stream. */
+    PaAsioStream *stream = (PaAsioStream*)s; /* The PA ASIO stream. */
 
     /* Pointer to the blocking i/o data struct. */
     PaAsioStreamBlockingState *blockingState = stream->blockingState;
@@ -3502,44 +3369,45 @@ static PaError ReadStream (PaStream      *s     ,
     unsigned int i; /* Just a counter. */
 
     /* About the time, needed to process 8 data blocks. */
-    DWORD timeout = (DWORD) (8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate);
+    DWORD timeout = (DWORD)( 8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate );
     DWORD waitResult = 0;
 
 
     /* Check if the stream is still available ready to gather new data. */
-
-    if (blockingState->stopFlag || !stream->isActive) {
-        PA_DEBUG ( ("Warning! Stream no longer available for reading in ReadStream()\n"));
+    if( blockingState->stopFlag || !stream->isActive )
+    {
+        PA_DEBUG(("Warning! Stream no longer available for reading in ReadStream()\n"));
         result = paStreamIsStopped;
         return result;
     }
 
     /* If the stream is a input stream. */
-    if (stream->inputChannelCount) {
+    if( stream->inputChannelCount )
+    {
         /* Prepare buffer access. */
-        if (!pBp->userOutputIsInterleaved) {
+        if( !pBp->userOutputIsInterleaved )
+        {
             userBuffer = blockingState->readStreamBuffer;
-
-            for (i = 0; i<pBp->inputChannelCount; ++i) {
-                ( (void**) userBuffer) [i] = ( (void**) buffer) [i];
+            for( i = 0; i<pBp->inputChannelCount; ++i )
+            {
+                ((void**)userBuffer)[i] = ((void**)buffer)[i];
             }
         } /* Use the unchanged buffer. */
-        else {
-            userBuffer = buffer;
-        }
+        else { userBuffer = buffer; }
 
-        do { /* Internal block processing for too large user data buffers. */
+        do /* Internal block processing for too large user data buffers. */
+        {
             /* Get the size of the current data block to be processed. */
-            lFramesPerBlock = (lFramesPerBlock < lFramesRemaining)
-                              ? lFramesPerBlock : lFramesRemaining;
+            lFramesPerBlock =(lFramesPerBlock < lFramesRemaining)
+                            ? lFramesPerBlock : lFramesRemaining;
             /* Use predefined block size for as long there are enough
                buffers available, thereafter reduce the processing block
                size to match the number of remaining buffers. So the final
                data block is processed although it may be incomplete. */
 
             /* If the available amount of data frames is insufficient. */
-
-            if (PaUtil_GetRingBufferReadAvailable (pRb) < (long) lFramesPerBlock) {
+            if( PaUtil_GetRingBufferReadAvailable(pRb) < (long) lFramesPerBlock )
+            {
                 /* Make sure, the event isn't already set! */
                 /* ResetEvent( blockingState->readFramesReadyEvent ); */
 
@@ -3550,33 +3418,30 @@ static PaError ReadStream (PaStream      *s     ,
                 blockingState->readFramesRequestedFlag = TRUE;
 
                 /* Wait until requested number of buffers has been freed. */
-                waitResult = WaitForSingleObject (blockingState->readFramesReadyEvent, timeout);
+                waitResult = WaitForSingleObject( blockingState->readFramesReadyEvent, timeout );
 
                 /* If something seriously went wrong... */
-
-                if (waitResult == WAIT_FAILED) {
-                    PA_DEBUG ( ("WaitForSingleObject() failed in ReadStream()\n"));
+                if( waitResult == WAIT_FAILED )
+                {
+                    PA_DEBUG(("WaitForSingleObject() failed in ReadStream()\n"));
                     result = paUnanticipatedHostError;
-                    PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError());
+                    PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() );
                     return result;
-                } else if (waitResult == WAIT_TIMEOUT) {
-                    PA_DEBUG ( ("WaitForSingleObject() timed out in ReadStream()\n"));
+                }
+                else if( waitResult == WAIT_TIMEOUT )
+                {
+                    PA_DEBUG(("WaitForSingleObject() timed out in ReadStream()\n"));
 
                     /* If block processing has stopped, abort! */
-
-                    if (blockingState->stopFlag) {
-                        return result = paStreamIsStopped;
-                    }
+                    if( blockingState->stopFlag ) { return result = paStreamIsStopped; }
 
                     /* if a timeout is encountered, continue, perhaps we should give up eventually */
                     continue;
-
                     /* To give up eventually, we may increase the time out
                        period and return an error if it fails anyway. */
                     /* retrun result = paTimedOut; */
                 }
             }
-
             /* Now, the ring buffer contains the required amount of data
                frames.
                (Therefor we don't need to check the return argument of
@@ -3589,48 +3454,47 @@ static PaError ReadStream (PaStream      *s     ,
                segment is returned. Otherwise, i.e. if the first segment
                is large enough, the second segment's pointer will be NULL.
             */
-            PaUtil_GetRingBufferReadRegions (pRb                ,
-                                             lFramesPerBlock    ,
-                                             &pRingBufferData1st,
-                                             &lRingBufferSize1st,
-                                             &pRingBufferData2nd,
-                                             &lRingBufferSize2nd);
+            PaUtil_GetRingBufferReadRegions(pRb                ,
+                                            lFramesPerBlock    ,
+                                            &pRingBufferData1st,
+                                            &lRingBufferSize1st,
+                                            &pRingBufferData2nd,
+                                            &lRingBufferSize2nd);
 
             /* Set number of frames to be copied from the ring buffer. */
-            PaUtil_SetInputFrameCount (pBp, lRingBufferSize1st);
-
+            PaUtil_SetInputFrameCount( pBp, lRingBufferSize1st ); 
             /* Setup ring buffer access. */
-            PaUtil_SetInterleavedInputChannels (pBp               , /* Buffer processor. */
-                                                0                 ,  /* The first channel's index. */
-                                                pRingBufferData1st,  /* First ring buffer segment. */
-                                                0);                  /* Use all available channels. */
+            PaUtil_SetInterleavedInputChannels(pBp               ,  /* Buffer processor. */
+                                               0                 ,  /* The first channel's index. */
+                                               pRingBufferData1st,  /* First ring buffer segment. */
+                                               0                 ); /* Use all available channels. */
 
             /* If a second ring buffer segment is required. */
-            if (lRingBufferSize2nd) {
+            if( lRingBufferSize2nd ) {
                 /* Set number of frames to be copied from the ring buffer. */
-                PaUtil_Set2ndInputFrameCount (pBp, lRingBufferSize2nd);
+                PaUtil_Set2ndInputFrameCount( pBp, lRingBufferSize2nd );
                 /* Setup ring buffer access. */
-                PaUtil_Set2ndInterleavedInputChannels (pBp               , /* Buffer processor. */
-                                                       0                 ,  /* The first channel's index. */
-                                                       pRingBufferData2nd,  /* Second ring buffer segment. */
-                                                       0);                  /* Use all available channels. */
+                PaUtil_Set2ndInterleavedInputChannels(pBp               ,  /* Buffer processor. */
+                                                      0                 ,  /* The first channel's index. */
+                                                      pRingBufferData2nd,  /* Second ring buffer segment. */
+                                                      0                 ); /* Use all available channels. */
             }
 
             /* Let the buffer processor handle "copy and conversion" and
                update the ring buffer indices manually. */
-            lFramesCopied = PaUtil_CopyInput (pBp, &buffer, lFramesPerBlock);
-
-            PaUtil_AdvanceRingBufferReadIndex (pRb, lFramesCopied);
+            lFramesCopied = PaUtil_CopyInput( pBp, &buffer, lFramesPerBlock );
+            PaUtil_AdvanceRingBufferReadIndex( pRb, lFramesCopied );
 
             /* Decrease number of unprocessed frames. */
             lFramesRemaining -= lFramesCopied;
 
         } /* Continue with the next data chunk. */
-        while (lFramesRemaining);
+        while( lFramesRemaining );
 
 
         /* If there has been an input overflow within the callback */
-        if (blockingState->inputOverflowFlag) {
+        if( blockingState->inputOverflowFlag )
+        {
             blockingState->inputOverflowFlag = FALSE;
 
             /* Return the corresponding error code. */
@@ -3645,12 +3509,12 @@ static PaError ReadStream (PaStream      *s     ,
     return result;
 }
 
-static PaError WriteStream (PaStream      *s     ,
+static PaError WriteStream( PaStream      *s     ,
                             const void    *buffer,
-                            unsigned long  frames)
+                            unsigned long  frames )
 {
     PaError result = paNoError; /* Initial return value. */
-    PaAsioStream *stream = (PaAsioStream*) s; /* The PA ASIO stream. */
+    PaAsioStream *stream = (PaAsioStream*)s; /* The PA ASIO stream. */
 
     /* Pointer to the blocking i/o data struct. */
     PaAsioStreamBlockingState *blockingState = stream->blockingState;
@@ -3675,7 +3539,7 @@ static PaError WriteStream (PaStream      *s     ,
     unsigned long lFramesRemaining = frames;
 
     /* About the time, needed to process 8 data blocks. */
-    DWORD timeout = (DWORD) (8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate);
+    DWORD timeout = (DWORD)( 8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate );
     DWORD waitResult = 0;
 
     /* Copy the input argument to avoid pointer increment! */
@@ -3684,40 +3548,41 @@ static PaError WriteStream (PaStream      *s     ,
 
 
     /* Check if the stream ist still available ready to recieve new data. */
-
-    if (blockingState->stopFlag || !stream->isActive) {
-        PA_DEBUG ( ("Warning! Stream no longer available for writing in WriteStream()\n"));
+    if( blockingState->stopFlag || !stream->isActive )
+    {
+        PA_DEBUG(("Warning! Stream no longer available for writing in WriteStream()\n"));
         result = paStreamIsStopped;
         return result;
     }
 
     /* If the stream is a output stream. */
-    if (stream->outputChannelCount) {
+    if( stream->outputChannelCount )
+    {
         /* Prepare buffer access. */
-        if (!pBp->userOutputIsInterleaved) {
+        if( !pBp->userOutputIsInterleaved )
+        {
             userBuffer = blockingState->writeStreamBuffer;
-
-            for (i = 0; i<pBp->outputChannelCount; ++i) {
-                ( (const void**) userBuffer) [i] = ( (const void**) buffer) [i];
+            for( i = 0; i<pBp->outputChannelCount; ++i )
+            {
+                ((const void**)userBuffer)[i] = ((const void**)buffer)[i];
             }
         } /* Use the unchanged buffer. */
-        else {
-            userBuffer = buffer;
-        }
+        else { userBuffer = buffer; }
 
 
-        do { /* Internal block processing for too large user data buffers. */
+        do /* Internal block processing for too large user data buffers. */
+        {
             /* Get the size of the current data block to be processed. */
-            lFramesPerBlock = (lFramesPerBlock < lFramesRemaining)
-                              ? lFramesPerBlock : lFramesRemaining;
+            lFramesPerBlock =(lFramesPerBlock < lFramesRemaining)
+                            ? lFramesPerBlock : lFramesRemaining;
             /* Use predefined block size for as long there are enough
                frames available, thereafter reduce the processing block
                size to match the number of remaining frames. So the final
                data block is processed although it may be incomplete. */
 
             /* If the available amount of buffers is insufficient. */
-
-            if (PaUtil_GetRingBufferWriteAvailable (pRb) < (long) lFramesPerBlock) {
+            if( PaUtil_GetRingBufferWriteAvailable(pRb) < (long) lFramesPerBlock )
+            {
                 /* Make sure, the event isn't already set! */
                 /* ResetEvent( blockingState->writeBuffersReadyEvent ); */
 
@@ -3728,33 +3593,29 @@ static PaError WriteStream (PaStream      *s     ,
                 blockingState->writeBuffersRequestedFlag = TRUE;
 
                 /* Wait until requested number of buffers has been freed. */
-                waitResult = WaitForSingleObject (blockingState->writeBuffersReadyEvent, timeout);
+                waitResult = WaitForSingleObject( blockingState->writeBuffersReadyEvent, timeout );
 
                 /* If something seriously went wrong... */
-
-                if (waitResult == WAIT_FAILED) {
-                    PA_DEBUG ( ("WaitForSingleObject() failed in WriteStream()\n"));
+                if( waitResult == WAIT_FAILED )
+                {
+                    PA_DEBUG(("WaitForSingleObject() failed in WriteStream()\n"));
                     result = paUnanticipatedHostError;
-                    PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError());
+                    PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() );
                     return result;
-                } else if (waitResult == WAIT_TIMEOUT) {
-                    PA_DEBUG ( ("WaitForSingleObject() timed out in WriteStream()\n"));
+                }
+                else if( waitResult == WAIT_TIMEOUT )
+                {
+                    PA_DEBUG(("WaitForSingleObject() timed out in WriteStream()\n"));
 
                     /* If block processing has stopped, abort! */
-
-                    if (blockingState->stopFlag) {
-                        return result = paStreamIsStopped;
-                    }
-
+                    if( blockingState->stopFlag ) { return result = paStreamIsStopped; }
                     /* if a timeout is encountered, continue, perhaps we should give up eventually */
                     continue;
-
                     /* To give up eventually, we may increase the time out
                        period and return an error if it fails anyway. */
                     /* retrun result = paTimedOut; */
                 }
             }
-
             /* Now, the ring buffer contains the required amount of free
                space to store the provided number of data frames.
                (Therefor we don't need to check the return argument of
@@ -3767,48 +3628,47 @@ static PaError WriteStream (PaStream      *s     ,
                segment is returned. Otherwise, i.e. if the first segment
                is large enough, the second segment's pointer will be NULL.
             */
-            PaUtil_GetRingBufferWriteRegions (pRb                ,
-                                              lFramesPerBlock    ,
-                                              &pRingBufferData1st,
-                                              &lRingBufferSize1st,
-                                              &pRingBufferData2nd,
-                                              &lRingBufferSize2nd);
+            PaUtil_GetRingBufferWriteRegions(pRb                ,
+                                             lFramesPerBlock    ,
+                                             &pRingBufferData1st,
+                                             &lRingBufferSize1st,
+                                             &pRingBufferData2nd,
+                                             &lRingBufferSize2nd);
 
             /* Set number of frames to be copied to the ring buffer. */
-            PaUtil_SetOutputFrameCount (pBp, lRingBufferSize1st);
-
+            PaUtil_SetOutputFrameCount( pBp, lRingBufferSize1st ); 
             /* Setup ring buffer access. */
-            PaUtil_SetInterleavedOutputChannels (pBp               , /* Buffer processor. */
-                                                 0                 ,  /* The first channel's index. */
-                                                 pRingBufferData1st,  /* First ring buffer segment. */
-                                                 0);                  /* Use all available channels. */
+            PaUtil_SetInterleavedOutputChannels(pBp               ,  /* Buffer processor. */
+                                                0                 ,  /* The first channel's index. */
+                                                pRingBufferData1st,  /* First ring buffer segment. */
+                                                0                 ); /* Use all available channels. */
 
             /* If a second ring buffer segment is required. */
-            if (lRingBufferSize2nd) {
+            if( lRingBufferSize2nd ) {
                 /* Set number of frames to be copied to the ring buffer. */
-                PaUtil_Set2ndOutputFrameCount (pBp, lRingBufferSize2nd);
+                PaUtil_Set2ndOutputFrameCount( pBp, lRingBufferSize2nd );
                 /* Setup ring buffer access. */
-                PaUtil_Set2ndInterleavedOutputChannels (pBp               , /* Buffer processor. */
-                                                        0                 ,  /* The first channel's index. */
-                                                        pRingBufferData2nd,  /* Second ring buffer segment. */
-                                                        0);                  /* Use all available channels. */
+                PaUtil_Set2ndInterleavedOutputChannels(pBp               ,  /* Buffer processor. */
+                                                       0                 ,  /* The first channel's index. */
+                                                       pRingBufferData2nd,  /* Second ring buffer segment. */
+                                                       0                 ); /* Use all available channels. */
             }
 
             /* Let the buffer processor handle "copy and conversion" and
                update the ring buffer indices manually. */
-            lFramesCopied = PaUtil_CopyOutput (pBp, &userBuffer, lFramesPerBlock);
-
-            PaUtil_AdvanceRingBufferWriteIndex (pRb, lFramesCopied);
+            lFramesCopied = PaUtil_CopyOutput( pBp, &userBuffer, lFramesPerBlock );
+            PaUtil_AdvanceRingBufferWriteIndex( pRb, lFramesCopied );
 
             /* Decrease number of unprocessed frames. */
             lFramesRemaining -= lFramesCopied;
 
         } /* Continue with the next data chunk. */
-        while (lFramesRemaining);
+        while( lFramesRemaining );
 
 
         /* If there has been an output underflow within the callback */
-        if (blockingState->outputUnderflowFlag) {
+        if( blockingState->outputUnderflowFlag )
+        {
             blockingState->outputUnderflowFlag = FALSE;
 
             /* Return the corresponding error code. */
@@ -3816,7 +3676,8 @@ static PaError WriteStream (PaStream      *s     ,
         }
 
     } /* If this is not an output stream. */
-    else {
+    else
+    {
         result = paCanNotWriteToAnInputOnlyStream;
     }
 
@@ -3824,25 +3685,25 @@ static PaError WriteStream (PaStream      *s     ,
 }
 
 
-static signed long GetStreamReadAvailable (PaStream* s)
+static signed long GetStreamReadAvailable( PaStream* s )
 {
-    PaAsioStream *stream = (PaAsioStream*) s;
+    PaAsioStream *stream = (PaAsioStream*)s;
 
     /* Call buffer utility routine to get the number of available frames. */
-    return PaUtil_GetRingBufferReadAvailable (&stream->blockingState->readRingBuffer);
+    return PaUtil_GetRingBufferReadAvailable( &stream->blockingState->readRingBuffer );
 }
 
 
-static signed long GetStreamWriteAvailable (PaStream* s)
+static signed long GetStreamWriteAvailable( PaStream* s )
 {
-    PaAsioStream *stream = (PaAsioStream*) s;
+    PaAsioStream *stream = (PaAsioStream*)s;
 
     /* Call buffer utility routine to get the number of empty buffers. */
-    return PaUtil_GetRingBufferWriteAvailable (&stream->blockingState->writeRingBuffer);
+    return PaUtil_GetRingBufferWriteAvailable( &stream->blockingState->writeRingBuffer );
 }
 
 
-PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific)
+PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific )
 {
     PaError result = paNoError;
     PaUtilHostApiRepresentation *hostApi;
@@ -3854,14 +3715,12 @@ PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific)
     PaAsioDeviceInfo *asioDeviceInfo;
 
 
-    result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO);
-
-    if (result != paNoError)
+    result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO );
+    if( result != paNoError )
         goto error;
 
-    result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi);
-
-    if (result != paNoError)
+    result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi );
+    if( result != paNoError )
         goto error;
 
     /*
@@ -3872,87 +3731,84 @@ PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific)
         done safely while a stream is open.
     */
 
-    asioHostApi = (PaAsioHostApiRepresentation*) hostApi;
-
-    if (asioHostApi->openAsioDeviceIndex != paNoDevice) {
+    asioHostApi = (PaAsioHostApiRepresentation*)hostApi;
+    if( asioHostApi->openAsioDeviceIndex != paNoDevice )
+    {
         result = paDeviceUnavailable;
         goto error;
     }
 
-    asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice];
+    asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice];
 
     /* See notes about CoInitialize(0) in LoadAsioDriver(). */
-    CoInitialize (0);
+	CoInitialize(0);
 
-    if (!asioHostApi->asioDrivers->loadDriver (const_cast<char*> (asioDeviceInfo->commonDeviceInfo.name))) {
+    if( !asioHostApi->asioDrivers->loadDriver( const_cast<char*>(asioDeviceInfo->commonDeviceInfo.name) ) )
+    {
         result = paUnanticipatedHostError;
         goto error;
     }
 
     /* CRUCIAL!!! */
-    memset (&asioDriverInfo, 0, sizeof (ASIODriverInfo));
-
+    memset( &asioDriverInfo, 0, sizeof(ASIODriverInfo) );
     asioDriverInfo.asioVersion = 2;
-
     asioDriverInfo.sysRef = systemSpecific;
-
-    asioError = ASIOInit (&asioDriverInfo);
-
-    if (asioError != ASE_OK) {
+    asioError = ASIOInit( &asioDriverInfo );
+    if( asioError != ASE_OK )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
         goto error;
-    } else {
+    }
+    else
+    {
         asioIsInitialized = 1;
     }
 
-    PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText (asioError)));
-
-    PA_DEBUG ( ("asioVersion: ASIOInit(): %ld\n",   asioDriverInfo.asioVersion));
-    PA_DEBUG ( ("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion));
-    PA_DEBUG ( ("Name: ASIOInit(): %s\n",           asioDriverInfo.name));
-    PA_DEBUG ( ("ErrorMessage: ASIOInit(): %s\n",   asioDriverInfo.errorMessage));
+PA_DEBUG(("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText(asioError) ));
+PA_DEBUG(("asioVersion: ASIOInit(): %ld\n",   asioDriverInfo.asioVersion )); 
+PA_DEBUG(("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion )); 
+PA_DEBUG(("Name: ASIOInit(): %s\n",           asioDriverInfo.name )); 
+PA_DEBUG(("ErrorMessage: ASIOInit(): %s\n",   asioDriverInfo.errorMessage )); 
 
     asioError = ASIOControlPanel();
-
-    if (asioError != ASE_OK) {
-        PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText (asioError)));
+    if( asioError != ASE_OK )
+    {
+        PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) ));
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
         goto error;
     }
 
-    PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText (asioError)));
+PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) ));
 
     asioError = ASIOExit();
-
-    if (asioError != ASE_OK) {
+    if( asioError != ASE_OK )
+    {
         result = paUnanticipatedHostError;
-        PA_ASIO_SET_LAST_ASIO_ERROR (asioError);
+        PA_ASIO_SET_LAST_ASIO_ERROR( asioError );
         asioIsInitialized = 0;
         goto error;
     }
 
-    CoUninitialize();
-
-    PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText (asioError)));
+	CoUninitialize();
+PA_DEBUG(("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText(asioError) ));
 
     return result;
 
 error:
-
-    if (asioIsInitialized) {
-        ASIOExit();
-    }
-
-    CoUninitialize();
+    if( asioIsInitialized )
+	{
+		ASIOExit();
+	}
+	CoUninitialize();
 
     return result;
 }
 
 
-PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex,
-                                    const char** channelName)
+PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex,
+        const char** channelName )
 {
     PaError result = paNoError;
     PaUtilHostApiRepresentation *hostApi;
@@ -3960,19 +3816,17 @@ PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex,
     PaAsioDeviceInfo *asioDeviceInfo;
 
 
-    result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO);
-
-    if (result != paNoError)
+    result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO );
+    if( result != paNoError )
         goto error;
 
-    result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi);
-
-    if (result != paNoError)
+    result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi );
+    if( result != paNoError )
         goto error;
 
-    asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice];
+    asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice];
 
-    if (channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels) {
+    if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels ){
         result = paInvalidChannelCount;
         goto error;
     }
@@ -3980,14 +3834,14 @@ PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex,
     *channelName = asioDeviceInfo->asioChannelInfos[channelIndex].name;
 
     return paNoError;
-
+    
 error:
     return result;
 }
 
 
-PaError PaAsio_GetOutputChannelName (PaDeviceIndex device, int channelIndex,
-                                     const char** channelName)
+PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex,
+        const char** channelName )
 {
     PaError result = paNoError;
     PaUtilHostApiRepresentation *hostApi;
@@ -3995,29 +3849,26 @@ PaError PaAsio_GetOutputChannelName (PaDeviceIndex device, int channelIndex,
     PaAsioDeviceInfo *asioDeviceInfo;
 
 
-    result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO);
-
-    if (result != paNoError)
+    result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO );
+    if( result != paNoError )
         goto error;
 
-    result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi);
-
-    if (result != paNoError)
+    result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi );
+    if( result != paNoError )
         goto error;
 
-    asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice];
+    asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice];
 
-    if (channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels) {
+    if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels ){
         result = paInvalidChannelCount;
         goto error;
     }
 
     *channelName = asioDeviceInfo->asioChannelInfos[
-
-                       asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name;
+            asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name;
 
     return paNoError;
-
+    
 error:
     return result;
 }
@@ -4033,15 +3884,15 @@ error:
 ** It may called at interrupt level on some machines so don't do anything
 ** that could mess up the system like calling malloc() or free().
 */
-static int BlockingIoPaCallback (const void                     *inputBuffer    ,
-                                 void                     *outputBuffer   ,
-                                 unsigned long             framesPerBuffer,
-                                 const PaStreamCallbackTimeInfo *timeInfo       ,
-                                 PaStreamCallbackFlags     statusFlags    ,
-                                 void                     *userData)
+static int BlockingIoPaCallback(const void                     *inputBuffer    ,
+                                      void                     *outputBuffer   ,
+                                      unsigned long             framesPerBuffer,
+                                const PaStreamCallbackTimeInfo *timeInfo       ,
+                                      PaStreamCallbackFlags     statusFlags    ,
+                                      void                     *userData       )
 {
     PaError result = paNoError; /* Initial return value. */
-    PaAsioStream *stream = * (PaAsioStream**) userData; /* The PA ASIO stream. */ /* This is a pointer to "theAsioStream", see OpenStream(). */
+    PaAsioStream *stream = *(PaAsioStream**)userData; /* The PA ASIO stream. */ /* This is a pointer to "theAsioStream", see OpenStream(). */
     PaAsioStreamBlockingState *blockingState = stream->blockingState; /* Persume blockingState is valid, otherwise the callback wouldn't be running. */
 
     /* Get a pointer to the stream's blocking i/o buffer processor. */
@@ -4049,11 +3900,11 @@ static int BlockingIoPaCallback (const void                     *inputBuffer
     PaUtilRingBuffer      *pRb = NULL;
 
     /* If output data has been requested. */
-
-    if (stream->outputChannelCount) {
+    if( stream->outputChannelCount )
+    {
         /* If the callback input argument signalizes a output underflow,
            make sure the WriteStream() function knows about it, too! */
-        if (statusFlags & paOutputUnderflowed) {
+        if( statusFlags & paOutputUnderflowed ) {
             blockingState->outputUnderflowFlag = TRUE;
         }
 
@@ -4061,32 +3912,36 @@ static int BlockingIoPaCallback (const void                     *inputBuffer
         pRb = &blockingState->writeRingBuffer;
 
         /* If the blocking i/o buffer contains enough output data, */
-        if (PaUtil_GetRingBufferReadAvailable (pRb) >= (long) framesPerBuffer) {
+        if( PaUtil_GetRingBufferReadAvailable(pRb) >= (long) framesPerBuffer )
+        {
             /* Extract the requested data from the ring buffer. */
-            PaUtil_ReadRingBuffer (pRb, outputBuffer, framesPerBuffer);
-        } else { /* If no output data is available :-( */
+            PaUtil_ReadRingBuffer( pRb, outputBuffer, framesPerBuffer );
+        }
+        else /* If no output data is available :-( */
+        {
             /* Signalize a write-buffer underflow. */
             blockingState->outputUnderflowFlag = TRUE;
 
             /* Fill the output buffer with silence. */
-            (*pBp->outputZeroer) (outputBuffer, 1, pBp->outputChannelCount * framesPerBuffer);
+            (*pBp->outputZeroer)( outputBuffer, 1, pBp->outputChannelCount * framesPerBuffer );
 
             /* If playback is to be stopped */
-
-            if (blockingState->stopFlag && PaUtil_GetRingBufferReadAvailable (pRb) < (long) framesPerBuffer) {
+            if( blockingState->stopFlag && PaUtil_GetRingBufferReadAvailable(pRb) < (long) framesPerBuffer )
+            {
                 /* Extract all the remaining data from the ring buffer,
                    whether it is a complete data block or not. */
-                PaUtil_ReadRingBuffer (pRb, outputBuffer, PaUtil_GetRingBufferReadAvailable (pRb));
+                PaUtil_ReadRingBuffer( pRb, outputBuffer, PaUtil_GetRingBufferReadAvailable(pRb) );
             }
         }
 
         /* Set blocking i/o event? */
-        if (blockingState->writeBuffersRequestedFlag && PaUtil_GetRingBufferWriteAvailable (pRb) >= (long) blockingState->writeBuffersRequested) {
+        if( blockingState->writeBuffersRequestedFlag && PaUtil_GetRingBufferWriteAvailable(pRb) >= (long) blockingState->writeBuffersRequested )
+        {
             /* Reset buffer request. */
             blockingState->writeBuffersRequestedFlag = FALSE;
             blockingState->writeBuffersRequested     = 0;
             /* Signalize that requested buffers are ready. */
-            SetEvent (blockingState->writeBuffersReadyEvent);
+            SetEvent( blockingState->writeBuffersReadyEvent );
             /* What do we do if SetEvent() returns zero, i.e. the event
                could not be set? How to return errors from within the
                callback? - S.Fischer */
@@ -4094,10 +3949,11 @@ static int BlockingIoPaCallback (const void                     *inputBuffer
     }
 
     /* If input data has been supplied. */
-    if (stream->inputChannelCount) {
+    if( stream->inputChannelCount )
+    {
         /* If the callback input argument signalizes a input overflow,
            make sure the ReadStream() function knows about it, too! */
-        if (statusFlags & paInputOverflowed) {
+        if( statusFlags & paInputOverflowed ) {
             blockingState->inputOverflowFlag = TRUE;
         }
 
@@ -4105,24 +3961,26 @@ static int BlockingIoPaCallback (const void                     *inputBuffer
         pRb = &blockingState->readRingBuffer;
 
         /* If the blocking i/o buffer contains not enough input buffers */
-        if (PaUtil_GetRingBufferWriteAvailable (pRb) < (long) framesPerBuffer) {
+        if( PaUtil_GetRingBufferWriteAvailable(pRb) < (long) framesPerBuffer )
+        {
             /* Signalize a read-buffer overflow. */
             blockingState->inputOverflowFlag = TRUE;
 
             /* Remove some old data frames from the buffer. */
-            PaUtil_AdvanceRingBufferReadIndex (pRb, framesPerBuffer);
+            PaUtil_AdvanceRingBufferReadIndex( pRb, framesPerBuffer );
         }
 
         /* Insert the current input data into the ring buffer. */
-        PaUtil_WriteRingBuffer (pRb, inputBuffer, framesPerBuffer);
+        PaUtil_WriteRingBuffer( pRb, inputBuffer, framesPerBuffer );
 
         /* Set blocking i/o event? */
-        if (blockingState->readFramesRequestedFlag && PaUtil_GetRingBufferReadAvailable (pRb) >= (long) blockingState->readFramesRequested) {
+        if( blockingState->readFramesRequestedFlag && PaUtil_GetRingBufferReadAvailable(pRb) >= (long) blockingState->readFramesRequested )
+        {
             /* Reset buffer request. */
             blockingState->readFramesRequestedFlag = FALSE;
             blockingState->readFramesRequested     = 0;
             /* Signalize that requested buffers are ready. */
-            SetEvent (blockingState->readFramesReadyEvent);
+            SetEvent( blockingState->readFramesReadyEvent );
             /* What do we do if SetEvent() returns zero, i.e. the event
                could not be set? How to return errors from within the
                callback? - S.Fischer */
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/notes.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/notes.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/notes.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/notes.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/jack/pa_jack.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/jack/pa_jack.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/jack/pa_jack.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/jack/pa_jack.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/low_latency_tip.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/oss/low_latency_tip.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/low_latency_tip.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/oss/low_latency_tip.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/pa_unix_oss.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/oss/pa_unix_oss.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/pa_unix_oss.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/oss/pa_unix_oss.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/recplay.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/oss/recplay.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/oss/recplay.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/oss/recplay.c
diff --git a/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f13a7f230296c87f606ec1f7505bde967afc1543
--- /dev/null
+++ b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp
@@ -0,0 +1,1911 @@
+/*
+ * Portable Audio I/O Library WASAPI implementation
+ * Copyright (c) 2006-2007 David Viens
+ *
+ * Based on the Open Source API proposed by Ross Bencina
+ * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however, 
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also 
+ * requested that these non-binding requests be included along with the 
+ * license above.
+ */
+
+/** @file
+ @ingroup hostapi_src
+ @brief WASAPI implementation of support for a host API.
+
+ @note pa_wasapi currently requires VC 2005, and the latest Vista SDK
+*/
+
+#if _MSC_VER >= 1400
+#include <windows.h>
+#include <MMReg.h>  //must be before other Wasapi headers
+#include <strsafe.h>
+#include <mmdeviceapi.h>
+#include <Avrt.h>
+#include <audioclient.h>
+#include <Endpointvolume.h>
+
+#include <KsMedia.h>
+#include <functiondiscoverykeys.h>  // PKEY_Device_FriendlyName
+#endif
+
+#include "pa_util.h"
+#include "pa_allocation.h"
+#include "pa_hostapi.h"
+#include "pa_stream.h"
+#include "pa_cpuload.h"
+#include "pa_process.h"
+#include "pa_debugprint.h"
+
+
+/*
+  davidv : work in progress. try using with 48000 , then 44100
+  and shared mode FIRST.
+ */
+
+#define PORTAUDIO_SHAREMODE     AUDCLNT_SHAREMODE_SHARED
+//#define PORTAUDIO_SHAREMODE   AUDCLNT_SHAREMODE_EXCLUSIVE
+
+
+
+/* prototypes for functions declared in this file */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+
+
+static void Terminate( struct PaUtilHostApiRepresentation *hostApi );
+static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
+                                  const PaStreamParameters *inputParameters,
+                                  const PaStreamParameters *outputParameters,
+                                  double sampleRate );
+static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
+                           PaStream** s,
+                           const PaStreamParameters *inputParameters,
+                           const PaStreamParameters *outputParameters,
+                           double sampleRate,
+                           unsigned long framesPerBuffer,
+                           PaStreamFlags streamFlags,
+                           PaStreamCallback *streamCallback,
+                           void *userData );
+static PaError CloseStream( PaStream* stream );
+static PaError StartStream( PaStream *stream );
+static PaError StopStream( PaStream *stream );
+static PaError AbortStream( PaStream *stream );
+static PaError IsStreamStopped( PaStream *s );
+static PaError IsStreamActive( PaStream *stream );
+static PaTime GetStreamTime( PaStream *stream );
+static double GetStreamCpuLoad( PaStream* stream );
+static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames );
+static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames );
+static signed long GetStreamReadAvailable( PaStream* stream );
+static signed long GetStreamWriteAvailable( PaStream* stream );
+
+
+/* IMPLEMENT ME: a macro like the following one should be used for reporting
+ host errors */
+#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \
+    PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText )
+
+/* PaWinWasapiHostApiRepresentation - host api datastructure specific to this implementation */
+
+
+
+//dummy entry point for other compilers and sdks
+//currently built using RC1 SDK (5600)
+#if _MSC_VER < 1400
+
+PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ){
+    return paNoError;
+}
+
+#else
+
+
+
+
+#define MAX_STR_LEN 512
+
+/*
+ These are fields that can be gathered from IDevice
+ and IAudioDevice PRIOR to Initialize, and done in first pass
+ i assume that neither of these will cause the Driver to "load",
+ but again, who knows how they implement their stuff
+ */
+typedef struct PaWinWasapiDeviceInfo
+{
+    //hmm is it wise to keep a reference until Terminate?
+    //TODO Check if that interface requires the driver to be loaded!
+    IMMDevice * device;
+
+    //Fields filled from IDevice
+    //from GetId
+    WCHAR szDeviceID[MAX_STR_LEN];
+    //from GetState
+    DWORD state;
+
+    //Fields filled from IMMEndpoint'sGetDataFlow
+    EDataFlow  flow;
+
+    //Fields filled from IAudioDevice (_prior_ to Initialize)
+    //from GetDevicePeriod(
+    REFERENCE_TIME  DefaultDevicePeriod;
+    REFERENCE_TIME  MinimumDevicePeriod;
+    //from GetMixFormat
+    WAVEFORMATEX   *MixFormat;//needs to be CoTaskMemFree'd after use!
+
+} PaWinWasapiDeviceInfo;
+
+
+typedef struct
+{
+    PaUtilHostApiRepresentation inheritedHostApiRep;
+    PaUtilStreamInterface callbackStreamInterface;
+    PaUtilStreamInterface blockingStreamInterface;
+
+    PaUtilAllocationGroup *allocations;
+
+    /* implementation specific data goes here */
+
+    //in case we later need the synch
+    IMMDeviceEnumerator * enumerator;
+
+    //this is the REAL number of devices, whether they are usefull to PA or not!
+    UINT deviceCount;
+
+    WCHAR defaultRenderer [MAX_STR_LEN];
+    WCHAR defaultCapturer [MAX_STR_LEN];
+
+    PaWinWasapiDeviceInfo   *devInfo;
+}PaWinWasapiHostApiRepresentation;
+
+
+/* PaWinWasapiStream - a stream data structure specifically for this implementation */
+
+typedef struct PaWinWasapiSubStream{
+    IAudioClient        *client;
+    WAVEFORMATEXTENSIBLE wavex;
+    UINT32               bufferSize;
+    REFERENCE_TIME       latency;
+    REFERENCE_TIME       period;
+    unsigned long framesPerHostCallback; /* just an example */
+}PaWinWasapiSubStream;
+
+typedef struct PaWinWasapiStream
+{ /* IMPLEMENT ME: rename this */
+    PaUtilStreamRepresentation streamRepresentation;
+    PaUtilCpuLoadMeasurer cpuLoadMeasurer;
+    PaUtilBufferProcessor bufferProcessor;
+
+    /* IMPLEMENT ME:
+            - implementation specific data goes here
+    */
+
+
+    //input
+	PaWinWasapiSubStream in;
+    IAudioCaptureClient *cclient;
+    IAudioEndpointVolume *inVol;
+	//output
+	PaWinWasapiSubStream out;
+    IAudioRenderClient  *rclient;
+	IAudioEndpointVolume *outVol;
+
+    bool running;
+    bool closeRequest;
+
+    DWORD dwThreadId;
+    HANDLE hThread;
+	HANDLE hNotificationEvent; 
+
+    GUID  session;
+
+}PaWinWasapiStream;
+
+#define PRINT(x) PA_DEBUG(x);
+
+void
+logAUDCLNT_E(HRESULT res){
+
+    char *text = 0;
+    switch(res){
+        case S_OK: return; break;
+        case E_POINTER                              :text ="E_POINTER"; break;
+        case E_INVALIDARG                           :text ="E_INVALIDARG"; break;
+
+        case AUDCLNT_E_NOT_INITIALIZED              :text ="AUDCLNT_E_NOT_INITIALIZED"; break;
+        case AUDCLNT_E_ALREADY_INITIALIZED          :text ="AUDCLNT_E_ALREADY_INITIALIZED"; break;
+        case AUDCLNT_E_WRONG_ENDPOINT_TYPE          :text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; break;
+        case AUDCLNT_E_DEVICE_INVALIDATED           :text ="AUDCLNT_E_DEVICE_INVALIDATED"; break;
+        case AUDCLNT_E_NOT_STOPPED                  :text ="AUDCLNT_E_NOT_STOPPED"; break;
+        case AUDCLNT_E_BUFFER_TOO_LARGE             :text ="AUDCLNT_E_BUFFER_TOO_LARGE"; break;
+        case AUDCLNT_E_OUT_OF_ORDER                 :text ="AUDCLNT_E_OUT_OF_ORDER"; break;
+        case AUDCLNT_E_UNSUPPORTED_FORMAT           :text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; break;
+        case AUDCLNT_E_INVALID_SIZE                 :text ="AUDCLNT_E_INVALID_SIZE"; break;
+        case AUDCLNT_E_DEVICE_IN_USE                :text ="AUDCLNT_E_DEVICE_IN_USE"; break;
+        case AUDCLNT_E_BUFFER_OPERATION_PENDING     :text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; break;
+        case AUDCLNT_E_THREAD_NOT_REGISTERED        :text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; break;      
+		case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED   :text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; break;
+        case AUDCLNT_E_ENDPOINT_CREATE_FAILED       :text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; break;
+        case AUDCLNT_E_SERVICE_NOT_RUNNING          :text ="AUDCLNT_E_SERVICE_NOT_RUNNING"; break;
+     //  case AUDCLNT_E_CPUUSAGE_EXCEEDED            :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break;
+     //Header error?
+        case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED     :text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; break;
+        case AUDCLNT_E_EXCLUSIVE_MODE_ONLY          :text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; break;
+        case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL :text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; break;
+        case AUDCLNT_E_EVENTHANDLE_NOT_SET          :text ="AUDCLNT_E_EVENTHANDLE_NOT_SET"; break;
+        case AUDCLNT_E_INCORRECT_BUFFER_SIZE        :text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE"; break;
+        case AUDCLNT_E_BUFFER_SIZE_ERROR            :text ="AUDCLNT_E_BUFFER_SIZE_ERROR"; break;
+        case AUDCLNT_S_BUFFER_EMPTY                 :text ="AUDCLNT_S_BUFFER_EMPTY"; break;
+        case AUDCLNT_S_THREAD_ALREADY_REGISTERED    :text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED"; break;
+        default:
+            text =" dunno!";
+            return ;
+        break;
+
+    }
+    PRINT(("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text));
+}
+
+inline double
+nano100ToMillis(const REFERENCE_TIME &ref){
+    //  1 nano = 0.000000001 seconds
+    //100 nano = 0.0000001   seconds
+    //100 nano = 0.0001   milliseconds
+    return ((double)ref)*0.0001;
+}
+
+inline double
+nano100ToSeconds(const REFERENCE_TIME &ref){
+    //  1 nano = 0.000000001 seconds
+    //100 nano = 0.0000001   seconds
+    //100 nano = 0.0001   milliseconds
+    return ((double)ref)*0.0000001;
+}
+
+#ifndef IF_FAILED_JUMP
+#define IF_FAILED_JUMP(hr, label) if(FAILED(hr)) goto label;
+#endif
+
+
+
+//AVRT is the new "multimedia schedulling stuff"
+
+typedef BOOL   (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER);
+typedef BOOL   (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE);
+typedef BOOL   (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE);
+typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics)  (LPCTSTR,LPDWORD);
+typedef BOOL   (WINAPI *FAvSetMmThreadPriority)         (HANDLE,AVRT_PRIORITY);
+
+HMODULE  hDInputDLL = 0;
+FAvRtCreateThreadOrderingGroup pAvRtCreateThreadOrderingGroup=0;
+FAvRtDeleteThreadOrderingGroup pAvRtDeleteThreadOrderingGroup=0;
+FAvRtWaitOnThreadOrderingGroup pAvRtWaitOnThreadOrderingGroup=0;
+FAvSetMmThreadCharacteristics  pAvSetMmThreadCharacteristics=0;
+FAvSetMmThreadPriority         pAvSetMmThreadPriority=0;
+
+
+
+#define setupPTR(fun, type, name)  {                                                        \
+                                        fun = (type) GetProcAddress(hDInputDLL,name);       \
+                                        if(fun == NULL) {                                   \
+                                            PRINT(("GetProcAddr failed for %s" ,name));     \
+                                            return false;                                   \
+                                        }                                                   \
+                                    }                                                       \
+
+bool
+setupAVRT(){
+
+    hDInputDLL = LoadLibraryA("avrt.dll");
+    if(hDInputDLL == NULL)
+        return false;
+
+    setupPTR(pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup");
+    setupPTR(pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup");
+    setupPTR(pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup");
+    setupPTR(pAvSetMmThreadCharacteristics,  FAvSetMmThreadCharacteristics,  "AvSetMmThreadCharacteristicsA");
+    setupPTR(pAvSetMmThreadPriority,         FAvSetMmThreadPriority,         "AvSetMmThreadPriority");
+
+    return true;
+}
+
+
+
+PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex )
+{
+    if (!setupAVRT()){
+        PRINT(("Windows WASAPI : No AVRT! (not VISTA?)"));
+        return paNoError;
+    }
+
+    CoInitialize(NULL);
+
+    PaError result = paNoError;
+    PaWinWasapiHostApiRepresentation *paWasapi;
+    PaDeviceInfo *deviceInfoArray;
+
+    paWasapi = (PaWinWasapiHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinWasapiHostApiRepresentation) );
+    if( !paWasapi ){
+        result = paInsufficientMemory;
+        goto error;
+    }
+
+    paWasapi->allocations = PaUtil_CreateAllocationGroup();
+    if( !paWasapi->allocations ){
+        result = paInsufficientMemory;
+        goto error;
+    }
+
+    *hostApi = &paWasapi->inheritedHostApiRep;
+    (*hostApi)->info.structVersion = 1;
+    (*hostApi)->info.type = paWASAPI;
+    (*hostApi)->info.name = "Windows WASAPI";
+    (*hostApi)->info.deviceCount = 0;   //so far, we must investigate each
+    (*hostApi)->info.defaultInputDevice  = paNoDevice;  /* IMPLEMENT ME */
+    (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */
+
+
+    HRESULT hResult = S_OK;
+    IMMDeviceCollection* spEndpoints=0;
+    paWasapi->enumerator = 0;
+
+    hResult = CoCreateInstance(
+             __uuidof(MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER,
+             __uuidof(IMMDeviceEnumerator),
+             (void**)&paWasapi->enumerator);
+
+    IF_FAILED_JUMP(hResult, error);
+
+    //getting default device ids in the eMultimedia "role"
+    {
+        {
+            IMMDevice* defaultRenderer=0;
+            hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &defaultRenderer);
+            IF_FAILED_JUMP(hResult, error);
+            WCHAR* pszDeviceId = NULL;
+            hResult = defaultRenderer->GetId(&pszDeviceId);
+            IF_FAILED_JUMP(hResult, error);
+            StringCchCopyW(paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId);
+            CoTaskMemFree(pszDeviceId);
+            defaultRenderer->Release();
+        }
+
+        {
+            IMMDevice* defaultCapturer=0;
+            hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eCapture, eMultimedia, &defaultCapturer);
+            IF_FAILED_JUMP(hResult, error);
+            WCHAR* pszDeviceId = NULL;
+            hResult = defaultCapturer->GetId(&pszDeviceId);
+            IF_FAILED_JUMP(hResult, error);
+            StringCchCopyW(paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId);
+            CoTaskMemFree(pszDeviceId);
+            defaultCapturer->Release();
+        }
+    }
+
+
+    hResult = paWasapi->enumerator->EnumAudioEndpoints(eAll, DEVICE_STATE_ACTIVE, &spEndpoints);
+    IF_FAILED_JUMP(hResult, error);
+
+    hResult = spEndpoints->GetCount(&paWasapi->deviceCount);
+    IF_FAILED_JUMP(hResult, error);
+
+    paWasapi->devInfo = new PaWinWasapiDeviceInfo[paWasapi->deviceCount];
+    {
+        for (size_t step=0;step<paWasapi->deviceCount;++step)
+            memset(&paWasapi->devInfo[step],0,sizeof(PaWinWasapiDeviceInfo));
+    }
+
+
+
+    if( paWasapi->deviceCount > 0 )
+    {
+        (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory(
+                paWasapi->allocations, sizeof(PaDeviceInfo*) * paWasapi->deviceCount );
+        if( !(*hostApi)->deviceInfos ){
+            result = paInsufficientMemory;
+            goto error;
+        }
+
+        /* allocate all device info structs in a contiguous block */
+        deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory(
+                paWasapi->allocations, sizeof(PaDeviceInfo) * paWasapi->deviceCount );
+        if( !deviceInfoArray ){
+            result = paInsufficientMemory;
+            goto error;
+        }
+
+        for( UINT i=0; i < paWasapi->deviceCount; ++i ){
+
+			PA_DEBUG(("i:%d\n",i));
+            PaDeviceInfo *deviceInfo = &deviceInfoArray[i];
+            deviceInfo->structVersion = 2;
+            deviceInfo->hostApi = hostApiIndex;
+
+            hResult = spEndpoints->Item(i, &paWasapi->devInfo[i].device);
+            IF_FAILED_JUMP(hResult, error);
+
+            //getting ID
+            {
+                WCHAR* pszDeviceId = NULL;
+                hResult = paWasapi->devInfo[i].device->GetId(&pszDeviceId);
+                IF_FAILED_JUMP(hResult, error);
+                StringCchCopyW(paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId);
+                CoTaskMemFree(pszDeviceId);
+
+                if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer)==0){
+                    //we found the default input!
+                    (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount;
+                }
+                if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer)==0){
+                    //we found the default output!
+                    (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount;
+                }
+            }
+
+            DWORD state=0;
+            hResult = paWasapi->devInfo[i].device->GetState(&paWasapi->devInfo[i].state);
+            IF_FAILED_JUMP(hResult, error);
+
+            if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE){
+                PRINT(("WASAPI device:%d is not currently available (state:%d)\n",i,state));
+                //spDevice->Release();
+                //continue;
+            }
+
+            {
+                IPropertyStore* spProperties;
+                hResult = paWasapi->devInfo[i].device->OpenPropertyStore(STGM_READ, &spProperties);
+                IF_FAILED_JUMP(hResult, error);
+
+                //getting "Friendly" Name
+                {
+                    PROPVARIANT value;
+                    PropVariantInit(&value);
+                    hResult = spProperties->GetValue(PKEY_Device_FriendlyName, &value);
+                    IF_FAILED_JUMP(hResult, error);
+                    deviceInfo->name = 0;
+                    char* deviceName = (char*)PaUtil_GroupAllocateMemory( paWasapi->allocations, MAX_STR_LEN + 1 );
+                    if( !deviceName ){
+                        result = paInsufficientMemory;
+                        goto error;
+                    }
+					if (value.pwszVal)
+						wcstombs(deviceName,   value.pwszVal,MAX_STR_LEN-1); //todo proper size	
+					else{
+						sprintf(deviceName,"baddev%d",i);
+					}
+
+                    deviceInfo->name = deviceName;
+                    PropVariantClear(&value);
+                }
+
+#if 0
+                DWORD numProps = 0;
+                hResult = spProperties->GetCount(&numProps);
+                IF_FAILED_JUMP(hResult, error);
+                {
+                    for (DWORD i=0;i<numProps;++i){
+                        PROPERTYKEY pkey;
+                        hResult = spProperties->GetAt(i,&pkey);
+
+                        PROPVARIANT value;
+                        PropVariantInit(&value);
+                        hResult = spProperties->GetValue(pkey, &value);
+
+                        switch(value.vt){
+                            case 11:
+                                PRINT(("property*%u*\n",value.ulVal));
+                            break;
+                            case 19:
+                                PRINT(("property*%d*\n",value.boolVal));
+                            break;
+                            case 31:
+                            {
+                                char temp[512];
+                                wcstombs(temp,    value.pwszVal,MAX_STR_LEN-1);
+                                PRINT(("property*%s*\n",temp));
+                            }
+                            break;
+                            default:break;
+                        }
+
+                        PropVariantClear(&value);
+                    }
+                }
+#endif
+
+                /*  These look interresting... but they are undocumented
+                PKEY_AudioEndpoint_FormFactor
+                PKEY_AudioEndpoint_ControlPanelPageProvider
+                PKEY_AudioEndpoint_Association
+                PKEY_AudioEndpoint_PhysicalSpeakerConfig
+                PKEY_AudioEngine_DeviceFormat
+                */
+                spProperties->Release();
+            }
+
+
+            //getting the Endpoint data
+            {
+                IMMEndpoint *endpoint=0;
+                hResult = paWasapi->devInfo[i].device->QueryInterface(__uuidof(IMMEndpoint),(void **)&endpoint);
+                if (SUCCEEDED(hResult)){
+                    hResult = endpoint->GetDataFlow(&paWasapi->devInfo[i].flow);
+                    endpoint->Release();
+                }
+            }
+
+            //Getting a temporary IAudioDevice for more fields
+            //we make sure NOT to call Initialize yet!
+            {
+                IAudioClient *myClient=0;
+
+                hResult = paWasapi->devInfo[i].device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient);
+                IF_FAILED_JUMP(hResult, error);
+
+                hResult = myClient->GetDevicePeriod(
+                    &paWasapi->devInfo[i].DefaultDevicePeriod,
+                    &paWasapi->devInfo[i].MinimumDevicePeriod);
+                IF_FAILED_JUMP(hResult, error);
+
+                hResult = myClient->GetMixFormat(&paWasapi->devInfo[i].MixFormat);
+
+				if (hResult != S_OK){
+					/*davidv: this happened with my hardware, previously for that same device in DirectSound:
+					  Digital Output (Realtek AC'97 Audio)'s GUID: {0x38f2cf50,0x7b4c,0x4740,0x86,0xeb,0xd4,0x38,0x66,0xd8,0xc8, 0x9f} 
+					  so something must be _really_ wrong with this device, TODO handle this better. We kind of need GetMixFormat*/
+					logAUDCLNT_E(hResult);
+					goto error;
+				}
+
+                myClient->Release();
+            }
+
+            //we can now fill in portaudio device data
+            deviceInfo->maxInputChannels  = 0;  //for now
+            deviceInfo->maxOutputChannels = 0;  //for now
+
+            switch(paWasapi->devInfo[i].flow){
+                case eRender:
+                    //hum not exaclty maximum, more like "default"
+                    deviceInfo->maxOutputChannels = paWasapi->devInfo[i].MixFormat->nChannels;
+
+                    deviceInfo->defaultHighOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod);
+                    deviceInfo->defaultLowOutputLatency  = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod);
+                break;
+                case eCapture:
+                    //hum not exaclty maximum, more like "default"
+                    deviceInfo->maxInputChannels  = paWasapi->devInfo[i].MixFormat->nChannels;
+
+                    deviceInfo->defaultHighInputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod);
+                    deviceInfo->defaultLowInputLatency  = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod);
+                break;
+                default:
+                    PRINT(("WASAPI device:%d bad Data FLow! \n",i));
+                    goto error;
+                break;
+            }
+
+            deviceInfo->defaultSampleRate = (double)paWasapi->devInfo[i].MixFormat->nSamplesPerSec;
+
+            (*hostApi)->deviceInfos[i] = deviceInfo;
+            ++(*hostApi)->info.deviceCount;
+        }
+    }
+
+    spEndpoints->Release();
+
+    (*hostApi)->Terminate = Terminate;
+    (*hostApi)->OpenStream = OpenStream;
+    (*hostApi)->IsFormatSupported = IsFormatSupported;
+
+    PaUtil_InitializeStreamInterface( &paWasapi->callbackStreamInterface, CloseStream, StartStream,
+                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,
+                                      GetStreamTime, GetStreamCpuLoad,
+                                      PaUtil_DummyRead, PaUtil_DummyWrite,
+                                      PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable );
+
+    PaUtil_InitializeStreamInterface( &paWasapi->blockingStreamInterface, CloseStream, StartStream,
+                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,
+                                      GetStreamTime, PaUtil_DummyGetCpuLoad,
+                                      ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable );
+
+    return result;
+
+error:
+
+    if (spEndpoints)
+        spEndpoints->Release();
+
+    if (paWasapi->enumerator)
+        paWasapi->enumerator->Release();
+
+    if( paWasapi )
+    {
+        if( paWasapi->allocations )
+        {
+            PaUtil_FreeAllAllocations( paWasapi->allocations );
+            PaUtil_DestroyAllocationGroup( paWasapi->allocations );
+        }
+
+        PaUtil_FreeMemory( paWasapi );
+    }
+    return result;
+}
+
+
+static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
+{
+    PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
+
+    paWasapi->enumerator->Release();
+
+    for (UINT i=0;i<paWasapi->deviceCount;++i){
+        PaWinWasapiDeviceInfo *info = &paWasapi->devInfo[i];
+
+        if (info->device)
+            info->device->Release();
+
+        if (info->MixFormat)
+            CoTaskMemFree(info->MixFormat);
+    }
+    delete [] paWasapi->devInfo;
+
+    CoUninitialize();
+
+    if( paWasapi->allocations ){
+        PaUtil_FreeAllAllocations( paWasapi->allocations );
+        PaUtil_DestroyAllocationGroup( paWasapi->allocations );
+    }
+
+    PaUtil_FreeMemory( paWasapi );
+}
+
+static void
+LogWAVEFORMATEXTENSIBLE(const WAVEFORMATEXTENSIBLE *in){
+
+    const WAVEFORMATEX *old = (WAVEFORMATEX *)in;
+
+	switch (old->wFormatTag){
+		case WAVE_FORMAT_EXTENSIBLE:{
+
+			PRINT(("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n"));
+
+			if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){
+				PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n"));
+			}
+			else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM){
+				PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n"));
+			}
+			else{
+				PRINT(("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n",	
+											in->SubFormat.Data1,
+											in->SubFormat.Data2,
+											in->SubFormat.Data3,
+											(int)in->SubFormat.Data4[0],
+											(int)in->SubFormat.Data4[1],
+											(int)in->SubFormat.Data4[2],
+											(int)in->SubFormat.Data4[3],
+											(int)in->SubFormat.Data4[4],
+											(int)in->SubFormat.Data4[5],
+											(int)in->SubFormat.Data4[6],
+											(int)in->SubFormat.Data4[7]));
+			}
+			PRINT(("Samples.wValidBitsPerSample=%d\n",  in->Samples.wValidBitsPerSample));
+			PRINT(("dwChannelMask=0x%X\n",in->dwChannelMask));
+		}break;
+		
+		case WAVE_FORMAT_PCM:        PRINT(("wFormatTag=WAVE_FORMAT_PCM\n")); break;
+		case WAVE_FORMAT_IEEE_FLOAT: PRINT(("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); break;
+		default : PRINT(("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); break;
+	}
+
+	PRINT(("nChannels      =%d\n",old->nChannels)); 
+	PRINT(("nSamplesPerSec =%d\n",old->nSamplesPerSec));  
+	PRINT(("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec));  
+	PRINT(("nBlockAlign    =%d\n",old->nBlockAlign));  
+	PRINT(("wBitsPerSample =%d\n",old->wBitsPerSample));  
+	PRINT(("cbSize         =%d\n",old->cbSize));  
+}
+
+
+
+/*
+ WAVEFORMATXXX is always interleaved
+ */
+static PaSampleFormat
+waveformatToPaFormat(const WAVEFORMATEXTENSIBLE *in){
+
+    const WAVEFORMATEX *old = (WAVEFORMATEX*)in;
+
+    switch (old->wFormatTag){
+
+        case WAVE_FORMAT_EXTENSIBLE:
+        {
+            if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){
+                if (in->Samples.wValidBitsPerSample == 32)
+                    return paFloat32;
+                else
+                    return paCustomFormat;
+            }
+            else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM){
+                switch (old->wBitsPerSample){
+                    case 32: return paInt32; break;
+                    case 24: return paInt24;break;
+                    case  8: return paUInt8;break;
+                    case 16: return paInt16;break;
+                    default: return paCustomFormat;break;
+                }
+            }
+            else
+                return paCustomFormat;
+        }
+        break;
+
+        case WAVE_FORMAT_IEEE_FLOAT:
+            return paFloat32;
+        break;
+
+        case WAVE_FORMAT_PCM:
+        {
+            switch (old->wBitsPerSample){
+                case 32: return paInt32; break;
+                case 24: return paInt24;break;
+                case  8: return paUInt8;break;
+                case 16: return paInt16;break;
+                default: return paCustomFormat;break;
+            }
+        }
+        break;
+
+        default:
+            return paCustomFormat;
+        break;
+    }
+
+    return paCustomFormat;
+}
+
+
+
+static PaError
+waveformatFromParams(WAVEFORMATEXTENSIBLE*wavex,
+                          const PaStreamParameters * params,
+                          double sampleRate){
+
+    size_t bytesPerSample = 0;
+    switch( params->sampleFormat & ~paNonInterleaved ){
+        case paFloat32:
+        case paInt32: bytesPerSample=4;break;
+        case paInt16: bytesPerSample=2;break;
+        case paInt24: bytesPerSample=3;break;
+        case paInt8:
+        case paUInt8: bytesPerSample=1;break;
+        case paCustomFormat:
+        default: return paSampleFormatNotSupported;break;
+    }
+
+    memset(wavex,0,sizeof(WAVEFORMATEXTENSIBLE));
+
+    WAVEFORMATEX *old    = (WAVEFORMATEX *)wavex;
+    old->nChannels       = (WORD)params->channelCount;
+    old->nSamplesPerSec  = (DWORD)sampleRate;
+    old->wBitsPerSample  = (WORD)(bytesPerSample*8);
+    old->nAvgBytesPerSec = (DWORD)(old->nSamplesPerSec * old->nChannels * bytesPerSample);
+    old->nBlockAlign     = (WORD)(old->nChannels * bytesPerSample);
+
+    //WAVEFORMATEX
+    if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)){
+        old->cbSize          = 0;
+        old->wFormatTag      = WAVE_FORMAT_PCM;
+    }
+    //WAVEFORMATEXTENSIBLE
+    else{
+        old->wFormatTag = WAVE_FORMAT_EXTENSIBLE;
+
+        old->cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX);
+
+        if ((params->sampleFormat & ~paNonInterleaved) == paFloat32)
+            wavex->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
+        else
+            wavex->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
+
+        wavex->Samples.wValidBitsPerSample = old->wBitsPerSample; //no extra padding!
+
+        switch(params->channelCount){
+            case 1:  wavex->dwChannelMask = SPEAKER_FRONT_CENTER; break;
+            case 2:  wavex->dwChannelMask = 0x1 | 0x2; break;
+            case 4:  wavex->dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; break;
+            case 6:  wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; break;
+            case 8:  wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; break;
+            default: wavex->dwChannelMask = 0; break;
+        }
+    }
+
+    return paNoError;
+}
+
+
+
+
+
+
+/*
+#define paFloat32        ((PaSampleFormat) 0x00000001) 
+#define paInt32          ((PaSampleFormat) 0x00000002)
+#define paInt24          ((PaSampleFormat) 0x00000004) 
+#define paInt16          ((PaSampleFormat) 0x00000008) 
+*/
+//lifted from pa_wdmks
+static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount)
+{
+    PA_DEBUG(( "sampleFormat = %lx\n" , sampleFormat ));
+    PA_DEBUG(( "sampleRate = %f\n" , sampleRate ));
+    PA_DEBUG(( "chanelCount = %d\n", channelCount ));
+
+    pwfext->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
+    pwfext->Format.nChannels = channelCount;
+    pwfext->Format.nSamplesPerSec = (int)sampleRate;
+    if(channelCount == 1)
+        pwfext->dwChannelMask = KSAUDIO_SPEAKER_DIRECTOUT;
+    else
+        pwfext->dwChannelMask = KSAUDIO_SPEAKER_STEREO;
+    if(sampleFormat == paFloat32)
+    {
+        pwfext->Format.nBlockAlign = channelCount * 4;
+        pwfext->Format.wBitsPerSample = 32;
+        pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX);
+        pwfext->Samples.wValidBitsPerSample = 32;
+        pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
+    }
+    else if(sampleFormat == paInt32)
+    {
+        pwfext->Format.nBlockAlign = channelCount * 4;
+        pwfext->Format.wBitsPerSample = 32;
+        pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX);
+        pwfext->Samples.wValidBitsPerSample = 32;
+        pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
+    }
+    else if(sampleFormat == paInt24)
+    {
+        pwfext->Format.nBlockAlign = channelCount * 3;
+        pwfext->Format.wBitsPerSample = 24;
+        pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX);
+        pwfext->Samples.wValidBitsPerSample = 24;
+        pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
+    }
+    else if(sampleFormat == paInt16)
+    {
+        pwfext->Format.nBlockAlign = channelCount * 2;
+        pwfext->Format.wBitsPerSample = 16;
+        pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX);
+        pwfext->Samples.wValidBitsPerSample = 16;
+        pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
+    }
+    pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign;
+}
+
+
+
+/*
+#define FORMATTESTS 4
+const int BestToWorst[FORMATTESTS]={paFloat32,paInt32,paInt24,paInt16};
+*/
+
+#define FORMATTESTS 3
+const int BestToWorst[FORMATTESTS]={paFloat32,paInt24,paInt16};
+
+
+static PaError
+GetClosestFormat(IAudioClient * myClient, double sampleRate,const  PaStreamParameters * params, 
+				 AUDCLNT_SHAREMODE *shareMode, WAVEFORMATEXTENSIBLE *outWavex)
+{
+	//TODO we should try exclusive first and shared after
+	*shareMode = PORTAUDIO_SHAREMODE;
+
+	PaError answer = paInvalidSampleRate;
+
+    waveformatFromParams(outWavex,params,sampleRate);
+	WAVEFORMATEX *sharedClosestMatch=0;
+	HRESULT hResult=!S_OK;
+
+	if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)
+		hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,(WAVEFORMATEX*)outWavex,NULL);
+	else
+		hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED,   (WAVEFORMATEX*)&outWavex,&sharedClosestMatch);
+
+	if (hResult == S_OK)
+		answer = paFormatIsSupported;
+    else if (sharedClosestMatch){
+        WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*)sharedClosestMatch;
+		
+		int closestMatchSR = (int)sharedClosestMatch->nSamplesPerSec;
+
+		if (sharedClosestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE)
+			memcpy(outWavex,sharedClosestMatch,sizeof(WAVEFORMATEXTENSIBLE));
+		else
+			memcpy(outWavex,sharedClosestMatch,sizeof(WAVEFORMATEX));
+
+        CoTaskMemFree(sharedClosestMatch);
+
+		if ((int)sampleRate == closestMatchSR)
+		answer = paFormatIsSupported;
+		else
+			answer = paInvalidSampleRate;
+	
+	}else {
+
+		//it doesnt suggest anything?? ok lets show it the MENU!
+
+		//ok fun time as with pa_win_mme, we know only a refusal of the user-requested
+		//sampleRate+num Channel is disastrous, as the portaudio buffer processor converts between anything
+		//so lets only use the number 
+		for (int i=0;i<FORMATTESTS;++i){
+			WAVEFORMATEXTENSIBLE ext;
+			wasapiFillWFEXT(&ext,BestToWorst[i],sampleRate,params->channelCount);		
+			if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)
+				hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,(WAVEFORMATEX*)&ext,NULL);
+			else
+				hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED,   (WAVEFORMATEX*)&ext,&sharedClosestMatch);
+
+			if (hResult == S_OK){
+				memcpy(outWavex,&ext,sizeof(WAVEFORMATEXTENSIBLE));
+				answer = paFormatIsSupported;
+				break;
+			}
+		}
+
+		if (answer!=paFormatIsSupported) {
+			//try MIX format?
+			//why did it HAVE to come to this ....
+			WAVEFORMATEX pcm16WaveFormat;
+			memset(&pcm16WaveFormat,0,sizeof(WAVEFORMATEX));
+			pcm16WaveFormat.wFormatTag = WAVE_FORMAT_PCM; 
+			pcm16WaveFormat.nChannels = 2; 
+			pcm16WaveFormat.nSamplesPerSec = (DWORD)sampleRate; 
+			pcm16WaveFormat.nBlockAlign = 4; 
+			pcm16WaveFormat.nAvgBytesPerSec = pcm16WaveFormat.nSamplesPerSec*pcm16WaveFormat.nBlockAlign; 
+			pcm16WaveFormat.wBitsPerSample = 16; 
+			pcm16WaveFormat.cbSize = 0;
+
+			if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)
+				hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,(WAVEFORMATEX*)&pcm16WaveFormat,NULL);
+			else
+				hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED,   (WAVEFORMATEX*)&pcm16WaveFormat,&sharedClosestMatch);
+
+			if (hResult == S_OK){
+				memcpy(outWavex,&pcm16WaveFormat,sizeof(WAVEFORMATEX));
+				answer = paFormatIsSupported;
+			}
+		}
+
+		logAUDCLNT_E(hResult);
+	}
+
+	return answer;
+}
+
+
+static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
+                                  const  PaStreamParameters *inputParameters,
+                                  const  PaStreamParameters *outputParameters,
+                                  double sampleRate )
+{
+
+    int inputChannelCount, outputChannelCount;
+    PaSampleFormat inputSampleFormat, outputSampleFormat;
+
+    if( inputParameters )
+    {
+        inputChannelCount = inputParameters->channelCount;
+        inputSampleFormat = inputParameters->sampleFormat;
+
+        /* all standard sample formats are supported by the buffer adapter,
+            this implementation doesn't support any custom sample formats */
+        if( inputSampleFormat & paCustomFormat )
+            return paSampleFormatNotSupported;
+
+        /* unless alternate device specification is supported, reject the use of
+            paUseHostApiSpecificDeviceSpecification */
+
+        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )
+            return paInvalidDevice;
+
+        /* check that input device can support inputChannelCount */
+        if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels )
+            return paInvalidChannelCount;
+
+        /* validate inputStreamInfo */
+        if( inputParameters->hostApiSpecificStreamInfo )
+            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
+
+
+        PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
+
+
+		IAudioClient *myClient=0;
+		HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate(
+			__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient);
+		if (hResult != S_OK){
+			logAUDCLNT_E(hResult);
+			return paInvalidDevice;
+		}
+
+        WAVEFORMATEXTENSIBLE wavex;
+		AUDCLNT_SHAREMODE shareMode;
+		PaError answer = GetClosestFormat(myClient,sampleRate,inputParameters,&shareMode,&wavex);
+		myClient->Release();
+
+		if (answer !=paFormatIsSupported)
+			return answer;
+    }
+    else
+    {
+        inputChannelCount = 0;
+    }
+
+    if( outputParameters )
+    {
+        outputChannelCount = outputParameters->channelCount;
+        outputSampleFormat = outputParameters->sampleFormat;
+
+        /* all standard sample formats are supported by the buffer adapter,
+            this implementation doesn't support any custom sample formats */
+        if( outputSampleFormat & paCustomFormat )
+            return paSampleFormatNotSupported;
+
+        /* unless alternate device specification is supported, reject the use of
+            paUseHostApiSpecificDeviceSpecification */
+
+        if( outputParameters->device == paUseHostApiSpecificDeviceSpecification )
+            return paInvalidDevice;
+
+        /* check that output device can support outputChannelCount */
+        if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels )
+            return paInvalidChannelCount;
+
+        /* validate outputStreamInfo */
+        if( outputParameters->hostApiSpecificStreamInfo )
+            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
+
+
+        PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
+
+		IAudioClient *myClient=0;
+		HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate(
+			__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient);
+		if (hResult != S_OK){
+			logAUDCLNT_E(hResult);
+			return paInvalidDevice;
+		}
+
+        WAVEFORMATEXTENSIBLE wavex;
+		AUDCLNT_SHAREMODE shareMode;
+		PaError answer = GetClosestFormat(myClient,sampleRate,outputParameters,&shareMode,&wavex);
+		myClient->Release();
+
+		if (answer !=paFormatIsSupported)
+			return answer;		
+    }
+    else
+    {
+        outputChannelCount = 0;
+    }
+
+
+    return paFormatIsSupported;
+}
+
+
+
+/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */
+
+static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
+                           PaStream** s,
+                           const PaStreamParameters *inputParameters,
+                           const PaStreamParameters *outputParameters,
+                           double sampleRate,
+                           unsigned long framesPerBuffer,
+                           PaStreamFlags streamFlags,
+                           PaStreamCallback *streamCallback,
+                           void *userData )
+{
+    PaError result = paNoError;
+    PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi;
+    PaWinWasapiStream *stream = 0;
+    int inputChannelCount, outputChannelCount;
+    PaSampleFormat inputSampleFormat, outputSampleFormat;
+    PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;
+
+
+    stream = (PaWinWasapiStream*)PaUtil_AllocateMemory( sizeof(PaWinWasapiStream) );
+    if( !stream ){
+        result = paInsufficientMemory;
+        goto error;
+    }
+
+    if( inputParameters )
+    {
+        inputChannelCount = inputParameters->channelCount;
+        inputSampleFormat = inputParameters->sampleFormat;
+
+        /* unless alternate device specification is supported, reject the use of
+            paUseHostApiSpecificDeviceSpecification */
+
+        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )
+            return paInvalidDevice;
+
+        /* check that input device can support inputChannelCount */
+        if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels )
+            return paInvalidChannelCount;
+
+        /* validate inputStreamInfo */
+        if( inputParameters->hostApiSpecificStreamInfo )
+            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
+
+
+        PaWinWasapiDeviceInfo &info = paWasapi->devInfo[inputParameters->device];
+
+        HRESULT hResult = info.device->Activate(
+            __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL,
+            (void**)&stream->in.client);
+
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        hResult = info.device->Activate(
+            __uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL,
+            (void**)&stream->inVol);
+
+        if (hResult != S_OK)
+            return paInvalidDevice;
+	
+		AUDCLNT_SHAREMODE shareMode;
+		PaError answer = GetClosestFormat(stream->in.client,sampleRate,inputParameters,&shareMode,&stream->in.wavex);
+		
+		if (answer !=paFormatIsSupported)
+			return answer;
+
+        //stream->out.period = info.DefaultDevicePeriod;
+        stream->in.period = info.MinimumDevicePeriod;
+
+        hResult = stream->in.client->Initialize(
+            shareMode,
+            0,  //no flags
+            stream->in.period,
+            0,//stream->out.period,
+            (WAVEFORMATEX*)&stream->in.wavex,
+            &stream->session
+            );
+
+        if (hResult != S_OK){
+            logAUDCLNT_E(hResult);
+            return paInvalidDevice;
+        }
+
+        hResult = stream->in.client->GetBufferSize(&stream->in.bufferSize);
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        hResult = stream->in.client->GetStreamLatency(&stream->in.latency);
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        double periodsPerSecond = 1.0/nano100ToSeconds(stream->in.period);
+        double samplesPerPeriod = (double)(stream->in.wavex.Format.nSamplesPerSec)/periodsPerSecond;
+
+        //this is the number of samples that are required at each period
+        stream->in.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels
+
+        /* IMPLEMENT ME - establish which  host formats are available */
+        hostInputSampleFormat =
+            PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(&stream->in.wavex), inputSampleFormat );
+	}
+    else
+    {
+        inputChannelCount = 0;
+        inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */
+    }
+
+    if( outputParameters )
+    {
+        outputChannelCount = outputParameters->channelCount;
+        outputSampleFormat = outputParameters->sampleFormat;
+
+        /* unless alternate device specification is supported, reject the use of
+            paUseHostApiSpecificDeviceSpecification */
+
+        if( outputParameters->device == paUseHostApiSpecificDeviceSpecification )
+            return paInvalidDevice;
+
+        /* check that output device can support inputChannelCount */
+        if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels )
+            return paInvalidChannelCount;
+
+        /* validate outputStreamInfo */
+        if( outputParameters->hostApiSpecificStreamInfo )
+            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */
+
+
+        PaWinWasapiDeviceInfo &info = paWasapi->devInfo[outputParameters->device];
+
+        HRESULT hResult = info.device->Activate(
+            __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL,
+            (void**)&stream->out.client);
+
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+		AUDCLNT_SHAREMODE shareMode;
+		PaError answer = GetClosestFormat(stream->out.client,sampleRate,outputParameters,&shareMode,&stream->out.wavex);
+		
+		if (answer !=paFormatIsSupported)
+			return answer;
+		LogWAVEFORMATEXTENSIBLE(&stream->out.wavex);
+
+       // stream->out.period = info.DefaultDevicePeriod;
+        stream->out.period = info.MinimumDevicePeriod;
+
+		/*For an exclusive-mode stream that uses event-driven buffering, 
+		the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration, 
+		and the values of these two parameters must be equal */
+		if (shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE){
+			hResult = stream->out.client->Initialize(
+				shareMode,
+				AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 
+				stream->out.period,
+				stream->out.period,
+				(WAVEFORMATEX*)&stream->out.wavex,
+				&stream->session
+				);
+		}
+		else{
+			hResult = stream->out.client->Initialize(
+				shareMode,
+				AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 
+				0,
+				0,
+				(WAVEFORMATEX*)&stream->out.wavex,
+				&stream->session
+				);
+		}
+	
+
+        if (hResult != S_OK){
+            logAUDCLNT_E(hResult);
+            return paInvalidDevice;
+        }
+
+        hResult = info.device->Activate(
+            __uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL,
+            (void**)&stream->outVol);
+
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        hResult = stream->out.client->GetBufferSize(&stream->out.bufferSize);
+        if (hResult != S_OK)
+            return paInvalidDevice;
+
+        hResult = stream->out.client->GetStreamLatency(&stream->out.latency);
+        if (hResult != S_OK)
+            return paInvalidDevice;
+		
+        double periodsPerSecond = 1.0/nano100ToSeconds(stream->out.period);
+        double samplesPerPeriod = (double)(stream->out.wavex.Format.nSamplesPerSec)/periodsPerSecond;
+
+        //this is the number of samples that are required at each period
+        stream->out.framesPerHostCallback = stream->out.bufferSize; //(unsigned long)samplesPerPeriod;//unrelated to channels
+
+        /* IMPLEMENT ME - establish which  host formats are available */
+        hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(&stream->out.wavex), outputSampleFormat );
+    }
+    else
+    {
+        outputChannelCount = 0;
+        outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */
+    }
+
+
+
+    /*
+        IMPLEMENT ME:
+
+        ( the following two checks are taken care of by PaUtil_InitializeBufferProcessor() FIXME - checks needed? )
+
+            - check that input device can support inputSampleFormat, or that
+                we have the capability to convert from outputSampleFormat to
+                a native format
+
+            - check that output device can support outputSampleFormat, or that
+                we have the capability to convert from outputSampleFormat to
+                a native format
+
+            - if a full duplex stream is requested, check that the combination
+                of input and output parameters is supported
+
+            - check that the device supports sampleRate
+
+            - alter sampleRate to a close allowable rate if possible / necessary
+
+            - validate suggestedInputLatency and suggestedOutputLatency parameters,
+                use default values where necessary
+    */
+
+
+
+    /* validate platform specific flags */
+    if( (streamFlags & paPlatformSpecificFlags) != 0 )
+        return paInvalidFlag; /* unexpected platform specific flag */
+
+
+
+    if( streamCallback )
+    {
+        PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation,
+                                               &paWasapi->callbackStreamInterface, streamCallback, userData );
+    }
+    else
+    {
+        PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation,
+                                               &paWasapi->blockingStreamInterface, streamCallback, userData );
+    }
+
+    PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate );
+
+
+	if (outputParameters && inputParameters){
+
+		//serious problem #1
+		if (stream->in.period != stream->out.period){
+			PRINT(("OpenStream: period discrepancy\n"));
+			goto error;
+		}
+
+		//serious problem #2
+		if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback){
+			PRINT(("OpenStream: framesPerHostCallback discrepancy\n"));
+			goto error;
+		}
+	}
+
+	unsigned long framesPerHostCallback = (outputParameters)?
+		stream->out.framesPerHostCallback: 
+		stream->in.framesPerHostCallback;
+
+    /* we assume a fixed host buffer size in this example, but the buffer processor
+        can also support bounded and unknown host buffer sizes by passing
+        paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of
+        paUtilFixedHostBufferSize below. */
+
+    result =  PaUtil_InitializeBufferProcessor( &stream->bufferProcessor,
+              inputChannelCount, inputSampleFormat, hostInputSampleFormat,
+              outputChannelCount, outputSampleFormat, hostOutputSampleFormat,
+              sampleRate, streamFlags, framesPerBuffer,
+              framesPerHostCallback, paUtilFixedHostBufferSize,
+              streamCallback, userData );
+    if( result != paNoError )
+        goto error;
+
+
+    /*
+        IMPLEMENT ME: initialise the following fields with estimated or actual
+        values.
+    */
+    stream->streamRepresentation.streamInfo.inputLatency =
+            PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)
+			+ ((inputParameters)?nano100ToSeconds(stream->in.latency) :0);
+
+    stream->streamRepresentation.streamInfo.outputLatency =
+            PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)
+			+ ((outputParameters)?nano100ToSeconds(stream->out.latency) :0);
+
+    stream->streamRepresentation.streamInfo.sampleRate = sampleRate;
+
+
+    *s = (PaStream*)stream;
+
+
+    return result;
+
+error:
+    if( stream )
+        PaUtil_FreeMemory( stream );
+
+    return result;
+}
+
+
+
+/*
+    When CloseStream() is called, the multi-api layer ensures that
+    the stream has already been stopped or aborted.
+*/
+
+#define SAFE_RELEASE(punk)  \
+              if ((punk) != NULL)  \
+                { (punk)->Release(); (punk) = NULL; }
+
+static PaError CloseStream( PaStream* s )
+{
+    PaError result = paNoError;
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /*
+        IMPLEMENT ME:
+            - additional stream closing + cleanup
+    */
+
+    SAFE_RELEASE(stream->out.client);
+    SAFE_RELEASE(stream->in.client);
+    SAFE_RELEASE(stream->cclient);
+    SAFE_RELEASE(stream->rclient);
+	SAFE_RELEASE(stream->inVol);
+	SAFE_RELEASE(stream->outVol);
+    CloseHandle(stream->hThread);
+	CloseHandle(stream->hNotificationEvent);
+
+    PaUtil_TerminateBufferProcessor( &stream->bufferProcessor );
+    PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation );
+    PaUtil_FreeMemory( stream );
+
+    return result;
+}
+
+DWORD WINAPI ProcThread(void *client);
+
+static PaError StartStream( PaStream *s )
+{
+    PaError result = paNoError;
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    PaUtil_ResetBufferProcessor( &stream->bufferProcessor );
+	
+	HRESULT hResult=S_OK;
+
+	if (stream->out.client){
+		hResult = stream->out.client->GetService(__uuidof(IAudioRenderClient),(void**)&stream->rclient);
+		logAUDCLNT_E(hResult);
+		if (hResult!=S_OK)
+			return paUnanticipatedHostError;
+	}
+	
+	if (stream->in.client){
+	 hResult = stream->in.client->GetService(__uuidof(IAudioCaptureClient),(void**)&stream->cclient);
+		logAUDCLNT_E(hResult);
+		if (hResult!=S_OK)
+			return paUnanticipatedHostError;
+	}
+
+    // Create a thread for this client.
+    stream->hThread = CreateThread(
+        NULL,              // no security attribute
+        0,                 // default stack size
+        ProcThread,
+        (LPVOID) stream,    // thread parameter
+        0,                 // not suspended
+        &stream->dwThreadId);      // returns thread ID
+
+    if (stream->hThread == NULL)
+        return paUnanticipatedHostError;
+
+    return paNoError;
+}
+
+
+static PaError StopStream( PaStream *s )
+{
+    PaError result = paNoError;
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    stream->closeRequest = true;
+    //todo something MUCH better than this
+    while(stream->closeRequest)
+        Sleep(100);
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior */
+
+    stream->running = false;
+
+    return result;
+}
+
+
+static PaError AbortStream( PaStream *s )
+{
+    PaError result = paNoError;
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    stream->closeRequest = true;
+    //todo something MUCH better than this
+    while(stream->closeRequest)
+        Sleep(100);
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior */
+
+    return result;
+}
+
+
+static PaError IsStreamStopped( PaStream *s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    return !stream->running;
+}
+
+
+static PaError IsStreamActive( PaStream *s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+    return stream->running;
+}
+
+
+static PaTime GetStreamTime( PaStream *s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+	//this is lame ds and mme does the same thing, quite useless method imho
+	//why dont we fetch the time in the pa callbacks?
+	//at least its doing to be clocked to something
+    return PaUtil_GetTime();
+}
+
+
+static double GetStreamCpuLoad( PaStream* s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer );
+}
+
+
+/*
+    As separate stream interfaces are used for blocking and callback
+    streams, the following functions can be guaranteed to only be called
+    for blocking streams.
+*/
+
+static PaError ReadStream( PaStream* s,
+                           void *buffer,
+                           unsigned long frames )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) buffer;
+    (void) frames;
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+    return paNoError;
+}
+
+
+static PaError WriteStream( PaStream* s,
+                            const void *buffer,
+                            unsigned long frames )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) buffer;
+    (void) frames;
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+    return paNoError;
+}
+
+
+static signed long GetStreamReadAvailable( PaStream* s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+    return 0;
+}
+
+
+static signed long GetStreamWriteAvailable( PaStream* s )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)s;
+
+    /* suppress unused variable warnings */
+    (void) stream;
+
+    /* IMPLEMENT ME, see portaudio.h for required behavior*/
+
+    return 0;
+}
+
+
+
+/*
+    ExampleHostProcessingLoop() illustrates the kind of processing which may
+    occur in a host implementation.
+
+*/
+static void WaspiHostProcessingLoop( void *inputBuffer,  long inputFrames,
+                                     void *outputBuffer, long outputFrames,
+                                     void *userData )
+{
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)userData;
+    PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */
+    int callbackResult;
+    unsigned long framesProcessed;
+
+    PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer );
+
+
+    /*
+        IMPLEMENT ME:
+            - generate timing information
+            - handle buffer slips
+    */
+
+    /*
+        If you need to byte swap or shift inputBuffer to convert it into a
+        portaudio format, do it here.
+    */
+
+
+
+    PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ );
+
+    /*
+        depending on whether the host buffers are interleaved, non-interleaved
+        or a mixture, you will want to call PaUtil_SetInterleaved*Channels(),
+        PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here.
+    */
+
+    if( stream->bufferProcessor.inputChannelCount > 0 )
+    {
+        PaUtil_SetInputFrameCount( &stream->bufferProcessor, inputFrames );
+        PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor,
+            0, /* first channel of inputBuffer is channel 0 */
+            inputBuffer,
+            0 ); /* 0 - use inputChannelCount passed to init buffer processor */
+    }
+
+    if( stream->bufferProcessor.outputChannelCount > 0 )
+    {
+        PaUtil_SetOutputFrameCount( &stream->bufferProcessor, outputFrames);
+        PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor,
+            0, /* first channel of outputBuffer is channel 0 */
+            outputBuffer,
+            0 ); /* 0 - use outputChannelCount passed to init buffer processor */
+    }
+
+    /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing()
+        in general you would pass paContinue for normal operation, and
+        paComplete to drain the buffer processor's internal output buffer.
+        You can check whether the buffer processor's output buffer is empty
+        using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor )
+    */
+    callbackResult = paContinue;
+    framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult );
+
+
+    /*
+        If you need to byte swap or shift outputBuffer to convert it to
+        host format, do it here.
+    */
+
+    PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed );
+
+
+    if( callbackResult == paContinue )
+    {
+        /* nothing special to do */
+    }
+    else if( callbackResult == paAbort )
+    {
+        /* IMPLEMENT ME - finish playback immediately  */
+
+        /* once finished, call the finished callback */
+        if( stream->streamRepresentation.streamFinishedCallback != 0 )
+            stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData );
+    }
+    else
+    {
+        /* User callback has asked us to stop with paComplete or other non-zero value */
+
+        /* IMPLEMENT ME - finish playback once currently queued audio has completed  */
+
+        /* once finished, call the finished callback */
+        if( stream->streamRepresentation.streamFinishedCallback != 0 )
+            stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData );
+    }
+}
+
+
+void 
+MMCSS_activate(){
+
+    DWORD stuff=0;
+    HANDLE thCarac = pAvSetMmThreadCharacteristics("Pro Audio",&stuff);
+    if (!thCarac){
+        PRINT(("AvSetMmThreadCharacteristics failed!\n"));
+    }
+
+    BOOL prio = pAvSetMmThreadPriority(thCarac,AVRT_PRIORITY_NORMAL);
+    if (!prio){
+        PRINT(("AvSetMmThreadPriority failed!\n"));
+    }
+
+	//debug
+    {
+        HANDLE hh       = GetCurrentThread();
+        int  currprio   = GetThreadPriority(hh);
+        DWORD currclass = GetPriorityClass(GetCurrentProcess());
+        PRINT(("currprio 0x%X currclass 0x%X\n",currprio,currclass));
+    }
+}
+
+
+DWORD WINAPI
+ProcThread(void* param){
+	HRESULT hResult;
+	MMCSS_activate();
+
+    PaWinWasapiStream *stream = (PaWinWasapiStream*)param;
+
+	stream->hNotificationEvent = CreateEvent(NULL, 
+	                                         FALSE,  //bManualReset are we sure??
+											 FALSE, 
+											 "PAWASA");
+	hResult = stream->out.client->SetEventHandle(stream->hNotificationEvent);
+	if (hResult != S_OK)
+		logAUDCLNT_E(hResult);
+
+	if (stream->out.client){
+		hResult = stream->out.client->Start();
+		if (hResult != S_OK)
+			logAUDCLNT_E(hResult);
+	}
+
+	stream->running = true;
+	bool bOne = false;
+
+	while( !stream->closeRequest ) 
+    { 
+	    //lets wait but have a 1 second timeout
+        DWORD dwResult = WaitForSingleObject(stream->hNotificationEvent, 1000);
+        switch( dwResult ) {
+		case WAIT_OBJECT_0: {
+
+			unsigned long usingBS = stream->out.framesPerHostCallback;
+
+			BYTE* indata  = 0;
+			BYTE* outdata = 0;
+
+			hResult = stream->rclient->GetBuffer(usingBS, &outdata);
+
+			if (hResult != S_OK || !outdata) {
+				//logAUDCLNT_E(hResult);
+				//most probably shared mode and hResult=AUDCLNT_E_BUFFER_TOO_LARGE
+				UINT32 padding = 0;
+				hResult = stream->out.client->GetCurrentPadding(&padding);
+				if (padding == 0)
+					break;	
+				usingBS = usingBS-padding;
+				if (usingBS == 0)
+					break;//huh?
+				hResult = stream->rclient->GetBuffer(usingBS, &outdata);
+				if (hResult != S_OK)//what can we do NOW??
+					break;
+				//logAUDCLNT_E(hResult);			
+			}
+	
+			WaspiHostProcessingLoop(indata, usingBS ,outdata, usingBS, stream);
+
+			hResult = stream->rclient->ReleaseBuffer(usingBS, 0);
+			if (hResult != S_OK)
+				logAUDCLNT_E(hResult);
+
+			 /*	This was suggested, but in my tests it doesnt seem to improve the 
+                locking behaviour some drivers have running in exclusive mode.
+                if(!ResetEvent(stream->hNotificationEvent)){
+					logAUDCLNT_E(hResult);
+				}
+             */
+
+		} 
+		break;
+
+        }
+    }
+	stream->out.client->Stop();
+    stream->closeRequest = false;
+    
+	return 0; 
+}
+
+
+
+
+#endif //VC 2005
+
+
+
+
+#if 0
+			if(bFirst) {			
+				float masteur;
+				hResult = stream->outVol->GetMasterVolumeLevelScalar(&masteur);
+				if (hResult != S_OK)
+					logAUDCLNT_E(hResult);
+				float chan1, chan2;
+				hResult = stream->outVol->GetChannelVolumeLevelScalar(0, &chan1);
+				if (hResult != S_OK)
+					logAUDCLNT_E(hResult);
+				hResult = stream->outVol->GetChannelVolumeLevelScalar(1, &chan2);
+				if (hResult != S_OK)
+					logAUDCLNT_E(hResult);
+
+				BOOL bMute;
+				hResult = stream->outVol->GetMute(&bMute);
+				if (hResult != S_OK)
+					logAUDCLNT_E(hResult);
+
+				stream->outVol->SetMasterVolumeLevelScalar(0.5, NULL);
+				stream->outVol->SetChannelVolumeLevelScalar(0, 0.5, NULL);
+				stream->outVol->SetChannelVolumeLevelScalar(1, 0.5, NULL);
+				stream->outVol->SetMute(FALSE, NULL);
+				bFirst = false;
+			}
+#endif
\ No newline at end of file
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wdmks/readme.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/wdmks/readme.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wdmks/readme.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/wdmks/readme.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_hostapis.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/unix/pa_unix_hostapis.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_hostapis.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/unix/pa_unix_hostapis.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_util.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/unix/pa_unix_util.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_util.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/unix/pa_unix_util.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_util.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/unix/pa_unix_util.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/unix/pa_unix_util.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/unix/pa_unix_util.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_hostapis.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_hostapis.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_hostapis.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_hostapis.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_util.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_util.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_util.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_util.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_waveformat.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_waveformat.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_waveformat.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_waveformat.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_wdmks_utils.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_wdmks_utils.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_wdmks_utils.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_wdmks_utils.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_wdmks_utils.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_wdmks_utils.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_win_wdmks_utils.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_win_wdmks_utils.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_x86_plain_converters.c b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_x86_plain_converters.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_x86_plain_converters.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_x86_plain_converters.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_x86_plain_converters.h b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_x86_plain_converters.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/src/os/win/pa_x86_plain_converters.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/src/os/win/pa_x86_plain_converters.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/testcvs/changeme.txt b/sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/testcvs/changeme.txt
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/portaudio/testcvs/changeme.txt
rename to sflphone-common/libs/pjproject-1.0.3/third_party/portaudio/testcvs/changeme.txt
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/resample/COPYING b/sflphone-common/libs/pjproject-1.0.3/third_party/resample/COPYING
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/resample/COPYING
rename to sflphone-common/libs/pjproject-1.0.3/third_party/resample/COPYING
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/resample/README.resample b/sflphone-common/libs/pjproject-1.0.3/third_party/resample/README.resample
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/resample/README.resample
rename to sflphone-common/libs/pjproject-1.0.3/third_party/resample/README.resample
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/resample/include/resamplesubs.h b/sflphone-common/libs/pjproject-1.0.3/third_party/resample/include/resamplesubs.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/resample/include/resamplesubs.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/resample/include/resamplesubs.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/largefilter.h b/sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/largefilter.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/largefilter.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/largefilter.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/libresample_dll.c b/sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/libresample_dll.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/libresample_dll.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/libresample_dll.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/resample.h b/sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/resample.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/resample.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/resample.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/resamplesubs.c b/sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/resamplesubs.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/resamplesubs.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/resamplesubs.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/smallfilter.h b/sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/smallfilter.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/smallfilter.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/smallfilter.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/stddefs.h b/sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/stddefs.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/resample/src/stddefs.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/resample/src/stddefs.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/AUTHORS b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/AUTHORS
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/AUTHORS
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/AUTHORS
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/COPYING b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/COPYING
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/COPYING
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/COPYING
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_bits.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_bits.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_bits.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_bits.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_buffer.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_buffer.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_buffer.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_buffer.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_callbacks.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_callbacks.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_callbacks.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_callbacks.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_config_types.h.in b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_config_types.h.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_config_types.h.in
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_config_types.h.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_echo.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_echo.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_echo.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_echo.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_header.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_header.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_header.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_header.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_jitter.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_jitter.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_jitter.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_jitter.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_preprocess.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_preprocess.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_preprocess.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_preprocess.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_resampler.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_resampler.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_resampler.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_resampler.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_stereo.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_stereo.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_stereo.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_stereo.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_types.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/include/speex/speex_types.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/include/speex/speex_types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/_kiss_fft_guts.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/_kiss_fft_guts.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/_kiss_fft_guts.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/_kiss_fft_guts.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/arch.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/arch.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/arch.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/arch.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/bits.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/bits.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/bits.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/bits.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/buffer.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/buffer.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/buffer.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/buffer.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_arm4.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search_arm4.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_arm4.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search_arm4.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_bfin.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search_bfin.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_bfin.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search_bfin.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_sse.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search_sse.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/cb_search_sse.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/cb_search_sse.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/echo_diagnostic.m b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/echo_diagnostic.m
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/echo_diagnostic.m
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/echo_diagnostic.m
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_10_16_table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_10_16_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_10_16_table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_10_16_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_10_32_table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_10_32_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_10_32_table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_10_32_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_20_32_table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_20_32_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_20_32_table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_20_32_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_5_256_table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_5_256_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_5_256_table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_5_256_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_5_64_table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_5_64_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_5_64_table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_5_64_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_8_128_table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_8_128_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/exc_8_128_table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/exc_8_128_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fftwrap.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fftwrap.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fftwrap.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fftwrap.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fftwrap.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fftwrap.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fftwrap.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fftwrap.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filterbank.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filterbank.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filterbank.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filterbank.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filterbank.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filterbank.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filterbank.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filterbank.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_arm4.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters_arm4.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_arm4.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters_arm4.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_bfin.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters_bfin.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_bfin.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters_bfin.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_sse.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters_sse.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/filters_sse.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/filters_sse.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_arm4.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_arm4.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_arm4.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_arm4.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_arm5e.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_arm5e.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_arm5e.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_arm5e.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_bfin.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_bfin.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_bfin.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_bfin.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_debug.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_debug.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_debug.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_debug.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_generic.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_generic.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/fixed_generic.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/fixed_generic.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/gain_table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/gain_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/gain_table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/gain_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/gain_table_lbr.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/gain_table_lbr.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/gain_table_lbr.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/gain_table_lbr.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/hexc_10_32_table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/hexc_10_32_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/hexc_10_32_table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/hexc_10_32_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/hexc_table.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/hexc_table.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/hexc_table.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/hexc_table.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/high_lsp_tables.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/high_lsp_tables.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/high_lsp_tables.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/high_lsp_tables.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/jitter.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/jitter.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/jitter.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/jitter.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fft.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/kiss_fft.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fft.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/kiss_fft.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fft.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/kiss_fft.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fft.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/kiss_fft.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fftr.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/kiss_fftr.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fftr.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/kiss_fftr.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fftr.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/kiss_fftr.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/kiss_fftr.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/kiss_fftr.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lpc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lpc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lpc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lpc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc_bfin.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lpc_bfin.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lpc_bfin.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lpc_bfin.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lsp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lsp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lsp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lsp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp_bfin.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lsp_bfin.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp_bfin.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lsp_bfin.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp_tables_nb.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lsp_tables_nb.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/lsp_tables_nb.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/lsp_tables_nb.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_arm4.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp_arm4.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_arm4.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp_arm4.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_bfin.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp_bfin.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_bfin.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp_bfin.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_sse.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp_sse.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/ltp_sse.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/ltp_sse.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/math_approx.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/math_approx.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/math_approx.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/math_approx.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/mdf.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/mdf.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/mdf.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/mdf.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/misc_bfin.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/misc_bfin.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/misc_bfin.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/misc_bfin.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/modes.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/modes.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/modes.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/modes.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes_wb.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/modes_wb.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/modes_wb.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/modes_wb.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/nb_celp.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/nb_celp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/nb_celp.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/nb_celp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/nb_celp.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/nb_celp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/nb_celp.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/nb_celp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/os_support.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/os_support.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/os_support.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/os_support.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/preprocess.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/preprocess.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/preprocess.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/preprocess.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/pseudofloat.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/pseudofloat.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/pseudofloat.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/pseudofloat.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/quant_lsp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/quant_lsp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/quant_lsp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/quant_lsp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp_bfin.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/quant_lsp_bfin.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/quant_lsp_bfin.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/quant_lsp_bfin.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/resample.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/resample.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/resample.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/resample.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/resample_sse.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/resample_sse.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/resample_sse.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/resample_sse.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/sb_celp.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/sb_celp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/sb_celp.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/sb_celp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/sb_celp.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/sb_celp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/sb_celp.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/sb_celp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/scal.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/scal.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/scal.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/scal.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/smallft.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/smallft.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/smallft.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/smallft.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/smallft.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/smallft.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/smallft.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/smallft.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/speex.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/speex.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex_callbacks.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/speex_callbacks.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex_callbacks.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/speex_callbacks.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex_header.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/speex_header.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/speex_header.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/speex_header.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/stack_alloc.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/stack_alloc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/stack_alloc.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/stack_alloc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/stereo.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/stereo.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/stereo.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/stereo.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testdenoise.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testdenoise.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testdenoise.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testdenoise.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testecho.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testecho.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testecho.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testecho.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testenc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testenc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc_uwb.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testenc_uwb.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc_uwb.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testenc_uwb.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc_wb.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testenc_wb.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testenc_wb.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testenc_wb.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testjitter.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testjitter.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testjitter.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testjitter.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testresample.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testresample.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/testresample.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/testresample.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vbr.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vbr.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vbr.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vbr.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vbr.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vbr.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vbr.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vbr.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vorbis_psy.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vorbis_psy.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vorbis_psy.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vorbis_psy.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vorbis_psy.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vorbis_psy.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vorbis_psy.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vorbis_psy.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_arm4.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq_arm4.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_arm4.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq_arm4.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_bfin.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq_bfin.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_bfin.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq_bfin.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_sse.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq_sse.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/vq_sse.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/vq_sse.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/window.c b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/window.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/libspeex/window.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/libspeex/window.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/symbian/config.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/symbian/config.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/symbian/config.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/symbian/config.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/speex/win32/config.h b/sflphone-common/libs/pjproject-1.0.3/third_party/speex/win32/config.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/speex/win32/config.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/speex/win32/config.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/CHANGES b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/CHANGES
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/CHANGES
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/CHANGES
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/LICENSE b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/LICENSE
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/LICENSE
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/LICENSE
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/README b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/README
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/README
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/README
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/TODO b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/TODO
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/TODO
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/TODO
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/VERSION b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/VERSION
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/VERSION
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/VERSION
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.guess b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config.guess
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.guess
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config.guess
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.h_win32vc7 b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config.h_win32vc7
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.h_win32vc7
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config.h_win32vc7
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.hw b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config.hw
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.hw
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config.hw
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.sub b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config.sub
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config.sub
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config.sub
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config_in.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config_in.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/config_in.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/config_in.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/configure b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/configure
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/configure
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/configure
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/configure.in b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/configure.in
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/configure.in
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/configure.in
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/Makefile b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/Makefile
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/Makefile
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/Makefile
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/VERSION b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/VERSION
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/VERSION
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/VERSION
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/ae_xfm/xfm.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/ae_xfm/xfm.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/ae_xfm/xfm.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/ae_xfm/xfm.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/aes.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/aes.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes_cbc.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/aes_cbc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes_cbc.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/aes_cbc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes_icm.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/aes_icm.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/aes_icm.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/aes_icm.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/cipher.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/cipher.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/cipher.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/cipher.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/null_cipher.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/null_cipher.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/cipher/null_cipher.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/cipher/null_cipher.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/auth.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/hash/auth.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/auth.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/hash/auth.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/hmac.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/hash/hmac.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/hmac.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/hash/hmac.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/null_auth.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/hash/null_auth.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/null_auth.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/hash/null_auth.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/sha1.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/hash/sha1.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/hash/sha1.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/hash/sha1.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/aes.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/aes.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes_cbc.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/aes_cbc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes_cbc.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/aes_cbc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes_icm.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/aes_icm.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/aes_icm.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/aes_icm.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/alloc.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/alloc.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/alloc.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/alloc.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/auth.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/auth.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/auth.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/auth.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/cipher.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/cipher.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/cipher.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/cipher.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/crypto.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/crypto.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_kernel.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/crypto_kernel.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_kernel.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/crypto_kernel.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_math.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/crypto_math.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_math.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/crypto_math.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_types.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/crypto_types.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/crypto_types.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/crypto_types.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/cryptoalg.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/cryptoalg.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/cryptoalg.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/cryptoalg.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/datatypes.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/datatypes.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/datatypes.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/datatypes.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/err.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/err.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/err.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/err.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/gf2_8.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/gf2_8.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/gf2_8.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/gf2_8.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/hmac.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/hmac.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/hmac.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/hmac.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/integers.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/integers.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/integers.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/integers.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/kernel_compat.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/kernel_compat.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/kernel_compat.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/kernel_compat.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/key.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/key.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/key.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/key.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/null_auth.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/null_auth.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/null_auth.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/null_auth.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/null_cipher.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/null_cipher.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/null_cipher.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/null_cipher.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/prng.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/prng.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/prng.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/prng.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rand_source.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/rand_source.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rand_source.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/rand_source.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rdb.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/rdb.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rdb.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/rdb.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rdbx.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/rdbx.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/rdbx.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/rdbx.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/sha1.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/sha1.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/sha1.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/sha1.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/stat.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/stat.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/stat.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/stat.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/xfm.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/xfm.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/include/xfm.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/include/xfm.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/alloc.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/kernel/alloc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/alloc.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/kernel/alloc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/crypto_kernel.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/kernel/crypto_kernel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/crypto_kernel.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/kernel/crypto_kernel.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/err.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/kernel/err.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/err.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/kernel/err.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/key.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/kernel/key.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/kernel/key.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/kernel/key.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/datatypes.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/math/datatypes.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/datatypes.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/math/datatypes.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/gf2_8.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/math/gf2_8.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/gf2_8.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/math/gf2_8.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/math.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/math/math.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/math.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/math/math.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/stat.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/math/stat.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/math/stat.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/math/stat.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/rdb.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/replay/rdb.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/rdb.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/replay/rdb.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/rdbx.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/replay/rdbx.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/rdbx.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/replay/rdbx.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/ut_sim.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/replay/ut_sim.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/replay/ut_sim.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/replay/ut_sim.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/ctr_prng.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/rng/ctr_prng.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/ctr_prng.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/rng/ctr_prng.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/prng.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/rng/prng.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/prng.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/rng/prng.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/rand_linux_kernel.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/rng/rand_linux_kernel.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/rand_linux_kernel.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/rng/rand_linux_kernel.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/rand_source.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/rng/rand_source.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/rng/rand_source.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/rng/rand_source.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/aes_calc.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/aes_calc.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/aes_calc.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/aes_calc.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/auth_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/auth_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/auth_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/auth_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/cipher_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/cipher_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/cipher_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/cipher_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/datatypes_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/datatypes_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/datatypes_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/datatypes_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/env.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/env.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/env.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/env.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/kernel_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/kernel_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/kernel_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/kernel_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/rand_gen.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/rand_gen.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/rand_gen.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/rand_gen.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/sha1_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/sha1_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/sha1_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/sha1_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/stat_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/stat_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/crypto/test/stat_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/crypto/test/stat_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/getopt_s.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/getopt_s.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/getopt_s.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/getopt_s.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/rtp.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/rtp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/rtp.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/rtp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/rtp_priv.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/rtp_priv.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/rtp_priv.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/rtp_priv.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/srtp.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/srtp.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/srtp.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/srtp.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/srtp_priv.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/srtp_priv.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/srtp_priv.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/srtp_priv.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/ut_sim.h b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/ut_sim.h
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/include/ut_sim.h
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/include/ut_sim.h
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/install-sh b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/install-sh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/install-sh
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/install-sh
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/pjlib/srtp_err.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/pjlib/srtp_err.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/pjlib/srtp_err.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/pjlib/srtp_err.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp.def b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp.def
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp.def
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp.def
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp/srtp.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp/srtp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp/srtp.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp/srtp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp7.sln b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp7.sln
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp7.sln
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp7.sln
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp7.vcproj b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp7.vcproj
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/srtp7.vcproj
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/srtp7.vcproj
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/tables/aes_tables.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/tables/aes_tables.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/tables/aes_tables.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/tables/aes_tables.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/dtls_srtp_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/dtls_srtp_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/dtls_srtp_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/dtls_srtp_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/getopt_s.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/getopt_s.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/getopt_s.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/getopt_s.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/lfsr.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/lfsr.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/lfsr.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/lfsr.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rdbx_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/rdbx_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rdbx_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/rdbx_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/replay_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/replay_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/replay_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/replay_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/roc_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/roc_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/roc_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/roc_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtp.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/rtp.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtp.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/rtp.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtpw.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/rtpw.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtpw.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/rtpw.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtpw_test.sh b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/rtpw_test.sh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/rtpw_test.sh
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/rtpw_test.sh
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/srtp_driver.c b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/srtp_driver.c
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/test/srtp_driver.c
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/test/srtp_driver.c
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/timing b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/timing
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/timing
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/timing
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/undos.sh b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/undos.sh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/undos.sh
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/undos.sh
diff --git a/sflphone-common/libs/pjproject-1.0.2/third_party/srtp/update.sh b/sflphone-common/libs/pjproject-1.0.3/third_party/srtp/update.sh
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/third_party/srtp/update.sh
rename to sflphone-common/libs/pjproject-1.0.3/third_party/srtp/update.sh
diff --git a/sflphone-common/libs/pjproject-1.0.2/user.mak.sample b/sflphone-common/libs/pjproject-1.0.3/user.mak.sample
similarity index 100%
rename from sflphone-common/libs/pjproject-1.0.2/user.mak.sample
rename to sflphone-common/libs/pjproject-1.0.3/user.mak.sample
diff --git a/tools/build-system/distributions/mandriva/sflphone-common.spec b/tools/build-system/distributions/mandriva/sflphone-common.spec
index 11921a1d76bc92257bd4c53f44c54606aae8debd..6a0bebbcd47b58073296aa3ce257624b1106bb8e 100644
--- a/tools/build-system/distributions/mandriva/sflphone-common.spec
+++ b/tools/build-system/distributions/mandriva/sflphone-common.spec
@@ -59,7 +59,7 @@ Authors:
 %setup -q
 
 %build
-cd libs/pjproject-1.0.2
+cd libs/pjproject-1.0.3
 ./autogen.sh --prefix=%{_prefix}
 make dep
 make clean
@@ -69,13 +69,13 @@ cd -
 make -j
 
 %install
-cd libs/pjproject-1.0.2
+cd libs/pjproject-1.0.3
 make DESTDIR=%{buildroot} install
 cd -
 make DESTDIR=%{buildroot} install
 
 %clean
-cd libs/pjproject-1.0.2
+cd libs/pjproject-1.0.3
 make clean
 cd -
 make clean
diff --git a/tools/build-system/distributions/opensuse/sflphone-common.spec b/tools/build-system/distributions/opensuse/sflphone-common.spec
index 34280a5b9562151479d52e1d98b6f8f28e734dc7..6cd41354c378bfac5a4d0e34b7d23ccab2a46aaf 100644
--- a/tools/build-system/distributions/opensuse/sflphone-common.spec
+++ b/tools/build-system/distributions/opensuse/sflphone-common.spec
@@ -58,7 +58,7 @@ Authors:
 %setup -q
 
 %build
-cd libs/pjproject-1.0.2
+cd libs/pjproject-1.0.3
 ./autogen.sh --prefix=%{_prefix}
 make dep
 make clean
@@ -68,13 +68,13 @@ cd -
 make -j
 
 %install
-cd libs/pjproject-1.0.2
+cd libs/pjproject-1.0.3
 make DESTDIR=%{buildroot} install
 cd -
 make DESTDIR=%{buildroot} install
 
 %clean
-cd libs/pjproject-1.0.2
+cd libs/pjproject-1.0.3
 make clean
 cd -
 make clean
diff --git a/tools/build-system/distributions/ubuntu/debian-sflphone-common/rules b/tools/build-system/distributions/ubuntu/debian-sflphone-common/rules
index d7235ece2b796b4f95933ac297042bd87a12058f..2ca6f99f329b1e55babd80850a265225ac7f4d68 100755
--- a/tools/build-system/distributions/ubuntu/debian-sflphone-common/rules
+++ b/tools/build-system/distributions/ubuntu/debian-sflphone-common/rules
@@ -21,7 +21,7 @@ configure-stamp:
 	dh_testdir
 	# Add here commands to configure the package.
 	./autogen.sh --prefix=/usr
-	cd libs/pjproject-1.0.2; ./autogen.sh --prefix=/usr
+	cd libs/pjproject-1.0.3; ./autogen.sh --prefix=/usr
 	touch configure-stamp
 
 #Architecture 
@@ -31,7 +31,7 @@ build-arch: build-arch-stamp
 build-arch-stamp: configure-stamp 
 
     # Add here commands to compile the arch part of the package.
-	cd libs/pjproject-1.0.2; $(MAKE) dep; $(MAKE) clean; $(MAKE)
+	cd libs/pjproject-1.0.3; $(MAKE) dep; $(MAKE) clean; $(MAKE)
 	cd -; $(MAKE) 
 	touch $@
 
@@ -72,7 +72,7 @@ install-arch:
 	# Add here commands to install the arch part of the package into 
 	# debian/tmp.
 	$(MAKE) DESTDIR=$(CURDIR)/debian/$(package) install
-	cd libs/pjproject-1.0.2; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install
+	cd libs/pjproject-1.0.3; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install
 	rm -rf $(CURDIR)/debian/$(package)/usr/include
 	dh_install -s
 # Must not depend on anything. This is to be called by