Skip to content

Commit

Permalink
Default ringingTimeout and maxCallDuration to be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
umarniz committed Nov 28, 2024
1 parent 8da0535 commit 3af97e5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/livekit-server-sdk/src/SipClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ export class SipClient extends ServiceBase {
let playRingtone: boolean = false;
let playDialtone: boolean = false;
let hidePhoneNumber: boolean = false;
let ringingTimeout: number = 0;
let maxCallDuration: number = 0;
let enableKrisp: boolean = false;
let ringingTimeout: number | undefined = undefined;
let maxCallDuration: number | undefined = undefined;
let enableKrisp: boolean | undefined = undefined;

if (opts !== undefined) {
participantIdentity = opts.participantIdentity || '';
Expand All @@ -435,9 +435,9 @@ export class SipClient extends ServiceBase {
playRingtone = opts.playRingtone || false;
playDialtone = opts.playDialtone || playRingtone; // Enable PlayDialtone if either PlayDialtone or playRingtone is set
hidePhoneNumber = opts.hidePhoneNumber || false;
ringingTimeout = opts.ringingTimeout || 0;
maxCallDuration = opts.maxCallDuration || 0;
enableKrisp = opts.enableKrisp || false;
ringingTimeout = opts.ringingTimeout || undefined;
maxCallDuration = opts.maxCallDuration || undefined;
enableKrisp = opts.enableKrisp || undefined;
}

const req = new CreateSIPParticipantRequest({
Expand All @@ -451,8 +451,8 @@ export class SipClient extends ServiceBase {
playRingtone: playDialtone,
playDialtone: playDialtone,
hidePhoneNumber: hidePhoneNumber,
ringingTimeout: new Duration({ seconds: BigInt(ringingTimeout) }),
maxCallDuration: new Duration({ seconds: BigInt(maxCallDuration) }),
ringingTimeout: ringingTimeout ? new Duration({ seconds: BigInt(ringingTimeout) }) : undefined,
maxCallDuration: maxCallDuration ? new Duration({ seconds: BigInt(maxCallDuration) }) : undefined,
enableKrisp: enableKrisp,
}).toJson();

Expand Down

0 comments on commit 3af97e5

Please sign in to comment.