InvergeDocs
.NETAPI reference

Voice

Voice in the .NET SDK.

VoiceResource

class
class Inverge.Nexus.Resources.VoiceResource

Nexus Voice (CPaaS) — the call 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. A webrtc leg comes back with a join bundle for the device to connect with; pstn and sip legs are dialled by the media plane.

The tenant is always the environment behind your API key — never passed in a body — and grants, rooms and caller ID are all decided server-side.

Directions

field
static string[] Directions

Valid call directions.

EndpointTypes

field
static string[] EndpointTypes

Valid endpoint types.

PresenceStatuses

field
static string[] PresenceStatuses

Valid presence statuses.

RecordingModes

field
static string[] RecordingModes

Valid recording modes.

Roles

field
static string[] Roles

Valid leg roles.

AddLegAsync()

method
Task<VoiceLegResult> AddLegAsync(string sessionId, string role, string endpointType, string? direction = null, string? address = null, string? callerId = null, string? identityId = null, CancellationToken cancellationToken = default)

Adds a participant leg to a session.

Read VoiceLegResult before using this: the endpoint reports a blocked call, a missing carrier and an unreachable media plane inside a successful response, so a 2xx does not mean the leg is live. Check IsSuccess or call EnsureSuccess.

Parameters

Prop

Type

Returns Task<VoiceLegResult>

AdvanceIvrAsync()

method
Task<IvrResult> AdvanceIvrAsync(string sessionId, CancellationToken cancellationToken = default)

Advances an IVR flow — after a prompt finished playing, say.

Parameters

Prop

Type

Returns Task<IvrResult>

AnswerAsync()

method
Task<NexusAck> AnswerAsync(string legId, CancellationToken cancellationToken = default)

Marks a leg answered.

Parameters

Prop

Type

Returns Task<NexusAck>

CreateCallAsync()

method
Task<VoiceCallResult> CreateCallAsync(string? direction = null, string? applicationId = null, string? proxyIdentityId = null, string? recordingMode = null, object? metadata = null, CancellationToken cancellationToken = default)

Creates a call session.

Parameters

Prop

Type

Returns Task<VoiceCallResult>

HangupAsync()

method
Task<NexusAck> HangupAsync(string legId, string reason = "hangup", CancellationToken cancellationToken = default)

Ends a leg.

Parameters

Prop

Type

Returns Task<NexusAck>

HoldAsync()

method
Task<NexusAck> HoldAsync(string legId, CancellationToken cancellationToken = default)

Puts a leg on hold.

Parameters

Prop

Type

Returns Task<NexusAck>

MuteAsync()

method
Task<NexusAck> MuteAsync(string legId, bool muted = true, CancellationToken cancellationToken = default)

Mutes or unmutes a conference participant.

Parameters

Prop

Type

Returns Task<NexusAck>

PresenceAsync()

method
Task<VoicePresenceResult> PresenceAsync(string identityId, string deviceId, string status, CancellationToken cancellationToken = default)

Heartbeats a device's presence, and reads back the identity's rolled-up status.

Parameters

Prop

Type

Returns Task<VoicePresenceResult>

RecordingDownloadUrl()

method
string RecordingDownloadUrl(string accessToken, bool inline = false)

Builds the fetchable URL for a recording access token.

Recordings have no permanent URL on purpose. The console mints a short-lived token bound to one recording and its expiry; this turns that token into a link. Treat the result as a secret with a short life — do not store it, and do not put it anywhere a log will keep it.

Parameters

Prop

Type

Returns string

RegisterDeviceAsync()

method
Task<NexusAck> RegisterDeviceAsync(string identityId, string deviceId, string platform, string? voipToken = null, string? fcmToken = null, CancellationToken cancellationToken = default)

Registers a device so incoming calls can ring it.

Parameters

Prop

Type

Returns Task<NexusAck>

RemoveParticipantAsync()

method
Task<NexusAck> RemoveParticipantAsync(string sessionId, string legId, CancellationToken cancellationToken = default)

Removes a participant from a conference.

Parameters

Prop

Type

Returns Task<NexusAck>

ReportQualityAsync()

method
Task<NexusAck> ReportQualityAsync(string sessionId, string? legId = null, int? rttMs = null, int? jitterMs = null, double? packetLoss = null, int? bitrateKbps = null, double? mos = null, string? codec = null, string? candidateType = null, CancellationToken cancellationToken = default)

Reports per-leg media quality, which feeds the console's voice analytics.

Parameters

Prop

Type

Returns Task<NexusAck>

ResumeAsync()

method
Task<NexusAck> ResumeAsync(string legId, CancellationToken cancellationToken = default)

Takes a leg off hold.

Parameters

Prop

Type

Returns Task<NexusAck>

RingAsync()

method
Task<NexusAck> RingAsync(string legId, CancellationToken cancellationToken = default)

Starts ringing a leg.

Parameters

Prop

Type

Returns Task<NexusAck>

SendDigitAsync()

method
Task<VoiceDtmfResult> SendDigitAsync(string sessionId, string legId, string digit, int? durationMs = null, CancellationToken cancellationToken = default)

Sends a DTMF digit.

When the session is inside an IVR, the result's Ivr carries the next instruction — there is no need to poll the IVR separately after a keypress.

Parameters

Prop

Type

Returns Task<VoiceDtmfResult>

SendIvrInputAsync()

method
Task<IvrResult> SendIvrInputAsync(string sessionId, string digit, CancellationToken cancellationToken = default)

Feeds a menu keypress into an IVR flow.

Parameters

Prop

Type

Returns Task<IvrResult>

StartIvrAsync()

method
Task<IvrResult> StartIvrAsync(string flowId, string? applicationId = null, CancellationToken cancellationToken = default)

Starts an in-app IVR flow.

The menu phase costs nothing: no call session exists until the flow resolves to a connect, because only then is there a call to bill.

Parameters

Prop

Type

Returns Task<IvrResult>

TransferBlindAsync()

method
Task<NexusAck> TransferBlindAsync(string sessionId, string legId, string targetType, string? targetAddress = null, string? targetIdentityId = null, string? callerId = null, CancellationToken cancellationToken = default)

Hands the call to someone else and drops the transferring leg immediately.

Parameters

Prop

Type

Returns Task<NexusAck>

TransferWarmCancelAsync()

method
Task<NexusAck> TransferWarmCancelAsync(string otherPartyLegId, string consultLegId, CancellationToken cancellationToken = default)

Abandons the consult and returns to the original party.

Parameters

Prop

Type

Returns Task<NexusAck>

TransferWarmCompleteAsync()

method
Task<NexusAck> TransferWarmCompleteAsync(string otherPartyLegId, string legId, CancellationToken cancellationToken = default)

Connects the two parties and drops the agent who initiated the transfer.

Parameters

Prop

Type

Returns Task<NexusAck>

TransferWarmStartAsync()

method
Task<NexusAck> TransferWarmStartAsync(string sessionId, string otherPartyLegId, string targetType, string? targetAddress = null, string? targetIdentityId = null, string? callerId = null, CancellationToken cancellationToken = default)

Starts a consult leg while the other party waits on hold.

Finish with TransferWarmCompleteAsync to connect the two, or TransferWarmCancelAsync to abandon the consult and go back to the original party. Leaving a warm transfer unfinished leaves them on hold.

Parameters

Prop

Type

Returns Task<NexusAck>

On this page