Orchardcore omnichannel sms

From CrestApps/CrestApps.AgentSkills · View interactive version

Orchardcore omnichannel sms is an AI agent skill from the GitHub repository CrestApps/CrestApps.AgentSkills. Skill for AI-driven SMS automation in Orchard Core with the CrestApps SMS Omnichannel Automation feature CrestApps.OrchardCore.Omnichannel.Sms. Covers dependencies, automatic SMS activity loads driven by a Chat AI profile, SmsOmnichannelProcessor and SmsOmnichannelEventHandler, the Twilio webhook ap

How to use this skill

Skill file

Orchard Core Omnichannel SMS Automation

Configure AI-Driven SMS

You are an Orchard Core expert. Configure the SMS Omnichannel Automation

feature so an AI chat profile carries SMS conversations for automated

activities, and connect the SMS provider's inbound webhook so customer replies

reach the AI.

Guidelines

enable CrestApps.OrchardCore.Omnichannel.Sms.

CrestApps.OrchardCore.AI.Chat.Core,

CrestApps.OrchardCore.Omnichannel.Managements, OrchardCore.Sms and the

dependency-only Provider Webhook Inbox

(CrestApps.OrchardCore.ContactCenter.ProviderInbox, from the Webhooks

module), which stores every inbound text before the provider is answered.

feature (CrestApps.OrchardCore.BusinessHours, which Contact Center Business

Hours also pulls in) to define the schedules, under **Content > Business

Hours**, that keep background follow-ups within hours (see

orchardcore-business-hours).

orchardcore-ai and orchardcore-ai-connections).

orchardcore-telephony-telnyx) and the tenant default at

Settings > Communication > SMS. Sends go through ISmsProviderRouter, so

an SMS address that pins a provider sends through that provider.

automated SMS, because the opening message is rendered and sent first.

never place tokens in recipes or source.

Enable via Recipe

{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "CrestApps.OrchardCore.Omnichannel.Sms"
      ],
      "disable": []
    }
  ]
}

Add CrestApps.OrchardCore.Omnichannel.Messaging.Sms as well when the AI must

be able to hand SMS conversations to people (see Live Agent Handoff).

Set Up an Automated SMS Campaign

  1. Build the CRM: a contact type with OmnichannelContactPart, a subject type

with OmnichannelSubjectPart, dispositions, a campaign, and subject actions

with When to choose this disposition guidance on each (see

orchardcore-omnichannel-management).

  1. Create a Chat AI profile with Start the conversation automatically. The

Qualify leads by text and Customer care by text starting points ship

with this module (see orchardcore-ai-profile-templates). The opening

message can use Liquid such as {{ Contact.DisplayText }}.

  1. Add the sending number as an omnichannel address with the **Text messages

(SMS)** capability.

  1. Connect the provider webhook (below).
  2. Create an Automatic activity load: subject, campaign, AI profile (or

leave empty to use the subject's), channel SMS, the sending address,

reply delay, optional cadence and Business Hours schedule. Run **Actions >

Load activities**.

AutomatedActivitiesProcessorBackgroundTask (every five minutes) hands each due

automated SMS activity to SmsOmnichannelProcessor, which checks opt-outs,

renders and sends the opening message, and sets the activity to

AwaitingCustomerAnswer.

Inbound Webhooks

| Provider | Endpoint | Validation |

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

| Twilio | POST ~/api/twilio/webhook/sms | X-Twilio-Signature against the Twilio auth token |

| Telnyx | POST ~/api/telnyx/webhook/sms | Ed25519 signature (see orchardcore-telephony-telnyx) |

| Azure Communication Services | via POST ~/api/azure/webhook/eventgrid | Event Grid SAS key or Entra token (see orchardcore-omnichannel-event-grid) |

The Twilio webhook is registered by this feature and by the SMS Messaging

Channel; with both on, it is mapped once. Its full address shows as a read-only

Webhook URL on the Twilio tab of Settings > Communication > SMS; set the

Twilio number's A message comes in to that URL with HTTP POST.

token is missing, and refuses an invalid signature.

in Settings > General so the signature is checked against it.

channel, which SmsOmnichannelEventHandler and the messaging workspace both

consume.

webhook inbox under the sms-inbound handler, keyed on the provider message

id (Twilio's MessageSid), before the provider is answered, then processed as

soon as the response is sent. The Provider Webhook Inbox Dispatch

background task finishes any text a restart interrupted, a redelivery is

recognized on every node, and a text that cannot be stored is answered 503

so the provider resends it.

Conversation Behavior

generates the next reply, which is sent after the reply delay with natural

pacing. A reply delay set on the load is stored on each activity and wins over

the subject's Response delay.

SMS, even when the AI may not update the contact. The subject's Opt-out

keywords** add to the standard STOP, STOPALL, UNSUBSCRIBE, CANCEL, END and

QUIT. After trimming and dropping trailing punctuation, a message opts out

when it is a keyword or starts with one followed by a space or punctuation

("STOP please" opts out, "please stop" does not), the same rule as the

messaging workspace (OmnichannelSmsComplianceHelper.IsOptOutRequest). Opt-outs

are recorded through IConsentService (see

orchardcore-omnichannel-management).

disposition from the subject's wired dispositions, writes the summary to the

activity notes, and runs the subject actions exactly as an agent completion

would. With the CRM feature and AI conversion on the load, a qualified open

lead is converted first (see orchardcore-omnichannel-management).

subject.

Background Tasks

| Task | Schedule | Purpose |

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

| SmsReEngagementBackgroundTask (Automated SMS Re-Engagement) | */5 * * * * | Sends due cadence follow-ups while the load's Business Hours schedule is open in the contact's time zone. |

| SmsOwedReplyRecoveryBackgroundTask (Automated SMS Owed-Reply Recovery) | */10 * * * * | Sends a reply that was owed but lost, for example after a restart, when the contact's last message is recent. |

Live Agent Handoff

Configure Live agent handoff on the subject (handoff queue plus at least one

Escalate when condition). The SMS handoff is carried out by the messaging

workspace, so enable CrestApps.OrchardCore.Omnichannel.Messaging.Sms. The

thread, with its full automated transcript, moves into the queue's inbox. See

orchardcore-omnichannel-messaging.

Let the AI Answer Incoming Texts

With the SMS Messaging Channel also enabled, EntryPointAIAgentStartup adds an

AI agent routing choice to text entry points (SmsEntryPointAIConversationStarter).

Set Route to to AI agent on the number's Text messages entry point

and pick a Chat profile. Texts go to people instead when the entry point is

closed, a person already holds an open conversation with the customer, the

customer's last AI conversation ended less than an hour ago, or the profile was

deleted. Entry points are covered by orchardcore-contact-center.

Extend

does not cover; filter by event type and channel (see orchardcore-omnichannel).

(see orchardcore-sms) and pin it on the SMS address.

Monitoring

AI SMS conversations report on the messaging meter CrestApps.OrchardCore.Messaging (see orchardcore-omnichannel-messaging, matched by CrestApps.OrchardCore.*): crestapps.messaging.ai.turn.duration (result: replied, no_reply, not_owed, superseded, lock_timeout, completion_failed, empty_reply, send_failed, error, cancelled), crestapps.messaging.ai.handoff, crestapps.messaging.ai.respond_decision (respond, skip, fallback), crestapps.messaging.activity.start (trigger entry_point or automated) and crestapps.messaging.send.duration for every automated text. The span crestapps.messaging.ai.turn parents the AI completion and send spans, and the conclusion check after a turn runs as the deferred task sms_conversation_conclusion. SmsReEngagementBackgroundTask reports items by result (sent, send_failed, no_content, opted_out, outside_hours, busy, error; budget_exceeded when it stops on its budget) and SmsOwedReplyRecoveryBackgroundTask reports redriven or error on crestapps.background_task.items. Log event ids 18200-18299 (18201 owed-reply recovery summary, 18202 AI turn ended).

Upgrading from 2.x

api/twilio/webhook/sms; the Omnichannel/webhook/TwilioEventGrid route is

removed (deliver ACS texts through api/azure/webhook/eventgrid).

part settings, and the per-run campaign, channel and address are chosen on the

activity load (see orchardcore-omnichannel-management).

Center Business Hours**; turn the Business Hours feature on explicitly when loads or

cadences pick a Business Hours schedule.

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.