Skip to content

Commit

Permalink
feat: prevents text being cutoff in flow sipcapture/homer-app#542
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyOplachko committed Jun 4, 2024
1 parent 4c4f4c6 commit fc4b49a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/app/helpers/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,14 @@ export class TransactionServiceProcessor {
const codecString = `${name || '--'}/${!isNaN(rate) ? rate : '--'}/PT:${
!isNaN(pt) ? pt : '--'
}`;
const outDataItem = {
const fallbackDescription = `${sIP}:${sPORT} -> ${dIP}:${dPORT}`;
const isRuriFromMessage = i.raw_source.includes(i.ruri_user);
const ruriDescription = isRuriFromMessage ? i.raw_source : i.ruri_user;
const isCodecValid = pt || name || rate;
const RTPDescription = isRTP && isCodecValid ? codecString : fallbackDescription
const description = ruriDescription || RTPDescription;

const outDataItem = {
id: i.id,
codecData,
callid: i.callid,
Expand All @@ -740,10 +747,7 @@ export class TransactionServiceProcessor {
: eventName),
method: eventName,
description:
i.ruri_user ||
(isRTP && (pt || name || rate)
? codecString
: `${sIP}:${sPORT} -> ${dIP}:${dPORT}`),
description,
info_date: `[${i.id || '#' + (pid + 1)}] [${protoName}] ${moment(
i.micro_ts
).format(dateFormat)}`,
Expand Down

0 comments on commit fc4b49a

Please sign in to comment.