Commit Graph

2352 Commits

Author SHA1 Message Date
bennylp 5fe4bc1972 Fix usages of strncpy(), pj_ansi_strncpy(), and strncat() by replacing them with pj_ansi_safe_strncpy() and pj_ansi_safe_strcpycat() 2023-02-18 12:51:49 +07:00
bennylp 2315043b20 Fix gcc warnings (Ubuntu 22.04, ffmpeg 4.4.2, openssl 3) 2023-02-18 08:36:56 +07:00
Nanang Izzuddin 98adc154db
Fix assertion in sipecho sample due to sending response statelessly on a stateful transaction (#3383)
Update pjsip_endpt_respond_stateless() to accept a terminated tsx, and update sipecho to use it.
2023-02-14 15:38:49 +07:00
Riza Sulistyo 642179a0e5
Make sure that NOTIFY tdata is set before sending it. (#3373) 2023-02-13 11:08:37 +08:00
sauwming 35924fbc2d
Handle invalid SDP when call is in early state (#3359) 2023-02-07 09:37:29 +08:00
sauwming f484d296e5
Remove assertion when even package exists (#3352) 2023-02-03 16:26:10 +08:00
sauwming e84fdea2eb
Fix mingw build due to usage of strtok_r (#3353) 2023-02-03 16:25:36 +08:00
sauwming 4095686a52
Update account config's contact_rewrite doc (#3356) 2023-02-03 16:24:52 +08:00
sauwming 7d1803309b
Optimize memory usage for SRTP ROC checking functionality (#3349) 2023-02-03 16:24:27 +08:00
Florian Xaver 6ca45bd192
Fix string DISCONNCTD (#3357) 2023-02-03 11:05:39 +08:00
Nanang Izzuddin 58f2d943dd
Hangup not yet confirmed outgoing calls in IP change (#3344) 2023-02-01 13:47:15 +08:00
Alexey Vasilyev 930d80e5fc
Added PRACK SDP offer processing (#2995) 2023-01-30 13:42:58 +08:00
Florian Xaver 4d233ecbba
Fix SIP-module documentation regarding return values (#3343) 2023-01-30 11:45:02 +08:00
Florian Xaver cfb1d466e0
Extend algorithm to find account for incoming calls in PJSUA(2) (#3336) 2023-01-27 11:24:34 +07:00
Nanang Izzuddin 58bfd3dd58
TLS uses remote IP address instead of hostname when sending BYE (#3310) 2023-01-21 14:04:38 +07:00
sauwming 0d3be5a417
Allow transport other than TLS to be used for SIPS scheme (#3332) 2023-01-19 10:24:23 +08:00
Florian Xaver 67070c5e46
Support different From URI in outgoing calls (#3320) 2023-01-18 17:09:56 +08:00
sauwming 2cf5432fdb
Suppress use-of-uninitialized-value warning when comparing SIP parser handler (#3316) 2022-12-20 20:28:53 +08:00
Riza Sulistyo 5ac9104514
Expand tab to spaces and remove $Id$ (#3292) 2022-11-22 16:26:54 +07:00
Nanang Izzuddin d00fc12807
Miscellaneous fixes (#3280)
* Suppress compile warnings
* Disable ioqueue stress test on VS2005 due to compile errors on structure data initialization (using C99 way, while VS2005 does not seem to support it).
2022-11-22 11:22:31 +08:00
sauwming caf9471769
Ignore closing transport when acquiring SIP UDP transport (#3286) 2022-11-08 15:28:53 +08:00
Alexey Vasilyev 4c81caa411
Don't terminate call on failed SDP negotiation during EARLY state (#3137) 2022-11-07 11:09:14 +08:00
Nanang Izzuddin 3bf821c1af
Fix IP change returning false error (PJSIP_ESESSIONTERMINATED) when there is no call (#3285) 2022-11-07 09:48:14 +07:00
sauwming 0610327775 Misc (re #3087): Fixed build warning on iOS (sprintf deprecated) 2022-11-01 11:21:29 +08:00
sauwming 31874008d1
Prevent integer underflow of sip regc's next registration time (#3274) 2022-10-24 11:15:01 +08:00
Riza Sulistyo 41c24942f1
Fix crash after updating contact (#3102) 2022-10-19 10:46:43 +07:00
Nanang Izzuddin c12693f3d9
Option to use SIP UPDATE for refreshing calls in IP change (#3146)
* Option to use SIP UPDATE for refreshing calls in IP change

* Updated docs

* Add AccountIpChangeConfig.reinvUseUpdate in PJSUA2

* Add logs for debugging and display menu 'I' for IP change in pjsua app (the IP change action was already there just hidden).
2022-10-19 09:12:59 +07:00
orbea c804b31f85
Fix build fail on alpine linux (with musl libc) : no execinfo.h (#3263)
The execinfo.h header is GNU specific and is not available with musl.

Gentoo Issue: https://bugs.gentoo.org/867343

Co-authored-by: jimying <yingqw.js@gmail.com>
2022-10-17 13:32:23 +08:00
SebaLedesma 6f311ab873
Doc fixes of the default value of Media Quality (#3241) 2022-10-17 11:50:23 +08:00
Nanang Izzuddin d98f3c3036
Add PJSUA_LOCK_CODEC_DONT_USE_UPDATE for forcing lock codec to always use INVITE method. (#3230) 2022-10-12 09:45:24 +07:00
Riza Sulistyo 505b027920
Update media state when SDP contain "a=inactive" attribute (#3237)
* Don't set media state to active when SDP contains "a=inactive" attribute

* Implement alternative 2

* Handle release hold using PJSUA_CALL_SET_MEDIA_DIR

* Revert "Handle release hold using PJSUA_CALL_SET_MEDIA_DIR"

This reverts commit 63b4d43ec7.

* Revert "Implement alternative 2"

This reverts commit 08fbd7dd32.

* Implement suggestion

* Implement changes in #1899 for video
2022-10-06 15:38:33 +07:00
liviu-rolo 947cd77fc4
Update endpoint.cpp (#3163) 2022-09-29 09:15:09 +08:00
BeardedSkunk 5b0f9c8c6f
fix missing init of tp_type in initialize_acc() (#3258)
With changing accounts, memory of obsolete account gets re-used for
 new one, be sure tp_type does not keep random type of whatever
 account-setup was using the memory beforehand.
2022-09-28 14:51:22 +07:00
Martin Flaska 00f2f4000c
pjsua2: Endpoint: Make transportGetInfo and transportEnum methods const (#3250) 2022-09-27 15:02:55 +07:00
Nanang Izzuddin 6929550e08
Add logs for RTP/RTCP socket binding error in PJSUA (#3208) 2022-09-19 17:18:44 +07:00
Riza Sulistyo 797088ed13
Fix port_range/portRange documentation (#3221)
* Fix port_range/portRange doc

* Modify doc text
2022-08-23 15:12:52 +07:00
sauwming 4f280161f1
Fix potential buffer overrun when printing SIP header/message (#3175) 2022-08-10 12:59:38 +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
Riza Sulistyo d4dc67706b
Add option to use default settings when switching sound device (#3181)
* Add option to use default settings when switching sound device

* Update doc

* Modification based on comments
2022-08-05 14:49:31 +07:00
sauwming 8861441ec8
Move UPnP to PJNATH (#3195) 2022-07-29 17:05:28 +08:00
sauwming e0b15546df Misc (re #3087): Fixed incorrect doc param name 2022-07-28 10:14:15 +08:00
sauwming 12aa75e317
Add ability in stream to modify Opus codec parameters on the fly (#3189) 2022-07-26 15:06:24 +08:00
sauwming 82247cb8c0
Add UPnP support for SIP UDP and media UDP transports (#3184) 2022-07-21 11:25:05 +08:00
Riza Sulistyo 0d7157c167
Support OpenSSL3 (#3168)
* Support OpenSSL3

* Modify code order
2022-07-08 09:25:38 +07:00
Nanang Izzuddin 80d3385b69
Update VAD docs/help (#3165)
Update VAD docs/help, some codecs (e.g: Opus & SILK) have VAD disabled by default.
2022-07-05 09:40:47 +07:00
Nanang Izzuddin d5fc07cc03
Random crash due to invoking SRTP APIs on custom media transport instance (#3145) 2022-06-20 12:26:59 +08:00
sauwming 772d690613
Add option to check if UPDATE sent during EARLY inv state has completed SDP nego using reliable prov response (#3138) 2022-06-10 07:24:02 +08:00
sauwming c4ee4db426
Add API pjsip_evsub_get_expires() (#3139) 2022-06-09 11:35:45 +08:00
sauwming b04abebc33
Fixed issues with event subscription regarding on_rx_refresh() and unsubscription (#3126) 2022-06-06 11:40:41 +08:00
Nanang Izzuddin d671704abe
Add run time settings to enable/disable RTCP-XR in account config (#3110) 2022-05-20 11:42:55 +07:00
Bastian Triller 3c2d4b3ae2
fix typos (#3096) 2022-05-05 13:46:43 +08:00
Riza Sulistyo fa7087461e
Don't schedule re-Registration on IP change case (#3027) 2022-05-04 09:34:36 +08:00
sauwming 0297a3bf57
Add account id parameter checking in pjsua im APIs (#3035) 2022-05-04 09:32:36 +08:00
sauwming f1c0e284a3
Added conference port id checking in pjsua (#3038) 2022-05-04 09:15:34 +08:00
Riza Sulistyo 0fd9cb0d0f
Fix missing argument due to changes on #2979 (#3076) 2022-05-04 09:14:30 +08:00
liviu-rolo 7a7c17d364
wrong documentation about default jbInit (#3006) 2022-05-04 09:13:02 +08:00
liviu-rolo 712225bd48
Wrong default values for JB prefetch (#3007) 2022-05-04 09:12:40 +08:00
Nanang Izzuddin 41023dad10
Some callbacks not invoked in call replace in PJSUA2 (#3059)
Warning: potential backward incompatibility issue, previously the replacing call can use any account (selected using pjsua_acc_find_for_incoming() and app may override via callback), now it is forced to use the same account.
2022-04-26 13:30:41 +07:00
sauwming 189e6c0330 Fix bug when hanging up call (#3026) 2022-04-06 17:21:12 +08:00
sauwming 38c13afa1c
Fixed missing field in CodecParam (#3037) 2022-03-25 17:30:46 +08:00
mscdex 4d422dbf17
Only generate call stats if logging is enabled (#3020) 2022-03-25 09:16:42 +08:00
Emre TUFEKCI 2fd5e76d8e
third party media build error fix (#3019) 2022-03-25 09:14:37 +08:00
Riza Sulistyo 8e95490e37
Add compile time option to allow multiple Authorization header (#3010) 2022-03-24 13:53:03 +08:00
sauwming 601f0c7af1
Update registration transport upon account's modification or transport setting (#3004) 2022-03-11 14:29:42 +08:00
Riza Sulistyo d27f79da11
Use PJ_ASSERT_RETURN() on pjsip_auth_create_digest() and pjsua_init_tpselector() (#3009)
* Use PJ_ASSERT_RETURN on pjsip_auth_create_digest

* Use PJ_ASSERT_RETURN on pjsua_init_tpselector()

* Fix incorrect check.

* Add return value to pjsip_auth_create_digest() and pjsip_auth_create_digestSHA256()

* Modification based on comments.
2022-03-08 22:20:39 +07:00
liviu-rolo 5102096ab1
wrong default value for jitter buffer max (#3001) 2022-03-03 12:44:43 +08:00
sauwming 18281d8a7d
Add option to randomize RTP starting port (#3000) 2022-03-03 12:43:44 +08:00
sauwming 6f197385c7
Miscellaneous fixes (#2969)
* Suppressed various compilation warnings
* Fixed CodeQL warning
* Fixed build warning on Android and Linux
* Fix build warning on Visual Studio
* Update target Android SDK version to 29 (for pjsua2 & app), to avoid gradle error: 'Google Play requires that apps target API level 29 or higher'.
* Add support for Camera2 API to ipjsua android app.
* Fix assertion on Win32 app (MSVC2005) because ICE transport info size is 160 bytes while the allocated buffer is just 144 bytes.
* Enable python unit test on windows for github actions.
* Avoid assertion in pjsua test caused by double calling of pjsua_conf_remove_port()
2022-02-24 14:46:01 +07:00
Nanang Izzuddin 062204bd5d
Fix cseq generation in pjsip_dlg_create_request(). (#2996) 2022-02-24 13:17:06 +07:00
sauwming c4531e0ddc
Hangup call in crossover scenario between CANCEL and 200 response (#2994) 2022-02-23 12:39:45 +08:00
sauwming 088690b607
Fixed failed pjsua test due to incorrect SRTP ROC check (#2993) 2022-02-23 12:10:44 +08:00
sauwming b5af6819a0
Fixed failure to resume video when unholding the call (#2988) 2022-02-22 11:40:10 +08:00
Nanang Izzuddin db3235953b
Merge pull request from GHSA-ffff-m5fm-qm62
* Update pjsip_ua_unregister_dlg():
- update the hash key if the dialog being unregistered is used as hash key.
- add an assertion check to make sure that the dlg_set to be removed is valid (can be found in the hash table).

* Change hash key string comparison method.
2022-02-21 07:24:52 +08:00
sauwming 9b37e587bc
Add feature to init SRTP ROC and check if SRTP ROC needs to be reset/maintained (#2846) 2022-02-18 10:06:29 +08:00
sauwming b1d29fd4e7
Fixed call hangup crash when ending session fails (#2980) 2022-02-16 11:27:35 +08:00
Riza Sulistyo d5477c1eed
Release wav player and recorder pool to clean up when calling pjsua_destroy() (#2979)
* Release wav player and recorder pool on pjsua_destroy2()

* Modification based on comments

* Modification based on comments

* modification based on comments
2022-02-15 13:21:38 +07:00
Florian Xaver 4cc86a6a3c
Fix documentation and usage of txdata ref counter (#2957) 2022-02-15 13:53:47 +08:00
sauwming 691c687f66
Fixed assertion in multipart test (#2972) 2022-02-15 11:19:13 +08:00
Grazhdan Oleg 14b0ef44df
Fix incorrect pjmedia_sdp_neg_state in case of SDP parsing error (#2908) 2022-02-14 17:27:11 +08:00
Krzysztof Marciniak f5249ca70e
Added pjsip_tsx_set_timers to change timers at runtime (#2781)
* Added pjsip_tsx_set_timers to change timers at runtime

Added new function pjsip_tsx_set_timers in sip_transaction.c
which allows to change session timers during runtime.
It also allows to change timer values independently,
currently all timers are set at various ratios from
t1 during init. This was required for server which could
change timeout configuration on runtime, but could be
usable in other projects.

* Add synchronization of timer values in pjsip_cfg().

Add synchronization of timer values to pjsip_cfg() and another
function to (re)synchronize timer values from pjsip_cfg(),
`pjsip_tsx_initialize_timer_values()`.

`pjsip_tsx_set_timers` now accepts zeroed arguments to mean
that it should not change that timer value.
2022-02-14 12:49:29 +08:00
George Joseph 668a828631
Add additional unit test options (#2961) 2022-02-11 12:28:03 +08:00
sauwming 2caced6fcf
Fix failure to manually reply re-INVITE (#2968) 2022-02-09 14:27:12 +08:00
sauwming 119623b633
Misleading log when answering a call in CONFIRMED state (#2950) 2022-02-08 12:02:37 +08:00
Nanang Izzuddin e0056814a9
Avoid double BYE when pjsua_call_hangup() is called multiple times (#2859) 2022-02-08 11:28:44 +08:00
Nanang Izzuddin c7c4ebc7b0
Add check if module has been unregistered in mod_ua module (in sip_ua_layer.c). (#2840) 2022-02-08 11:28:17 +08:00
Nanang Izzuddin c12d12cab7
Fix deadlock after immediate hangup on video call (#2837) 2022-02-08 11:27:42 +08:00
Riza Sulistyo 4fa7528c9d
Allow registration refresh to continue when REGISTER response contains expires parameter set to 0 (#2809) 2022-02-08 11:24:48 +08:00
Riza Sulistyo 313d536c28
Implement verify callback to TLS connection (#2962) 2022-02-08 11:15:38 +08:00
sauwming d979253c92
Merge pull request from GHSA-qcvw-h34v-c7r9
* Perform buffer length checks

* Add asssertion sanity checks
2022-02-08 08:15:07 +08:00
George Joseph 551273f639
Additional multipart improvements (#2953)
Added the following APIs:
pjsip_multipart_find_part_by_header()
pjsip_multipart_find_part_by_header_str()
pjsip_multipart_find_part_by_cid_str()
pjsip_multipart_find_part_by_cid_uri()
2022-02-02 09:30:14 +07:00
sauwming c9a75bed34
Add parameter assertion check in pjsip_uri_get_uri() (#2893) 2022-01-19 19:22:06 +08:00
Nanang Izzuddin ecd18ee4d4
Fix issue of not rescheduled keep-alive timer for Flow-Timer when ka_interval (UDP keep-alive interval setting) is zero/disabled. (#2943) 2022-01-18 13:41:57 +08:00
sauwming 3cdea084b2
Check for tdata when ending inv session (#2938) 2022-01-18 13:38:55 +08:00
Florian Xaver e84b3318d7
Support Digest AKA authentication in PJSUA2 (#2785) 2022-01-17 10:18:00 +08:00
Florian Xaver ff7cd11630
Support loop media transport in PJSUA2 (#2900) 2022-01-13 13:20:50 +07:00
George Joseph 80c48e9a57
Create generic pjsip_hdr_find functions (#2941) 2022-01-13 13:10:04 +07:00
Riza Sulistyo d3d4d2200c
Support Flow-Timer on rfc5626 (#2921)
* Support Flow-Timer

* randomize keep-alive timer each time it is scheduled.

* Modify random delay calculation.

* Simplify random delay calculation.
2022-01-10 22:31:53 +07:00
sauwming b771df4663
Fix missing event unsubscription in pjsua video (#2932) 2022-01-06 15:39:15 +08:00
sauwming 3faf1d2b4d
Fix incorrect unescaping of tokens during parsing (#2933) 2022-01-04 15:28:49 +08:00
sauwming 833c983029
Get note from root if not found in tuple (#2909) 2021-12-23 11:00:33 +08:00
sauwming fc91812dd1
Fix crash when dumping call data during media deinit (#2918) 2021-12-23 10:59:51 +08:00
sauwming 41b7bde0f0
Check for decoding delay in video stream (#2886) 2021-12-23 10:09:48 +08:00
George Joseph 69a89a26dd
sip_inv: Additional multipart support (#2919) (#2920) 2021-12-22 09:32:22 +07:00
George Joseph 57416c5cf8
Fix declaration of pjsip_auth_deinit_parser() (#2914) 2021-12-22 09:27:46 +07:00
Nanang Izzuddin 7dcf16dca5
Fix issues in updating media dir to "none" in the middle of a call (#2906)
* Fix issues in updating media dir to NONE in the middle of a call

* Update PJSUA2 CallSetting::mediaDir declaration for SWIG. Note: adding SWIG template for MediaDirVector as vector of pjmedia_dir enum causes some error: SWIG treats enum as int, so vector of pjmedia_dir will be wrapped as vector of int, as there is already IntVector, SWIG rejects duplicated vector of int.
2021-12-06 14:38:33 +07:00
Riza Sulistyo 073e992767
Add documentation on how port_range is used (#2904)
* Add documentation on how port_range is used.

* Add pjsua2 documentation

* Move example of media transport settings
2021-12-03 07:58:22 +07:00
Riza Sulistyo ef0ed65808
Disable assertion when checking for an invalid transport (#2891)
* Disable assertion for an invalid transport

* Modification based on comments.
2021-11-19 11:29:26 +07:00
Riza Sulistyo cc680d21e6
Change "md5" algorithm name to uppercase to comply with the standard (#2889) 2021-11-18 13:15:07 +07:00
Nanang Izzuddin ab86ec3dc0
Only add the top most supported auth header in auth reinit request. (#2887) 2021-11-16 15:34:52 +07:00
Nanang Izzuddin 532e64ef6e
Disable auto restart socket in PJMEDIA and PJSIP transports (#2881) 2021-11-11 09:25:45 +07:00
Riza Sulistyo 6ca06f63ec
Fix some doc warning (#2879) 2021-11-10 09:57:40 +07:00
Nanang Izzuddin 407009c0a8
Fix bug in REGISTER Contact length calculation (#2857) 2021-10-21 10:22:45 +07:00
Nanang Izzuddin c87056e178
Add call dump to pjsua_media_channel_deinit() (#2855) 2021-10-20 12:45:20 +07:00
Nanang Izzuddin 6b1821c0c7
Add compile-time setting to disable automatic video device subsystem initialization (#2777) 2021-10-19 15:26:38 +07:00
Nanang Izzuddin 8fc67a51ee
Miscelaneous changes on PJSUA2 audio device APIs (#2822) 2021-09-27 15:24:59 +07:00
Nanang Izzuddin e48ec1dc0d
Add support to specify Contact URI params specific to REGISTER requests (#2819) 2021-09-23 09:08:07 +07:00
Nanang Izzuddin ae5ce4ca72
Handle unknown cipher name in PJSUA2 (#2821) 2021-09-10 16:45:39 +07:00
Riza Sulistyo 661a8cef67
Add support to windows on ARM build (#2807)
* Add support to ARM64 configuration for win32 build

* Add changes notes to webrtc and webrtc_aec3 third party sources

* Remove reference to libwebrtc_aec3 from libpjproject. Add reference it manually if libwebrtc_aec3 is needed.

* Fix build error on Release configuration.
2021-08-30 10:39:48 +07:00
Nanang Izzuddin 37136a4ee6
High video latency when decoder frame rate is initialized lower than actually received (#2798)
- Add new APIs to update/refresh video conference bridge port: `pjmedia_vid_conf_update_port(), pjsua_vid_conf_update_port(), VideoMedia::update()`.
- Use the new API in PJSUA-LIB to update renderer & stream decoder in format changed event.
2021-08-18 10:47:13 +07:00
Riza Sulistyo 43d1bc90d7
Avoid deadlock on unsubscribe event (#2771) 2021-07-27 11:29:38 +07:00
Nanang Izzuddin d5f95aa066
Merge pull request from GHSA-cv8x-p47p-99wr
* - Avoid SSL socket parent/listener getting destroyed during handshake by increasing parent's reference count.
- Add missing SSL socket close when the newly accepted SSL socket is discarded in SIP TLS transport.

* - Fix silly mistake: accepted active socket created without group lock in SSL socket.
- Replace assertion with normal validation check of SSL socket instance in OpenSSL verification callback (verify_cb()) to avoid crash, e.g: if somehow race condition with SSL socket destroy happens or OpenSSL application data index somehow gets corrupted.
2021-07-23 11:49:21 +08:00
Nanang Izzuddin c80f59eb90
SDL full-screen mode fixes and enhancement (#2759)
- Add fullscreen mode PJMEDIA_VID_DEV_FULLSCREEN_DESKTOP (no video mode change), which is mapped to SDL_WINDOW_FULLSCREEN_DESKTOP.
- Fix resizing while in full-screen.
- Update PJSUA, PJSUA2 & pjsua app, e.g: fullscreen setting was boolean (fullscreen enabled/disabled), now it is enum: disabled, fullscreen, or fullscreen desktop.
2021-07-21 11:47:07 +07:00
Dan Oprescu 0966d4c6dd
Fix 's default constructor to do what the documentation says. (#2762) 2021-07-12 08:54:22 +07:00
Riza Sulistyo 70074ede91 Linker error when building pjmedia_test, pjsip_test and sample project when using Visual Studio, some of them caused by #2753. 2021-07-07 16:47:05 +07:00
Nanang Izzuddin 8ef2a3c0d0 Re #2753: Compile error when PJSIP_AUTH_HAS_DIGEST_SHA256 is disabled (or without OpenSSL). 2021-07-06 14:46:09 +07:00
SebaLedesma abf2b4c54f
Support for SHA-256 algorithm in SIP Digest Authentication (#2753) 2021-07-06 11:17:11 +07:00
Nanang Izzuddin bc6f0ee6e3
Avoid call disconnection due to request timeout when network change happens. (#2737) 2021-06-29 15:00:58 +07:00
Nanang Izzuddin cb35c79f21
Allow app modify video encoding param in on_stream_precreate() (#2741) 2021-06-29 15:00:12 +07:00
Riza Sulistyo 3844cd1b8b
Avoid deadlock when restarting SIP UDP transport due to holding pjsua lock (#2731)
* Avoid deadlock when restarting SIP UDP transport due to holding pjsua
lock.

* Add callback to lock/unlock any lock held when waiting for the read spin loop finish.

* Use simpler approach by unlocking before restarting UDP transport.

* Add doc to pjsip_udp_transport_restart() and pjsip_udp_transport_restart2() of the possibility of deadlock.
2021-06-29 14:58:22 +07:00
Nanang Izzuddin a5bd5e9d44 Misc (re #2698): Update docs of TD timer in SIP transaction, which also affects tsx timeout timer for both INVITE & non-INVITE tsx since https://trac.pjsip.org/repos/changeset/3203.
Thanks to Pirmin Walthert for the feedback.
2021-06-16 17:07:53 +07:00
sauwming 1cb34f56a7
Specify media direction when making, answering, or updating call (#2705) 2021-05-17 09:58:19 +08:00
sauwming bdbeb7c4b2
Skip unsupported digest algorithm (#2408)
Co-authored-by: Nanang Izzuddin <nanang@teluu.com>
2021-04-22 14:03:28 +08:00
sauwming ea7105c222
Allow SIP transaction to continue for certain case despite transport error (#2683) 2021-04-01 16:06:10 +08:00
Nanang Izzuddin 4772d62ed2
Fix reject incoming call before sending any response (auto 100/trying response is disabled) (#2676) 2021-04-01 11:50:57 +07:00
Dan Oprescu 29412ceb82
call_change_cap_dev() should allow *any* valid capture device, ie. including PJMEDIA_DIR_CAPTURE_PLAYBACK for example (#2678) 2021-03-31 10:03:55 +08:00
Hubert LOBIT c075a41071
Add a `getID()` method to PJSUA2 Buddy class (#2681) 2021-03-30 16:15:15 +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
sauwming 1a3f8ad60d
Fixed race condition between media event callback and stopping video (#2666) 2021-03-12 16:42:56 +08:00
sauwming 90a7d70ae2
Fix secure transport checking (#2663) 2021-03-09 13:39:41 +08:00
Riza Sulistyo 74c34399d6 Misc (re #2504): Suppress some compile warning on VS Windows. 2021-03-09 07:32:36 +07:00
sauwming 67e46c1ac4
Merge pull request from GHSA-8hcp-hm38-mfph
* Check hostname during TLS transport selection

* revision based on feedback

* remove the code in create_request that has been moved
2021-03-08 17:39:36 +08:00
Riza Sulistyo 940e3c0443
Support Android AMediaCodec (#2552)
* Implement android AMediaCodec AVC/VPX codec.

* - Change "anmed" to "and_media" prefix for clearity.
- Check if encoder/decoder exists before enabling codec.

* Fix bug on enum info.

* Add support to AMRNB and AMRWB audio codec.

* Modification based on comments.

* - move VPX packetizer from codec implementation.

* - Remove unwanted changes.
- Fix bug on vpx (VP9) packetize method.

* - New method to initialize vpx packetizer config.
- Don't use pt as codec id.

* add compiler option to prioritze using software or hardware codec.

* add documentation related to packetization mode for H264.

* fix some potential compile error.

* Specify video codec PT to support #2656.
2021-03-05 21:59:07 +07:00
Riza Sulistyo 433cf50b1c
Add option to disable auto re-registration. (#2652)
* Add option to disable auto re-registration.

* modification based on comments

* Change config name and add doc.
2021-03-05 14:42:21 +07:00
Riza Sulistyo d9055ede5c
Allow EC to be used when sound device is opened on speaker mode only (#2651)
* Add option to always use VPIO on coreaudio dev.

* Revert "Add option to always use VPIO on coreaudio dev."

This reverts commit 55d6da5b4b.

* Allow EC to be enabled when sound device is opened on speaker only mode.

* Modify assertion to allow ec to be set on playback only mode.
2021-03-04 16:08:52 +07:00
Nanang Izzuddin d331da47c8
Update pjsip-simple RPID (#2639)
- Allow <note> element in <tuple> set in pjsip_pres_status.info[0].rpid.note without having RPID element in presence message body.
- Fix wrong parent node for finding note element in get_tuple_note().
- Update docs: fix typo, etc.
2021-03-03 15:27:57 +07:00
Nanang Izzuddin 415ada6a61
Fix SIP session timer not retry refreshing after a re-INVITE refresh responded with 503 (#2657) 2021-03-03 15:08:40 +07:00
sauwming 6470fb9e4b
Fixed race condition in regc_send() (#2653) 2021-02-24 17:03:29 +08:00
sauwming 0438a4762c
Modify pjsua maximum calls setting (#2654) 2021-02-24 17:02:58 +08:00
sauwming 0c78b9e8c8
Add compile time option to disable auto sending of 100 response (#2642) 2021-02-22 13:58:19 +08:00
sauwming 9c778a700a
Fixed race condition between stopping video stream and format change event (#2645) 2021-02-18 13:15:49 +08:00
Nanang Izzuddin aadc643a01
Fixed assertion in media update of session refresh after previous SDP offer has been rejected (#2627) 2021-02-15 10:18:02 +07:00
Riza Sulistyo e1b82fc25d
Update RTP timestamp on inactive/paused video stream (#2640) 2021-02-15 10:05:29 +07:00
Nanang Izzuddin 73553fbd02
Use UTC time in PJSIP presence PIDF timestamp (#2638) 2021-02-15 09:04:06 +07:00
Alex Kalmuk 974cb47351
Add --disable-pjsua2 option for targets which lacks C++ (#2630) 2021-01-28 10:45:32 +08:00
Nanang Izzuddin e6f7d032dd Re #2572: fix assertion in auto_rereg_timer_cb() when trying to re-register to an unavailable registrar via UDP. 2020-12-18 16:36:58 +07:00
Riza Sulistyo a29e9dc3e5
Modify on_new_session callback as optional. (#2534) 2020-12-15 14:32:06 +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
Nikolai ZHUBR dad6a34680
Fix building with video support (including dshow camera) on mingw (#2589) 2020-12-10 15:54:40 +07:00
sauwming 2eea0ace2b
Report disconnection event immediately when hanging up a call (#2600) 2020-12-04 10:29:45 +08:00
Nanang Izzuddin c6bc0b1e2e
Create new contact for reregistration after transport disconnected (#2572) 2020-11-20 10:53:59 +07:00
Nanang Izzuddin 2925cca94f
Fix bugs in pjsip_inv_answer() (#2472) 2020-11-20 10:52:55 +07:00
Nanang Izzuddin 90a16c523b
Race condition between transport destroy and acquire (#2470)
* Handle race condition between transport_idle_callback() and pjsip_tpmgr_acquire_transport2().
* Add transport destroy state check as additional of transport shutdown state check
2020-11-20 10:52:22 +07:00
Andreas Wehrmann fe5ef0c3a4
PJSUA call: fix on_pager_statusX() callbacks for in-dialog requests (#2490)
- on_pager_status() was called twice: once for event TSX_STATE and later for event TIMER
- on_pager_status2() was not called at all
2020-11-19 10:01:17 +07:00
sauwming bba95b8a95
Prevent regc destroy when it is busy (#2575) 2020-11-11 10:28:28 +08:00
Nanang Izzuddin f3e091fac0
Invoke on_call_sdp_created callback for new SDP offer generated by pjsua_call_set_vid_strm() (#2564) 2020-11-02 14:46:15 +07:00
sauwming 86fdff32e7
Disallow forceful close of pjsua transport (#2557) 2020-10-23 08:37:03 +08:00
Riza Sulistyo efbe7164e9
Option to send keep alive periodically when stream is started for NAT hole punching (#2518)
* send keep alive when stream is started.

* modification based on comments.

* Add documentation.

* Modification based on comments.

* Grouped configuration.
2020-10-12 14:37:30 +07:00
Riza Sulistyo 7a702b9aab
Add option to disable ice mismatch check. (#2538)
* Add option to disable ice mismatch check.

* Fix check error and modify doc.

* Modification based on comments.
2020-10-12 12:38:12 +07:00
sauwming ce18018cc1
Fix incorrect copying of destination info when creating CANCEL (#2546) 2020-10-12 13:31:25 +08:00
Sergey Strelchenko 004f7f7d8c
Fixed wrong macros PJ_DEF. PJ_DECL is correct. (#2545) 2020-10-12 11:58:53 +08:00
Max Truxa 9c66083712
Implement stream pre-create callback (#2507) 2020-10-05 14:20:46 +07:00
Nanang Izzuddin 7147e2e985 Merge branch 'master' of https://github.com/pjsip/pjproject 2020-10-05 10:33:35 +07:00
Nanang Izzuddin 1749cf8a50 Misc (re #2504): Updated PJSUA_VID_REQ_KEYFRAME_RTCP_PLI docs, it is supported since 2.10. 2020-10-05 10:33:14 +07:00
Riza Sulistyo 510716631e Add option to disable ice mismatch check. 2020-10-02 14:18:51 +07:00
Nanang Izzuddin da46a61baf
Invite state not shifting to CONFIRMED state after sending ACK manually (#2528)
Also updated docs:
 - on_send_ack(): explicitly mention that ACK request must be created using pjsip_inv_create_ack().
 - pjsip_inv_create_ack(): SDP answer to be set using pjsip_inv_set_sdp_answer(), was pjsip_create_sdp_body().
2020-09-30 14:33:25 +07:00
sauwming a184b14f8c
Speaker only setting still requires audio input device (#2522) 2020-09-29 11:29:15 +08:00
sauwming e2d8ee0f49
Suppress CodeQL warnings (#2530)
Also exclude some third party libs and python source
2020-09-23 18:45:59 +08:00
Nanang Izzuddin 4ec0b6485c
Avoid invoking callback on_pager_status twice when resending with auth fails. (#2489) 2020-08-18 11:35:33 +07:00
Max Truxa 5925c42ea3
Pass JB discard algorithm along other JB settings (#2506) 2020-08-14 10:35:11 +08:00
Nanang Izzuddin 32153443e7 Misc (re #2504): Fixed compile error 'declaration after statement', e.g: on MSVC2005 2020-08-10 11:37:29 +07:00
sauwming 92d2e8df9a
Fix sip transaction to send pending message (#2471) 2020-07-20 11:32:54 +08:00
andreas-wehrmann 973bb671a1
PJ adjustable pool sizes (#2395)
Make several pool sizes settable via compile time macro settings. This can be used to deal with memory fragmentation issues in long running applications that encounter temporary high loads.
2020-07-15 11:46:59 +07:00
sauwming b0aa9e93a7
Fixed failed reinvite if call opt is NULL (#2478) 2020-07-03 17:22:44 +08:00
Max Truxa 5f14950cb5
Add callbacks to receive RTP DTMF events (#2447) 2020-06-26 16:06:21 +08:00
Nanang Izzuddin 11fd8da3ed
Fixed bug in ICE callback implementation in PJSUA to reschedule timer after failed in acquiring dialog. (#2468) 2020-06-24 09:03:21 +07:00
sauwming 87653d5a22
Check current inv state before decreasing ref count (#2459) 2020-06-15 14:14:45 +08:00
Riza Sulistyo de9f0713b3
Possible leak tdata when receiving 200 OK response after the invite session is destroyed. (#2432)
* Possible leak tdata when receiving 200 OK response after the invite
session was destroyed.

* Add comments linking the PR to the changes.

* Add safety check.

* Fix possible leaked tdata when ACK is not sent due to timeout.
2020-06-10 15:20:51 +07:00
Riza Sulistyo f45f2d435a
Allow demote SRTP call to RTP when using re-INVITE with PJSUA_CALL_REINIT_MEDIA (#2451)
* - Allow demote SRTP call to RTP when using re-INVITE with
PJSUA_CALL_REINIT_MEDIA
- DTLS renegotiation when receiving re-INVITE with modified media
transport address

* Revert DTLS_DEBUG to 0.

* modification based on comments.

* modified comment.
2020-06-10 10:42:53 +07:00
Truong-Thanh-Quang 6503ec40a8
Fix dtmf signal &duration parsing in dtmf-relay INFO message (#2425) 2020-06-09 15:14:25 +07:00
Nanang Izzuddin 5d216a94c8
Fix bug when sending IM using null content (continuation of #2452) (#2454)
Also update on_pager_status() callback: set body param with message body (i.e: tdata->msg->body) when IM is sent using null content.
2020-06-09 12:35:19 +07:00
Nanang Izzuddin 55cd705114
Allow NULL content in sending IM if msg_data has body/multipart (#2452) 2020-06-04 13:19:17 +07:00
sauwming c2d7c7616f
Call on_call_media_event() callback asynchronously to avoid deadlock (#2446) 2020-05-22 15:07:28 +08:00
Guido Falsi 78683646c8
Fix race condition in parallel builds (#2426)
* Some targets residing in `OBJDIRS` are missing a dependency on that directory, which results in a race condition, causing build to fail sometimes due to the directory not existing when running parallel builds.

* The `PJSUA_LIB` variable is not defined anywhere, resulting in an empty value, and no correct dependency on the pjsua shared library for `pjsua2`. The correct variable seems to be `PJSUA_LIB_LIB`, defined at the start of this same `Makefile`.
2020-05-11 13:50:39 +07:00
sauwming 95c29aa1d2
Avoid undefinition of standard macros s_addr and s6_addr (#2423) 2020-05-06 09:38:26 +08:00
sauwming bb60df2346
Fixed assertion when receving an INVITE response during an UPDATE (#2419) 2020-05-05 14:02:14 +08:00
sauwming b53b8e8651
Fix duplicate 408 status phrase
Re #2381
2020-05-01 17:18:02 +08:00
Nanang Izzuddin b23633707c
More CI works (#2376)
* pjsua-test:
  - Update pjsua-test module call: wait ICE update before checking media
  - Attempt to fix all failed tests by sipp module: changed SIPp port from 6000 to 50070 (port used by recvfrom module)
  - Update call module: confirm codec priority after change, fix DTLS-SRTP expect may race with state CONFIRMED
  - Add timeout check in telnet-ing to pjsua
  - ICE nego may race with call state CONFIRMED, so mod call better just sleep instead of expecting 'ICE nego success'.

* Other unit tests:
  - Print stack trace on crash on Linux and DarwinOS via SIGSEGV signal handler.
  - Update resolver test: print log on callback error, replace assertion checks with error return, fix comments, sleep periods, fix received packet count may be > 1 if server ignore the request (for example when the test machine experiencing high CPU load).
  - Update ccpp.yml: add -g for jobs with unit-tests.
  - More lenient on tsx retransmission count check in pjsip-test.
  - Update tsx_uac/s_test.c: allow retransmission timing diff from 150 to 500ms to accommodate possible CPU spike on some test machines.
2020-04-30 11:25:19 +07:00
sauwming 558922fc3f
Suppressed various compilation warnings (#2410)
Such as:
- conversion from string literal to 'char *' warning
- format-truncation warning

Co-authored-by: nanangizz <nanang@teluu.com>
2020-04-29 15:11:26 +08:00
sauwming 1c985975ce
Status phrases (#2381)
* pjsip: Add new status phrases

Taken from various (newer) SIP RFC's.

* psjip: Make status phrases match the RFC's

Replace homebrew phrases with the standard phrases from the SIP RFC's.

* pjsip: Add new status codes to pjsip_status_code enum

* Update symbols.i

* Fix indentation of symbols.i

Co-authored-by: sauwming <ming@teluu.com>
2020-04-29 11:58:31 +08:00
Nanang Izzuddin 8cd15e8073
Increment outgoing RTP timestamp on inactive or receive only stream (#2340) 2020-04-29 10:55:14 +07:00