Skip to main content

mod_dptools: displace_session


Displace file.

Plays a file or stream to a channel.

Click here to expand Table of Contents


application="displace_session" data="<path> [<flags>] [+time_limit_ms]"


  • path: any sound format FreeSWITCH supports, wav, local_steam, shout etc.
  • flags: mlr
m/mux = mux, so both ends still can hear each other
l = loop, loop forever¹
r = apply on the read side, default to write(Respectively writes the sound to the B-leg instead of the A-leg of a call)

¹The l-flag does not seem to work - use ;loops=-1 instead for a tone_stream - see example below --Peletiah 10:54, 8 March 2011 (UTC)


This part of my dialplan is called on a bind_meta_app/execute_extension statement. It starts recording the session then injects a beep every 15 seconds as required by some state laws. The mux flag makes sure that all the audio is mixed in.

<extension name="record_call">
<condition field="destination_number" expression="^record_call$">
<action application="set" data="rec_session=$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
<action application="record_session" data="${rec_session}" />
<action application="playback" data="tone_stream://L=3;%(100,100,350,440)" />
<action application="displace_session" data="tone_stream://%(100,15000,800);loops=-1 mux" />

See Also