feat(placetel): Add hungup call trigger

This commit is contained in:
Faruk AYDIN
2023-10-06 16:07:34 +02:00
parent 2099978b8f
commit ef087be4f0
5 changed files with 138 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import listNumbers from './list-numbers';
export default [listNumbers];

View File

@@ -0,0 +1,31 @@
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
export default {
name: 'List numbers',
key: 'listNumbers',
async run($: IGlobalVariable) {
const numbers: {
data: IJSONObject[];
} = {
data: [],
};
const { data } = await $.http.get('/v2/numbers');
if (!data) {
return { data: [] };
}
if (data.length) {
for (const number of data) {
numbers.data.push({
value: number.number,
name: number.number,
});
}
}
return numbers;
},
};