Skip to content

[codex] implement outbound quick calls#14

Merged
DebdipWritesCode merged 2 commits into
mainfrom
codex/outbound-calls-end-to-end
Jun 15, 2026
Merged

[codex] implement outbound quick calls#14
DebdipWritesCode merged 2 commits into
mainfrom
codex/outbound-calls-end-to-end

Conversation

@rahuliitk

Copy link
Copy Markdown
Contributor

Summary

  • Add server-side outbound quick-call dispatch that validates the selected caller ID belongs to the active/configured agent, resolves provider/SID from the database, and persists LiveKit dispatch metadata.
  • Add runtime agent-config fallback by agent ID for outbound jobs, plus metadata-driven outbound first-message/system-prompt overrides in the AI worker.
  • Add a console /outbound quick-call screen with assigned-number selection and API mutation wiring.

Validation

  • pnpm --filter server exec tsx --test tests/outbound/outbound-call.schema.test.ts tests/outbound/outbound-call.service.test.ts tests/outbound/outbound-call.route.test.ts
  • apps/ai/.venv/bin/python -m unittest discover apps/ai/tests
  • pnpm --filter server check-types
  • pnpm --filter console exec tsc --noEmit
  • pnpm --filter console lint (0 errors, existing warnings remain)
  • find tests -name '*.test.ts' -print0 | xargs -0 pnpm exec tsx --test from apps/server
  • pnpm build
  • Browser smoke: unauthenticated http://localhost:3100/outbound redirects to /login with no runtime console errors.

Notes

  • I did not place a live PSTN test call because there was no known user-controlled destination number available, and I avoided calling arbitrary/customer numbers.

Copy link
Copy Markdown
Contributor Author

Live outbound verification update:

  • Created LiveKit outbound trunk ST_7mnYLU6NUMKV for Twilio domain quickvoice-livekit.pstn.twilio.com, restricted to +16812696313.
  • Added/attached a dedicated Twilio SIP credential list to the existing QuickVoice LiveKit Elastic SIP trunk, then updated the LiveKit trunk with matching SIP auth.
  • Ran this PR's outbound service orchestration locally against real LiveKit/Twilio and this PR's AI worker under a unique agent name.
  • Controlled destination: +918274925985.
  • Final live call result: Twilio status completed, direction trunking-terminating, duration 26s, price $0.06590, from +16812696313.
  • The PR worker logs showed outbound metadata was applied: the brief test first message and live-test system prompt overrode the agent's saved default prompt for the outbound job.

Production config note: ECS task definition currently has LIVEKIT_SIP_OUTBOUND_TRUNK_TWILIO_ID set to placeholder text. Deploying this PR should also set LIVEKIT_SIP_OUTBOUND_TRUNK_TWILIO_ID=ST_7mnYLU6NUMKV for quickvoice-server. Telnyx remains unwired unless/until a Telnyx LiveKit outbound trunk is provisioned.

Copy link
Copy Markdown
Contributor Author

Outbound UI QA/polish update:

  • Polished /outbound quick-call UI to show carrier/provider context, friendly line names, all assigned caller IDs, inline started-call feedback, and a disabled submit state until the recipient number is present.
  • Verified the real route with a local authenticated mock API for session, agents, numbers, and quick-call submit.
  • Interaction tested: /outbound -> fill recipient, name, first message, system prompt override -> Start call -> success toast and inline started-call message.
  • Verified submitted payload included agentId, phoneNumber, fromNumber, username, firstMessage, and systemPrompt.
  • Browser checks: desktop screenshot, narrow mobile screenshot, mobile action/ready-lines scroll check, and console error check all clean.
  • Commands run: pnpm --filter console exec tsc --noEmit, pnpm --filter console lint (0 errors, existing warnings only), pnpm --filter console build, git diff --check.

Screenshots were captured locally under /tmp/quickvoice-outbound-*.png; no screenshot artifacts were committed.

@DebdipWritesCode DebdipWritesCode marked this pull request as ready for review June 15, 2026 17:11
@DebdipWritesCode DebdipWritesCode merged commit 44a05b3 into main Jun 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants