Set calls and SMS number routing
set_voice_sms_number_routingSet where incoming calls to an active calls and SMS number go. mode agent (with agentId): an agent that runs on volai's own voice engine answers. An agent can be attached only to an active number (a number that is awaiting_registration, rejected or being released returns invalid_transition) and only an agent on the volai engine (otherwise unsupported_for_number_type); if the agent has a transfer number, it must be a number this line may call (+420 for a Prague number, otherwise see capabilities.outboundTo of the number), or destination_not_allowed is returned and nothing is changed. mode none: calls are not answered (this disconnects the agent and works in any status of the number). mode forward (forwardTo = your phone in international format): the operator forwards the call to your phone and no agent answers. mode sip (sipUri = your SIP server as host or host:port, optional sipUsername and sipPassword together): the call goes to your own PBX. forward and sip are available only when volai has enabled them for your account; otherwise the call fails with unsupported_for_number_type and nothing changes. forward is allowed only to ordinary landline or mobile numbers in the countries the number may call (see capabilities.outboundTo), never to premium lines or to volai numbers (destination_not_allowed or invalid_number); a malformed SIP address returns invalid_sip_uri and a change the operator did not accept returns routing_failed. Forwarded calls are billed per second from the operator's call records: the inbound minute rate plus, for forward, the outbound minute rate to the destination (see the pricing page; when the caller's number is outside the EEA, the outbound minute to a Czech phone can cost up to the separate higher rate of a call from a number outside the EEA to Czechia); sip bills only the inbound minute. Setting forward or sip needs a balance of at least the threshold at which a stopped service resumes (resumeAtBalanceHal, the error message states the amount) on an account that is not stopped for credit, otherwise insufficient_credit (top up first); with a monthly spending cap that is reached, forward returns spend_cap_reached and so does sip unless the cap lets inbound calls through (inboundAboveCap); nothing changes. A forwarded number stops ringing your phone or PBX by itself when the balance drops below zero or the cap is reached (sip keeps ringing at the cap when inboundAboveCap is on) and comes back on its own after a top-up or a higher cap. Switching back to agent or none always works. While the number is being processed (an activation, billing or a release) the call returns in_progress: nothing was changed, try again in a minute. Calls from the number are placed with make_call and agentId, SMS with send_sms and fromNumber. Same data as PATCH /v1/voice-sms-numbers/{e164} (response schema in /openapi.json).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"e164": "<e164>",
"mode": "<mode>"
},
"name": "set_voice_sms_number_routing"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| e164 | Yes | Calls and SMS number to configure, in E.164 format with the country code, for example +420292000001. Must belong to this account, from list_voice_sms_numbers. | |
| mode | Yes | Where calls to this number go: agent (needs agentId), none (not answered, agent disconnected), forward (needs forwardTo) or sip (needs sipUri). forward and sip may be off for the account. | |
| sipUri | No | Your SIP server as host or host:port, required when mode is sip. The call goes to your own PBX and no agent answers. | |
| agentId | No | Id of the agent that should answer calls to this number, from list_agents. Required when mode is agent, ignored otherwise. | |
| forwardTo | No | Your phone in international format (+ or 00 prefix), required when mode is forward. Ordinary landline or mobile numbers only, never a premium line or a volai number. | |
| sipPassword | No | Digest password of your SIP server, for mode sip. Send it with sipUsername. Omitted, or empty with the unchanged sipUsername, it keeps the stored password if the sipUri host and port stay the same, else invalid_sip_uri. Both fields empty remove the login. Never returned. | |
| sipUsername | No | Digest username of your SIP server, for mode sip. Send it together with sipPassword. Omitting both on the same server keeps the saved login; an empty sipUsername together with an empty sipPassword removes it. |