Playing recording external media
From FreeSWITCH Wiki
Contents |
[edit]
CLI examples
[edit]
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
[edit]
Play local MP3 into a conference
- Build mod_shout (not built by default)
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.
[edit]
Broadcast WAV into live call
At the console "show channels" and find the uuid for the call you are interested in
broadcast <uuid> /path/to/file.wav both
[edit]
Python examples
[edit]
Play remote MP3
- Build mod_shout (not built by default)
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
[edit]
Dialplan examples
[edit]
Play wav
<extension name="wavs">
<condition field="destination_number" expression="^2009$">
<action application="playback" data="/path/to/your.wav"/>
</condition>
</extension>
