Skip to content

feat(simulate): run audio simulations against a phone number with --to-phone-number - #1035

Merged
u9g merged 4 commits into
mainfrom
jason/simulate-phone-number
Oct 27, 2026
Merged

u9g merged 4 commits into
mainfrom
jason/simulate-phone-number

Conversation

@u9g

@u9g u9g commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

lk agent simulate audio can now run a scenarios file against a phone number instead of an agent:

lk agent simulate audio --scenarios scenarios.yaml --to-phone-number +14154176004 --from-phone-number +14128420792
lk agent simulate audio --scenarios scenarios.yaml --to-phone-number +14154176004 --from-phone-number +15105550199 --trunk ST_xxx

Each simulation calls --to-phone-number over SIP, and whoever answers is the agent under test. This tests a production telephony agent through its real number and SIP path, with no simulation code in the agent. Nothing is spawned locally, so, as with --agent-name, --scenarios is required.

Flag Meaning
--to-phone-number Number to call. Requires --from-phone-number.
--trunk Outbound SIP trunk to call through. Without it, the call goes out from a LiveKit phone number. Requires --to-phone-number.
--from-phone-number Caller number: a LiveKit phone number the project owns, or a number on --trunk. Always required, so every simulation call has a caller ID that belongs to whoever runs it.

The flags map one-to-one onto the new SimulationRun.Create.Request fields (sip_call_to, sip_trunk_id, sip_number), which match CreateSIPParticipantRequest. The flag names match lk sip participant create (--trunk, --from-phone-number, --to-phone-number; after #1083).

Depends on livekit/protocol#1858 (the request fields) and livekit/agents-private#549 (the simulation service that places the call). Release after #549 is deployed: an older server ignores the new fields and would dispatch an agent with an empty name instead of calling the number.

Commits

  1. chore: bump protocol for the simulation run's SIP fields
  2. feat(simulate): run audio simulations against a phone number with --to-phone-number
  3. fix(simulate): reject --from-phone-number without --to-phone-number
  4. refactor(simulate): name the SIP trunk flag --trunk

@u9g
u9g force-pushed the jason/simulate-phone-number branch from 44934b1 to af4b79b Compare October 13, 2026 22:27
@u9g u9g changed the title feat(simulate): run audio simulations against a phone number with --phone-number feat(simulate): run audio simulations against a phone number with --to-phone-number Oct 13, 2026
@u9g
u9g force-pushed the jason/simulate-phone-number branch from af4b79b to 8b959be Compare October 14, 2026 02:34
@u9g

u9g commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

lk agent simulate audio --to-phone-number against staging, running this PR with livekit/agents-private#549: the same booking scenario calls an agent's real phone number twice, first from a LiveKit phone number (--from-phone-number), then through a Twilio Elastic SIP Trunk (--from-trunk). Both pass.

simulate-phone-number.mp4

@u9g
u9g force-pushed the jason/simulate-phone-number branch from 8b959be to 277207e Compare October 26, 2026 16:08
Without a number to call, a caller number would be dropped and the run would
dispatch an agent instead.
@u9g u9g changed the title feat(simulate): run audio simulations against a phone number with --to-phone-number feat(simulate): run audio simulations against a phone number with --call Oct 26, 2026
@u9g
u9g force-pushed the jason/simulate-phone-number branch from 228eb1b to 9f26636 Compare October 26, 2026 20:53
@u9g u9g changed the title feat(simulate): run audio simulations against a phone number with --call feat(simulate): run audio simulations against a phone number with --to-phone-number Oct 26, 2026
@u9g
u9g merged commit a7d37ac into main Oct 27, 2026
26 checks passed
@u9g
u9g deleted the jason/simulate-phone-number branch October 27, 2026 12:16
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