Orchardcore omnichannel voice

From CrestApps/CrestApps.AgentSkills · View interactive version

Orchardcore omnichannel voice is an AI agent skill from the GitHub repository CrestApps/CrestApps.AgentSkills. Skill for the CrestApps Automated Voice module in Orchard Core, the provider-neutral AI voice conversation loop for automated phone activities and AI voice entry points. Covers the CrestApps.OrchardCore.Omnichannel.Voice feature, pairing it with Telnyx AI Voice Agent, automatic Phone loads, the voic

How to use this skill

Skill file

Orchard Core Automated Voice

Run AI Voice Conversations

You are an Orchard Core expert. Configure the Automated Voice feature so an AI

chat profile holds phone conversations for automated activities and AI voice

entry points, over whichever telephony provider carries the call.

Guidelines

Enable CrestApps.OrchardCore.Omnichannel.Voice (Automated Voice). It

depends on CrestApps.OrchardCore.Telephony, CrestApps.OrchardCore.AI,

CrestApps.OrchardCore.AI.Chat.Core and

CrestApps.OrchardCore.Omnichannel.Managements.

the audio and the Phone channel processor. Today that is **Telnyx AI Voice

Agent** (CrestApps.OrchardCore.Telnyx.AiVoice), which depends on this

feature and is covered by orchardcore-telephony-telnyx. Asterisk cannot

place or answer AI calls. An AI call is an automated activity, not a dialer

mode, and uses no dialer profile.

(CrestApps.OrchardCore.ContactCenter.Voice.Media) and a realtime deployment

(the profile's Conversation deployment, see orchardcore-ai-chat).

Without it, the turn-based loop speaks with text-to-speech and listens with

transcription.

window before dialing; the calling window needs the Contact Center Outbound

Dialer (orchardcore-contact-center, orchardcore-dnc-registry).

Enable via Recipe

{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "CrestApps.OrchardCore.Telnyx.AiVoice"
      ],
      "disable": []
    }
  ]
}

Enabling the provider feature enables Automated Voice and its dependencies.

Outbound AI Calls

  1. Build the CRM: contact type, subject with OmnichannelSubjectPart,

dispositions, subject actions with When to choose this disposition, and a

campaign (see orchardcore-omnichannel-management).

  1. Create a Chat profile with Start the conversation automatically; its

opening message is the call greeting. The Phone calls starting points

(Answer calls at the front desk, Qualify leads by phone, **Confirm

appointments by phone**) ship with this module (see

orchardcore-ai-profile-templates).

  1. Add the caller number as an omnichannel address with Voice calls.
  2. Create an Automatic load with channel Phone, the address, the AI

profile, reply delay and optionally **Play background office sound on

calls** (realtime profiles only).

  1. AutomatedActivitiesProcessorBackgroundTask dispatches due activities to the

provider's Phone processor, which dials and starts the loop.

Voice settings (AutomatedVoiceActivitySettings: profile, speech-to-text and

text-to-speech deployments, voice, ambience, AI update permissions, reply delay,

Business Hours schedule, cadence) are resolved by

IAutomatedVoiceActivitySettingsResolver from the activity, then the subject's

flow settings, then the default AI deployment site settings. In the admin, the

profile, update permissions and reply delay come from the load (an outbound

subject cannot hold a profile, so an outbound load must name one); the

speech-to-text and text-to-speech deployments and the voice are settings of an

inbound Phone subject only. When no voice is picked, the AI persona's voice

is used (when it was chosen on the speaking provider's deployment) before the

site default. An outbound subject shows only the Live agent handoff card.

Before each call the processor cancels the activity when the number is known

not in service or the contact opted out, then runs the do-not-call lists (with

the Outbound Dialer) and a calling window only when turned on for automated

calls; the refusing reason is written to the notes. A workflow's **Place Call

or Send Message** task skips these checks.

Inbound AI Calls

Set Route to to AI voice agent on a Voice calls inbound entry point

and pick a Chat profile (orchardcore-contact-center). Optionally add an

inbound Phone subject whose address is that number to supply dispositions

and the handoff rules. A silent inbound caller is never treated as voicemail.

Call Behavior

still there, twice, then says goodbye and hangs up. On a call the platform

placed, silence from a person who never spoke is treated as a voicemail.

DiscloseOnAIVoiceCalls (Have automated voice agents say it first) makes

the AI say the recording disclosure before anything else.

a phone menu or enter an extension, hears keys the caller presses, and with

Secure Data Capture can take a card or account number through

collectSecureDigits.

detection, or recognized from the greeting), the AI waits for the tone,

leaves one short message and hangs up; the activity takes the disposition with

the Answering machine outcome.

and transferToLiveAgent are registered hidden: a session gets a hidden

tool only when it names it (AICompletionContext.ToolNames, plus

OrchestrationContext.MustIncludeTools), so ordinary AI

chats never see them and a call is offered the transfer only while someone

can take it.

transferToLiveAgent to transfer to the handoff queue; the

voice-handoff-summary prompt briefs the agent, and the briefing is saved on

a fresh read of the activity so concurrent routing writes cannot drop it. A

transferred call is not concluded by the AI. Before the conversation starts

the loop asks IOmnichannelHandoffAvailability what a handoff would do: a

closed queue that books a callback keeps the transfer and the model says

someone will call back; one that books nothing removes the transfer and the

model offers to take a message. The platform's fixed handoff lines are spoken

only on English calls; otherwise the caller hears only the model.

up to two times, then handed off if allowed, otherwise an apology ends the

call. The activity takes the Try Again disposition and terminal reason

ai_session_lost. An unexpected error before the session has sent anything

else (a refused set-up, such as a voice the provider lacks) counts as lost.

language and holds the model to it (RealtimeOrchestrationRequest.SpeechLanguage).

The conclusion and handoff prompts take a Language variable, so the summary

and briefing are written in the persona's language.

picks a disposition only from the subject's wired dispositions, based on what

the customer said. A call nobody spoke on gets the No answer outcome; an

undecided call gets the Try Again disposition, then Disconnected.

DispositionedBy is AIAgent. A New Activity action still runs when the

caller matched no contact, and the follow-up takes the call summary as its

instructions.

AIInvocationScope.Current.Items under the VoiceCallInvocationItems keys

(ActivityId, CustomerNumber, ChannelEndpointId, ContactContentItemId,

ContactContentType, each prefixed Omnichannel.Voice.).

over for an agent, transfers it to a number, switches its AI profile, or ends

it; the Contact Center Live dashboard and the api/ai/v1/live-calls API use

it. A live session runs on the node that answered it; with OrchardCore.Redis

enabled, IAIVoiceCallCommandRelay carries commands to that node.

resolved speech-to-speech deployment does not list.

(AIVoiceCallShutdown).

Automated Voice Call Recovery**, */5 * * * *) concludes calls whose hangup

the provider never reported.

silence, barge-ins, outcome).

Add Automated Voice to a Telephony Provider

A provider integrates in three pieces, all in its own feature that depends on

CrestApps.OrchardCore.Omnichannel.Voice:

  1. Implement IVoiceAgentMediaProvider (namespace

CrestApps.OrchardCore.Telephony.Services): TechnicalName,

DefaultVoice, SpeakAsync, StartTranscriptionAsync,

StopTranscriptionAsync, GatherAsync and HangupAsync. Register it scoped;

IVoiceAgentMediaProviderResolver finds it by technical name.

  1. Register an IOmnichannelProcessor whose Channel is Phone that dials the

contact for an automated activity (see orchardcore-omnichannel).

  1. Translate the provider's call webhooks into VoiceAgentEvent

(Kind: Answered, SpeechStarted, SpeechEnded, Transcription,

AnswererDetected, MachineGreetingEnded, Hangup; plus ProviderCallId,

ProviderName, ActivityId, TranscriptionText, TranscriptionIsFinal,

Answerer, HangupCause) and pass them to

IVoiceAgentConversationLoop.HandleAsync.

using CrestApps.OrchardCore.Telephony.Services;

namespace MyCompany.OrchardCore.Telephony.Acme;

public sealed class AcmeVoiceAgentMediaProvider : IVoiceAgentMediaProvider
{
    public string TechnicalName => "Acme";

    public string DefaultVoice => "acme-neural-1";

    public Task<bool> SpeakAsync(string providerCallId, string text, string voice = null, string language = null, CancellationToken cancellationToken = default)
        => Task.FromResult(true); // Call the provider's text-to-speech command.

    public Task<bool> StartTranscriptionAsync(string providerCallId, string language = null, string commandId = null, CancellationToken cancellationToken = default)
        => Task.FromResult(true);

    public Task<bool> StopTranscriptionAsync(string providerCallId, CancellationToken cancellationToken = default)
        => Task.FromResult(true);

    public Task<bool> GatherAsync(string providerCallId, string text, string validDigits, CancellationToken cancellationToken = default)
        => Task.FromResult(true);

    public Task<bool> HangupAsync(string providerCallId, CancellationToken cancellationToken = default)
        => Task.FromResult(true);
}
services.AddScoped<IVoiceAgentMediaProvider, AcmeVoiceAgentMediaProvider>();

Use the Telnyx provider (TelnyxVoiceAgentMediaProvider,

TelnyxAiVoiceConversationHandler, VoiceOmnichannelProcessor) as the

reference. For bidirectional audio and realtime sessions, the provider must

also integrate with Contact Center Voice Media.

Monitoring

VoiceTelemetry publishes the meter and activity source CrestApps.OrchardCore.Voice (matched by CrestApps.OrchardCore.*, see orchardcore-opentelemetry). Calls are counted once, where the call's usage summary is written:

| Instrument | Tags | Measures |

|---|---|---|

| crestapps.voice.ai.sessions | engine (realtime, turn_based), outcome (completed_by_ai, handed_to_agent, voicemail, no_answer, caller_hung_up, failed, transferred, unknown), deployment, provider | Automated calls summarized |

| crestapps.voice.ai.response.latency, .model.latency, .first_audio.latency, .detector.wait | engine, deployment | Per-answer latencies |

| crestapps.voice.ai.session.reconnects, .session.errors, .session.summary.lost | outcome, kind, reason | Live session health |

| crestapps.voice.ai.voicemail.machine_detected, .idle_prompts, .barge_ins, .guardrail.refusals | source, engine, action, direction | Call-handling decisions |

| crestapps.voice.ai.turn.duration | outcome | Turn-based loop: final transcript to reply audio |

| crestapps.voice.media.streams, crestapps.voice.media.stream.lost | provider | Live media streams |

Spans: crestapps.voice.ai.session (children crestapps.voice.ai.session.setup, .reconnect, .handover and crestapps.voice.ai.voicemail) and crestapps.voice.ai.turn. Transcripts are never logged or tagged; log event ids are 18500-18999. The per-call cost estimate uses the AI deployment's prices plus the carrier's per-minute price from the Costs tab of Settings → Communication → Telephony (TelephonyCostSettings, see orchardcore-telephony).

Upgrading from 2.x

voice feature (Telnyx AI Voice Agent enables it for you). Dialpad is removed.

IOptionsMonitor<TelephonyProviderOptions>; custom code that read them with

IOptions<T> must switch (see orchardcore-telephony).

or chat that needs one must name it in AICompletionContext.ToolNames (and

OrchestrationContext.MustIncludeTools); they are no longer given to every

chat.

variable; override copies of these prompts should accept it.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.