Orchardcore dnc registry

From CrestApps/CrestApps.AgentSkills · View interactive version

Orchardcore dnc registry is an AI agent skill from the GitHub repository CrestApps/CrestApps.AgentSkills. Skill for configuring national and local do-not-call registry checks in CrestApps Orchard Core, including Azure Blob Storage for uploaded local lists. Covers the DncRegistry, UsaFtc, CanadaDncl and Local features and the DncRegistry.Azure module, global import enforcement, dialer screening that fail

How to use this skill

Skill file

Orchard Core DNC Registry - Prompt Templates

Configure Do-Not-Call Suppression

You are an Orchard Core expert. Generate accurate compliance-focused configuration and code for the CrestApps DNC Registry modules. The module screens canonical phone numbers against national registries and locally uploaded lists. The same registries screen Omnichannel contact imports and Contact Center outbound dialing. The optional Azure module moves uploaded local-list files to Azure Blob Storage.

Guidelines

Feature Overview

| Feature | Feature ID | Admin location |

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

| DNC Registry | CrestApps.OrchardCore.DncRegistry | Settings → Content Import (global enforcement) |

| USA FTC Do Not Call Registry | CrestApps.OrchardCore.DncRegistry.UsaFtc | Settings → DNC Registries → USA FTC Registry |

| Canada LNNTE-DNCL Registry | CrestApps.OrchardCore.DncRegistry.CanadaDncl | Settings → DNC Registries → Canada LNNTE-DNCL Registry |

| Local Do Not Call Registry | CrestApps.OrchardCore.DncRegistry.Local | Interaction Center → Local DNC Registry |

| DNC Registry - Azure Blob Storage | CrestApps.OrchardCore.DncRegistry.Azure (depends on Local) | Configuration only |

All screens require the Manage DNC registry settings permission (DncRegistryPermissions.ManageDncRegistrySettings). Each settings group registers that permission with services.AddSiteSettingsPermission(...), so a role holding only this permission can open the pages. Provider menu items appear only when the provider feature is enabled.

Enable Registries

{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "CrestApps.OrchardCore.DncRegistry",
        "CrestApps.OrchardCore.DncRegistry.Local",
        "CrestApps.OrchardCore.DncRegistry.UsaFtc"
      ],
      "disable": []
    }
  ]
}

Registry Keys and Settings

| Registry | Key | Settings object | Properties |

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

| USA FTC | usa-ftc-dnc | UsaFtcDncRegistrySettings | OrganizationId, BaseUrl (default https://telemarketing.donotcall.gov/api/), ProtectedApiKey |

| Canada LNNTE-DNCL | canada-lnnte-dncl | CanadaDnclRegistrySettings | AccountNumber, BaseUrl (default https://www.lnnte-dncl.gc.ca/api/), ProtectedApiKey |

| Local | local-dnc | none | Lists are managed in the admin |

Global enforcement lives in DncRegistrySettings (EnforceGlobally, EnforcedRegistryKeys). Provision it with the generic settings step:

{
  "steps": [
    {
      "name": "settings",
      "DncRegistrySettings": {
        "EnforceGlobally": true,
        "EnforcedRegistryKeys": [
          "usa-ftc-dnc",
          "local-dnc"
        ]
      },
      "UsaFtcDncRegistrySettings": {
        "OrganizationId": "example-org",
        "BaseUrl": "https://telemarketing.donotcall.gov/api/"
      }
    }
  ]
}

Saved API keys are protected and never redisplayed; entering a new value replaces the key. BaseUrl is required when saving from the admin screen.

Where Screening Happens

Local Do Not Call Registry

The Local feature registers LocalDncRegistry (key local-dnc), ILocalDncListManager, ILocalDncFileStore, LocalDncListIndex, LocalDncEntryIndex, and the Local DNC Import Processor background task.

CSV files hold one phone number per row in a single column. The importer skips blank rows, a header row, duplicates in the file and invalid numbers, rejects multi-column rows, and parses numbers without + using the country chosen at upload. Rejected rows with reasons are downloadable as CSV.

555-123-4567
(555) 234-5678
5559876543

Consent source

The Local feature registers DoNotCallListConsentSource, an IConsentSource named ConsentSourceNames.DoNotCallLists registered with services.AddConsentSource<T>() (the shared consent building block in CrestApps.OrchardCore.Consent.Abstractions). For the Phone channel it reports an E.164 number as opted out when it is on a completed local list, so modules that ask IConsentService honor local lists without referencing this module.

Recipes and deployment

The Local DNC lists deployment step (Do Not Call category) exports every Completed list with its phone numbers (personal data: export only to a site you trust). The LocalDncLists recipe step queues each list for the same background import an upload uses; a list whose name and country already exist is skipped, so a recipe can run twice. Both have CrestApps Recipes JSON schemas.

{
  "steps": [
    {
      "name": "LocalDncLists",
      "Lists": [
        { "Name": "Opted out", "CountryCode": "US", "PhoneNumbers": [ "+12025550101", "+12025550102" ] }
      ]
    }
  ]
}

ILocalDncListManager.GetPhoneNumbersAsync(listId) returns a list's numbers.

Report Builder data source

With Data Pipelines Core (OrchardCore.DataPipelines.Core) and the Local feature enabled, the DNC registry data source (DncRegistry) is readable with ManageDncRegistrySettings:

| Data set | Rows | Main date | Fields |

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

| DncLists | One per local list | CreatedUtc | ListId (identifier), Name, UploadedFileName, CountryCode, PhoneNumberCount, CreatedUtc, Status, TotalRecords, TotalProcessed, ImportedCount, ErrorCount, FailedAttempts, Error, ProcessSaveUtc, CompletedUtc |

| DncEntries | One per imported number | None | EntryId (identifier), ListId (references DncLists.ListId), CountryCode |

The phone numbers themselves are not exposed. Only entries of Completed lists screen numbers, so join DncLists and filter Status to report on numbers in use. The USA FTC and Canada registries store nothing to report on.

DncRegistrySettings and DncRegistryConstants live in CrestApps.OrchardCore.DncRegistry.Abstractions, so modules such as the Omnichannel Management contact import read enforcement settings without referencing the module.

Admin list

The Local DNC Registry page renders through Orchard Core's AdminList shape (list name LocalDncLists, row model LocalDncList, grid columns Name, Status and Actions). Customize rows with LocalDncList_SummaryAdmin placement for the List layout and SummaryAdminGrid placement for the Grid layout, or add columns with an IAdminListColumnsProvider for LocalDncLists. See orchardcore-admin-lists.

Azure Blob Storage Backend

Configure CrestApps:DncRegistry:AzureBlobStorage under OrchardCore in the root appsettings.json (a tenant's own App_Data/Sites/{tenant}/appsettings.json starts at CrestApps):

{
  "OrchardCore": {
    "CrestApps": {
      "DncRegistry": {
        "AzureBlobStorage": {
          "ConnectionString": "",
          "ContainerName": "dnc-registry-{{ ShellSettings.Name }}",
          "BasePath": "",
          "CreateContainer": true,
          "RemoveContainer": false,
          "RemoveFilesFromBasePath": false
        }
      }
    }
  }
}

| Setting | Meaning |

|---|---|

| ConnectionString | Required. Keep it in a secret source. |

| ContainerName | Required. Liquid with ShellSettings; resolved lowercase and must be a valid container name (3 to 63 lowercase letters, digits, single hyphens). |

| BasePath | Optional folder in the container; Liquid supported (for example {{ ShellSettings.Name }} in a shared container). |

| CreateContainer | Create the container on tenant activation. |

| RemoveContainer | Delete the container when the tenant is removed. Do not use on a shared container. |

| RemoveFilesFromBasePath | Delete only BasePath content on tenant removal. Use with a shared container. |

The Azure module registers the store with the shared services.AddTenantFileStore<ILocalDncFileStore>("DncRegistry", "CrestApps:DncRegistry:AzureBlobStorage", ..., removeOnTenantRemoval: true) building block (CrestApps.OrchardCore.FileStorage.Core), which binds TenantStoreBlobStorageOptions<ILocalDncFileStore>, expands the Liquid in the container name and base path, and creates or removes the container with the tenant. The former DncRegistryBlobStorageOptions class and its tenant events are gone; the configuration keys are unchanged. When ConnectionString or ContainerName is missing, the local file store keeps serving files. Azure stores only uploaded source files; the entry indexes stay in the database.

Add a Registry Provider

Reference CrestApps.OrchardCore.DncRegistry.Abstractions and register the provider in its own feature that depends on CrestApps.OrchardCore.DncRegistry:

using CrestApps.OrchardCore.DncRegistry;
using CrestApps.OrchardCore.PhoneNumbers;

namespace MyCompany.OrchardCore.Compliance;

public sealed class MyRegistry : INationalDoNotCallRegistry
{
    private readonly IHttpClientFactory _httpClientFactory;

    public MyRegistry(IHttpClientFactory httpClientFactory)
    {
        _httpClientFactory = httpClientFactory;
    }

    public string Key => "my-registry";

    public string DisplayName => "My Registry";

    public string Description => "Checks numbers against My Registry.";

    public Task<HashSet<PhoneNumber>> GetRegisteredNumbersAsync(
        IEnumerable<PhoneNumber> phoneNumbers,
        CancellationToken cancellationToken = default)
        => GetRegisteredNumbersAsync(phoneNumbers, null, cancellationToken);

    public async Task<HashSet<PhoneNumber>> GetRegisteredNumbersAsync(
        IEnumerable<PhoneNumber> phoneNumbers,
        NumberSearchContext context,
        CancellationToken cancellationToken = default)
    {
        try
        {
            var client = _httpClientFactory.CreateClient(nameof(MyRegistry));

            // Submit the canonical numbers (filter by context?.CountryCode when set) and
            // return only the inputs the registry reports as listed.
            return [];
        }
        catch (HttpRequestException ex)
        {
            // Fail closed: an unreachable registry has not screened anything.
            throw new DoNotCallScreeningException(Key, "My Registry could not be reached.", ex);
        }
    }
}
services.AddHttpClient(nameof(MyRegistry));
services.AddScoped<INationalDoNotCallRegistry, MyRegistry>();

Monitoring

DncRegistryTelemetry publishes the meter and activity source CrestApps.OrchardCore.DncRegistry (matched by CrestApps.OrchardCore.*, see orchardcore-opentelemetry):

| Instrument | Tags | Measures |

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

| crestapps.dnc.screening.duration | registry (usa_ftc, canada_dncl, local), outcome (ok, error, skipped, cancelled, timeout), reason (not_configured, when skipped) | One screening of numbers against one registry |

| crestapps.dnc.screening.size | registry | Numbers one screening asked about |

| crestapps.dnc.screening.listed | registry | Screened numbers reported as listed |

| crestapps.dnc.import.duration | outcome, reason | One local list import run |

| crestapps.dnc.import.rows | result (imported, duplicate, invalid_number, blank, multiple_columns, header) | File rows, counted once their batch is saved |

Spans: crestapps.dnc.screening, crestapps.dnc.import.run, crestapps.deferred.dnc_local_import, crestapps.deferred.dnc_local_delete. A failed import retry counts on crestapps.retry.attempts (area = dnc), and LocalDncImportBackgroundTask on crestapps.background_task.*. Event id 16400 logs an import run ending, under a DncListId log scope. The Contact Center dial path adds crestapps.contactcenter.dialer.dnc.lookup.duration (result listed, clear, error).

Upgrading from 2.x

Troubleshooting

| Symptom | Check |

|---|---|

| Local registry has no hits | The list reached Completed, and inputs normalize to the same E.164 value |

| Upload returns but no entries exist | The background import is pending, paused, or failed; check the list state and errors |

| Local numbers rejected | Choose the correct country at upload |

| Dialer keeps skipping a number with ComplianceScreeningUnavailable | A registry is throwing DoNotCallScreeningException; fix its credentials or connectivity |

| Azure storage ignored | Both ConnectionString and ContainerName are set under OrchardCore:CrestApps:DncRegistry:AzureBlobStorage |

| Invalid container name at tenant start | The tenant name breaks Azure naming rules; use a shared container with BasePath |

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.