Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c7fc773
fix: voip call history doesn't always log the correct call information
pierre-lehnen-rc Jan 22, 2025
edf86bf
parse channel data, link users by channel id, handle some voicemail e…
pierre-lehnen-rc Jan 23, 2025
f423ba7
final state before defeat
pierre-lehnen-rc Jan 24, 2025
779d8cf
Merge branch 'develop' into fix/voip-log-parser
pierre-lehnen-rc Jun 3, 2025
2c0b399
conflict merge error
pierre-lehnen-rc Jun 6, 2025
3f2aaf9
parsing channel events, starting work on channel itself
pierre-lehnen-rc Jun 8, 2025
1bb6812
paaarsing
pierre-lehnen-rc Jun 9, 2025
58ce1f0
tamed beast
pierre-lehnen-rc Jun 10, 2025
26147b6
reorganized models
pierre-lehnen-rc Jun 11, 2025
8759514
comments and types
pierre-lehnen-rc Jun 12, 2025
68aebba
remove tools from models
pierre-lehnen-rc Jun 12, 2025
d7673ad
unused new function
pierre-lehnen-rc Jun 12, 2025
31d4ea2
avoid mutating object received as param
pierre-lehnen-rc Jun 12, 2025
4489bb9
small adjustment
pierre-lehnen-rc Jun 13, 2025
aa3eb10
type fixes
pierre-lehnen-rc Jun 13, 2025
3033d18
unit tests
pierre-lehnen-rc Jun 15, 2025
ffa6fbd
changeset
pierre-lehnen-rc Jun 15, 2025
997294d
Merge branch 'develop' of https://github.com/RocketChat/Rocket.Chat i…
cardoso Jun 16, 2025
36d8ee3
replace for...in
pierre-lehnen-rc Jun 16, 2025
7c778c7
changes from code review
pierre-lehnen-rc Jun 17, 2025
0e8f6db
typings
pierre-lehnen-rc Jun 17, 2025
0f1c4e7
simplified code
pierre-lehnen-rc Jun 17, 2025
b7bc10a
filter functions
pierre-lehnen-rc Jun 17, 2025
b7d0f1a
fixing bug introduced by changes done for code review
pierre-lehnen-rc Jun 18, 2025
c351fe2
add support for calls that were initiated by a channel that was origi…
pierre-lehnen-rc Jun 19, 2025
d070b99
add caller to data inserted into leg profiles, and add the inserted d…
pierre-lehnen-rc Jun 19, 2025
93fc022
Merge branch 'develop' into fix/voip-log-parser
pierre-lehnen-rc Jun 27, 2025
f17115c
slight future proofing
pierre-lehnen-rc Jun 27, 2025
d9ed2ad
store data in a format more that is easier to read when debugging call
pierre-lehnen-rc Jun 27, 2025
846ee05
Merge branch 'develop' into fix/voip-log-parser
kodiakhq[bot] Jul 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/shy-colts-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@rocket.chat/model-typings': patch
'@rocket.chat/core-typings': patch
'@rocket.chat/freeswitch': patch
'@rocket.chat/ui-voip': patch
'@rocket.chat/models': patch
'@rocket.chat/tools': patch
'@rocket.chat/meteor': patch
---

Fixes the parsing of FreeSwitch events to properly generate a history of calls on Rocket.Chat
16 changes: 9 additions & 7 deletions apps/meteor/app/statistics/server/lib/getVoIPStatistics.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { log } from 'console';

import type { IStats, IVoIPPeriodStats } from '@rocket.chat/core-typings';
import { FreeSwitchCall } from '@rocket.chat/models';
import { FreeSwitchChannel } from '@rocket.chat/models';
import { MongoInternals } from 'meteor/mongo';

import { readSecondaryPreferred } from '../../../../server/database/readSecondaryPreferred';
Expand Down Expand Up @@ -30,35 +30,37 @@ async function getVoIPStatisticsForPeriod(days?: number): Promise<IVoIPPeriodSta
const statistics: IVoIPPeriodStats = {};

promises.push(
FreeSwitchCall.countCallsByDirection('internal', minDate, options).then((count) => {
FreeSwitchChannel.countChannelsByKind('internal', minDate, options).then((count) => {
statistics.internalCalls = count;
}),
);

promises.push(
FreeSwitchCall.countCallsByDirection('external_inbound', minDate, options).then((count) => {
FreeSwitchChannel.countChannelsByKindAndDirection('external', 'inbound', minDate, options).then((count) => {
statistics.externalInboundCalls = count;
}),
);

promises.push(
FreeSwitchCall.countCallsByDirection('external_outbound', minDate, options).then((count) => {
FreeSwitchChannel.countChannelsByKindAndDirection('external', 'outbound', minDate, options).then((count) => {
statistics.externalOutboundCalls = count;
}),
);

promises.push(
FreeSwitchCall.sumCallsDuration(minDate, options).then((callsDuration) => {
FreeSwitchChannel.sumChannelsDurationByKind('internal', minDate, options).then((callsDuration) => {
statistics.callsDuration = callsDuration;
}),
);

promises.push(
FreeSwitchCall.countCallsBySuccessState(true, minDate, options).then((count) => {
FreeSwitchChannel.countChannelsByKindAndSuccessState('internal', true, minDate, options).then((count) => {
statistics.successfulCalls = count;
}),
);

promises.push(
FreeSwitchCall.countCallsBySuccessState(false, minDate, options).then((count) => {
FreeSwitchChannel.countChannelsByKindAndSuccessState('internal', false, minDate, options).then((count) => {
statistics.failedCalls = count;
}),
);
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/client/hooks/useVoipClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export const useVoipClient = (): UseVoipClientResult => {
iceServers,
connectionRetryCount: Number(voipRetryCount),
enableKeepAliveUsingOptionsForUnstableNetworks: Boolean(enableKeepAlive),
userId: uid || '',
siteUrl: '',
};

client = await (isEE ? EEVoipClient.create(config) : VoIPUser.create(config));
Expand Down
Loading
Loading