Commit Graph

110 Commits

Author SHA1 Message Date
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
Benny Prijono 329d638568 Integration of Sipit24 branch, many tickets involved:
- #793: AMR encoder should regard 'mode-set' param specified by remote decoder.
 - #831: Automatically switch to TCP transport when sending large request
 - #832: Support for outbound proxy setting without using Route header
 - #849: Modify conference audio switch behavior in connecting ports.
 - #850: Remove 'Require=replaces' param in 'Refer-To' header (in call transfer with replaces).
 - #851: Support for regular nomination in ICE
 - #852: --ip-addr support for IPv6 for media transport in pjsua
 - #854: Adding SOFTWARE attribute in all outgoing requests may cause compatibility problem with older STUN server (thanks Alexei Kuznetsov for the report)
 - #855: Bug in digit map frequencies for DTMF digits (thanks FCCH for the report)
 - #856: Put back the ICE candidate priority values according to the default values in the draft-mmusic-ice
 - #857: Support for ICE keep-alive with Binding indication
 - #858: Do not authenticate STUN 438 response
 - #859: AMR-WB format param in the SDP is not negotiated correctly.
 - #867: Return error instead of asserting when PJSUA-LIB fails to open log file




git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2724 74dad513-b988-da41-8d7b-12977e46ad98
2009-05-29 13:04:03 +00:00
Benny Prijono 8440eee1bf Part of ticket #780: enhance the PJNATH doxygen documentation
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2642 74dad513-b988-da41-8d7b-12977e46ad98
2009-04-22 17:20:24 +00:00
Benny Prijono d9dd8657e8 More ticket #780: fixed compilation errors due to previous modifications related to TURN
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2591 74dad513-b988-da41-8d7b-12977e46ad98
2009-04-13 18:40:10 +00:00
Benny Prijono 0f327c95a5 Ticket #780: Update TURN from draft 09 to draft 13:
- new rules for permissions:
    - permission must be created and refreshed explicitly with CreatePermission
    - transmitting data does not refresh permission
 - attributes changed/added: XOR-PEER-ADDRESS, XOR-RELAYED-ADDRESS, EVEN-PORT, DONT-FRAGMENT
 - attribute(s) removed: REQUESTED-PROPS
 - new status codes: 401 (Forbidden), 507 (Insufficient Capacity)
 - removed status codes: 443 (Invalid IP address), 444 (Invalid Port), 508 (Insufficient Port Capacity)



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2589 74dad513-b988-da41-8d7b-12977e46ad98
2009-04-13 08:54:10 +00:00
Benny Prijono 0fc2c6bb34 Part of ticket #780 (work in progress): added IPv6 support to various STUN attributes and added the test from draft-ietf-behave-stun-test-vectors
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2580 74dad513-b988-da41-8d7b-12977e46ad98
2009-04-07 09:42:58 +00:00
Benny Prijono 9158a3a88e Ticket #742: Change in mapped/STUN IP address does not update ICE srflx candidate (thanks Alexei Kuznetsov for the report)
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2484 74dad513-b988-da41-8d7b-12977e46ad98
2009-03-04 12:56:32 +00:00
Benny Prijono 844653c1f2 Updated copyright notice in all files to Teluu Inc., and changed the year as well
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2394 74dad513-b988-da41-8d7b-12977e46ad98
2008-12-23 17:27:53 +00:00
Nanang Izzuddin 838cb32cc4 Cleaned up compile warnings (on gcc 4.0.1).
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2386 74dad513-b988-da41-8d7b-12977e46ad98
2008-12-18 17:52:57 +00:00
Benny Prijono efa014b4ea Ticket #598: Update to draft-ietf-behave-rfc3489bis-18 and draft-ietf-behave-turn-09, and fix other things as well. Please see the ticket for more info
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2234 74dad513-b988-da41-8d7b-12977e46ad98
2008-08-22 17:46:33 +00:00
Benny Prijono a18dad99c8 Optimize the number of characters written to SDP by ICE
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2054 74dad513-b988-da41-8d7b-12977e46ad98
2008-06-25 21:16:46 +00:00
Benny Prijono 074db79551 Added more API to initialize STUN message and attributes without pool
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2044 74dad513-b988-da41-8d7b-12977e46ad98
2008-06-21 17:51:31 +00:00
Benny Prijono 7ce74135ed Fixed bug with authenticating STUN messages when unrecognized/unknown non-mandatory STUN attribute is present in the message
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2041 74dad513-b988-da41-8d7b-12977e46ad98
2008-06-21 12:36:56 +00:00
Benny Prijono 5b64b8df4b Updated doxygen documentations
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2037 74dad513-b988-da41-8d7b-12977e46ad98
2008-06-20 21:39:02 +00:00
Benny Prijono ed6bd028f8 Added new API's in ICE stream transport to assist offer/answer negotiation: pj_ice_strans_has_sess(), pj_ice_strans_sess_is_running(), pj_ice_strans_sess_is_complete(), pj_ice_strans_get_running_comp_cnt(), pj_ice_strans_get_ufrag_pwd(), and PJNATH_EICEMISMATCH error code.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2031 74dad513-b988-da41-8d7b-12977e46ad98
2008-06-19 13:54:21 +00:00
Benny Prijono 0890fb6d16 Fixed more mismatch decl/def function specifications (thanks Samuel Vinson)
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1997 74dad513-b988-da41-8d7b-12977e46ad98
2008-06-07 11:23:27 +00:00
Benny Prijono ff1df04070 Major major modifications related to ticket #485 (support for TURN-07):
- Added STUN socket transport pj_stun_sock
 - Integration of TURN-07 to ICE
 - Major refactoring in ICE stream transport to make it simpler
 - Major modification (i.e. API change) in almost everywhere else
 - Much more elaborate STUN, TURN, and ICE tests in pjnath-test



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1988 74dad513-b988-da41-8d7b-12977e46ad98
2008-06-06 14:47:10 +00:00
Benny Prijono e7226850ad More ticket #485: fixed TURN server permission not allowing peer with the same IP to get through, and added option to disable FINGERPRINT verification in TURN server since it is currently broken when TURN is used with ICE (which has a FINGERPRINT in its Binding Request)
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1924 74dad513-b988-da41-8d7b-12977e46ad98
2008-04-13 21:48:44 +00:00