Changeset 1719
- Timestamp:
- Jan 20, 2008 2:28:26 PM (15 years ago)
- Location:
- pjproject/branches/users/nanang
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/users/nanang/build.mak.in
r1573 r1719 9 9 10 10 # Determine which party libraries to use 11 export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lmilenage-$(TARGET_NAME) 11 export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lmilenage-$(TARGET_NAME) -lsrtp-$(TARGET_NAME) 12 12 13 13 ifneq (@ac_no_gsm_codec@,1) -
pjproject/branches/users/nanang/pjsip-apps/src/pjsua/pjsua_app.c
r1709 r1719 474 474 pjsua_acc_config *cur_acc; 475 475 char *config_file = NULL; 476 int use_srtp = -1; 476 477 unsigned i; 477 478 … … 800 801 801 802 case OPT_USE_SRTP: 802 i= my_atoi(pj_optarg);803 if (!pj_isdigit(*pj_optarg) || i> 2) {803 use_srtp = my_atoi(pj_optarg); 804 if (!pj_isdigit(*pj_optarg) || use_srtp > 2) { 804 805 PJ_LOG(1,(THIS_FILE, "Invalid value for --use-srtp option")); 805 806 return -1; 806 807 } 807 cur_acc->use_srtp = i;808 808 break; 809 809 … … 1038 1038 for (i=0; i<cfg->acc_cnt; ++i) { 1039 1039 pjsua_acc_config *acfg = &cfg->acc_cfg[i]; 1040 1041 acfg->use_srtp = (pjmedia_srtp_use) use_srtp; 1040 1042 1041 1043 if (acfg->cred_info[acfg->cred_count].username.slen) -
pjproject/branches/users/nanang/pjsip/src/pjsua-lib/pjsua_media.c
r1709 r1719 751 751 pjsua_call *call = &pjsua_var.calls[call_id]; 752 752 pjsua_acc *acc = &pjsua_var.acc[call->acc_id]; 753 pjmedia_srtp_use use_srtp; 753 pjmedia_srtp_setting srtp_opt; 754 pjmedia_transport *srtp; 755 pj_status_t status; 754 756 755 757 PJ_UNUSED_ARG(role); … … 764 766 /* Stop media transport (for good measure!) */ 765 767 pjmedia_transport_media_stop(call->med_tp); 766 767 /* See if we need to use SRTP */ 768 use_srtp = acc->cfg.use_srtp; 769 if (use_srtp != PJMEDIA_SRTP_DISABLED) { 770 pj_status_t status; 771 pjmedia_transport *srtp; 772 768 769 /* Check if SRTP requires secure signaling */ 770 if (acc->cfg.use_srtp != PJMEDIA_SRTP_DISABLED) { 773 771 if (security_level < acc->cfg.srtp_secure_signaling) { 774 772 return PJSIP_ESESSIONINSECURE; 775 773 } 776 777 /* Create SRTP */ 778 status = pjmedia_transport_srtp_create(pjsua_var.med_endpt, 779 call->med_tp, 780 NULL, &srtp); 781 if (status != PJ_SUCCESS) 782 return status; 783 784 /* Set SRTP as current media transport */ 785 call->med_tp = srtp; 786 } 774 } 775 776 /* Always create SRTP adapter */ 777 pjmedia_srtp_setting_default(&srtp_opt); 778 srtp_opt.close_member_tp = PJ_FALSE; 779 status = pjmedia_transport_srtp_create(pjsua_var.med_endpt, 780 call->med_tp, 781 &srtp_opt, &srtp); 782 if (status != PJ_SUCCESS) 783 return status; 784 785 /* Set SRTP as current media transport */ 786 call->med_orig = call->med_tp; 787 call->med_tp = srtp; 787 788 788 789 return PJ_SUCCESS; -
pjproject/branches/users/nanang/third_party/build/srtp/Makefile
r1718 r1719 37 37 rng = crypto/rng/rand_source.o crypto/rng/prng.o crypto/rng/ctr_prng.o 38 38 39 err = crypto/kernel/err.o39 err = pjlib/srtp_err.o 40 40 41 41 kernel = crypto/kernel/crypto_kernel.o crypto/kernel/alloc.o \ -
pjproject/branches/users/nanang/third_party/build/srtp/libsrtp.dsp
r1699 r1719 43 43 F90=df.exe 44 44 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c 45 # 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 /c45 # 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 46 46 # ADD BASE RSC /l 0x409 /d "NDEBUG" 47 47 # ADD RSC /l 0x409 /d "NDEBUG" … … 67 67 F90=df.exe 68 68 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c 69 # 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 /c69 # 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 70 70 # ADD BASE RSC /l 0x409 /d "_DEBUG" 71 71 # ADD RSC /l 0x409 /d "_DEBUG" … … 90 90 SOURCE=..\..\srtp\srtp\srtp.c 91 91 # End Source File 92 # Begin Source File 93 94 SOURCE=..\..\srtp\pjlib\srtp_err.c 95 # End Source File 92 96 # End Group 93 97 # Begin Group "Header Files" … … 96 100 # Begin Source File 97 101 98 SOURCE=.\config.h99 # End Source File100 # Begin Source File101 102 102 SOURCE=..\..\srtp\include\rtp.h 103 103 # End Source File … … 108 108 # Begin Source File 109 109 110 SOURCE=.\srtp_config.h 111 # End Source File 112 # Begin Source File 113 110 114 SOURCE=..\..\srtp\include\ut_sim.h 111 115 # End Source File … … 291 295 # Begin Source File 292 296 293 SOURCE=..\..\srtp\crypto\kernel\err.c294 # End Source File295 # Begin Source File296 297 297 SOURCE=..\..\srtp\crypto\kernel\key.c 298 298 # End Source File … … 325 325 SOURCE=..\..\srtp\crypto\replay\rdbx.c 326 326 # End Source File 327 # Begin Source File328 329 SOURCE=..\..\srtp\crypto\replay\ut_sim.c330 # End Source File331 327 # End Group 332 328 # Begin Group "rng" … … 346 342 # End Source File 347 343 # End Group 348 # End Group349 # Begin Group "tables"350 351 # PROP Default_Filter ""352 # Begin Source File353 354 SOURCE=..\..\srtp\tables\aes_tables.c355 # End Source File356 344 # End Group 357 345 # End Target -
pjproject/branches/users/nanang/third_party/build/srtp/libsrtp.vcproj
r1699 r1719 41 41 Name="VCCLCompilerTool" 42 42 Optimization="0" 43 AdditionalIncludeDirectories=".,../../srtp/include,../../srtp/crypto/include "43 AdditionalIncludeDirectories=".,../../srtp/include,../../srtp/crypto/include,../../../pjlib/include" 44 44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB" 45 45 MinimalRebuild="true" … … 105 105 <Tool 106 106 Name="VCCLCompilerTool" 107 AdditionalIncludeDirectories=".,../../srtp/include,../../srtp/crypto/include "107 AdditionalIncludeDirectories=".,../../srtp/include,../../srtp/crypto/include,../../../pjlib/include" 108 108 PreprocessorDefinitions="WIN32;NDEBUG;_LIB" 109 109 RuntimeLibrary="2" … … 155 155 > 156 156 </File> 157 <File 158 RelativePath="..\..\srtp\pjlib\srtp_err.c" 159 > 160 </File> 157 161 </Filter> 158 162 <Filter … … 162 166 > 163 167 <File 164 RelativePath=".\config.h"165 >166 </File>167 <File168 168 RelativePath="..\..\srtp\include\rtp.h" 169 169 > … … 171 171 <File 172 172 RelativePath="..\..\srtp\include\srtp.h" 173 > 174 </File> 175 <File 176 RelativePath=".\srtp_config.h" 173 177 > 174 178 </File> … … 245 249 </File> 246 250 <File 247 RelativePath="..\..\srtp\crypto\kernel\err.c"248 >249 </File>250 <File251 251 RelativePath="..\..\srtp\crypto\kernel\key.c" 252 252 > … … 278 278 <File 279 279 RelativePath="..\..\srtp\crypto\replay\rdbx.c" 280 >281 </File>282 <File283 RelativePath="..\..\srtp\crypto\replay\ut_sim.c"284 280 > 285 281 </File> -
pjproject/branches/users/nanang/third_party/build/srtp/srtp_config.h
r1718 r1719 1 /* $Id$ */ 2 /* 3 * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 */ 19 #ifndef __SRTP_CONFIG_H__ 20 #define __SRTP_CONFIG_H__ 21 1 22 #include <pj/types.h> 2 23 3 /* Define if building for a CISC machine (e.g. Intel). */ 4 /* #define CPU_CISC 1 */ 5 6 /* Define if building for a RISC machine (assume slow byte access). */ 7 /* #undef CPU_RISC */ 8 9 /* PJLIB can't detect CISC vs RISC CPU, so we'll just say RISC here */ 10 #if defined(PJ_WIN32) && PJ_WIN32!=0 11 # define CPU_CISC 1 24 /* We'll just define CISC if it's x86 family */ 25 #if (defined(PJ_M_I386) && PJ_M_I386!=0) || \ 26 (defined(PJ_M_X86_64) && PJ_M_X86_64!=0) || \ 27 (defined(PJ_M_IA64) && PJ_M_IA64!=0) 28 # define CPU_CISC 1 29 # define HAVE_X86 1 /* use X86 inlined assembly code */ 12 30 #else 13 # define CPU_RISC 131 # define CPU_RISC 1 14 32 #endif 15 33 16 /* Path to random device */17 /* #define DEV_URANDOM "/dev/urandom" */18 19 34 /* Define to compile in dynamic debugging system. */ 20 #define ENABLE_DEBUGGING 1 21 22 /* Report errors to this file. */ 23 /* #undef ERR_REPORTING_FILE */ 24 25 /* Define to use logging to stdout. */ 26 //#define ERR_REPORTING_STDOUT 1 27 28 /* Define this to use ISMAcryp code. */ 29 /* #undef GENERIC_AESICM */ 35 #define ENABLE_DEBUGGING PJ_DEBUG 30 36 31 37 /* Define to 1 if you have the <arpa/inet.h> header file. */ 32 #if def PJ_HAS_ARPA_INET_H38 #if defined(PJ_HAS_ARPA_INET_H) && PJ_HAS_ARPA_INET_H!=0 33 39 # define HAVE_ARPA_INET_H 1 34 40 #endif … … 38 44 39 45 /* Define to 1 if you have the `inet_aton' function. */ 40 #if defPJ_SOCK_HAS_INET_PTON46 #if defined(PJ_SOCK_HAS_INET_PTON) && PJ_SOCK_HAS_INET_PTON 41 47 # define HAVE_INET_ATON 1 42 48 #endif 43 49 44 /* Define to 1 if the system has the type `int16_t'. */45 #define HAVE_INT16_T 146 50 47 /* Define to 1 if the system has the type `int32_t'. */ 48 #define HAVE_INT32_T 1 51 /* Define to 1 if you have the <netinet/in.h> header file. */ 52 #if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H!=0 53 # define HAVE_NETINET_IN_H 1 54 #endif 49 55 50 /* Define to 1 if the system has the type `int8_t'. */ 51 #define HAVE_INT8_T 1 56 /* Define to 1 if you have the <stdlib.h> header file. */ 57 #if defined(PJ_HAS_STDLIB_H) && PJ_HAS_STDLIB_H!=0 58 # define HAVE_STDLIB_H 1 59 #endif 60 61 /* Define to 1 if you have the <string.h> header file. */ 62 #if defined(PJ_HAS_STRING_H) && PJ_HAS_STRING_H!=0 63 # define HAVE_STRING_H 1 64 #endif 65 66 /* Define to 1 if you have the <sys/socket.h> header file. */ 67 #if defined(PJ_HAS_SYS_SOCKET_H) && PJ_HAS_SYS_SOCKET_H!=0 68 # define HAVE_SYS_SOCKET_H 1 69 #endif 70 71 /* Define to 1 if you have the <sys/types.h> header file. */ 72 #if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H!=0 73 # define HAVE_SYS_TYPES_H 1 74 #endif 75 76 /* Define to 1 if you have the <unistd.h> header file. */ 77 /* Define to 1 if you have the `usleep' function. */ 78 #if defined(PJ_HAS_UNISTD_H) && PJ_HAS_UNISTD_H!=0 79 # define HAVE_UNISTD_H 1 80 # define HAVE_USLEEP 1 81 #endif 82 83 84 /* Define to 1 if you have the <windows.h> header file. */ 85 #if defined(PJ_WIN32) && PJ_WIN32!=0 86 # define HAVE_WINDOWS_H 1 87 #endif 88 89 /* Define to 1 if you have the <winsock2.h> header file. */ 90 #if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0 91 # define HAVE_WINSOCK2_H 1 92 #endif 93 94 #define HAVE_INT16_T 1 95 #define HAVE_INT32_T 1 96 #define HAVE_INT8_T 1 97 #define HAVE_UINT8_T 1 98 #define HAVE_UINT16_T 1 99 #define HAVE_UINT32_T 1 100 #define HAVE_UINT64_T 1 101 102 typedef pj_uint8_t uint8_t; 103 typedef pj_uint16_t uint16_t; 104 typedef pj_uint32_t uint32_t; 105 typedef pj_uint64_t uint64_t; 106 typedef pj_int8_t int8_t; 107 typedef pj_int16_t int16_t; 108 typedef pj_int32_t int32_t; 109 typedef pj_int64_t int64_t; 110 111 #define SIZEOF_UNSIGNED_LONG (sizeof(unsigned long)) 112 #define SIZEOF_UNSIGNED_LONG_LONG 8 113 114 115 #if (_MSC_VER >= 1400) // VC8+ 116 # ifndef _CRT_SECURE_NO_DEPRECATE 117 # define _CRT_SECURE_NO_DEPRECATE 118 # endif 119 # ifndef _CRT_NONSTDC_NO_DEPRECATE 120 # define _CRT_NONSTDC_NO_DEPRECATE 121 # endif 122 #endif // VC8+ 123 124 #ifdef _MSC_VER 125 # ifndef __cplusplus 126 # define inline _inline 127 # endif 128 129 # pragma warning(disable:4311) 130 # pragma warning(disable:4761) // integral mismatch 131 # pragma warning(disable:4018) // signed/unsigned mismatch 132 # pragma warning(disable:4244) // conversion from int64 to int 133 #endif 134 135 136 /* Path to random device */ 137 /* #define DEV_URANDOM "/dev/urandom" */ 138 139 /* We have overridden libsrtp error mechanism, so these are not used. */ 140 /* #undef ERR_REPORTING_FILE */ 141 /* #undef ERR_REPORTING_STDOUT */ 142 /* #undef USE_ERR_REPORTING_FILE */ 143 /* #undef USE_SYSLOG */ 144 /* #undef HAVE_SYSLOG_H */ 145 146 147 /* Define this to use ISMAcryp code. */ 148 /* #undef GENERIC_AESICM */ 52 149 53 150 /* Define to 1 if you have the <inttypes.h> header file. */ 54 151 /* #undef HAVE_INTTYPES_H */ 152 153 /* Define to 1 if you have the `socket' function. */ 154 /* #undef HAVE_SOCKET */ 55 155 56 156 /* Define to 1 if you have the `socket' library (-lsocket). */ … … 60 160 /* #undef HAVE_MACHINE_TYPES_H */ 61 161 62 /* Define to 1 if you have the <memory.h> header file. */63 //#define HAVE_MEMORY_H 164 65 /* Define to 1 if you have the <netinet/in.h> header file. */66 #ifdef PJ_HAS_NETINET_IN_H67 # define HAVE_NETINET_IN_H 168 #endif69 70 /* Define to 1 if you have the `socket' function. */71 /* #undef HAVE_SOCKET */72 73 162 /* Define to 1 if you have the <stdint.h> header file. */ 74 163 /* #undef HAVE_STDINT_H */ 75 76 /* Define to 1 if you have the <stdlib.h> header file. */77 #ifdef PJ_HAS_STDLIB_H78 # define HAVE_STDLIB_H 179 #endif80 164 81 165 /* Define to 1 if you have the <strings.h> header file. */ 82 166 //#define HAVE_STRINGS_H 1 83 167 84 /* Define to 1 if you have the <string.h> header file. */85 #ifdef PJ_HAS_STRING_H86 # define HAVE_STRING_H 187 #endif88 89 /* Define to 1 if you have the <syslog.h> header file. */90 /* #undef HAVE_SYSLOG_H */91 92 168 /* Define to 1 if you have the <sys/int_types.h> header file. */ 93 169 /* #undef HAVE_SYS_INT_TYPES_H */ 94 95 /* Define to 1 if you have the <sys/socket.h> header file. */96 #ifdef PJ_HAS_SYS_SOCKET_H97 # define HAVE_SYS_SOCKET_H 198 #endif99 100 /* Define to 1 if you have the <sys/stat.h> header file. */101 //#define HAVE_SYS_STAT_H 1102 103 /* Define to 1 if you have the <sys/types.h> header file. */104 #ifdef PJ_HAS_SYS_TYPES_H105 # define HAVE_SYS_TYPES_H 1106 #endif107 108 /* Define to 1 if you have the <sys/uio.h> header file. */109 /* #undef HAVE_SYS_UIO_H */110 111 /* Define to 1 if the system has the type `uint8_t'. */112 #define HAVE_UINT8_T 1113 114 /* Define to 1 if the system has the type `uint16_t'. */115 #define HAVE_UINT16_T 1116 117 /* Define to 1 if the system has the type `uint32_t'. */118 #define HAVE_UINT32_T 1119 120 /* Define to 1 if the system has the type `uint64_t'. */121 #define HAVE_UINT64_T 1122 123 /* Define to 1 if you have the <unistd.h> header file. */124 /* Define to 1 if you have the `usleep' function. */125 #ifdef PJ_HAS_UNISTD_H126 # define HAVE_UNISTD_H 1127 # define HAVE_USLEEP 1128 #endif129 130 131 /* Define to 1 if you have the <windows.h> header file. */132 #if defined(PJ_WIN32) && PJ_WIN32!=0133 # define HAVE_WINDOWS_H 1134 #endif135 136 /* Define to 1 if you have the <winsock2.h> header file. */137 #ifdef PJ_HAS_WINSOCK2_H138 # define HAVE_WINSOCK2_H 1139 #endif140 141 /* Define to use X86 inlined assembly code */142 /* #undef HAVE_X86 */143 144 /* Define to the address where bug reports for this package should be sent. */145 #define PACKAGE_BUGREPORT ""146 147 /* Define to the full name of this package. */148 #define PACKAGE_NAME ""149 150 /* Define to the full name and version of this package. */151 #define PACKAGE_STRING ""152 153 /* Define to the one symbol short name of this package. */154 #define PACKAGE_TARNAME ""155 156 /* Define to the version of this package. */157 #define PACKAGE_VERSION ""158 159 /* The size of a `unsigned long', as computed by sizeof. */160 #define SIZEOF_UNSIGNED_LONG (sizeof(unsigned long))161 162 /* The size of a `unsigned long long', as computed by sizeof. */163 #define SIZEOF_UNSIGNED_LONG_LONG 8164 170 165 171 /* Define to use GDOI. */ … … 175 181 //#define STDC_HEADERS 1 176 182 177 /* Write errors to this file */ 178 /* #undef USE_ERR_REPORTING_FILE */ 179 180 /* Define to use syslog logging. */ 181 /* #undef USE_SYSLOG */ 182 183 /* Define to 1 if your processor stores words with the most significant byte 184 first (like Motorola and SPARC, unlike Intel and VAX). */ 183 /* Endianness would have been set by pjlib. */ 185 184 /* #undef WORDS_BIGENDIAN */ 186 185 … … 188 187 /* #undef const */ 189 188 190 /* MSVC does't have "inline" */191 #if defined(_MSC_VER)192 # define inline _inline193 #endif194 195 189 /* Define to `unsigned' if <sys/types.h> does not define. */ 196 190 /* #undef size_t */ 197 191 198 #if (_MSC_VER >= 1400) // VC8+199 # ifndef _CRT_SECURE_NO_DEPRECATE200 # define _CRT_SECURE_NO_DEPRECATE201 # endif202 # ifndef _CRT_NONSTDC_NO_DEPRECATE203 # define _CRT_NONSTDC_NO_DEPRECATE204 # endif205 #endif // VC8+206 192 207 #ifndef int_types_defined 208 typedef pj_uint8_t uint8_t; 209 typedef pj_uint16_t uint16_t; 210 typedef pj_uint32_t uint32_t; 211 typedef pj_uint64_t uint64_t; 212 typedef pj_int8_t int8_t; 213 typedef pj_int16_t int16_t; 214 typedef pj_int32_t int32_t; 215 typedef pj_int64_t int64_t; 216 # define int_types_defined 217 #endif 193 #endif /* __SRTP_CONFIG_H__ */ 218 194 219 #ifdef _MSC_VER220 #pragma warning(disable:4311)221 #pragma warning(disable:4761) // integral mismatch222 #pragma warning(disable:4018) // signed/unsigned mismatch223 #pragma warning(disable:4244) // conversion from int64 to int224 #endif225
Note: See TracChangeset
for help on using the changeset viewer.