]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_sdp_rtp: Fix intermittent call drop on reINVITE sdp change master
authorMike Bradeen <mbradeen@sangoma.com>
Wed, 5 Aug 2026 23:01:18 +0000 (17:01 -0600)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thu, 6 Aug 2026 15:45:49 +0000 (15:45 +0000)
commitf0c1c1a7b79b0f8cc0311649bf36824cbeee30a9
tree80c83e29290905e575bd3ffb4e62271705733f3f
parent926a1068f21e1753ceead1e04f881b793d48626a
res_pjsip_sdp_rtp: Fix intermittent call drop on reINVITE sdp change

A reINVITE that changed the offered codec set (e.g. ulaw+alaw -> alaw
only) could lead to call teardown when a bridge write still using the
old format occurred during the re-negotiation.

This change avoids the termination by making the following changes.

First, Asterisk now holds the lock across both the tx payload update
and the channel format update so they commit atomically.

Second, when processing the sdp on the new incoming offer, merge the
new offer with the old until the negotiation is complete.

Also adds unit tests for the sdp merge

Fixes: #2059
include/asterisk/rtp_engine.h
main/rtp_engine.c
res/res_pjsip_sdp_rtp.c
tests/test_res_rtp.c