feat: Explicit answer/reject for inbound calls (#2504)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent b9f09b7c4e
commit f397596ed1
26 changed files with 503 additions and 362 deletions
+18
View File
@@ -3,6 +3,7 @@ import { mock } from 'vitest-mock-extended';
import { INTERNAL_CALLBACK_ACTION } from '../../src/config/schema/actions/custom/internal.js';
import { ActionConfig } from '../../src/config/schema/actions/types.js';
import {
createCallAnswerAction,
createCallEndAction,
createCallStartAction,
createCameraAction,
@@ -430,6 +431,23 @@ describe('createSubstreamOffAction', () => {
});
});
describe('createCallAnswerAction', () => {
it('should create call answer action', () => {
expect(createCallAnswerAction()).toEqual({
action: 'fire-dom-event',
advanced_camera_card_action: 'call_answer',
});
});
it('should create call answer action with a cardID', () => {
expect(createCallAnswerAction({ cardID: 'card_id' })).toEqual({
action: 'fire-dom-event',
advanced_camera_card_action: 'call_answer',
card_id: 'card_id',
});
});
});
describe('createCallEndAction', () => {
it('should create call end action', () => {
expect(createCallEndAction()).toEqual({