Changeset 1735
- Timestamp:
- Jan 23, 2008 8:39:07 PM (17 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 25 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/build.mak.in
r1573 r1735 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/trunk/pjmedia/build/Makefile
r1664 r1735 3 3 THIRD_PARTY:=$(PJDIR)/third_party 4 4 PA_DIR := $(THIRD_PARTY)/build/portaudio/src 5 6 SRTP_INC=$(CC_INC)$(THIRD_PARTY)/build/srtp \ 7 $(CC_INC)$(THIRD_PARTY)/srtp/crypto/include \ 8 $(CC_INC)$(THIRD_PARTY)/srtp/include 5 9 6 10 include $(PJDIR)/build/common.mak … … 26 30 $(CC_INC)../../pjlib-util/include \ 27 31 $(CC_INC)../../pjnath/include \ 28 $(CC_INC)../.. 32 $(CC_INC)../.. \ 33 $(SRTP_INC) 29 34 export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ 30 35 $(HOST_CXXFLAGS) $(CXXFLAGS) … … 49 54 resample_port.o rtcp.o rtp.o sdp.o sdp_cmp.o sdp_neg.o \ 50 55 session.o silencedet.o sound_port.o stream.o \ 51 tonegen.o transport_ice.o transport_udp.o \ 56 tonegen.o transport_ice.o transport_srtp.o \ 57 transport_udp.o \ 52 58 wav_player.o wav_playlist.o wav_writer.o wave.o \ 53 59 $(SOUND_OBJS) $(NULLSOUND_OBJS) -
pjproject/trunk/pjmedia/build/pjmedia.dsp
r1664 r1735 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 /W4 /GX /Zi /O2 /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjnath/include" /I "../../third_party/portaudio/include" /I "../../third_party/speex/include" /I "../.. " /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /FR /FD /c45 # ADD CPP /nologo /MD /W4 /GX /Zi /O2 /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjnath/include" /I "../../third_party/portaudio/include" /I "../../third_party/speex/include" /I "../../third_party/build/srtp" /I "../../third_party/srtp/crypto/include" /I "../../third_party/srtp/include" /I "../.." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /FR /FD /c 46 46 # SUBTRACT CPP /YX 47 47 # ADD BASE RSC /l 0x409 /d "NDEBUG" … … 68 68 F90=df.exe 69 69 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c 70 # ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjnath/include" /I "../../third_party/portaudio/include" /I "../../third_party/speex/include" /I "../.. " /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /FR /FD /GZ /c70 # ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjnath/include" /I "../../third_party/portaudio/include" /I "../../third_party/speex/include" /I "../../third_party/build/srtp" /I "../../third_party/srtp/crypto/include" /I "../../third_party/srtp/include" /I "../.." /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /FR /FD /GZ /c 71 71 # SUBTRACT CPP /YX 72 72 # ADD BASE RSC /l 0x409 /d "_DEBUG" … … 250 250 # Begin Source File 251 251 252 SOURCE=..\src\pjmedia\transport_srtp.c 253 # End Source File 254 # Begin Source File 255 252 256 SOURCE=..\src\pjmedia\transport_udp.c 253 257 # End Source File … … 407 411 408 412 SOURCE=..\include\pjmedia\transport_ice.h 413 # End Source File 414 # Begin Source File 415 416 SOURCE=..\include\pjmedia\transport_srtp.h 409 417 # End Source File 410 418 # Begin Source File -
pjproject/trunk/pjmedia/build/pjmedia.vcproj
r1664 r1735 44 44 Optimization="2" 45 45 InlineFunctionExpansion="1" 46 AdditionalIncludeDirectories="../include ,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../.."46 AdditionalIncludeDirectories="../include;../../pjlib/include;"../../pjlib-util/include";../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../.." 47 47 PreprocessorDefinitions="NDEBUG;WIN32;_LIB;PJ_WIN32=1;PJ_M_I386=1" 48 48 StringPooling="true" … … 120 120 Name="VCCLCompilerTool" 121 121 Optimization="0" 122 AdditionalIncludeDirectories="../include ,../../pjlib/include,../../pjlib-util/include,../../pjnath/include,../../third_party/portaudio/include,../../third_party/speex/include,../.."122 AdditionalIncludeDirectories="../include;../../pjlib/include;"../../pjlib-util/include";../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../.." 123 123 PreprocessorDefinitions="_DEBUG;WIN32;_LIB;PJ_WIN32=1;PJ_M_I386=1" 124 124 MinimalRebuild="true" … … 967 967 </File> 968 968 <File 969 RelativePath="..\src\pjmedia\transport_srtp.c" 970 > 971 </File> 972 <File 969 973 RelativePath="..\src\pjmedia\transport_udp.c" 970 974 > … … 1218 1222 </File> 1219 1223 <File 1224 RelativePath="..\include\pjmedia\transport_srtp.h" 1225 > 1226 </File> 1227 <File 1220 1228 RelativePath="..\include\pjmedia\transport_udp.h" 1221 1229 > -
pjproject/trunk/pjmedia/include/pjmedia.h
r1177 r1735 55 55 #include <pjmedia/transport.h> 56 56 #include <pjmedia/transport_ice.h> 57 #include <pjmedia/transport_srtp.h> 57 58 #include <pjmedia/transport_udp.h> 58 59 #include <pjmedia/wav_playlist.h> -
pjproject/trunk/pjmedia/include/pjmedia/config.h
r1715 r1735 485 485 486 486 487 /** 488 * SRTP Transport 489 * By default it is enabled. 490 */ 491 #ifndef PJMEDIA_HAS_SRTP 492 # define PJMEDIA_HAS_SRTP 1 493 #endif 494 487 495 488 496 /** -
pjproject/trunk/pjmedia/include/pjmedia/errno.h
r1639 r1735 43 43 */ 44 44 #define PJMEDIA_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE) 45 #define PJMEDIA_ERRNO_END (PJMEDIA_ERRNO_START + PJ_ERRNO_SPACE_SIZE - 1) 45 46 46 47 … … 48 49 * Mapping from PortAudio error codes to pjmedia error space. 49 50 */ 50 #define PJMEDIA_PORTAUDIO_ERRNO_START (PJMEDIA_ERRNO_ START+PJ_ERRNO_SPACE_SIZE-1000)51 51 #define PJMEDIA_PORTAUDIO_ERRNO_START (PJMEDIA_ERRNO_END-10000) 52 #define PJMEDIA_PORTAUDIO_ERRNO_END (PJMEDIA_PORTAUDIO_ERRNO_START + 10000 -1) 52 53 /** 53 54 * Convert PortAudio error code to PJMEDIA error code. 54 */ 55 #define PJMEDIA_ERRNO_FROM_PORTAUDIO(err) (err+PJMEDIA_PORTAUDIO_ERRNO_START) 56 55 * PortAudio error code range: 0 >= err >= -10000 56 */ 57 #define PJMEDIA_ERRNO_FROM_PORTAUDIO(err) ((int)PJMEDIA_PORTAUDIO_ERRNO_START-err) 58 59 60 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 61 62 /** 63 * Mapping from LibSRTP error codes to pjmedia error space. 64 */ 65 #define PJMEDIA_LIBSRTP_ERRNO_START (PJMEDIA_ERRNO_END-10200) 66 #define PJMEDIA_LIBSRTP_ERRNO_END (PJMEDIA_LIBSRTP_ERRNO_START + 200 - 1) 67 /** 68 * Convert LibSRTP error code to PJMEDIA error code. 69 * LibSRTP error code range: 0 <= err < 200 70 */ 71 #define PJMEDIA_ERRNO_FROM_LIBSRTP(err) (PJMEDIA_LIBSRTP_ERRNO_START+err) 72 73 #endif 57 74 58 75 /************************************************************ … … 525 542 */ 526 543 #define PJMEDIA_ESNDINSAMPLEFMT (PJMEDIA_ERRNO_START+203) /* 220203 */ 544 545 546 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 547 /************************************************************ 548 * SRTP TRANSPORT ERRORS 549 ***********************************************************/ 550 /** 551 * @hideinitializer 552 * SRTP crypto-suite name not match the offerer tag. 553 */ 554 #define PJMEDIA_SRTP_ECRYPTONOTMATCH (PJMEDIA_ERRNO_START+220) /* 220220 */ 555 /** 556 * @hideinitializer 557 * Invalid SRTP key length for specific crypto. 558 */ 559 #define PJMEDIA_SRTP_EINKEYLEN (PJMEDIA_ERRNO_START+221) /* 220221 */ 560 /** 561 * @hideinitializer 562 * Unsupported SRTP crypto-suite. 563 */ 564 #define PJMEDIA_SRTP_ENOTSUPCRYPTO (PJMEDIA_ERRNO_START+222) /* 220222 */ 565 /** 566 * @hideinitializer 567 * SRTP SDP contains ambigue answer. 568 */ 569 #define PJMEDIA_SRTP_ESDPAMBIGUEANS (PJMEDIA_ERRNO_START+223) /* 220223 */ 570 /** 571 * @hideinitializer 572 * Duplicated crypto tag. 573 */ 574 #define PJMEDIA_SRTP_ESDPDUPCRYPTOTAG (PJMEDIA_ERRNO_START+224) /* 220224 */ 575 /** 576 * @hideinitializer 577 * Invalid crypto attribute. 578 */ 579 #define PJMEDIA_SRTP_ESDPINCRYPTO (PJMEDIA_ERRNO_START+225) /* 220225 */ 580 /** 581 * @hideinitializer 582 * Invalid crypto tag. 583 */ 584 #define PJMEDIA_SRTP_ESDPINCRYPTOTAG (PJMEDIA_ERRNO_START+226) /* 220226 */ 585 /** 586 * @hideinitializer 587 * Invalid SDP media transport for SRTP. 588 */ 589 #define PJMEDIA_SRTP_ESDPINTRANSPORT (PJMEDIA_ERRNO_START+227) /* 220227 */ 590 /** 591 * @hideinitializer 592 * SRTP crypto attribute required in SDP. 593 */ 594 #define PJMEDIA_SRTP_ESDPREQCRYPTO (PJMEDIA_ERRNO_START+228) /* 220228 */ 595 /** 596 * @hideinitializer 597 * Secure transport required in SDP media descriptor. 598 */ 599 #define PJMEDIA_SRTP_ESDPREQSECTP (PJMEDIA_ERRNO_START+229) /* 220229 */ 600 601 #endif /* PJMEDIA_HAS_SRTP */ 527 602 528 603 -
pjproject/trunk/pjmedia/include/pjmedia/transport.h
r1098 r1735 167 167 PJ_BEGIN_DECL 168 168 169 #include <pjmedia/sdp.h> 169 170 170 171 /* … … 243 244 const void *pkt, 244 245 pj_size_t size); 246 247 /** 248 * This function is called by application to generate the SDP parts 249 * related to transport type, e.g: ICE, SRTP. 250 * 251 * Application should call #pjmedia_transport_media_create() instead of 252 * calling this function directly. 253 */ 254 pj_status_t (*media_create)(pjmedia_transport *tp, 255 pj_pool_t *pool, 256 pjmedia_sdp_session *sdp_local, 257 const pjmedia_sdp_session *sdp_remote, 258 unsigned media_index); 259 260 /** 261 * This function is called by application to start the transport 262 * based on SDP negotiation result. 263 * 264 * Application should call #pjmedia_transport_media_start() instead of 265 * calling this function directly. 266 */ 267 pj_status_t (*media_start) (pjmedia_transport *tp, 268 pj_pool_t *pool, 269 pjmedia_sdp_session *sdp_local, 270 const pjmedia_sdp_session *sdp_remote, 271 unsigned media_index); 272 273 /** 274 * This function is called by application to stop the transport. 275 * 276 * Application should call #pjmedia_transport_media_stop() instead of 277 * calling this function directly. 278 */ 279 pj_status_t (*media_stop) (pjmedia_transport *tp); 280 281 /** 282 * This function can be called to simulate packet lost. 283 * 284 * Application should call #pjmedia_transport_simulate_lost() instead of 285 * calling this function directly. 286 */ 287 pj_status_t (*simulate_lost)(pjmedia_transport *tp, 288 pjmedia_dir dir, 289 unsigned pct_lost); 245 290 246 291 /** … … 411 456 412 457 /** 458 * Generate local SDP parts that are related to the specified media transport. 459 * Remote SDP might be needed as reference when application is in deciding 460 * side of negotiation (callee side), otherwise it should be NULL. 461 * This is just a simple wrapper which calls <tt>media_create()</tt> member 462 * of the transport. 463 * 464 * @param tp The media transport. 465 * @param pool The memory pool. 466 * @param sdp_local Local SDP. 467 * @param sdp_remote Remote SDP. 468 * 469 * @return PJ_SUCCESS on success, or the appropriate error code. 470 */ 471 PJ_INLINE(pj_status_t) pjmedia_transport_media_create(pjmedia_transport *tp, 472 pj_pool_t *pool, 473 pjmedia_sdp_session *sdp_local, 474 const pjmedia_sdp_session *sdp_remote, 475 unsigned media_index) 476 { 477 return (*tp->op->media_create)(tp, pool, sdp_local, sdp_remote, 478 media_index); 479 } 480 481 /** 482 * Start the transport with regards to SDP negotiation result. 483 * This is just a simple wrapper which calls <tt>media_start()</tt> member 484 * of the transport. 485 * 486 * @param tp The media transport. 487 * @param pool The memory pool. 488 * @param sdp_local Local SDP. 489 * @param sdp_remote Remote SDP. 490 * @param media_index Media index to start. 491 * 492 * @return PJ_SUCCESS on success, or the appropriate error code. 493 */ 494 PJ_INLINE(pj_status_t) pjmedia_transport_media_start(pjmedia_transport *tp, 495 pj_pool_t *pool, 496 pjmedia_sdp_session *sdp_local, 497 const pjmedia_sdp_session *sdp_remote, 498 unsigned media_index) 499 { 500 return (*tp->op->media_start)(tp, pool, sdp_local, sdp_remote, media_index); 501 } 502 503 504 /** 505 * Stop the transport. 506 * This is just a simple wrapper which calls <tt>media_stop()</tt> member 507 * of the transport. 508 * 509 * @param tp The media transport. 510 * 511 * @return PJ_SUCCESS on success, or the appropriate error code. 512 */ 513 PJ_INLINE(pj_status_t) pjmedia_transport_media_stop(pjmedia_transport *tp) 514 { 515 return (*tp->op->media_stop)(tp); 516 } 517 518 /** 413 519 * Close media transport. This is just a simple wrapper which calls 414 520 * <tt>destroy()</tt> member of the transport. This function will free … … 427 533 } 428 534 535 /** 536 * Simulate packet lost in the specified direction (for testing purposes). 537 * When enabled, the transport will randomly drop packets to the specified 538 * direction. 539 * 540 * @param tp The media transport. 541 * @param dir Media direction to which packets will be randomly dropped. 542 * @param pct_lost Percent lost (0-100). Set to zero to disable packet 543 * lost simulation. 544 * 545 * @return PJ_SUCCESS on success. 546 */ 547 PJ_INLINE(pj_status_t) pjmedia_transport_simulate_lost(pjmedia_transport *tp, 548 pjmedia_dir dir, 549 unsigned pct_lost) 550 { 551 return (*tp->op->simulate_lost)(tp, dir, pct_lost); 552 } 553 429 554 430 555 PJ_END_DECL -
pjproject/trunk/pjmedia/include/pjmedia/transport_ice.h
r1436 r1735 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __ pjmedia_ice_H__20 #define __ pjmedia_ice_H__19 #ifndef __PJMEDIA_TRANSPORT_ICE_H__ 20 #define __PJMEDIA_TRANSPORT_ICE_H__ 21 21 22 22 … … 75 75 const pjmedia_ice_cb *cb, 76 76 pjmedia_transport **p_tp); 77 78 /**79 * Destroy the media transport.80 *81 * @param tp The media transport.82 *83 * @return PJ_SUCCESS.84 */85 PJ_DECL(pj_status_t) pjmedia_ice_destroy(pjmedia_transport *tp);86 77 87 78 … … 170 161 const pj_str_t *local_passwd); 171 162 172 /**173 * Modify the SDP to add ICE specific SDP attributes before sending174 * the SDP to remote host.175 *176 * @param tp The media transport.177 * @param pool Pool to allocate memory for the SDP elements.178 * @param sdp The SDP descriptor to be modified.179 *180 * @return PJ_SUCCESS, or the appropriate error code.181 */182 PJ_DECL(pj_status_t) pjmedia_ice_modify_sdp(pjmedia_transport *tp,183 pj_pool_t *pool,184 pjmedia_sdp_session *sdp);185 186 /**187 * Start ICE connectivity checks.188 *189 * This function will pair the local and remote candidates to create190 * check list. Once the check list is created and sorted based on the191 * priority, ICE periodic checks will be started. This function will192 * return immediately, and application will be notified about the193 * connectivity check status in the callback.194 *195 * @param tp The media transport.196 * @param pool Memory pool to parse the SDP.197 * @param rem_sdp The SDP received from remote agent.198 * @param media_index The media index (in SDP) to process.199 *200 * @return PJ_SUCCESS, or the appropriate error code.201 */202 PJ_DECL(pj_status_t) pjmedia_ice_start_ice(pjmedia_transport *tp,203 pj_pool_t *pool,204 const pjmedia_sdp_session *rem_sdp,205 unsigned media_index);206 207 /**208 * Stop the ICE session (typically when the call is terminated). Application209 * may restart the ICE session again by calling #pjmedia_ice_init_ice(),210 * for example to use this media transport for the next call.211 *212 * @param tp The media transport.213 *214 * @return PJ_SUCCESS, or the appropriate error code.215 */216 PJ_DECL(pj_status_t) pjmedia_ice_stop_ice(pjmedia_transport *tp);217 218 219 /**220 * Simulate packet lost in the specified direction (for testing purposes).221 * When enabled, the transport will randomly drop packets to the specified222 * direction.223 *224 * @param tp The ICE media transport.225 * @param dir Media direction to which packets will be randomly dropped.226 * @param pct_lost Percent lost (0-100). Set to zero to disable packet227 * lost simulation.228 *229 * @return PJ_SUCCESS on success.230 */231 PJ_DECL(pj_status_t) pjmedia_ice_simulate_lost(pjmedia_transport *tp,232 pjmedia_dir dir,233 unsigned pct_lost);234 235 236 237 163 238 164 PJ_END_DECL … … 244 170 245 171 246 #endif /* __ pjmedia_ice_H__ */172 #endif /* __PJMEDIA_TRANSPORT_ICE_H__ */ 247 173 248 174 -
pjproject/trunk/pjmedia/include/pjmedia/transport_udp.h
r1615 r1735 54 54 PJMEDIA_UDP_NO_SRC_ADDR_CHECKING = 1 55 55 }; 56 57 58 /**59 * UDP transport info.60 */61 typedef struct pjmedia_transport_udp_info62 {63 /**64 * Media socket info.65 */66 pjmedia_sock_info skinfo;67 68 } pjmedia_transport_udp_info;69 56 70 57 … … 138 125 pjmedia_transport **p_tp); 139 126 140 /**141 * Get media socket info from the specified UDP transport.142 *143 * @param tp The UDP transport interface.144 * @param info Media socket info to be initialized.145 *146 * @return PJ_SUCCESS on success.147 */148 PJ_DECL(pj_status_t)149 pjmedia_transport_udp_get_info( pjmedia_transport *tp,150 pjmedia_transport_udp_info *info);151 152 127 153 128 /** … … 170 145 171 146 172 /**173 * Simulate packet lost in the specified direction (for testing purposes).174 * When enabled, the transport will randomly drop packets to the specified175 * direction.176 *177 * @param tp The UDP media transport.178 * @param dir Media direction to which packets will be randomly dropped.179 * @param pct_lost Percent lost (0-100). Set to zero to disable packet180 * lost simulation.181 *182 * @return PJ_SUCCESS on success.183 */184 PJ_DECL(pj_status_t) pjmedia_transport_udp_simulate_lost(pjmedia_transport *tp,185 pjmedia_dir dir,186 unsigned pct_lost);187 188 189 190 /**191 * Close UDP transport. Application can also use the "destroy" member of192 * media transport interface to close the UDP transport.193 *194 * @param tp The UDP media transport.195 *196 * @return PJ_SUCCESS on success.197 */198 PJ_DECL(pj_status_t) pjmedia_transport_udp_close(pjmedia_transport *tp);199 200 201 202 147 PJ_END_DECL 203 148 -
pjproject/trunk/pjmedia/src/pjmedia/errno.c
r1639 r1735 24 24 #endif 25 25 26 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 27 const char* get_libsrtp_errstr(int err); 28 #endif 26 29 27 30 … … 142 145 PJ_BUILD_ERR( PJMEDIA_ESNDINDEVID, "Invalid sound device ID" ), 143 146 PJ_BUILD_ERR( PJMEDIA_ESNDINSAMPLEFMT, "Invalid sample format for sound device" ), 147 148 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 149 /* SRTP transport errors: */ 150 PJ_BUILD_ERR( PJMEDIA_SRTP_ECRYPTONOTMATCH, "SRTP crypto-suite name not match the offerer tag" ), 151 PJ_BUILD_ERR( PJMEDIA_SRTP_EINKEYLEN, "Invalid SRTP key length for specific crypto" ), 152 PJ_BUILD_ERR( PJMEDIA_SRTP_ENOTSUPCRYPTO, "Unsupported SRTP crypto-suite" ), 153 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPAMBIGUEANS, "SRTP SDP contains ambigue answer" ), 154 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPDUPCRYPTOTAG,"Duplicated SRTP crypto tag" ), 155 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPINCRYPTO, "Invalid SRTP crypto attribute" ), 156 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPINCRYPTOTAG, "Invalid SRTP crypto tag" ), 157 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPINTRANSPORT, "Invalid SDP media transport for SRTP" ), 158 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPREQCRYPTO, "SRTP crypto attribute required" ), 159 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPREQSECTP, "Secure transport required in SDP media descriptor" ) 160 #endif 161 144 162 }; 145 163 … … 160 178 /* See if the error comes from PortAudio. */ 161 179 #if PJMEDIA_SOUND_IMPLEMENTATION==PJMEDIA_SOUND_PORTAUDIO_SOUND 162 if (statcode >= PJMEDIA_ ERRNO_FROM_PORTAUDIO(paNotInitialized)&&163 statcode < PJMEDIA_ERRNO_FROM_PORTAUDIO(paNotInitialized + 10000))180 if (statcode >= PJMEDIA_PORTAUDIO_ERRNO_START && 181 statcode <= PJMEDIA_PORTAUDIO_ERRNO_END) 164 182 { 165 183 166 int pa_err = statcode - PJMEDIA_ERRNO_FROM_PORTAUDIO(0); 184 //int pa_err = statcode - PJMEDIA_ERRNO_FROM_PORTAUDIO(0); 185 int pa_err = PJMEDIA_PORTAUDIO_ERRNO_START - statcode; 167 186 pj_str_t msg; 168 187 … … 176 195 } else 177 196 #endif /* PJMEDIA_SOUND_IMPLEMENTATION */ 197 198 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 199 /* LIBSRTP error */ 200 if (statcode >= PJMEDIA_LIBSRTP_ERRNO_START && 201 statcode < PJMEDIA_LIBSRTP_ERRNO_END) 202 { 203 int err = statcode - PJMEDIA_PORTAUDIO_ERRNO_START; 204 pj_str_t msg; 205 206 msg = pj_str((char*)get_libsrtp_errstr(err)); 207 208 pj_strncpy_with_null(&errstr, &msg, bufsize); 209 return errstr; 210 211 } else 212 #endif 213 214 /* PJMEDIA error */ 178 215 if (statcode >= PJMEDIA_ERRNO_START && 179 statcode < PJMEDIA_ERRNO_ START + PJ_ERRNO_SPACE_SIZE)216 statcode < PJMEDIA_ERRNO_END) 180 217 { 181 218 /* Find the error in the table. … … 212 249 213 250 } 214 } 215 251 } 216 252 #endif /* PJ_HAS_ERROR_STRING */ 217 253 -
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r1656 r1735 52 52 * These are media transport operations. 53 53 */ 54 static pj_status_t tp_get_info(pjmedia_transport *tp, 55 pjmedia_sock_info *info); 56 static pj_status_t tp_attach( pjmedia_transport *tp, 57 void *stream, 58 const pj_sockaddr_t *rem_addr, 59 const pj_sockaddr_t *rem_rtcp, 60 unsigned addr_len, 61 void (*rtp_cb)(void*, 62 const void*, 63 pj_ssize_t), 64 void (*rtcp_cb)(void*, 65 const void*, 66 pj_ssize_t)); 67 static void tp_detach( pjmedia_transport *tp, 68 void *strm); 69 static pj_status_t tp_send_rtp( pjmedia_transport *tp, 70 const void *pkt, 71 pj_size_t size); 72 static pj_status_t tp_send_rtcp( pjmedia_transport *tp, 73 const void *pkt, 74 pj_size_t size); 54 static pj_status_t transport_get_info (pjmedia_transport *tp, 55 pjmedia_sock_info *info); 56 static pj_status_t transport_attach (pjmedia_transport *tp, 57 void *user_data, 58 const pj_sockaddr_t *rem_addr, 59 const pj_sockaddr_t *rem_rtcp, 60 unsigned addr_len, 61 void (*rtp_cb)(void*, 62 const void*, 63 pj_ssize_t), 64 void (*rtcp_cb)(void*, 65 const void*, 66 pj_ssize_t)); 67 static void transport_detach (pjmedia_transport *tp, 68 void *strm); 69 static pj_status_t transport_send_rtp( pjmedia_transport *tp, 70 const void *pkt, 71 pj_size_t size); 72 static pj_status_t transport_send_rtcp(pjmedia_transport *tp, 73 const void *pkt, 74 pj_size_t size); 75 static pj_status_t transport_media_create(pjmedia_transport *tp, 76 pj_pool_t *pool, 77 pjmedia_sdp_session *sdp_local, 78 const pjmedia_sdp_session *sdp_remote, 79 unsigned media_index); 80 static pj_status_t transport_media_start (pjmedia_transport *tp, 81 pj_pool_t *pool, 82 pjmedia_sdp_session *sdp_local, 83 const pjmedia_sdp_session *sdp_remote, 84 unsigned media_index); 85 static pj_status_t transport_media_stop(pjmedia_transport *tp); 86 static pj_status_t transport_simulate_lost(pjmedia_transport *tp, 87 pjmedia_dir dir, 88 unsigned pct_lost); 89 static pj_status_t transport_destroy (pjmedia_transport *tp); 75 90 76 91 /* … … 85 100 86 101 87 static pjmedia_transport_op tp_ice_op = 88 { 89 &tp_get_info, 90 &tp_attach, 91 &tp_detach, 92 &tp_send_rtp, 93 &tp_send_rtcp, 94 &pjmedia_ice_destroy 102 static pjmedia_transport_op transport_ice_op = 103 { 104 &transport_get_info, 105 &transport_attach, 106 &transport_detach, 107 &transport_send_rtp, 108 &transport_send_rtcp, 109 &transport_media_create, 110 &transport_media_start, 111 &transport_media_stop, 112 &transport_simulate_lost, 113 &transport_destroy 95 114 }; 96 115 … … 133 152 tp_ice->ice_st = ice_st; 134 153 pj_ansi_strcpy(tp_ice->base.name, ice_st->obj_name); 135 tp_ice->base.op = &t p_ice_op;154 tp_ice->base.op = &transport_ice_op; 136 155 tp_ice->base.type = PJMEDIA_TRANSPORT_TYPE_ICE; 137 156 … … 144 163 if (p_tp) 145 164 *p_tp = &tp_ice->base; 146 147 return PJ_SUCCESS;148 }149 150 151 /*152 * Destroy ICE media transport.153 */154 PJ_DEF(pj_status_t) pjmedia_ice_destroy(pjmedia_transport *tp)155 {156 struct transport_ice *tp_ice = (struct transport_ice*)tp;157 158 if (tp_ice->ice_st) {159 pj_ice_strans_destroy(tp_ice->ice_st);160 /*Must not touch tp_ice after ice_st is destroyed!161 (it has the pool)162 tp_ice->ice_st = NULL;163 */164 }165 165 166 166 return PJ_SUCCESS; … … 231 231 comp, PJ_EINVAL); 232 232 233 pj_memcpy(comp, tp_ice->ice_st->comp[comp_id-1], sizeof(pj_ice_strans_comp)); 233 pj_memcpy(comp, tp_ice->ice_st->comp[comp_id-1], 234 sizeof(pj_ice_strans_comp)); 234 235 return PJ_SUCCESS; 235 236 } … … 247 248 { 248 249 struct transport_ice *tp_ice = (struct transport_ice*)tp; 249 return pj_ice_strans_init_ice(tp_ice->ice_st, role, local_ufrag, local_passwd); 250 return pj_ice_strans_init_ice(tp_ice->ice_st, role, local_ufrag, 251 local_passwd); 250 252 } 251 253 … … 255 257 * This will add ICE attributes to the SDP. 256 258 */ 257 PJ_DEF(pj_status_t) pjmedia_ice_modify_sdp(pjmedia_transport *tp, 258 pj_pool_t *pool, 259 pjmedia_sdp_session *sdp) 260 { 261 struct transport_ice *tp_ice = (struct transport_ice*)tp; 259 static pj_status_t transport_media_create(pjmedia_transport *tp, 260 pj_pool_t *pool, 261 pjmedia_sdp_session *sdp_local, 262 const pjmedia_sdp_session *sdp_remote, 263 unsigned media_index) 264 { 265 struct transport_ice *tp_ice = (struct transport_ice*)tp; 266 pj_ice_sess_role ice_role; 262 267 enum { MAXLEN = 256 }; 263 268 char *buffer; 264 269 pjmedia_sdp_attr *attr; 265 270 unsigned i, cand_cnt; 271 pj_status_t status; 272 273 /* Init ICE */ 274 ice_role = (sdp_remote==NULL ? PJ_ICE_SESS_ROLE_CONTROLLING : 275 PJ_ICE_SESS_ROLE_CONTROLLED); 276 277 status = pjmedia_ice_init_ice(tp, ice_role, NULL, NULL); 278 if (status != PJ_SUCCESS) 279 return status; 280 266 281 267 282 buffer = (char*) pj_pool_alloc(pool, MAXLEN); … … 270 285 attr = pjmedia_sdp_attr_create(pool, "ice-ufrag", 271 286 &tp_ice->ice_st->ice->rx_ufrag); 272 sdp ->attr[sdp->attr_count++] = attr;287 sdp_local->attr[sdp_local->attr_count++] = attr; 273 288 274 289 /* Create ice-pwd attribute */ 275 290 attr = pjmedia_sdp_attr_create(pool, "ice-pwd", 276 291 &tp_ice->ice_st->ice->rx_pass); 277 sdp ->attr[sdp->attr_count++] = attr;292 sdp_local->attr[sdp_local->attr_count++] = attr; 278 293 279 294 /* Add all candidates (to media level) */ … … 281 296 for (i=0; i<cand_cnt; ++i) { 282 297 pj_ice_sess_cand *cand; 298 pjmedia_sdp_media *m; 283 299 pj_str_t value; 284 300 int len; … … 330 346 value = pj_str(buffer); 331 347 attr = pjmedia_sdp_attr_create(pool, "candidate", &value); 332 sdp->media[0]->attr[sdp->media[0]->attr_count++] = attr; 348 m = sdp_local->media[media_index]; 349 m->attr[m->attr_count++] = attr; 333 350 } 334 351 … … 457 474 PJ_LOG(4,(tp_ice->ice_st->obj_name, 458 475 "Disabling local ICE, reason=%s", reason)); 459 pjmedia_ice_stop_ice(&tp_ice->base);476 transport_media_stop(&tp_ice->base); 460 477 } 461 478 … … 464 481 * Start ICE checks when both offer and answer are available. 465 482 */ 466 PJ_DEF(pj_status_t) pjmedia_ice_start_ice(pjmedia_transport *tp, 467 pj_pool_t *pool, 468 const pjmedia_sdp_session *rem_sdp, 469 unsigned media_index) 483 static pj_status_t transport_media_start(pjmedia_transport *tp, 484 pj_pool_t *pool, 485 pjmedia_sdp_session *sdp_local, 486 const pjmedia_sdp_session *sdp_remote, 487 unsigned media_index) 470 488 { 471 489 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 482 500 pj_status_t status; 483 501 484 PJ_ASSERT_RETURN(tp && pool && rem_sdp, PJ_EINVAL); 485 PJ_ASSERT_RETURN(media_index < rem_sdp->media_count, PJ_EINVAL); 486 487 sdp_med = rem_sdp->media[media_index]; 502 PJ_UNUSED_ARG(sdp_local); 503 504 PJ_ASSERT_RETURN(tp && pool && sdp_remote, PJ_EINVAL); 505 PJ_ASSERT_RETURN(media_index < sdp_remote->media_count, PJ_EINVAL); 506 507 sdp_med = sdp_remote->media[media_index]; 488 508 489 509 /* Get the SDP connection for the media stream. … … 493 513 conn = sdp_med->conn; 494 514 if (conn == NULL) 495 conn = rem_sdp->conn;515 conn = sdp_remote->conn; 496 516 497 517 if (conn == NULL) { … … 508 528 if (attr == NULL) { 509 529 /* Find ice-ufrag attribute in session descriptor */ 510 attr = pjmedia_sdp_attr_find2( rem_sdp->attr_count, rem_sdp->attr,530 attr = pjmedia_sdp_attr_find2(sdp_remote->attr_count, sdp_remote->attr, 511 531 "ice-ufrag", NULL); 512 532 if (attr == NULL) { … … 522 542 if (attr == NULL) { 523 543 /* Find ice-pwd attribute in session descriptor */ 524 attr = pjmedia_sdp_attr_find2( rem_sdp->attr_count, rem_sdp->attr,544 attr = pjmedia_sdp_attr_find2(sdp_remote->attr_count, sdp_remote->attr, 525 545 "ice-pwd", NULL); 526 546 if (attr == NULL) { … … 609 629 610 630 611 PJ_DEF(pj_status_t) pjmedia_ice_stop_ice(pjmedia_transport *tp)631 static pj_status_t transport_media_stop(pjmedia_transport *tp) 612 632 { 613 633 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 616 636 617 637 618 static pj_status_t t p_get_info(pjmedia_transport *tp,619 638 static pj_status_t transport_get_info(pjmedia_transport *tp, 639 pjmedia_sock_info *info) 620 640 { 621 641 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 649 669 650 670 651 static pj_status_t t p_attach(pjmedia_transport *tp,652 void *stream,653 const pj_sockaddr_t *rem_addr,654 const pj_sockaddr_t *rem_rtcp,655 unsigned addr_len,656 void (*rtp_cb)(void*,657 const void*,658 pj_ssize_t),659 void (*rtcp_cb)(void*,660 const void*,661 pj_ssize_t))671 static pj_status_t transport_attach (pjmedia_transport *tp, 672 void *stream, 673 const pj_sockaddr_t *rem_addr, 674 const pj_sockaddr_t *rem_rtcp, 675 unsigned addr_len, 676 void (*rtp_cb)(void*, 677 const void*, 678 pj_ssize_t), 679 void (*rtcp_cb)(void*, 680 const void*, 681 pj_ssize_t)) 662 682 { 663 683 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 674 694 675 695 676 static void t p_detach(pjmedia_transport *tp,677 696 static void transport_detach(pjmedia_transport *tp, 697 void *strm) 678 698 { 679 699 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 687 707 688 708 689 static pj_status_t t p_send_rtp(pjmedia_transport *tp,690 691 709 static pj_status_t transport_send_rtp(pjmedia_transport *tp, 710 const void *pkt, 711 pj_size_t size) 692 712 { 693 713 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 709 729 710 730 711 static pj_status_t t p_send_rtcp(pjmedia_transport *tp,712 713 731 static pj_status_t transport_send_rtcp(pjmedia_transport *tp, 732 const void *pkt, 733 pj_size_t size) 714 734 { 715 735 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 799 819 800 820 /* Simulate lost */ 801 PJ_DEF(pj_status_t) pjmedia_ice_simulate_lost(pjmedia_transport *tp,802 803 821 static pj_status_t transport_simulate_lost(pjmedia_transport *tp, 822 pjmedia_dir dir, 823 unsigned pct_lost) 804 824 { 805 825 struct transport_ice *ice = (struct transport_ice*) tp; … … 816 836 } 817 837 838 839 /* 840 * Destroy ICE media transport. 841 */ 842 static pj_status_t transport_destroy(pjmedia_transport *tp) 843 { 844 struct transport_ice *tp_ice = (struct transport_ice*)tp; 845 846 if (tp_ice->ice_st) { 847 pj_ice_strans_destroy(tp_ice->ice_st); 848 /*Must not touch tp_ice after ice_st is destroyed! 849 (it has the pool) 850 tp_ice->ice_st = NULL; 851 */ 852 } 853 854 return PJ_SUCCESS; 855 } 856 -
pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
r1630 r1735 95 95 pj_ssize_t bytes_read); 96 96 97 static pj_status_t transport_get_info(pjmedia_transport *tp, 98 pjmedia_sock_info *info); 99 static pj_status_t transport_attach( pjmedia_transport *tp, 97 /* 98 * These are media transport operations. 99 */ 100 static pj_status_t transport_get_info (pjmedia_transport *tp, 101 pjmedia_sock_info *info); 102 static pj_status_t transport_attach (pjmedia_transport *tp, 100 103 void *user_data, 101 104 const pj_sockaddr_t *rem_addr, … … 108 111 const void*, 109 112 pj_ssize_t)); 110 static void transport_detach (pjmedia_transport *tp,113 static void transport_detach (pjmedia_transport *tp, 111 114 void *strm); 112 115 static pj_status_t transport_send_rtp( pjmedia_transport *tp, … … 116 119 const void *pkt, 117 120 pj_size_t size); 121 static pj_status_t transport_media_create(pjmedia_transport *tp, 122 pj_pool_t *pool, 123 pjmedia_sdp_session *sdp_local, 124 const pjmedia_sdp_session *sdp_remote, 125 unsigned media_index); 126 static pj_status_t transport_media_start (pjmedia_transport *tp, 127 pj_pool_t *pool, 128 pjmedia_sdp_session *sdp_local, 129 const pjmedia_sdp_session *sdp_remote, 130 unsigned media_index); 131 static pj_status_t transport_media_stop(pjmedia_transport *tp); 132 static pj_status_t transport_simulate_lost(pjmedia_transport *tp, 133 pjmedia_dir dir, 134 unsigned pct_lost); 135 static pj_status_t transport_destroy (pjmedia_transport *tp); 118 136 119 137 … … 125 143 &transport_send_rtp, 126 144 &transport_send_rtcp, 127 &pjmedia_transport_udp_close 145 &transport_media_create, 146 &transport_media_start, 147 &transport_media_stop, 148 &transport_simulate_lost, 149 &transport_destroy 128 150 }; 129 151 … … 342 364 343 365 on_error: 344 pjmedia_transport_udp_close(&tp->base);366 transport_destroy(&tp->base); 345 367 return status; 346 }347 348 349 /*350 * Get media socket info.351 */352 PJ_DEF(pj_status_t) pjmedia_transport_udp_get_info( pjmedia_transport *tp,353 pjmedia_transport_udp_info *inf)354 {355 return transport_get_info(tp, &inf->skinfo);356 368 } 357 369 … … 360 372 * Close UDP transport. 361 373 */ 362 PJ_DEF(pj_status_t) pjmedia_transport_udp_close(pjmedia_transport *tp)374 static pj_status_t transport_destroy(pjmedia_transport *tp) 363 375 { 364 376 struct transport_udp *udp = (struct transport_udp*) tp; … … 727 739 728 740 729 PJ_DEF(pj_status_t) pjmedia_transport_udp_simulate_lost(pjmedia_transport *tp, 730 pjmedia_dir dir, 731 unsigned pct_lost) 741 static pj_status_t transport_media_create(pjmedia_transport *tp, 742 pj_pool_t *pool, 743 pjmedia_sdp_session *sdp_local, 744 const pjmedia_sdp_session *sdp_remote, 745 unsigned media_index) 746 { 747 PJ_UNUSED_ARG(tp); 748 PJ_UNUSED_ARG(pool); 749 PJ_UNUSED_ARG(sdp_local); 750 PJ_UNUSED_ARG(sdp_remote); 751 752 return PJ_SUCCESS; 753 } 754 755 static pj_status_t transport_media_start(pjmedia_transport *tp, 756 pj_pool_t *pool, 757 pjmedia_sdp_session *sdp_local, 758 const pjmedia_sdp_session *sdp_remote, 759 unsigned media_index) 760 { 761 PJ_UNUSED_ARG(tp); 762 PJ_UNUSED_ARG(pool); 763 PJ_UNUSED_ARG(sdp_local); 764 PJ_UNUSED_ARG(sdp_remote); 765 PJ_UNUSED_ARG(media_index); 766 767 return PJ_SUCCESS; 768 } 769 770 static pj_status_t transport_media_stop(pjmedia_transport *tp) 771 { 772 PJ_UNUSED_ARG(tp); 773 774 return PJ_SUCCESS; 775 } 776 777 static pj_status_t transport_simulate_lost(pjmedia_transport *tp, 778 pjmedia_dir dir, 779 unsigned pct_lost) 732 780 { 733 781 struct transport_udp *udp = (struct transport_udp*)tp; -
pjproject/trunk/pjproject-vs8.sln
r1488 r1735 1 1 2 2 Microsoft Visual Studio Solution File, Format Version 9.00 3 # Visual C++ Express20053 # Visual Studio 2005 4 4 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjlib", "pjlib\build\pjlib.vcproj", "{DA0E03ED-53A7-4050-8A85-90541C5509F8}" 5 5 EndProject … … 13 13 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjlib_util_test", "pjlib-util\build\pjlib_util_test.vcproj", "{ED02BE13-8297-4770-8097-27DC2CCABF9A}" 14 14 ProjectSection(ProjectDependencies) = postProject 15 { DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8}16 { FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}15 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 16 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 17 17 EndProjectSection 18 18 EndProject … … 29 29 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjsua", "pjsip-apps\build\pjsua.vcproj", "{8310649E-A25E-4AF0-91E8-9E3CC659BB89}" 30 30 ProjectSection(ProjectDependencies) = postProject 31 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 31 32 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 32 33 {4BF51C21-5A30-423B-82FE-1ED410E5769D} = {4BF51C21-5A30-423B-82FE-1ED410E5769D} 34 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 35 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 36 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 37 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 38 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 39 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 40 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 41 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 42 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 43 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 44 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 45 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 33 46 {E53AA5FF-B737-40AA-BD13-387EFA99023D} = {E53AA5FF-B737-40AA-BD13-387EFA99023D} 34 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 47 EndProjectSection 48 EndProject 49 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjsua_lib", "pjsip\build\pjsua_lib.vcproj", "{9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}" 50 EndProject 51 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_debug", "pjsip-apps\build\sample_debug.vcproj", "{A0F1AA62-0F6F-420D-B09A-AC04B6862821}" 52 ProjectSection(ProjectDependencies) = postProject 53 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 54 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 55 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 56 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 57 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 58 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 59 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 60 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 61 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 62 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 35 63 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 36 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 37 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 38 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 39 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 40 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 41 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 42 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 43 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 44 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 45 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 46 EndProjectSection 47 EndProject 48 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjsua_lib", "pjsip\build\pjsua_lib.vcproj", "{9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}" 49 EndProject 50 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_debug", "pjsip-apps\build\sample_debug.vcproj", "{A0F1AA62-0F6F-420D-B09A-AC04B6862821}" 51 ProjectSection(ProjectDependencies) = postProject 64 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 52 65 {E53AA5FF-B737-40AA-BD13-387EFA99023D} = {E53AA5FF-B737-40AA-BD13-387EFA99023D} 53 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 54 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 55 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 56 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 57 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 58 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 59 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 60 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 61 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 62 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 63 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 64 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 65 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 66 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 67 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 66 68 EndProjectSection 67 69 EndProject 68 70 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "samples", "pjsip-apps\build\samples.vcproj", "{E378A1FC-0C9C-4462-860F-7E60BC1BF84E}" 69 71 ProjectSection(ProjectDependencies) = postProject 70 { 9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}71 { DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8}72 { B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21}73 { 4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}74 { 855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}75 { 7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}76 { FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}77 { 2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031}72 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 73 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 74 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 75 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 76 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 77 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 78 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 79 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 78 80 EndProjectSection 79 81 EndProject 80 82 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_pjsip", "pjsip\build\test_pjsip.vcproj", "{B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}" 81 83 ProjectSection(ProjectDependencies) = postProject 82 { 9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}83 { DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8}84 { B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21}85 { 4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}86 { 855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}87 { 7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}88 { FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}89 { 2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031}84 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 85 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 86 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 87 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 88 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 89 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 90 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 91 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 90 92 EndProjectSection 91 93 EndProject … … 105 107 EndProject 106 108 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmilenage", "third_party\build\milenage\libmilenage.vcproj", "{4BF51C21-5A30-423B-82FE-1ED410E5769D}" 109 EndProject 110 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsrtp", "third_party\build\srtp\libsrtp.vcproj", "{F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}" 107 111 EndProject 108 112 Global … … 200 204 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|Win32.ActiveCfg = Release|Win32 201 205 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|Win32.Build.0 = Release|Win32 206 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|Win32.ActiveCfg = Debug|Win32 207 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|Win32.Build.0 = Debug|Win32 208 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|Win32.ActiveCfg = Release|Win32 209 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|Win32.Build.0 = Release|Win32 202 210 EndGlobalSection 203 211 GlobalSection(SolutionProperties) = preSolution -
pjproject/trunk/pjproject.dsw
r1488 r1735 4 4 ############################################################################### 5 5 6 Project: "libgsmcodec"=.\THIRD_PARTY\BUILD\GSM\libgsmcodec.dsp - Package Owner=<4> 7 8 Package=<5> 9 {{{ 10 }}} 11 12 Package=<4> 13 {{{ 14 }}} 15 16 ############################################################################### 17 18 Project: "libilbccodec"=.\THIRD_PARTY\BUILD\ILBC\libilbccodec.dsp - Package Owner=<4> 19 20 Package=<5> 21 {{{ 22 }}} 23 24 Package=<4> 25 {{{ 26 }}} 27 28 ############################################################################### 29 30 Project: "libmilenage"=.\third_party\build\milenage\libmilenage.dsp - Package Owner=<4> 31 32 Package=<5> 33 {{{ 34 }}} 35 36 Package=<4> 37 {{{ 38 }}} 39 40 ############################################################################### 41 42 Project: "libportaudio"=.\THIRD_PARTY\BUILD\PORTAUDIO\libportaudio.dsp - Package Owner=<4> 43 44 Package=<5> 45 {{{ 46 }}} 47 48 Package=<4> 49 {{{ 50 }}} 51 52 ############################################################################### 53 54 Project: "libresample"=.\THIRD_PARTY\BUILD\RESAMPLE\libresample.dsp - Package Owner=<4> 55 56 Package=<5> 57 {{{ 58 }}} 59 60 Package=<4> 61 {{{ 62 }}} 63 64 ############################################################################### 65 66 Project: "libresample_dll"=.\THIRD_PARTY\BUILD\RESAMPLE\libresample_dll.dsp - Package Owner=<4> 67 68 Package=<5> 69 {{{ 70 }}} 71 72 Package=<4> 73 {{{ 74 }}} 75 76 ############################################################################### 77 78 Project: "libspeex"=.\third_party\build\speex\libspeex.dsp - Package Owner=<4> 79 80 Package=<5> 81 {{{ 82 }}} 83 84 Package=<4> 85 {{{ 86 }}} 87 88 ############################################################################### 89 90 Project: "pjlib"=.\pjlib\build\pjlib.dsp - Package Owner=<4> 91 92 Package=<5> 93 {{{ 94 }}} 95 96 Package=<4> 97 {{{ 98 }}} 99 100 ############################################################################### 101 102 Project: "pjlib_test"=.\pjlib\build\pjlib_test.dsp - Package Owner=<4> 6 Project: "libgsmcodec"=".\THIRD_PARTY\BUILD\GSM\libgsmcodec.dsp" - Package Owner=<4> 7 8 Package=<5> 9 {{{ 10 }}} 11 12 Package=<4> 13 {{{ 14 }}} 15 16 ############################################################################### 17 18 Project: "libilbccodec"=".\THIRD_PARTY\BUILD\ILBC\libilbccodec.dsp" - Package Owner=<4> 19 20 Package=<5> 21 {{{ 22 }}} 23 24 Package=<4> 25 {{{ 26 }}} 27 28 ############################################################################### 29 30 Project: "libmilenage"=".\third_party\build\milenage\libmilenage.dsp" - Package Owner=<4> 31 32 Package=<5> 33 {{{ 34 }}} 35 36 Package=<4> 37 {{{ 38 }}} 39 40 ############################################################################### 41 42 Project: "libportaudio"=".\THIRD_PARTY\BUILD\PORTAUDIO\libportaudio.dsp" - Package Owner=<4> 43 44 Package=<5> 45 {{{ 46 }}} 47 48 Package=<4> 49 {{{ 50 }}} 51 52 ############################################################################### 53 54 Project: "libresample"=".\THIRD_PARTY\BUILD\RESAMPLE\libresample.dsp" - Package Owner=<4> 55 56 Package=<5> 57 {{{ 58 }}} 59 60 Package=<4> 61 {{{ 62 }}} 63 64 ############################################################################### 65 66 Project: "libresample_dll"=".\THIRD_PARTY\BUILD\RESAMPLE\libresample_dll.dsp" - Package Owner=<4> 67 68 Package=<5> 69 {{{ 70 }}} 71 72 Package=<4> 73 {{{ 74 }}} 75 76 ############################################################################### 77 78 Project: "libspeex"=".\third_party\build\speex\libspeex.dsp" - Package Owner=<4> 79 80 Package=<5> 81 {{{ 82 }}} 83 84 Package=<4> 85 {{{ 86 }}} 87 88 ############################################################################### 89 90 Project: "libsrtp"=".\third_party\build\srtp\libsrtp.dsp" - Package Owner=<4> 91 92 Package=<5> 93 {{{ 94 }}} 95 96 Package=<4> 97 {{{ 98 }}} 99 100 ############################################################################### 101 102 Project: "pjlib"=".\pjlib\build\pjlib.dsp" - Package Owner=<4> 103 104 Package=<5> 105 {{{ 106 }}} 107 108 Package=<4> 109 {{{ 110 }}} 111 112 ############################################################################### 113 114 Project: "pjlib_test"=".\pjlib\build\pjlib_test.dsp" - Package Owner=<4> 103 115 104 116 Package=<5> … … 145 157 ############################################################################### 146 158 147 Project: "pjmedia"= .\pjmedia\build\pjmedia.dsp- Package Owner=<4>148 149 Package=<5> 150 {{{ 151 }}} 152 153 Package=<4> 154 {{{ 155 }}} 156 157 ############################################################################### 158 159 Project: "pjmedia_codec"= .\pjmedia\build\pjmedia_codec.dsp- Package Owner=<4>160 161 Package=<5> 162 {{{ 163 }}} 164 165 Package=<4> 166 {{{ 167 }}} 168 169 ############################################################################### 170 171 Project: "pjnath"= .\pjnath\build\pjnath.dsp- Package Owner=<4>172 173 Package=<5> 174 {{{ 175 }}} 176 177 Package=<4> 178 {{{ 179 }}} 180 181 ############################################################################### 182 183 Project: "pjsip_core"= .\pjsip\build\pjsip_core.dsp- Package Owner=<4>184 185 Package=<5> 186 {{{ 187 }}} 188 189 Package=<4> 190 {{{ 191 }}} 192 193 ############################################################################### 194 195 Project: "pjsip_simple"= .\pjsip\build\pjsip_simple.dsp- Package Owner=<4>196 197 Package=<5> 198 {{{ 199 }}} 200 201 Package=<4> 202 {{{ 203 }}} 204 205 ############################################################################### 206 207 Project: "pjsip_ua"= .\pjsip\build\pjsip_ua.dsp- Package Owner=<4>159 Project: "pjmedia"=".\pjmedia\build\pjmedia.dsp" - Package Owner=<4> 160 161 Package=<5> 162 {{{ 163 }}} 164 165 Package=<4> 166 {{{ 167 }}} 168 169 ############################################################################### 170 171 Project: "pjmedia_codec"=".\pjmedia\build\pjmedia_codec.dsp" - Package Owner=<4> 172 173 Package=<5> 174 {{{ 175 }}} 176 177 Package=<4> 178 {{{ 179 }}} 180 181 ############################################################################### 182 183 Project: "pjnath"=".\pjnath\build\pjnath.dsp" - Package Owner=<4> 184 185 Package=<5> 186 {{{ 187 }}} 188 189 Package=<4> 190 {{{ 191 }}} 192 193 ############################################################################### 194 195 Project: "pjsip_core"=".\pjsip\build\pjsip_core.dsp" - Package Owner=<4> 196 197 Package=<5> 198 {{{ 199 }}} 200 201 Package=<4> 202 {{{ 203 }}} 204 205 ############################################################################### 206 207 Project: "pjsip_simple"=".\pjsip\build\pjsip_simple.dsp" - Package Owner=<4> 208 209 Package=<5> 210 {{{ 211 }}} 212 213 Package=<4> 214 {{{ 215 }}} 216 217 ############################################################################### 218 219 Project: "pjsip_ua"=".\pjsip\build\pjsip_ua.dsp" - Package Owner=<4> 208 220 209 221 Package=<5> … … 270 282 Project_Dep_Name libmilenage 271 283 End Project Dependency 272 }}} 273 274 ############################################################################### 275 276 Project: "pjsua_lib"=.\pjsip\build\pjsua_lib.dsp - Package Owner=<4> 284 Begin Project Dependency 285 Project_Dep_Name libsrtp 286 End Project Dependency 287 }}} 288 289 ############################################################################### 290 291 Project: "pjsua_lib"=".\pjsip\build\pjsua_lib.dsp" - Package Owner=<4> 277 292 278 293 Package=<5> … … 394 409 ############################################################################### 395 410 396 Project: "test_pjsip"= .\pjsip\build\test_pjsip.dsp- Package Owner=<4>411 Project: "test_pjsip"=".\pjsip\build\test_pjsip.dsp" - Package Owner=<4> 397 412 398 413 Package=<5> -
pjproject/trunk/pjsip-apps/build/Samples-vc.mak
r1681 r1735 24 24 RESAMPLE_LIB = ..\..\third_party\lib\libresample-$(TARGET)$(LIBEXT) 25 25 SPEEX_LIB = ..\..\third_party\lib\libspeex-$(TARGET)$(LIBEXT) 26 SRTP_LIB = ..\..\third_party\lib\libsrtp-$(TARGET)$(LIBEXT) 26 27 27 28 THIRD_PARTY_LIBS = $(GSM_LIB) $(ILBC_LIB) $(PORTAUDIO_LIB) $(RESAMPLE_LIB) \ 28 $(SPEEX_LIB) 29 $(SPEEX_LIB) $(SRTP_LIB) 29 30 30 31 LIBS = $(PJSUA_LIB_LIB) $(PJSIP_UA_LIB) $(PJSIP_SIMPLE_LIB) \ -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r1626 r1735 121 121 puts ("SIP Account options:"); 122 122 puts (" --use-ims Enable 3GPP/IMS related settings on this account"); 123 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 124 puts (" --use-srtp=N Use SRTP N= 0: disabled, 1: optional, 2: mandatory"); 125 #endif 123 126 puts (" --registrar=url Set the URL of registrar server"); 124 127 puts (" --id=url Set the URL of local ID (used in From header)"); … … 383 386 OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, 384 387 OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_AUTO_PLAY, OPT_AUTO_LOOP, 385 OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_USE_ICE, 388 OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_USE_ICE, OPT_USE_SRTP, 386 389 OPT_PLAY_FILE, OPT_PLAY_TONE, OPT_RTP_PORT, OPT_ADD_CODEC, 387 390 OPT_ILBC_MODE, OPT_REC_FILE, OPT_AUTO_REC, … … 442 445 { "rtp-port", 1, 0, OPT_RTP_PORT}, 443 446 { "use-ice", 0, 0, OPT_USE_ICE}, 447 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 448 { "use-srtp", 1, 0, OPT_USE_SRTP}, 449 #endif 444 450 { "add-codec", 1, 0, OPT_ADD_CODEC}, 445 451 { "dis-codec", 1, 0, OPT_DIS_CODEC}, … … 797 803 break; 798 804 805 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 806 case OPT_USE_SRTP: 807 app_config.cfg.use_srtp = my_atoi(pj_optarg); 808 if (!pj_isdigit(*pj_optarg) || app_config.cfg.use_srtp > 2) { 809 PJ_LOG(1,(THIS_FILE, "Invalid value for --use-srtp option")); 810 return -1; 811 } 812 break; 813 #endif 814 799 815 case OPT_RTP_PORT: 800 816 cfg->rtp_cfg.port = my_atoi(pj_optarg); … … 1111 1127 pj_strcat2(result, line); 1112 1128 } 1129 1130 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 1131 /* SRTP */ 1132 if (acc_cfg->use_srtp) { 1133 pj_ansi_sprintf(line, "--use-srtp %i\n", 1134 (int)acc_cfg->use_srtp); 1135 pj_strcat2(result, line); 1136 } 1137 #endif 1113 1138 1114 1139 /* Proxy */ -
pjproject/trunk/pjsip-apps/src/samples/simpleua.c
r1530 r1735 286 286 * the SDP). 287 287 */ 288 { 289 pjmedia_transport_udp_info udp_info; 290 291 pjmedia_transport_udp_get_info(g_med_transport, &udp_info); 292 pj_memcpy(&g_med_skinfo, &udp_info.skinfo, 293 sizeof(pjmedia_sock_info)); 294 } 288 pjmedia_transport_get_info(g_med_transport, &g_med_skinfo); 295 289 296 290 -
pjproject/trunk/pjsip-apps/src/samples/siprtp.c
r1670 r1735 1006 1006 pjmedia_sdp_media *m; 1007 1007 pjmedia_sdp_attr *attr; 1008 pjmedia_ transport_udp_info tpinfo;1008 pjmedia_sock_info tpinfo; 1009 1009 struct media_stream *audio = &call->media[0]; 1010 1010 … … 1013 1013 1014 1014 /* Get transport info */ 1015 pjmedia_transport_ udp_get_info(audio->transport, &tpinfo);1015 pjmedia_transport_get_info(audio->transport, &tpinfo); 1016 1016 1017 1017 /* Create and initialize basic SDP session */ … … 1047 1047 /* Standard media info: */ 1048 1048 m->desc.media = pj_str("audio"); 1049 m->desc.port = pj_ntohs(tpinfo. skinfo.rtp_addr_name.ipv4.sin_port);1049 m->desc.port = pj_ntohs(tpinfo.rtp_addr_name.ipv4.sin_port); 1050 1050 m->desc.port_count = 1; 1051 1051 m->desc.transport = pj_str("RTP/AVP"); -
pjproject/trunk/pjsip-apps/src/samples/streamutil.c
r1666 r1735 56 56 " --send-only Set stream direction to send only \n" 57 57 " --recv-only Set stream direction to recv only (default) \n" 58 59 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 60 " --use-srtp[=NAME] Enable SRTP with crypto suite NAME \n" 61 " e.g: AES_CM_128_HMAC_SHA1_80 (default), \n" 62 " AES_CM_128_HMAC_SHA1_32 \n" 63 " Use this option along with the TX & RX keys, \n" 64 " formated of 60 hex digits (e.g: E148DA..) \n" 65 " --srtp-tx-key SRTP key for transmiting \n" 66 " --srtp-rx-key SRTP key for receiving \n" 67 #endif 68 58 69 "\n" 59 70 ; … … 65 76 #include <pjmedia.h> 66 77 #include <pjmedia-codec.h> 78 #include <pjmedia/transport_srtp.h> 67 79 68 80 #include <stdlib.h> /* atoi() */ … … 79 91 static void print_stream_stat(pjmedia_stream *stream); 80 92 93 /* Prototype for LIBSRTP utility in file datatypes.c */ 94 int hex_string_to_octet_string(char *raw, char *hex, int len); 81 95 82 96 /* … … 123 137 pj_uint16_t local_port, 124 138 const pj_sockaddr_in *rem_addr, 139 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 140 pj_bool_t use_srtp, 141 const pj_str_t *crypto_suite, 142 const pj_str_t *srtp_tx_key, 143 const pj_str_t *srtp_rx_key, 144 #endif 125 145 pjmedia_stream **p_stream ) 126 146 { 127 147 pjmedia_stream_info info; 128 pjmedia_transport *transport ;148 pjmedia_transport *transport = NULL; 129 149 pj_status_t status; 150 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 151 pjmedia_transport *srtp_tp = NULL; 152 #endif 130 153 131 154 … … 159 182 return status; 160 183 184 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 185 /* Check if SRTP enabled */ 186 if (use_srtp) { 187 pjmedia_srtp_crypto tx_plc, rx_plc; 188 189 status = pjmedia_transport_srtp_create(med_endpt, transport, 190 NULL, &srtp_tp); 191 if (status != PJ_SUCCESS) 192 return status; 193 194 pj_bzero(&tx_plc, sizeof(pjmedia_srtp_crypto)); 195 pj_bzero(&rx_plc, sizeof(pjmedia_srtp_crypto)); 196 197 tx_plc.key = *srtp_tx_key; 198 tx_plc.name = *crypto_suite; 199 rx_plc.key = *srtp_rx_key; 200 rx_plc.name = *crypto_suite; 201 202 status = pjmedia_transport_srtp_start(srtp_tp, &tx_plc, &rx_plc); 203 if (status != PJ_SUCCESS) 204 return status; 205 206 transport = srtp_tp; 207 } 208 #endif 161 209 162 210 /* Now that the stream info is initialized, we can create the … … 165 213 166 214 status = pjmedia_stream_create( med_endpt, pool, &info, 167 transport, NULL, p_stream); 215 transport, 216 NULL, p_stream); 168 217 169 218 if (status != PJ_SUCCESS) { 170 219 app_perror(THIS_FILE, "Error creating stream", status); 171 pjmedia_transport_ udp_close(transport);220 pjmedia_transport_close(transport); 172 221 return status; 173 222 } … … 202 251 pj_status_t status; 203 252 253 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 254 /* SRTP variables */ 255 pj_bool_t use_srtp = PJ_FALSE; 256 char tmp_tx_key[64]; 257 char tmp_rx_key[64]; 258 pj_str_t srtp_tx_key = {NULL, 0}; 259 pj_str_t srtp_rx_key = {NULL, 0}; 260 pj_str_t srtp_crypto_suite = {NULL, 0}; 261 int tmp_key_len; 262 #endif 204 263 205 264 /* Default values */ … … 221 280 OPT_SEND_ONLY = 's', 222 281 OPT_RECV_ONLY = 'i', 282 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 283 OPT_USE_SRTP = 'S', 284 #endif 285 OPT_SRTP_TX_KEY = 'x', 286 OPT_SRTP_RX_KEY = 'y', 223 287 OPT_HELP = 'h', 224 288 }; … … 233 297 { "send-only", 0, 0, OPT_SEND_ONLY }, 234 298 { "recv-only", 0, 0, OPT_RECV_ONLY }, 299 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 300 { "use-srtp", 2, 0, OPT_USE_SRTP }, 301 { "srtp-tx-key", 1, 0, OPT_SRTP_TX_KEY }, 302 { "srtp-rx-key", 1, 0, OPT_SRTP_RX_KEY }, 303 #endif 235 304 { "help", 0, 0, OPT_HELP }, 236 305 { NULL, 0, 0, 0 }, … … 299 368 break; 300 369 370 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 371 case OPT_USE_SRTP: 372 use_srtp = PJ_TRUE; 373 if (pj_optarg) { 374 pj_strset(&srtp_crypto_suite, pj_optarg, strlen(pj_optarg)); 375 } else { 376 srtp_crypto_suite = pj_str("AES_CM_128_HMAC_SHA1_80"); 377 } 378 break; 379 380 case OPT_SRTP_TX_KEY: 381 tmp_key_len = hex_string_to_octet_string(tmp_tx_key, pj_optarg, strlen(pj_optarg)); 382 pj_strset(&srtp_tx_key, tmp_tx_key, tmp_key_len/2); 383 break; 384 385 case OPT_SRTP_RX_KEY: 386 tmp_key_len = hex_string_to_octet_string(tmp_rx_key, pj_optarg, strlen(pj_optarg)); 387 pj_strset(&srtp_rx_key, tmp_rx_key, tmp_key_len/2); 388 break; 389 #endif 390 301 391 case OPT_HELP: 302 392 usage(); … … 324 414 } 325 415 416 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 417 /* SRTP validation */ 418 if (use_srtp) { 419 if (!srtp_tx_key.slen || !srtp_rx_key.slen) 420 { 421 printf("Error: Key for each SRTP stream direction must be set\n"); 422 return 1; 423 } 424 } 425 #endif 326 426 327 427 /* Must create a pool factory before we can allocate any memory. */ … … 369 469 /* Create stream based on program arguments */ 370 470 status = create_stream(pool, med_endpt, codec_info, dir, local_port, 371 &remote_addr, &stream); 471 &remote_addr, 472 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 473 use_srtp, &srtp_crypto_suite, 474 &srtp_tx_key, &srtp_rx_key, 475 #endif 476 &stream); 372 477 if (status != PJ_SUCCESS) 373 478 goto on_exit; … … 538 643 tp = pjmedia_stream_get_transport(stream); 539 644 pjmedia_stream_destroy(stream); 540 pjmedia_transport_udp_close(tp); 645 646 pjmedia_transport_close(tp); 541 647 } 542 648 -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r1703 r1735 404 404 #endif 405 405 406 406 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 407 408 /** 409 * Default value of SRTP mode usage. Valid values are PJMEDIA_SRTP_DISABLED, 410 * PJMEDIA_SRTP_OPTIONAL, and PJMEDIA_SRTP_MANDATORY. 411 */ 412 #ifndef PJSUA_DEFAULT_USE_SRTP 413 #define PJSUA_DEFAULT_USE_SRTP PJMEDIA_SRTP_DISABLED 414 #endif 415 416 /** 417 * Default value of secure signaling requirement for SRTP. 418 * Valid values are: 419 * 0: SRTP does not require secure signaling 420 * 1: SRTP requires secure transport such as TLS 421 * 2: SRTP requires secure end-to-end transport (SIPS) 422 */ 423 #ifndef PJSUA_DEFAULT_SRTP_SECURE_SIGNALING 424 #define PJSUA_DEFAULT_SRTP_SECURE_SIGNALING 1 425 #endif 426 427 #endif 407 428 408 429 /** … … 1035 1056 pj_str_t user_agent; 1036 1057 1058 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 1059 /** 1060 * Specify default value of secure media transport usage. 1061 * Valid values are PJMEDIA_SRTP_DISABLED, PJMEDIA_SRTP_OPTIONAL, and 1062 * PJMEDIA_SRTP_MANDATORY. 1063 * 1064 * Note that this setting can be further customized in account 1065 * configuration (#pjsua_acc_config). 1066 * 1067 * Default: #PJSUA_DEFAULT_USE_SRTP 1068 */ 1069 pjmedia_srtp_use use_srtp; 1070 1071 /** 1072 * Specify whether SRTP requires secure signaling to be used. This option 1073 * is only used when \a use_srtp option above is non-zero. 1074 * 1075 * Valid values are: 1076 * 0: SRTP does not require secure signaling 1077 * 1: SRTP requires secure transport such as TLS 1078 * 2: SRTP requires secure end-to-end transport (SIPS) 1079 * 1080 * Note that this setting can be further customized in account 1081 * configuration (#pjsua_acc_config). 1082 * 1083 * Default: #PJSUA_DEFAULT_SRTP_SECURE_SIGNALING 1084 */ 1085 int srtp_secure_signaling; 1086 #endif 1087 1037 1088 } pjsua_config; 1038 1089 … … 1971 2022 */ 1972 2023 pj_str_t ka_data; 2024 2025 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 2026 /** 2027 * Specify whether secure media transport should be used for this account. 2028 * Valid values are PJMEDIA_SRTP_DISABLED, PJMEDIA_SRTP_OPTIONAL, and 2029 * PJMEDIA_SRTP_MANDATORY. 2030 * 2031 * Default: #PJSUA_DEFAULT_USE_SRTP 2032 */ 2033 pjmedia_srtp_use use_srtp; 2034 2035 /** 2036 * Specify whether SRTP requires secure signaling to be used. This option 2037 * is only used when \a use_srtp option above is non-zero. 2038 * 2039 * Valid values are: 2040 * 0: SRTP does not require secure signaling 2041 * 1: SRTP requires secure transport such as TLS 2042 * 2: SRTP requires secure end-to-end transport (SIPS) 2043 * 2044 * Default: #PJSUA_DEFAULT_SRTP_SECURE_SIGNALING 2045 */ 2046 int srtp_secure_signaling; 2047 #endif 1973 2048 1974 2049 } pjsua_acc_config; -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r1717 r1735 51 51 pjsip_evsub *xfer_sub; /**< Xfer server subscription, if this 52 52 call was triggered by xfer. */ 53 pjmedia_transport *med_tp; /**< Media transport. */ 53 pjmedia_transport *med_tp; /**< Current media transport. */ 54 pjmedia_transport *med_orig; /**< Original media transport */ 54 55 pj_timer_entry refresh_tm;/**< Timer to send re-INVITE. */ 55 56 pj_timer_entry hangup_tm; /**< Timer to hangup call. */ … … 314 315 */ 315 316 pj_status_t pjsua_media_channel_init(pjsua_call_id call_id, 316 pjsip_role_e role); 317 pjsip_role_e role, 318 int security_level); 317 319 pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id, 318 320 pj_pool_t *pool, 321 const pjmedia_sdp_session *rem_sdp, 319 322 pjmedia_sdp_session **p_sdp); 320 323 pj_status_t pjsua_media_channel_update(pjsua_call_id call_id, 321 constpjmedia_sdp_session *local_sdp,324 pjmedia_sdp_session *local_sdp, 322 325 const pjmedia_sdp_session *remote_sdp); 323 326 pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r1717 r1735 256 256 } 257 257 258 static pj_bool_t pj_stristr(const pj_str_t *str, const pj_str_t *substr) 259 { 260 int i; 261 262 for (i=0; i<(str->slen-substr->slen); ++i) { 263 pj_str_t s; 264 s.ptr = str->ptr+i; 265 s.slen = substr->slen; 266 267 if (pj_stricmp(&s, substr)==0) 268 return PJ_TRUE; 269 } 270 return PJ_FALSE; 271 } 272 273 /* Get signaling secure level. 274 * Return: 275 * 0: if signaling is not secure 276 * 1: if TLS transport is used for immediate hop 277 * 2: if end-to-end signaling is secure. 278 * 279 * NOTE: 280 * THIS IS WRONG. It should take into account the route-set. 281 */ 282 static int get_secure_level(const pj_str_t *dst_uri) 283 { 284 const pj_str_t tls = pj_str(";transport=tls"); 285 const pj_str_t sips = pj_str("sips:"); 286 287 PJ_TODO(Fix_get_secure_level); 288 289 if (pj_stristr(dst_uri, &sips)) 290 return 2; 291 if (pj_stristr(dst_uri, &tls)) 292 return 1; 293 return 0; 294 } 295 258 296 /* 259 297 * Make outgoing call to the specified URI using the specified account. … … 363 401 364 402 /* Init media channel */ 365 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC); 403 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC, 404 get_secure_level(dest_uri)); 366 405 if (status != PJ_SUCCESS) { 367 406 pjsua_perror(THIS_FILE, "Error initializing media channel", status); … … 373 412 offer = NULL; 374 413 #else 375 status = pjsua_media_channel_create_sdp(call->index, dlg->pool, &offer);414 status = pjsua_media_channel_create_sdp(call->index, dlg->pool, NULL, &offer); 376 415 if (status != PJ_SUCCESS) { 377 416 pjsua_perror(THIS_FILE, "pjmedia unable to create SDP", status); … … 520 559 pjsua_call *call; 521 560 int call_id = -1; 522 pjmedia_sdp_session *answer; 561 int secure_level; 562 pjmedia_sdp_session *offer, *answer; 523 563 pj_status_t status; 524 564 … … 615 655 } 616 656 617 618 /* Init media channel */619 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAS);620 if (status != PJ_SUCCESS) {621 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL,622 NULL, NULL);623 PJSUA_UNLOCK();624 return PJ_TRUE;625 }626 627 628 /* Get media capability from media endpoint: */629 status = pjsua_media_channel_create_sdp(call->index, rdata->tp_info.pool, &answer);630 if (status != PJ_SUCCESS) {631 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL,632 NULL, NULL);633 pjsua_media_channel_deinit(call->index);634 PJSUA_UNLOCK();635 return PJ_TRUE;636 }637 638 657 /* 639 658 * Get which account is most likely to be associated with this incoming … … 643 662 acc_id = call->acc_id = pjsua_acc_find_for_incoming(rdata); 644 663 664 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 665 /* Get signaling security level, only when required by SRTP */ 666 if (pjsua_var.acc[acc_id].cfg.srtp_secure_signaling < 2) { 667 secure_level = PJSIP_TRANSPORT_IS_SECURE(rdata->tp_info.transport)!=0; 668 } else 669 #endif 670 671 { 672 char *uri; 673 int uri_len; 674 pj_str_t dst; 675 676 uri = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE); 677 uri_len = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, 678 rdata->msg_info.msg->line.req.uri, 679 uri, PJSIP_MAX_URL_SIZE); 680 if (uri_len < 1) { 681 pjsua_perror(THIS_FILE, "Error analyzing dst URI", 682 PJSIP_EURITOOLONG); 683 uri_len = 0; 684 } 685 686 dst.ptr = uri; 687 dst.slen = uri_len; 688 689 secure_level = get_secure_level(&dst); 690 } 691 692 /* Init media channel */ 693 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAS, 694 secure_level); 695 if (status != PJ_SUCCESS) { 696 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL, 697 NULL, NULL); 698 PJSUA_UNLOCK(); 699 return PJ_TRUE; 700 } 701 702 /* Parse SDP from incoming request */ 703 if (rdata->msg_info.msg->body) { 704 status = pjmedia_sdp_parse(rdata->tp_info.pool, 705 rdata->msg_info.msg->body->data, 706 rdata->msg_info.msg->body->len, &offer); 707 if (status != PJ_SUCCESS) { 708 pjsua_perror(THIS_FILE, "Error parsing SDP in incoming INVITE", status); 709 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 400, NULL, 710 NULL, NULL); 711 pjsua_media_channel_deinit(call->index); 712 PJSUA_UNLOCK(); 713 return PJ_TRUE; 714 } 715 } else { 716 offer = NULL; 717 } 718 719 /* Get media capability from media endpoint: */ 720 status = pjsua_media_channel_create_sdp(call->index, rdata->tp_info.pool, 721 offer, &answer); 722 if (status != PJ_SUCCESS) { 723 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL, 724 NULL, NULL); 725 pjsua_media_channel_deinit(call->index); 726 PJSUA_UNLOCK(); 727 return PJ_TRUE; 728 } 729 645 730 /* Verify that we can handle the request. */ 646 731 options |= PJSIP_INV_SUPPORT_100REL; … … 648 733 options |= PJSIP_INV_REQUIRE_100REL; 649 734 650 status = pjsip_inv_verify_request (rdata, &options, answer, NULL,651 pjsua_var.endpt, &response);735 status = pjsip_inv_verify_request2(rdata, &options, offer, answer, NULL, 736 pjsua_var.endpt, &response); 652 737 if (status != PJ_SUCCESS) { 653 738 … … 1339 1424 1340 1425 /* Init media channel */ 1341 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC); 1426 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC, 1427 get_secure_level(&dlg->remote.info_str)); 1342 1428 if (status != PJ_SUCCESS) { 1343 1429 pjsua_perror(THIS_FILE, "Error initializing media channel", status); … … 1349 1435 PJ_UNUSED_ARG(unhold); 1350 1436 PJ_TODO(create_active_inactive_sdp_based_on_unhold_arg); 1351 status = pjsua_media_channel_create_sdp(call->index, call->inv->pool, &sdp); 1437 status = pjsua_media_channel_create_sdp(call->index, call->inv->pool, 1438 NULL, &sdp); 1352 1439 if (status != PJ_SUCCESS) { 1353 1440 pjsua_perror(THIS_FILE, "Unable to get SDP from media endpoint", … … 1407 1494 1408 1495 /* Init media channel */ 1409 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC); 1496 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC, 1497 get_secure_level(&dlg->remote.info_str)); 1410 1498 if (status != PJ_SUCCESS) { 1411 1499 pjsua_perror(THIS_FILE, "Error initializing media channel", status); … … 1415 1503 1416 1504 /* Create SDP */ 1417 status = pjsua_media_channel_create_sdp(call->index, call->inv->pool, &sdp); 1505 status = pjsua_media_channel_create_sdp(call->index, call->inv->pool, 1506 NULL, &sdp); 1418 1507 if (status != PJ_SUCCESS) { 1419 1508 pjsua_perror(THIS_FILE, "Unable to get SDP from media endpoint", … … 2356 2445 { 2357 2446 pjsua_call *call; 2358 const pjmedia_sdp_session *local_sdp; 2447 const pjmedia_sdp_session *c_local; 2448 pjmedia_sdp_session *local_sdp; 2359 2449 const pjmedia_sdp_session *remote_sdp; 2360 2450 … … 2385 2475 2386 2476 /* Get local and remote SDP */ 2387 status = pjmedia_sdp_neg_get_active_local(call->inv->neg, & local_sdp);2477 status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &c_local); 2388 2478 if (status != PJ_SUCCESS) { 2389 2479 pjsua_perror(THIS_FILE, … … 2394 2484 return; 2395 2485 } 2486 local_sdp = (pjmedia_sdp_session*) c_local; 2396 2487 2397 2488 status = pjmedia_sdp_neg_get_active_remote(call->inv->neg, &remote_sdp); … … 2525 2616 status = create_inactive_sdp( call, &answer ); 2526 2617 } else { 2618 int secure_level; 2527 2619 2528 2620 PJ_LOG(4,(THIS_FILE, "Call %d: received updated media offer", … … 2530 2622 2531 2623 /* Init media channel */ 2532 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAS); 2624 secure_level = get_secure_level(&call->inv->dlg->remote.info_str); 2625 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAS, 2626 secure_level); 2533 2627 if (status != PJ_SUCCESS) { 2534 2628 pjsua_perror(THIS_FILE, "Error initializing media channel", status); … … 2537 2631 } 2538 2632 2539 status = pjsua_media_channel_create_sdp(call->index, call->inv->pool, &answer); 2633 status = pjsua_media_channel_create_sdp(call->index, call->inv->pool, 2634 offer, &answer); 2540 2635 } 2541 2636 … … 2577 2672 status = create_inactive_sdp( call, offer ); 2578 2673 } else { 2674 int secure_level; 2579 2675 2580 2676 PJ_LOG(4,(THIS_FILE, "Call %d: asked to send a new offer", … … 2582 2678 2583 2679 /* Init media channel */ 2584 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC); 2680 secure_level = get_secure_level(&call->inv->dlg->remote.info_str); 2681 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC, 2682 secure_level); 2585 2683 if (status != PJ_SUCCESS) { 2586 2684 pjsua_perror(THIS_FILE, "Error initializing media channel", status); … … 2589 2687 } 2590 2688 2591 status = pjsua_media_channel_create_sdp(call->index, call->inv->pool, offer); 2689 status = pjsua_media_channel_create_sdp(call->index, call->inv->pool, 2690 NULL, offer); 2592 2691 } 2593 2692 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r1705 r1735 88 88 cfg->thread_cnt = 1; 89 89 cfg->nat_type_in_sdp = 1; 90 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 91 cfg->use_srtp = PJSUA_DEFAULT_USE_SRTP; 92 cfg->srtp_secure_signaling = PJSUA_DEFAULT_SRTP_SECURE_SIGNALING; 93 #endif 90 94 } 91 95 … … 143 147 cfg->ka_interval = 15; 144 148 cfg->ka_data = pj_str("\r\n"); 149 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 150 cfg->use_srtp = pjsua_var.ua_cfg.use_srtp; 151 cfg->srtp_secure_signaling = pjsua_var.ua_cfg.srtp_secure_signaling; 152 #endif 145 153 } 146 154 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r1704 r1735 535 535 goto on_error; 536 536 } 537 537 538 status = pjmedia_transport_udp_attach(pjsua_var.med_endpt, NULL, 538 539 &skinfo, 0, … … 544 545 } 545 546 546 pjmedia_transport_ udp_simulate_lost(pjsua_var.calls[i].med_tp,547 548 549 550 pjmedia_transport_ udp_simulate_lost(pjsua_var.calls[i].med_tp,551 552 547 pjmedia_transport_simulate_lost(pjsua_var.calls[i].med_tp, 548 PJMEDIA_DIR_ENCODING, 549 pjsua_var.media_cfg.tx_drop_pct); 550 551 pjmedia_transport_simulate_lost(pjsua_var.calls[i].med_tp, 552 PJMEDIA_DIR_DECODING, 553 pjsua_var.media_cfg.rx_drop_pct); 553 554 554 555 } … … 646 647 } 647 648 648 pjmedia_ ice_simulate_lost(pjsua_var.calls[i].med_tp,649 PJMEDIA_DIR_ENCODING,650 pjsua_var.media_cfg.tx_drop_pct);651 652 pjmedia_ ice_simulate_lost(pjsua_var.calls[i].med_tp,653 PJMEDIA_DIR_DECODING,654 pjsua_var.media_cfg.rx_drop_pct);649 pjmedia_transport_simulate_lost(pjsua_var.calls[i].med_tp, 650 PJMEDIA_DIR_ENCODING, 651 pjsua_var.media_cfg.tx_drop_pct); 652 653 pjmedia_transport_simulate_lost(pjsua_var.calls[i].med_tp, 654 PJMEDIA_DIR_DECODING, 655 pjsua_var.media_cfg.rx_drop_pct); 655 656 656 657 status = pjmedia_ice_start_init(pjsua_var.calls[i].med_tp, 0, &addr, … … 745 746 746 747 pj_status_t pjsua_media_channel_init(pjsua_call_id call_id, 747 pjsip_role_e role) 748 pjsip_role_e role, 749 int security_level) 748 750 { 749 751 pjsua_call *call = &pjsua_var.calls[call_id]; 750 752 751 if (pjsua_var.media_cfg.enable_ice) { 752 pj_ice_sess_role ice_role; 753 pj_status_t status; 754 755 ice_role = (role==PJSIP_ROLE_UAC ? PJ_ICE_SESS_ROLE_CONTROLLING : 756 PJ_ICE_SESS_ROLE_CONTROLLED); 757 758 /* Restart ICE */ 759 pjmedia_ice_stop_ice(call->med_tp); 760 761 status = pjmedia_ice_init_ice(call->med_tp, ice_role, NULL, NULL); 762 if (status != PJ_SUCCESS) 763 return status; 764 } 765 766 return PJ_SUCCESS; 767 } 768 769 pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id, 770 pj_pool_t *pool, 771 pjmedia_sdp_session **p_sdp) 772 { 773 pjmedia_sdp_session *sdp; 774 pjmedia_sock_info skinfo; 775 pjsua_call *call = &pjsua_var.calls[call_id]; 753 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 754 pjsua_acc *acc = &pjsua_var.acc[call->acc_id]; 755 pjmedia_srtp_setting srtp_opt; 756 pjmedia_transport *srtp; 776 757 pj_status_t status; 758 #endif 759 760 PJ_UNUSED_ARG(role); 777 761 778 762 /* Return error if media transport has not been created yet … … 783 767 } 784 768 769 /* Stop media transport (for good measure!) */ 770 pjmedia_transport_media_stop(call->med_tp); 771 772 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 773 /* Check if SRTP requires secure signaling */ 774 if (acc->cfg.use_srtp != PJMEDIA_SRTP_DISABLED) { 775 if (security_level < acc->cfg.srtp_secure_signaling) { 776 return PJSIP_ESESSIONINSECURE; 777 } 778 } 779 780 /* Always create SRTP adapter */ 781 pjmedia_srtp_setting_default(&srtp_opt); 782 srtp_opt.close_member_tp = PJ_FALSE; 783 srtp_opt.use = acc->cfg.use_srtp; 784 status = pjmedia_transport_srtp_create(pjsua_var.med_endpt, 785 call->med_tp, 786 &srtp_opt, &srtp); 787 if (status != PJ_SUCCESS) 788 return status; 789 790 /* Set SRTP as current media transport */ 791 call->med_orig = call->med_tp; 792 call->med_tp = srtp; 793 #else 794 call->med_orig = call->med_tp; 795 PJ_UNUSED_ARG(security_level); 796 #endif 797 798 return PJ_SUCCESS; 799 } 800 801 pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id, 802 pj_pool_t *pool, 803 const pjmedia_sdp_session *rem_sdp, 804 pjmedia_sdp_session **p_sdp) 805 { 806 enum { MAX_MEDIA = 1, MEDIA_IDX = 0 }; 807 pjmedia_sdp_session *sdp; 808 pjmedia_sock_info skinfo; 809 pjsua_call *call = &pjsua_var.calls[call_id]; 810 pj_status_t status; 811 812 /* Return error if media transport has not been created yet 813 * (e.g. application is starting) 814 */ 815 if (call->med_tp == NULL) { 816 return PJ_EBUSY; 817 } 818 785 819 /* Get media socket info */ 786 820 pjmedia_transport_get_info(call->med_tp, &skinfo); 787 821 788 822 /* Create SDP */ 789 status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, pool, 1,823 status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, pool, MAX_MEDIA, 790 824 &skinfo, &sdp); 791 825 if (status != PJ_SUCCESS) … … 816 850 } 817 851 818 if (pjsua_var.media_cfg.enable_ice) {819 status = pjmedia_ice_modify_sdp(call->med_tp, pool, sdp); 820 if (status != PJ_SUCCESS)821 goto on_error; 822 } 852 /* Give the SDP to media transport */ 853 status = pjmedia_transport_media_create(call->med_tp, pool, 854 sdp, rem_sdp, MEDIA_IDX); 855 if (status != PJ_SUCCESS) 856 goto on_error; 823 857 824 858 *p_sdp = sdp; … … 859 893 stop_media_session(call_id); 860 894 861 if (pjsua_var.media_cfg.enable_ice) { 862 pjmedia_ice_stop_ice(call->med_tp); 863 } 864 895 pjmedia_transport_media_stop(call->med_tp); 896 897 if (call->med_tp != call->med_orig) { 898 pjmedia_transport_close(call->med_tp); 899 call->med_tp = call->med_orig; 900 } 865 901 return PJ_SUCCESS; 866 902 } … … 878 914 pjsua_call_id call_id; 879 915 880 call_id = (pjsua_call_id) user_data;916 call_id = (pjsua_call_id)(long)user_data; 881 917 pjsua_var.ua_cfg.cb.on_dtmf_digit(call_id, digit); 882 918 } … … 885 921 886 922 pj_status_t pjsua_media_channel_update(pjsua_call_id call_id, 887 constpjmedia_sdp_session *local_sdp,923 pjmedia_sdp_session *local_sdp, 888 924 const pjmedia_sdp_session *remote_sdp) 889 925 { … … 912 948 for (i=0; i < sess_info.stream_cnt; ++i) { 913 949 if (sess_info.stream_info[i].type == PJMEDIA_TYPE_AUDIO && 914 sess_info.stream_info[i].proto == PJMEDIA_TP_PROTO_RTP_AVP) 950 (sess_info.stream_info[i].proto == PJMEDIA_TP_PROTO_RTP_AVP || 951 sess_info.stream_info[i].proto == PJMEDIA_TP_PROTO_RTP_SAVP)) 915 952 { 916 953 si = &sess_info.stream_info[i]; … … 946 983 call->media_dir = PJMEDIA_DIR_NONE; 947 984 948 /* Shutdown ICE session */ 949 if (pjsua_var.media_cfg.enable_ice) { 950 pjmedia_ice_stop_ice(call->med_tp); 951 } 985 /* Shutdown transport's session */ 986 pjmedia_transport_media_stop(call->med_tp); 952 987 953 988 /* No need because we need keepalive? */ 954 989 955 990 } else { 956 /* Start ICE */ 957 if (pjsua_var.media_cfg.enable_ice) { 958 status = pjmedia_ice_start_ice(call->med_tp, call->inv->pool, 959 remote_sdp, 0); 960 if (status != PJ_SUCCESS) 961 return status; 962 } 991 /* Start media transport */ 992 status = pjmedia_transport_media_start(call->med_tp, 993 call->inv->pool, 994 local_sdp, remote_sdp, 0); 995 if (status != PJ_SUCCESS) 996 return status; 963 997 964 998 /* Override ptime, if this option is specified. */ … … 1001 1035 pjmedia_session_set_dtmf_callback(call->session, 0, 1002 1036 &dtmf_callback, 1003 (void*)( call->index));1037 (void*)(long)(call->index)); 1004 1038 } 1005 1039
Note: See TracChangeset
for help on using the changeset viewer.