Route Inbound Calls to a Browser Client
Ring one agent on a Sautikit inbound call: dial a SIP credential as client:<username>, an app device by its bare identity. A bad name fails in 1 second.
Ring one agent on a Sautikit inbound call: dial a SIP credential as client:<username>, an app device by its bare identity. A bad name fails in 1 second.
To ring an agent on an inbound call, your voice callback returns a dial to an
endpoint that is set up on Sautikit: a SIP credential, an enrolled app device or
an internal extension. The clientName you set when you mint a
browser SDK token is a label for that connection, not
an address you can dial. A dial to any other name fails in about 1 second.
Dialling a name that is not one of those endpoints does not ring. The dial
fails and the call is recorded as missed, with Dialing and
Missed in the same second and no ring time.
The two kinds of endpoint take different forms in the same dial
attribute:
| Endpoint | Dial it as | Example |
|---|---|---|
| SIP credential (a registered softphone or desk phone) | client:<username> | client:agent-1001 |
| Enrolled app device | the device's bare identity, with no client: prefix | dev-… |
| Internal extension | the four-digit extension | 1001 |
Do not build a SIP URI for any of these (sip:… or user/..@realm is
rejected), and do not add client: to a device identity: a prefixed device
identity fails without ringing.
The simplest route is the extension. Every registered device gets a four-digit internal extension, and Sautikit rings every device on it, waking app devices that are asleep. Set the number's forward target to the agent's extension and you do not have to build a dial string at all.
List the SIP credentials on the number. Each one has a username and, when
one is assigned, an extension:
curl -s "https://api.sautikit.com/v1/numbers/$NUMBER_ID/sip-credentials" \
-H "Authorization: Bearer $SAUTIKIT_API_KEY" | jq '.credentials[] | {label, username, extension}'On an inbound call, return a dial to the agent. You can greet the caller
first and record the connected leg as usual. This example rings a SIP
credential.
import { sauti } from "@sautikit/node";
res.json({
actions: [
sauti.say({ text: "Thank you for calling. Connecting you now." }),
sauti.dial({
number: "client:agent-1001",
callerId: "+254720000000",
timeout: 30,
record: "record-from-answer",
}),
],
});{
"actions": [
{ "say": { "text": "Thank you for calling. Connecting you now." } },
{
"dial": {
"number": "client:agent-1001",
"callerId": "+254720000000",
"timeout": 30,
"record": "record-from-answer"
}
}
]
}<Dial callerId="+254720000000" timeout="30" record="record-from-answer"><Number>client:agent-1001</Number></Dial>The caller hears the greeting, then the agent's phone rings. When the agent answers, the two are connected and recording starts.
To ring several agents at once and connect the first to answer, fan out with
numbers and first_answer_wins:
{
"actions": [
{
"dial": {
"numbers": ["client:agent-101", "client:agent-102"],
"callerId": "+254720000000",
"first_answer_wins": true,
"record": "record-from-answer"
}
}
]
}A SIP credential with no registered device fails at once, so list only agents who are online. To ring every device an agent has without checking, dial the extension instead.
Dialing and the answer, not Dialing and Missed in the same
second. An instant miss means the dialled name is not a provisioned endpoint,
or its SIP registration is not live.username (or
the device identity) the API returned, and that the client: prefix is on SIP
credentials only.dial parameters