From bef6bb8eadefcf02077ca57dedffa837d89c7499 Mon Sep 17 00:00:00 2001 From: Antonio Date: Tue, 21 Jul 2026 17:54:39 +0200 Subject: [PATCH] fix(pjsip): guard undefined callid on non-private contact --- lib/plugins_command_13/pjsipDetails.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/plugins_command_13/pjsipDetails.js b/lib/plugins_command_13/pjsipDetails.js index 8404d29..342b731 100644 --- a/lib/plugins_command_13/pjsipDetails.js +++ b/lib/plugins_command_13/pjsipDetails.js @@ -127,8 +127,10 @@ var IDLOG = '[pjsipDetails]'; list[data.actionid].ip = (data.uri.split('@')[1]).split(':')[0]; list[data.actionid].port = (data.uri.split('@')[1]).split(':')[1]; } - // check if the IP is private otherwise get it from callid - if (!util.isPrivateIP(list[data.actionid].ip)){ + // check if the IP is private otherwise get it from callid. + // callid is absent for statically-configured (non-registered) + // contacts, so guard it to avoid crashing on public-IP trunks. + if (data.callid && !util.isPrivateIP(list[data.actionid].ip)){ list[data.actionid].ip = data.callid.split('@')[1]; } list[data.actionid].sipuseragent = data.useragent;