Commit Graph

127 Commits

Author SHA1 Message Date
Nanang Izzuddin 1dab9b63ac
Add TLS/SSL backend: Windows Schannel (#3867) 2024-05-08 10:25:03 +07:00
Fil 70332e3510
Rephrase some type definitions in the docs for a better understanding (#3880) 2024-03-12 10:28:42 +08:00
Riza Sulistyo d51e247135
Add option to disable renegotiation on TLSv1.2 or earlier (#3663)
* Add option to enable SSL_OP_NO_RENEGOTIATION on OpenSSL

* Add the option to runtime configuration

* Modification based on comments

* Add the implementation files and pjsua2 modification
2023-08-23 09:52:04 +07:00
sauwming 66c101f3d3
Add API to shutdown TURN session with the appropriate error status (#3392)
* Add pj_turn_session_shutdown2()

* Minor: fix indentation
2023-02-20 19:00:57 +08:00
Nanang Izzuddin d8440f4d71
Merge pull request from GHSA-9pfh-r8x4-w26w
* Fix buffer overread in STUN message decoder

* Updates based on comments
2022-12-20 12:39:12 +08:00
Riza Sulistyo 5ac9104514
Expand tab to spaces and remove $Id$ (#3292) 2022-11-22 16:26:54 +07:00
sauwming 40a06fba2c Misc (re #3087): Update iOS sample app projects and fix build warnings 2022-11-01 12:02:49 +08:00
Benny Prijono c03ab41ed5
Documentation fixes for docs.pjsip.org v2.0 project (#3202)
* Improve robustness of sample apps. Fixing crash in aviplay

* Changes in documentation

* Add first pjsua2 hello world sample (from PJSUA2 guide)

* Fix doxygen documentation for docs.pjsip.org v2

* Add make clean-doc target

* Replace Trac ticket URL with GitHub issues URL

* Remove pjsip-book because the correct one is in pjproject_docs
2022-08-09 06:16:16 +07:00
sauwming 8861441ec8
Move UPnP to PJNATH (#3195) 2022-07-29 17:05:28 +08:00
Marcus Froeschl 30ca7186db
Fix compiler warning C4819 (Unicode character in ANSI file) (#3022) 2022-03-25 17:30:10 +08:00
Nanang Izzuddin c6e238d2a3
Avoid memory bloat on ICE restart (#2903) 2021-12-15 09:05:20 +07:00
Riza Sulistyo 6ca06f63ec
Fix some doc warning (#2879) 2021-11-10 09:57:40 +07:00
Momo Takanashi 6a700a6276
Added pj_turn_sock_connect for TURN TCP Allocations (#2754) 2021-07-13 11:17:59 +07:00
sauwming f0ff5817d0
Fix double free of stun session (#2709) 2021-05-17 09:56:27 +08:00
Nanang Izzuddin 79531cbc05
More works on Trickle ICE (#2667)
- Improve trickling state management (fix no SIP INFO when initial INVITE responded immediately with 200, strayed SIP INFO after trickling is done, etc).
- Fix issues when rtcp-mux is enabled.
- Allow process incoming SIP INFO before receiving remote SDP.
- Use regular ICE on re-INVITE (with reinit media flag).
- Avoid calling pj_ice_strans_get_running_comp_cnt() for loop condition.
- Fix bug in pjnath-test: TURN server set wrong peer channel number.
- Added timer for end-of-candidate indication from remote & don't flag ice-mismatch if remote uses default address in trickle ICE
2021-03-17 13:00:01 +07:00
Nanang Izzuddin 25c5eea417 Trickle ICE (re #2588):
- Fix premature end-of-candidate indication.
- Fix premature ICE session destroy in sending INFO (update remote with local candidates).
- Fix assertion when foundation list is full.
- Fix assertion when pruned check is completed/timed-out.
- Minor, missing 'static' for internal functions.
2021-03-10 10:05:45 +07:00
Nanang Izzuddin d65cacddd3
Implement trickle ICE (#2588)
Squash & merge trickle-ice dev branch to master.
2020-12-11 09:40:57 +07:00
Nanang Izzuddin bd9dff4b02
Media loss after 5 minutes when using ICE+TURN (#2503)
- Assign unique local preferences for candidates with the same type.
- Update component's valid pair condition, instead of just the highest priority, also consider 'nominated' flag.
- Add new compile-time setting PJ_ICE_ST_USE_TURN_PERMANENT_PERM, if set, TURN client session will automatically renew permission for all remote candidates.
- Update local preference for peer reflexive candidate.
- Also update PRIORITY field value in performing connectivity check: use unique local pref (with peer-reflexive candidate type).
- Fix local preference mask for non-standard ICE prio calculation.
2020-08-18 13:03:44 +07:00
jrun 645611d8a9
ice_strans: add on_valid_pair() to callbacks (#2433)
Related to #2263
2020-05-20 12:16:10 +08:00
Riza Sulistyo 71ff006510 Close #2263: Add callback to notify when first valid pair is found on ICE negotiation.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@6139 74dad513-b988-da41-8d7b-12977e46ad98
2020-01-28 03:51:50 +00:00
Sauw Ming d024a392ec Fixed #2229: Limitations in ICE data sending
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@6071 74dad513-b988-da41-8d7b-12977e46ad98
2019-09-23 07:25:41 +00:00
Nanang Izzuddin 8b06775a7b Fix #2230: Fixed crash in STUN session due to race condition which leads to premature tdata destroy.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@6069 74dad513-b988-da41-8d7b-12977e46ad98
2019-09-12 08:46:05 +00:00
Riza Sulistyo 765e804fda Close #1017: TURN TLS transport implementation.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@6004 74dad513-b988-da41-8d7b-12977e46ad98
2019-05-24 03:32:17 +00:00
Nanang Izzuddin fa6616c43c Close #2197: Support TURN extensions for TCP allocations (RFC 6062).
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5987 74dad513-b988-da41-8d7b-12977e46ad98
2019-05-14 09:31:39 +00:00
Sauw Ming fd5674b334 Fixed #2136: Increase default ICE password length as mandated by the RFC
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5850 74dad513-b988-da41-8d7b-12977e46ad98
2018-08-01 08:34:19 +00:00
Sauw Ming c6dfde7616 Fixed #1966:
* Add option to specify default address family in ICE default candidate
* As answerer, match the address family in the SDP offer if possible.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5562 74dad513-b988-da41-8d7b-12977e46ad98
2017-03-03 02:11:02 +00:00
Sauw Ming 532eba77fc Re #1945 (misc): Add an alias REQUESTED-ADDRESS-FAMILY (which is used in the RFC 6156) for REQUESTED-ADDRESS-TYPE (which is used in the draft). Change the string literal to use the RFC version.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5527 74dad513-b988-da41-8d7b-12977e46ad98
2017-01-18 03:50:32 +00:00
Nanang Izzuddin 651b791867 Re #1971: Request IPv4 relay address to an IPv6 TURN server for IPv6-IPv4 connectivity.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5481 74dad513-b988-da41-8d7b-12977e46ad98
2016-11-14 06:13:01 +00:00
Sauw Ming b4e1c4800c Re #422: IPv6 support for NAT detect
Add API pj_stun_detect_nat_type2()



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5359 74dad513-b988-da41-8d7b-12977e46ad98
2016-06-28 06:33:20 +00:00
Nanang Izzuddin 4d07fcf756 Re #422: Added IPv6 support to PJNATH, changes:
- Deprecated 'pj_ice_strans_cfg.af', if set, the value will be ignored, address family setting is now specified via transport setting, i.e: 'pj_ice_strans_cfg.stun_tp/turn_tp'.
 - Deprecated 'pj_ice_strans_cfg.stun/turn', for backward compatibility, this field value will be checked if 'pj_ice_strans_cfg.stun_tp_cnt/turn_tp_cnt' is set to zero.
 - Added 'pj_ice_strans_stun_cfg' & 'pj_ice_strans_stun_cfg' and the corresponding 'pj_ice_strans_stun/turn_cfg_default()'
 - Added 'pj_ice_strans_cfg.stun_tp/turn_tp' as replacement of 'pj_ice_strans_cfg.stun/turn', it is now an array so app can have multiple STUN/TURN transports.
 - Added macro PJ_ICE_MAX_STUN/TURN to specify maximum number of STUN/TURN transports in each ICE component in compile-time.
 - Miscellaneous: fixed socket number limit in concurrency test in pjnath-test, updated pjsua_media.c to use new 'pj_ice_strans_cfg' setting.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5339 74dad513-b988-da41-8d7b-12977e46ad98
2016-06-08 03:17:45 +00:00
Sauw Ming 0ced8c9cdd Fixed #1913: Add callback for address change notification from STUN keep alive
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5282 74dad513-b988-da41-8d7b-12977e46ad98
2016-05-09 03:29:28 +00:00
Nanang Izzuddin bc2f742bbf Misc (re #1882): Added include header guard to pjnath.h.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5203 74dad513-b988-da41-8d7b-12977e46ad98
2015-12-01 07:04:45 +00:00
Sauw Ming 7e067e0ca7 Fixed #1815: Race condition of STUN transaction destruction
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4983 74dad513-b988-da41-8d7b-12977e46ad98
2015-02-13 11:34:26 +00:00
Sauw Ming a179899278 Fixed #1674: Deadlock when third party media employs external lock and ICE is active
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4606 74dad513-b988-da41-8d7b-12977e46ad98
2013-10-01 05:00:57 +00:00
Nanang Izzuddin 1c3e8fbdf1 Fix #1700: Added PJ_ICE_CAND_TYPE_MAX to represent the number ICE candidate types.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4602 74dad513-b988-da41-8d7b-12977e46ad98
2013-09-25 04:57:26 +00:00
Nanang Izzuddin 69498fb477 Close #1681:
- Added compile-time settings PJMEDIA_TRANSPORT_SO_RCVBUF_SIZE and PJMEDIA_TRANSPORT_SO_SNDBUF_SIZE. The default values are both 64 KB when PJMEDIA_HAS_VIDEO is set, otherwise just zero (socket buffer size uses OS default). The settings will be applied to media transport UDP and ICE.
 - Also added run-time settings so_sndbuf_size and so_rcvbuf_size into ICE stream transport, STUN socket, and TURN socket. Default values are all zero.




git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4538 74dad513-b988-da41-8d7b-12977e46ad98
2013-06-19 09:06:55 +00:00
Benny Prijono e00cbe02e9 Fixed #1617: major synchronization fixes in PJNATH with incorporation of group lock to avoid deadlock and crashes due to race conditions
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4360 74dad513-b988-da41-8d7b-12977e46ad98
2013-02-21 11:26:35 +00:00
Sauw Ming 462e6c18f5 Fixed #1620: Fix the calculation of transmission count during retransmission of STUN request
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4352 74dad513-b988-da41-8d7b-12977e46ad98
2013-02-19 14:37:28 +00:00
Nanang Izzuddin a2174066e7 Close #1602: configurable local port range for ICE transport.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4343 74dad513-b988-da41-8d7b-12977e46ad98
2013-02-07 09:35:34 +00:00
Nanang Izzuddin 1e42a67b06 Re: Added compile-time setting PJNATH_STUN_SOFTWARE_NAME to specify SOFTWARE attribute for STUN sessions.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4199 74dad513-b988-da41-8d7b-12977e46ad98
2012-07-05 10:52:55 +00:00
Nanang Izzuddin 3bb260a28d Fix #1547:
- Added PJMEDIA_MAX_MRU to specify maximum packet size in receiving direction.
 - Added max_pkt_size into pj_turn_sock_cfg, default is PJ_TURN_MAX_PKT_LEN.
 - Fixed hardcoded MTU settings in media transport SRTP.
 - Added MIN_CHUNKS_PER_FRM constant in video stream.

Notes:
 - PJMEDIA_MAX_MTU & PJMEDIA_MAX_MRU to specify max packet size for TX and RX dir.
 - For ICE media transport, TURN session limits outgoing packet size to PJ_TURN_MAX_PKT_LEN (the size of internal buffer for inserting TURN overheads).



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4197 74dad513-b988-da41-8d7b-12977e46ad98
2012-07-05 07:26:29 +00:00
Benny Prijono 8534076c29 Re #1548: Crash due to racing condition in timer when call is disconnected quickly (thanks Joshua Colp for the report!)
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4196 74dad513-b988-da41-8d7b-12977e46ad98
2012-07-05 07:02:50 +00:00
Benny Prijono fe9bf3079b Fixed #1512: added Option to continue ICE operation even when STUN resolution fails
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4133 74dad513-b988-da41-8d7b-12977e46ad98
2012-05-21 14:00:17 +00:00
Nanang Izzuddin a62ffc9d03 Re #1250: Updated the year in all copyright texts with 2011!
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3553 74dad513-b988-da41-8d7b-12977e46ad98
2011-05-05 06:14:19 +00:00
Benny Prijono 4d6ff4d62c Fixed #1077: In ICE stream transport (ice_strans.c), automaticaly retry allocation once if TURN allocation fails. If this allocation retry also fails, notify the TURN user via on_ice_complete() callback. Details:
- added new PJ_ICE_STRANS_OP_KEEP_ALIVE operation
 - also added new on_ice_transport_error() pjsua callback to allow application to react to the failure.


git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3212 74dad513-b988-da41-8d7b-12977e46ad98
2010-06-19 12:35:33 +00:00
Benny Prijono 87b347ed3b Make TURN pool memory sizes compile-time configurable (misc, re: #1068)
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3197 74dad513-b988-da41-8d7b-12977e46ad98
2010-06-03 16:18:11 +00:00
Benny Prijono a6ff3af6fe Misc (#1026): added more documentation for PJNATH_EICEFAILED error code
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3118 74dad513-b988-da41-8d7b-12977e46ad98
2010-03-08 03:25:17 +00:00
Benny Prijono 41903da982 Fixed ticket #999:
Several bug fixes to the TURN client library and icedemo sample application:

 1. ICE stream transport reports ICE initialization/candidate gathering stage as successful even when TURN client TCP connection has failed.
 2. Bad ChannelData framing when TCP is used. PJNATH did not properly add padding to the TURN ChannelData packet if TCP is used and the data is not aligned to four bytes boundary. Similarly incoming ChannelData with padding (over TCP) may not be handled correctly.
 3. Incoming data over TCP may be delayed. PJNATH only processed one frame (be it request, indication, or ChannelData) on an incoming stream, so if the stream contains more than one frames, the processing of subsequent frames will be delayed until more stream is received on the TCP transport.
 4. The icedemo sample application overwrites the incoming packet buffer with NULL character ('\0') before printing the message to console. If there is another packet after current packet (as often happens when TCP is used), the subsequent packet will get corrupted. 

The combinations of bugs above may cause PJNATH to return "Invalid STUN message length (PJNATH_EINSTUNMSGLEN)" error when processing incoming TURN ChannelData message over TCP.

And a small enhancement:

  1. Add logging to file option to icedemo sample. 

Thanks Sarun Nandakumar for the report.




git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3028 74dad513-b988-da41-8d7b-12977e46ad98
2009-12-08 13:11:25 +00:00
Benny Prijono 4d79b0f7f1 Initial commit for ticket #950: QoS support:
- implementation:
     - PJLIB (sock_qos*.*)
 - added QoS support in:
     - SIP UDP transport, 
     - SIP TCP transport,
     - media UDP transport (done in pjsua-lib), 
     - pjnath ICE stream transport,
     - pjnath STUN socket,
     - pjnath TURN client
 - added QoS options in pjsua-lib:
     - QoS fields in pjsua_transport_config
 - added "--set-qos" parameter in pjsua

Notes:
 - QoS in TLS transport is not yet implemented, waiting for #957
 - build ok on VS6, VS2005 (multiple targets), Carbide, and Mingw
 - no run-time testing yet



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2966 74dad513-b988-da41-8d7b-12977e46ad98
2009-10-25 09:02:07 +00:00
Benny Prijono f5d9f1f381 Ticket #881: send UPDATE or re-INVITE after ICE negotiation, if the default candidate has changed
- done
 - added pj_ice_strans_state (to be used for informational purposes for now)
 - added pjmedia ICE transport specific info, and display it in call dump output
 - misc fixes (changed pjmedia_transport_info.spec_info_cnt from int to unsigned)


git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2945 74dad513-b988-da41-8d7b-12977e46ad98
2009-10-14 13:13:18 +00:00