AI in Webex
Guide
Implement, register, configure, and verify a partner-hosted Media Forking gRPC endpoint that receives caller and agent audio from Webex Contact Center.
anchorBefore you begin
anchorPrepare a Webex Contact Center organization with a Full Admin who can authorize a Service App and an administrator who can edit, validate, and publish a flow. Implement a publicly reachable gRPC endpoint and secure it with TLS using a currently valid, publicly issued server certificate for the registered hostname. Optionally, add mutual TLS (mTLS) for transport-level client authentication. Require a client certificate and validate its issuer, validity window, and tenant-documented Webex CCAI identity. Do not use mTLS instead of runtime JSON Web Signature (JWS) validation.
Use the Media Forking sample code as a protocol reference, and adapt it to your processing and operational requirements. Its current Java validator retrieves keys before checking the issuer allowlist and tests every returned key; do not reuse that authentication path unchanged.
anchorImplement the gRPC endpoint
anchorWebex Contact Center acts as the gRPC client. Your partner-hosted service acts as the server and implements this bidirectional streaming RPC:
service ConversationAudio {
rpc StreamConversationAudio(stream ConversationAudioForkingRequest)
returns (stream ConversationAudioForkingResponse);
}
For each request:
- Read
conversation_idandcustomer_org_idto associate the message with the correct conversation and customer organization. - Read
audio.audio_data,audio.encoding,audio.sample_rate_hertz, andaudio.audio_timestampinstead of assuming fixed audio properties. - Read
audio.roleandaudio.role_idto identify the media leg. - Use
(conversation_id, role, role_id)as the processing key so that individual media legs remain separate. - Make downstream writes idempotent or deduplicate re-established streams by
conversation_idandrole_id. - Use
ConversationAudioForkingResponse.status_messageanderror_codefor application status and processing errors. Terminate the RPC with an appropriate gRPC status for authentication, transport, or unrecoverable stream failures. - Complete the response stream after Webex completes its request stream and your endpoint finishes processing.
Media Forking sends variable-sized raw mono audio frames, not a WAV container, at 8 kHz or 16 kHz. The protobuf defines LINEAR16, MULAW, and ALAW. The canonical Java sample logs the encoding and can append raw audio bytes to files; it does not decode or transcode them. Decode or transcode the audio as required by your downstream processor. The sample sends one SUCCESS acknowledgment after Webex completes its request stream, so do not expect a response for every audio frame.
The sample's file capture is a development aid. Before storing call audio in production, apply access controls, retention limits, and encryption at rest.
Implement Check on the separate com.cisco.wcc.ccai.v1.Health service defined in the sample's health contract, exposed at /v1/ping under the service endpoint. Return SERVING while the media service is ready to receive streams and NOT_SERVING when it is not ready.
Important: The customer is responsible for keeping the receiving service healthy and able to receive and process streamed data. Webex Contact Center does not maintain back pressure. Keep the gRPC receive callback non-blocking; buffer briefly within fixed bounds or shed load explicitly. If the receiver cannot receive or process the stream, any resulting data loss is permanent and cannot be recovered.
anchorRegister the data source
anchorUse the Data Sources API with the organization-specific Service App access token.
- Register the endpoint for the customer organization.
- Follow the current API request schema. In
schemaId, supply the Media Forking schema selected for the Service App; also supply the endpoint URL, audience, subject, nonce, and a supported token lifetime. - Confirm that the endpoint URL satisfies the Service App's data exchange domain rule.
- Record the returned data source identifier.
- Before the current JWS token expires, update the registered data source with the complete required payload, including its current
statusand a newnonce. The configured token lifetime can be at most 1440 minutes (24 hours).
Use OAuth tokens only to manage the data source through the API. For each media RPC, extract the JWS from the gRPC authorization metadata and validate all of the following:
- The issuer against an allowlist of Webex issuers before retrieving verification keys.
- The
RS256algorithm and RSA signature, using the Cisco public key identified by the JWS header'skidfrom${iss}/oauth2/v2/keys/verificationjwk/. - The expiration time.
- The audience and subject claims against the values registered for the data source, and the presence of the JWT ID.
- The
com.cisco.datasource.urlclaim against the registered endpoint URL. - The
com.cisco.datasource.schema.uuidclaim against the selected Media Forking schema. - For a multi-tenant endpoint, the signed
com.cisco.org.uuidclaim against the request'scustomer_org_id.
Reject a missing or invalid JWS with UNAUTHENTICATED. Keep JWS validation enabled even when you use mTLS.
anchorCreate the Media Forking configuration
anchor- In Control Hub, go to Contact Center > Integrations > Features.
- Create a Media Forking configuration that selects the authorized Service App and registered data source.
anchorConfigure the flow
anchor- Open the target flow in Flow Designer.
- Add the Media Forking activity to the agent-call flow at the point where media streaming should begin.
- Select the Media Forking configuration in the activity.
- Validate the flow.
- Resolve any validation errors.
- Publish the flow.
- Map an entry point to the published flow unless an existing entry point already invokes it.
anchorVerify the integration
anchor- Confirm that the health
CheckRPC reportsSERVINGwhen the receiver is ready andNOT_SERVINGwhen it is not ready. - Confirm that the endpoint rejects an audio RPC that does not contain a valid JWS.
- Place a test call through the configured flow.
- Have an agent answer the call.
- Confirm that the Media Forking activity opens a stream to the registered endpoint.
- Confirm receipt of messages for both
CALLERandAGENTroles. - Verify that the endpoint preserves conversation and role identifiers.
- Verify that the endpoint handles the declared encoding and sample rate.
- End the call and confirm that both sides close the stream cleanly.
- Check server logs for expired tokens, URL or schema claim mismatches, stream failures, and successful completion.