Voice
Voice in the .NET SDK.
VoiceResource
classclass Inverge.Nexus.Resources.VoiceResourceNexus 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
fieldstatic string[] DirectionsValid call directions.
EndpointTypes
fieldstatic string[] EndpointTypesValid endpoint types.
PresenceStatuses
fieldstatic string[] PresenceStatusesValid presence statuses.
RecordingModes
fieldstatic string[] RecordingModesValid recording modes.
Roles
fieldstatic string[] RolesValid leg roles.
AddLegAsync()
methodTask<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()
methodTask<IvrResult> AdvanceIvrAsync(string sessionId, CancellationToken cancellationToken = default)Advances an IVR flow — after a prompt finished playing, say.
Parameters
Prop
Type
Returns Task<IvrResult>
AnswerAsync()
methodTask<NexusAck> AnswerAsync(string legId, CancellationToken cancellationToken = default)Marks a leg answered.
Parameters
Prop
Type
Returns Task<NexusAck>
CreateCallAsync()
methodTask<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()
methodTask<NexusAck> HangupAsync(string legId, string reason = "hangup", CancellationToken cancellationToken = default)Ends a leg.
Parameters
Prop
Type
Returns Task<NexusAck>
HoldAsync()
methodTask<NexusAck> HoldAsync(string legId, CancellationToken cancellationToken = default)Puts a leg on hold.
Parameters
Prop
Type
Returns Task<NexusAck>
MuteAsync()
methodTask<NexusAck> MuteAsync(string legId, bool muted = true, CancellationToken cancellationToken = default)Mutes or unmutes a conference participant.
Parameters
Prop
Type
Returns Task<NexusAck>
PresenceAsync()
methodTask<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()
methodstring 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()
methodTask<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()
methodTask<NexusAck> RemoveParticipantAsync(string sessionId, string legId, CancellationToken cancellationToken = default)Removes a participant from a conference.
Parameters
Prop
Type
Returns Task<NexusAck>
ReportQualityAsync()
methodTask<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()
methodTask<NexusAck> ResumeAsync(string legId, CancellationToken cancellationToken = default)Takes a leg off hold.
Parameters
Prop
Type
Returns Task<NexusAck>
RingAsync()
methodTask<NexusAck> RingAsync(string legId, CancellationToken cancellationToken = default)Starts ringing a leg.
Parameters
Prop
Type
Returns Task<NexusAck>
SendDigitAsync()
methodTask<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()
methodTask<IvrResult> SendIvrInputAsync(string sessionId, string digit, CancellationToken cancellationToken = default)Feeds a menu keypress into an IVR flow.
Parameters
Prop
Type
Returns Task<IvrResult>
StartIvrAsync()
methodTask<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()
methodTask<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()
methodTask<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()
methodTask<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()
methodTask<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>
