Contact center (CCaaS) implementation
Overview
In building a Contact Center as a Service solution leveraging Telnyx WebRTC, enable SIP connection credentials with Park Outbound Calls and webhook events for enhanced functionality and seamless communication flows.Key features
Webhook events- Monitor SIP connection events in real-time.
- Receive notifications for call events: dialing, answering, bridging, hang-up, voicemail completion.
- Primary/failover URL configuration for reliability.
- Temporarily hold calls until further instructions via Voice API.
- Enable additional processing or decision-making before connecting.
- Provide customizable call handling experiences.
- Utilize Telnyx’s call control capabilities (Voice API documentation).
- Issue commands based on webhook events: answer, play audio, bridge, transfer.
- Handle sophisticated workflows for call routing.
Inbound call flow
- User calls main number, answered with text-to-speech greeting.
- IVR menu presents options to mark call attributes (language, skills, department).
- Call transferred to queue, parked while waiting for agent.
- Auto-transfer to most idle agent or manual cherry-picking.
- Call recording initiated when agent answers.
- Call forwarded to multiple agents simultaneously with recording enabled.
- Additional call control: mute, hold, transcription, text-to-speech announcements.
Frontend implementation
Authentication
Agent desktop applications should have an authentication process implemented. We recommend using authentication tokens generated from individual telephony credentials created for each agent. When an agent logs in, the frontend app requests an authentication token from the backend, which is then used for subsequent API requests in the WebRTC client. When a call is received, you can see which agents are logged in with the on-demand generated credentials. Your call center service would use our Call Control API to dial each of the generated credentials to connect the caller with one of the available agents. Once agents are logged in, make sure your WebRTC client informs your call center backend that the agents are registered. This ensures the backend has a list of agents it can dial each time an inbound call is received to the main number. See more details in the User authentication section in the Backend implementation for the Voice API methods to be used on the backend side.Agent desktop application
Agent desktop application should support the following options: Agent status management: The agent should be able to report their current status, such as Available or Unavailable, so the backend application can see the currently available agents and decide which agent should receive the next call. Here is an example softphone application (WebRTC client) with an option to choose a preferred audio device.


Audio device settings
Get a list of available audio devices:Call control toolbar
Toggle microphone:Backend implementation
The backend application handles call routing, IVR logic, and agent management through Telnyx Voice API webhooks.User authentication
For each user, generate on-demand telephony credentials which should be stored in a database and associated with the user login. Agent desktop application should request an authentication token to be created based on the telephony credentials. Generate on-demand telephony credentials On-Demand Credentials help you onboard new customers or team members under your SIP connection, allowing you to separate each user with their own security credentials. This solution is ideal for integrating WebRTC into your own platforms, enabling your backend system to create outbound calls to each on-demand generated credential. You can use the optional parameterexpires_at if you would like to set an expiration time for the credentials.
Call flow
In the backend application, we can fully control the call flow from the initiation of the call up to the call disconnect event. Based on the webhook notification, we can decide what kind of actions should be applied to the call. To monitor the call and proceed with the call flow, we should monitor call event types received on the webhook URL. Having an integration with the CRM application, we can retrieve caller data, for instance based on the caller number:call.initiated webhook, you should answer the call and provide an initial greeting with IVR options using the speak option:
Next steps
- Review WebRTC authentication options.
- Explore Call Control API documentation.
- Learn more about webhook fundamentals.