/** * Campaign outbound where the script opens the leg (`outboundCallMode: 'script_dial'`). * * The host does not send an INVITE. Phase is `'dialing'`; the starting `channel` * can only dial. Conversation is on the channel `makeCall()` returns. * `makeCall({})` uses the campaign msisdn + the call row's trunk. * * The first successful dial is the campaign row (result, `answer_date`, recording). */ import { defineScript, getScriptPhase } from '@voctiv/agent-sdk'; export default defineScript( async (ctx) => { const phase = getScriptPhase(ctx.context); const channel = phase === 'dialing' ? await ctx.channel.sip.makeCall({}) : ctx.channel; await channel.audio.say('Hello!'); }, { outboundCallMode: 'script_dial' }, );