Skip to content

Conversation

@dremin
Copy link
Contributor

@dremin dremin commented Nov 11, 2025

Summary

The internal-call feature has historically been built on layers of workarounds, due to TaskRouter being unable to dial anything other than a phone number, client, or SIP address. However, now that conferences support TwiML apps, TaskRouter can now call applications directly. This allows us to greatly simplify internal-call, and remove the risk associated with the workarounds previously used.

The new approach is fairly simple: Dial a TwiML app with parameters specifying the call target, and have the TwiML app enqueue the call to the internal call TR workflow.

There are a few adjacent changes that are contained within this branch as well that are required for everything to work as expected:

  1. Configuration scripts have been updated with support for fetching TwiML app SIDs
  2. The TaskLineOutboundCallHeader system string has been modified to display the internal call target rather than the app SID when the internal_outbound_to task attribute exists
  3. Added a system hook for beforeAcceptTask to allow accepting calls from application SIDs. This applies not only to this feature, but any other feature using an application SID as well.

The TR workflow is also somewhat optimized, as now we use known agent routing.

Checklist

  • Tested changes end to end
  • Updated documentation
  • Requested one or more reviewers

dremin and others added 12 commits November 29, 2022 16:30
# Conflicts:
#	plugin-flex-ts-template-v2/src/feature-library/conference/flex-hooks/components/ParticipantCanvas.tsx
#	plugin-flex-ts-template-v2/src/feature-library/internal-call/README.md
#	plugin-flex-ts-template-v2/src/feature-library/internal-call/flex-hooks/actions/AcceptTask.tsx
#	plugin-flex-ts-template-v2/src/feature-library/internal-call/flex-hooks/actions/HoldCall.tsx
#	plugin-flex-ts-template-v2/src/feature-library/internal-call/flex-hooks/actions/UnholdCall.tsx
#	plugin-flex-ts-template-v2/src/feature-library/internal-call/flex-hooks/components/CallCanvasActions.tsx
#	plugin-flex-ts-template-v2/src/feature-library/internal-call/helpers/InternalCallService.ts
#	plugin-flex-ts-template-v2/src/feature-library/internal-call/helpers/internalCall.ts
#	plugin-flex-ts-template-v2/src/feature-library/internal-call/types/ServiceConfiguration.ts
#	plugin-flex-ts-template-v2/src/flex-hooks/actions/actions.ts
#	plugin-flex-ts-template-v2/src/flex-hooks/components/components.ts
#	plugin-flex-ts-template-v2/src/flex-hooks/events/events.ts
#	scripts/common.js
#	serverless-functions/.env.dev
#	serverless-functions/.env.example
#	serverless-functions/.env.prod
#	serverless-functions/.env.qa
#	serverless-functions/.env.test
#	serverless-functions/src/functions/features/internal-call/common/agent-join-conference.protected.js
#	serverless-functions/src/functions/features/internal-call/common/agent-outbound-join.protected.js
#	serverless-functions/src/functions/features/internal-call/common/call-outbound-join.protected.js
@github-actions
Copy link

0 ESLint error(s) and 0 ESLint warning(s) found in pull request changed files.
✅ No issues found!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants