/** * When the host hands a platform-dialed outbound leg to the script. * * - `'on_answer'` — the host dials and starts the script on the `200 OK`. The script * always gets an answered call, which is what a greeting, a turn watchdog and a * max-duration timer assume. * - `'from_invite'` — the host starts the script **first**, then automatically * dials the campaign number on the same `channel`. The session is already * running when the INVITE goes out, so `progress$` / `sipSignal$` see 1xx and * a 4xx/5xx rejects `waitForAnswer()`. Phase is `'early'`; gate the greeting * on `channel.sip.waitForAnswer()`. * - `'script_dial'` — the host does **not** dial. The script starts with no leg at all * (phase `'dialing'`) and opens one itself: * * ```ts * const leg = await channel.sip.makeCall({ msisdn: context.calledNumber }); * await leg.sip.waitForAnswer(); * ``` * * The leg it gets back is the conversation channel — the one the script plays and * listens on. The channel the script starts with can only dial: it has no audio. * The first leg opened this way is the one the platform reports on (result, * `answer_date`, duration, recording), so a script that never dials leaves the * call row with no answer. * * Inbound legs are unaffected — they always start before the answer. `'from_invite'` * additionally lets an inbound run report `'early'` instead of `'online'`. * * `answer_date` and billing never move: both come from the `200 OK`. */ export type OutboundCallMode = 'on_answer' | 'from_invite' | 'script_dial'; /** * Call-handling options a script declares for itself, passed as the second * argument of {@link import('../define-script').defineScript}: * * ```ts * export default defineScript(handler, { outboundCallMode: 'from_invite' }); * ``` * * The host reads them off the default export **before** the session starts, * because they decide *when* it starts. A script that passes nothing gets the * documented defaults. */ export interface ScriptCallOptions { /** * Where the script picks up a platform-dialed outbound leg (campaign dialer, * `platform.call`). See {@link OutboundCallMode} for what each mode implies. * * @defaultValue 'on_answer' */ outboundCallMode?: OutboundCallMode; } //# sourceMappingURL=call-options.d.ts.map