Commit Graph

5340 Commits

Author SHA1 Message Date
Nanang Izzuddin 8dc264454d Close #2101:
- set atomic's mutex to NULL in atomic destroy
 - added few sanity checks to the atomic functions.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5758 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-26 10:33:50 +00:00
Sauw Ming cea6909212 Re #2059: Fixed the ordering of CXXFLAGS to prevent build issue on Android, such as below:
In file included from /android-ndk-r15c/platforms/android-15/arch-arm/usr/include/linux/posix_types.h:41:0,
                 from /android-ndk-r15c/platforms/android-15/arch-arm/usr/include/sys/types.h:37,
                 from /android-ndk-r15c/platforms/android-15/arch-arm/usr/include/stdio.h:50,
                 from ../../pjlib/include/pj/compat/string.h:39,
                 from ../../pjlib/include/pj/string.h:29,
                 from ../include/pjmedia/frame.h:28,
                 from ../include/pjmedia/port.h:30,
                 from ../include/pjmedia/codec.h:29,
                 from ../include/pjmedia-codec/types.h:29,
                 from ../include/pjmedia-codec/openh264.h:22,
                 from ../src/pjmedia-codec/openh264.cpp:19:
/android-ndk-r15c/sysroot/usr/include/arm-linux-androideabi/asm/posix_types.h:33:37: fatal error: asm-generic/posix_types.h: No such file or directory
 #include <asm-generic/posix_types.h>



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5757 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-19 00:26:55 +00:00
Sauw Ming 17d09ee571 Re #2059: Allow multiple codecs in SDP answer when creating SDP neg with remote offer
Thanks to Alexey Ermoshin for the patch.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5756 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-16 07:54:41 +00:00
Nanang Izzuddin 922b4e2ed6 Close #2100:
- Added new APIs:
   * PJMEDIA: pjmedia_srtp_enum_crypto(), pjmedia_srtp_enum_keying()
   * PJSUA: pjsua_config.srtp_opt, pjsua_acc_config.srtp_opt, pjsua_srtp_opt_default()
   * PJSUA2: AccountMediaConfig::srtpOpt, Endpoint::srtpCryptoEnum()
 - Deprecated PJSUA callback on_create_media_transport_srtp() (not removed yet, just warnings).
 - Slightly refactored SRTP code:
   * Fixed potential issue with on_create_media_transport_srtp(), some PJSUA internal values in pjmedia_srtp_setting may be overridden by app.
   * Fixed few issues in SRTP and keying mechanism, e.g: premature local SDP modification (it should be done after verification).
   * Potential minor backward compatibility issue: default value of pjmedia_srtp_setting.crypto_count is now zero, previously it was initialized with all crypto via pjmedia_srtp_setting_default(), actually zero and all cryptos in this setting semantically are the same.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5755 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-15 03:00:59 +00:00
Nanang Izzuddin e740a9c7d7 Re #2059: Fixed assertion in JSON name verification due to NULL string pointer passed to string::compare() in reading array node.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5754 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-14 08:28:52 +00:00
Sauw Ming 1780e6c5df Re #2098: Fixed insufficient buffer length to avoid message truncation.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5753 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-08 23:54:40 +00:00
Sauw Ming 106ec876a3 Fixed #865: More clever RTP transport remote address switch
The summary of changes:
- To solve no 2:
Add callback rtp_cb2(pjmedia_tp_cb_param *param) which allows application to get more info from the media transport, such as the packet's source address.
- To solve no 3:
Add compile time option PJMEDIA_TRANSPORT_SWITCH_REMOTE_ADDR (by default enabled). Currently, there are already runtime options PJMEDIA_UDP_NO_SRC_ADDR_CHECKING and PJMEDIA_ICE_NO_SRC_ADDR_CHECKING, but there are a few drawbacks:
 * the options are not exported to the higher level, such as stream, or pjsua.
 * the options are separate for each transport, UDP and ICE, there's no single option to do this.
- To solve no 1:
Using the new rtp_cb2() callback, move the functionality to check the packet's source address to the stream/video stream.
By checking the RTP pt and SSRC, there are a few advantages:
 * When receiving packets from multiple sources, stream can choose the packet with the correct SSRC as advertised from the SDP, and discard the others (see also ticket #1366).
 * If remote address switch is enabled, a faster switch can be achieved as soon as packet with correct ssrc is received, instead of waiting for several consecutive packets (according to setting PJMEDIA_RTP_NAT_PROBATION_CNT).



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5752 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-08 02:01:26 +00:00
Nanang Izzuddin 1108232740 Fixed #2099: Fixed SSL socket (OpenSSL backend), when sending buffer is full, any further send operation should be rejected immediately without writing to OpenSSL SSL BIO.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5751 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-06 08:44:18 +00:00
Nanang Izzuddin 6d20076196 Re #2096:
- Fixed crash in media transport when application calls detach() while the transport only implements detach2().
 - Avoid assertion in UDP media transport when calling detach() without previously calling attach().



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5750 74dad513-b988-da41-8d7b-12977e46ad98
2018-03-06 07:42:54 +00:00
Nanang Izzuddin 4a5dc5711d Re #2096: Fixed assertion in SDP answerer when its SRTP is disabled. This is an SDES issue, but related to DTLS-SRTP works (all SRTP keyings have been refactored for DTLS implementation).
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5749 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-27 07:44:26 +00:00
Sauw Ming b8226493a8 Fixed #2098: Add SDP attribute SSRC and CNAME
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5748 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-27 03:37:53 +00:00
Nanang Izzuddin 486266b850 Close #2097: Updated UDP media transport to start socket read operation in pjmedia_transport_media_start().
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5747 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-26 10:14:27 +00:00
Nanang Izzuddin 4223637bd0 Fixe #2096:
- Fixed re-INVITE scenario: always generate SRTP attr in SDP re-offer/answer as both offerer/answerer (as long as SRTP is not disabled of course), currently it does not generate SRTP attr if active session does not use SRTP.
 - Fixed bug in retrieving video stream info from SDP that caused DTLS transport (UDP/TLS/RTP/SAVP) getting rejected.
 - Added pjsua app param '--srtp-keying=0/1' to choose SRTP keying to be used in the outgoing offer (0=SDES (default), 1=DTLS-SRTP).
 - Few minors, e.g: adding transport_srtp_dtls/sdes.c to pjmedia MSVC2015 project.


git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5746 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-26 07:50:18 +00:00
Sauw Ming 12affd6c35 Fixed #2093: Crash when parsing SDP with an invalid media format description
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5741 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-21 02:32:36 +00:00
Sauw Ming 6229154cb1 Fixed #2092: Crash when receiving SDP with invalid fmtp attribute
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5740 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-21 02:28:02 +00:00
Nanang Izzuddin 6a833fdbff Misc (#2059): Update Android & Java app samples to avoid call instance deletion in the library callback context (thanks Kai Ludwig for the feedbacks).
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5738 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-16 09:37:00 +00:00
Riza Sulistyo 0be14c8181 Fix #2091: On iOS11, replace_udp_sock() might fail and lead to unusable UDP transport.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5737 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-15 13:57:11 +00:00
Sauw Ming 8f28537db2 Re #2086: Add more info for better understanding of the lifetime of PJSUA2 objects. And add an example to explicitly delete PJSUA2 objects.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5736 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-12 07:07:02 +00:00
Sauw Ming 08ff24ac94 Fixed #2086: Add C# binding using SWIG, and support for Xamarin
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5735 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-12 06:50:00 +00:00
Sauw Ming c7d20d5111 Fixed #2089: Support receiving Opus packets with various frame lengths
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5734 74dad513-b988-da41-8d7b-12977e46ad98
2018-02-12 06:18:22 +00:00
Nanang Izzuddin d4357ce3bf Fix #2085:
- Do not override Via header of a CANCEL request, its values are copied from the original INVITE already.
 - Reset account's Via address & transport when SIP TCP/TLS transport is disconnected.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5733 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-25 07:00:42 +00:00
Nanang Izzuddin c777dd8c89 Re #2082: For MSVC backward compatibility, set PJ_SSL_SOCK_IMP to PJ_SSL_SOCK_IMP_OPENSSL by default when PJ_HAS_SSL_SOCK is set.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5732 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-24 03:42:35 +00:00
Sauw Ming a6fe0de627 Re #2084: Make sure the output size of opus_decode() doesn't exceed the available frame size.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5731 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-24 02:37:39 +00:00
Sauw Ming 8efbf21031 Re #2082: Minor fix of incorrect function definitions
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5730 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-24 01:10:42 +00:00
Riza Sulistyo 0d8fc52ae7 Re #2059 (misc): Use PJSIP_MAX_URL_SIZE to print remote info (URL) instead of
hard-coded.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5729 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-18 05:44:41 +00:00
Sauw Ming b1bb629773 Fixed #2084: Opus decode/recovery issue when FEC or PLC is enabled
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5728 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-18 04:02:00 +00:00
Riza Sulistyo 3ab66b795b Re #2059 (misc): Prevent corrupt header from causing a crash when printed.
Thanks to George Joseph for the patch.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5727 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-17 11:30:52 +00:00
Riza Sulistyo 6f7a8b0fbf Close #2083: Fix build error when building using LibreSSL.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5726 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-17 11:15:34 +00:00
Sauw Ming c4279ec635 Re #2082: Initial implementation of GnuTLS support.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5725 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-15 08:52:29 +00:00
Sauw Ming 20e3502515 Fixed #2081: Assertion when setting audio dev in PJSUA2.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5724 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-11 01:03:46 +00:00
Sauw Ming 46d1d869bd Re #2059 (misc): Fixed build error when PJSIP_HAS_RESOLVER==0
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5723 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-10 00:48:10 +00:00
Sauw Ming 56b557cd18 Re #2059 (misc): sudo make uninstall: Remove ignored failures
Thanks to Alexander Traud for the patch.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5722 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-08 06:16:45 +00:00
Nanang Izzuddin dc991f5636 Close #2080: Added call flag PJSUA_CALL_UPDATE_TARGET for updating remote target, the new remote target can be specified in pjsua_msg_data.target_uri.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5721 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-08 04:08:35 +00:00
Sauw Ming 5a2e2bf613 Fixed #2079: Crash in pjsip due to race condition in account's keep alive timer
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5720 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-08 03:20:34 +00:00
Nanang Izzuddin 9353a01e78 Misc (re #2059): Configurable number of socket options (PJ_MAX_SOCKOPT_PARAMS macro).
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5719 74dad513-b988-da41-8d7b-12977e46ad98
2018-01-05 09:48:31 +00:00
Riza Sulistyo d0d441b96e Re #2059 (misc): Update account tp_type when transport_id is changed on pjsua_acc_modify().
Thanks to Oded Arbel for the report.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5718 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-31 09:08:56 +00:00
Nanang Izzuddin 3a92ff29be Close #2077: New PJSUA & PJSUA2 APIs for instantiating extra audio device.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5717 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-19 01:45:37 +00:00
Sauw Ming ab0b027a5a Re #2071: Change the default array size to contain the resolved address to 16 (and 32 if IPv6 is enabled) to accommodate more addresses.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5716 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-18 09:46:03 +00:00
Sauw Ming cfe26bd049 Re #2074: Revert the default sample Android setting to use separate worker threads, since it doesn't seem to fix the problem.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5715 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-18 03:42:18 +00:00
Nanang Izzuddin db7a4d592a Fixed #2076:
- Ignore transport error on completed transaction.
 - Don't disconnect call if transport error happens on transaction that is not initial INVITE transaction.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5714 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-13 08:16:30 +00:00
Nanang Izzuddin 0677422d37 Fixed #2075: Updated PJSUA pjsua_set_snd_dev() to immediately apply new sound device IDs if sound device is active even when PJSUA_SND_DEV_NO_IMMEDIATE_OPEN mode is set.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5713 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-13 03:53:20 +00:00
Nanang Izzuddin fb12b9497c Fixed #2074: Introduced compile time setting PJSUA_SEPARATE_WORKER_FOR_TIMER to allow separate polling for timer events and network events.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5712 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-12 07:44:09 +00:00
Riza Sulistyo 6a3a672e33 Close #2073: Enable wav playlist to play WAV files with extra chunks after DATA chunk.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5711 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-07 03:03:50 +00:00
Riza Sulistyo c9d493b9d6 Close #2072: Call on_call_transfer_status() callback when REFER is responded with failure response.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5710 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-05 07:11:08 +00:00
Riza Sulistyo a5ffdfbd43 Re #2062: Remove related files from Visual Studio projects.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5709 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-04 09:30:47 +00:00
Riza Sulistyo 126a428c1e Re #2065: We still need to modify some source code to avoid build error on
Visual Studio 2005.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5708 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-04 07:23:36 +00:00
Sauw Ming a39e60661e Re #2071: Specify socktype hint when calling getaddrinfo, to reduce the number of addresses returned.
Thanks to Alexander Traud for the patch.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5707 74dad513-b988-da41-8d7b-12977e46ad98
2017-12-04 01:28:40 +00:00
Sauw Ming e25c665c69 Fixed #2071: Update pjsip_resolve() to be able to return more than one resolved address
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5706 74dad513-b988-da41-8d7b-12977e46ad98
2017-11-30 04:41:52 +00:00
Sauw Ming 2403173ecd Re #2059 (misc): Fixed ffmpeg H264 unpacketization error due to uninitialized unpack_nal_start
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5705 74dad513-b988-da41-8d7b-12977e46ad98
2017-11-29 02:23:08 +00:00
Sauw Ming 85fa1f130f Re #2069: Change the field name to outboundProxies, so that it's more consistent with account's proxies settings.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5704 74dad513-b988-da41-8d7b-12977e46ad98
2017-11-27 08:37:37 +00:00