@sayna-ai/node-sdk 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3476,6 +3476,37 @@ class SaynaClient {
3476
3476
  })
3477
3477
  });
3478
3478
  }
3479
+ async sipCall(roomName, participantName, participantIdentity, fromPhoneNumber, toPhoneNumber, sipConfig) {
3480
+ if (!roomName || roomName.trim().length === 0) {
3481
+ throw new SaynaValidationError("room_name cannot be empty");
3482
+ }
3483
+ if (!participantName || participantName.trim().length === 0) {
3484
+ throw new SaynaValidationError("participant_name cannot be empty");
3485
+ }
3486
+ if (!participantIdentity || participantIdentity.trim().length === 0) {
3487
+ throw new SaynaValidationError("participant_identity cannot be empty");
3488
+ }
3489
+ if (!fromPhoneNumber || fromPhoneNumber.trim().length === 0) {
3490
+ throw new SaynaValidationError("from_phone_number cannot be empty");
3491
+ }
3492
+ if (!toPhoneNumber || toPhoneNumber.trim().length === 0) {
3493
+ throw new SaynaValidationError("to_phone_number cannot be empty");
3494
+ }
3495
+ const body = {
3496
+ room_name: roomName.trim(),
3497
+ participant_name: participantName.trim(),
3498
+ participant_identity: participantIdentity.trim(),
3499
+ from_phone_number: fromPhoneNumber.trim(),
3500
+ to_phone_number: toPhoneNumber.trim()
3501
+ };
3502
+ if (sipConfig) {
3503
+ body.sip = sipConfig;
3504
+ }
3505
+ return this.fetchFromSayna("sip/call", {
3506
+ method: "POST",
3507
+ body: JSON.stringify(body)
3508
+ });
3509
+ }
3479
3510
  async getRecording(streamId) {
3480
3511
  if (!streamId || streamId.trim().length === 0) {
3481
3512
  throw new SaynaValidationError("streamId cannot be empty");
@@ -3678,4 +3709,4 @@ async function saynaConnect(url, sttConfig, ttsConfig, livekitConfig, withoutAud
3678
3709
  return client;
3679
3710
  }
3680
3711
 
3681
- //# debugId=7B83EE0F9AE502FD64756E2164756E21
3712
+ //# debugId=60C9CBFBEDADAA1664756E2164756E21