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;