From b9e9fe305ae1f56a8cd56fef8abc17171b077649 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Tue, 8 Sep 2026 00:42:47 +0700 Subject: [PATCH] Fix/siprec survives fs transfer (#232) * fix: keep siprec recording alive across a feature server transfer A cross-feature-server move (enqueue/dequeue or conference) re-negotiates the feature-server leg in _onFeatureServerTransfer, but nothing rebuilt the rtpengine subscription the SIPREC recording forks from, so the recorder went silent from the moment the call moved. The fresh destroy handler installed on the new leg also dropped the _stopRecording() call the original handlers have, so the SIPREC dialog was never BYEd and the recorder had to wait out its media timeout. Rebuild the subscription after the transfer re-negotiates media, and stop the recording when the transferred leg ends. The resubscribe call is guarded so this is safe to deploy before @jambonz/siprec-client-utils is bumped. Co-Authored-By: Claude Opus 5 (1M context) * fix: drop the siprec re-subscribe, keep the missing teardown The cross-feature-server move was tested on a real two-feature-server cluster (inbound path): the rtpengine subscription survives the REFER on its own, so resubscribe() was fixing a fault that does not exist. rtpengine keeps non-offer-answer subscriptions across an answer. What does fail, and what this branch still fixes, is the teardown: the destroy handler installed on the transferred leg never stopped the recording, so the recorder was left without a BYE. Verified on the inbound path; the outbound transfer path has the identical handler and the same omission. Co-Authored-By: Claude Opus 5 (1M context) --------- Co-authored-by: Claude Opus 5 (1M context) --- lib/call-session.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/call-session.js b/lib/call-session.js index c58c924..355e174 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -1266,6 +1266,7 @@ Duration=${payload.duration} ` this.activeCallIds.delete(this.req.get('Call-ID')); if (this.activeCallIds.size === 0) this.idleEmitter.emit('idle'); uac.other.destroy(); + this._stopRecording(); if (this.req.locals.cdr) { const now = Date.now(); const day = new Date();