Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Call } from 'webitel-sdk';

import { useWebSocketClient } from '../../../../../../../../../app/api/agent-workspace/websocket/useWebSocketClient';

const blindTransferDialplan = async (
call: Call,
schemaId: number,
): Promise<void> => {
const { getClientSync } = useWebSocketClient();
const client = getClientSync();

await client.request('call_bt_dialplan', {
id: call.id,
schema_id: schemaId,
});
};

export default blindTransferDialplan;
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<call-transfer-container
type="dialplan"
:get-data="getDialplans"
>
<template #avatar>
<wt-icon icon="bot" />
</template>
<template #actions="{ item }">
<wt-rounded-action
color="transfer"
icon="call-transfer--filled"
:tooltip="$t('transfer.blindTransfer')"
rounded
:loading="showLoader(item.id)"
@click="transfer(item)"
/>
</template>
</call-transfer-container>
</template>

<script setup lang="ts">
import { DialplansAPI } from '@webitel/api-services/api';
import { EngineListRoutingOutboundCall } from '@webitel/api-services/gen';
import { computed } from 'vue';
import { useStore } from 'vuex';
import { useLoader } from '../../../../../../../composables/useLoader';
import CallTransferContainer from '../_shared/components/call-transfer-container.vue';
import blindTransferDialplan from '../_shared/utils/blindTransferDialplan';
import { TransferParams } from '../types/transfer-tabs';

const store = useStore();
const { showLoader, runWithLoader } = useLoader();

const call = computed(() => store.getters['features/call/CALL_ON_WORKSPACE']);

const emit = defineEmits([
'transfer-complete',
]);

const transfer = async (item) => {
if (call.value) {
await runWithLoader(item.id, () =>
blindTransferDialplan(call.value, Number(item.schema.id)),
);
emit('transfer-complete');
}
};

const getDialplans = (
params: TransferParams,
): Promise<EngineListRoutingOutboundCall> => {
return DialplansAPI.getList({
...params,
allowTransfer: true,
});
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useUserinfoStore } from '../../../../../../modules/userinfo/userinfoStore';
import AgentsCallTransfer from './components/agents-call-transfer.vue';
import DialplanCallTransfer from './components/dialplan-call-transfer.vue';
import QueuesCallTransfer from './components/queues-call-transfer.vue';
import UsersCallTransfer from './components/users-call-transfer.vue';

Expand Down Expand Up @@ -59,6 +60,11 @@ const tabs = computed(() => [
value: 'queues',
component: QueuesCallTransfer,
},
{
text: t('WtApplication.admin.sections.dialplan', 2),
value: 'dialplan',
component: DialplanCallTransfer,
},
]);

const currentTab = ref(tabs.value[0]);
Expand All @@ -77,7 +83,7 @@ const currentTab = ref(tabs.value[0]);
&-tabs {
display: grid;
width: 100%;
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(4, 1fr);
margin-bottom: var(--spacing-sm);
}

Expand Down
Loading