Scenario Actions
Configure mid-call behavior with time-based and event-driven scenario actions including hold, resume, media updates, deferred track activation, DTMF generation, and IVR testing.
Scenario actions define what happens during a call, beyond the basic dial-hold-hangup lifecycle. They let you simulate real-world mid-call operations like putting calls on hold, resuming, activating deferred media tracks, and changing media parameters -- all triggered by time or by events from the remote endpoint.
Overview
Each group can have up to 30 scenario actions. Actions are displayed as When/Then cards in the test creation form:
- When (left, blue): The trigger condition -- when should this action fire?
- Then (right, green): The action to execute -- what should happen?
Actions are connected by vertical lines to show sequence. When multiple time-based actions are defined, they execute in chronological order.
Trigger Types
At Time
The simplest trigger. The action fires at a specific number of seconds after call establishment.
Example: Hold the call at 10 seconds, resume at 20 seconds.
On Event
The action fires when a specific event is received from the remote endpoint. This is reactive -- the endpoint waits for the event and then acts.
Available events:
| Event | Description |
|---|---|
| Hold Received | The remote endpoint put the call on hold (received re-INVITE with a=sendonly or a=inactive) |
| Resume Received | The remote endpoint resumed a previously held call |
| Session Timer Refreshed | A session timer refresh completed successfully (RFC 4028) |
| INFO Received | A SIP INFO message was received from the remote endpoint |
| DTMF Received | A DTMF digit was detected from the remote endpoint (RFC 4733 RTP telephone-event or SIP INFO). Optionally filter on a specific digit (0-9, *, #) or match any digit. |
Event triggers fire once
Each event-triggered action fires at most once during a call. If the same event occurs multiple times (e.g., multiple hold/resume cycles), only the first occurrence triggers the action.
On Event + Delay
A composite trigger that combines event detection with a time delay. The action fires a specified number of seconds after the event is detected.
Example: 5 seconds after receiving a hold from the remote, negotiate a video track.
Action Types
Hold
Places the call on hold by sending a SIP re-INVITE with the media direction changed.
Parameters:
| Parameter | Options | Description |
|---|---|---|
| Hold Mode | Send Only (a=sendonly) | Stops sending media but continues receiving. The remote hears silence/sees freeze. |
Inactive (a=inactive) | Stops both sending and receiving. Full bidirectional hold. |
What happens technically:
- A re-INVITE is sent with the SDP
a=attribute modified - RTP sending is muted (packets stopped, but GStreamer pipeline continues running internally)
- Hold count and duration metrics are tracked in the call timing table
- The call state machine transitions to the held state
Resume
Resumes a previously held call by sending a SIP re-INVITE restoring the original media direction (a=sendrecv).
No additional parameters. Resume always restores full bidirectional media flow.
State machine enforcement
A Resume action is only valid after a Hold action. The form validates this for time-based actions -- you cannot resume a call that is not on hold. For event-triggered actions, the state machine enforces this at runtime.
Start Sending Track
Activates a deferred track that was negotiated at call start but not sending (configured with "Negotiate at start" enabled and "Start sending at establishment" disabled).
Parameters:
| Parameter | Description |
|---|---|
| Target Track | Select from tracks that have "Start sending at establishment" disabled |
What happens technically:
- A re-INVITE (or UPDATE if supported) changes the track direction from
a=inactivetoa=sendrecv - The media pipeline is rebuilt to include the newly active track
- RTP keepalive for that track stops and real media begins flowing
- The
deferred_tracks_activatedmetric is incremented
See Advanced Track Settings for configuring deferred tracks.
Negotiate Track
Activates a track that was not negotiated at call start (configured with "Negotiate at start" disabled, shown as port 0 in the initial SDP).
Parameters:
| Parameter | Description |
|---|---|
| Target Track | Select from tracks that have "Negotiate at start" disabled |
What happens technically:
- A re-INVITE replaces port 0 with a real allocated port for this track
- The remote endpoint negotiates codecs and ports for the new media line
- The media pipeline is rebuilt to include the newly negotiated track
- Ports are allocated and media begins flowing
SDP m-line ordering
RFC 3264 requires that m-line ordering is preserved across re-INVITEs. When a port-0 track is activated, it keeps its original position in the SDP. This ensures interoperability with strict SDP parsers on SBCs and PBXes.
Update Media
Changes media parameters (codec, bitrate) for an existing active track mid-call.
Parameters:
| Parameter | Description |
|---|---|
| Target Track | Any active track in the group |
What happens technically:
- Prefers SIP UPDATE (RFC 3311) if the remote advertised support, otherwise falls back to re-INVITE
- The SDP is modified with updated codec or bitrate parameters
- The media pipeline is rebuilt with the new parameters
- The
update_media_countmetric is incremented
Send DTMF
Sends a sequence of DTMF digits during the call. Used for IVR navigation, automated menu testing, and tone transmission validation.
Parameters:
| Parameter | Options | Description |
|---|---|---|
| Digits | 0-9, *, # (up to 20 characters) | The digit sequence to transmit. Each character generates one DTMF event. |
| Method | RFC 4733 / RTP (recommended) | Sends digits as RFC 4733 telephone-event RTP packets (PT 101). Most widely supported. |
| SIP INFO (dtmf-relay) | Sends each digit as a SIP INFO request with application/dtmf-relay body. Used when RTP telephone-event is not available. | |
| Both | Sends via RFC 4733 RTP and SIP INFO simultaneously. | |
| Duration | 50-1000 ms (default 100) | How long each digit is held before moving to the next. |
What happens technically:
- For RFC 4733: A GStreamer
rtpdtmfsrcelement generates telephone-event RTP packets with the correct event code, duration, and end-bit. Packets are merged with the audio RTP stream via a funnel element. - For SIP INFO: A SIP INFO request is sent with
Content-Type: application/dtmf-relayand bodySignal=X\r\nDuration=Y. - Each digit in the sequence is sent with the configured inter-digit interval.
- The
dtmf_digits_sentmetric is incremented for each digit transmitted.
DTMF is refused during hold
DTMF actions are blocked when the call is in a held state (local hold, remote hold, or both). Resume the call before sending DTMF digits.
Conflict Handling (Glare)
When both endpoints try to modify the session simultaneously (e.g., both send re-INVITEs at the same time), a glare condition occurs. The remote responds with 491 Request Pending.
CallMeter handles this automatically:
- The initiating side retries after a random backoff (0-2 seconds for the caller, 2.1-4 seconds for the callee)
- Up to 3 retries are attempted
- If all retries fail, the action is marked as failed and the
scenario_actions_failedmetric is incremented
Practical Scenarios
Basic Hold/Resume Cycle
Test your PBX's hold music and call recovery:
| # | When | Then |
|---|---|---|
| 1 | At 10 seconds | Hold (sendonly) |
| 2 | At 30 seconds | Resume |
Reactive Hold Response
When the remote puts you on hold, automatically resume after 5 seconds (tests hold-resume interoperability):
| # | When | Then |
|---|---|---|
| 1 | On Hold Received + 5s delay | Resume |
Video Escalation
Start with audio only, activate video mid-call:
- Configure Video Track 2 with "Start sending at establishment" disabled
- Add scenario action:
| # | When | Then |
|---|---|---|
| 1 | At 15 seconds | Start Sending Track (Video Track 2) |
Content Sharing on Hold
Simulate a conferencing system that starts content sharing when put on hold:
- Configure Video Track 2 with "Negotiate at start" disabled
- Add scenario action:
| # | When | Then |
|---|---|---|
| 1 | On Hold Received | Negotiate Track (Video Track 2) |
Metrics
Scenario actions contribute to several call timing metrics:
| Metric | Description |
|---|---|
scenario_actions_executed | Total scenario actions that completed successfully |
scenario_actions_failed | Total scenario actions that failed (timeout, glare exhaustion, etc.) |
hold_count | Number of hold events during the call |
total_hold_duration_ms | Total time spent on hold in milliseconds |
deferred_tracks_activated | Number of deferred tracks activated mid-call |
update_media_count | Number of UPDATE_MEDIA actions executed |
session_timer_refreshes | Number of session timer refreshes completed |
dtmf_digits_sent | Cumulative DTMF digits transmitted during the call |
dtmf_digits_received | Cumulative DTMF digits detected during the call |
dtmf_method | DTMF transport method used: rtp, info, or both |
These metrics appear in the call timing section of the test results and can be used to verify that your SIP infrastructure handles mid-call operations correctly under load.
IVR Menu Navigation
Test an automated phone menu by sending DTMF digits at timed intervals:
| # | When | Then |
|---|---|---|
| 1 | At 5 seconds | Send DTMF: digits 1, method RFC 4733 RTP, duration 100ms |
| 2 | At 12 seconds | Send DTMF: digits 3, method RFC 4733 RTP, duration 100ms |
Reactive IVR Chain
React to incoming DTMF tones and respond with digits (simulates two endpoints navigating each other's IVR):
| # | When | Then |
|---|---|---|
| 1 | On DTMF Received (digit: 1) | Send DTMF: digits 5, method RFC 4733 RTP, duration 100ms |
| 2 | On DTMF Received (digit: any) + 2s delay | Send DTMF: digits 0, method RFC 4733 RTP, duration 100ms |
DTMF Reliability Under Load
Send a full keypad sequence to verify DTMF reliability under SIP stress:
| # | When | Then |
|---|---|---|
| 1 | At 3 seconds | Send DTMF: digits 1234567890*#, method Both, duration 80ms |
Limits
- Maximum 30 scenario actions per group
- Time-based trigger times must be less than the call duration
- Hold/Resume state machine is enforced: no double-hold, no resume without prior hold
- Track-targeting actions must reference valid tracks with the correct deferred settings
- Each event-triggered action fires at most once per call
Next Steps
- Advanced Track Settings -- DSCP marking and deferred negotiation
- Creating a Test -- Full test creation walkthrough
- Groups -- Multi-group test configuration
Advanced Track Settings
Configure DSCP/QoS marking for traffic prioritization and deferred track negotiation for mid-call media activation on a per-track basis.
Running a Test
Execute a SIP load test, monitor real-time progress, understand run statuses, stop tests early, and manage concurrent test limits.