From e353b751c038c886cb86501b7a3cdcc50fe07459 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Sat, 11 Jul 2026 19:31:59 +0700 Subject: [PATCH] fixed wrongly identify 3pcc call (#245) * fixed wrongly identify 3pcc call * update drachtio 5.0.27 --- lib/call-session.js | 6 +++++- package-lock.json | 34 ++++++++++------------------------ package.json | 2 +- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/lib/call-session.js b/lib/call-session.js index 589b967..07bc8a3 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -109,7 +109,11 @@ class CallSession extends Emitter { async connect() { const {sdp} = this.req.locals; - const is3pcc = this.req.body?.length === 0; + // use the parsed SDP from middleware (req.locals.sdp), not req.body: + // for multipart (SIPREC) or IWF-originated bodies req.body may be empty + // or not represent the actual offer, which would wrongly send an + // SDP-bearing call down the no-offer 3pcc path. + const is3pcc = !sdp || sdp.length === 0; this.logger.info(`inbound ${is3pcc ? '3pcc ' : ''}call accepted for routing`); const engine = this.getRtpEngine(); if (!engine) { diff --git a/package-lock.json b/package-lock.json index 019c4a3..95ccd27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "cidr-matcher": "^2.1.1", "debug": "^4.4.3", "drachtio-fn-b2b-sugar": "0.2.1", - "drachtio-srf": "^5.0.21", + "drachtio-srf": "^5.0.27", "express": "^4.21.2", "pino": "^10.1.0", "verify-aws-sns-signature": "^0.1.0", @@ -3089,9 +3089,9 @@ "integrity": "sha512-bMtje8GWVTze+UG6WSGnlUfBaYCuFiApNXl/XxWc+X9uATZiZkV2jIqhf+Y4SY3nS8dZclJIVKd9qwoCa+i+Vw==" }, "node_modules/drachtio-srf": { - "version": "5.0.21", - "resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.21.tgz", - "integrity": "sha512-9hkQ7LURI1ceTMs49Nh2aosAd2v0565eD8Ccho5sSzXEHuq0DE3epjStlThq6LvIGVVAOXuSQGXFmlMWK92R3w==", + "version": "5.0.27", + "resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.27.tgz", + "integrity": "sha512-UCNITDPJreCurG5reM2TSmWSbT52azPaNqoc42L4nljy0aVuDt0Am9ExpAy5RfsP8ioxSY2VdSJehr1ARRJL+Q==", "license": "MIT", "dependencies": { "debug": "^4.4.3", @@ -3099,7 +3099,7 @@ "node-noop": "^1.0.0", "only": "^0.0.2", "sdp-transform": "^2.15.0", - "short-uuid": "^5.2.0", + "short-uuid": "^6.0.3", "sip-methods": "^0.3.0", "sip-status": "^0.1.0", "utils-merge": "^1.0.1", @@ -6111,29 +6111,15 @@ } }, "node_modules/short-uuid": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/short-uuid/-/short-uuid-5.2.0.tgz", - "integrity": "sha512-296/Nzi4DmANh93iYBwT4NoYRJuHnKEzefrkSagQbTH/A6NTaB68hSPDjm5IlbI5dx9FXdmtqPcj6N5H+CPm6w==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/short-uuid/-/short-uuid-6.0.3.tgz", + "integrity": "sha512-UMZ3rYOoid307EqWsPTnoBUSOB51Fi28vUMPigUsSCmbaSvslyf/SlXZWOn4btj8tokhBTBkPFKVKKlIolEG1w==", "license": "MIT", "dependencies": { - "any-base": "^1.1.0", - "uuid": "^9.0.1" + "any-base": "^1.1.0" }, "engines": { - "node": ">=14" - } - }, - "node_modules/short-uuid/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" + "node": ">=14.17.0" } }, "node_modules/side-channel": { diff --git a/package.json b/package.json index 74f65d8..0dc6622 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "cidr-matcher": "^2.1.1", "debug": "^4.4.3", "drachtio-fn-b2b-sugar": "0.2.1", - "drachtio-srf": "^5.0.21", + "drachtio-srf": "^5.0.27", "express": "^4.21.2", "pino": "^10.1.0", "verify-aws-sns-signature": "^0.1.0",