Commit Graph
4 Commits
Author SHA1 Message Date
Andrey Volk 815bbf8cfa [Core] Stop partner uuid lookups from growing the session pool, with a unit-test (#3311)
switch_channel_get_partner_uuid_copy() read signal_bond and originate_signal_bond with dup set, so every call
copied the uuid into the session pool before copying it into the caller's buffer. The read path calls it for
each comfort-noise frame of a bridged leg, so the pool grew by 40 bytes per frame until hangup. The lookups now
return the channel's own value, which stays valid under profile_mutex while it is copied.

The copy used strncpy(), which leaves the buffer without a terminating NUL when the value is as long as the
buffer or longer. switch_copy_string() cuts the value to fit and always terminates it.

With RTCP passthru, every received RTCP packet looked the partner up with switch_channel_get_partner_uuid(), which
copies the uuid into the session pool, so the pool grew with each packet until hangup. The lookup now copies the
uuid into a stack buffer with switch_channel_get_partner_uuid_copy().
2026-11-26 15:50:36 +03:00
Andrey Volk 24ff01518f [Unit-tests] Fix build of various unit-tests. 2021-10-23 22:01:08 +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