Enabling Applet-Level Call Recording
Enabling Applet-Level Call Recording
Overview
This guide demonstrates how enterprises can dynamically control call recording within their Exotel applet flow using the Passthru Applet (GET request) and Recording API (POST request). This setup enables selective, event-driven recording control — for example, starting the recording before a greeting or IVR prompt and stopping it before agent transfer.
The implementation combines thePassthru Applet andCall Recordings to allow real-time backend-triggered recording.
How It Works
- Use Passthru Applet (GET): The Passthru applet sends call information such as CallSID, From, and To parameters to your backend via a GET request.
- Backend Triggers Recording API (POST): Your backend receives the GET request, extracts the CallSID, and immediately makes a POST call to the Recording API to start recording.
- Continue Call Flow: The call proceeds through the configured applets (Greeting, IVR, Gather, etc.) while recording remains active.
- End-of-Flow Stop Recording: At the final stage, another Passthru applet sends a GET request to your backend endpoint (e.g., /stop_recording), which triggers a POST API call to stop recording.
This ensures Exotel only records the specific portion of the call you need, such as the main interaction, and not hold or transfer periods.
Step-by-Step Implementation
1. Configure the Passthru Applet (Start Recording)
- Add a Passthru Applet at the point in the flow where you want to begin recording.
- Set the Passthru applet’s GET URL to a backend endpoint like https://yourdomain.com/start_recording.
- When executed, Exotel performs a GET request to this endpoint with call details appended as query parameters:
Your backend should capture the CallSid from this GET request quer params
2. Backend: Invoke Start Recording API (POST)
Your backend now calls Exotel’s Recording API using the captured CallSid.
POST
Example:
curl --location 'https://<base_url>/v1/Accounts/<AccountSID>/Calls/<CallSID>/recording.json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'Action=START' \
--data-urlencode 'RecordingChannels=dual' \
--data-urlencode 'RecordingFormat=mp3-hq' \
--data-urlencode 'StatusCallback=<status_callback_url>' \
--data-urlencode 'Leg1Recording=True'Replace <your_api_key> and <your_api_token> with the API key and token created by you.
- Replace <your_sid> with your “Account sid”
- Replace <subdomain> with the region of your account
- <subdomain> of Singapore cluster is @api.exotel.com
- <subdomain> of Mumbai cluster is @api.in.exotel.com
<your_api_key> , <your_api_token> and <your_sid> are available in the API settings page of your Exotel Dashboard
Parameter Reference:
Parameter | Type | Description |
|---|---|---|
Action | String | START or STOP to control recording. |
RecordingChannels | String | Optional — Audio channels. • single (default) – Both legs mixed. • dual – Caller/callee recorded separately. |
RecordingFormat | String | Optional — Audio quality. • mp3 (default) – Standard bitrate. • mp3-hq – High bitrate (32 kbps/channel). Requires enablement via [email protected]. |
StatusCallback | URL | Callback endpoint for recording status. |
Leg1Recording | Boolean | True to record only the first call leg. |
3. Continue with Business Applets
After triggering the start recording API, your flow continues normally with applets such as:
- Greeting Applet: Playback welcome message.
- IVR Applet: Capture user selections.
- Gather Applet: Collect input.
- Connect Applet: Transfer to agent.
Example Flow:
4. Configure Passthru Applet (Stop Recording)
At the end of the flow:
- Add another Passthru Applet configured to call a URL like https://yourdomain.com/stop_recording.
- This GET request from Exotel again includes the CallSid.
- Your backend receives this GET, extracts the CallSid, and invokes:
curl --location 'https://<your_api_key>:<your_api_token><subdomain>/v1/Accounts/<your_sid>/Calls/<CallSID>/recording.json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'Action=STOP'This cleanly terminates recording at the end of the call.
Recording Access
- Dashboard: Under each call log.
- **Call Detail APIs: **https://developer.exotel.com/api/make-a-call-api#call-details
Compliance Notes
- The Passthru applet always sends a GET request to your backend; the enterprise must use POST to trigger or stop recording.
- Obtain customer consent per regional compliance rules.
- mp3-hq is an optional, on-demand feature.
- Recordings are stored securely in Exotel’s environment.
Example Use Case
Scenario: A customer support survey where only the IVR interaction is recorded.
- Passthru applet sends GET to backend → backend triggers Start Recording (POST).
- IVR runs and records customer input.
- Final Passthru sends GET → backend triggers Stop Recording (POST) before agent connection.
This ensures only the main customer interaction is captured.