feat: provision record all call (#254)

This commit is contained in:
Hoan Luu Huu authored and GitHub committed 2023-06-13 09:03:44 -04:00
1 parent b1fe033c12
commit 96ffce8cd1
25 files changed
+4315 -4998

No files matched your search

+29
View File
@@ -17,6 +17,7 @@ interface JambonzWindowObject {
DISABLE_JAEGER_TRACING: string;
DISABLE_CUSTOM_SPEECH: string;
ENABLE_FORGOT_PASSWORD: string;
DISABLE_CALL_RECORDING: string;
}
declare global {
@@ -51,6 +52,11 @@ export const DISABLE_JAEGER_TRACING: boolean =
window.JAMBONZ?.DISABLE_JAEGER_TRACING === "true" ||
JSON.parse(import.meta.env.VITE_APP_JAEGER_TRACING_DISABLED || "false");
/** Enable Record All Call Feature */
export const DISABLE_CALL_RECORDING: boolean =
window.JAMBONZ?.DISABLE_CALL_RECORDING === "true" ||
JSON.parse(import.meta.env.VITE_APP_DISABLE_CALL_RECORDING || "false");
/** TCP Max Port */
export const TCP_MAX_PORT = 65535;
@@ -122,7 +128,30 @@ export const SIP_GATEWAY_PROTOCOL_OPTIONS = [
value: "tls/srtp",
},
];
/**
* Record bucket type
*/
export const BUCKET_VENDOR_OPTIONS = [
{
name: "NONE",
value: "",
},
{
name: "AWS S3",
value: "aws_s3",
},
];
export const AUDIO_FORMAT_OPTIONS = [
{
name: "mp3",
value: "mp3",
},
{
name: "wav",
value: "wav",
},
];
/** Password Length options */
export const PASSWORD_MIN = 8;
+13
View File
@@ -70,6 +70,8 @@ import type {
Lcr,
LcrRoute,
LcrCarrierSetEntry,
BucketCredential,
BucketCredentialTestResult,
} from "./types";
import { StatusCodes } from "./types";
import { JaegerRoot } from "./jaeger-types";
@@ -83,6 +85,7 @@ const fetchTransport = <Type>(
try {
const response = await fetch(url, options);
const transport: FetchTransport<Type> = {
headers: response.headers,
status: response.status,
json: <Type>{},
};
@@ -267,6 +270,16 @@ export const postAccount = (payload: Partial<Account>) => {
return postFetch<SidResponse, Partial<Account>>(API_ACCOUNTS, payload);
};
export const postAccountBucketCredentialTest = (
sid: string,
payload: Partial<BucketCredential>
) => {
return postFetch<BucketCredentialTestResult, Partial<BucketCredential>>(
`${API_ACCOUNTS}/${sid}/BucketCredentialTest`,
payload
);
};
export const postApplication = (payload: Partial<Application>) => {
return postFetch<SidResponse, Partial<Application>>(
API_APPLICATIONS,
+12
View File
@@ -37,6 +37,18 @@ export interface JaegerAttribute {
value: JaegerValue;
}
export interface WaveSufferSttResult {
vendor: string;
transcript: string;
confidence: number;
language_code: string;
}
export interface WaveSufferDtmfResult {
dtmf: string;
duration: string;
}
export interface JaegerValue {
stringValue: string;
doubleValue: string;
+26 -2
View File
@@ -51,6 +51,7 @@ export enum StatusCodes {
/** Fetch transport interfaces */
export interface FetchTransport<Type> {
headers: Headers;
status: StatusCodes;
json: Type;
blob?: Blob;
@@ -87,7 +88,7 @@ export interface SelectorOptions {
value: string;
}
export interface Pcap {
export interface DownloadedBlob {
data_url: string;
file_name: string;
}
@@ -102,6 +103,11 @@ export interface CredentialTestResult {
tts: CredentialTest;
}
export interface BucketCredentialTestResult {
status: CredentialStatus;
reason: string;
}
export interface LimitField {
label: string;
category: LimitCategories;
@@ -246,7 +252,23 @@ export interface Account {
registration_hook: null | WebHook;
service_provider_sid: string;
device_calling_application_sid: null | string;
lcr_sid: null | string;
record_all_calls: number;
record_format?: null | string;
bucket_credential: null | BucketCredential;
}
export interface AwsTag {
Key: string;
Value: string;
}
export interface BucketCredential {
vendor: null | string;
region?: null | string;
name?: null | string;
access_key_id?: null | string;
secret_access_key?: null | string;
tags?: null | AwsTag[];
}
export interface Application {
@@ -262,6 +284,7 @@ export interface Application {
speech_synthesis_language: null | string;
speech_recognizer_vendor: null | Lowercase<Vendor>;
speech_recognizer_language: null | string;
record_all_calls: number;
}
export interface PhoneNumber {
@@ -298,6 +321,7 @@ export interface RecentCall {
direction: string;
trunk: string;
trace_id: string;
recording_url?: string;
}
export interface SpeechCredential {