From a29bbb250fe1e7fa3566eba4e9cb7769d5e01634 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Wed, 13 Nov 2019 08:49:06 -0800 Subject: [PATCH] Track client's webrtc call session - We want to be able to correlate client webrtc calls with freeswitch logs. We add extra info on callerid which we strip out in akka-fsesl. --- .../freeswitch/voice/freeswitch/ESLEventListener.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java index 5fe62e0dd7..d18b994b21 100755 --- a/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java +++ b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java @@ -51,6 +51,7 @@ public class ESLEventListener implements IEslEventListener { private static final Pattern GLOBAL_AUDION_PATTERN = Pattern.compile("(GLOBAL_AUDIO)_(.*)$"); private static final Pattern CALLERNAME_PATTERN = Pattern.compile("(.*)-bbbID-(.*)$"); + private static final Pattern CALLERNAME_WITH_SESS_INFO_PATTERN = Pattern.compile("^(.*)_(\\d+)-bbbID-(.*)$"); @Override public void conferenceEventJoin(String uniqueId, String confName, int confSize, EslEvent event) { @@ -77,7 +78,11 @@ public class ESLEventListener implements IEslEventListener { conferenceEventListener.handleConferenceEvent(dsStart); } else { Matcher matcher = CALLERNAME_PATTERN.matcher(callerIdName); - if (matcher.matches()) { + Matcher callWithSess = CALLERNAME_WITH_SESS_INFO_PATTERN.matcher(callerIdName); + if (callWithSess.matches()) { + voiceUserId = callWithSess.group(1).trim(); + callerIdName = callWithSess.group(3).trim(); + } else if (matcher.matches()) { voiceUserId = matcher.group(1).trim(); callerIdName = matcher.group(2).trim(); } else {