/** * Schedule outbound using CMS contact-rules defaults already resolved on `context`. * * When `recallCount` / `recallDelay` are omitted from `platform.call()` options, the host * fills them from `context.recallCount` / `context.recallDelay` only when `onFailedCall` is * not configured for that scheduled call. */ import { defineScript } from '@voctiv/agent-sdk'; export default defineScript(async ({ channel, context, logger, platform }) => { channel.sip.answer(); const msisdn = context.msisdn || context.callerId; if (!msisdn) return; logger.log('Recall configuration snapshot', { effective: { count: context.recallCount, delaySec: context.recallDelay, }, agentDefaults: { count: context.agent?.recallCount, delaySec: context.agent?.recallDelay, }, attempt: context.attempt, }); await platform.call(msisdn); await channel.audio.say('We have scheduled a call using your agent recall settings.'); });