Skip to content

SIP PBX Media Actions

Andrey Egorov edited this page May 18, 2026 · 4 revisions

Overview

The Media resource controls playback, tones, recording, media waiting, and DTMF sending.

Operations

Operation Purpose Output branches
Play Audio Play audio from binary, file, or HTTP. Interrupted + Completed in blocking mode, Result in background mode
Play Tone Generate daemon-owned tones. Interrupted in infinite blocking tone, otherwise blocking/background branches
Record Audio Record audio to binary, file, or HTTP. Interrupted + Completed in blocking mode, Result in background mode
Stop Media Stop media by mediaId or by leg. Result
Wait Media Wait for a media operation to finish or interrupt. Interrupted, Timeout, Completed
Send DTMF Send DTMF over a live leg. Result

Common Leg Resolution

Most media actions resolve legId in this order:

  1. explicit Options -> Leg ID
  2. item.json.legId
  3. item.json.sipPbx.legId

Stop Media and Wait Media can also resolve mediaId from the current item.

Common Media Options

Option Applies to Description
Leg ID Most media start actions Explicit target leg.
Stop Other Media Playback and recording starts Stop other active media on the same leg before starting this one.
Ducking Factor Playback actions Attenuates lower-priority concurrent playback.
Execution Mode Playback and recording starts Blocking waits for a terminal media event. Background returns immediately.
Interrupt On Play Audio, Play Tone, Record Audio Multi-select interrupt signals. Depending on the action, available values are DTMF, Voice, or Silence.

Operation: Play Audio

Parameters

Parameter Required Shown when Description
Source Type Yes Always Binary, File, or HTTP.
Binary Property Yes Source Type = Binary Item binary property name.
File Path Yes Source Type = File File path on the n8n host.
URL Yes Source Type = HTTP HTTP or HTTPS audio source URL.
HTTP Auth No Source Type = HTTP None, Predefined, or Generic.
Credential Type Yes HTTP Auth = Predefined n8n credential used to sign the HTTP request.
Generic Auth Type Yes HTTP Auth = Generic Generic auth credential used to sign the HTTP request.
Interrupt On No Always Multi-select interrupt signals for playback. Available values: DTMF, Voice.

Options

Option Shown when Description
Leg ID Always Explicit target leg.
HTTP Method Source Type = HTTP GET, POST, or PUT.
HTTP Headers Source Type = HTTP Extra HTTP headers.
Voice Threshold Interrupt On contains Voice Voice activity threshold.
Voice Duration (ms) Interrupt On contains Voice Voice activity duration required to trigger interruption.
Stop Other Media Always Stop other active media on the same leg first.
Ducking Factor Always Concurrent playback ducking control.
Execution Mode Always Blocking or Background.

Output

Branch When used Typical fields
Result Execution Mode = Background mediaId, legId, optional sipPbx.mediaId, optional sipPbx.legId
Interrupted Execution Mode = Blocking mediaId, legId, interruptReason, optional digit
Completed Execution Mode = Blocking mediaId, legId

Operation: Play Tone

Parameters

Parameter Required Shown when Description
Tone Yes Always Built-in preset or Custom.
Custom Tone Yes Tone = Custom Tone pattern syntax <freqs>/<durationMs>,....
Repeat Forever No Always Infinite tone playback.
Interrupt On No Always Multi-select interrupt signals for tone playback. Available values: DTMF, Voice.

Options

Option Shown when Description
Leg ID Always Explicit target leg.
Voice Threshold Interrupt On contains Voice Voice activity threshold.
Voice Duration (ms) Interrupt On contains Voice Voice activity duration required to trigger interruption.
Stop Other Media Always Stop other active media on the same leg first.
Ducking Factor Always Concurrent playback ducking control.
Execution Mode Always Blocking or Background.

Output

Branch When used Typical fields
Result Execution Mode = Background mediaId, legId
Interrupted Execution Mode = Blocking mediaId, legId, interruptReason, optional digit
Completed Execution Mode = Blocking and finite tone mediaId, legId

Operation: Record Audio

Parameters

Parameter Required Shown when Description
Interrupt On No Always Multi-select interrupt signals for recording. Available values: DTMF, Silence.
Max Duration (Seconds) No Always Recording duration cap.
File Format Yes Always WAV, MP3, Opus, or OGG.
Output Type Yes Always Binary, File, or HTTP.
Binary Property Yes Output Type = Binary Item binary property to write into.
File Path Yes Output Type = File Output file path on the n8n host.
URL Yes Output Type = HTTP Upload destination URL.
HTTP Auth No Output Type = HTTP None, Predefined, or Generic.
Credential Type Yes HTTP Auth = Predefined n8n credential used to sign the HTTP request.
Generic Auth Type Yes HTTP Auth = Generic Generic auth credential used to sign the HTTP request.

Options

Option Shown when Description
Leg ID Always Explicit target leg.
HTTP Method Output Type = HTTP POST or PUT.
HTTP Headers Output Type = HTTP Extra HTTP headers.
Silence Threshold Interrupt On contains Silence Silence detection threshold.
Silence Duration (ms) Interrupt On contains Silence Silence duration required to stop recording.
Stop Other Media Always Stop other active media on the same leg first.
Execution Mode Always Blocking or Background.
WAV Sample Rate File Format = WAV WAV output sample rate.
WAV Bit Depth File Format = WAV WAV output bit depth.
Compressed Sample Rate File Format = MP3, Opus, or OGG Output sample rate for compressed formats.
Compressed Bitrate File Format = MP3, Opus, or OGG Output bitrate for compressed formats.

Output

Branch When used Typical fields
Result Execution Mode = Background mediaId, legId
Interrupted Execution Mode = Blocking mediaId, legId, interruptReason, optional digit
Completed Execution Mode = Blocking mediaId, legId, optional durationMs, optional bytesProduced, optional filePath

Operation: Stop Media

Parameters

Parameter Required Description
Target Yes Media ID or Leg ID.
Options -> Media ID Yes when Target = Media ID Explicit media operation to stop.
Options -> Leg ID Yes when Target = Leg ID Stop active media on this leg.

Output

Branch Typical fields
Result mediaId, optional legId

Operation: Wait Media

Parameters

Parameter Required Description
Timeout (Seconds) No Maximum wait time before the action takes the Timeout branch.
Media IDs No Explicit wait target list. If empty, resolves from item.json.mediaId, then item.json.sipPbx.mediaId.

Output

Branch Typical fields
Interrupted mediaId, legId, interruptReason, optional digit
Timeout mediaId, optional legId, eventType = "timeout"
Completed mediaId, legId, optional durationMs, optional bytesProduced, optional filePath

Wait Media and queued DTMF

  • Media waits and blocking media actions use the same shared built-in interruptReason catalog as the other wait actions, but only the media subset relevant to that operation.
  • Wait Media is media-scoped, not leg-scoped.
  • If all watched media operations on a leg are non-interrupting for DTMF, Wait Media consumes queued and live leg DTMF while it waits.
  • This mirrors the behavior of non-interrupting blocking media, where stray digits should not leak through into a later call.wait.
  • If one of the watched media operations is DTMF-interruptible, Wait Media does not drain DTMF for that leg.
  • Explicit Stop Media finalizes the stopped media with interruptReason = "media_stopped".
  • If the underlying leg is destroyed while the media operation is still active, both Wait Media and blocking media actions resolve through Interrupted with interruptReason = "call_ended".
  • If a leg is joined into a bridge by call.bridge, active media on that leg resolves through Interrupted with interruptReason = "call_bridge_joined".

Operation: Send DTMF

Parameters

Parameter Required Description
Digits Yes DTMF string to send.
Options -> Leg ID No Explicit target leg. If omitted, resolves from current item leg metadata.
Options -> Method No Auto, RFC2833, SIP INFO, or Inband.
Options -> Duration (ms) No Per-digit duration.
Options -> Gap (ms) No Gap between digits.

Output

Branch Fields
Result legId, digits

DTMF Notes

Topic Behavior
Inbound methods The runtime accepts inbound DTMF from RFC2833, SIP INFO, and optionally Inband audio-tone detection when allowed by the active SIP route.
Deduplication Repeated RFC2833 retransmits are deduplicated. Short-window transport dedup also suppresses duplicate DTMF arriving from multiple methods such as RFC2833 plus SIP INFO.
Blocking media with Interrupt On Blocking media actions take the Interrupted branch when the selected signal arrives.
Blocking media without Interrupt On = DTMF Queued and live DTMF is consumed while the media waits, so stale digits do not leak into later leg waits.
Explicit Stop Media Wait Media and blocking media on the stopped operation resolve through Interrupted with interruptReason = "media_stopped".
Leg destruction during active media Active playback, tone, recording, and Wait Media complete through Interrupted with interruptReason = "call_ended" even if no user interrupt signal was selected.
Bridge activation during active media Active playback, tone, recording, and Wait Media on that leg complete through Interrupted with interruptReason = "call_bridge_joined".

Clone this wiki locally