Playing recording external media

From FreeSWITCH Wiki
Jump to: navigation, search

Contents

CLI examples

Play WAV into a conference

freeswitch@host> conference freeswitch play /tmp/foo.wav

Assuming you have a conference named freeswitch configured and at least one party connected.

NOTE: at least when testing w/ a Sipura ATA, foo.wav will have to be: 8kz, 16-bit, 1 channel. Otherwise the audio will sound distorted because the timing will be wrong

Play local MP3 into a conference

freeswitch@host> conference freeswitch play /tmp/foo.mp3

Assuming you have a conference named freeswitch configured and at least one party connected.

NOTE: the MP3 can be encoded at either 8Khz or 44,100khz and will sound correct in both cases.

Broadcast WAV into live call

At the console "show channels" and find the uuid for the call you are interested in

uuid_broadcast <uuid> /path/to/file.wav both

Python examples

Play remote MP3

Create a python script that calls

session.playFile("shout://some.server.com/file.mp3")

NOTE: script not complete, see Mod python for example script this can be plugged into

Dialplan examples

Play wav

  <extension name="wavs">
    <condition field="destination_number" expression="^2009$">
      <action application="playback" data="/path/to/your.wav"/>
    </condition>
  </extension>