Conference sessions (an AI assistant in a call with people)
A voice agent can sit in a call with a customer, any number of your staff and other AIs. It hears everyone, each on their own track, keeps the whole conversation as context, and speaks only when a sentence starts with its name, or, in Lead mode, when the customer speaks. Your call-centre app runs the call; we run the AI.
customer ⇄ your SIP trunk ⇄ your LiveKit room ⇄ your agents, other AIs
▲
└── Senaiy agent: hears every track, speaks when addressed
your app ── POST /v1/conference-sessions ─────────────▶ Senaiy
◀── signed events to your webhook endpoint ──── Senaiy
── POST /v1/conference-sessions/{id}/control ─▶ Senaiy
This uses an API key with the agents.run scope (Authentication), like
Voice calls. Responses are wrapped in {"message": …}.
1. Before the first session
- A webhook endpoint for the events. Register it, verify it and keep its signing secret, as
in "Registering the events endpoint" below.
events_urlmust be exactly its URL. We refuse any other URL, so events never go to an address you did not register. The agent's tools. Grant the agent the conference tools you want it to use:
show_on_screen: long answers go to the agent's screen.request_human: Lead mode, ask for a person.hand_off_to_ai: pass a request to another AI.
The agent cannot end, hold or transfer a conference: the line is yours.
- The agent's name for speech recognition. See "Wake names" below. List the spellings in
wake.names.
Registering the events endpoint
Do this once per URL, in the Senaiy portal of the organization that owns the agent.
- Register the URL. Open Developer → Webhooks → Register endpoint, and enter the URL that will
receive the events.
- It must be reachable from the internet and resolve to a public address. A private or internal address is refused.
- We don't follow redirects, so give the final URL.
- Register a URL once. If it is there twice, delete the extra copy: each copy has its own secret, and the events would be signed with the secret of whichever copy we pick.
- Choose the subscribed events. These choose the platform's other webhooks, such as
run_lifecycleorcall.ended(Webhooks). Conference events go to the endpoint named inevents_urlwhatever you tick, so tick only what you also want to receive. Those other webhooks are signed differently (see step 5). Verify that you own it. When you press Verify on the endpoint's page, we send:
POST <your URL> Content-Type: application/json {"type": "verification", "challenge": "<token>"}Answer within 10 seconds with a 2xx status and a JSON body whose top-level
challengeis the same token:{"challenge": "<token>"}.- Until it is verified, the endpoint stays "Pending Verification" and a session that names it is refused.
- Receivers built on Frappe: a whitelisted method's return value is wrapped as
{"message": {...}}, which does not pass. Setfrappe.response["challenge"] = challengeinstead of returning it.
- Keep the signing secret. The register dialog shows only the verification token. To get the
secret, press Rotate secret on the endpoint's page. It is shown once, so store it in your app's
settings.
- Rotating again replaces it.
- Sessions started after a rotation sign with the new secret.
Check every delivery. Conference events carry
X-SL-TimestampandX-SL-Signature: v1=<hex>. Compute the HMAC over the raw body exactly as received, before any JSON parsing:import hashlib, hmac, time def is_from_senaiy(secret: str, timestamp: str, signature: str, raw_body: bytes) -> bool: if not timestamp.isdigit() or abs(time.time() - int(timestamp)) > 300: return False expected = "v1=" + hmac.new(secret.encode(), f"{timestamp}.".encode() + raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(signature, expected)The platform's other webhooks use the same secret but different headers:
X-SolvFast-Timestamp, andX-SolvFast-Signaturewith the hex digest only, withoutv1=. One URL can receive both kinds: tell them apart by which header is present.Answer 2xx quickly, and do the work afterwards:
- A slow answer holds back the next batch.
- A 4xx other than 408 or 429 makes us drop that batch.
2. Start: POST /v1/conference-sessions
{
"senaiy_agent_id": "acme-sana-voice-agent",
"call_id": "CC-9001",
"livekit": {"url": "wss://livekit.example.com", "token": "<token for our participant>", "room": "conf-9001", "identity": "senaiy-sana"},
"mode": "lead",
"wake": {
"names": {"ar": ["سنا"], "en": ["Sana"]},
"allowed_roles": ["customer", "agent", "supervisor"],
"follow_up_s": 0,
"barge_in": "speaker"
},
"participants": [
{"identity": "sip_+966500000000", "name": "Fahad", "role": "customer"},
{"identity": "agent-khalid", "name": "Khalid", "role": "agent"}
],
"other_ais": [{"identity": "alexa-1", "name": "Alexa"}],
"context": {
"customer": {"name": "Fahad", "tier": "gold"},
"linked_records": [{"doctype": "Sales Order", "name": "SO-0042"}],
"call": {"reason": "late delivery"},
"prior_transcript": [{"speaker": "Fahad", "role": "customer", "text": "طلبي رقم SO-0042 تأخر"}]
},
"policies": {"confirm_tools": ["cancel_booking"], "max_answer_sentences": 3, "announcement": "معكم سنا، المساعدة الذكية."},
"events_url": "https://cc.example.com/senaiy/events"
}
Reply: {"session_id": "a1b2c3d4e5", "call_id": "CC-9001", "status": "joining", "mode": "lead"}. The
agent is in the room in about half a second. The room's token is passed to the agent and never
stored.
| Field | |
|---|---|
mode |
lead: the agent answers every customer line. assistant (default): only lines that start with its name. |
wake.names |
Names by language. The agent wakes when a sentence starts with one, after an optional يا, ok, hey or اوكي. Without names, it answers to its own agent name. |
wake.allowed_roles |
Roles whose wake counts. Empty means every person. A wake from another role is reported as wake.ignored (reason: "role"). An AI never wakes the agent. |
wake.follow_up_s |
0–10, default 0 (off). After the agent answers someone, that person's next line within this many seconds is for the agent without its name. The name alone ("Sana?") always gets "Yes?", and that speaker's next line, within 10 s, is for the agent. |
wake.misheard |
Optional, up to 10 examples of a word that speech-to-text writes as the name, e.g. "«سنا كاملة» is «سنة كاملة» (a whole year)". With them, a name wake whose line only makes sense with the other word is declined in silence (wake.ignored, reason: "not addressed"). Without them, every name wake is answered. See §6. |
wake.barge_in |
Who cuts the agent off while it speaks. speaker (default): the person who addressed it, from their first word. words: anyone saying two words or more. any: any voice, within about 300 ms. off: nobody. "سنا خلاص, Sana, stop) always stops it. |
participants |
identity → name, role. An identity you don't list takes its role from the room: a SIP participant is customer, an agent participant is ai, anyone else is participant. |
other_ais |
Their LiveKit identities. The agent hears and records them but never wakes on them, never answers them, and asks for the floor before speaking (§5). |
context |
customer, linked_records and call are given to the agent with every turn. prior_transcript lines go into the conversation as if heard. |
policies.confirm_tools |
Tools that never run on the agent's word: each call waits for your confirm_action (§4). They must be tools the agent has. |
policies.max_answer_sentences |
Default 3. Anything longer goes to the screen with show_on_screen. |
policies.announcement |
Spoken once, when the first person is in the room. |
mcp.servers |
Refused. The agent uses the connectors it was given on the platform. |
3. Events
Each delivery is a POST to events_url:
{"session_id": "a1b2c3d4e5", "events": [
{"event_id": "6f0c…", "seq": 14, "type": "transcript.segment", "at": 1795560000.512,
"data": {"speaker": "Fahad", "role": "customer", "identity": "sip_+966500000000", "text": "متى يوصل طلبي؟", "start": 1795559998.9, "end": 1795560000.3, "language": "ar"}}
]}
- Signature.
X-SL-Timestamp: <unix seconds>andX-SL-Signature: v1=<hex HMAC-SHA256(signing secret, "<timestamp>.<raw body>")>. Reject old timestamps. - Order.
seqcounts up per session. A batch is retried (0.5, 1, 2, 4, 8 s) until you answer 2xx, and the next batch waits for it. A 4xx other than 408 or 429 is not retried. - Replays. De-duplicate on
event_id. - Timing. Transcript segments are batched for up to 0.5 s. Every other event is sent at once.
| Event | data |
|---|---|
session.joined |
identity, mode, muted |
session.state_changed |
state, previous. One of listening, thinking, speaking, waiting_confirmation, muted. |
transcript.segment |
speaker, role, identity, text, start, end, language. The agent's own words are ai.answer. |
wake.detected |
speaker, role, identity, text |
wake.ignored |
speaker, role, identity, reason: role, muted or not addressed (the line only sounded like the name; see "Wake names") |
ai.answer |
text (what it said), run, turn (wake, follow_up, lead, tap, handoff, assistant_mode), screen_payload ([{title, content}] or null) |
action.pending |
action_id, tool, arguments |
action.completed |
action_id, status: completed, failed, timed out, cancelled or rejected |
floor.request / floor.release |
identity |
human.requested |
reason, queue |
ai.handoff_requested |
to, reason |
mode.changed |
mode, previous |
summary.ready |
summary: the call so far, for the person taking over |
session.ended |
reason, usage: listening_s, active_s, stt_s, tts_chars, llm_tokens |
session.error |
message |
4. Control: POST /v1/conference-sessions/{id}/control
Send {"action": "<action>", …fields}. The reply carries the agent's state, mode and muted.
action |
Fields | What happens |
|---|---|---|
wake |
speaker? |
The agent says "Yes?". The next line from speaker, or from anyone if omitted, is for it. Works while muted. |
stop_speaking |
Stops speaking now. | |
mute / unmute |
Muted, its name does not wake it and it does not lead. wake still works. |
|
set_mode |
mode |
To assistant: it stops mid-sentence, says one hand-over line, listens, and sends summary.ready. To lead: it answers the customer from now on. |
update_participants |
participants?, other_ais? |
Replaces either list. |
update_context |
customer?, linked_records?, call? |
Merged into the context. |
confirm_action |
action_id |
The action runs. Its result reaches the agent, which says it, and you get action.completed. |
reject_action |
action_id, reason? |
Not run. The agent is told on its next turn. action.completed has status: "rejected". |
edit_action |
action_id, arguments |
New arguments. It waits for confirm_action again, and action.pending is sent again. |
floor_granted / floor_denied |
The answer to floor.request (§5). |
|
ai_handoff |
from, reason |
Another AI hands the conversation to this one, which takes it from there. |
end |
reason? |
The agent leaves. session.ended follows. |
GET /v1/conference-sessions/{id} returns the session's status, mode, participants, transcript,
actions, usage and turn latencies.
5. Several AIs in one call
When other_ais is not empty, or two Senaiy agents share the room, an agent asks for the floor
before it speaks:
- It emits
floor.requestand starts working on the answer. - It holds the answer until you send
floor_granted. floor_denied, or no reply within 3 s, drops the answer.floor.releasefollows once it has finished speaking.
With no other AI, there is no floor to ask for. To pass a request to another AI, the agent calls
hand_off_to_ai and you get ai.handoff_requested.
Two Senaiy agents of your organization in the same room share one transcription of each person. The second agent adds no speech-to-text cost, and each hears the other's exact words, not a transcript of its voice.
6. Wake names: what we measured
voice_runtime/wake_bench.py builds the BRD's test set and scores it as phone audio:
- The set: 200 wakes per dialect, 216 mid-sentence mentions, plus ordinary talk that includes the
words that sound like the name.
- The audio: spoken by ElevenLabs, cut to 8 kHz μ-law with noise at 20 dB SNR.
- The transcription: ElevenLabs Scribe v2.
These are first results on 40 sentences per dialect and kind.
| «سنا» / "Sana" | Saudi | Egyptian | English |
|---|---|---|---|
| Wakes detected, plain speech-to-text | 0 % | 2.5 % | 87.5 % |
| Wakes detected, name given to speech-to-text as a key term | 95 % | 85 % | (not run) |
| Mid-sentence mentions that woke it | 0 % | 0 % | 0 % |
| Ordinary talk that woke it, key term on (adversarial set: «سنة», «سناء», «ثناء») | 2 / 10 | 4 / 10 | — |
Without help, speech recognition writes «سنا» as «سنة» (year), «سنى», «ثنى», «ستنة» or «استنى». A conference therefore always gives the names to speech-to-text as key terms.
Key terms also pull «سنة» and «سناء» at the start of a sentence onto «سنا». wake.misheard lets the
agent decline those. We tested the instruction on production's gpt-5.4-mini with 8 real wakes and
7 mishearings:
| How the agent was told | Real wakes answered | Mishearings declined |
|---|---|---|
| In general terms, first wording | 2 of 5 | 2 of 5 |
| In general terms, "a question or request after your name is always for you" | 8 of 8 | 2 of 7 |
| A list of sound-alike words | 7 of 8 | 0 of 7 |
Phrase examples (wake.misheard) |
8 of 8 | 5 of 7, mostly the ones the examples named |
A real request left unanswered costs more than an occasional answer to a misheard line, which
someone can stop with "
Before go-live, what we recommend:
- Run the full set (--per-kind 0) with your own recordings or voices.
- Use «يا سنا» in staff training.
- List the mishearings that keep coming back as examples.
- Set the targets on those numbers.
7. Latency
Each turn's time is measured from the end of the sentence (the speaker's pause, less the 0.5 s it
takes to notice it) to the first audio of the answer. It is reported per session (GET, latencies)
and across sessions (agents.conference.latency_report).
For reference, one-to-one calls on production (Sana, 70 turns from 2026-11-18 to 19) took p50 1.79 s and p90 3.74 s from the end of the caller's turn to the first audio. A conference turn adds the 0.5 s pause that ends a line, which is longer than a one-to-one call's. The BRD's 1.5 s p50 / 2.5 s p90 is not met yet.
If nothing has been said 1.5 s after the agent was addressed, it says a short filler («لحظة…»). When
wake.misheard is set, a name wake's filler waits until the agent knows it is answering.
Limits
- One Senaiy agent per session. A second agent in the same room is a second session.
- Transcription per person streams for as long as the person is in the room. Each person's audio
is billed as speech-to-text time (
stt_s). - Lines are kept in the call's conversation. A long call keeps a rolling summary (identifiers kept word for word) plus its latest 30 lines verbatim. The full transcript stays on the session.