Commit Graph

425 Commits

Author SHA1 Message Date
Dmitry Verenitsin 56cc958b28 [core] Fix use-after-free in session thread pool worker. (#3030)
`switch_core_session_thread_pool_launch()` allocated the thread data (`td`)
from the session pool. However, `switch_core_session_thread()` destroys
the session pool before returning, leaving td as a dangling pointer.
The worker then accesses `td->running` and `td->pool` — a use-after-free
that crashes under memory pressure when the freed pool is reused.

Allocate `td` with `switch_zmalloc()` and set `td->alloc = 1` so the worker frees it
after the task completes. This ensures `td` outlives the session pool
destruction.
2026-05-26 00:13:29 +03:00
Jakub Karolczyk b4ebd0936c [core, mod_sofia] Fix codec set deadlock 2024-10-11 16:16:02 +03:00
Andrey Volk fdce50e420 [Core] Fix missing MEDIA_PARAMS in message_names. 2023-07-16 21:20:56 +03:00
Andrey Volk 55313696db [Core] Remove unused count variable from switch_core_session_execute_exten() 2023-03-31 22:48:11 +03:00
Andrey Volk 23e6569fb0 [Core] Fix race condition of session_table hash in switch_core_session_request_uuid() 2023-03-02 12:53:00 +03:00
Dragos Oancea 8e59603d98 [core][mod_sofia] remove ZRTP (deemed obsolete).
[unit-tests][build-system][docs] remove references to ZRTP.
2022-10-28 20:19:42 +03:00
Andrey Volk 56b6e954cf [Core] Fix dead nested assignments 2022-08-09 23:29:31 +03:00
Andrey Volk fbf2da44d9 [Core] Fix use of private headers. 2021-11-10 21:46:29 +03:00
Chris Rienzo e6cd6391ff [core] Add app_disable_expand_variables channel variable. When true, application args are not expanded by FreeSWITCH and are passed to the application unchanged. 2021-10-23 22:00:40 +03:00
Chris Rienzo 6b6b721c10 [core] allow external ID to be same as the session UUID 2021-10-23 22:00:26 +03:00
Chris Rienzo c2e240d6dc [core] Add switch_core_session_set_external_id() which lets you define an additional identifier that you can use in switch_core_session_locate(). 2021-10-23 22:00:26 +03:00
Anthony Minessale b18ea498df [core] add new prompt functionality to ask for pin over dialogbox 2021-10-23 22:00:00 +03:00
Anthony Minessale efff71f2f0 [core] add switch_thread_pool_wait 2021-10-23 21:59:59 +03:00
Andrey Volk c61d89a47f [Core] Add new switch_core_session_try_reset() API to fix a deadlock for the case when two threads want to set session codecs. 2021-03-22 18:47:46 +03:00
Chris Rienzo c63f9524ee [core] Remove unused buffers and mutexes in switch_core_session. Remove destruction of resamplers that will already be destroyed by switch_core_session_reset(). 2021-03-22 18:46:03 +03:00
Andrey Volk 97930570dc [Core] Fix possible memory leak of switch_core_session_message_t in switch_core_session_queue_indication() 2021-03-17 19:30:39 +03:00
Andrey Volk 4fe8aecbfb [Core] Make switch_core_media_set_codec() and switch_core_media_set_video_codec() thread-safe so there is no race when a session's codec is initiated by different threads simultaneously. 2021-03-16 23:15:54 +03:00
Chris Rienzo 4b337f1117 FS-11878 [core] change log level of dialplan EXECUTE 2019-07-18 00:58:57 +04:00
Chris Rienzo 2d231cdff3 FS-11823 [core] clear out event queue when destroying session 2019-06-06 11:20:16 -04:00
Chris Rienzo c40af77327 FS-11706 [core] use unique mutex for stack_count 2019-03-19 23:14:47 -04:00
Chris Rienzo d86c715694 FS-11706 [core] protect session stack count with mutex 2019-03-19 12:12:38 -04:00
Chris Rienzo 1a5ce0ebeb FS-11706 [core] add some extra information to troubleshoot 'too many stacked extensions' 2019-03-19 12:12:26 -04:00
Mike Jerris 6eeaf76bc2 Merge pull request #1404 in FS/freeswitch from ~LAZEDO/freeswitch:feature/FS-10704 to master
* commit '96ae6ef4dd22297c803f821ee615ad86993c95a0':
  FS-10704 [core] add event-uuid-name
  FS-10704 [core] allow event-uuid (app_uuid) to be used in application
2019-02-12 15:28:11 +00:00
Mike Jerris 866bd44efc FS-11539: [core] session message names print wrong in log messages 2018-11-28 22:14:08 +00:00
Anthony Minessale 65524ea2c1 FS-11379: [freeswitch-core] Rare race condition in state machine #resolve 2018-09-05 18:20:58 -04:00
Brian West 291da11322 FS-10867: [freeswitch-core] Prevent stack smash when queing multiple sound files without event-lock #resolve 2018-07-24 07:21:38 +00:00
lazedo 96ae6ef4dd FS-10704 [core] add event-uuid-name
this allows for external call control to provide a app name
2018-06-08 12:24:43 +00:00
Luis Azedo ae7e4d2eaf FS-10704 [core] allow event-uuid (app_uuid) to be used in application 2017-10-03 04:28:20 +01:00
Ken Rice 53116495d1 Revert "FS-10416: [mod_commands] add new outbound channels to an in-progress originate"
This commit causes a segfault when parsing destinations that are |
delimited. This patchset needs to be tested further before inclusion
into the tree.

This reverts commit b11955db0b.
2017-07-11 17:25:48 -05:00
Mike Jerris 2a788cdefd Merge pull request #1307 in FS/freeswitch from ~HRISTO/freeswitch:feature/FS-10416-add-new-endpoints-to-be-called-while to master
* commit 'b11955db0bfdcccd5ad98fd689870153d31154f3':
  FS-10416: [mod_commands] add new outbound channels to an in-progress originate
2017-07-06 20:41:20 +00:00
Anthony Minessale e78f3f0c04 FS-10387: [core] High memory usage with mod_sofia, osmo-nitb and DTX setting active #resolve 2017-06-22 15:48:20 -05:00
Hristo Trendev b11955db0b FS-10416: [mod_commands] add new outbound channels to an in-progress originate
This allows new endpoints (outbound channels) to be called, after an originate
is already in progress, where any of the originally called endpoints need to
continue to ring.

One use case would be to convert a 302 Moved Temporarily destination to SIP
endpoint(s) and then to add the new endpoints to an in-progress originate,
without cancelling any of the other (already ringing) outbound channels.
2017-06-21 19:31:46 +02:00
Sergey Safarov df1ab07ca4 FS-9924: Removed extra space in source files 2017-02-09 23:59:49 -05:00
Anthony Minessale b7578ecd98 FS-9654 introduce origination_aleg_uuid 2017-01-17 16:45:22 -06:00
Anthony Minessale cf506d2f02 FS-9880: [freeswitch-core] Code to check for text-only is too soon in app processing #resolve 2016-12-22 13:03:54 -06:00
Anthony Minessale 3b50883734 FS-9638 passing codec through on unanswered channels too (late neg) 2016-11-14 11:35:03 -06:00
Anthony Minessale 9b8a5edd3d FS-9638 2016-11-10 12:09:00 -06:00
Chris Rienzo 120e326760 FS-9644 [mod_commands][core]
update hupall API to support multiple variables
       hupall [cause] [[var1] [val1]] [[var2] [val2]] ...

    added switch_core_session_hupall_matching_vars_ans() which will hang up all channels that match each variable(s) value
2016-10-18 15:08:07 -04:00
Anthony Minessale c409499cd9 FS-9576 #resolve [Add Realtime Text] 2016-09-27 16:40:43 -05:00
Anthony Minessale e7758cb724 FS-9247 #resolve [Table with message type names not updated when enum was updated by sangoma patch] 2016-06-09 13:33:38 -05:00
Ken Rice e18c12b609 FS-8953 [core] white space clean up. 2016-03-17 08:55:00 -05:00
Anthony Minessale eea76c8856 FS-8130
Port video buffer to also support audio and remove original STFU jitter buffer
Add some more resilience to video packet loss
Add codec control mechanism for both call-specific debug and codec/call specfic params
Make opus function better in packet loss and latent situations
Use new codec control prams to make JB lookahead FEC optionally enabled or disabled mid-call
Add Param to allow JB lookahead to be enabled.
2015-09-14 13:30:08 -05:00
Anthony Minessale 004c5080ab FS-8142 minor formatting mod 2015-09-09 11:41:04 -05:00
Artur Zaprzała cd4c3188e4 FS-8142 Fix a thread cache thread-safety and caching 2015-09-09 10:42:10 +02:00
Anthony Minessale a48bccbb09 FS-6833 missing event names in string 2015-09-01 17:17:25 -05:00
Anthony Minessale 3850e467ad FS-8091 #resolve [Missing some message names in switch_core_session.c] 2015-08-28 14:46:45 -05:00
Mike Jerris 5de2f7d7bd FS-7966: multiple fixes for msvc 2015 build, silence multiple warnings 2015-08-27 18:49:13 -06:00
Anthony Minessale b6a6cde728 FS-7486 2015-07-03 14:22:20 -04:00
Anthony Minessale 6a102816f6 FS-7679 #resolve #comment please test, also added some cases of calling a file with no video as well 2015-06-25 13:33:47 -05:00
Anthony Minessale 2188358832 FS-7500 FS-7499 refactoring while battling chrome 2015-05-28 12:47:34 -05:00