InvergeDocs
PythonAPI reference

Voice

Nexus Voice (CPaaS) control plane.

// access
client.voice

Nexus 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

class

client.voice

Extends Resource.

View source

create_call()

method
def 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]

View source

add_leg()

method
def 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 carries leg plus join: {room, region, access, turn} — hand access and turn to the device SDK.
  • pstn / sip → the media plane dials address; the response carries dialing.

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]

View source

ring()

method
def ring(leg_id) -> Dict[str, Any]

Parameters

Prop

Type

Returns Dict[str, Any]

View source

answer()

method
def answer(leg_id) -> Dict[str, Any]

Parameters

Prop

Type

Returns Dict[str, Any]

View source

hold()

method
def hold(leg_id) -> Dict[str, Any]

Parameters

Prop

Type

Returns Dict[str, Any]

View source

resume()

method
def resume(leg_id) -> Dict[str, Any]

Parameters

Prop

Type

Returns Dict[str, Any]

View source

hangup()

method
def hangup(leg_id, reason='hangup') -> Dict[str, Any]

Parameters

Prop

Type

Returns Dict[str, Any]

View source

dtmf()

method
def 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]

View source

ivr_start()

method
def 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]

View source

ivr_advance()

method
def ivr_advance(session_id) -> Dict[str, Any]

Advance the flow (e.g. after a prompt finished playing).

Parameters

Prop

Type

Returns Dict[str, Any]

View source

ivr_input()

method
def ivr_input(session_id, digit) -> Dict[str, Any]

Feed a menu keypress; returns the next instruction.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

register_device()

method
def 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]

View source

presence()

method
def 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]

View source

report_quality()

method
def 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]

View source

transfer_blind()

method
def 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]

View source

transfer_warm_start()

method
def 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]

View source

transfer_warm_complete()

method
def 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]

View source

transfer_warm_cancel()

method
def 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]

View source

mute()

method
def mute(leg_id, muted=True) -> Dict[str, Any]

Mute or unmute a participant.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

remove()

method
def remove(session_id, leg_id) -> Dict[str, Any]

Remove a participant from the conference.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

recording_download_url()

method
def recording_download_url(access_token, *, inline=False) -> str

Build 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

View source

On this page