Voice
Nexus Voice (CPaaS) control plane.
// access
client.voiceNexus Voice (CPaaS) control plane.
A call is a session with one or more legs. Create the session, add a leg per participant, then drive it: ring, answer, hold, hangup, DTMF, transfer, conference moderation. WebRTC legs come back with a media join bundle (a scoped token + TURN config) for the client to join with; PSTN/SIP legs are dialled by the media plane.
The tenant is always the environment behind your API key — never passed in the body — and grants, rooms and caller-ID are decided server-side.
Voice
classclient.voice
Extends Resource.
create_call()
methoddef create_call(*, direction=None, application_id=None, proxy_identity_id=None, recording_mode=None, metadata=None) -> Dict[str, Any]Create a call session. Returns {session: {...}}.
direction: inbound | outbound | internal.
recording_mode: disabled | mixed | dual_channel | per_track.
proxy_identity_id routes through a masking identity (number masking).
Parameters
Prop
Type
Returns Dict[str, Any]
add_leg()
methoddef add_leg(session_id, role, endpoint_type, *, direction=None, address=None, caller_id=None, identity_id=None) -> Dict[str, Any]Add a participant leg to a session.
webrtc→ the response carrieslegplusjoin:{room, region, access, turn}— handaccessandturnto the device SDK.pstn/sip→ the media plane dialsaddress; the response carriesdialing.
A response containing error is still HTTP 200 — check for
call_blocked (fraud policy), no_outbound_trunk and
media_unavailable before assuming the leg is live.
Parameters
Prop
Type
Returns Dict[str, Any]
ring()
methoddef ring(leg_id) -> Dict[str, Any]Parameters
Prop
Type
Returns Dict[str, Any]
answer()
methoddef answer(leg_id) -> Dict[str, Any]Parameters
Prop
Type
Returns Dict[str, Any]
hold()
methoddef hold(leg_id) -> Dict[str, Any]Parameters
Prop
Type
Returns Dict[str, Any]
resume()
methoddef resume(leg_id) -> Dict[str, Any]Parameters
Prop
Type
Returns Dict[str, Any]
hangup()
methoddef hangup(leg_id, reason='hangup') -> Dict[str, Any]Parameters
Prop
Type
Returns Dict[str, Any]
dtmf()
methoddef dtmf(session_id, leg_id, digit, *, duration_ms=None) -> Dict[str, Any]Send a DTMF digit. If the session is in an IVR, the response's
ivr key carries the next instruction.
Parameters
Prop
Type
Returns Dict[str, Any]
ivr_start()
methoddef ivr_start(flow_id, *, application_id=None) -> Dict[str, Any]Start an in-app IVR flow. Returns {sessionId, instruction}.
The menu phase is Redis-only — no call session exists until the flow
resolves to a connect instruction.
Parameters
Prop
Type
Returns Dict[str, Any]
ivr_advance()
methoddef ivr_advance(session_id) -> Dict[str, Any]Advance the flow (e.g. after a prompt finished playing).
Parameters
Prop
Type
Returns Dict[str, Any]
ivr_input()
methoddef ivr_input(session_id, digit) -> Dict[str, Any]Feed a menu keypress; returns the next instruction.
Parameters
Prop
Type
Returns Dict[str, Any]
register_device()
methoddef register_device(identity_id, device_id, platform, *, voip_token=None, fcm_token=None) -> Dict[str, Any]Register a device so incoming calls can ring it (ios | android | other).
Parameters
Prop
Type
Returns Dict[str, Any]
presence()
methoddef presence(identity_id, device_id, status) -> Dict[str, Any]Heartbeat a device's presence. Returns the identity's rolled-up status.
Parameters
Prop
Type
Returns Dict[str, Any]
report_quality()
methoddef report_quality(session_id, *, leg_id=None, rtt_ms=None, jitter_ms=None, packet_loss=None, bitrate_kbps=None, mos=None, codec=None, candidate_type=None) -> Dict[str, Any]Report per-leg media quality (feeds the console's voice analytics).
Parameters
Prop
Type
Returns Dict[str, Any]
transfer_blind()
methoddef transfer_blind(session_id, leg_id, target_type, *, target_address=None, target_identity_id=None, caller_id=None) -> Dict[str, Any]Hand the call off and drop leg_id immediately.
Parameters
Prop
Type
Returns Dict[str, Any]
transfer_warm_start()
methoddef transfer_warm_start(session_id, other_party_leg_id, target_type, *, target_address=None, target_identity_id=None, caller_id=None) -> Dict[str, Any]Start a consult leg while the other party waits on hold.
Parameters
Prop
Type
Returns Dict[str, Any]
transfer_warm_complete()
methoddef transfer_warm_complete(other_party_leg_id, leg_id) -> Dict[str, Any]Connect the parties and drop the initiator.
Parameters
Prop
Type
Returns Dict[str, Any]
transfer_warm_cancel()
methoddef transfer_warm_cancel(other_party_leg_id, consult_leg_id) -> Dict[str, Any]Abandon the consult and return to the original party.
Parameters
Prop
Type
Returns Dict[str, Any]
mute()
methoddef mute(leg_id, muted=True) -> Dict[str, Any]Mute or unmute a participant.
Parameters
Prop
Type
Returns Dict[str, Any]
remove()
methoddef remove(session_id, leg_id) -> Dict[str, Any]Remove a participant from the conference.
Parameters
Prop
Type
Returns Dict[str, Any]
recording_download_url()
methoddef recording_download_url(access_token, *, inline=False) -> strBuild the download URL for a recording access token.
There is no permanent URL for a recording: the console mints a short-lived HMAC token bound to the recording id and its expiry, and this turns that token into a fetchable link.
Parameters
Prop
Type
Returns str
