Index: pjproject/branches/users/nanang/build.mak.in
===================================================================
--- pjproject/branches/users/nanang/build.mak.in	(revision 1718)
+++ pjproject/branches/users/nanang/build.mak.in	(revision 1719)
@@ -9,5 +9,5 @@
 
 # Determine which party libraries to use
-export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lmilenage-$(TARGET_NAME)
+export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lmilenage-$(TARGET_NAME) -lsrtp-$(TARGET_NAME)
 
 ifneq (@ac_no_gsm_codec@,1)
Index: pjproject/branches/users/nanang/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- pjproject/branches/users/nanang/pjsip-apps/src/pjsua/pjsua_app.c	(revision 1718)
+++ pjproject/branches/users/nanang/pjsip-apps/src/pjsua/pjsua_app.c	(revision 1719)
@@ -474,4 +474,5 @@
     pjsua_acc_config *cur_acc;
     char *config_file = NULL;
+    int use_srtp = -1;
     unsigned i;
 
@@ -800,10 +801,9 @@
 
 	case OPT_USE_SRTP:
-	    i = my_atoi(pj_optarg);
-	    if (!pj_isdigit(*pj_optarg) || i > 2) {
+	    use_srtp = my_atoi(pj_optarg);
+	    if (!pj_isdigit(*pj_optarg) || use_srtp > 2) {
 		PJ_LOG(1,(THIS_FILE, "Invalid value for --use-srtp option"));
 		return -1;
 	    }
-	    cur_acc->use_srtp = i;
 	    break;
 
@@ -1038,4 +1038,6 @@
     for (i=0; i<cfg->acc_cnt; ++i) {
 	pjsua_acc_config *acfg = &cfg->acc_cfg[i];
+
+	acfg->use_srtp = (pjmedia_srtp_use) use_srtp;
 
 	if (acfg->cred_info[acfg->cred_count].username.slen)
Index: pjproject/branches/users/nanang/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- pjproject/branches/users/nanang/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1718)
+++ pjproject/branches/users/nanang/pjsip/src/pjsua-lib/pjsua_media.c	(revision 1719)
@@ -751,5 +751,7 @@
     pjsua_call *call = &pjsua_var.calls[call_id];
     pjsua_acc *acc = &pjsua_var.acc[call->acc_id];
-    pjmedia_srtp_use use_srtp;
+    pjmedia_srtp_setting srtp_opt;
+    pjmedia_transport *srtp;
+    pj_status_t status;
 
     PJ_UNUSED_ARG(role);
@@ -764,25 +766,24 @@
     /* Stop media transport (for good measure!) */
     pjmedia_transport_media_stop(call->med_tp);
-    
-    /* See if we need to use SRTP */
-    use_srtp = acc->cfg.use_srtp;
-    if (use_srtp != PJMEDIA_SRTP_DISABLED) {
-	pj_status_t status;
-	pjmedia_transport *srtp;
-
+
+    /* Check if SRTP requires secure signaling */
+    if (acc->cfg.use_srtp != PJMEDIA_SRTP_DISABLED) {
 	if (security_level < acc->cfg.srtp_secure_signaling) {
 	    return PJSIP_ESESSIONINSECURE;
 	}
-
-	/* Create SRTP */
-	status = pjmedia_transport_srtp_create(pjsua_var.med_endpt, 
-					       call->med_tp,
-					       NULL, &srtp);
-	if (status != PJ_SUCCESS)
-	    return status;
-
-	/* Set SRTP as current media transport */
-	call->med_tp = srtp;
-    }
+    }
+
+    /* Always create SRTP adapter */
+    pjmedia_srtp_setting_default(&srtp_opt);
+    srtp_opt.close_member_tp = PJ_FALSE;
+    status = pjmedia_transport_srtp_create(pjsua_var.med_endpt, 
+					   call->med_tp,
+					   &srtp_opt, &srtp);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    /* Set SRTP as current media transport */
+    call->med_orig = call->med_tp;
+    call->med_tp = srtp;
 
     return PJ_SUCCESS;
Index: pjproject/branches/users/nanang/third_party/build/srtp/Makefile
===================================================================
--- pjproject/branches/users/nanang/third_party/build/srtp/Makefile	(revision 1718)
+++ pjproject/branches/users/nanang/third_party/build/srtp/Makefile	(revision 1719)
@@ -37,5 +37,5 @@
 rng     = crypto/rng/rand_source.o crypto/rng/prng.o crypto/rng/ctr_prng.o
 
-err     = crypto/kernel/err.o
+err     = pjlib/srtp_err.o
 
 kernel  = crypto/kernel/crypto_kernel.o  crypto/kernel/alloc.o   \
Index: pjproject/branches/users/nanang/third_party/build/srtp/libsrtp.dsp
===================================================================
--- pjproject/branches/users/nanang/third_party/build/srtp/libsrtp.dsp	(revision 1718)
+++ pjproject/branches/users/nanang/third_party/build/srtp/libsrtp.dsp	(revision 1719)
@@ -43,5 +43,5 @@
 F90=df.exe
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../../srtp/include" /I "../../srtp/crypto/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../../srtp/include" /I "../../srtp/crypto/include" /I "../../../pjlib/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /c
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /d "NDEBUG"
@@ -67,5 +67,5 @@
 F90=df.exe
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "." /I "../../srtp/include" /I "../../srtp/crypto/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "." /I "../../srtp/include" /I "../../srtp/crypto/include" /I "../../../pjlib/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /d "_DEBUG"
@@ -90,4 +90,8 @@
 SOURCE=..\..\srtp\srtp\srtp.c
 # End Source File
+# Begin Source File
+
+SOURCE=..\..\srtp\pjlib\srtp_err.c
+# End Source File
 # End Group
 # Begin Group "Header Files"
@@ -96,8 +100,4 @@
 # Begin Source File
 
-SOURCE=.\config.h
-# End Source File
-# Begin Source File
-
 SOURCE=..\..\srtp\include\rtp.h
 # End Source File
@@ -108,4 +108,8 @@
 # Begin Source File
 
+SOURCE=.\srtp_config.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\srtp\include\ut_sim.h
 # End Source File
@@ -291,8 +295,4 @@
 # Begin Source File
 
-SOURCE=..\..\srtp\crypto\kernel\err.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\..\srtp\crypto\kernel\key.c
 # End Source File
@@ -325,8 +325,4 @@
 SOURCE=..\..\srtp\crypto\replay\rdbx.c
 # End Source File
-# Begin Source File
-
-SOURCE=..\..\srtp\crypto\replay\ut_sim.c
-# End Source File
 # End Group
 # Begin Group "rng"
@@ -346,12 +342,4 @@
 # End Source File
 # End Group
-# End Group
-# Begin Group "tables"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\srtp\tables\aes_tables.c
-# End Source File
 # End Group
 # End Target
Index: pjproject/branches/users/nanang/third_party/build/srtp/libsrtp.vcproj
===================================================================
--- pjproject/branches/users/nanang/third_party/build/srtp/libsrtp.vcproj	(revision 1718)
+++ pjproject/branches/users/nanang/third_party/build/srtp/libsrtp.vcproj	(revision 1719)
@@ -41,5 +41,5 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".,../../srtp/include,../../srtp/crypto/include"
+				AdditionalIncludeDirectories=".,../../srtp/include,../../srtp/crypto/include,../../../pjlib/include"
 				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
 				MinimalRebuild="true"
@@ -105,5 +105,5 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories=".,../../srtp/include,../../srtp/crypto/include"
+				AdditionalIncludeDirectories=".,../../srtp/include,../../srtp/crypto/include,../../../pjlib/include"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
 				RuntimeLibrary="2"
@@ -155,4 +155,8 @@
 				>
 			</File>
+			<File
+				RelativePath="..\..\srtp\pjlib\srtp_err.c"
+				>
+			</File>
 		</Filter>
 		<Filter
@@ -162,8 +166,4 @@
 			>
 			<File
-				RelativePath=".\config.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\srtp\include\rtp.h"
 				>
@@ -171,4 +171,8 @@
 			<File
 				RelativePath="..\..\srtp\include\srtp.h"
+				>
+			</File>
+			<File
+				RelativePath=".\srtp_config.h"
 				>
 			</File>
@@ -245,8 +249,4 @@
 				</File>
 				<File
-					RelativePath="..\..\srtp\crypto\kernel\err.c"
-					>
-				</File>
-				<File
 					RelativePath="..\..\srtp\crypto\kernel\key.c"
 					>
@@ -278,8 +278,4 @@
 				<File
 					RelativePath="..\..\srtp\crypto\replay\rdbx.c"
-					>
-				</File>
-				<File
-					RelativePath="..\..\srtp\crypto\replay\ut_sim.c"
 					>
 				</File>
Index: pjproject/branches/users/nanang/third_party/build/srtp/srtp_config.h
===================================================================
--- pjproject/branches/users/nanang/third_party/build/srtp/srtp_config.h	(revision 1718)
+++ pjproject/branches/users/nanang/third_party/build/srtp/srtp_config.h	(revision 1719)
@@ -1,34 +1,40 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __SRTP_CONFIG_H__
+#define __SRTP_CONFIG_H__
+
 #include <pj/types.h>
 
-/* Define if building for a CISC machine (e.g. Intel). */
-/* #define CPU_CISC 1 */
-
-/* Define if building for a RISC machine (assume slow byte access). */
-/* #undef CPU_RISC */
-
-/* PJLIB can't detect CISC vs RISC CPU, so we'll just say RISC here */
-#if defined(PJ_WIN32) && PJ_WIN32!=0
-#   define CPU_CISC	1
+/* We'll just define CISC if it's x86 family */
+#if (defined(PJ_M_I386) && PJ_M_I386!=0) || \
+    (defined(PJ_M_X86_64) && PJ_M_X86_64!=0) || \
+    (defined(PJ_M_IA64) && PJ_M_IA64!=0)
+#   define CPU_CISC	    1
+#   define HAVE_X86	    1   /* use X86 inlined assembly code */
 #else
-#   define CPU_RISC	1
+#   define CPU_RISC	    1
 #endif
 
-/* Path to random device */
-/* #define DEV_URANDOM "/dev/urandom" */
-
 /* Define to compile in dynamic debugging system. */
-#define ENABLE_DEBUGGING 1
-
-/* Report errors to this file. */
-/* #undef ERR_REPORTING_FILE */
-
-/* Define to use logging to stdout. */
-//#define ERR_REPORTING_STDOUT 1
-
-/* Define this to use ISMAcryp code. */
-/* #undef GENERIC_AESICM */
+#define ENABLE_DEBUGGING    PJ_DEBUG
 
 /* Define to 1 if you have the <arpa/inet.h> header file. */
-#ifdef PJ_HAS_ARPA_INET_H 
+#if defined(PJ_HAS_ARPA_INET_H) && PJ_HAS_ARPA_INET_H!=0
 #   define HAVE_ARPA_INET_H 1
 #endif
@@ -38,19 +44,113 @@
 
 /* Define to 1 if you have the `inet_aton' function. */
-#ifdef PJ_SOCK_HAS_INET_PTON
+#if defined(PJ_SOCK_HAS_INET_PTON) && PJ_SOCK_HAS_INET_PTON
 #   define HAVE_INET_ATON   1
 #endif
 
-/* Define to 1 if the system has the type `int16_t'. */
-#define HAVE_INT16_T 1
 
-/* Define to 1 if the system has the type `int32_t'. */
-#define HAVE_INT32_T 1
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H!=0
+#   define HAVE_NETINET_IN_H	1
+#endif
 
-/* Define to 1 if the system has the type `int8_t'. */
-#define HAVE_INT8_T 1
+/* Define to 1 if you have the <stdlib.h> header file. */
+#if defined(PJ_HAS_STDLIB_H) && PJ_HAS_STDLIB_H!=0
+#   define HAVE_STDLIB_H    1
+#endif
+
+/* Define to 1 if you have the <string.h> header file. */
+#if defined(PJ_HAS_STRING_H) && PJ_HAS_STRING_H!=0
+#   define HAVE_STRING_H    1
+#endif
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#if defined(PJ_HAS_SYS_SOCKET_H) && PJ_HAS_SYS_SOCKET_H!=0
+#   define HAVE_SYS_SOCKET_H	1
+#endif
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H!=0
+#   define HAVE_SYS_TYPES_H 1
+#endif
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* Define to 1 if you have the `usleep' function. */
+#if defined(PJ_HAS_UNISTD_H) && PJ_HAS_UNISTD_H!=0
+#   define HAVE_UNISTD_H    1
+#   define HAVE_USLEEP	    1
+#endif
+
+
+/* Define to 1 if you have the <windows.h> header file. */
+#if defined(PJ_WIN32) && PJ_WIN32!=0
+#   define HAVE_WINDOWS_H   1
+#endif
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0
+#   define HAVE_WINSOCK2_H  1
+#endif
+
+#define HAVE_INT16_T	    1
+#define HAVE_INT32_T	    1
+#define HAVE_INT8_T	    1
+#define HAVE_UINT8_T	    1
+#define HAVE_UINT16_T	    1
+#define HAVE_UINT32_T	    1
+#define HAVE_UINT64_T	    1
+
+typedef pj_uint8_t	    uint8_t;
+typedef pj_uint16_t	    uint16_t;
+typedef pj_uint32_t	    uint32_t;
+typedef pj_uint64_t	    uint64_t;
+typedef pj_int8_t	    int8_t;
+typedef pj_int16_t	    int16_t;
+typedef pj_int32_t	    int32_t;
+typedef pj_int64_t	    int64_t;
+
+#define SIZEOF_UNSIGNED_LONG	    (sizeof(unsigned long))
+#define SIZEOF_UNSIGNED_LONG_LONG   8
+
+
+#if (_MSC_VER >= 1400) // VC8+
+#   ifndef _CRT_SECURE_NO_DEPRECATE
+#	define _CRT_SECURE_NO_DEPRECATE
+#   endif
+#   ifndef _CRT_NONSTDC_NO_DEPRECATE
+#	define _CRT_NONSTDC_NO_DEPRECATE
+#   endif
+#endif // VC8+
+
+#ifdef _MSC_VER
+#   ifndef __cplusplus
+#	define inline _inline
+#   endif
+
+#   pragma warning(disable:4311)
+#   pragma warning(disable:4761) // integral mismatch
+#   pragma warning(disable:4018) // signed/unsigned mismatch
+#   pragma warning(disable:4244) // conversion from int64 to int
+#endif
+
+
+/* Path to random device */
+/* #define DEV_URANDOM "/dev/urandom" */
+
+/* We have overridden libsrtp error mechanism, so these are not used. */
+/* #undef ERR_REPORTING_FILE */
+/* #undef ERR_REPORTING_STDOUT */
+/* #undef USE_ERR_REPORTING_FILE */
+/* #undef USE_SYSLOG */
+/* #undef HAVE_SYSLOG_H */
+
+
+/* Define this to use ISMAcryp code. */
+/* #undef GENERIC_AESICM */
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 /* #undef HAVE_INTTYPES_H */
+
+/* Define to 1 if you have the `socket' function. */
+/* #undef HAVE_SOCKET */
 
 /* Define to 1 if you have the `socket' library (-lsocket). */
@@ -60,106 +160,12 @@
 /* #undef HAVE_MACHINE_TYPES_H */
 
-/* Define to 1 if you have the <memory.h> header file. */
-//#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#ifdef PJ_HAS_NETINET_IN_H
-#   define HAVE_NETINET_IN_H	1
-#endif
-
-/* Define to 1 if you have the `socket' function. */
-/* #undef HAVE_SOCKET */
-
 /* Define to 1 if you have the <stdint.h> header file. */
 /* #undef HAVE_STDINT_H */
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#ifdef PJ_HAS_STDLIB_H
-#   define HAVE_STDLIB_H 1
-#endif
 
 /* Define to 1 if you have the <strings.h> header file. */
 //#define HAVE_STRINGS_H 1
 
-/* Define to 1 if you have the <string.h> header file. */
-#ifdef PJ_HAS_STRING_H
-#   define HAVE_STRING_H 1
-#endif
-
-/* Define to 1 if you have the <syslog.h> header file. */
-/* #undef HAVE_SYSLOG_H */
-
 /* Define to 1 if you have the <sys/int_types.h> header file. */
 /* #undef HAVE_SYS_INT_TYPES_H */
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#ifdef PJ_HAS_SYS_SOCKET_H
-#   define HAVE_SYS_SOCKET_H	1
-#endif
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-//#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#ifdef PJ_HAS_SYS_TYPES_H
-#   define HAVE_SYS_TYPES_H 1
-#endif
-
-/* Define to 1 if you have the <sys/uio.h> header file. */
-/* #undef HAVE_SYS_UIO_H */
-
-/* Define to 1 if the system has the type `uint8_t'. */
-#define HAVE_UINT8_T 1
-
-/* Define to 1 if the system has the type `uint16_t'. */
-#define HAVE_UINT16_T 1
-
-/* Define to 1 if the system has the type `uint32_t'. */
-#define HAVE_UINT32_T 1
-
-/* Define to 1 if the system has the type `uint64_t'. */
-#define HAVE_UINT64_T 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-/* Define to 1 if you have the `usleep' function. */
-#ifdef PJ_HAS_UNISTD_H
-#   define HAVE_UNISTD_H    1
-#   define HAVE_USLEEP	    1
-#endif
-
-
-/* Define to 1 if you have the <windows.h> header file. */
-#if defined(PJ_WIN32) && PJ_WIN32!=0
-#   define HAVE_WINDOWS_H 1
-#endif
-
-/* Define to 1 if you have the <winsock2.h> header file. */
-#ifdef PJ_HAS_WINSOCK2_H 
-#   define HAVE_WINSOCK2_H 1
-#endif
-
-/* Define to use X86 inlined assembly code */
-/* #undef HAVE_X86 */
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME ""
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING ""
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION ""
-
-/* The size of a `unsigned long', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_LONG (sizeof(unsigned long))
-
-/* The size of a `unsigned long long', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_LONG_LONG 8
 
 /* Define to use GDOI. */
@@ -175,12 +181,5 @@
 //#define STDC_HEADERS 1
 
-/* Write errors to this file */
-/* #undef USE_ERR_REPORTING_FILE */
-
-/* Define to use syslog logging. */
-/* #undef USE_SYSLOG */
-
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
+/* Endianness would have been set by pjlib. */
 /* #undef WORDS_BIGENDIAN */
 
@@ -188,38 +187,8 @@
 /* #undef const */
 
-/* MSVC does't have "inline" */
-#if defined(_MSC_VER)
-#   define inline _inline
-#endif
-
 /* Define to `unsigned' if <sys/types.h> does not define. */
 /* #undef size_t */
 
-#if (_MSC_VER >= 1400) // VC8+
-#   ifndef _CRT_SECURE_NO_DEPRECATE
-#	define _CRT_SECURE_NO_DEPRECATE
-#   endif
-#   ifndef _CRT_NONSTDC_NO_DEPRECATE
-#	define _CRT_NONSTDC_NO_DEPRECATE
-#   endif
-#endif // VC8+
 
-#ifndef int_types_defined
-    typedef pj_uint8_t	uint8_t;
-    typedef pj_uint16_t	uint16_t;
-    typedef pj_uint32_t uint32_t;
-    typedef pj_uint64_t uint64_t;
-    typedef pj_int8_t	int8_t;
-    typedef pj_int16_t	int16_t;
-    typedef pj_int32_t	int32_t;
-    typedef pj_int64_t	int64_t;
-#   define int_types_defined
-#endif
+#endif	/* __SRTP_CONFIG_H__ */
 
-#ifdef _MSC_VER
-    #pragma warning(disable:4311)
-    #pragma warning(disable:4761) // integral mismatch
-    #pragma warning(disable:4018) // signed/unsigned mismatch
-    #pragma warning(disable:4244) // conversion from int64 to int
-#endif
-
Index: pjproject/branches/users/nanang/third_party/srtp/pjlib/srtp_err.c
===================================================================
--- pjproject/branches/users/nanang/third_party/srtp/pjlib/srtp_err.c	(revision 1719)
+++ pjproject/branches/users/nanang/third_party/srtp/pjlib/srtp_err.c	(revision 1719)
@@ -0,0 +1,47 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#include "err.h"
+#include <pj/log.h>
+
+/* Redirect libsrtp error to PJ_LOG */
+
+err_reporting_level_t err_level = err_level_none;
+
+err_status_t
+err_reporting_init(char *ident) {
+    return err_status_ok;
+}
+
+void
+err_report(int priority, char *format, ...) {
+  va_list args;
+
+  if (priority <= err_level) {
+
+    va_start(args, format);
+    pj_log("libsrtp", priority, format, args);
+    va_end(args);
+  }
+}
+
+void
+err_reporting_set_level(err_reporting_level_t lvl) { 
+  err_level = lvl;
+}
+
