Skip to content

Commit fc4b49a

Browse files
feat: prevents text being cutoff in flow sipcapture/homer-app#542
1 parent 4c4f4c6 commit fc4b49a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/app/helpers/parser.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,14 @@ export class TransactionServiceProcessor {
731731
const codecString = `${name || '--'}/${!isNaN(rate) ? rate : '--'}/PT:${
732732
!isNaN(pt) ? pt : '--'
733733
}`;
734-
const outDataItem = {
734+
const fallbackDescription = `${sIP}:${sPORT} -> ${dIP}:${dPORT}`;
735+
const isRuriFromMessage = i.raw_source.includes(i.ruri_user);
736+
const ruriDescription = isRuriFromMessage ? i.raw_source : i.ruri_user;
737+
const isCodecValid = pt || name || rate;
738+
const RTPDescription = isRTP && isCodecValid ? codecString : fallbackDescription
739+
const description = ruriDescription || RTPDescription;
740+
741+
const outDataItem = {
735742
id: i.id,
736743
codecData,
737744
callid: i.callid,
@@ -740,10 +747,7 @@ export class TransactionServiceProcessor {
740747
: eventName),
741748
method: eventName,
742749
description:
743-
i.ruri_user ||
744-
(isRTP && (pt || name || rate)
745-
? codecString
746-
: `${sIP}:${sPORT} -> ${dIP}:${dPORT}`),
750+
description,
747751
info_date: `[${i.id || '#' + (pid + 1)}] [${protoName}] ${moment(
748752
i.micro_ts
749753
).format(dateFormat)}`,

0 commit comments

Comments
 (0)