@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 +32 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +32 -1
- package/dist/index.js.map +3 -3
- package/dist/sayna-client.d.ts +50 -1
- package/dist/sayna-client.d.ts.map +1 -1
- package/dist/types.d.ts +46 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3439,6 +3439,37 @@ class SaynaClient {
|
|
|
3439
3439
|
})
|
|
3440
3440
|
});
|
|
3441
3441
|
}
|
|
3442
|
+
async sipCall(roomName, participantName, participantIdentity, fromPhoneNumber, toPhoneNumber, sipConfig) {
|
|
3443
|
+
if (!roomName || roomName.trim().length === 0) {
|
|
3444
|
+
throw new SaynaValidationError("room_name cannot be empty");
|
|
3445
|
+
}
|
|
3446
|
+
if (!participantName || participantName.trim().length === 0) {
|
|
3447
|
+
throw new SaynaValidationError("participant_name cannot be empty");
|
|
3448
|
+
}
|
|
3449
|
+
if (!participantIdentity || participantIdentity.trim().length === 0) {
|
|
3450
|
+
throw new SaynaValidationError("participant_identity cannot be empty");
|
|
3451
|
+
}
|
|
3452
|
+
if (!fromPhoneNumber || fromPhoneNumber.trim().length === 0) {
|
|
3453
|
+
throw new SaynaValidationError("from_phone_number cannot be empty");
|
|
3454
|
+
}
|
|
3455
|
+
if (!toPhoneNumber || toPhoneNumber.trim().length === 0) {
|
|
3456
|
+
throw new SaynaValidationError("to_phone_number cannot be empty");
|
|
3457
|
+
}
|
|
3458
|
+
const body = {
|
|
3459
|
+
room_name: roomName.trim(),
|
|
3460
|
+
participant_name: participantName.trim(),
|
|
3461
|
+
participant_identity: participantIdentity.trim(),
|
|
3462
|
+
from_phone_number: fromPhoneNumber.trim(),
|
|
3463
|
+
to_phone_number: toPhoneNumber.trim()
|
|
3464
|
+
};
|
|
3465
|
+
if (sipConfig) {
|
|
3466
|
+
body.sip = sipConfig;
|
|
3467
|
+
}
|
|
3468
|
+
return this.fetchFromSayna("sip/call", {
|
|
3469
|
+
method: "POST",
|
|
3470
|
+
body: JSON.stringify(body)
|
|
3471
|
+
});
|
|
3472
|
+
}
|
|
3442
3473
|
async getRecording(streamId) {
|
|
3443
3474
|
if (!streamId || streamId.trim().length === 0) {
|
|
3444
3475
|
throw new SaynaValidationError("streamId cannot be empty");
|
|
@@ -3652,4 +3683,4 @@ export {
|
|
|
3652
3683
|
SaynaClient
|
|
3653
3684
|
};
|
|
3654
3685
|
|
|
3655
|
-
//# debugId=
|
|
3686
|
+
//# debugId=7F7E8DB17A66E86F64756E2164756E21
|