viq.twilio.contract 1.3.0
IVR menus keyed by team and hunt group route codes, a Ring hunt group step, text-to-speech voice and accent per step, voicemail status and Salesforce sync fixes, and warm / three-way call transfers with one forward-options API.
No packages depend on viq.twilio.contract.
## v1.3.0 (2026-11-26)
### Added
- ITwilioProvisioningService.ProvisionTenantAsync (+ DiscoverableTwilioProvisioningService): creates a tenant's missing Twilio subaccount (under TwilioConfig:PrimaryAccountSid), softphone TwiML application ("RocketPhone softphone", Voice URL {WebhookPublicBaseUrl}/api/v2.0/Twilio/voice?tenantCode=, no app-level status callback since the voice webhook sets CallProgressEndpoint per dial) and API key, all in US1. Reuses an existing subaccount (rp-{tenantCode}) or application with the same name, so retries are safe. Returns the key secret as ISecretFieldEncryption ciphertext; the caller (viq.uam) stores the result
- Voice SDK Access Tokens (API key + VoiceGrant with OutgoingApplicationSid and IncomingAllow) replace Capability Tokens for tenants with an API key, when TwilioConfig:UseAccessTokens is true or the tenant is in TwilioConfig:AccessTokenTenants. Otherwise, or when the secret cannot be decrypted, the Capability Token is issued as before
- ITwilioProvisioningService.ListTenantNumbersAsync: the numbers in the tenant's Twilio account (read-only) with capabilities and WebhookStatus (RocketPhone, WrongTenant, Legacy, TwimlApp, Other, None) compared with {WebhookPublicBaseUrl}/api/v2.0/Twilio/inbound?tenantCode=. Used by viq.uam number sync
- ITwilioProvisioningService.ConfigureNumberWebhookAsync: sets a tenant number's Voice URL to the inbound webhook (POST, tenantCode in the URL) and clears its TwiML app; the status callback is left as it is. Numbers on a SIP trunk (new WebhookStatus SipTrunk) are refused. Returns the previous Voice URL / app for the audit trail
- ITwilioProvisioningService.TransferNumberAsync: moves a number from one tenant's subaccount to another's with the primary account's credentials (update AccountSid), then points it at the destination tenant's inbound webhook. Both accounts must be active subaccounts of TwilioConfig:PrimaryAccountSid. Refuses SIP-trunk numbers, and numbers needing an address or regulatory bundle the destination does not have. A webhook failure after the move is returned as WebhookWarning
- ICallFlowAdminService.GetTwilioCallLogAsync and GET call-flow/calls/{callSid}/twilio: live call log from the tenant's own Twilio account (call, child legs, errors and warnings, recording metadata without audio, webhook request/response events). CallSid must be CA + 32 hex; another account's call is "not found". Nothing stored
- Tenant Twilio REST calls for these use a per-call TwilioRestClient (not the static TwilioClient.Init)
- Config: TwilioConfig:PrimaryAccountSid, PrimaryAuthToken, UseAccessTokens, AccessTokenTenants; SecretFieldEncryption:Key (same key as viq.uam)
### Removed
- TwilioConfig:OwnerAuthToken (was unused; replaced by PrimaryAccountSid / PrimaryAuthToken)
### Requires
- viq.services.datastore.postgres 7.1.15 (VoipInfo.ApiKeySid / ApiKeySecret)
## v1.2.3 (2026-11-25)
### Added
- Flow version history: ListFlowVersionsAsync and GET call-flow/flows/{flowId}/versions (newest first, with created / published by and names); RestoreFlowVersionAsync and POST call-flow/flows/{flowId}/versions/{versionNumber}/restore copy a version into the draft (not published)
- Turn a flow on or off: SetFlowEnabledAsync, CallFlowEnabledRequest and PUT call-flow/flows/{flowId}/enabled. A disabled flow is not used for calls (they take the no-flow path)
- Where a schedule or media file is used: GetScheduleUsageAsync / GET call-flow/schedules/{scheduleId}/usage (with IsDefault) and GetMediaUsageAsync / GET call-flow/media/{mediaId}/usage, returning the flows, version and step that use it (CallFlowUsageDto)
- Executions list filters From, To (ISO date-times), Status, Page and Limit (default 25, max 100) on the request and query string; the response has Pagination (CallFlowPaginationDto: page, limit, total count). Before, only the last 24 hours were returned
- "Twilio Queue" licence feature (TwilioQueuePolicy), checked like "AI Agent": without it the ENQUEUE_CALL step takes its false branch (outcome NOT_LICENSED). Ring team busy hold is not gated
### Changed
- Saving a flow draft rejects step settings outside their allowed range (timeouts, ring and wait times, retries and similar) with 400 instead of saving them
- Deleting a schedule used by a published flow answers 409 Conflict
- Saving a draft reuses the existing draft version and publish promotes it, so version numbers no longer skip
- A partial-day holiday must have different opening and closing times (HH:mm)
## v1.2.2 (2026-11-23)
### Added
- Delete a call flow: DeleteFlowAsync (gRPC) and DELETE call-flow/flows/{flowId} (controller hosted by viq.apigw). Soft delete of the flow, its assignments and all its versions; executions are kept. Calls to its user, team or number then take the no-flow path. Runtime also ignores a deleted flow found by id
### Changed
- Flow steps come back in the order they were saved (the admin portal's drag-to-reorder list order); publish copies them in that order
## v1.2.1 (2026-11-20)
### Added
- The call flow sets CallLog.RoutingTargetType / RoutingTargetId: User for a Ring user step or a forward to a user, Team for a Ring team, Ring hunt group or forward to a team (a hunt group counts as its team), RPAgent with the agent id for an AI agent step, and the number's owner when there is no published flow. Set when the step starts, so the last target the call reached is kept. Needs viq.calllogcontext.contract 7.0.9 and viq.services.datastore.postgres 7.1.13
### Changed
- AI_AGENT step, "Needs a person": the person's part of the call is now a call log of its own, linked to the agent's by ParentCallId. The agent's call log keeps the conversation and is marked as transferred (QueueTransfer, reason, team); the Twilio CallSid moves to the new call log, so ringing, answer, recording, transcription and the final status of the call belong to the person's call log. If the new call log cannot be created the call carries on as one call log, as before
- The softphone receives AiCallRecordId (the agent's call log) with AiHandoff, AiAgentName and AiSummary
- AI_AGENT licence is now a licence feature, like Call Engagement: the step runs when any licence row of the tenant has the feature "AI Agent" enabled. The product licence code twilio-ai-agent is no longer used. AgentStream:AllowAllTenants defaults to false
- RING_HUNT_GROUP is removed from the admin portal (Ring team covers it). Published flows that still contain the step keep running
- Voicemail email: the Voicemail step's "Notify by email" list is the only recipient list (the admin portal fills it from the flow's user or team when the step is added). With no address no email is sent. A call with no published flow uses the number owner's default: the user's email, or the team's voicemail email list
### Fixed
- After an AI agent handover the person's recording was marked "record only" and never transcribed, and their ringing and answer statuses were dropped because the call already counted as answered by the agent
- Media in TwiML (hold and wait music, the default hold file, flow messages, the legacy tenant CallHoldMusicUri) could be sent unsigned, and Twilio got 400 from the private bucket. Every media URL is now signed through CallFlowMediaStorage. It accepts a storage.googleapis.com URL in any bucket, the storage CDN URL, gs://, or a path inside the configured bucket (e.g. TwilioConfig:DefaultHoldMusic = "callhold/default_hold.mp3"). A URL that still cannot be signed is logged as a warning and raises a PlatformIssue system alert (Error) with the tenant, URL, configured bucket and reason, at most once per URL and tenant every 30 minutes
## v1.2.0 (2026-11-11)
### Added
- GET /api/v2.0/CallFlow/menu-targets (ICallFlowAdminService.ListMenuTargetsAsync): teams with their route codes and their hunt groups (route code, member count) for IVR menu presses
- RING_HUNT_GROUP call-flow step: rings only the members of one team hunt group, with busy hold on the hunt group and its own "No answer or busy" and "Otherwise" branches
- Step config voice (man / woman) and accent (en-GB / en-US) for the step's own text-to-speech; a chosen media file keeps its own voice
- AI_AGENT call-flow step (spike): <Connect action=resume><Stream> to the agent stream hosted by viq.audioingest (AgentStream:StreamUrl), with a single-use HMAC token and a Redis session envelope (markers, hang-up callback); the resume reads the handoff marker AgentHandoff:{executionId} to pick the edge (trueNodeKey = needs a person, nextNodeKey = finished, falseNodeKey = agent unavailable). Skills, knowledge and handover rules from the step config (agent) are compiled into the agent instructions (AgentPromptCompiler) and carried as JSON on the envelope. Recording webhooks skip batch transcription for agent calls. Configuration section AgentStream (Enabled false by default)
- AI_AGENT step config callbackUserId ("Assign callbacks and leads to") and timeZone ("Caller time zone"), carried on the session envelope; the compiled instructions state the current date and time in that zone, ask for date and datetime details as ISO 8601, and tell the model to tag end_call / transfer with the skill's action (lead, case, callback) and name
- VOICEMAIL step config notifyEmails ("Notify by email"): kept per call and sent as metadata voicemailNotifyEmails on the CTI voicemail status and the recording BlobCompletion; CallLogContext adds them to the voicemail email recipients
- Call forward transfer types on POST /api/v2.0/CallCentre/call/forward (TransferType): BLIND (default, unchanged), WARM (caller on hold in the call's <Enqueue> queue, consult call to the target, then <Dial><Queue> hand-over) and THREE_WAY (same consult, then caller, agent and target in one conference)
- POST /api/v2.0/CallCentre/call/forward/complete, /merge and /cancel (ICallCentreService.CompleteForwardAsync, MergeForwardAsync, CancelForwardAsync) to finish, merge or stop a consult
- Twilio webhook POST /api/v2.0/Twilio/transfer/consult-result (ITwilioService.ProcessTransferConsultResultAsync): consult Dial action; reconnects the agent to the caller when the target does not answer or the consult is cancelled
- WARM and THREE_WAY follow the user's licence (User.LicenseType, then the tenant licence row): licence features WarmTransfer and ThreeWayCall, enabled for the user's role; or for everyone with TwilioConfig:TransferTypesForAllTenants. The legacy HotTransfer feature does not unlock WARM
- GET /api/v2.0/CallCentre/call/forward/options: every user with status (AVAILABLE, ON_CALL, BUSY, OFFLINE), every team with member and available counts, and the transfer actions the tenant may use; searchTerm is the only parameter
- TwilioConfig:VoicemailSilenceTimeoutSeconds (default 10): silence timeout of the voicemail <Record>; Twilio's default of 5 seconds cut quiet callers off
### Changed
- Voicemail recording webhook decides voicemail from the recording source (RecordVerb, inbound, not diverted) instead of the current call status, sets status and outcome to voicemail with the recording duration, and publishes a CTI "voicemail" status so CallLogContext re-syncs the call after the no-answer
- Caller-leg "completed" after a recorded voicemail stays completed instead of becoming no-answer (Redis voicemail marker)
- Voicemail step without a chosen file plays the voicemail greeting by owner: user, then team, then organisation
- GET /api/v2.0/CallFlow/media/by-purpose/{purpose} returns only active media; with none active, media is null
- Forward options come from one builder (one Beacon read)
- Call status callback accepts transferLeg=consult (CallStatusCallbackRequest.TransferLeg): when the agent's consult call drops mid-consult, the held caller is sent to the target instead of staying on hold
### Removed
- GET /api/v2.0/CallCentre/call/forward/options/user and /options/team, ICallCentreService.GetCallForwardUserOptionsAsync / GetCallForwardTeamOptionsAsync and their request models (no client used them)
- CallForwardOptionsQueryRequest filter flags (IncludeUnavailableUser, IncludeBusyUsers, IncludeTeams, IncludeBusyTeams, IncludeUnavailableTeams); the list always holds everyone with a status
- Forward user option ExternalNumber and PhotoDetails (never filled)
### Compatibility
- New node type and config fields are optional; existing flows behave as before
- CallLogContext and transcription changes for the voicemail re-sync and no-transcript sync ship with those services
## v1.1.3 (2026-11-10)
### Changed
- Call initiate uses the remote ID from the call event when available
## v1.1.2 (2026-11-09)
### Changed
- Hold and resume publish call-status CTI events for recording pause
.NET 10.0
- Twilio (>= 8.1.0)
- viq.service.base (>= 7.1.2)